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