./Config fixes for Solaris

This commit is contained in:
codemastr 2003-05-30 20:31:07 +00:00
parent b3576b29db
commit 825ee732bf
4 changed files with 26 additions and 385 deletions

View file

@ -2198,3 +2198,5 @@ seen. gmtime warning still there
UnrealIRCd by Onliner).
- Doc updates
- Removed "Duplicate user entry in SJOIN" notice because the problem has been traced down.
- Fixed some ./Config problems on Solaris with IPv6, SSL, and some other misc. things
(#0001004) reported by lion.

44
autoconf/aclocal.m4 vendored
View file

@ -344,48 +344,6 @@ fi
])dnl ACX_PTHREAD
dnl Written by Caolan McNamara <caolan@skynet.ie>, modified slightly by codemastr
AC_DEFUN(AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R,[
AC_CHECK_FUNC(gethostbyname_r)
if test "$ac_cv_func_gethostbyname_r" = "yes"; then
AC_CACHE_CHECK(how many parameters gethostbyname_r takes, ac_cv_func_which_gethostname_r, [
AC_TRY_COMPILE([#include <netdb.h>], [
char *name;
struct hostent *he;
struct hostent_data data;
(void) gethostbyname_r(name, he, &data);
],ac_cv_func_which_gethostname_r=three, [
AC_TRY_COMPILE([#include <netdb.h>], [
char *name;
struct hostent *he, *res;
char buffer[2048];
int buflen = 2048;
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
],ac_cv_func_which_gethostname_r=six, [
AC_TRY_COMPILE([#include <netdb.h>], [
char *name;
struct hostent *he;
char buffer[2048];
int buflen = 2048;
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
],ac_cv_func_which_gethostname_r=five,ac_cv_func_which_gethostname_r=no)
])
])],ac_cv_func_which_gethostname_r=no)]
if test "$ac_cv_func_which_gethostname_r" = "six"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_6)
elif test "$ac_cv_func_which_gethostname_r" = "five"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_5)
elif test "$ac_cv_func_which_gethostname_r" = "three"; then
AC_DEFINE(HAVE_GETHOSTBYNAME_R_3)
fi
fi
)])
dnl the following 2 macros are based on CHECK_SSL by Mark Ethan Trostler <trostler@juniper.net>
AC_DEFUN([CHECK_SSL],
@ -401,7 +359,7 @@ AC_MSG_CHECKING(for openssl)
if test -f "$dir/include/openssl/ssl.h"; then
AC_MSG_RESULT(found in $ssldir/include/openssl)
found_ssl="yes";
CFLAGS="$CFLAGS -I$ssldir/include/openssl";
CFLAGS="$CFLAGS -I$ssldir/include";
break;
fi
if test -f "$dir/include/ssl.h"; then

View file

@ -28,8 +28,8 @@ AC_PATH_PROG(INSTALL,install)
dnl Checks for libraries.
AC_CHECK_LIB(descrypt, crypt, [AC_DEFINE(HAVE_CRYPT) IRCDLIBS="$IRCDLIBS-ldescrypt " MKPASSWDLIBS="-ldescrypt"],
AC_CHECK_LIB(crypt, crypt,[ AC_DEFINE(HAVE_CRYPT) IRCDLIBS="$IRCDLIBS-lcrypt " MKPASSWDLIBS="-lcrypt"]))
AC_CHECK_LIB(socket, socket,IRCDLIBS="$IRCDLIBS-lsocket ")
AC_CHECK_LIB(nsl, inet_ntoa,IRCDLIBS="$IRCDLIBS-lnsl ")
AC_CHECK_LIB(socket, socket,IRCDLIBS="$IRCDLIBS-lsocket " SOCKLIB="-lsocket")
AC_CHECK_LIB(nsl, inet_ntoa,IRCDLIBS="$IRCDLIBS-lnsl " INETLIB="-lnsl")
AC_SUBST(IRCDLIBS)
AC_SUBST(MKPASSWDLIBS)
@ -99,6 +99,8 @@ AC_DEFINE(DYNAMIC_LINKING)
])
AC_DEFUN(AC_ENABLE_INET6,[
AC_CACHE_CHECK(if your system has IPv6 support, ac_cv_ip6, [
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
@ -114,6 +116,7 @@ AC_MSG_WARN(Your system does not support IPv6 so it will not be enabled)
else
AC_DEFINE(INET6)
fi
LIBS="$save_libs"
])
AC_CHECK_HEADER(sys/param.h,AC_DEFINE(PARAMH))
AC_CHECK_HEADER(stdlib.h,AC_DEFINE(STDLIBH))
@ -123,7 +126,6 @@ AC_CHECK_HEADER(unistd.h,AC_DEFINE(UNISTDH))
AC_CHECK_HEADER(string.h,AC_DEFINE(STRINGH))
AC_CHECK_HEADER(strings.h,AC_DEFINE(STRINGSH))
AC_CHECK_HEADER(regex.h,AC_DEFINE(HAVE_REGEX),AC_INSTALL_REGEX)
AC_CHECK_HEADER(openssl/ssl.h,openssl=yes)
AC_CHECK_HEADER(malloc.h,AC_DEFINE(MALLOCH,<malloc.h>))
AC_CHECK_HEADER(sys/rusage.h,AC_DEFINE(RUSAGEH))
AC_CHECK_HEADER(glob.h,AC_DEFINE(GLOBH))
@ -137,6 +139,8 @@ AC_TYPE_UID_T
unreal_CHECK_TYPE_SIZES
AC_CACHE_CHECK(what kind of nonblocking sockets you have, ac_cv_nonblocking,[
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
AC_TRY_RUN([
#include <sys/types.h>
#include <sys/socket.h>
@ -220,6 +224,7 @@ AC_DEFINE(NBLOCK_BSD)
elif test "$ac_cv_nonblocking" = "FIONBIO"; then
AC_DEFINE(NBLOCK_SYSV)
fi
LIBS="$save_libs"
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_FUNC_SETPGRP
@ -299,9 +304,12 @@ AC_CHECK_FUNCS(bcopy,,AC_DEFINE(NEED_BCOPY))
AC_CHECK_FUNCS(bcmp,,AC_DEFINE(NEED_BCMP))
AC_CHECK_FUNCS(bzero,,AC_DEFINE(NEED_BZERO))
AC_CHECK_FUNCS(strcasecmp,AC_DEFINE(GOT_STRCASECMP))
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB $INETLIB"
AC_CHECK_FUNCS(inet_addr,,AC_DEFINE(NEED_INET_ADDR))
AC_CHECK_FUNCS(inet_ntoa,,AC_DEFINE(NEED_INET_NTOA))
AC_CHECK_FUNCS(inet_netof,,AC_DEFINE(NEED_INET_NETOF))
LIBS="$save_libs"
AC_CHECK_FUNCS(syslog,AC_DEFINE(HAVE_SYSLOG))
AC_CHECK_FUNCS(vsyslog,AC_DEFINE(HAVE_VSYSLOG))
AC_SUBST(REGEX)
@ -336,7 +344,6 @@ AC_ARG_ENABLE(dynamic-linking, [ --enable-dynamic-linking Make the IRCd dyna
AC_ARG_ENABLE(inet6, [ --enable-inet6 Make the IRCd support IPv6 ], AC_ENABLE_INET6)
AC_SUBST(IRCDDIR)
AC_SUBST(BINDIR)
AC_caolan_FUNC_WHICH_GETHOSTBYNAME_R
AC_MSG_CHECKING(if FD_SETSIZE is large enough to allow $ac_fd file descriptors)
AC_TRY_RUN([
#include <sys/types.h>

350
configure vendored
View file

@ -2402,7 +2402,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_socket_socket" >&5
echo "${ECHO_T}$ac_cv_lib_socket_socket" >&6
if test $ac_cv_lib_socket_socket = yes; then
IRCDLIBS="$IRCDLIBS-lsocket "
IRCDLIBS="$IRCDLIBS-lsocket " SOCKLIB="-lsocket"
fi
echo "$as_me:$LINENO: checking for inet_ntoa in -lnsl" >&5
@ -2461,7 +2461,7 @@ fi
echo "$as_me:$LINENO: result: $ac_cv_lib_nsl_inet_ntoa" >&5
echo "${ECHO_T}$ac_cv_lib_nsl_inet_ntoa" >&6
if test $ac_cv_lib_nsl_inet_ntoa = yes; then
IRCDLIBS="$IRCDLIBS-lnsl "
IRCDLIBS="$IRCDLIBS-lnsl " INETLIB="-lnsl"
fi
@ -3751,112 +3751,6 @@ REGEX="../extras/regex/regex.o"
fi
if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking openssl/ssl.h usability" >&5
echo $ECHO_N "checking openssl/ssl.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
$ac_includes_default
#include <openssl/ssl.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking openssl/ssl.h presence" >&5
echo $ECHO_N "checking openssl/ssl.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <openssl/ssl.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
egrep -v '^ *\+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc in
yes:no )
{ echo "$as_me:$LINENO: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: openssl/ssl.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;};;
no:yes )
{ echo "$as_me:$LINENO: WARNING: openssl/ssl.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: openssl/ssl.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: openssl/ssl.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: openssl/ssl.h: proceeding with the preprocessor's result" >&2;};;
esac
echo "$as_me:$LINENO: checking for openssl/ssl.h" >&5
echo $ECHO_N "checking for openssl/ssl.h... $ECHO_C" >&6
if test "${ac_cv_header_openssl_ssl_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_openssl_ssl_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_openssl_ssl_h" >&5
echo "${ECHO_T}$ac_cv_header_openssl_ssl_h" >&6
fi
if test $ac_cv_header_openssl_ssl_h = yes; then
openssl=yes
fi
if test "${ac_cv_header_malloc_h+set}" = set; then
echo "$as_me:$LINENO: checking for malloc.h" >&5
echo $ECHO_N "checking for malloc.h... $ECHO_C" >&6
@ -6694,6 +6588,8 @@ if test "${ac_cv_nonblocking+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
echo "$as_me: error: cannot run test program while cross compiling" >&2;}
@ -6879,6 +6775,7 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
LIBS="$save_libs"
if test $ac_cv_c_compiler_gnu = yes; then
echo "$as_me:$LINENO: checking whether $CC needs -traditional" >&5
echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6
@ -9048,6 +8945,8 @@ _ACEOF
fi
done
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB $INETLIB"
for ac_func in inet_addr
do
@ -9291,6 +9190,7 @@ _ACEOF
fi
done
LIBS="$save_libs"
for ac_func in syslog
do
@ -9611,7 +9511,7 @@ echo $ECHO_N "checking for openssl... $ECHO_C" >&6
echo "$as_me:$LINENO: result: found in $ssldir/include/openssl" >&5
echo "${ECHO_T}found in $ssldir/include/openssl" >&6
found_ssl="yes";
CFLAGS="$CFLAGS -I$ssldir/include/openssl";
CFLAGS="$CFLAGS -I$ssldir/include";
break;
fi
if test -f "$dir/include/ssl.h"; then
@ -9940,6 +9840,8 @@ if test "${ac_cv_ip6+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
save_libs="$LIBS"
LIBS="$LIBS $SOCKLIB"
if test "$cross_compiling" = yes; then
{ { echo "$as_me:$LINENO: error: cannot run test program while cross compiling" >&5
echo "$as_me: error: cannot run test program while cross compiling" >&2;}
@ -9992,239 +9894,11 @@ cat >>confdefs.h <<\_ACEOF
_ACEOF
fi
LIBS="$save_libs"
fi;
echo "$as_me:$LINENO: checking for gethostbyname_r" >&5
echo $ECHO_N "checking for gethostbyname_r... $ECHO_C" >&6
if test "${ac_cv_func_gethostbyname_r+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char gethostbyname_r (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gethostbyname_r ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_gethostbyname_r) || defined (__stub___gethostbyname_r)
choke me
#else
f = gethostbyname_r;
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_gethostbyname_r=yes
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_func_gethostbyname_r=no
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_gethostbyname_r" >&5
echo "${ECHO_T}$ac_cv_func_gethostbyname_r" >&6
if test "$ac_cv_func_gethostbyname_r" = "yes"; then
echo "$as_me:$LINENO: checking how many parameters gethostbyname_r takes" >&5
echo $ECHO_N "checking how many parameters gethostbyname_r takes... $ECHO_C" >&6
if test "${ac_cv_func_which_gethostname_r+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <netdb.h>
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
char *name;
struct hostent *he;
struct hostent_data data;
(void) gethostbyname_r(name, he, &data);
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_which_gethostname_r=three
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <netdb.h>
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
char *name;
struct hostent *he, *res;
char buffer[2048];
int buflen = 2048;
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &res, &h_errnop)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_which_gethostname_r=six
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
#include <netdb.h>
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
char *name;
struct hostent *he;
char buffer[2048];
int buflen = 2048;
int h_errnop;
(void) gethostbyname_r(name, he, buffer, buflen, &h_errnop)
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_func_which_gethostname_r=five
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
ac_cv_func_which_gethostname_r=no
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_func_which_gethostname_r" >&5
echo "${ECHO_T}$ac_cv_func_which_gethostname_r" >&6
if test "$ac_cv_func_which_gethostname_r" = "six"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_6 1
_ACEOF
elif test "$ac_cv_func_which_gethostname_r" = "five"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_5 1
_ACEOF
elif test "$ac_cv_func_which_gethostname_r" = "three"; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_GETHOSTBYNAME_R_3 1
_ACEOF
fi
fi
echo "$as_me:$LINENO: checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors" >&5
echo $ECHO_N "checking if FD_SETSIZE is large enough to allow $ac_fd file descriptors... $ECHO_C" >&6
if test "$cross_compiling" = yes; then