diff options
author | Jeremy Jackson <jerj@coplanar.net> | 2009-01-21 18:27:37 -0500 |
---|---|---|
committer | Paul Jakma <paul@quagga.net> | 2009-06-19 15:03:31 +0100 |
commit | 5589ffa7dd6846a83e1d312f3dc3f2aa47e40f92 (patch) | |
tree | 036a1285f5de7c5daee1caa0d3e9fddba8841630 | |
parent | 7f177ee8df0437ba0d002c1226201150639dcd09 (diff) |
[configure/cleanup] fix broken autoconf cache variables
Fix zebra_rtread and zebra_ipforward_path.
It looks like someone tried to make this cached, but it was being ignored at
least on autoconf 2.6.1. 2.6.2 now gives a warning about the situation,
hence this fix.
Although they are just warnings, it's dangerous to leave them as-is, because
someone not diligent in reading the autoconf manual might just stick _cv_ in
the name, with the effect that running a ./configure --config-cache would
fail horribly, since variables are being set inside the AC_CACHE_CHECK()
block that would not be seen when the variable's value was read from cache.
Also added m4 quotes [] to macro arguments as autoconf manual
suggests.
-rwxr-xr-x | configure.ac | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/configure.ac b/configure.ac index 56fa55e0..16aad98c 100755 --- a/configure.ac +++ b/configure.ac @@ -837,29 +837,26 @@ main() dnl ------------------------------ dnl check kernel route read method dnl ------------------------------ -AC_CACHE_CHECK(route read method check, zebra_rtread, -[if test "$netlink" = yes; then - RTREAD_METHOD="rtread_netlink.o" - zebra_rtread="netlink" +AC_CACHE_CHECK([route read method], [quagga_cv_rtread_method], +[if test "x$netlink" = xyes; then + quagga_cv_rtread_method="netlink" else -for zebra_rtread in /proc/net/route /dev/ip /dev/null; +for quagga_cv_rtread_method in /proc/net/route /dev/ip /dev/null; do - test x`ls $zebra_rtread 2>/dev/null` = x"$zebra_rtread" && break + test x`ls $quagga_cv_rtread_method 2>/dev/null` = x"$quagga_cv_rtread_method" && break done -case $zebra_rtread in - "/proc/net/route") RTREAD_METHOD="rtread_proc.o" - zebra_rtread="proc";; +case $quagga_cv_rtread_method in + "/proc/net/route") quagga_cv_rtread_method="proc";; "/dev/ip") case "$host" in - *-freebsd*) RTREAD_METHOD=rtread_sysctl.o - zebra_rtread="sysctl";; - *) RTREAD_METHOD="rtread_getmsg.o" - zebra_rtread="getmsg";; + *-freebsd*) quagga_cv_rtread_method="sysctl";; + *) quagga_cv_rtread_method="getmsg";; esac;; - *) RTREAD_METHOD="rtread_sysctl.o" - zebra_rtread="sysctl";; + *) + quagga_cv_rtread_method="sysctl";; esac fi]) +RTREAD_METHOD=rtread_${quagga_cv_rtread_method}.o AC_SUBST(RTREAD_METHOD) dnl ----------------------------- @@ -965,26 +962,22 @@ AC_SUBST(IF_PROC) dnl ----------------------------- dnl check ipforward detect method dnl ----------------------------- -AC_CACHE_CHECK(ipforward method check, zebra_ipforward_path, -[for zebra_ipforward_path in /proc/net/snmp /dev/ip /dev/null; +AC_CACHE_CHECK([ipforward method], [quagga_cv_ipforward_method], +[for quagga_cv_ipforward_method in /proc/net/snmp /dev/ip /dev/null; do - test x`ls $zebra_ipforward_path 2>/dev/null` = x"$zebra_ipforward_path" && break + test x`ls $quagga_cv_ipforward_method 2>/dev/null` = x"$quagga_cv_ipforward_method" && break done -case $zebra_ipforward_path in - "/proc/net/snmp") IPFORWARD=ipforward_proc.o - zebra_ipforward_path="proc";; +case $quagga_cv_ipforward_method in + "/proc/net/snmp") quagga_cv_ipforward_method="proc";; "/dev/ip") case "$host" in - *-nec-sysv4*) IPFORWARD=ipforward_ews.o - zebra_ipforward_path="ews";; - *-freebsd*) IPFORWARD=ipforward_sysctl.o - zebra_ipforward_path="sysctl";; - *) IPFORWARD=ipforward_solaris.o - zebra_ipforward_path="solaris";; + *-nec-sysv4*) quagga_cv_ipforward_method="ews";; + *-freebsd*) quagga_cv_ipforward_method="sysctl";; + *) quagga_cv_ipforward_method="solaris";; esac;; - *) IPFORWARD=ipforward_sysctl.o - zebra_ipforward_path="sysctl";; + *) quagga_cv_ipforward_method="sysctl";; esac]) +IPFORWARD=ipforward_${quagga_cv_ipforward_method}.o AC_SUBST(IPFORWARD) AC_CHECK_FUNCS(getaddrinfo, [have_getaddrinfo=yes], [have_getaddrinfo=no]) |