Statistics
| Branch: | Revision:

iof-bird-daemon / configure.in @ 61fb537c

History | View | Annotate | Download (3.86 KB)

1
dnl ** This is a configure script template for BIRD
2
dnl ** Process it with autoconf to get ./configure
3
dnl ** (c) 1999 Martin Mares <mj@ucw.cz>
4

    
5
AC_REVISION($Id$)
6
AC_INIT(conf/confbase.Y)
7
AC_CONFIG_AUX_DIR(tools)
8

    
9
AC_ARG_ENABLE(debug,[  --enable-debug          enable internal debugging routines (default: enabled)],,enable_debug=yes)
10
AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
11
AC_ARG_WITH(protocols,[  --with-protocols=LIST   include specified routing protocols (default: rip,static)],,[with_protocols="rip,static"])
12

    
13
if test "$srcdir" = . ; then
14
	# Building in current directory => create obj directory holding all objects
15
	objdir=obj
16
	mkdir -p obj
17
	srcdir_rel=..
18
	makefiles="Makefile:tools/Makefile-top.in obj/Makefile:tools/Makefile.in obj/Rules:tools/Rules.in"
19
	exedir=..
20
else
21
	# Building in separate directory
22
	objdir=.
23
	srcdir_rel=$srcdir
24
	makefiles="Makefile:tools/Makefile.in Rules:tools/Rules.in"
25
	exedir=.
26
fi
27
case $srcdir_rel in
28
	/*)	srcdir_rel_mf=$srcdir_rel ;;
29
	*)	srcdir_rel_mf="\$(root-rel)$srcdir_rel" ;;
30
esac
31
AC_SUBST(objdir)
32
AC_SUBST(exedir)
33
AC_SUBST(srcdir_rel_mf)
34

    
35
AC_CANONICAL_HOST
36
AC_MSG_CHECKING([which OS configuration should we use])
37
if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then
38
	if test -f $with_sysconfig ; then
39
		sysdesc=$with_sysconfig
40
	else
41
		sysdesc=$srcdir/sysdep/cf/$with_sysconfig
42
		if ! test -f $sysdesc ; then
43
			sysdesc=$sysdesc.h
44
		fi
45
	fi
46
elif test -f sysconfig.h ; then
47
	sysdesc=sysconfig
48
else
49
	case "$host_os" in
50
		linux*)		case `uname -r` in
51
					1.*|2.0.*)	sysdesc=linux-20 ;;
52
					*)		sysdesc=linux-21 ;;
53
					esac
54
				;;
55
		*)		AC_MSG_RESULT(unknown)
56
				AC_MSG_ERROR([Cannot determine correct system configuration.])
57
				;;
58
		esac
59
	sysdesc=$srcdir/sysdep/cf/$sysdesc.h
60
fi
61
AC_MSG_RESULT($sysdesc)
62
if ! test -f $sysdesc ; then
63
	AC_MSG_ERROR([The system configuration file is missing.])
64
fi
65
sysname=`echo $sysdesc | sed 's/\.h$//'`
66
AC_DEFINE_UNQUOTED(SYSCONF_INCLUDE, "$sysdesc")
67

    
68
AC_MSG_CHECKING([system-dependent directories])
69
sysdep_dirs="`sed <$sysdesc '/^Link: /!d;s/^Link: \(.*\)$/\1/' | tr '\012' ' '` lib"
70
AC_MSG_RESULT($sysdep_dirs)
71
AC_SUBST(sysdep_dirs)
72

    
73
AC_MSG_CHECKING([protocols])
74
protocols=`echo "$with_protocols" | sed 's/,/ /g'`
75
if test "$protocols" = no ; then protocols= ; fi
76
for a in $protocols ; do
77
	if ! test -f $srcdir/proto/$a/Makefile ; then
78
		AC_MSG_RESULT(failed)
79
		AC_MSG_ERROR([Requested protocol $a not found.])
80
		fi
81
	AC_DEFINE_UNQUOTED(CONFIG_`echo $a | tr 'a-z' 'A-Z'`)
82
	done
83
AC_MSG_RESULT(ok)
84
AC_SUBST(protocols)
85

    
86
AC_PROG_CC
87
if test -z "$GCC" ; then
88
	AC_MSG_ERROR([This program requires the GNU C Compiler.])
89
	fi
90
AC_MSG_CHECKING([what CFLAGS should we use])
91
if test "$ac_test_CFLAGS" != set ; then
92
	CFLAGS="$CFLAGS -Wall -W -Wstrict-prototypes -Wno-unused -Wno-parentheses"
93
fi
94
AC_MSG_RESULT($CFLAGS)
95

    
96
AC_PROG_CPP
97
AC_PROG_INSTALL
98
AC_PROG_RANLIB
99
AC_CHECK_PROG(FLEX, flex, flex)
100
AC_CHECK_PROG(BISON, bison, bison)
101
AC_CHECK_PROGS(M4, gm4 m4, m4)
102
if test -z "$FLEX" -o -z "$BISON" -o -z "$M4" ; then
103
	AC_MSG_ERROR([Some tools required for building BIRD are missing.])
104
	fi
105

    
106
AC_CHECK_HEADER(syslog.h, [AC_DEFINE(HAVE_SYSLOG)])
107

    
108
BIRD_CHECK_INTEGERS
109
BIRD_CHECK_ENDIAN
110
BIRD_CHECK_STRUCT_ALIGN
111
BIRD_CHECK_TIME_T
112
BIRD_CHECK_STRUCT_MREQN
113

    
114
if test "$enable_debug" = yes ; then
115
	AC_DEFINE(PATH_CONFIG_DIR, ".")
116
	AC_DEFINE(DEBUGGING)
117
	AC_CHECK_LIB(dmalloc, dmalloc_debug)
118
	if test $ac_cv_lib_dmalloc_dmalloc_debug != yes ; then
119
		AC_CHECK_LIB(efence, malloc)
120
	fi
121
else
122
	AC_DEFINE_UNQUOTED(PATH_CONFIG_DIR, "$sysconfdir")
123
fi
124

    
125
AC_CONFIG_HEADER(sysdep/autoconf.h)
126
AC_OUTPUT_COMMANDS(,[CPP="$CPP" $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs])
127
AC_OUTPUT($makefiles)
128

    
129
cat >&AC_FD_MSG <<EOF
130

    
131
BIRD was configured with the following options:
132
	Source directory:	$srcdir
133
	Object directory:	$objdir
134
	System configuration:	$sysdesc
135
	Debugging:		$enable_debug
136
	Routing protocols:	$protocols
137
EOF
138
rm -f $objdir/.*-stamp