blob: 0fea115f2d2b23e9c9bf6eb5c44e6c28fb43fa65 [file] [log] [blame]
Harald Welte4cd3d8a2010-03-23 00:30:19 +08001AC_INIT([libosmocore],
2 m4_esyscmd([./git-version-gen .tarball-version]),
Holger Hans Peter Freyther8db70202012-03-26 16:34:37 +02003 [openbsc@lists.osmocom.org])
Harald Welte3cae0392010-02-20 21:09:24 +01004
Harald Welte4cd3d8a2010-03-23 00:30:19 +08005AM_INIT_AUTOMAKE([dist-bzip2])
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +01006AC_CONFIG_TESTDIR(tests)
Harald Welte3cae0392010-02-20 21:09:24 +01007
8dnl kernel style compile messages
9m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10
11dnl checks for programs
12AC_PROG_MAKE_SET
13AC_PROG_CC
14AC_PROG_INSTALL
Harald Welte4cd3d8a2010-03-23 00:30:19 +080015LT_INIT
Harald Welte3cae0392010-02-20 21:09:24 +010016AC_PROG_LIBTOOL
17
Harald Welte4cd3d8a2010-03-23 00:30:19 +080018AC_CONFIG_MACRO_DIR([m4])
19
Harald Welte3cae0392010-02-20 21:09:24 +010020dnl checks for header files
21AC_HEADER_STDC
Harald Weltee4764422011-05-22 12:25:57 +020022AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
Holger Hans Peter Freyther47723482011-11-09 11:26:15 +010023# for src/conv.c
24AC_FUNC_ALLOCA
25AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
26AC_SUBST(LIBRARY_DL)
Harald Welte3cae0392010-02-20 21:09:24 +010027
Harald Welte21e73c22011-08-17 19:33:06 +020028AC_PATH_PROG(DOXYGEN,doxygen,false)
29AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
30
Harald Welte3cae0392010-02-20 21:09:24 +010031# The following test is taken from WebKit's webkit.m4
32saved_CFLAGS="$CFLAGS"
33CFLAGS="$CFLAGS -fvisibility=hidden "
34AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020035AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010036 [ AC_MSG_RESULT([yes])
37 SYMBOL_VISIBILITY="-fvisibility=hidden"],
38 AC_MSG_RESULT([no]))
39CFLAGS="$saved_CFLAGS"
40AC_SUBST(SYMBOL_VISIBILITY)
41
42dnl Generate the output
43AM_CONFIG_HEADER(config.h)
44
Harald Weltecbb29f72010-03-07 20:24:30 +010045AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020046 [AS_HELP_STRING(
47 [--disable-talloc],
48 [Disable building talloc memory allocator]
49 )],
job36b4a202011-08-21 17:18:23 +020050 [enable_talloc=$enableval], [enable_talloc="yes"])
51AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
Harald Weltecbb29f72010-03-07 20:24:30 +010052
Harald Welteb9ce51c2010-06-30 19:43:11 +020053AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020054 [AS_HELP_STRING(
55 [--disable-plugin],
56 [Disable support for dlopen plugins],
57 )],
job36b4a202011-08-21 17:18:23 +020058 [enable_plugin=$enableval], [enable_plugin="yes"])
59AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +020060
Harald Weltef8b2ba72010-03-07 20:33:59 +010061AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020062 [AS_HELP_STRING(
63 [--disable-tests],
64 [Disable building test programs]
65 )],
job36b4a202011-08-21 17:18:23 +020066 [enable_tests=$enableval], [enable_tests="yes"])
67AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
Harald Weltef8b2ba72010-03-07 20:33:59 +010068
Harald Welte1067e8c2010-06-25 03:00:58 +020069AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020070 [AS_HELP_STRING(
71 [--disable-vty],
72 [Disable building VTY telnet interface]
73 )],
job36b4a202011-08-21 17:18:23 +020074 [enable_vty=$enableval], [enable_vty="yes"])
75AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +020076
Sylvain Munautac3e61a2010-07-25 18:08:54 +020077AC_ARG_ENABLE(panic_infloop,
78 [AS_HELP_STRING(
79 [--enable-panic-infloop],
80 [Trigger infinite loop on panic rather than fprintf/abort]
81 )],
job36b4a202011-08-21 17:18:23 +020082 [panic_infloop=$enableval], [panic_infloop="no"])
83if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +020084then
85 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
86fi
87
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080088AC_ARG_ENABLE(bsc_fd_check,
89 [AS_HELP_STRING(
90 [--enable-bsc-fd-check],
91 [Instrument bsc_register_fd to check that the fd is registered]
92 )],
job36b4a202011-08-21 17:18:23 +020093 [fd_check=$enableval], [fd_check="no"])
94if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080095then
96 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
97fi
98
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080099AC_ARG_ENABLE(msgfile,
100 [AS_HELP_STRING(
101 [--disable-msgfile],
102 [Disable support for the msgfile],
103 )],
job36b4a202011-08-21 17:18:23 +0200104 [enable_msgfile=$enableval], [enable_msgfile="yes"])
105AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800106
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200107AC_ARG_ENABLE(serial,
108 [AS_HELP_STRING(
109 [--disable-serial],
110 [Disable support for the serial helpers],
111 )],
112 [enable_serial=$enableval], [enable_serial="yes"])
113AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
114
job8e4deb62011-08-21 17:18:24 +0200115AC_ARG_ENABLE(utilities,
116 [AS_HELP_STRING(
117 [--disable-utilities],
118 [Disable building utility programs],
119 )],
120 [enable_utilities=$enableval], [enable_utilities="yes"])
121AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
122
123AC_ARG_ENABLE(embedded,
124 [AS_HELP_STRING(
125 [--enable-embedded],
126 [Enable building for embedded use and disable unsupported features]
127 )],
128 [embedded=$enableval], [embedded="no"])
129if test x"$embedded" = x"yes"
130then
131 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
132 AM_CONDITIONAL(ENABLE_TESTS, false)
133 AM_CONDITIONAL(ENABLE_PLUGIN, false)
134 AM_CONDITIONAL(ENABLE_MSGFILE, false)
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200135 AM_CONDITIONAL(ENABLE_SERIAL, false)
job8e4deb62011-08-21 17:18:24 +0200136 AM_CONDITIONAL(ENABLE_VTY, false)
137 AM_CONDITIONAL(ENABLE_TALLOC, false)
138 AM_CONDITIONAL(ENABLE_UTILITIES, false)
139 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
140fi
Harald Welte54403772010-05-29 11:49:51 +0200141
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +0100142
Harald Welte3cae0392010-02-20 21:09:24 +0100143AC_OUTPUT(
144 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200145 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200146 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100147 libosmogsm.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200148 include/osmocom/Makefile
149 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200150 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200151 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100152 include/osmocom/gsm/Makefile
153 include/osmocom/gsm/protocol/Makefile
154 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100155 include/Makefile
156 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200157 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200158 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100159 src/gsm/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100160 tests/Makefile
161 tests/timer/Makefile
162 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800163 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200164 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100165 tests/smscb/Makefile
Harald Welte712691d2011-09-01 14:47:31 +0200166 tests/bits/Makefile
Sylvain Munaut810c3342011-11-17 20:33:19 +0100167 tests/a5/Makefile
Harald Weltee076ac02011-12-07 00:10:18 +0100168 tests/auth/Makefile
Sylvain Munaut29eb92d2011-11-24 17:48:42 +0100169 tests/conv/Makefile
Holger Hans Peter Freyther72bd4eb2011-12-11 20:25:12 +0100170 tests/lapd/Makefile
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +0100171 tests/gsm0808/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200172 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200173 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200174 Doxyfile.gsm
175 Doxyfile.vty
176 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100177 Makefile)