This repository has been archived by the owner on Jan 4, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathconfigure.ac
120 lines (103 loc) · 3.49 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
AC_PREREQ(2.60)
AC_INIT([opensocdebug],
[2016.1],
[opensocdebug],
[http://www.opensocdebug.org])
AC_CONFIG_SRCDIR([src/context.c])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([check-news foreign 1.11 -Wall -Wno-portability silent-rules tar-pax no-dist-gzip dist-xz subdir-objects])
# Library versioning
# http://www.gnu.org/software/libtool/manual/html_node/Updating-version-info.html
# http://sourceware.org/autobook/autobook/autobook_91.html
OSD_CURRENT=2016
OSD_REVISION=1
OSD_AGE=0
LTLDFLAGS="-version-info ${OSD_CURRENT}:${OSD_REVISION}:${OSD_AGE}"
AC_SUBST(LTLDFLAGS)
AC_PROG_CC_STDC
AC_USE_SYSTEM_EXTENSIONS
AC_SYS_LARGEFILE
AC_CONFIG_MACRO_DIR([m4])
AM_SILENT_RULES([yes])
LT_INIT([disable-static pic-only])
AC_PREFIX_DEFAULT([/usr])
AC_PROG_SED
AC_PROG_MKDIR_P
# check for GLIP
PKG_CHECK_MODULES([libglip], [libglip >= 0.1])
AC_SUBST([libglip_CFLAGS])
AC_SUBST([libglip_LIBS])
# check for libreadline
AC_CHECK_LIB([readline], [readline], [
READLINE_LIBS=-lreadline
AC_DEFINE([HAVE_LIBREADLINE], [1], [Define to 1 if you have the `readline' library (-lreadline).])
])
AC_SUBST(READLINE_LIBS)
AC_CHECK_HEADER([readline/readline.h],,AC_MSG_ERROR([Unable to find readline.h. You may need to install the readline development package.]))
# check for libelf
AC_CHECK_LIB([elf], [elf_version], [
LIBELF_LIBS=-lelf
AC_DEFINE([HAVE_LIBELF], [1], [Define to 1 if you have the `elfutils' library (-lelf).])
])
AC_SUBST(LIBELF_LIBS)
AC_CHECK_HEADER([elfutils/version.h],,AC_MSG_ERROR([Unable to find elfutils/version.h. You may need to install the libelf-dev development package.]))
AC_ARG_ENABLE([python-bindings],
AS_HELP_STRING([--enable-python-bindings], [enable python bindings (default n)]),
[enable_python=$enableval],
[enable_python=no])
AM_CONDITIONAL([HAVE_SWIG], [test "$SWIG"])
AS_IF([test "x$enable_python" = "xyes"], [
AC_CHECK_PROG([SWIG], [swig], yes)
AS_IF([test "x$SWIG" != "xyes"],
[AC_MSG_ERROR([Unable to find swig. Needed for python bindings.])])
AM_PATH_PYTHON2([2.5.0])
AC_DEFINE(ENABLE_PYTHON, [1], [Define to use python bindings])
])
AM_CONDITIONAL([ENABLE_PYTHON], [test "x$enable_python" != "xno"])
AM_CFLAGS="-Wall \
-Wmissing-declarations -Wmissing-prototypes \
-Wnested-externs -Wpointer-arith \
-Wsign-compare -Wchar-subscripts \
-Wstrict-prototypes -Wshadow \
-Wformat-security -Wtype-limits \
-fvisibility=hidden \
-ffunction-sections \
-fdata-sections \
-pthread \
${libglip_CFLAGS}"
AC_SUBST([AM_CFLAGS])
AM_LDFLAGS="-Wl,--gc-sections \
-Wl,--as-needed \
-pthread \
-lrt \
${libglip_LIBS}"
AC_SUBST(AM_LDFLAGS)
AC_CONFIG_HEADERS(config.h)
AC_CONFIG_FILES([
Makefile
opensocdebug.pc
src/Makefile
src/tools/Makefile
src/tools/daemon/Makefile
src/tools/osd_term/Makefile
src/tools/cli/Makefile
src/tools/gdbserver/Makefile
src/bindings/Makefile
src/bindings/python/Makefile
src/bindings/python/setup.py
])
AC_OUTPUT
AC_MSG_RESULT([
$PACKAGE $VERSION
=====
prefix: ${prefix}
libdir: ${libdir}
includedir: ${includedir}
datarootdir: ${datarootdir}
datadir: ${datadir}
compiler: ${CC}
cflags: ${CFLAGS}
ldflags: ${LDFLAGS}
python bindings: ${enable_python}
])