Commit: patch 9.2.0269: configure: Link error on Solaris

1 view
Skip to first unread message

Christian Brabandt

unread,
Mar 29, 2026, 10:17:12 AM (3 days ago) Mar 29
to vim...@googlegroups.com
patch 9.2.0269: configure: Link error on Solaris

Commit: https://github.com/vim/vim/commit/b8a653a377337637cc63927b0d168f94d19fd787
Author: Christian Brabandt <c...@256bit.org>
Date: Sun Mar 29 14:00:51 2026 +0000

patch 9.2.0269: configure: Link error on Solaris

Problem: configure: Link error on Solaris
(idgn23, after v9.2.0153)
Solution: Move the check for the nsl library a bit earlier,
regenerate configure

fixes: #19803

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/src/auto/configure b/src/auto/configure
index 93ee5ea65..8e73d97b1 100755
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -8820,6 +8820,57 @@ then :

LIBS="-lsocket $LIBS"

+fi
+
+ { printf "%s
" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
+printf %s "checking for gethostbyname in -lnsl... " >&6; }
+if test ${ac_cv_lib_nsl_gethostbyname+y}
+then :
+ printf %s "(cached) " >&6
+else case e in #(
+ e) ac_check_lib_save_LIBS=$LIBS
+LIBS="-lnsl $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.
+ The 'extern "C"' is for builds by C++ compilers;
+ although this is not generally supported in C code supporting it here
+ has little cost and some practical benefit (sr 110532). */
+#ifdef __cplusplus
+extern "C"
+#endif
+char gethostbyname (void);
+int
+main (void)
+{
+return gethostbyname ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"
+then :
+ ac_cv_lib_nsl_gethostbyname=yes
+else case e in #(
+ e) ac_cv_lib_nsl_gethostbyname=no ;;
+esac
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.beam \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS ;;
+esac
+fi
+{ printf "%s
" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
+printf "%s
" "$ac_cv_lib_nsl_gethostbyname" >&6; }
+if test "x$ac_cv_lib_nsl_gethostbyname" = xyes
+then :
+ printf "%s
" "#define HAVE_LIBNSL 1" >>confdefs.h
+
+ LIBS="-lnsl $LIBS"
+
fi

fi
@@ -8891,57 +8942,6 @@ then :
fi

else
- { printf "%s
" "$as_me:${as_lineno-$LINENO}: checking for gethostbyname in -lnsl" >&5
-printf %s "checking for gethostbyname in -lnsl... " >&6; }
-if test ${ac_cv_lib_nsl_gethostbyname+y}
-then :
- printf %s "(cached) " >&6
-else case e in #(
- e) ac_check_lib_save_LIBS=$LIBS
-LIBS="-lnsl $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.
- The 'extern "C"' is for builds by C++ compilers;
- although this is not generally supported in C code supporting it here
- has little cost and some practical benefit (sr 110532). */
-#ifdef __cplusplus
-extern "C"
-#endif
-char gethostbyname (void);
-int
-main (void)
-{
-return gethostbyname ();
- ;
- return 0;
-}
-_ACEOF
-if ac_fn_c_try_link "$LINENO"
-then :
- ac_cv_lib_nsl_gethostbyname=yes
-else case e in #(
- e) ac_cv_lib_nsl_gethostbyname=no ;;
-esac
-fi
-rm -f core conftest.err conftest.$ac_objext conftest.beam \
- conftest$ac_exeext conftest.$ac_ext
-LIBS=$ac_check_lib_save_LIBS ;;
-esac
-fi
-{ printf "%s
" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_nsl_gethostbyname" >&5
-printf "%s
" "$ac_cv_lib_nsl_gethostbyname" >&6; }
-if test "x$ac_cv_lib_nsl_gethostbyname" = xyes
-then :
- printf "%s
" "#define HAVE_LIBNSL 1" >>confdefs.h
-
- LIBS="-lnsl $LIBS"
-
-fi
-
{ printf "%s
" "$as_me:${as_lineno-$LINENO}: checking whether compiling with IPv4 networking is possible" >&5
printf %s "checking whether compiling with IPv4 networking is possible... " >&6; }
if test ${vim_cv_ipv4_networking+y}
diff --git a/src/configure.ac b/src/configure.ac
index 495c8de40..3787701e3 100644
--- a/src/configure.ac
+++ b/src/configure.ac
@@ -2238,6 +2238,8 @@ if test "$enable_channel" = "yes"; then
AC_CHECK_LIB(network, socket)
else
AC_CHECK_LIB(socket, socket)
+ dnl On Solaris we need the nsl library.
+ AC_CHECK_LIB(nsl, gethostbyname)
fi

AC_CACHE_CHECK([whether compiling with IPv6 networking is possible], [vim_cv_ipv6_networking],
@@ -2274,8 +2276,6 @@ if test "$enable_channel" = "yes"; then
AC_DEFINE(FEAT_IPV6)
AC_CHECK_FUNCS(inet_ntop)
else
- dnl On Solaris we need the nsl library.
- AC_CHECK_LIB(nsl, gethostbyname)
AC_CACHE_CHECK([whether compiling with IPv4 networking is possible], [vim_cv_ipv4_networking],
[AC_LINK_IFELSE([AC_LANG_PROGRAM([
#include <stdio.h>
diff --git a/src/version.c b/src/version.c
index 82172b749..50844e28d 100644
--- a/src/version.c
+++ b/src/version.c
@@ -734,6 +734,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 269,
/**/
268,
/**/
Reply all
Reply to author
Forward
0 new messages