mirror of
https://github.com/unrealircd/unrealircd.git
synced 2026-06-12 19:14:46 +02:00
- Support compiling with a bundled c-ares again, the hacky way. (#3931)
This commit is contained in:
@@ -2038,3 +2038,4 @@
|
||||
it automatically. This avoids some potential crashes.
|
||||
- Give more clear error to users who use ``make custommodule'' without
|
||||
MODULEFILE. (#3935)
|
||||
- Support compiling with a bundled c-ares again, the hacky way. (#3931)
|
||||
|
||||
@@ -107,7 +107,7 @@ AC_DEFUN([CHECK_LIBCURL],
|
||||
[
|
||||
dnl Attempt one: Linux sed
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -r 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
AS_IF([test x"$XCURLLIBS" = x],
|
||||
AS_IF([test "x$XCURLLIBS" = "x"],
|
||||
[
|
||||
dnl Attempt two: FreeBSD (and others?) sed
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -E 's/(@<:@^ @:>@+ @<:@^ @:>@+ )(@<:@^ @:>@+ @<:@^ @:>@+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
@@ -117,6 +117,9 @@ AC_DEFUN([CHECK_LIBCURL],
|
||||
])
|
||||
])
|
||||
CURLLIBS="$XCURLLIBS"
|
||||
|
||||
IRCDLIBS_CURL_CARES="$CARES_LIBS"
|
||||
CFLAGS_CURL_CARES="$CARES_CFLAGS"
|
||||
])
|
||||
|
||||
dnl Make sure that linking against cURL works rather than letting the user
|
||||
@@ -126,7 +129,10 @@ AC_DEFUN([CHECK_LIBCURL],
|
||||
|
||||
AC_MSG_CHECKING([curl_easy_init() in $CURLLIBS])
|
||||
LIBS_SAVEDA="$LIBS"
|
||||
LIBS="$IRCDLIBS"
|
||||
CFLAGS_SAVEDA="$CFLAGS"
|
||||
|
||||
LIBS="$IRCDLIBS $IRCDLIBS_CURL_CARES"
|
||||
CFLAGS="$CFLAGS $CFLAGS_CURL_CARES"
|
||||
AC_LINK_IFELSE(
|
||||
[
|
||||
AC_LANG_PROGRAM(
|
||||
@@ -138,6 +144,7 @@ AC_DEFUN([CHECK_LIBCURL],
|
||||
AC_MSG_FAILURE([You asked for libcURL (remote includes) support, but it can't be found at $enable_curl])
|
||||
])
|
||||
LIBS="$LIBS_SAVEDA"
|
||||
CFLAGS="$CFLAGS_SAVEDA"
|
||||
|
||||
URL="url.o"
|
||||
AC_SUBST(URL)
|
||||
|
||||
@@ -596,6 +596,7 @@ ac_includes_default="\
|
||||
|
||||
ac_subst_vars='LTLIBOBJS
|
||||
LIBOBJS
|
||||
URL
|
||||
CARES_LIBS
|
||||
CARES_CFLAGS
|
||||
PKG_CONFIG
|
||||
@@ -604,7 +605,6 @@ TRE_CFLAGS
|
||||
FD_SETSIZE
|
||||
BINDIR
|
||||
IRCDDIR
|
||||
URL
|
||||
HAVE_ZLIB
|
||||
MODULEFLAGS
|
||||
CRYPTOLIB
|
||||
@@ -693,9 +693,9 @@ with_system_tre
|
||||
with_system_cares
|
||||
enable_ssl
|
||||
enable_ziplinks
|
||||
enable_libcurl
|
||||
enable_dynamic_linking
|
||||
enable_inet6
|
||||
enable_libcurl
|
||||
'
|
||||
ac_precious_vars='build_alias
|
||||
host_alias
|
||||
@@ -1330,12 +1330,12 @@ Optional Features:
|
||||
--enable-ziplinks=DIR enable ziplinks. will check /usr/local /usr
|
||||
/usr/pkg. Note that SSL does its own compression, so
|
||||
you won't need this for SSL links.
|
||||
--enable-libcurl=DIR enable libcurl (remote include) support
|
||||
--disable-dynamic-linking
|
||||
Make the IRCd statically link with shared objects
|
||||
rather than dynamically (noone knows if disabling
|
||||
dynamic linking actually does anything or not)
|
||||
--enable-inet6 Make the IRCd support IPv6
|
||||
--enable-libcurl=DIR enable libcurl (remote include) support
|
||||
|
||||
Optional Packages:
|
||||
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
|
||||
@@ -6202,127 +6202,6 @@ $as_echo "not found" >&6; }
|
||||
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-libcurl was given.
|
||||
if test "${enable_libcurl+set}" = set; then :
|
||||
enableval=$enable_libcurl; enable_curl=$enableval
|
||||
else
|
||||
enable_curl=no
|
||||
fi
|
||||
|
||||
|
||||
if test "x$enable_curl" != "xno"; then :
|
||||
|
||||
CURLCONFIG="curl-config"
|
||||
if test "x$enable_curl" != "xyes"; then :
|
||||
CURLCONFIG="$enable_curl/bin/curl-config"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $CURLCONFIG" >&5
|
||||
$as_echo_n "checking $CURLCONFIG... " >&6; }
|
||||
if $CURLCONFIG --version 2>/dev/null >/dev/null; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error "Could not find curl-config, try editing --enable-libcurl
|
||||
See \`config.log' for more details." "$LINENO" 5; }
|
||||
fi
|
||||
|
||||
CURLCFLAG="`$CURLCONFIG --cflags`"
|
||||
CURLLIBS="`$CURLCONFIG --libs`"
|
||||
|
||||
CURLUSESCARES="`echo $CURLLIBS|grep c-ares|wc -l`"
|
||||
if test "$CURLUSESCARES" = "0"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!" >&5
|
||||
$as_echo "$as_me: WARNING: cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!" >&2;}
|
||||
fi
|
||||
|
||||
if test -z "${CURLLIBS}"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CURLLIBS is empty, that probably means that I could not find $enable_curl/bin/curl-config" >&5
|
||||
$as_echo "$as_me: WARNING: CURLLIBS is empty, that probably means that I could not find $enable_curl/bin/curl-config" >&2;}
|
||||
fi
|
||||
|
||||
|
||||
if test "x$with_system_cares" = "xno" && test "x$HOME/curl" != "x$enable_curl" && test "x/usr/share/unreal-curl" != "x$enable_curl" && test "$CURLUSESCARES" != "0" ; then :
|
||||
|
||||
as_fn_error "
|
||||
|
||||
You have decided to build unrealIRCd with libcURL (remote includes) support.
|
||||
However, you have disabled system-installed c-ares support (--with-system-cares).
|
||||
Because UnrealIRCd will use a bundled copy of c-ares which may be incompatible
|
||||
with the system-installed libcURL, this is a bad idea which may result in error
|
||||
messages looking like:
|
||||
|
||||
\`\`[error] unrealircd.conf:9: include: error downloading '(http://example.net/ex.conf)': Could not resolve host: example.net (Successful completion)''
|
||||
|
||||
Or UnrealIRCd might even crash.
|
||||
|
||||
Please build UnrealIRCd with --with-system-cares when enabling --enable-libcurl
|
||||
" "$LINENO" 5
|
||||
|
||||
fi
|
||||
|
||||
if test "x`echo $CURLLIBS |grep ares`" != x && test "x$with_system_cares" = "xno"; then :
|
||||
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -r 's/([^ ]+ [^ ]+ )([^ ]+ [^ ]+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
if test x"$XCURLLIBS" = x; then :
|
||||
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -E 's/([^ ]+ [^ ]+ )([^ ]+ [^ ]+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
if test x"$XCURLLIBS" = x; then :
|
||||
|
||||
as_fn_error "sed appears to be broken. It is needed for a remote includes compile hack." "$LINENO" 5
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
CURLLIBS="$XCURLLIBS"
|
||||
|
||||
fi
|
||||
|
||||
IRCDLIBS="$IRCDLIBS $CURLLIBS"
|
||||
CFLAGS="$CFLAGS $CURLCFLAG -DUSE_LIBCURL"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking curl_easy_init() in $CURLLIBS" >&5
|
||||
$as_echo_n "checking curl_easy_init() in $CURLLIBS... " >&6; }
|
||||
LIBS_SAVEDA="$LIBS"
|
||||
LIBS="$IRCDLIBS"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <curl/curl.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error "You asked for libcURL (remote includes) support, but it can't be found at $enable_curl
|
||||
See \`config.log' for more details." "$LINENO" 5; }
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS="$LIBS_SAVEDA"
|
||||
|
||||
URL="url.o"
|
||||
|
||||
|
||||
fi
|
||||
# Check whether --enable-dynamic-linking was given.
|
||||
if test "${enable_dynamic_linking+set}" = set; then :
|
||||
enableval=$enable_dynamic_linking; enable_dynamic_linking=$enableval
|
||||
@@ -7000,6 +6879,134 @@ fi
|
||||
fi
|
||||
|
||||
|
||||
# Check whether --enable-libcurl was given.
|
||||
if test "${enable_libcurl+set}" = set; then :
|
||||
enableval=$enable_libcurl; enable_curl=$enableval
|
||||
else
|
||||
enable_curl=no
|
||||
fi
|
||||
|
||||
|
||||
if test "x$enable_curl" != "xno"; then :
|
||||
|
||||
CURLCONFIG="curl-config"
|
||||
if test "x$enable_curl" != "xyes"; then :
|
||||
CURLCONFIG="$enable_curl/bin/curl-config"
|
||||
fi
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $CURLCONFIG" >&5
|
||||
$as_echo_n "checking $CURLCONFIG... " >&6; }
|
||||
if $CURLCONFIG --version 2>/dev/null >/dev/null; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error "Could not find curl-config, try editing --enable-libcurl
|
||||
See \`config.log' for more details." "$LINENO" 5; }
|
||||
fi
|
||||
|
||||
CURLCFLAG="`$CURLCONFIG --cflags`"
|
||||
CURLLIBS="`$CURLCONFIG --libs`"
|
||||
|
||||
CURLUSESCARES="`echo $CURLLIBS|grep c-ares|wc -l`"
|
||||
if test "$CURLUSESCARES" = "0"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!" >&5
|
||||
$as_echo "$as_me: WARNING: cURL is compiled without c-ares support. Your IRCd will possibly stall when REHASHing!" >&2;}
|
||||
fi
|
||||
|
||||
if test -z "${CURLLIBS}"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: CURLLIBS is empty, that probably means that I could not find $enable_curl/bin/curl-config" >&5
|
||||
$as_echo "$as_me: WARNING: CURLLIBS is empty, that probably means that I could not find $enable_curl/bin/curl-config" >&2;}
|
||||
fi
|
||||
|
||||
|
||||
if test "x$with_system_cares" = "xno" && test "x$HOME/curl" != "x$enable_curl" && test "x/usr/share/unreal-curl" != "x$enable_curl" && test "$CURLUSESCARES" != "0" ; then :
|
||||
|
||||
as_fn_error "
|
||||
|
||||
You have decided to build unrealIRCd with libcURL (remote includes) support.
|
||||
However, you have disabled system-installed c-ares support (--with-system-cares).
|
||||
Because UnrealIRCd will use a bundled copy of c-ares which may be incompatible
|
||||
with the system-installed libcURL, this is a bad idea which may result in error
|
||||
messages looking like:
|
||||
|
||||
\`\`[error] unrealircd.conf:9: include: error downloading '(http://example.net/ex.conf)': Could not resolve host: example.net (Successful completion)''
|
||||
|
||||
Or UnrealIRCd might even crash.
|
||||
|
||||
Please build UnrealIRCd with --with-system-cares when enabling --enable-libcurl
|
||||
" "$LINENO" 5
|
||||
|
||||
fi
|
||||
|
||||
if test "x`echo $CURLLIBS |grep ares`" != x && test "x$with_system_cares" = "xno"; then :
|
||||
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -r 's/([^ ]+ [^ ]+ )([^ ]+ [^ ]+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
if test "x$XCURLLIBS" = "x"; then :
|
||||
|
||||
XCURLLIBS="`echo "$CURLLIBS"|sed -E 's/([^ ]+ [^ ]+ )([^ ]+ [^ ]+ )(.+)/\1\3/g' 2>/dev/null`"
|
||||
if test x"$XCURLLIBS" = x; then :
|
||||
|
||||
as_fn_error "sed appears to be broken. It is needed for a remote includes compile hack." "$LINENO" 5
|
||||
|
||||
fi
|
||||
|
||||
fi
|
||||
CURLLIBS="$XCURLLIBS"
|
||||
|
||||
IRCDLIBS_CURL_CARES="$CARES_LIBS"
|
||||
CFLAGS_CURL_CARES="$CARES_CFLAGS"
|
||||
|
||||
fi
|
||||
|
||||
IRCDLIBS="$IRCDLIBS $CURLLIBS"
|
||||
CFLAGS="$CFLAGS $CURLCFLAG -DUSE_LIBCURL"
|
||||
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking curl_easy_init() in $CURLLIBS" >&5
|
||||
$as_echo_n "checking curl_easy_init() in $CURLLIBS... " >&6; }
|
||||
LIBS_SAVEDA="$LIBS"
|
||||
CFLAGS_SAVEDA="$CFLAGS"
|
||||
|
||||
LIBS="$IRCDLIBS $IRCDLIBS_CURL_CARES"
|
||||
CFLAGS="$CFLAGS $CFLAGS_CURL_CARES"
|
||||
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <curl/curl.h>
|
||||
int
|
||||
main ()
|
||||
{
|
||||
CURL *curl = curl_easy_init();
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
|
||||
_ACEOF
|
||||
if ac_fn_c_try_link "$LINENO"; then :
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
{ { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
|
||||
$as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
|
||||
as_fn_error "You asked for libcURL (remote includes) support, but it can't be found at $enable_curl
|
||||
See \`config.log' for more details." "$LINENO" 5; }
|
||||
|
||||
fi
|
||||
rm -f core conftest.err conftest.$ac_objext \
|
||||
conftest$ac_exeext conftest.$ac_ext
|
||||
LIBS="$LIBS_SAVEDA"
|
||||
CFLAGS="$CFLAGS_SAVEDA"
|
||||
|
||||
URL="url.o"
|
||||
|
||||
|
||||
fi
|
||||
|
||||
ac_config_files="$ac_config_files Makefile src/modules/Makefile unreal ircdcron/ircdchk"
|
||||
|
||||
cat >confcache <<\_ACEOF
|
||||
|
||||
+1
-1
@@ -496,7 +496,6 @@ AC_ARG_WITH(system-tre, [AS_HELP_STRING([--with-system-tre], [Use the system tre
|
||||
AC_ARG_WITH(system-cares, [AS_HELP_STRING([--with-system-cares], [Use the system c-ares (at least version 1.6.0) package instead of bundled c-ares, discovered using pkg-config])], [], [with_system_cares=no])
|
||||
CHECK_SSL
|
||||
CHECK_ZLIB
|
||||
CHECK_LIBCURL
|
||||
AC_ARG_ENABLE(dynamic-linking, [AS_HELP_STRING([--disable-dynamic-linking], [Make the IRCd statically link with shared objects rather than dynamically (noone knows if disabling dynamic linking actually does anything or not)])],
|
||||
[enable_dynamic_linking=$enableval], [enable_dynamic_linking="yes"])
|
||||
AS_IF([test $enable_dynamic_linking = "yes"],
|
||||
@@ -638,6 +637,7 @@ dnl use pkg-config for system c-ares:
|
||||
PKG_CHECK_MODULES([CARES], libcares >= 1.6.0)
|
||||
])
|
||||
|
||||
CHECK_LIBCURL
|
||||
|
||||
AC_OUTPUT(Makefile src/modules/Makefile unreal ircdcron/ircdchk)
|
||||
chmod 0700 unreal
|
||||
|
||||
Reference in New Issue
Block a user