summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorAlon Bar-Lev <alon.barlev@gmail.com>2012-02-29 22:12:04 +0200
committerDavid Sommerseth <davids@redhat.com>2012-03-22 22:17:26 +0100
commitcab53332e11b9a447883da0c95552c453f760f0b (patch)
tree3f32b25e44b65ec8094741ff47c17da5f6542f66 /configure.ac
parent7647a48c2d2c446ee387316389085fe83c6ef894 (diff)
downloadopenvpn-cab53332e11b9a447883da0c95552c453f760f0b.tar.gz
openvpn-cab53332e11b9a447883da0c95552c453f760f0b.tar.xz
openvpn-cab53332e11b9a447883da0c95552c453f760f0b.zip
build: autoconf: minor cleanups
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com> Acked-by: Adriaan de Jong <dejong@fox-it.com> Acked-by: David Sommerseth <davids@redhat.com> Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac145
1 files changed, 72 insertions, 73 deletions
diff --git a/configure.ac b/configure.ac
index c540f82..98615c6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -400,6 +400,16 @@ AC_CHECK_HEADERS([ \
netinet/tcp.h arpa/inet.h netdb.h \
windows.h winsock2.h ws2tcpip.h \
])
+AC_CHECK_HEADERS([ \
+ sys/time.h sys/un.h sys/ioctl.h sys/stat.h \
+ sys/mman.h sys/file.h \
+ unistd.h signal.h \
+ syslog.h pwd.h grp.h \
+ net/if_tun.h net/tun/if_tun.h stropts.h \
+ sys/sockio.h \
+ sys/uio.h linux/if_tun.h linux/sockios.h \
+ linux/types.h sys/poll.h sys/epoll.h err.h \
+])
SOCKET_INCLUDES="
#ifdef HAVE_STDLIB_H
@@ -425,76 +435,11 @@ SOCKET_INCLUDES="
#endif
"
-if test "${WIN32}" != "yes"; then
- AC_CHECK_HEADERS([ \
- sys/time.h sys/un.h sys/ioctl.h sys/stat.h \
- sys/mman.h sys/file.h \
- syslog.h pwd.h grp.h \
- net/if_tun.h net/tun/if_tun.h stropts.h \
- sys/sockio.h \
- sys/uio.h linux/if_tun.h linux/sockios.h \
- linux/types.h sys/poll.h sys/epoll.h err.h \
- ])
- AC_CHECK_HEADERS(
- [net/if.h netinet/ip.h netinet/if_ether.h resolv.h],
- ,
- ,
- [[${SOCKET_INCLUDES}]]
- )
-
- AC_FUNC_FORK
-fi
-
-dnl We emulate signals in Windows
-AC_CHECK_DECLS(
- [SIGHUP],
- ,
- [AC_DEFINE([SIGHUP], [1], [SIGHUP replacement])],
- [[
- #ifdef HAVE_SIGNAL_H
- #include <signal.h>
- #endif
- ]]
-)
-AC_CHECK_DECLS(
- [SIGINT],
- ,
- [AC_DEFINE([SIGINT], [2], [SIGINT replacement])],
- [[
- #ifdef HAVE_SIGNAL_H
- #include <signal.h>
- #endif
- ]]
-)
-AC_CHECK_DECLS(
- [SIGUSR1],
+AC_CHECK_HEADERS(
+ [net/if.h netinet/ip.h netinet/if_ether.h resolv.h],
,
- [AC_DEFINE([SIGUSR1], [10], [SIGUSR1 replacement])],
- [[
- #ifdef HAVE_SIGNAL_H
- #include <signal.h>
- #endif
- ]]
-)
-AC_CHECK_DECLS(
- [SIGUSR2],
,
- [AC_DEFINE([SIGUSR2], [12], [SIGUSR2 replacement])],
- [[
- #ifdef HAVE_SIGNAL_H
- #include <signal.h>
- #endif
- ]]
-)
-AC_CHECK_DECLS(
- [SIGTERM],
- ,
- [AC_DEFINE([SIGTERM], [15], [SIGTERM replacement])],
- [[
- #ifdef HAVE_SIGNAL_H
- #include <signal.h>
- #endif
- ]]
+ [[${SOCKET_INCLUDES}]]
)
AC_CHECK_TYPES(
@@ -503,8 +448,6 @@ AC_CHECK_TYPES(
[AC_DEFINE([in_addr_t], [uint32_t], [Workaround missing in_addr_t])],
[[${SOCKET_INCLUDES}]]
)
-
-dnl check for IPv6 types
AC_CHECK_TYPE(
[struct tun_pi],
[AC_DEFINE(HAVE_TUN_PI, 1, [struct tun_pi needed for IPv6 support])],
@@ -547,16 +490,72 @@ AC_CHECK_TYPE(
[AC_MSG_ERROR([struct sockaddr_in6 not found, needed for ipv6 transport support.])],
[[${SOCKET_INCLUDES}]]
)
+AC_CHECK_DECLS(
+ [SO_MARK],
+ ,
+ ,
+ [[${SOCKET_INCLUDES}]]
+)
-AC_CHECK_FUNCS(
- [ctime memset vsnprintf strdup],
+dnl We emulate signals in Windows
+AC_CHECK_DECLS(
+ [SIGHUP],
,
- [AC_MSG_ERROR([Required library function not found])]
+ [AC_DEFINE([SIGHUP], [1], [SIGHUP replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
)
+AC_CHECK_DECLS(
+ [SIGINT],
+ ,
+ [AC_DEFINE([SIGINT], [2], [SIGINT replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGUSR1],
+ ,
+ [AC_DEFINE([SIGUSR1], [10], [SIGUSR1 replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGUSR2],
+ ,
+ [AC_DEFINE([SIGUSR2], [12], [SIGUSR2 replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+AC_CHECK_DECLS(
+ [SIGTERM],
+ ,
+ [AC_DEFINE([SIGTERM], [15], [SIGTERM replacement])],
+ [[
+ #ifdef HAVE_SIGNAL_H
+ #include <signal.h>
+ #endif
+ ]]
+)
+
+AC_FUNC_FORK
+
AC_CHECK_FUNCS([ \
daemon chroot getpwnam setuid nice system getpid dup dup2 \
getpass strerror syslog openlog mlockall getgrnam setgid \
setgroups stat flock readv writev time gettimeofday \
+ ctime memset vsnprintf strdup \
setsid chdir putenv getpeername unlink \
chsize ftruncate execve getpeereid umask basename dirname access \
epoll_create \