blob: b923a218f4e7598f5fcb800a2895df9773d1b45f [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
23# The following test is taken from WebKit's webkit.m4
24saved_CFLAGS="$CFLAGS"
25CFLAGS="$CFLAGS -fvisibility=hidden "
26AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
Alexander Huemer3d79f532011-05-24 15:16:13 +020027AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
Harald Welte3cae0392010-02-20 21:09:24 +010028 [ AC_MSG_RESULT([yes])
29 SYMBOL_VISIBILITY="-fvisibility=hidden"],
30 AC_MSG_RESULT([no]))
31CFLAGS="$saved_CFLAGS"
32AC_SUBST(SYMBOL_VISIBILITY)
33
34dnl Generate the output
35AM_CONFIG_HEADER(config.h)
36
Harald Weltecbb29f72010-03-07 20:24:30 +010037AC_ARG_ENABLE(talloc,
Sylvain Munautf23abab2010-07-25 16:16:42 +020038 [AS_HELP_STRING(
39 [--disable-talloc],
40 [Disable building talloc memory allocator]
41 )],
Harald Weltecbb29f72010-03-07 20:24:30 +010042 [enable_talloc=0], [enable_talloc=1])
Harald Weltecbb29f72010-03-07 20:24:30 +010043AM_CONDITIONAL(ENABLE_TALLOC, test "x$enable_talloc" = "x1")
44
Harald Welteb9ce51c2010-06-30 19:43:11 +020045AC_ARG_ENABLE(plugin,
Sylvain Munautf23abab2010-07-25 16:16:42 +020046 [AS_HELP_STRING(
47 [--disable-plugin],
48 [Disable support for dlopen plugins],
49 )],
Harald Welteb9ce51c2010-06-30 19:43:11 +020050 [enable_plugin=0], [enable_plugin=1])
51AM_CONDITIONAL(ENABLE_PLUGIN, test "x$enable_plugin" = "x1")
52
Harald Weltef8b2ba72010-03-07 20:33:59 +010053AC_ARG_ENABLE(tests,
Sylvain Munautf23abab2010-07-25 16:16:42 +020054 [AS_HELP_STRING(
55 [--disable-tests],
56 [Disable building test programs]
57 )],
Harald Weltef8b2ba72010-03-07 20:33:59 +010058 [enable_tests=0], [enable_tests=1])
59AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "x1")
60
Harald Welte1067e8c2010-06-25 03:00:58 +020061AC_ARG_ENABLE(vty,
Sylvain Munautf23abab2010-07-25 16:16:42 +020062 [AS_HELP_STRING(
63 [--disable-vty],
64 [Disable building VTY telnet interface]
65 )],
Harald Welte54403772010-05-29 11:49:51 +020066 [enable_vty=0], [enable_vty=1])
67AM_CONDITIONAL(ENABLE_VTY, test "x$enable_vty" = "x1")
68
Sylvain Munautac3e61a2010-07-25 18:08:54 +020069AC_ARG_ENABLE(panic_infloop,
70 [AS_HELP_STRING(
71 [--enable-panic-infloop],
72 [Trigger infinite loop on panic rather than fprintf/abort]
73 )],
74 [panic_infloop=1], [panic_infloop=0])
75if test "x$panic_infloop" = "x1"
76then
77 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
78fi
79
Holger Hans Peter Freyther43558312010-08-06 06:48:43 +080080AC_ARG_ENABLE(bsc_fd_check,
81 [AS_HELP_STRING(
82 [--enable-bsc-fd-check],
83 [Instrument bsc_register_fd to check that the fd is registered]
84 )],
85 [fd_check=1], [fd_check=0])
86if test "x$fd_check" = "x1"
87then
88 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
89fi
90
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +080091AC_ARG_ENABLE(msgfile,
92 [AS_HELP_STRING(
93 [--disable-msgfile],
94 [Disable support for the msgfile],
95 )],
96 [enable_msgfile=0], [enable_msgfile=1])
97AM_CONDITIONAL(ENABLE_MSGFILE, test "x$enable_msgfile" = "x1")
98
Harald Welte54403772010-05-29 11:49:51 +020099
Harald Welte3cae0392010-02-20 21:09:24 +0100100AC_OUTPUT(
101 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200102 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200103 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100104 libosmogsm.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200105 include/osmocom/Makefile
106 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200107 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200108 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100109 include/osmocom/gsm/Makefile
110 include/osmocom/gsm/protocol/Makefile
111 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100112 include/Makefile
113 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200114 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200115 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100116 src/gsm/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100117 tests/Makefile
118 tests/timer/Makefile
119 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800120 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200121 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100122 tests/smscb/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100123 Makefile)