trxcon/l1sched: clarify TDMA Fn (mod 26) maps
[osmocom-bb.git] / src / shared / libosmocore / configure.ac
blob24ddd0c7547dbc4ff52651c343c725378308aa65
1 AC_INIT([libosmocore],
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
12 AC_PROG_MAKE_SET
13 AC_PROG_MKDIR_P
14 AC_PROG_CC
15 AC_PROG_INSTALL
16 LT_INIT([pic-only])
18 AC_CONFIG_MACRO_DIR([m4])
20 dnl check os: some linker flags not available on osx
21 case $host in
22 *-darwin*)
23         ;;
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)
32 dnl checks for header files
33 AC_HEADER_STDC
34 AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
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)
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"],
50         AC_MSG_RESULT([no]))
51 CFLAGS="$saved_CFLAGS"
52 AC_SUBST(SYMBOL_VISIBILITY)
54 AC_DEFUN([CHECK_TM_INCLUDES_TM_GMTOFF], [
55   AC_CACHE_CHECK(
56     [whether struct tm has tm_gmtoff member],
57     osmo_cv_tm_includes_tm_gmtoff,
58     [AC_LINK_IFELSE([
59       AC_LANG_PROGRAM([
60         #include <time.h>
61       ], [
62         time_t t = time(NULL);
63         struct tm* lt = localtime(&t);
64         int off = lt->tm_gmtoff;
65       ])
66     ],
67     osmo_cv_tm_includes_tm_gmtoff=yes,
68     osmo_cv_tm_includes_tm_gmtoff=no
69     )]
70   )
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.])
74   fi
77 CHECK_TM_INCLUDES_TM_GMTOFF
79 dnl Generate the output
80 AM_CONFIG_HEADER(config.h)
82 AC_ARG_ENABLE(talloc,
83         [AS_HELP_STRING(
84                 [--disable-talloc],
85                 [Disable building talloc memory allocator]
86         )],
87         [enable_talloc=$enableval], [enable_talloc="yes"])
88 AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
90 AC_ARG_ENABLE(plugin,
91         [AS_HELP_STRING(
92                 [--disable-plugin],
93                 [Disable support for dlopen plugins],
94         )],
95         [enable_plugin=$enableval], [enable_plugin="yes"])
96 AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
98 AC_ARG_ENABLE(vty,
99         [AS_HELP_STRING(
100                 [--disable-vty],
101                 [Disable building VTY telnet interface]
102         )],
103         [enable_vty=$enableval], [enable_vty="yes"])
104 AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
106 AC_ARG_ENABLE(panic_infloop,
107         [AS_HELP_STRING(
108                 [--enable-panic-infloop],
109                 [Trigger infinite loop on panic rather than fprintf/abort]
110         )],
111         [panic_infloop=$enableval], [panic_infloop="no"])
112 if test x"$panic_infloop" = x"yes"
113 then
114         AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
117 AC_ARG_ENABLE(bsc_fd_check,
118         [AS_HELP_STRING(
119                 [--enable-bsc-fd-check],
120                 [Instrument bsc_register_fd to check that the fd is registered]
121         )],
122         [fd_check=$enableval], [fd_check="no"])
123 if test x"$fd_check" = x"no"
124 then
125         AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
128 AC_ARG_ENABLE(msgfile,
129         [AS_HELP_STRING(
130                 [--disable-msgfile],
131                 [Disable support for the msgfile],
132         )],
133         [enable_msgfile=$enableval], [enable_msgfile="yes"])
134 AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
136 AC_ARG_ENABLE(serial,
137         [AS_HELP_STRING(
138                 [--disable-serial],
139                 [Disable support for the serial helpers],
140         )],
141         [enable_serial=$enableval], [enable_serial="yes"])
142 AM_CONDITIONAL(ENABLE_SERIAL, test x"$enable_serial" = x"yes")
144 AC_ARG_ENABLE(utilities,
145         [AS_HELP_STRING(
146                 [--disable-utilities],
147                 [Disable building utility programs],
148         )],
149         [enable_utilities=$enableval], [enable_utilities="yes"])
150 AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
152 AC_ARG_ENABLE(gb,
153         [AS_HELP_STRING(
154                 [--disable-gb],
155                 [Disable building Gb library],
156         )],
157         [enable_gb=$enableval], [enable_gb="yes"])
158 AM_CONDITIONAL(ENABLE_GB, test x"$enable_gb" = x"yes")
160 AC_ARG_ENABLE(embedded,
161         [AS_HELP_STRING(
162                 [--enable-embedded],
163                 [Enable building for embedded use and disable unsupported features]
164         )],
165         [embedded=$enableval], [embedded="no"])
166 if test x"$embedded" = x"yes"
167 then
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])
180 AC_OUTPUT(
181         libosmocore.pc
182         libosmocodec.pc
183         libosmovty.pc
184         libosmogsm.pc
185         libosmogb.pc
186         include/Makefile
187         src/Makefile
188         src/vty/Makefile
189         src/codec/Makefile
190         src/gsm/Makefile
191         src/gb/Makefile
192         tests/Makefile
193         utils/Makefile
194         Doxyfile.core
195         Doxyfile.gsm
196         Doxyfile.vty
197         Doxyfile.codec
198         Makefile)