blob: 7d8e6dda1fe9340867aff47325ca2bf378be4854 [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)
Holger Hans Peter Freyther47723482011-11-09 11:26:15 +010022# for src/conv.c
23AC_FUNC_ALLOCA
24AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
25AC_SUBST(LIBRARY_DL)
Harald Welte3cae0392010-02-20 21:09:24 +010026
Harald Welte21e73c22011-08-17 19:33:06 +020027AC_PATH_PROG(DOXYGEN,doxygen,false)
28AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
29
Harald Welte3cae0392010-02-20 21:09:24 +010030# The following test is taken from WebKit's webkit.m4
31saved_CFLAGS="$CFLAGS"
32CFLAGS="$CFLAGS -fvisibility=hidden "
33AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020034AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010035 [ AC_MSG_RESULT([yes])
36 SYMBOL_VISIBILITY="-fvisibility=hidden"],
37 AC_MSG_RESULT([no]))
38CFLAGS="$saved_CFLAGS"
39AC_SUBST(SYMBOL_VISIBILITY)
40
41dnl Generate the output
42AM_CONFIG_HEADER(config.h)
43
Harald Weltecbb29f72010-03-07 20:24:30 +010044AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020045 [AS_HELP_STRING(
46 [--disable-talloc],
47 [Disable building talloc memory allocator]
48 )],
job36b4a202011-08-21 17:18:23 +020049 [enable_talloc=$enableval], [enable_talloc="yes"])
50AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
Harald Weltecbb29f72010-03-07 20:24:30 +010051
Harald Welteb9ce51c2010-06-30 19:43:11 +020052AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020053 [AS_HELP_STRING(
54 [--disable-plugin],
55 [Disable support for dlopen plugins],
56 )],
job36b4a202011-08-21 17:18:23 +020057 [enable_plugin=$enableval], [enable_plugin="yes"])
58AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +020059
Harald Weltef8b2ba72010-03-07 20:33:59 +010060AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020061 [AS_HELP_STRING(
62 [--disable-tests],
63 [Disable building test programs]
64 )],
job36b4a202011-08-21 17:18:23 +020065 [enable_tests=$enableval], [enable_tests="yes"])
66AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
Harald Weltef8b2ba72010-03-07 20:33:59 +010067
Harald Welte1067e8c2010-06-25 03:00:58 +020068AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020069 [AS_HELP_STRING(
70 [--disable-vty],
71 [Disable building VTY telnet interface]
72 )],
job36b4a202011-08-21 17:18:23 +020073 [enable_vty=$enableval], [enable_vty="yes"])
74AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +020075
Sylvain Munautac3e61a2010-07-25 18:08:54 +020076AC_ARG_ENABLE(panic_infloop,
77 [AS_HELP_STRING(
78 [--enable-panic-infloop],
79 [Trigger infinite loop on panic rather than fprintf/abort]
80 )],
job36b4a202011-08-21 17:18:23 +020081 [panic_infloop=$enableval], [panic_infloop="no"])
82if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +020083then
84 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
85fi
86
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080087AC_ARG_ENABLE(bsc_fd_check,
88 [AS_HELP_STRING(
89 [--enable-bsc-fd-check],
90 [Instrument bsc_register_fd to check that the fd is registered]
91 )],
job36b4a202011-08-21 17:18:23 +020092 [fd_check=$enableval], [fd_check="no"])
93if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080094then
95 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
96fi
97
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080098AC_ARG_ENABLE(msgfile,
99 [AS_HELP_STRING(
100 [--disable-msgfile],
101 [Disable support for the msgfile],
102 )],
job36b4a202011-08-21 17:18:23 +0200103 [enable_msgfile=$enableval], [enable_msgfile="yes"])
104AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800105
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200106AC_ARG_ENABLE(serial,
107 [AS_HELP_STRING(
108 [--disable-serial],
109 [Disable support for the serial helpers],
110 )],
111 [enable_serial=$enableval], [enable_serial="yes"])
112AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
113
job8e4deb62011-08-21 17:18:24 +0200114AC_ARG_ENABLE(utilities,
115 [AS_HELP_STRING(
116 [--disable-utilities],
117 [Disable building utility programs],
118 )],
119 [enable_utilities=$enableval], [enable_utilities="yes"])
120AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
121
122AC_ARG_ENABLE(embedded,
123 [AS_HELP_STRING(
124 [--enable-embedded],
125 [Enable building for embedded use and disable unsupported features]
126 )],
127 [embedded=$enableval], [embedded="no"])
128if test x"$embedded" = x"yes"
129then
130 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
131 AM_CONDITIONAL(ENABLE_TESTS, false)
132 AM_CONDITIONAL(ENABLE_PLUGIN, false)
133 AM_CONDITIONAL(ENABLE_MSGFILE, false)
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200134 AM_CONDITIONAL(ENABLE_SERIAL, false)
job8e4deb62011-08-21 17:18:24 +0200135 AM_CONDITIONAL(ENABLE_VTY, false)
136 AM_CONDITIONAL(ENABLE_TALLOC, false)
137 AM_CONDITIONAL(ENABLE_UTILITIES, false)
138 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
139fi
Harald Welte54403772010-05-29 11:49:51 +0200140
Harald Welte3cae0392010-02-20 21:09:24 +0100141AC_OUTPUT(
142 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200143 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200144 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100145 libosmogsm.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200146 include/osmocom/Makefile
147 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200148 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200149 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100150 include/osmocom/gsm/Makefile
151 include/osmocom/gsm/protocol/Makefile
152 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100153 include/Makefile
154 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200155 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200156 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100157 src/gsm/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100158 tests/Makefile
159 tests/timer/Makefile
160 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800161 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200162 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100163 tests/smscb/Makefile
Harald Welte712691d2011-09-01 14:47:31 +0200164 tests/bits/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200165 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200166 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200167 Doxyfile.gsm
168 Doxyfile.vty
169 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100170 Makefile)