summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorTodd C. Miller <Todd.Miller@courtesan.com>1999-02-01 00:46:13 +0000
committerTodd C. Miller <Todd.Miller@courtesan.com>1999-02-01 00:46:13 +0000
commit0ee00ab5969f93fe571eeb4423cdf9a7a2693996 (patch)
tree3f2d534f81db70740cc682a1208ba76562b0ebf1 /configure
parent0fe753f2488086178d0ee88cd152ac57fec7ca44 (diff)
downloadsudo-0ee00ab5969f93fe571eeb4423cdf9a7a2693996.tar.gz
When linking with both -lsocket and -lnsl be sure to do so in that order. Also, when we can't find socket() or inet_addr() and have to try linking with both libs, issue a warning.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure112
1 files changed, 56 insertions, 56 deletions
diff --git a/configure b/configure
index 40d2e19ca..533e881e5 100755
--- a/configure
+++ b/configure
@@ -6147,70 +6147,70 @@ fi
fi
fi
-echo $ac_n "checking for inet_addr""... $ac_c" 1>&6
-echo "configure:6152: checking for inet_addr" >&5
-if eval "test \"`echo '$''{'ac_cv_func_inet_addr'+set}'`\" = set"; then
+echo $ac_n "checking for socket""... $ac_c" 1>&6
+echo "configure:6152: checking for socket" >&5
+if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6157 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char inet_addr(); below. */
+ which can conflict with char socket(); below. */
#include <assert.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 inet_addr();
+char socket();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_inet_addr) || defined (__stub___inet_addr)
+#if defined (__stub_socket) || defined (__stub___socket)
choke me
#else
-inet_addr();
+socket();
#endif
; return 0; }
EOF
if { (eval echo configure:6180: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
- eval "ac_cv_func_inet_addr=yes"
+ eval "ac_cv_func_socket=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_inet_addr=no"
+ eval "ac_cv_func_socket=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'inet_addr`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
echo "$ac_t""yes" 1>&6
:
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for inet_addr in -lnsl""... $ac_c" 1>&6
-echo "configure:6198: checking for inet_addr in -lnsl" >&5
-ac_lib_var=`echo nsl'_'inet_addr | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:6198: 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="-lnsl $LIBS"
+LIBS="-lsocket $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6206 "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 inet_addr();
+char socket();
int main() {
-inet_addr()
+socket()
; return 0; }
EOF
if { (eval echo configure:6217: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6228,12 +6228,12 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- SUDO_LIBS="${SUDO_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"
+ SUDO_LIBS="${SUDO_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for inet_addr in -linet""... $ac_c" 1>&6
-echo "configure:6236: checking for inet_addr in -linet" >&5
-ac_lib_var=`echo inet'_'inet_addr | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
+echo "configure:6236: checking for socket in -linet" >&5
+ac_lib_var=`echo inet'_'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
@@ -6245,10 +6245,10 @@ cat > conftest.$ac_ext <<EOF
/* 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 inet_addr();
+char socket();
int main() {
-inet_addr()
+socket()
; return 0; }
EOF
if { (eval echo configure:6255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6269,24 +6269,24 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
SUDO_LIBS="${SUDO_LIBS} -linet"; LIBS="${LIBS} -linet"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for inet_addr in -lnsl""... $ac_c" 1>&6
-echo "configure:6274: checking for inet_addr in -lnsl" >&5
-ac_lib_var=`echo nsl'_'inet_addr | sed 'y%./+-%__p_%'`
+echo "configure: warning: unable to find socket() trying -lsocket -lnsl" 1>&2 echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:6274: 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="-lnsl socket $LIBS"
+LIBS="-lsocket -lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6282 "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 inet_addr();
+char socket();
int main() {
-inet_addr()
+socket()
; return 0; }
EOF
if { (eval echo configure:6293: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6315,70 +6315,70 @@ fi
fi
-echo $ac_n "checking for socket""... $ac_c" 1>&6
-echo "configure:6320: checking for socket" >&5
-if eval "test \"`echo '$''{'ac_cv_func_socket'+set}'`\" = set"; then
+echo $ac_n "checking for inet_addr""... $ac_c" 1>&6
+echo "configure:6320: checking for inet_addr" >&5
+if eval "test \"`echo '$''{'ac_cv_func_inet_addr'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
#line 6325 "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
- which can conflict with char socket(); below. */
+ which can conflict with char inet_addr(); below. */
#include <assert.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();
+char inet_addr();
int main() {
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
-#if defined (__stub_socket) || defined (__stub___socket)
+#if defined (__stub_inet_addr) || defined (__stub___inet_addr)
choke me
#else
-socket();
+inet_addr();
#endif
; return 0; }
EOF
if { (eval echo configure:6348: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
rm -rf conftest*
- eval "ac_cv_func_socket=yes"
+ eval "ac_cv_func_inet_addr=yes"
else
echo "configure: failed program was:" >&5
cat conftest.$ac_ext >&5
rm -rf conftest*
- eval "ac_cv_func_socket=no"
+ eval "ac_cv_func_inet_addr=no"
fi
rm -f conftest*
fi
-if eval "test \"`echo '$ac_cv_func_'socket`\" = yes"; then
+if eval "test \"`echo '$ac_cv_func_'inet_addr`\" = yes"; then
echo "$ac_t""yes" 1>&6
:
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:6366: checking for socket in -lsocket" >&5
-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for inet_addr in -lnsl""... $ac_c" 1>&6
+echo "configure:6366: checking for inet_addr in -lnsl" >&5
+ac_lib_var=`echo nsl'_'inet_addr | 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"
+LIBS="-lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6374 "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();
+char inet_addr();
int main() {
-socket()
+inet_addr()
; return 0; }
EOF
if { (eval echo configure:6385: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6396,12 +6396,12 @@ LIBS="$ac_save_LIBS"
fi
if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
echo "$ac_t""yes" 1>&6
- SUDO_LIBS="${SUDO_LIBS} -lsocket"; LIBS="${LIBS} -lsocket"
+ SUDO_LIBS="${SUDO_LIBS} -lnsl"; LIBS="${LIBS} -lnsl"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for socket in -linet""... $ac_c" 1>&6
-echo "configure:6404: checking for socket in -linet" >&5
-ac_lib_var=`echo inet'_'socket | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for inet_addr in -linet""... $ac_c" 1>&6
+echo "configure:6404: checking for inet_addr in -linet" >&5
+ac_lib_var=`echo inet'_'inet_addr | 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
@@ -6413,10 +6413,10 @@ cat > conftest.$ac_ext <<EOF
/* 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();
+char inet_addr();
int main() {
-socket()
+inet_addr()
; return 0; }
EOF
if { (eval echo configure:6423: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
@@ -6437,24 +6437,24 @@ if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
SUDO_LIBS="${SUDO_LIBS} -linet"; LIBS="${LIBS} -linet"
else
echo "$ac_t""no" 1>&6
-echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
-echo "configure:6442: checking for socket in -lsocket" >&5
-ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+echo "configure: warning: unable to find socket() trying -lsocket -lnsl" 1>&2 echo $ac_n "checking for inet_addr in -lsocket""... $ac_c" 1>&6
+echo "configure:6442: checking for inet_addr in -lsocket" >&5
+ac_lib_var=`echo socket'_'inet_addr | 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 nsl $LIBS"
+LIBS="-lsocket -lnsl $LIBS"
cat > conftest.$ac_ext <<EOF
#line 6450 "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();
+char inet_addr();
int main() {
-socket()
+inet_addr()
; return 0; }
EOF
if { (eval echo configure:6461: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then