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 | |
Sylvain Munaut | 69b1b8b | 2015-08-19 11:15:14 +0200 | [diff] [blame] | 5 | AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6 subdir-objects]) |
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 |
Diego Elio Pettenò | d471a21 | 2012-06-29 13:01:19 -0700 | [diff] [blame] | 13 | AC_PROG_MKDIR_P |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 14 | AC_PROG_CC |
| 15 | AC_PROG_INSTALL |
Jan Engelhardt | c2ddc4f | 2015-09-16 14:32:31 +0200 | [diff] [blame] | 16 | LT_INIT([pic-only disable-static]) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 17 | |
Harald Welte | 4cd3d8a | 2010-03-23 00:30:19 +0800 | [diff] [blame] | 18 | AC_CONFIG_MACRO_DIR([m4]) |
| 19 | |
Tobias Engel | 597460f | 2012-10-24 17:52:52 +0200 | [diff] [blame] | 20 | dnl check os: some linker flags not available on osx |
| 21 | case $host in |
| 22 | *-darwin*) |
| 23 | ;; |
| 24 | *) |
| 25 | LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map' |
| 26 | LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map' |
| 27 | ;; |
| 28 | esac |
| 29 | AC_SUBST(LTLDFLAGS_OSMOGB) |
| 30 | AC_SUBST(LTLDFLAGS_OSMOGSM) |
| 31 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 32 | dnl checks for header files |
| 33 | AC_HEADER_STDC |
Harald Welte | e15ac06 | 2014-12-04 14:15:36 +0100 | [diff] [blame] | 34 | AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h netinet/tcp.h) |
Holger Hans Peter Freyther | 4772348 | 2011-11-09 11:26:15 +0100 | [diff] [blame] | 35 | # for src/conv.c |
| 36 | AC_FUNC_ALLOCA |
| 37 | AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""]) |
| 38 | AC_SUBST(LIBRARY_DL) |
Holger Hans Peter Freyther | c2c042d | 2014-04-17 23:19:10 +0200 | [diff] [blame] | 39 | # for src/backtrace.c |
| 40 | AC_CHECK_LIB(execinfo, backtrace, BACKTRACE_LIB=-lexecinfo, BACKTRACE_LIB=) |
| 41 | AC_SUBST(BACKTRACE_LIB) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 42 | |
Harald Welte | 21e73c2 | 2011-08-17 19:33:06 +0200 | [diff] [blame] | 43 | AC_PATH_PROG(DOXYGEN,doxygen,false) |
| 44 | AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false) |
| 45 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 46 | # The following test is taken from WebKit's webkit.m4 |
| 47 | saved_CFLAGS="$CFLAGS" |
| 48 | CFLAGS="$CFLAGS -fvisibility=hidden " |
| 49 | AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden]) |
Alexander Huemer | 3d79f53 | 2011-05-24 15:16:13 +0200 | [diff] [blame] | 50 | AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])], |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 51 | [ AC_MSG_RESULT([yes]) |
| 52 | SYMBOL_VISIBILITY="-fvisibility=hidden"], |
| 53 | AC_MSG_RESULT([no])) |
| 54 | CFLAGS="$saved_CFLAGS" |
| 55 | AC_SUBST(SYMBOL_VISIBILITY) |
| 56 | |
Harald Welte | 7c8e2cc | 2012-08-29 16:47:30 +0200 | [diff] [blame] | 57 | AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [ |
| 58 | AC_CACHE_CHECK( |
| 59 | [whether struct tm has tm_gmtoff member], |
| 60 | osmo_cv_tm_includes_tm_gmtoff, |
| 61 | [AC_LINK_IFELSE([ |
| 62 | AC_LANG_PROGRAM([ |
| 63 | #include <time.h> |
| 64 | ], [ |
| 65 | time_t t = time(NULL); |
| 66 | struct tm* lt = localtime(&t); |
| 67 | int off = lt->tm_gmtoff; |
| 68 | ]) |
| 69 | ], |
| 70 | osmo_cv_tm_includes_tm_gmtoff=yes, |
| 71 | osmo_cv_tm_includes_tm_gmtoff=no |
| 72 | )] |
| 73 | ) |
| 74 | if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then |
| 75 | AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1, |
| 76 | [Define if struct tm has tm_gmtoff member.]) |
| 77 | fi |
| 78 | ]) |
| 79 | |
| 80 | CHECK_TM_INCLUDES_TM_GMTOFF |
| 81 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 82 | dnl Generate the output |
Christian Vogel | 854debc | 2013-01-05 20:30:41 +0100 | [diff] [blame] | 83 | AC_CONFIG_HEADER(config.h) |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 84 | |
Harald Welte | 495fe26 | 2012-09-10 16:28:17 +0200 | [diff] [blame] | 85 | AC_ARG_ENABLE([pcsc], [AS_HELP_STRING([--disable-pcsc], [Build without PC/SC support])], |
| 86 | [ |
Holger Hans Peter Freyther | 18bcc8a | 2014-11-14 15:06:09 +0100 | [diff] [blame] | 87 | enable_pcsc=$enableval |
Harald Welte | 495fe26 | 2012-09-10 16:28:17 +0200 | [diff] [blame] | 88 | ], |
| 89 | [ |
Holger Hans Peter Freyther | 18bcc8a | 2014-11-14 15:06:09 +0100 | [diff] [blame] | 90 | enable_pcsc="yes" |
Harald Welte | 495fe26 | 2012-09-10 16:28:17 +0200 | [diff] [blame] | 91 | ]) |
Holger Hans Peter Freyther | 18bcc8a | 2014-11-14 15:06:09 +0100 | [diff] [blame] | 92 | if test "x$enable_pcsc" = "xyes" ; then |
| 93 | PKG_CHECK_MODULES(PCSC, libpcsclite) |
| 94 | fi |
| 95 | AM_CONDITIONAL(ENABLE_PCSC, test "x$enable_pcsc" = "xyes") |
Harald Welte | 495fe26 | 2012-09-10 16:28:17 +0200 | [diff] [blame] | 96 | |
Harald Welte | cbb29f7 | 2010-03-07 20:24:30 +0100 | [diff] [blame] | 97 | AC_ARG_ENABLE(talloc, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 98 | [AS_HELP_STRING( |
| 99 | [--disable-talloc], |
| 100 | [Disable building talloc memory allocator] |
| 101 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 102 | [enable_talloc=$enableval], [enable_talloc="yes"]) |
| 103 | AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"]) |
Harald Welte | cbb29f7 | 2010-03-07 20:24:30 +0100 | [diff] [blame] | 104 | |
Harald Welte | b9ce51c | 2010-06-30 19:43:11 +0200 | [diff] [blame] | 105 | AC_ARG_ENABLE(plugin, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 106 | [AS_HELP_STRING( |
| 107 | [--disable-plugin], |
| 108 | [Disable support for dlopen plugins], |
| 109 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 110 | [enable_plugin=$enableval], [enable_plugin="yes"]) |
| 111 | AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes") |
Harald Welte | b9ce51c | 2010-06-30 19:43:11 +0200 | [diff] [blame] | 112 | |
Harald Welte | 1067e8c | 2010-06-25 03:00:58 +0200 | [diff] [blame] | 113 | AC_ARG_ENABLE(vty, |
Sylvain Munaut | f23abab | 2010-07-25 16:16:42 +0200 | [diff] [blame] | 114 | [AS_HELP_STRING( |
| 115 | [--disable-vty], |
| 116 | [Disable building VTY telnet interface] |
| 117 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 118 | [enable_vty=$enableval], [enable_vty="yes"]) |
| 119 | AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes") |
Harald Welte | 5440377 | 2010-05-29 11:49:51 +0200 | [diff] [blame] | 120 | |
Sylvain Munaut | ac3e61a | 2010-07-25 18:08:54 +0200 | [diff] [blame] | 121 | AC_ARG_ENABLE(panic_infloop, |
| 122 | [AS_HELP_STRING( |
| 123 | [--enable-panic-infloop], |
| 124 | [Trigger infinite loop on panic rather than fprintf/abort] |
| 125 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 126 | [panic_infloop=$enableval], [panic_infloop="no"]) |
| 127 | if test x"$panic_infloop" = x"yes" |
Sylvain Munaut | ac3e61a | 2010-07-25 18:08:54 +0200 | [diff] [blame] | 128 | then |
| 129 | AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) |
| 130 | fi |
| 131 | |
Holger Hans Peter Freyther | 4355831 | 2010-08-06 06:48:43 +0800 | [diff] [blame] | 132 | AC_ARG_ENABLE(bsc_fd_check, |
| 133 | [AS_HELP_STRING( |
| 134 | [--enable-bsc-fd-check], |
| 135 | [Instrument bsc_register_fd to check that the fd is registered] |
| 136 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 137 | [fd_check=$enableval], [fd_check="no"]) |
| 138 | if test x"$fd_check" = x"no" |
Holger Hans Peter Freyther | 4355831 | 2010-08-06 06:48:43 +0800 | [diff] [blame] | 139 | then |
| 140 | AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd]) |
| 141 | fi |
| 142 | |
Holger Hans Peter Freyther | c87f266 | 2010-10-07 00:00:15 +0800 | [diff] [blame] | 143 | AC_ARG_ENABLE(msgfile, |
| 144 | [AS_HELP_STRING( |
| 145 | [--disable-msgfile], |
| 146 | [Disable support for the msgfile], |
| 147 | )], |
job | 36b4a20 | 2011-08-21 17:18:23 +0200 | [diff] [blame] | 148 | [enable_msgfile=$enableval], [enable_msgfile="yes"]) |
| 149 | AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes") |
Holger Hans Peter Freyther | c87f266 | 2010-10-07 00:00:15 +0800 | [diff] [blame] | 150 | |
Sylvain Munaut | fe28ded | 2011-09-02 22:18:24 +0200 | [diff] [blame] | 151 | AC_ARG_ENABLE(serial, |
| 152 | [AS_HELP_STRING( |
| 153 | [--disable-serial], |
| 154 | [Disable support for the serial helpers], |
| 155 | )], |
| 156 | [enable_serial=$enableval], [enable_serial="yes"]) |
| 157 | AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes") |
| 158 | |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 159 | AC_ARG_ENABLE(utilities, |
| 160 | [AS_HELP_STRING( |
| 161 | [--disable-utilities], |
| 162 | [Disable building utility programs], |
| 163 | )], |
| 164 | [enable_utilities=$enableval], [enable_utilities="yes"]) |
| 165 | AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes") |
| 166 | |
Harald Welte | e3a10b6 | 2012-09-08 22:18:43 +0200 | [diff] [blame] | 167 | AC_ARG_ENABLE(gb, |
| 168 | [AS_HELP_STRING( |
| 169 | [--disable-gb], |
| 170 | [Disable building Gb library], |
| 171 | )], |
| 172 | [enable_gb=$enableval], [enable_gb="yes"]) |
| 173 | AM_CONDITIONAL(ENABLE_GB, test x"$enable_gb" = x"yes") |
| 174 | |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 175 | AC_ARG_ENABLE(embedded, |
| 176 | [AS_HELP_STRING( |
| 177 | [--enable-embedded], |
| 178 | [Enable building for embedded use and disable unsupported features] |
| 179 | )], |
| 180 | [embedded=$enableval], [embedded="no"]) |
| 181 | if test x"$embedded" = x"yes" |
| 182 | then |
| 183 | AC_DEFINE([EMBEDDED],[1],[Select building for embedded use]) |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 184 | AM_CONDITIONAL(ENABLE_PLUGIN, false) |
| 185 | AM_CONDITIONAL(ENABLE_MSGFILE, false) |
Sylvain Munaut | fe28ded | 2011-09-02 22:18:24 +0200 | [diff] [blame] | 186 | AM_CONDITIONAL(ENABLE_SERIAL, false) |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 187 | AM_CONDITIONAL(ENABLE_VTY, false) |
| 188 | AM_CONDITIONAL(ENABLE_TALLOC, false) |
| 189 | AM_CONDITIONAL(ENABLE_UTILITIES, false) |
Harald Welte | e3a10b6 | 2012-09-08 22:18:43 +0200 | [diff] [blame] | 190 | AM_CONDITIONAL(ENABLE_GB, false) |
job | 8e4deb6 | 2011-08-21 17:18:24 +0200 | [diff] [blame] | 191 | AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort]) |
| 192 | fi |
Harald Welte | 5440377 | 2010-05-29 11:49:51 +0200 | [diff] [blame] | 193 | |
Holger Hans Peter Freyther | f9eda74 | 2011-11-13 01:02:54 +0100 | [diff] [blame] | 194 | |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 195 | AC_OUTPUT( |
| 196 | libosmocore.pc |
Sylvain Munaut | b99b930 | 2010-10-24 18:23:10 +0200 | [diff] [blame] | 197 | libosmocodec.pc |
Harald Welte | e352c52 | 2010-05-19 19:42:32 +0200 | [diff] [blame] | 198 | libosmovty.pc |
Pablo Neira Ayuso | fba495e | 2011-03-23 18:08:08 +0100 | [diff] [blame] | 199 | libosmogsm.pc |
Harald Welte | 641f7ce | 2012-06-17 23:05:26 +0800 | [diff] [blame] | 200 | libosmogb.pc |
Harald Welte | 3ff81b1 | 2014-08-20 19:58:40 +0200 | [diff] [blame] | 201 | libosmoctrl.pc |
Harald Welte | d54c2ee | 2012-01-17 18:25:50 +0100 | [diff] [blame] | 202 | libosmosim.pc |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 203 | include/Makefile |
| 204 | src/Makefile |
Harald Welte | 3fb0b6f | 2010-05-19 19:02:52 +0200 | [diff] [blame] | 205 | src/vty/Makefile |
Sylvain Munaut | 1a4ea5b | 2010-10-08 15:09:16 +0200 | [diff] [blame] | 206 | src/codec/Makefile |
Harald Welte | d54c2ee | 2012-01-17 18:25:50 +0100 | [diff] [blame] | 207 | src/sim/Makefile |
Pablo Neira Ayuso | fba495e | 2011-03-23 18:08:08 +0100 | [diff] [blame] | 208 | src/gsm/Makefile |
Harald Welte | 641f7ce | 2012-06-17 23:05:26 +0800 | [diff] [blame] | 209 | src/gb/Makefile |
Harald Welte | 3ff81b1 | 2014-08-20 19:58:40 +0200 | [diff] [blame] | 210 | src/ctrl/Makefile |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 211 | tests/Makefile |
Harald Welte | eeb78dd | 2011-08-02 13:44:54 +0200 | [diff] [blame] | 212 | utils/Makefile |
Harald Welte | c7859ed | 2011-08-20 12:54:17 +0200 | [diff] [blame] | 213 | Doxyfile.core |
Harald Welte | 49e1056 | 2011-08-17 19:21:07 +0200 | [diff] [blame] | 214 | Doxyfile.gsm |
| 215 | Doxyfile.vty |
| 216 | Doxyfile.codec |
Harald Welte | 3cae039 | 2010-02-20 21:09:24 +0100 | [diff] [blame] | 217 | Makefile) |