Revision ab188fb7

View differences:

configure.in
6 6
AC_INIT(conf/confbase.Y)
7 7
AC_CONFIG_AUX_DIR(tools)
8 8

  
9
AC_ARG_ENABLE(debug,[  --enable-debug          enable internal debugging routines (default: disabled)],,enable_debug=no)
10
AC_ARG_ENABLE(memcheck,[  --enable-memcheck       check memory allocations when debugging (default: enabled)],,enable_memcheck=yes)
11
AC_ARG_ENABLE(client,[  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
12
AC_ARG_ENABLE(ipv6,[  --enable-ipv6           enable building of IPv6 version (default: disabled)],,enable_ipv6=no)
13
AC_ARG_WITH(sysconfig,[  --with-sysconfig=FILE   use specified BIRD system configuration file])
14
AC_ARG_WITH(protocols,[  --with-protocols=LIST   include specified routing protocols (default: all)],,[with_protocols="all"])
15
AC_ARG_WITH(sysinclude,[  --with-sysinclude=PATH  search for system includes on specified place])
16
AC_ARG_WITH(iproutedir,[  --with-iproutedir=PATH  path to iproute2 config files (default: /etc/iproute2)],[given_iproutedir="yes"])
17
AC_ARG_VAR([FLEX], [location of the Flex program]) 
18
AC_ARG_VAR([BISON], [location of the Bison program]) 
19
AC_ARG_VAR([M4], [location of the M4 program]) 
9
AC_ARG_ENABLE(debug,	[  --enable-debug          enable internal debugging routines (default: disabled)],,enable_debug=no)
10
AC_ARG_ENABLE(memcheck,	[  --enable-memcheck       check memory allocations when debugging (default: enabled)],,enable_memcheck=yes)
11
AC_ARG_ENABLE(client,	[  --enable-client         enable building of BIRD client (default: enabled)],,enable_client=yes)
12
AC_ARG_ENABLE(ipv6,	[  --enable-ipv6           enable building of IPv6 version (default: disabled)],,enable_ipv6=no)
13
AC_ARG_WITH(suffix,	[  --with-suffix=STRING    use specified suffix for BIRD files (default: 6 for IPv6 version)],[given_suffix="yes"])
14
AC_ARG_WITH(sysconfig,	[  --with-sysconfig=FILE   use specified BIRD system configuration file])
15
AC_ARG_WITH(protocols,	[  --with-protocols=LIST   include specified routing protocols (default: all)],,[with_protocols="all"])
16
AC_ARG_WITH(sysinclude,	[  --with-sysinclude=PATH  search for system includes on specified place])
17
AC_ARG_WITH(runtimedir,	[  --with-runtimedir=PATH  path for runtime files (default: $(localstatedir)/run)],[runtimedir="$with_runtimedir"],[runtimedir="\$(localstatedir)/run"])
18
AC_ARG_WITH(iproutedir,	[  --with-iproutedir=PATH  path to iproute2 config files (default: /etc/iproute2)],[given_iproutedir="yes"])
19
AC_ARG_VAR([FLEX], [location of the Flex program])
20
AC_ARG_VAR([BISON], [location of the Bison program])
21
AC_ARG_VAR([M4], [location of the M4 program])
22

  
20 23

  
21 24
if test "$srcdir" = . ; then
22 25
	# Building in current directory => create obj directory holding all objects
......
39 42
AC_SUBST(objdir)
40 43
AC_SUBST(exedir)
41 44
AC_SUBST(srcdir_rel_mf)
45
AC_SUBST(runtimedir)
42 46

  
43 47
if test "$enable_ipv6" = yes ; then
44 48
	ip=ipv6
45
	SUFFIX6=6
49
	SUFFIX=6
46 50
	all_protocols=bgp,ospf,pipe,radv,rip,static
47 51
else
48 52
	ip=ipv4
49
	SUFFIX6=""
53
	SUFFIX=""
50 54
	all_protocols=bgp,ospf,pipe,rip,static
51 55
fi
52 56

  
57
if test "$given_suffix" = yes ; then
58
   	SUFFIX="$with_suffix"
59
fi
60
AC_SUBST(SUFFIX)
61

  
53 62
if test "$with_protocols" = all ; then
54 63
	with_protocols="$all_protocols"
55 64
fi
56 65

  
66
if test "$enable_debug" = yes ; then
67
	CONFIG_FILE="bird$SUFFIX.conf"
68
	CONTROL_SOCKET="bird$SUFFIX.ctl"
69
else
70
	CONFIG_FILE="\$(sysconfdir)/bird$SUFFIX.conf"
71
	CONTROL_SOCKET="$runtimedir/bird$SUFFIX.ctl"
72
fi
73
AC_SUBST(CONFIG_FILE)
74
AC_SUBST(CONTROL_SOCKET)
75

  
57 76
AC_SEARCH_LIBS(clock_gettime,[c rt posix4])
58 77

  
59 78
AC_CANONICAL_HOST
......
225 244
fi
226 245
AC_SUBST(CLIENT)
227 246
AC_SUBST(CLIENT_LIBS)
228
AC_SUBST(SUFFIX6)
229 247

  
230 248
mkdir -p $objdir/sysdep
231 249
AC_CONFIG_HEADERS([$objdir/sysdep/autoconf.h:sysdep/autoconf.h.in])
sysdep/autoconf.h.in
62 62
/* We have stdint.h */
63 63
#undef HAVE_STDINT_H
64 64

  
65
#define CONFIG_PATH ?
sysdep/config.h
37 37

  
38 38
#endif
39 39

  
40
/* Path to configuration file */
41
#ifdef IPV6
42
#  ifdef DEBUGGING
43
#    define PATH_CONFIG "bird6.conf"
44
#    define PATH_CONTROL_SOCKET "bird6.ctl"
45
#  else
46
#    define PATH_CONFIG PATH_CONFIG_DIR "/bird6.conf"
47
#    define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird6.ctl"
48
#  endif
49
#else
50
#  ifdef DEBUGGING
51
#    define PATH_CONFIG "bird.conf"
52
#    define PATH_CONTROL_SOCKET "bird.ctl"
53
#  else
54
#    define PATH_CONFIG PATH_CONFIG_DIR "/bird.conf"
55
#    define PATH_CONTROL_SOCKET PATH_CONTROL_SOCKET_DIR "/bird.ctl"
56
#  endif
57
#endif
58

  
59 40
#endif
sysdep/unix/main.c
151 151
#endif // PATH_IPROUTE_DIR
152 152

  
153 153

  
154
static char *config_name = PATH_CONFIG;
154
static char *config_name = PATH_CONFIG_FILE;
155 155

  
156 156
static int
157 157
cf_read(byte *dest, unsigned int len, int fd)
tools/Makefile.in
48 48

  
49 49
sysdep/paths.h:
50 50
	echo >sysdep/paths.h "/* Generated by Makefile, don't edit manually! */"
51
	echo >>sysdep/paths.h "#define PATH_CONFIG_DIR \"$(sysconfdir)\""
52
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET_DIR \"$(localstatedir)/run\""
51
	echo >>sysdep/paths.h "#define PATH_CONFIG_FILE \"@CONFIG_FILE@\""
52
	echo >>sysdep/paths.h "#define PATH_CONTROL_SOCKET \"@CONTROL_SOCKET@\""
53 53
	if test -n "@iproutedir@" ; then echo >>sysdep/paths.h "#define PATH_IPROUTE_DIR \"@iproutedir@\"" ; fi
54 54

  
55 55
tags:
56 56
	cd $(srcdir) ; etags -lc `find $(static-dirs) $(addprefix $(objdir)/,$(dynamic-dirs)) $(client-dirs) -name *.[chY]`
57 57

  
58 58
install: all
59
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/$(localstatedir)/run
60
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX6@
59
	$(INSTALL) -d $(DESTDIR)/$(sbindir) $(DESTDIR)/$(sysconfdir) $(DESTDIR)/@runtimedir@
60
	$(INSTALL_PROGRAM) -s $(exedir)/bird $(DESTDIR)/$(sbindir)/bird@SUFFIX@
61 61
	if test -n "@CLIENT@" ; then								\
62
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX6@ ;				\
62
		$(INSTALL_PROGRAM) -s $(exedir)/birdc $(DESTDIR)/$(sbindir)/birdc@SUFFIX@ ;	\
63 63
	fi
64
	if ! test -f $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ; then						\
65
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/$(sysconfdir)/bird@SUFFIX6@.conf ;	\
64
	if ! test -f $(DESTDIR)/@CONFIG_FILE@ ; then						\
65
		$(INSTALL_DATA) $(srcdir)/doc/bird.conf.example $(DESTDIR)/@CONFIG_FILE@ ;	\
66 66
	else											\
67
		echo "Not overwriting old bird@SUFFIX@.conf" ;						\
67
		echo "Not overwriting old bird@SUFFIX@.conf" ;					\
68 68
	fi
69 69

  
70 70
install-docs:

Also available in: Unified diff