blob: a77e3e89ecff3ba6b1fa7f0f2c0871fcd8176481 [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 )],
Harald Weltecbb29f72010-03-07 20:24:30 +010045 [enable_talloc=0], [enable_talloc=1])
Harald Weltecbb29f72010-03-07 20:24:30 +010046AM_CONDITIONAL(ENABLE_TALLOC, test "x$enable_talloc" = "x1")
47
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 )],
Harald Welteb9ce51c2010-06-30 19:43:11 +020053 [enable_plugin=0], [enable_plugin=1])
54AM_CONDITIONAL(ENABLE_PLUGIN, test "x$enable_plugin" = "x1")
55
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 )],
Harald Weltef8b2ba72010-03-07 20:33:59 +010061 [enable_tests=0], [enable_tests=1])
62AM_CONDITIONAL(ENABLE_TESTS, test "x$enable_tests" = "x1")
63
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 )],
Harald Welte54403772010-05-29 11:49:51 +020069 [enable_vty=0], [enable_vty=1])
70AM_CONDITIONAL(ENABLE_VTY, test "x$enable_vty" = "x1")
71
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 )],
77 [panic_infloop=1], [panic_infloop=0])
78if test "x$panic_infloop" = "x1"
79then
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 )],
88 [fd_check=1], [fd_check=0])
89if test "x$fd_check" = "x1"
90then
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 )],
99 [enable_msgfile=0], [enable_msgfile=1])
100AM_CONDITIONAL(ENABLE_MSGFILE, test "x$enable_msgfile" = "x1")
101
Harald Welte54403772010-05-29 11:49:51 +0200102
Harald Welte3cae0392010-02-20 21:09:24 +0100103AC_OUTPUT(
104 libosmocore.pc
Sylvain Munautb99b9302010-10-24 18:23:10 +0200105 libosmocodec.pc
Harald Weltee352c522010-05-19 19:42:32 +0200106 libosmovty.pc
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100107 libosmogsm.pc
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200108 include/osmocom/Makefile
109 include/osmocom/vty/Makefile
Sylvain Munautb99b9302010-10-24 18:23:10 +0200110 include/osmocom/codec/Makefile
Harald Welteb9ce51c2010-06-30 19:43:11 +0200111 include/osmocom/crypt/Makefile
Pablo Neira Ayuso83419342011-03-22 16:36:13 +0100112 include/osmocom/gsm/Makefile
113 include/osmocom/gsm/protocol/Makefile
114 include/osmocom/core/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100115 include/Makefile
116 src/Makefile
Harald Welte3fb0b6f2010-05-19 19:02:52 +0200117 src/vty/Makefile
Sylvain Munaut1a4ea5b2010-10-08 15:09:16 +0200118 src/codec/Makefile
Pablo Neira Ayusofba495e2011-03-23 18:08:08 +0100119 src/gsm/Makefile
Harald Welte3cae0392010-02-20 21:09:24 +0100120 tests/Makefile
121 tests/timer/Makefile
122 tests/sms/Makefile
Holger Hans Peter Freytherc87f2662010-10-07 00:00:15 +0800123 tests/msgfile/Makefile
Holger Hans Peter Freytherdaa653f2010-10-11 07:56:06 +0200124 tests/ussd/Makefile
Holger Hans Peter Freythere05c7df2010-12-29 11:57:48 +0100125 tests/smscb/Makefile
Harald Welteeeb78dd2011-08-02 13:44:54 +0200126 utils/Makefile
Harald Welte49e10562011-08-17 19:21:07 +0200127 Doxyfile
128 Doxyfile.gsm
129 Doxyfile.vty
130 Doxyfile.codec
Harald Welte3cae0392010-02-20 21:09:24 +0100131 Makefile)