2 m4_esyscmd([./git-version-gen .tarball-version]),
3 [openbsc@lists.osmocom.org])
5 AM_INIT_AUTOMAKE([foreign dist-bzip2 no-dist-gzip 1.6])
6 AC_CONFIG_TESTDIR(tests)
8 dnl kernel style compile messages
9 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
11 dnl checks for programs
18 AC_CONFIG_MACRO_DIR([m4])
20 dnl check os: some linker flags not available on osx
25 LTLDFLAGS_OSMOGB='-Wl,--version-script=$(srcdir)/libosmogb.map'
26 LTLDFLAGS_OSMOGSM='-Wl,--version-script=$(srcdir)/libosmogsm.map'
29 AC_SUBST(LTLDFLAGS_OSMOGB)
30 AC_SUBST(LTLDFLAGS_OSMOGSM)
32 dnl checks for header files
34 AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
37 AC_SEARCH_LIBS([dlopen], [dl dld], [LIBRARY_DL="$LIBS";LIBS=""])
40 AC_PATH_PROG(DOXYGEN,doxygen,false)
41 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
43 # The following test is taken from WebKit's webkit.m4
44 saved_CFLAGS="$CFLAGS"
45 CFLAGS="$CFLAGS -fvisibility=hidden "
46 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
47 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
48 [ AC_MSG_RESULT([yes])
49 SYMBOL_VISIBILITY="-fvisibility=hidden"],
51 CFLAGS="$saved_CFLAGS"
52 AC_SUBST(SYMBOL_VISIBILITY)
54 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
56 [whether struct tm has tm_gmtoff member],
57 osmo_cv_tm_includes_tm_gmtoff,
62 time_t t = time(NULL);
63 struct tm* lt = localtime(&t);
64 int off = lt->tm_gmtoff;
67 osmo_cv_tm_includes_tm_gmtoff=yes,
68 osmo_cv_tm_includes_tm_gmtoff=no
71 if test "x$osmo_cv_tm_includes_tm_gmtoff" = xyes; then
72 AC_DEFINE(HAVE_TM_GMTOFF_IN_TM, 1,
73 [Define if struct tm has tm_gmtoff member.])
77 CHECK_TM_INCLUDES_TM_GMTOFF
79 dnl Generate the output
80 AM_CONFIG_HEADER(config.h)
85 [Disable building talloc memory allocator]
87 [enable_talloc=$enableval], [enable_talloc="yes"])
88 AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
93 [Disable support for dlopen plugins],
95 [enable_plugin=$enableval], [enable_plugin="yes"])
96 AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
101 [Disable building VTY telnet interface]
103 [enable_vty=$enableval], [enable_vty="yes"])
104 AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
106 AC_ARG_ENABLE(panic_infloop,
108 [--enable-panic-infloop],
109 [Trigger infinite loop on panic rather than fprintf/abort]
111 [panic_infloop=$enableval], [panic_infloop="no"])
112 if test x"$panic_infloop" = x"yes"
114 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
117 AC_ARG_ENABLE(bsc_fd_check,
119 [--enable-bsc-fd-check],
120 [Instrument bsc_register_fd to check that the fd is registered]
122 [fd_check=$enableval], [fd_check="no"])
123 if test x"$fd_check" = x"no"
125 AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
128 AC_ARG_ENABLE(msgfile,
131 [Disable support for the msgfile],
133 [enable_msgfile=$enableval], [enable_msgfile="yes"])
134 AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
136 AC_ARG_ENABLE(serial,
139 [Disable support for the serial helpers],
141 [enable_serial=$enableval], [enable_serial="yes"])
142 AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
144 AC_ARG_ENABLE(utilities,
146 [--disable-utilities],
147 [Disable building utility programs],
149 [enable_utilities=$enableval], [enable_utilities="yes"])
150 AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
155 [Disable building Gb library],
157 [enable_gb=$enableval], [enable_gb="yes"])
158 AM_CONDITIONAL(ENABLE_GB, test x"$enable_gb" = x"yes")
160 AC_ARG_ENABLE(embedded,
163 [Enable building for embedded use and disable unsupported features]
165 [embedded=$enableval], [embedded="no"])
166 if test x"$embedded" = x"yes"
168 AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
169 AM_CONDITIONAL(ENABLE_PLUGIN, false)
170 AM_CONDITIONAL(ENABLE_MSGFILE, false)
171 AM_CONDITIONAL(ENABLE_SERIAL, false)
172 AM_CONDITIONAL(ENABLE_VTY, false)
173 AM_CONDITIONAL(ENABLE_TALLOC, false)
174 AM_CONDITIONAL(ENABLE_UTILITIES, false)
175 AM_CONDITIONAL(ENABLE_GB, false)
176 AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])