mirror of
https://github.com/znc/znc.git
synced 2026-07-05 17:31:06 +02:00
added a quick check for dlopen in case not required in external lib, also fixes an issue with having one test application not being called inside of a if conditional. seems like possible autoconf bug. check for misc c api functions, probably need to add more
git-svn-id: https://znc.svn.sourceforge.net/svnroot/znc/trunk@256 726aef4b-f618-498e-8847-2d620e286838
This commit is contained in:
@@ -1962,13 +1962,7 @@ if test "${enable_openssl+set}" = set; then
|
||||
NOSSL=1
|
||||
fi;
|
||||
|
||||
if test -z "$NOSSL"; then
|
||||
if test -n "$OPENSSL"; then
|
||||
appendLib -L${OPENSSL}/lib
|
||||
appendInc -I${OPENSSL}/include
|
||||
fi
|
||||
|
||||
ac_ext=c
|
||||
ac_ext=c
|
||||
ac_cpp='$CPP $CPPFLAGS'
|
||||
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
|
||||
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
|
||||
@@ -2699,6 +2693,216 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
for ac_func in stat lstat chmod open
|
||||
do
|
||||
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
|
||||
echo "$as_me:$LINENO: checking for $ac_func" >&5
|
||||
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
|
||||
if eval "test \"\${$as_ac_var+set}\" = set"; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
|
||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||
#define $ac_func innocuous_$ac_func
|
||||
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char $ac_func (); below.
|
||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||
<limits.h> exists even on freestanding compilers. */
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#undef $ac_func
|
||||
|
||||
/* 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 $ac_func ();
|
||||
/* 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_$ac_func) || defined (__stub___$ac_func)
|
||||
choke me
|
||||
#else
|
||||
char (*f) () = $ac_func;
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return f != $ac_func;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (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); }; } &&
|
||||
{ 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
|
||||
eval "$as_ac_var=yes"
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
eval "$as_ac_var=no"
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
|
||||
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
|
||||
if test `eval echo '${'$as_ac_var'}'` = yes; then
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
|
||||
_ACEOF
|
||||
|
||||
else
|
||||
echo "Missing Required libc feature" && exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
if test "$MODULES" = "yes"; then
|
||||
echo "$as_me:$LINENO: checking for dlopen" >&5
|
||||
echo $ECHO_N "checking for dlopen... $ECHO_C" >&6
|
||||
if test "${ac_cv_func_dlopen+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.h. */
|
||||
/* Define dlopen to an innocuous variant, in case <limits.h> declares dlopen.
|
||||
For example, HP-UX 11i <limits.h> declares gettimeofday. */
|
||||
#define dlopen innocuous_dlopen
|
||||
|
||||
/* System header to define __stub macros and hopefully few prototypes,
|
||||
which can conflict with char dlopen (); below.
|
||||
Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
|
||||
<limits.h> exists even on freestanding compilers. */
|
||||
|
||||
#ifdef __STDC__
|
||||
# include <limits.h>
|
||||
#else
|
||||
# include <assert.h>
|
||||
#endif
|
||||
|
||||
#undef dlopen
|
||||
|
||||
/* 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 dlopen ();
|
||||
/* 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_dlopen) || defined (__stub___dlopen)
|
||||
choke me
|
||||
#else
|
||||
char (*f) () = dlopen;
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
int
|
||||
main ()
|
||||
{
|
||||
return f != dlopen;
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (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); }; } &&
|
||||
{ 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_dlopen=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_func_dlopen=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_func_dlopen" >&5
|
||||
echo "${ECHO_T}$ac_cv_func_dlopen" >&6
|
||||
if test $ac_cv_func_dlopen = yes; then
|
||||
NOCHECK_DL=1
|
||||
fi
|
||||
|
||||
fi
|
||||
|
||||
if test -z "$NOSSL"; then
|
||||
if test -n "$OPENSSL"; then
|
||||
appendLib -L${OPENSSL}/lib
|
||||
appendInc -I${OPENSSL}/include
|
||||
fi
|
||||
|
||||
|
||||
echo "$as_me:$LINENO: checking for BIO_new in -lcrypto" >&5
|
||||
echo $ECHO_N "checking for BIO_new in -lcrypto... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_crypto_BIO_new+set}" = set; then
|
||||
@@ -2861,7 +3065,7 @@ if test -z "$prefix" || test $prefix = "NONE"; then
|
||||
fi
|
||||
|
||||
if test "$MODULES" = "yes"; then
|
||||
if test -n "$ISSUN"; then
|
||||
if test -z "$NOCHECK_DL"; then
|
||||
echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
|
||||
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
|
||||
@@ -2928,88 +3132,29 @@ echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
|
||||
if test $ac_cv_lib_dl_dlopen = yes; then
|
||||
appendCXX -D_MODULES
|
||||
fi
|
||||
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
else
|
||||
echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5
|
||||
echo $ECHO_N "checking for dlopen in -ldl... $ECHO_C" >&6
|
||||
if test "${ac_cv_lib_dl_dlopen+set}" = set; then
|
||||
echo $ECHO_N "(cached) $ECHO_C" >&6
|
||||
else
|
||||
ac_check_lib_save_LIBS=$LIBS
|
||||
LIBS="-ldl $LIBS"
|
||||
cat >conftest.$ac_ext <<_ACEOF
|
||||
/* confdefs.h. */
|
||||
_ACEOF
|
||||
cat confdefs.h >>conftest.$ac_ext
|
||||
cat >>conftest.$ac_ext <<_ACEOF
|
||||
/* end confdefs.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 dlopen ();
|
||||
int
|
||||
main ()
|
||||
{
|
||||
dlopen ();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
rm -f conftest.$ac_objext conftest$ac_exeext
|
||||
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
|
||||
(eval $ac_link) 2>conftest.er1
|
||||
ac_status=$?
|
||||
grep -v '^ *+' conftest.er1 >conftest.err
|
||||
rm -f conftest.er1
|
||||
cat conftest.err >&5
|
||||
echo "$as_me:$LINENO: \$? = $ac_status" >&5
|
||||
(exit $ac_status); } &&
|
||||
{ ac_try='test -z "$ac_c_werror_flag"
|
||||
|| test ! -s conftest.err'
|
||||
{ (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); }; } &&
|
||||
{ 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_lib_dl_dlopen=yes
|
||||
else
|
||||
echo "$as_me: failed program was:" >&5
|
||||
sed 's/^/| /' conftest.$ac_ext >&5
|
||||
|
||||
ac_cv_lib_dl_dlopen=no
|
||||
fi
|
||||
rm -f conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS=$ac_check_lib_save_LIBS
|
||||
fi
|
||||
echo "$as_me:$LINENO: result: $ac_cv_lib_dl_dlopen" >&5
|
||||
echo "${ECHO_T}$ac_cv_lib_dl_dlopen" >&6
|
||||
if test $ac_cv_lib_dl_dlopen = yes; then
|
||||
appendCXX -D_MODULES -rdynamic
|
||||
MODULES="no"
|
||||
fi
|
||||
|
||||
MODFLAGS=`echo $CXXFLAGS | sed 's/-rdynamic//g'`
|
||||
fi
|
||||
MODFLAGS="$MODFLAGS -I`pwd`"
|
||||
MODTARGET="modules"
|
||||
appendLib -ldl
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$MODFLAGS -mimpure-text"
|
||||
fi
|
||||
if test "$MODULES" = "yes"; then
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
else
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
appendCXX -rdynamic
|
||||
fi
|
||||
MODFLAGS="$MODFLAGS -I`pwd`"
|
||||
MODTARGET="modules"
|
||||
if test -z "$NOCHECK_DL"; then
|
||||
appendLib -ldl
|
||||
fi
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$MODFLAGS -mimpure-text"
|
||||
fi
|
||||
|
||||
appendCXX "-D_MODDIR_=\\\"${prefix}/share/znc\\\""
|
||||
appendCXX "-D_MODDIR_=\\\"${prefix}/share/znc\\\""
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION=`grep '#define VERSION' Modules.h | awk '{print $3}'`
|
||||
|
||||
+24
-13
@@ -40,6 +40,11 @@ AC_ARG_ENABLE( debug, [ --enable-debug enable debuging], appendCXX -Wall -ggdb
|
||||
AC_ARG_ENABLE( modules, [ --disable-modules disable modules], MODULES="no", MODULES="yes")
|
||||
AC_ARG_ENABLE( openssl, [ --disable-openssl disable openssl], NOSSL=1,)
|
||||
|
||||
AC_CHECK_FUNCS( stat lstat chmod open, , echo "Missing Required libc feature" && exit 1)
|
||||
if test "$MODULES" = "yes"; then
|
||||
AC_CHECK_FUNC( dlopen,NOCHECK_DL=1,)
|
||||
fi
|
||||
|
||||
if test -z "$NOSSL"; then
|
||||
if test -n "$OPENSSL"; then
|
||||
appendLib -L${OPENSSL}/lib
|
||||
@@ -59,21 +64,27 @@ if test -z "$prefix" || test $prefix = "NONE"; then
|
||||
fi
|
||||
|
||||
if test "$MODULES" = "yes"; then
|
||||
if test -n "$ISSUN"; then
|
||||
AC_CHECK_LIB( dl, dlopen, appendCXX -D_MODULES,, )
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
else
|
||||
AC_CHECK_LIB( dl, dlopen, appendCXX -D_MODULES -rdynamic,, )
|
||||
MODFLAGS=`echo $CXXFLAGS | sed 's/-rdynamic//g'`
|
||||
fi
|
||||
MODFLAGS="$MODFLAGS -I`pwd`"
|
||||
MODTARGET="modules"
|
||||
appendLib -ldl
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$MODFLAGS -mimpure-text"
|
||||
if test -z "$NOCHECK_DL"; then
|
||||
AC_CHECK_LIB( dl, dlopen, appendCXX -D_MODULES,MODULES="no",)
|
||||
fi
|
||||
if test "$MODULES" = "yes"; then
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
else
|
||||
MODFLAGS="$CXXFLAGS"
|
||||
appendCXX -rdynamic
|
||||
fi
|
||||
MODFLAGS="$MODFLAGS -I`pwd`"
|
||||
MODTARGET="modules"
|
||||
if test -z "$NOCHECK_DL"; then
|
||||
appendLib -ldl
|
||||
fi
|
||||
if test -n "$ISSUN"; then
|
||||
MODFLAGS="$MODFLAGS -mimpure-text"
|
||||
fi
|
||||
|
||||
appendCXX "-D_MODDIR_=\\\"${prefix}/share/znc\\\""
|
||||
appendCXX "-D_MODDIR_=\\\"${prefix}/share/znc\\\""
|
||||
fi
|
||||
fi
|
||||
|
||||
VERSION=`grep '#define VERSION' Modules.h | awk '{print $3}'`
|
||||
|
||||
Reference in New Issue
Block a user