From 32d5a3f33566af6f94c30344a7b045aab8549feb Mon Sep 17 00:00:00 2001 From: hyung-hwan Date: Fri, 3 May 2024 10:23:25 +0900 Subject: [PATCH] updated socket library detection in configure.ac --- Makefile.in | 2 +- configure | 45 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 5 ++++- 3 files changed, 50 insertions(+), 2 deletions(-) diff --git a/Makefile.in b/Makefile.in index 44a7272d..df83fa56 100644 --- a/Makefile.in +++ b/Makefile.in @@ -168,7 +168,7 @@ am__DIST_COMMON = $(srcdir)/Makefile.in $(top_srcdir)/ac/ar-lib \ $(top_srcdir)/ac/ltmain.sh $(top_srcdir)/ac/missing \ $(top_srcdir)/ac/tap-driver.sh $(top_srcdir)/pkgs/hawk.spec.in \ README.md ac/ar-lib ac/compile ac/config.guess ac/config.sub \ - ac/install-sh ac/ltmain.sh ac/missing + ac/depcomp ac/install-sh ac/ltmain.sh ac/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) diff --git a/configure b/configure index 268a995b..25a9bf79 100755 --- a/configure +++ b/configure @@ -21318,6 +21318,51 @@ then : SOCKET_LIBS="$SOCKET_LIBS -lsocket" printf "%s\n" "#define HAVE_CONNECT 1" >>confdefs.h +else $as_nop + + { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for connect in -lnetwork" >&5 +printf %s "checking for connect in -lnetwork... " >&6; } +if test ${ac_cv_lib_network_connect+y} +then : + printf %s "(cached) " >&6 +else $as_nop + ac_check_lib_save_LIBS=$LIBS +LIBS="-lnetwork $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +char connect (); +int +main (void) +{ +return connect (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO" +then : + ac_cv_lib_network_connect=yes +else $as_nop + ac_cv_lib_network_connect=no +fi +rm -f core conftest.err conftest.$ac_objext conftest.beam \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_network_connect" >&5 +printf "%s\n" "$ac_cv_lib_network_connect" >&6; } +if test "x$ac_cv_lib_network_connect" = xyes +then : + + SOCKET_LIBS="$SOCKET_LIBS -lnetwork" + printf "%s\n" "#define HAVE_CONNECT 1" >>confdefs.h + +fi + fi diff --git a/configure.ac b/configure.ac index 7cf06b09..dc26d476 100644 --- a/configure.ac +++ b/configure.ac @@ -347,7 +347,10 @@ if test "x$ac_cv_func_connect" = "xno" then AC_CHECK_LIB([socket], [connect], [ SOCKET_LIBS="$SOCKET_LIBS -lsocket" - AC_DEFINE(HAVE_CONNECT, 1) + AC_DEFINE(HAVE_CONNECT, 1) ], [ + AC_CHECK_LIB([network], [connect], [ + SOCKET_LIBS="$SOCKET_LIBS -lnetwork" + AC_DEFINE(HAVE_CONNECT, 1) ]) ]) fi if test "x${platform_win32}" = "xyes"