blob: ae811e1a2c3b1f095f1927c5e81ec980aca55b24 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001AC_INIT([libosmocore],
2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [openbsc-devel@lists.openbsc.org])
Harald Welte3cae0392010-02-20 21:09:24 +01004
Harald Welte4cd3d8a2010-03-23 00:30:19 +08005AM_INIT_AUTOMAKE([dist-bzip2])
Harald Welte3cae0392010-02-20 21:09:24 +01006
7dnl kernel style compile messages
8m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
9
10dnl checks for programs
11AC_PROG_MAKE_SET
12AC_PROG_CC
13AC_PROG_INSTALL
Harald Welte4cd3d8a2010-03-23 00:30:19 +080014LT_INIT
Harald Welte3cae0392010-02-20 21:09:24 +010015AC_PROG_LIBTOOL
16
Harald Welte4cd3d8a2010-03-23 00:30:19 +080017AC_CONFIG_MACRO_DIR([m4])
18
Harald Welte3cae0392010-02-20 21:09:24 +010019dnl checks for header files
20AC_HEADER_STDC
Harald Weltee4764422011-05-22 12:25:57 +020021AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
Harald Welte3cae0392010-02-20 21:09:24 +010022
Harald Welte21e73c22011-08-17 19:33:06 +020023AC_PATH_PROG(DOXYGEN,doxygen,false)
24AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
25
Harald Welte3cae0392010-02-20 21:09:24 +010026# The following test is taken from WebKit's webkit.m4
27saved_CFLAGS="$CFLAGS"
28CFLAGS="$CFLAGS -fvisibility=hidden "
29AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020030AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010031 [ AC_MSG_RESULT([yes])
32 SYMBOL_VISIBILITY="-fvisibility=hidden"],
33 AC_MSG_RESULT([no]))
34CFLAGS="$saved_CFLAGS"
35AC_SUBST(SYMBOL_VISIBILITY)
36
37dnl Generate the output
38AM_CONFIG_HEADER(config.h)
39
Harald Weltecbb29f72010-03-07 20:24:30 +010040AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020041 [AS_HELP_STRING(
42 [--disable-talloc],
43 [Disable building talloc memory allocator]
44 )],
job36b4a202011-08-21 17:18:23 +020045 [enable_talloc=$enableval], [enable_talloc="yes"])
46AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
Harald Weltecbb29f72010-03-07 20:24:30 +010047
Harald Welteb9ce51c2010-06-30 19:43:11 +020048AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020049 [AS_HELP_STRING(
50 [--disable-plugin],
51 [Disable support for dlopen plugins],
52 )],
job36b4a202011-08-21 17:18:23 +020053 [enable_plugin=$enableval], [enable_plugin="yes"])
54AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +020055
Harald Weltef8b2ba72010-03-07 20:33:59 +010056AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020057 [AS_HELP_STRING(
58 [--disable-tests],
59 [Disable building test programs]
60 )],
job36b4a202011-08-21 17:18:23 +020061 [enable_tests=$enableval], [enable_tests="yes"])
62AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
Harald Weltef8b2ba72010-03-07 20:33:59 +010063
Harald Welte1067e8c2010-06-25 03:00:58 +020064AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020065 [AS_HELP_STRING(
66 [--disable-vty],
67 [Disable building VTY telnet interface]
68 )],
job36b4a202011-08-21 17:18:23 +020069 [enable_vty=$enableval], [enable_vty="yes"])
70AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +020071
Sylvain Munautac3e61a2010-07-25 18:08:54 +020072AC_ARG_ENABLE(panic_infloop,
73 [AS_HELP_STRING(
74 [--enable-panic-infloop],
75 [Trigger infinite loop on panic rather than fprintf/abort]
76 )],
job36b4a202011-08-21 17:18:23 +020077 [panic_infloop=$enableval], [panic_infloop="no"])
78if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +020079then
80 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
81fi
82
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080083AC_ARG_ENABLE(bsc_fd_check,
84 [AS_HELP_STRING(
85 [--enable-bsc-fd-check],
86 [Instrument bsc_register_fd to check that the fd is registered]
87 )],
job36b4a202011-08-21 17:18:23 +020088 [fd_check=$enableval], [fd_check="no"])
89if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080090then
91 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
92fi
93
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080094AC_ARG_ENABLE(msgfile,
95 [AS_HELP_STRING(
96 [--disable-msgfile],
97 [Disable support for the msgfile],
98 )],
job36b4a202011-08-21 17:18:23 +020099 [enable_msgfile=$enableval], [enable_msgfile="yes"])
100AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800101
job8e4deb62011-08-21 17:18:24 +0200102AC_ARG_ENABLE(utilities,
103 [AS_HELP_STRING(
104 [--disable-utilities],
105 [Disable building utility programs],
106 )],
107 [enable_utilities=$enableval], [enable_utilities="yes"])
108AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
109
110AC_ARG_ENABLE(embedded,
111 [AS_HELP_STRING(
112 [--enable-embedded],
113 [Enable building for embedded use and disable unsupported features]
114 )],
115 [embedded=$enableval], [embedded="no"])
116if test x"$embedded" = x"yes"
117then
118 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
119 AM_CONDITIONAL(ENABLE_TESTS, false)
120 AM_CONDITIONAL(ENABLE_PLUGIN, false)
121 AM_CONDITIONAL(ENABLE_MSGFILE, false)
122 AM_CONDITIONAL(ENABLE_VTY, false)
123 AM_CONDITIONAL(ENABLE_TALLOC, false)
124 AM_CONDITIONAL(ENABLE_UTILITIES, false)
125 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
126fi
Harald Welte54403772010-05-29 11:49:51 +0200127
Harald Welte3cae0392010-02-20 21:09:24 +0100128AC_OUTPUT(
129 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200130 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200131 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100132 libosmogsm.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200133 include/osmocom/Makefile
134 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200135 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200136 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100137 include/osmocom/gsm/Makefile
138 include/osmocom/gsm/protocol/Makefile
139 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100140 include/Makefile
141 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200142 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200143 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100144 src/gsm/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100145 tests/Makefile
146 tests/timer/Makefile
147 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800148 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200149 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100150 tests/smscb/Makefile
Harald Welte712691d2011-09-01 14:47:31 +0200151 tests/bits/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200152 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200153 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200154 Doxyfile.gsm
155 Doxyfile.vty
156 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100157 Makefile)