iof-bird-daemon / configure.in @ f9254d23
History | View | Annotate | Download (5.52 KB)
1 | 2f9bcf97 | Martin Mares | dnl ** This is a configure script template for BIRD |
---|---|---|---|
2 | dnl ** Process it with autoconf to get ./configure |
||
3 | 9fac310d | Martin Mares | dnl ** (c) 1999--2000 Martin Mares <mj@ucw.cz> |
4 | 2f9bcf97 | Martin Mares | |
5 | AC_REVISION($Id$) |
||
6 | AC_INIT(conf/confbase.Y) |
||
7 | AC_CONFIG_AUX_DIR(tools) |
||
8 | |||
9 | c0760ab0 | Martin Mares | AC_ARG_ENABLE(debug,[ --enable-debug enable internal debugging routines (default: disabled)],,enable_debug=no) |
10 | c817b991 | Martin Mares | AC_ARG_ENABLE(warnings,[ --enable-warnings enable extra warnings (default: disabled)],,enable_warnings=no) |
11 | 9fac310d | Martin Mares | AC_ARG_ENABLE(client,[ --enable-client enable building of BIRD client (default: enabled)],,enable_client=yes) |
12 | c817b991 | Martin Mares | AC_ARG_ENABLE(ipv6,[ --enable-ipv6 enable building of IPv6 version (default: disabled)],,enable_ipv6=no) |
13 | 2f9bcf97 | Martin Mares | AC_ARG_WITH(sysconfig,[ --with-sysconfig=FILE use specified BIRD system configuration file]) |
14 | c817b991 | Martin Mares | AC_ARG_WITH(protocols,[ --with-protocols=LIST include specified routing protocols (default: all)],,[with_protocols="all"]) |
15 | a07e9d82 | Martin Mares | AC_ARG_WITH(sysinclude,[ --with-sysinclude=PATH search for system includes on specified place]) |
16 | 2f9bcf97 | Martin Mares | |
17 | 49e7e5ee | Martin Mares | if test "$srcdir" = . ; then |
18 | # Building in current directory => create obj directory holding all objects |
||
19 | objdir=obj |
||
20 | mkdir -p obj |
||
21 | srcdir_rel=.. |
||
22 | makefiles="Makefile:tools/Makefile-top.in obj/Makefile:tools/Makefile.in obj/Rules:tools/Rules.in" |
||
23 | exedir=.. |
||
24 | else |
||
25 | # Building in separate directory |
||
26 | objdir=. |
||
27 | srcdir_rel=$srcdir |
||
28 | makefiles="Makefile:tools/Makefile.in Rules:tools/Rules.in" |
||
29 | exedir=. |
||
30 | fi |
||
31 | case $srcdir_rel in |
||
32 | /*) srcdir_rel_mf=$srcdir_rel ;; |
||
33 | *) srcdir_rel_mf="\$(root-rel)$srcdir_rel" ;; |
||
34 | esac |
||
35 | AC_SUBST(objdir) |
||
36 | AC_SUBST(exedir) |
||
37 | AC_SUBST(srcdir_rel_mf) |
||
38 | |||
39 | c817b991 | Martin Mares | if test "$enable_ipv6" = yes ; then |
40 | ip=ipv6 |
||
41 | if test "$with_protocols" = all ; then |
||
42 | with_protocols=bgp,pipe,rip,static |
||
43 | fi |
||
44 | else |
||
45 | ip=ipv4 |
||
46 | if test "$with_protocols" = all ; then |
||
47 | with_protocols=bgp,ospf,pipe,rip,static |
||
48 | fi |
||
49 | fi |
||
50 | |||
51 | 2f9bcf97 | Martin Mares | AC_CANONICAL_HOST |
52 | AC_MSG_CHECKING([which OS configuration should we use]) |
||
53 | if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then |
||
54 | if test -f $with_sysconfig ; then |
||
55 | 49e7e5ee | Martin Mares | sysdesc=$with_sysconfig |
56 | 2f9bcf97 | Martin Mares | else |
57 | 49e7e5ee | Martin Mares | sysdesc=$srcdir/sysdep/cf/$with_sysconfig |
58 | if ! test -f $sysdesc ; then |
||
59 | sysdesc=$sysdesc.h |
||
60 | fi |
||
61 | 2f9bcf97 | Martin Mares | fi |
62 | elif test -f sysconfig.h ; then |
||
63 | 49e7e5ee | Martin Mares | sysdesc=sysconfig |
64 | 2f9bcf97 | Martin Mares | else |
65 | c817b991 | Martin Mares | case "$ip:$host_os" in |
66 | ipv4:linux*) case `uname -r` in |
||
67 | 1127ac6e | Martin Mares | 1.*|2.0.*) sysdesc=linux-20 ;; |
68 | f2ed663a | Martin Mares | *) sysdesc=linux-22 ;; |
69 | 1127ac6e | Martin Mares | esac |
70 | ;; |
||
71 | c817b991 | Martin Mares | ipv6:linux*) sysdesc=linux-v6 |
72 | ;; |
||
73 | 2f9bcf97 | Martin Mares | *) AC_MSG_RESULT(unknown) |
74 | AC_MSG_ERROR([Cannot determine correct system configuration.]) |
||
75 | ;; |
||
76 | esac |
||
77 | 49e7e5ee | Martin Mares | sysdesc=$srcdir/sysdep/cf/$sysdesc.h |
78 | 2f9bcf97 | Martin Mares | fi |
79 | 49e7e5ee | Martin Mares | AC_MSG_RESULT($sysdesc) |
80 | if ! test -f $sysdesc ; then |
||
81 | 2f9bcf97 | Martin Mares | AC_MSG_ERROR([The system configuration file is missing.]) |
82 | fi |
||
83 | 49e7e5ee | Martin Mares | sysname=`echo $sysdesc | sed 's/\.h$//'` |
84 | AC_DEFINE_UNQUOTED(SYSCONF_INCLUDE, "$sysdesc") |
||
85 | |||
86 | AC_MSG_CHECKING([system-dependent directories]) |
||
87 | sysdep_dirs="`sed <$sysdesc '/^Link: /!d;s/^Link: \(.*\)$/\1/' | tr '\012' ' '` lib" |
||
88 | AC_MSG_RESULT($sysdep_dirs) |
||
89 | AC_SUBST(sysdep_dirs) |
||
90 | 2f9bcf97 | Martin Mares | |
91 | AC_MSG_CHECKING([protocols]) |
||
92 | protocols=`echo "$with_protocols" | sed 's/,/ /g'` |
||
93 | b296730c | Martin Mares | if test "$protocols" = no ; then protocols= ; fi |
94 | 2f9bcf97 | Martin Mares | for a in $protocols ; do |
95 | if ! test -f $srcdir/proto/$a/Makefile ; then |
||
96 | AC_MSG_RESULT(failed) |
||
97 | AC_MSG_ERROR([Requested protocol $a not found.]) |
||
98 | fi |
||
99 | AC_DEFINE_UNQUOTED(CONFIG_`echo $a | tr 'a-z' 'A-Z'`) |
||
100 | done |
||
101 | AC_MSG_RESULT(ok) |
||
102 | 49e7e5ee | Martin Mares | AC_SUBST(protocols) |
103 | 2f9bcf97 | Martin Mares | |
104 | AC_PROG_CC |
||
105 | if test -z "$GCC" ; then |
||
106 | AC_MSG_ERROR([This program requires the GNU C Compiler.]) |
||
107 | fi |
||
108 | AC_MSG_CHECKING([what CFLAGS should we use]) |
||
109 | if test "$ac_test_CFLAGS" != set ; then |
||
110 | c817b991 | Martin Mares | if test "$enable_warnings" = yes ; then |
111 | WARNS="" |
||
112 | else |
||
113 | WARNS=" -Wno-unused" |
||
114 | fi |
||
115 | CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-parentheses$WARNS" |
||
116 | 2f9bcf97 | Martin Mares | fi |
117 | a07e9d82 | Martin Mares | if test "$with_sysinclude" != no -a -n "$with_sysinclude"; then |
118 | CPPFLAGS="$CPPFLAGS -I$with_sysinclude" |
||
119 | fi |
||
120 | 2f9bcf97 | Martin Mares | AC_MSG_RESULT($CFLAGS) |
121 | |||
122 | AC_PROG_CPP |
||
123 | AC_PROG_INSTALL |
||
124 | AC_PROG_RANLIB |
||
125 | AC_CHECK_PROG(FLEX, flex, flex) |
||
126 | AC_CHECK_PROG(BISON, bison, bison) |
||
127 | e4912e35 | Martin Mares | AC_CHECK_PROGS(M4, gm4 m4, m4) |
128 | 2f9bcf97 | Martin Mares | if test -z "$FLEX" -o -z "$BISON" -o -z "$M4" ; then |
129 | AC_MSG_ERROR([Some tools required for building BIRD are missing.]) |
||
130 | fi |
||
131 | |||
132 | a07e9d82 | Martin Mares | case $sysdesc in |
133 | c817b991 | Martin Mares | */linux-22*|*/linux-v6*) |
134 | AC_CHECK_HEADER(linux/rtnetlink.h,,[AC_MSG_ERROR([Appropriate version of Linux kernel headers not found.])]) |
||
135 | ;; |
||
136 | a07e9d82 | Martin Mares | esac |
137 | |||
138 | 2f9bcf97 | Martin Mares | AC_CHECK_HEADER(syslog.h, [AC_DEFINE(HAVE_SYSLOG)]) |
139 | |||
140 | BIRD_CHECK_INTEGERS |
||
141 | BIRD_CHECK_ENDIAN |
||
142 | BIRD_CHECK_STRUCT_ALIGN |
||
143 | BIRD_CHECK_TIME_T |
||
144 | 620c4f90 | Martin Mares | BIRD_CHECK_STRUCT_IP_MREQN |
145 | 2f9bcf97 | Martin Mares | |
146 | if test "$enable_debug" = yes ; then |
||
147 | AC_DEFINE(DEBUGGING) |
||
148 | 7a2105be | Martin Mares | AC_CHECK_LIB(dmalloc, dmalloc_debug) |
149 | if test $ac_cv_lib_dmalloc_dmalloc_debug != yes ; then |
||
150 | AC_CHECK_LIB(efence, malloc) |
||
151 | fi |
||
152 | 2f9bcf97 | Martin Mares | fi |
153 | |||
154 | 7211be1c | Martin Mares | CLIENT= |
155 | CLIENT_LIBS= |
||
156 | 9fac310d | Martin Mares | if test "$enable_client" = yes ; then |
157 | CLIENT=client |
||
158 | 7211be1c | Martin Mares | AC_CHECK_LIB(history, add_history, CLIENT_LIBS="-lhistory") |
159 | AC_CHECK_LIB(ncurses, tgetent, USE_TERMCAP_LIB=-lncurses, |
||
160 | AC_CHECK_LIB(curses, tgetent, USE_TERMCAP_LIB=-lcurses, |
||
161 | AC_CHECK_LIB(termcap, tgetent, USE_TERMCAP_LIB=-ltermcap))) |
||
162 | 1d4ba658 | Martin Mares | AC_CHECK_LIB(readline, rl_callback_read_char, CLIENT_LIBS="-lreadline $CLIENT_LIBS $USE_TERMCAP_LIB", |
163 | df0cf75d | Martin Mares | AC_MSG_ERROR([[The client requires GNU readline library 2.1 or newer. Either install the library or use --disable-client to compile without the client.]]), $USE_TERMCAP_LIB) |
164 | 9fac310d | Martin Mares | fi |
165 | AC_SUBST(CLIENT) |
||
166 | 7211be1c | Martin Mares | AC_SUBST(CLIENT_LIBS) |
167 | 9fac310d | Martin Mares | |
168 | 54165b13 | Martin Mares | mkdir -p $objdir/sysdep |
169 | AC_CONFIG_HEADER($objdir/sysdep/autoconf.h:sysdep/autoconf.h.in) |
||
170 | 2c2f67bd | Martin Mares | AC_OUTPUT_COMMANDS(,[CPP="$CPP" $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs]) |
171 | 49e7e5ee | Martin Mares | AC_OUTPUT($makefiles) |
172 | 2f9bcf97 | Martin Mares | |
173 | cat >&AC_FD_MSG <<EOF |
||
174 | |||
175 | BIRD was configured with the following options: |
||
176 | b296730c | Martin Mares | Source directory: $srcdir |
177 | Object directory: $objdir |
||
178 | 49e7e5ee | Martin Mares | System configuration: $sysdesc |
179 | 2f9bcf97 | Martin Mares | Debugging: $enable_debug |
180 | Routing protocols: $protocols |
||
181 | 9fac310d | Martin Mares | Client: $enable_client |
182 | 2f9bcf97 | Martin Mares | EOF |
183 | b296730c | Martin Mares | rm -f $objdir/.*-stamp |