From 147078f43db61e75301a80a0d2eb182c945e9e74 Mon Sep 17 00:00:00 2001 From: David Adam Date: Mon, 8 Dec 2014 08:43:38 +0800 Subject: Solaris build fixes: use _sys_errs if available --- configure.ac | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) (limited to 'configure.ac') diff --git a/configure.ac b/configure.ac index 99a12cd4..cba17847 100644 --- a/configure.ac +++ b/configure.ac @@ -694,6 +694,56 @@ else AC_MSG_RESULT(no) fi +# Check for sys_errlist +AC_MSG_CHECKING([for sys_errlist array]) +AC_TRY_LINK( + [ + #include + ], + [ + const char *p; + p = sys_errlist[sys_nerr]; + ], + have_sys_errlist=yes, + have_sys_errlist=no +) +if test "$have_sys_errlist" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE( + [HAVE_SYS_ERRLIST], + [1], + [Define to 1 if the sys_errlist array is available.] + ) +else + AC_MSG_RESULT(no) +fi + +# Check for _sys_errs +AC_MSG_CHECKING([for _sys_errs array]) +AC_TRY_LINK( + [ + #include + ], + [ + std::string p; + extern const char _sys_errs[]; + extern const int _sys_index[]; + p = _sys_errs[_sys_index[0]]; + ], + have__sys__errs=yes, + have__sys__errs=no +) +if test "$have__sys__errs" = yes; then + AC_MSG_RESULT(yes) + AC_DEFINE( + [HAVE__SYS__ERRS], + [1], + [Define to 1 if the _sys_errs array is available.] + ) +else + AC_MSG_RESULT(no) +fi + # Check if getopt_long exists and works AC_MSG_CHECKING([if getopt_long exists and works]) AC_TRY_LINK( -- cgit v1.2.3