Revision 49e7e5ee configure.in

View differences:

configure.in
10 10
AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
11 11
AC_ARG_WITH(protocols,[  --with-protocols=LIST   include specified routing protocols (default: rip,static)],,[with_protocols="rip,static"])
12 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

  
13 35
AC_CANONICAL_HOST
14 36
AC_MSG_CHECKING([which OS configuration should we use])
15 37
if test -n "$with_sysconfig" -a "$with_sysconfig" != no ; then
16
	case "$with_sysconfig" in *.h) ;; *) with_sysconfig="$with_sysconfig.h" ;; esac
17 38
	if test -f $with_sysconfig ; then
18
		SYSDESC=$with_sysconfig
39
		sysdesc=$with_sysconfig
19 40
	else
20
		SYSDESC=sysdep/cf/$with_sysconfig
41
		sysdesc=$srcdir/sysdep/cf/$with_sysconfig
42
		if ! test -f $sysdesc ; then
43
			sysdesc=$sysdesc.h
44
		fi
21 45
	fi
22 46
elif test -f sysconfig.h ; then
23
	SYSDESC=sysconfig
47
	sysdesc=sysconfig
24 48
else
25 49
	case "$host_os" in
26
		linux*)		SYSDESC=linux-20 ;;
50
		linux*)		sysdesc=linux-20 ;;
27 51
		*)		AC_MSG_RESULT(unknown)
28 52
				AC_MSG_ERROR([Cannot determine correct system configuration.])
29 53
				;;
30 54
		esac
31
	SYSDESC=sysdep/cf/$SYSDESC.h
55
	sysdesc=$srcdir/sysdep/cf/$sysdesc.h
32 56
fi
33
AC_MSG_RESULT($SYSDESC)
34
if ! test -f $SYSDESC ; then
57
AC_MSG_RESULT($sysdesc)
58
if ! test -f $sysdesc ; then
35 59
	AC_MSG_ERROR([The system configuration file is missing.])
36 60
fi
37
AC_DEFINE_UNQUOTED(SYSCONF_INCLUDE, "$SYSDESC")
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)
38 68

  
39 69
AC_MSG_CHECKING([protocols])
40 70
protocols=`echo "$with_protocols" | sed 's/,/ /g'`
......
46 76
	AC_DEFINE_UNQUOTED(CONFIG_`echo $a | tr 'a-z' 'A-Z'`)
47 77
	done
48 78
AC_MSG_RESULT(ok)
79
AC_SUBST(protocols)
49 80

  
50 81
AC_PROG_CC
51 82
if test -z "$GCC" ; then
......
82 113
fi
83 114

  
84 115
AC_CONFIG_HEADER(sysdep/autoconf.h)
85
AC_OUTPUT
116
AC_OUTPUT_COMMANDS(,[$srcdir/tools/mergedirs $srcdir $srcdir_rel $objdir $sysdep_dirs])
117
AC_OUTPUT($makefiles)
86 118

  
87 119
cat >&AC_FD_MSG <<EOF
88 120

  
89 121
BIRD was configured with the following options:
90
	System configuration:	$SYSDESC
122
	System configuration:	$sysdesc
91 123
	Debugging:		$enable_debug
92 124
	Routing protocols:	$protocols
93 125
EOF

Also available in: Unified diff