Commit 88cb8667 authored by David Woodhouse's avatar David Woodhouse

Unify $host_os case statement in configure.ac

There's no good reason for the Solaris check to be separate from the rest.
Signed-off-by: default avatarDavid Woodhouse <David.Woodhouse@intel.com>
parent 0f1e5503
......@@ -29,7 +29,11 @@
#include "openconnect-internal.h"
#ifdef __sun__
#ifdef HAVE_SUNOS_BROKEN_TIME
/*
* On SunOS, time() goes backwards. Thankfully, gethrtime() doesn't.
* https://www.illumos.org/issues/1871 and, for Solaris 11, CR7121035.
*/
#include <sys/time.h>
time_t openconnect__time(time_t *t)
......
......@@ -56,6 +56,10 @@ AC_DEFINE_UNQUOTED(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}")
AC_SUBST(DEFAULT_VPNCSCRIPT, "${with_vpnc_script}")
use_openbsd_libtool=
symver_time=
symver_getline=
symver_asprintf=
case $host_os in
*linux* | *gnu*)
AC_MSG_NOTICE([Applying feature macros for GNU build])
......@@ -74,6 +78,11 @@ case $host_os in
AC_MSG_NOTICE([Applying feature macros for OpenBSD build])
use_openbsd_libtool=true
;;
*solaris*|*sunos*)
AC_MSG_NOTICE([Applying workaround for broken SunOS time() function])
AC_DEFINE(HAVE_SUNOS_BROKEN_TIME)
symver_time="openconnect__time;"
;;
*)
# On FreeBSD the only way to get vsyslog() visible is to define
# *nothing*, which makes absolutely everything visible.
......@@ -82,16 +91,6 @@ case $host_os in
;;
esac
symver_time=
symver_getline=
symver_asprintf=
case $host_os in
*solaris*|*sunos*)
symver_time="openconnect__time;"
;;
esac
AC_CHECK_FUNC(fdevname_r, [AC_DEFINE(HAVE_FDEVNAME_R, 1)], [])
AC_CHECK_FUNC(getline, [AC_DEFINE(HAVE_GETLINE, 1)], [symver_getline="openconnect__getline;"])
AC_CHECK_FUNC(strcasestr, [AC_DEFINE(HAVE_STRCASESTR, 1)], [])
......
......@@ -330,7 +330,7 @@ struct openconnect_info {
/****************************************************************************/
/* Oh Solaris how we hate thee! */
#ifdef __sun__
#ifdef HAVE_SUNOS_BROKEN_TIME
#define time(x) openconnect__time(x)
time_t openconnect__time(time_t *t);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment