mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-11 15:06:14 +01:00
configure: check if -lsocket is needed (for Solaris)
Also, link libgio to -lresolv explicitly, rather than depending on getting it implicitly via the libasyncns build (which should eventually be going away). https://bugzilla.gnome.org/show_bug.cgi?id=645336
This commit is contained in:
parent
a636dfd7fb
commit
0d63793129
46
configure.ac
46
configure.ac
@ -1069,39 +1069,43 @@ if $glib_failed ; then
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
AC_CHECK_FUNCS(getprotobyname_r endservent)
|
AC_CHECK_FUNCS(getprotobyname_r endservent)
|
||||||
AC_CHECK_HEADERS([netdb.h wspiapi.h])
|
AC_CHECK_HEADERS([netdb.h wspiapi.h arpa/nameser_compat.h])
|
||||||
|
|
||||||
# For gio/libasyncns
|
# For gio/libasyncns
|
||||||
if test $glib_native_win32 = no; then
|
AC_CHECK_FUNCS(strndup setresuid setreuid)
|
||||||
AC_CHECK_FUNCS(strndup setresuid setreuid)
|
AC_CHECK_HEADERS(sys/prctl.h)
|
||||||
AC_CHECK_HEADERS(sys/prctl.h arpa/nameser_compat.h)
|
|
||||||
|
|
||||||
# We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150
|
# We can't just use AC_CHECK_FUNC/AC_CHECK_LIB here. Bug 586150
|
||||||
AC_MSG_CHECKING([for res_query])
|
NETWORK_LIBS=""
|
||||||
AC_TRY_LINK([#include <sys/types.h>
|
AC_MSG_CHECKING([for res_query])
|
||||||
#include <netinet/in.h>
|
AC_TRY_LINK([#include <sys/types.h>
|
||||||
#include <arpa/nameser.h>
|
#include <netinet/in.h>
|
||||||
#include <resolv.h>],
|
#include <arpa/nameser.h>
|
||||||
[res_query("test", 0, 0, (void *)0, 0);],
|
#include <resolv.h>
|
||||||
[AC_MSG_RESULT([yes])],
|
],[
|
||||||
|
res_query("test", 0, 0, (void *)0, 0);
|
||||||
|
],[AC_MSG_RESULT([yes])],
|
||||||
[save_libs="$LIBS"
|
[save_libs="$LIBS"
|
||||||
LIBS="-lresolv $LIBS"
|
LIBS="-lresolv $LIBS"
|
||||||
AC_TRY_LINK([#include <sys/types.h>
|
AC_TRY_LINK([#include <sys/types.h>
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/nameser.h>
|
#include <arpa/nameser.h>
|
||||||
#include <resolv.h>],
|
#include <resolv.h>
|
||||||
[res_query("test", 0, 0, (void *)0, 0);],
|
],[
|
||||||
[AC_MSG_RESULT([in -lresolv])
|
res_query("test", 0, 0, (void *)0, 0);
|
||||||
LIBASYNCNS_LIBADD="-lresolv"],
|
],[AC_MSG_RESULT([in -lresolv])
|
||||||
|
NETWORK_LIBS="-lresolv $NETWORK_LIBS"],
|
||||||
[LIBS="-lbind $save_libs"
|
[LIBS="-lbind $save_libs"
|
||||||
AC_TRY_LINK([#include <resolv.h>],
|
AC_TRY_LINK([#include <resolv.h>],
|
||||||
[res_query("test", 0, 0, (void *)0, 0);],
|
[res_query("test", 0, 0, (void *)0, 0);],
|
||||||
[AC_MSG_RESULT([in -lbind])
|
[AC_MSG_RESULT([in -lbind])
|
||||||
LIBASYNCNS_LIBADD="-lbind"],
|
NETWORK_LIBS="-lbind $NETWORK_LIBS"],
|
||||||
[AC_MSG_ERROR(not found)])])
|
[AC_MSG_ERROR(not found)])])
|
||||||
LIBS="$save_libs"])
|
LIBS="$save_libs"])
|
||||||
AC_SUBST(LIBASYNCNS_LIBADD)
|
AC_CHECK_FUNC(socket, :, AC_CHECK_LIB(socket, socket,
|
||||||
fi
|
[NETWORK_LIBS="-lsocket $NETWORK_LIBS"],
|
||||||
|
[AC_MSG_ERROR(Could not find socket())]))
|
||||||
|
AC_SUBST(NETWORK_LIBS)
|
||||||
|
|
||||||
case $host in
|
case $host in
|
||||||
*-*-solaris* )
|
*-*-solaris* )
|
||||||
|
@ -416,6 +416,7 @@ libgio_2_0_la_LIBADD = \
|
|||||||
$(SELINUX_LIBS) \
|
$(SELINUX_LIBS) \
|
||||||
$(GLIB_LIBS) \
|
$(GLIB_LIBS) \
|
||||||
$(XATTR_LIBS) \
|
$(XATTR_LIBS) \
|
||||||
|
$(NETWORK_LIBS) \
|
||||||
$(NULL)
|
$(NULL)
|
||||||
|
|
||||||
libgio_2_0_la_CPPFLAGS = $(ZLIB_CFLAGS) $(AM_CPPFLAGS)
|
libgio_2_0_la_CPPFLAGS = $(ZLIB_CFLAGS) $(AM_CPPFLAGS)
|
||||||
|
@ -10,6 +10,6 @@ libasyncns_la_SOURCES = \
|
|||||||
asyncns.h \
|
asyncns.h \
|
||||||
g-asyncns.h
|
g-asyncns.h
|
||||||
|
|
||||||
libasyncns_la_LIBADD = $(LIBASYNCNS_LIBADD)
|
libasyncns_la_LIBADD = $(NETWORK_LIBS)
|
||||||
|
|
||||||
EXTRA_DIST += README update.sh
|
EXTRA_DIST += README update.sh
|
||||||
|
Loading…
Reference in New Issue
Block a user