Added autoconf option for utilities and embedded
[osmocom-bb.git] / configure.ac
blobae811e1a2c3b1f095f1927c5e81ec980aca55b24
1 AC_INIT([libosmocore],
2         m4_esyscmd([./git-version-gen .tarball-version]),
3         [openbsc-devel@lists.openbsc.org])
5 AM_INIT_AUTOMAKE([dist-bzip2])
7 dnl kernel style compile messages
8 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
10 dnl checks for programs
11 AC_PROG_MAKE_SET
12 AC_PROG_CC
13 AC_PROG_INSTALL
14 LT_INIT
15 AC_PROG_LIBTOOL
17 AC_CONFIG_MACRO_DIR([m4])
19 dnl checks for header files
20 AC_HEADER_STDC
21 AC_CHECK_HEADERS(execinfo.h sys/select.h sys/socket.h syslog.h ctype.h)
23 AC_PATH_PROG(DOXYGEN,doxygen,false)
24 AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
26 # The following test is taken from WebKit's webkit.m4
27 saved_CFLAGS="$CFLAGS"
28 CFLAGS="$CFLAGS -fvisibility=hidden "
29 AC_MSG_CHECKING([if ${CC} supports -fvisibility=hidden])
30 AC_COMPILE_IFELSE([AC_LANG_SOURCE([char foo;])],
31       [ AC_MSG_RESULT([yes])
32         SYMBOL_VISIBILITY="-fvisibility=hidden"],
33         AC_MSG_RESULT([no]))
34 CFLAGS="$saved_CFLAGS"
35 AC_SUBST(SYMBOL_VISIBILITY)
37 dnl Generate the output
38 AM_CONFIG_HEADER(config.h)
40 AC_ARG_ENABLE(talloc,
41         [AS_HELP_STRING(
42                 [--disable-talloc],
43                 [Disable building talloc memory allocator]
44         )],
45         [enable_talloc=$enableval], [enable_talloc="yes"])
46 AM_CONDITIONAL(ENABLE_TALLOC, [test x"$enable_talloc" = x"yes"])
48 AC_ARG_ENABLE(plugin,
49         [AS_HELP_STRING(
50                 [--disable-plugin],
51                 [Disable support for dlopen plugins],
52         )],
53         [enable_plugin=$enableval], [enable_plugin="yes"])
54 AM_CONDITIONAL(ENABLE_PLUGIN, test x"$enable_plugin" = x"yes")
56 AC_ARG_ENABLE(tests,
57         [AS_HELP_STRING(
58                 [--disable-tests],
59                 [Disable building test programs]
60         )],
61         [enable_tests=$enableval], [enable_tests="yes"])
62 AM_CONDITIONAL(ENABLE_TESTS, test x"$enable_tests" = x"yes")
64 AC_ARG_ENABLE(vty,
65         [AS_HELP_STRING(
66                 [--disable-vty],
67                 [Disable building VTY telnet interface]
68         )],
69         [enable_vty=$enableval], [enable_vty="yes"])
70 AM_CONDITIONAL(ENABLE_VTY, test x"$enable_vty" = x"yes")
72 AC_ARG_ENABLE(panic_infloop,
73         [AS_HELP_STRING(
74                 [--enable-panic-infloop],
75                 [Trigger infinite loop on panic rather than fprintf/abort]
76         )],
77         [panic_infloop=$enableval], [panic_infloop="no"])
78 if test x"$panic_infloop" = x"yes"
79 then
80         AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
83 AC_ARG_ENABLE(bsc_fd_check,
84         [AS_HELP_STRING(
85                 [--enable-bsc-fd-check],
86                 [Instrument bsc_register_fd to check that the fd is registered]
87         )],
88         [fd_check=$enableval], [fd_check="no"])
89 if test x"$fd_check" = x"no"
90 then
91         AC_DEFINE([BSC_FD_CHECK],[1],[Instrument the bsc_register_fd])
94 AC_ARG_ENABLE(msgfile,
95         [AS_HELP_STRING(
96                 [--disable-msgfile],
97                 [Disable support for the msgfile],
98         )],
99         [enable_msgfile=$enableval], [enable_msgfile="yes"])
100 AM_CONDITIONAL(ENABLE_MSGFILE, test x"$enable_msgfile" = x"yes")
102 AC_ARG_ENABLE(utilities,
103         [AS_HELP_STRING(
104                 [--disable-utilities],
105                 [Disable building utility programs],
106         )],
107         [enable_utilities=$enableval], [enable_utilities="yes"])
108 AM_CONDITIONAL(ENABLE_UTILITIES, test x"$enable_utilities" = x"yes")
110 AC_ARG_ENABLE(embedded,
111         [AS_HELP_STRING(
112                 [--enable-embedded],
113                 [Enable building for embedded use and disable unsupported features]
114         )],
115         [embedded=$enableval], [embedded="no"])
116 if test x"$embedded" = x"yes"
117 then
118         AC_DEFINE([EMBEDDED],[1],[Select building for embedded use])
119         AM_CONDITIONAL(ENABLE_TESTS, false)
120         AM_CONDITIONAL(ENABLE_PLUGIN, false)
121         AM_CONDITIONAL(ENABLE_MSGFILE, false)
122         AM_CONDITIONAL(ENABLE_VTY, false)
123         AM_CONDITIONAL(ENABLE_TALLOC, false)
124         AM_CONDITIONAL(ENABLE_UTILITIES, false)
125         AC_DEFINE([PANIC_INFLOOP],[1],[Use infinite loop on panic rather than fprintf/abort])
128 AC_OUTPUT(
129         libosmocore.pc
130         libosmocodec.pc
131         libosmovty.pc
132         libosmogsm.pc
133         include/osmocom/Makefile
134         include/osmocom/vty/Makefile
135         include/osmocom/codec/Makefile
136         include/osmocom/crypt/Makefile
137         include/osmocom/gsm/Makefile
138         include/osmocom/gsm/protocol/Makefile
139         include/osmocom/core/Makefile
140         include/Makefile
141         src/Makefile
142         src/vty/Makefile
143         src/codec/Makefile
144         src/gsm/Makefile
145         tests/Makefile
146         tests/timer/Makefile
147         tests/sms/Makefile
148         tests/msgfile/Makefile
149         tests/ussd/Makefile
150         tests/smscb/Makefile
151         tests/bits/Makefile
152         utils/Makefile
153         Doxyfile.core
154         Doxyfile.gsm
155         Doxyfile.vty
156         Doxyfile.codec
157         Makefile)