Harald Welte | 4cd3d8a | 2010-03-23 00:30:19 +0800 | [diff] [blame] | 1 | AC_INIT([libosmocore], |
| 2 | m4_esyscmd([./git-version-gen .tarball-version]), |
Holger Hans Peter Freyther | 8db7020 | 2012-03-26 16:34:37 +0200 | [diff] [blame] | 3 | [openbsc@lists.osmocom.org]) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 4 | |
Harald Welte | 4cd3d8a | 2010-03-23 00:30:19 +0800 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE([dist-bzip2]) |
Holger Hans Peter Freyther | f9eda74 | 2011-11-13 01:02:54 +0100 | [diff] [blame] | 6 | AC_CONFIG_TESTDIR(tests) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 7 | |
| 8 | dnl kernel style compile messages |
| 9 | m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])]) |
| 10 | |
| 11 | dnl checks for programs |
| 12 | AC_PROG_MAKE_SET |
| 13 | AC_PROG_CC |
| 14 | AC_PROG_INSTALL |
Harald Welte | 4cd3d8a | 2010-03-23 00:30:19 +0800 | [diff] [blame] | 15 | LT_INIT |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 16 | AC_PROG_LIBTOOL |
Harald Welte | 1c72bfb | 2012-04-04 22:05:24 +0200 | [diff] [blame] | 17 | CHECK_GCC_FVISIBILITY |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 18 | |
Harald Welte | 4cd3d8a | 2010-03-23 00:30:19 +0800 | [diff] [blame] | 19 | AC_CONFIG_MACRO_DIR([m4]) |
| 20 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 21 | dnl checks for header files |
| 22 | AC_HEADER_STDC |
Harald Welte | e476442 | 2011-05-22 12:25:57 +0200 | [diff] [blame] | 23 | AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h) |
Holger Hans Peter Freyther | 4772348 | 2011-11-09 11:26:15 +0100 | [diff] [blame] | 24 | # for src/conv.c |
| 25 | AC_FUNC_ALLOCA |
| 26 | AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""]) |
| 27 | AC_SUBST(LIBRARY_DL) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 28 | |
Harald Welte | 21e73c2 | 2011-08-17 19:33:06 +0200 | [diff] [blame] | 29 | AC_PATH_PROG(DOXYGEN,doxygen,false) |
| 30 | AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) |
| 31 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 32 | # The following test is taken from WebKit's webkit.m4 |
| 33 | saved_CFLAGS="$CFLAGS" |
| 34 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 35 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | 3d79f53 | 2011-05-24 15:16:13 +0200 | [diff] [blame] | 36 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 37 | [ AC_MSG_RESULT([yes]) |
| 38 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 39 | AC_MSG_RESULT([no])) |
| 40 | CFLAGS="$saved_CFLAGS" |
| 41 | AC_SUBST(SYMBOL_VISIBILITY) |
| 42 | |
| 43 | dnl Generate the output |
| 44 | AM_CONFIG_HEADER(config.h) |
| 45 | |
Harald Welte | cbb29f7 | 2010-03-07 20:24:30 +0100 | [diff] [blame] | 46 | AC_ARG_ENABLE(talloc, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 47 | [AS_HELP_STRING( |
| 48 | [--disable-talloc], |
| 49 | [Disable building talloc memory allocator] |
| 50 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 51 | [enable_talloc=$enableval], [enable_talloc="yes"]) |
| 52 | AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"]) |
Harald Welte | cbb29f7 | 2010-03-07 20:24:30 +0100 | [diff] [blame] | 53 | |
Harald Welte | b9ce51c | 2010-06-30 19:43:11 +0200 | [diff] [blame] | 54 | AC_ARG_ENABLE(plugin, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 55 | [AS_HELP_STRING( |
| 56 | [--disable-plugin], |
| 57 | [Disable support for dlopen plugins], |
| 58 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 59 | [enable_plugin=$enableval], [enable_plugin="yes"]) |
| 60 | AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes") |
Harald Welte | b9ce51c | 2010-06-30 19:43:11 +0200 | [diff] [blame] | 61 | |
Harald Welte | f8b2ba7 | 2010-03-07 20:33:59 +0100 | [diff] [blame] | 62 | AC_ARG_ENABLE(tests, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 63 | [AS_HELP_STRING( |
| 64 | [--disable-tests], |
| 65 | [Disable building test programs] |
| 66 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 67 | [enable_tests=$enableval], [enable_tests="yes"]) |
| 68 | AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes") |
Harald Welte | f8b2ba7 | 2010-03-07 20:33:59 +0100 | [diff] [blame] | 69 | |
Harald Welte | 1067e8c | 2010-06-25 03:00:58 +0200 | [diff] [blame] | 70 | AC_ARG_ENABLE(vty, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 71 | [AS_HELP_STRING( |
| 72 | [--disable-vty], |
| 73 | [Disable building VTY telnet interface] |
| 74 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 75 | [enable_vty=$enableval], [enable_vty="yes"]) |
| 76 | AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes") |
Harald Welte | 5440377 | 2010-05-29 11:49:51 +0200 | [diff] [blame] | 77 | |
Sylvain Munaut | ac3e61a | 2010-07-25 18:08:54 +0200 | [diff] [blame] | 78 | AC_ARG_ENABLE(panic_infloop, |
| 79 | [AS_HELP_STRING( |
| 80 | [--enable-panic-infloop], |
| 81 | [Trigger infinite loop on panic rather than fprintf/abort] |
| 82 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 83 | [panic_infloop=$enableval], [panic_infloop="no"]) |
| 84 | if test x"$panic_infloop" = x"yes" |
Sylvain Munaut | ac3e61a | 2010-07-25 18:08:54 +0200 | [diff] [blame] | 85 | then |
| 86 | AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) |
| 87 | fi |
| 88 | |
Holger Hans Peter Freyther | 4355831 | 2010-08-06 06:48:43 +0800 | [diff] [blame] | 89 | AC_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 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 94 | [fd_check=$enableval], [fd_check="no"]) |
| 95 | if test x"$fd_check" = x"no" |
Holger Hans Peter Freyther | 4355831 | 2010-08-06 06:48:43 +0800 | [diff] [blame] | 96 | then |
| 97 | AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd]) |
| 98 | fi |
| 99 | |
Holger Hans Peter Freyther | c87f266 | 2010-10-07 00:00:15 +0800 | [diff] [blame] | 100 | AC_ARG_ENABLE(msgfile, |
| 101 | [AS_HELP_STRING( |
| 102 | [--disable-msgfile], |
| 103 | [Disable support for the msgfile], |
| 104 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 105 | [enable_msgfile=$enableval], [enable_msgfile="yes"]) |
| 106 | AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes") |
Holger Hans Peter Freyther | c87f266 | 2010-10-07 00:00:15 +0800 | [diff] [blame] | 107 | |
Sylvain Munaut | fe28ded | 2011-09-02 22:18:24 +0200 | [diff] [blame] | 108 | AC_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"]) |
| 114 | AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes") |
| 115 | |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 116 | AC_ARG_ENABLE(utilities, |
| 117 | [AS_HELP_STRING( |
| 118 | [--disable-utilities], |
| 119 | [Disable building utility programs], |
| 120 | )], |
| 121 | [enable_utilities=$enableval], [enable_utilities="yes"]) |
| 122 | AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes") |
| 123 | |
| 124 | AC_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"]) |
| 130 | if test x"$embedded" = x"yes" |
| 131 | then |
| 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 Munaut | fe28ded | 2011-09-02 22:18:24 +0200 | [diff] [blame] | 136 | AM_CONDITIONAL(ENABLE_SERIAL, false) |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 137 | 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]) |
| 141 | fi |
Harald Welte | 5440377 | 2010-05-29 11:49:51 +0200 | [diff] [blame] | 142 | |
Holger Hans Peter Freyther | f9eda74 | 2011-11-13 01:02:54 +0100 | [diff] [blame] | 143 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 144 | AC_OUTPUT( |
| 145 | libosmocore.pc |
Sylvain Munaut | b99b930 | 2010-10-24 18:23:10 +0200 | [diff] [blame] | 146 | libosmocodec.pc |
Harald Welte | e352c52 | 2010-05-19 19:42:32 +0200 | [diff] [blame] | 147 | libosmovty.pc |
Pablo Neira Ayuso | fba495e | 2011-03-23 18:08:08 +0100 | [diff] [blame] | 148 | libosmogsm.pc |
Harald Welte | 641f7ce | 2012-06-17 23:05:26 +0800 | [diff] [blame] | 149 | libosmogb.pc |
Harald Welte | 3fb0b6f | 2010-05-19 19:02:52 +0200 | [diff] [blame] | 150 | include/osmocom/Makefile |
| 151 | include/osmocom/vty/Makefile |
Sylvain Munaut | b99b930 | 2010-10-24 18:23:10 +0200 | [diff] [blame] | 152 | include/osmocom/codec/Makefile |
Harald Welte | b9ce51c | 2010-06-30 19:43:11 +0200 | [diff] [blame] | 153 | include/osmocom/crypt/Makefile |
Pablo Neira Ayuso | 8341934 | 2011-03-22 16:36:13 +0100 | [diff] [blame] | 154 | include/osmocom/gsm/Makefile |
| 155 | include/osmocom/gsm/protocol/Makefile |
Harald Welte | 641f7ce | 2012-06-17 23:05:26 +0800 | [diff] [blame] | 156 | include/osmocom/gprs/Makefile |
| 157 | include/osmocom/gprs/protocol/Makefile |
Pablo Neira Ayuso | 8341934 | 2011-03-22 16:36:13 +0100 | [diff] [blame] | 158 | include/osmocom/core/Makefile |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 159 | include/Makefile |
| 160 | src/Makefile |
Harald Welte | 3fb0b6f | 2010-05-19 19:02:52 +0200 | [diff] [blame] | 161 | src/vty/Makefile |
Sylvain Munaut | 1a4ea5b | 2010-10-08 15:09:16 +0200 | [diff] [blame] | 162 | src/codec/Makefile |
Pablo Neira Ayuso | fba495e | 2011-03-23 18:08:08 +0100 | [diff] [blame] | 163 | src/gsm/Makefile |
Harald Welte | 641f7ce | 2012-06-17 23:05:26 +0800 | [diff] [blame] | 164 | src/gb/Makefile |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 165 | tests/Makefile |
| 166 | tests/timer/Makefile |
| 167 | tests/sms/Makefile |
Holger Hans Peter Freyther | c87f266 | 2010-10-07 00:00:15 +0800 | [diff] [blame] | 168 | tests/msgfile/Makefile |
Holger Hans Peter Freyther | daa653f | 2010-10-11 07:56:06 +0200 | [diff] [blame] | 169 | tests/ussd/Makefile |
Holger Hans Peter Freyther | e05c7df | 2010-12-29 11:57:48 +0100 | [diff] [blame] | 170 | tests/smscb/Makefile |
Harald Welte | 712691d | 2011-09-01 14:47:31 +0200 | [diff] [blame] | 171 | tests/bits/Makefile |
Sylvain Munaut | 810c334 | 2011-11-17 20:33:19 +0100 | [diff] [blame] | 172 | tests/a5/Makefile |
Harald Welte | e076ac0 | 2011-12-07 00:10:18 +0100 | [diff] [blame] | 173 | tests/auth/Makefile |
Sylvain Munaut | 29eb92d | 2011-11-24 17:48:42 +0100 | [diff] [blame] | 174 | tests/conv/Makefile |
Holger Hans Peter Freyther | 72bd4eb | 2011-12-11 20:25:12 +0100 | [diff] [blame] | 175 | tests/lapd/Makefile |
Holger Hans Peter Freyther | 9751081 | 2012-01-22 13:36:52 +0100 | [diff] [blame] | 176 | tests/gsm0808/Makefile |
Harald Welte | eeb78dd | 2011-08-02 13:44:54 +0200 | [diff] [blame] | 177 | utils/Makefile |
Harald Welte | c7859ed | 2011-08-20 12:54:17 +0200 | [diff] [blame] | 178 | Doxyfile.core |
Harald Welte | 49e1056 | 2011-08-17 19:21:07 +0200 | [diff] [blame] | 179 | Doxyfile.gsm |
| 180 | Doxyfile.vty |
| 181 | Doxyfile.codec |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 182 | Makefile) |