Statistics
| Branch: | Revision:

iof-bird-daemon / configure.in @ 7a2105be

History | View | Annotate | Download (3.75 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*)		sysdesc=linux-20 ;;
51
		*)		AC_MSG_RESULT(unknown)
52
				AC_MSG_ERROR([Cannot determine correct system configuration.])
53
				;;
54
		esac
55
	sysdesc=$srcdir/sysdep/cf/$sysdesc.h
56
fi
57
AC_MSG_RESULT($sysdesc)
58
if ! test -f $sysdesc ; then
59
	AC_MSG_ERROR([The system configuration file is missing.])
60
fi
61
sysname=`echo $sysdesc | sed 's/\.h$//'`
62
AC_DEFINE_UNQUOTED(SYSCONF_INCLUDE, "$sysdesc")
63

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

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

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

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

    
102
AC_CHECK_HEADER(syslog.h, [AC_DEFINE(HAVE_SYSLOG)])
103

    
104
BIRD_CHECK_INTEGERS
105
BIRD_CHECK_ENDIAN
106
BIRD_CHECK_STRUCT_ALIGN
107
BIRD_CHECK_TIME_T
108

    
109
if test "$enable_debug" = yes ; then
110
	AC_DEFINE(PATH_CONFIG_DIR, ".")
111
	AC_DEFINE(DEBUGGING)
112
	AC_CHECK_LIB(dmalloc, dmalloc_debug)
113
	if test $ac_cv_lib_dmalloc_dmalloc_debug != yes ; then
114
		AC_CHECK_LIB(efence, malloc)
115
	fi
116
else
117
	AC_DEFINE_UNQUOTED(PATH_CONFIG_DIR, "$sysconfdir")
118
fi
119

    
120
AC_CONFIG_HEADER(sysdep/autoconf.h)
121
AC_OUTPUT_COMMANDS(,[CPP="$CPP" $srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs])
122
AC_OUTPUT($makefiles)
123

    
124
cat >&AC_FD_MSG <<EOF
125

    
126
BIRD was configured with the following options:
127
	Source directory:	$srcdir
128
	Object directory:	$objdir
129
	System configuration:	$sysdesc
130
	Debugging:		$enable_debug
131
	Routing protocols:	$protocols
132
EOF
133
rm -f $objdir/.*-stamp