To: [email protected]
Subject: Patch 6.2f.035
Fcc: outbox
From: Bram Moolenaar <[email protected]>
Mime-Version: 1.0
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: 8bit
------------

Patch 6.2f.035
Problem:    The configure check for the netbeans interface doesn't work if the
           socket and nsl libraries are required.
Solution:   Check for the socket and nsl libraries before the netbeans check.
Files:      src/auto/configure, src/configure.in


*** ../vim-6.2f.034/src/auto/configure  Sat May 31 12:03:18 2003
--- src/auto/configure  Sat May 31 16:38:17 2003
***************
*** 2118,2127 ****

 if test "$enable_netbeans" = "yes"; then
   echo "$ac_t""no" 1>&6
   echo $ac_n "checking whether compiling netbeans integration is possible""... $ac_c" 1>&6
! echo "configure:2123: checking whether compiling netbeans integration is possible" >&5
   cat > conftest.$ac_ext <<EOF
! #line 2125 "configure"
 #include "confdefs.h"

 #include <stdio.h>
--- 2118,2221 ----

 if test "$enable_netbeans" = "yes"; then
   echo "$ac_t""no" 1>&6
+     echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+ echo "configure:2123: checking for socket in -lsocket" >&5
+ ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   ac_save_LIBS="$LIBS"
+ LIBS="-lsocket  $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 2131 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ /* We use char because int might match the return type of a gcc2
+     builtin and then its argument prototype would still apply.  */
+ char socket();
+
+ int main() {
+ socket()
+ ; return 0; }
+ EOF
+ if { (eval echo configure:2142: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+   eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   eval "ac_cv_lib_$ac_lib_var=no"
+ fi
+ rm -f conftest*
+ LIBS="$ac_save_LIBS"
+
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+   echo "$ac_t""yes" 1>&6
+     ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+   cat >> confdefs.h <<EOF
+ #define $ac_tr_lib 1
+ EOF
+
+   LIBS="-lsocket $LIBS"
+
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+
+   echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6
+ echo "configure:2170: checking for gethostbyname in -lnsl" >&5
+ ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'`
+ if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+   echo $ac_n "(cached) $ac_c" 1>&6
+ else
+   ac_save_LIBS="$LIBS"
+ LIBS="-lnsl  $LIBS"
+ cat > conftest.$ac_ext <<EOF
+ #line 2178 "configure"
+ #include "confdefs.h"
+ /* Override any gcc2 internal prototype to avoid an error.  */
+ /* We use char because int might match the return type of a gcc2
+     builtin and then its argument prototype would still apply.  */
+ char gethostbyname();
+
+ int main() {
+ gethostbyname()
+ ; return 0; }
+ EOF
+ if { (eval echo configure:2189: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+   rm -rf conftest*
+   eval "ac_cv_lib_$ac_lib_var=yes"
+ else
+   echo "configure: failed program was:" >&5
+   cat conftest.$ac_ext >&5
+   rm -rf conftest*
+   eval "ac_cv_lib_$ac_lib_var=no"
+ fi
+ rm -f conftest*
+ LIBS="$ac_save_LIBS"
+
+ fi
+ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+   echo "$ac_t""yes" 1>&6
+     ac_tr_lib=HAVE_LIB`echo nsl | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+     -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+   cat >> confdefs.h <<EOF
+ #define $ac_tr_lib 1
+ EOF
+
+   LIBS="-lnsl $LIBS"
+
+ else
+   echo "$ac_t""no" 1>&6
+ fi
+
   echo $ac_n "checking whether compiling netbeans integration is possible""... $ac_c" 1>&6
! echo "configure:2217: checking whether compiling netbeans integration is possible" >&5
   cat > conftest.$ac_ext <<EOF
! #line 2219 "configure"
 #include "confdefs.h"

 #include <stdio.h>
*** ../vim-6.2f.034/src/configure.in    Sat May 31 12:03:18 2003
--- src/configure.in    Sat May 31 16:38:14 2003
***************
*** 630,635 ****
--- 630,638 ----
       , [enable_netbeans="yes"])
 if test "$enable_netbeans" = "yes"; then
   AC_MSG_RESULT(no)
+   dnl On Solaris we need the socket and nsl library.
+   AC_CHECK_LIB(socket, socket)
+   AC_CHECK_LIB(nsl, gethostbyname)
   AC_MSG_CHECKING(whether compiling netbeans integration is possible)
   AC_TRY_LINK([
 #include <stdio.h>
*** ../vim-6.2f.034/src/version.c       Sat May 31 12:03:18 2003
--- src/version.c       Sat May 31 16:43:15 2003
***************
*** 632,633 ****
--- 632,635 ----
 {   /* Add new patch number below this line */
+ /**/
+     35,
 /**/

--
He who laughs last, thinks slowest.

/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///          Creator of Vim - Vi IMproved -- http://www.Vim.org          \\\
\\\              Project leader for A-A-P -- http://www.A-A-P.org        ///
\\\     Help AIDS victims, buy at Amazon -- http://ICCF.nl/click1.html ///