blob: 484a7ddfdc4aff59f0e943f8b251138338b8e21f [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
Harald Welte1c72bfb2012-04-04 22:05:24 +020017CHECK_GCC_FVISIBILITY
Harald Welte3cae0392010-02-20 21:09:24 +010018
Harald Welte4cd3d8a2010-03-23 00:30:19 +080019AC_CONFIG_MACRO_DIR([m4])
20
Harald Welte3cae0392010-02-20 21:09:24 +010021dnl checks for header files
22AC_HEADER_STDC
Harald Weltee4764422011-05-22 12:25:57 +020023AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
Holger Hans Peter Freyther47723482011-11-09 11:26:15 +010024# for src/conv.c
25AC_FUNC_ALLOCA
26AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
27AC_SUBST(LIBRARY_DL)
Harald Welte3cae0392010-02-20 21:09:24 +010028
Harald Welte21e73c22011-08-17 19:33:06 +020029AC_PATH_PROG(DOXYGEN,doxygen,false)
30AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
31
Harald Welte3cae0392010-02-20 21:09:24 +010032# The following test is taken from WebKit's webkit.m4
33saved_CFLAGS="$CFLAGS"
34CFLAGS="$CFLAGS -fvisibility=hidden "
35AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020036AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010037 [ AC_MSG_RESULT([yes])
38 SYMBOL_VISIBILITY="-fvisibility=hidden"],
39 AC_MSG_RESULT([no]))
40CFLAGS="$saved_CFLAGS"
41AC_SUBST(SYMBOL_VISIBILITY)
42
43dnl Generate the output
44AM_CONFIG_HEADER(config.h)
45
Harald Weltecbb29f72010-03-07 20:24:30 +010046AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020047 [AS_HELP_STRING(
48 [--disable-talloc],
49 [Disable building talloc memory allocator]
50 )],
job36b4a202011-08-21 17:18:23 +020051 [enable_talloc=$enableval], [enable_talloc="yes"])
52AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
Harald Weltecbb29f72010-03-07 20:24:30 +010053
Harald Welteb9ce51c2010-06-30 19:43:11 +020054AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020055 [AS_HELP_STRING(
56 [--disable-plugin],
57 [Disable support for dlopen plugins],
58 )],
job36b4a202011-08-21 17:18:23 +020059 [enable_plugin=$enableval], [enable_plugin="yes"])
60AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
Harald Welteb9ce51c2010-06-30 19:43:11 +020061
Harald Weltef8b2ba72010-03-07 20:33:59 +010062AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020063 [AS_HELP_STRING(
64 [--disable-tests],
65 [Disable building test programs]
66 )],
job36b4a202011-08-21 17:18:23 +020067 [enable_tests=$enableval], [enable_tests="yes"])
68AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
Harald Weltef8b2ba72010-03-07 20:33:59 +010069
Harald Welte1067e8c2010-06-25 03:00:58 +020070AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020071 [AS_HELP_STRING(
72 [--disable-vty],
73 [Disable building VTY telnet interface]
74 )],
job36b4a202011-08-21 17:18:23 +020075 [enable_vty=$enableval], [enable_vty="yes"])
76AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
Harald Welte54403772010-05-29 11:49:51 +020077
Sylvain Munautac3e61a2010-07-25 18:08:54 +020078AC_ARG_ENABLE(panic_infloop,
79 [AS_HELP_STRING(
80 [--enable-panic-infloop],
81 [Trigger infinite loop on panic rather than fprintf/abort]
82 )],
job36b4a202011-08-21 17:18:23 +020083 [panic_infloop=$enableval], [panic_infloop="no"])
84if test x"$panic_infloop" = x"yes"
Sylvain Munautac3e61a2010-07-25 18:08:54 +020085then
86 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
87fi
88
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080089AC_ARG_ENABLE(bsc_fd_check,
90 [AS_HELP_STRING(
91 [--enable-bsc-fd-check],
92 [Instrument bsc_register_fd to check that the fd is registered]
93 )],
job36b4a202011-08-21 17:18:23 +020094 [fd_check=$enableval], [fd_check="no"])
95if test x"$fd_check" = x"no"
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080096then
97 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
98fi
99
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800100AC_ARG_ENABLE(msgfile,
101 [AS_HELP_STRING(
102 [--disable-msgfile],
103 [Disable support for the msgfile],
104 )],
job36b4a202011-08-21 17:18:23 +0200105 [enable_msgfile=$enableval], [enable_msgfile="yes"])
106AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800107
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200108AC_ARG_ENABLE(serial,
109 [AS_HELP_STRING(
110 [--disable-serial],
111 [Disable support for the serial helpers],
112 )],
113 [enable_serial=$enableval], [enable_serial="yes"])
114AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
115
job8e4deb62011-08-21 17:18:24 +0200116AC_ARG_ENABLE(utilities,
117 [AS_HELP_STRING(
118 [--disable-utilities],
119 [Disable building utility programs],
120 )],
121 [enable_utilities=$enableval], [enable_utilities="yes"])
122AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
123
124AC_ARG_ENABLE(embedded,
125 [AS_HELP_STRING(
126 [--enable-embedded],
127 [Enable building for embedded use and disable unsupported features]
128 )],
129 [embedded=$enableval], [embedded="no"])
130if test x"$embedded" = x"yes"
131then
132 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
133 AM_CONDITIONAL(ENABLE_TESTS, false)
134 AM_CONDITIONAL(ENABLE_PLUGIN, false)
135 AM_CONDITIONAL(ENABLE_MSGFILE, false)
Sylvain Munautfe28ded2011-09-02 22:18:24 +0200136 AM_CONDITIONAL(ENABLE_SERIAL, false)
job8e4deb62011-08-21 17:18:24 +0200137 AM_CONDITIONAL(ENABLE_VTY, false)
138 AM_CONDITIONAL(ENABLE_TALLOC, false)
139 AM_CONDITIONAL(ENABLE_UTILITIES, false)
140 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
141fi
Harald Welte54403772010-05-29 11:49:51 +0200142
Holger Hans Peter Freytherf9eda742011-11-13 01:02:54 +0100143
Harald Welte3cae0392010-02-20 21:09:24 +0100144AC_OUTPUT(
145 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200146 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200147 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100148 libosmogsm.pc
Harald Welte641f7ce2012-06-17 23:05:26 +0800149 libosmogb.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200150 include/osmocom/Makefile
151 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200152 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200153 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100154 include/osmocom/gsm/Makefile
155 include/osmocom/gsm/protocol/Makefile
Harald Welte641f7ce2012-06-17 23:05:26 +0800156 include/osmocom/gprs/Makefile
157 include/osmocom/gprs/protocol/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100158 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100159 include/Makefile
160 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200161 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200162 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100163 src/gsm/Makefile
Harald Welte641f7ce2012-06-17 23:05:26 +0800164 src/gb/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100165 tests/Makefile
166 tests/timer/Makefile
167 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800168 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200169 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100170 tests/smscb/Makefile
Harald Welte712691d2011-09-01 14:47:31 +0200171 tests/bits/Makefile
Sylvain Munaut810c3342011-11-17 20:33:19 +0100172 tests/a5/Makefile
Harald Weltee076ac02011-12-07 00:10:18 +0100173 tests/auth/Makefile
Sylvain Munaut29eb92d2011-11-24 17:48:42 +0100174 tests/conv/Makefile
Holger Hans Peter Freyther72bd4eb2011-12-11 20:25:12 +0100175 tests/lapd/Makefile
Holger Hans Peter Freyther97510812012-01-22 13:36:52 +0100176 tests/gsm0808/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200177 utils/Makefile
Harald Weltec7859ed2011-08-20 12:54:17 +0200178 Doxyfile.core
Harald Welte49e10562011-08-17 19:21:07 +0200179 Doxyfile.gsm
180 Doxyfile.vty
181 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100182 Makefile)