summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-02-29 22:12:01 +0200
committerDavid Sommerseth <davids@redhat.com>2012-03-22 22:17:26 +0100
commitc3fc703d31f47ceef66bc8006e2870e3c4d05ee6 (patch)
tree6f4e4d5d36bddc0fd9fb94027571a2399935f6cb /configure.ac
parent98bc1a3e06a11be62bb1f5ab3d7c1b98dfbabbaa (diff)
downloadopenvpn-c3fc703d31f47ceef66bc8006e2870e3c4d05ee6.tar.gz
openvpn-c3fc703d31f47ceef66bc8006e2870e3c4d05ee6.tar.xz
openvpn-c3fc703d31f47ceef66bc8006e2870e3c4d05ee6.zip
build: autoconf: commands as environment
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac66
1 files changed, 28 insertions, 38 deletions
diff --git a/configure.ac b/configure.ac
index 6b5cf71..ed98464 100644
--- a/configure.ac
+++ b/configure.ac
@@ -267,37 +267,6 @@ AC_ARG_WITH(
)
AC_ARG_WITH(
- [ifconfig-path],
- [AS_HELP_STRING([--with-ifconfig-path=PATH], [Path to ifconfig tool])],
- [IFCONFIG="$withval"],
- [AC_PATH_PROG([IFCONFIG], [ifconfig], [ifconfig], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
-)
-AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool])
-
-AC_ARG_WITH(
- [iproute-path],
- [AS_HELP_STRING([--with-iproute-path=PATH], [Path to iproute tool])],
- [IPROUTE="$withval"],
- [AC_PATH_PROG([IPROUTE], [ip], [ip], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
-)
-AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool])
-
-AC_ARG_WITH([route-path],
- [AS_HELP_STRING([--with-route-path=PATH], [Path to route tool])],
- [ROUTE="$withval"],
- [AC_PATH_PROG([ROUTE], [route], [route], [$PATH:/usr/local/sbin:/usr/sbin:/sbin])]
-)
-AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool])
-
-AC_ARG_WITH(
- [netstat-path],
- [AS_HELP_STRING([--with-netstat-path=PATH], [Path to netstat tool])],
- [NETSTAT="$withval"],
- [AC_PATH_PROG([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc])]
-)
-AC_DEFINE_UNQUOTED([NETSTAT_PATH], ["$NETSTAT"], [Path to netstat tool])
-
-AC_ARG_WITH(
[mem-check],
[AS_HELP_STRING([--with-mem-check=TYPE], [build with debug memory checking, TYPE=dmalloc|valgrind|ssl])],
[
@@ -370,6 +339,20 @@ AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
+AC_ARG_VAR([IFCONFIG], [full path to ipconfig utility])
+AC_ARG_VAR([ROUTE], [full path to route utility])
+AC_ARG_VAR([IPROUTE], [full path to ip utility])
+AC_ARG_VAR([NETSTAT], [path to netstat utility]) # tests
+AC_ARG_VAR([MAN2HTML], [path to man2html utility])
+AC_PATH_PROGS([IFCONFIG], [ifconfig],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_PATH_PROGS([ROUTE], [route],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_PATH_PROGS([IPROUTE], [ip],, [$PATH:/usr/local/sbin:/usr/sbin:/sbin])
+AC_CHECK_PROGS([NETSTAT], [netstat], [netstat], [$PATH:/usr/local/sbin:/usr/sbin:/sbin:/etc]) # tests
+AC_CHECK_PROGS([MAN2HTML], [man2html])
+AC_DEFINE_UNQUOTED([IFCONFIG_PATH], ["$IFCONFIG"], [Path to ifconfig tool])
+AC_DEFINE_UNQUOTED([IPROUTE_PATH], ["$IPROUTE"], [Path to iproute tool])
+AC_DEFINE_UNQUOTED([ROUTE_PATH], ["$ROUTE"], [Path to route tool])
+
#
# Libtool
#
@@ -386,12 +369,6 @@ ifdef(
]
)
-if test "${WIN32}" = "yes"; then
- AC_ARG_VAR([MAN2HTML], [man2html utility])
- AC_CHECK_PROGS([MAN2HTML], [man2html])
- test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
-fi
-
AC_C_CONST
AC_C_INLINE
AC_C_VOLATILE
@@ -920,7 +897,16 @@ test "${enable_pf}" = "yes" && AC_DEFINE([ENABLE_PF], [1], [Enable internal pack
test "${enable_strict_options}" = "yes" && AC_DEFINE([ENABLE_STRICT_OPTIONS_CHECK], [1], [Enable strict options check between peers])
test "${enable_password_save}" = "yes" && AC_DEFINE([ENABLE_PASSWORD_SAVE], [1], [Allow --askpass and --auth-user-pass passwords to be read from a file])
test "${enable_systemd}" = "yes" && AC_DEFINE([ENABLE_SYSTEMD], [1], [Enable systemd support])
-test "${enable_iproute2}" = "yes" && AC_DEFINE([ENABLE_IPROUTE], [1], [enable iproute2 support])
+
+if test "${enable_iproute2}" = "yes"; then
+ test -z "${IPROUTE}" && AC_MSG_ERROR([ip utility is required but missing])
+ AC_DEFINE([ENABLE_IPROUTE], [1], [enable iproute2 support])
+else
+ if test "${WIN32}" != "yes"; then
+ test -z "${ROUTE}" && AC_MSG_ERROR([route utility is required but missing])
+ test -z "${IFCONFIG}" && AC_MSG_ERROR([ifconfig utility is required but missing])
+ fi
+fi
if test "${enable_pedantic}" = "yes"; then
enable_strict="yes"
@@ -930,6 +916,10 @@ if test "${enable_strict}" = "yes"; then
CFLAGS="${CFLAGS} -Wall -Wno-unused-parameter -Wno-unused-function"
fi
+if test "${WIN32}" = "yes"; then
+ test -z "${MAN2HTML}" && AC_MSG_ERROR([man2html is required for win32])
+fi
+
CONFIGURE_DEFINES="`set | grep '^enable_.*=' ; set | grep '^with_.*='`"
AC_DEFINE_UNQUOTED([CONFIGURE_DEFINES], ["`echo ${CONFIGURE_DEFINES}`"], [Configuration settings])