From: Marc G. Fournier Date: Tue, 4 Feb 1997 22:39:56 +0000 (+0000) Subject: Add in appropriate checks for inet_aton, and modifications to backend/port/Makefile X-Git-Tag: REL6_1~594 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4506116db8c3473aac9400d2d7ffb6968b32314e;p=postgresql Add in appropriate checks for inet_aton, and modifications to backend/port/Makefile to include inet_aton.c if required --- diff --git a/src/configure b/src/configure index f30c46cb0f..4f4b5a88d6 100755 --- a/src/configure +++ b/src/configure @@ -2925,13 +2925,66 @@ else fi done +echo $ac_n "checking for inet_aton""... $ac_c" 1>&6 +echo "configure:2930: checking for inet_aton" >&5 +if eval "test \"`echo '$''{'ac_cv_func_inet_aton'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* 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_aton(); + +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_aton) || defined (__stub___inet_aton) +choke me +#else +inet_aton(); +#endif + +; return 0; } +EOF +if { (eval echo configure:2958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then + rm -rf conftest* + eval "ac_cv_func_inet_aton=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_inet_aton=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'inet_aton`\" = yes"; then + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define HAVE_INET_ATON 1 +EOF + +else + echo "$ac_t""no" 1>&6 +INET_ATON='inet_aton.o' +fi + + echo $ac_n "checking for cbrt""... $ac_c" 1>&6 -echo "configure:2930: checking for cbrt" >&5 +echo "configure:2983: checking for cbrt" >&5 if eval "test \"`echo '$''{'ac_cv_func_cbrt'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3011: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_cbrt=yes" else @@ -2975,7 +3028,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for cbrt in -lm""... $ac_c" 1>&6 -echo "configure:2979: checking for cbrt in -lm" >&5 +echo "configure:3032: checking for cbrt in -lm" >&5 ac_lib_var=`echo m'_'cbrt | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2983,7 +3036,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3051: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3020,12 +3073,12 @@ fi fi echo $ac_n "checking for rint""... $ac_c" 1>&6 -echo "configure:3024: checking for rint" >&5 +echo "configure:3077: checking for rint" >&5 if eval "test \"`echo '$''{'ac_cv_func_rint'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3105: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_func_rint=yes" else @@ -3069,7 +3122,7 @@ EOF else echo "$ac_t""no" 1>&6 echo $ac_n "checking for rint in -lm""... $ac_c" 1>&6 -echo "configure:3073: checking for rint in -lm" >&5 +echo "configure:3126: checking for rint in -lm" >&5 ac_lib_var=`echo m'_'rint | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3077,7 +3130,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lm $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest; then +if { (eval echo configure:3145: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3214,7 +3267,7 @@ done ac_given_srcdir=$srcdir -trap 'rm -fr `echo "GNUmakefile Makefile.global include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 +trap 'rm -fr `echo "GNUmakefile Makefile.global backend/port/Makefile include/config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then diff --git a/src/configure.in b/src/configure.in index f2d242b564..0d638ceffe 100644 --- a/src/configure.in +++ b/src/configure.in @@ -149,7 +149,9 @@ AC_FUNC_MEMCMP AC_TYPE_SIGNAL AC_FUNC_VPRINTF AC_CHECK_FUNCS(isinf tzset getrusage vfork memmove sigsetjmp kill sysconf) +AC_CHECK_FUNC(inet_aton, AC_DEFINE(HAVE_INET_ATON), INET_ATON='inet_aton.o') +AC_SUBST(INET_ATON) AC_CHECK_FUNC(cbrt, AC_DEFINE(HAVE_CBRT), AC_CHECK_LIB(m, cbrt, AC_DEFINE(HAVE_CBRT))) AC_CHECK_FUNC(rint, AC_DEFINE(HAVE_RINT), AC_CHECK_LIB(m, rint, AC_DEFINE(HAVE_RINT))) -AC_OUTPUT(GNUmakefile Makefile.global) +AC_OUTPUT(GNUmakefile Makefile.global backend/port/Makefile) diff --git a/src/include/config.h.in b/src/include/config.h.in index 8eb3d67f40..833222709c 100644 --- a/src/include/config.h.in +++ b/src/include/config.h.in @@ -44,6 +44,9 @@ /* Set to 1 if you have cbrt() */ #undef HAVE_CBRT +/* Set to 1 if you have cbrt() */ +#undef HAVE_INET_ATON + /* Set to 1 if you have rint() */ #undef HAVE_RINT