add GSM_LCHAN_PDTCH
[osmocom-bb.git] / configure.ac
blob977eef9dff7b7fe25d1ba47629443e21432270d5
1 AC_INIT([libosmocore],
2         m4_esyscmd([./git-version-gen .tarball-version]),
3         [openbsc@lists.osmocom.org])
5 AM_INIT_AUTOMAKE([dist-bzip2])
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_CC
14 AC_PROG_INSTALL
15 LT_INIT
16 AC_PROG_LIBTOOL
17 CHECK_GCC_FVISIBILITY
19 AC_CONFIG_MACRO_DIR([m4])
21 dnl checks for header files
22 AC_HEADER_STDC
23 AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
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)
29 AC_PATH_PROG(DOXYGEN,doxygen,false)
30 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
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])
36 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
37       [ AC_MSG_RESULT([yes])
38         SYMBOL_VISIBILITY="-fvisibility=hidden"],
39         AC_MSG_RESULT([no]))
40 CFLAGS="$saved_CFLAGS"
41 AC_SUBST(SYMBOL_VISIBILITY)
43 dnl Generate the output
44 AM_CONFIG_HEADER(config.h)
46 AC_ARG_ENABLE(talloc,
47         [AS_HELP_STRING(
48                 [--disable-talloc],
49                 [Disable building talloc memory allocator]
50         )],
51         [enable_talloc=$enableval], [enable_talloc="yes"])
52 AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
54 AC_ARG_ENABLE(plugin,
55         [AS_HELP_STRING(
56                 [--disable-plugin],
57                 [Disable support for dlopen plugins],
58         )],
59         [enable_plugin=$enableval], [enable_plugin="yes"])
60 AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
62 AC_ARG_ENABLE(tests,
63         [AS_HELP_STRING(
64                 [--disable-tests],
65                 [Disable building test programs]
66         )],
67         [enable_tests=$enableval], [enable_tests="yes"])
68 AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
70 AC_ARG_ENABLE(vty,
71         [AS_HELP_STRING(
72                 [--disable-vty],
73                 [Disable building VTY telnet interface]
74         )],
75         [enable_vty=$enableval], [enable_vty="yes"])
76 AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
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         )],
83         [panic_infloop=$enableval], [panic_infloop="no"])
84 if test x"$panic_infloop" = x"yes"
85 then
86         AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
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         )],
94         [fd_check=$enableval], [fd_check="no"])
95 if test x"$fd_check" = x"no"
96 then
97         AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
100 AC_ARG_ENABLE(msgfile,
101         [AS_HELP_STRING(
102                 [--disable-msgfile],
103                 [Disable support for the msgfile],
104         )],
105         [enable_msgfile=$enableval], [enable_msgfile="yes"])
106 AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
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")
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")
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)
136         AM_CONDITIONAL(ENABLE_SERIAL, false)
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])
144 AC_OUTPUT(
145         libosmocore.pc
146         libosmocodec.pc
147         libosmovty.pc
148         libosmogsm.pc
149         include/osmocom/Makefile
150         include/osmocom/vty/Makefile
151         include/osmocom/codec/Makefile
152         include/osmocom/crypt/Makefile
153         include/osmocom/gsm/Makefile
154         include/osmocom/gsm/protocol/Makefile
155         include/osmocom/core/Makefile
156         include/Makefile
157         src/Makefile
158         src/vty/Makefile
159         src/codec/Makefile
160         src/gsm/Makefile
161         tests/Makefile
162         tests/timer/Makefile
163         tests/sms/Makefile
164         tests/msgfile/Makefile
165         tests/ussd/Makefile
166         tests/smscb/Makefile
167         tests/bits/Makefile
168         tests/a5/Makefile
169         tests/auth/Makefile
170         tests/conv/Makefile
171         tests/lapd/Makefile
172         tests/gsm0808/Makefile
173         utils/Makefile
174         Doxyfile.core
175         Doxyfile.gsm
176         Doxyfile.vty
177         Doxyfile.codec
178         Makefile)