Browse Source

add inet_ntoa.m4

Max Lv 12 years ago
parent
commit
392c3e0e57
10 changed files with 200 additions and 38 deletions
  1. 11
      Makefile.in
  2. 1
      aclocal.m4
  3. 7
      config.h.in
  4. 136
      configure
  5. 3
      configure.ac
  6. 11
      libasyncns/Makefile.in
  7. 11
      libev/Makefile.in
  8. 41
      m4/inet_ntoa.m4
  9. 2
      src/Makefile.am
  10. 15
      src/Makefile.in

11
Makefile.in

@ -40,11 +40,11 @@ DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \
config.sub depcomp install-sh ltmain.sh missing
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/libev/libev.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/inet_ntoa.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/openssl.m4 \
$(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
@ -156,6 +156,7 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INET_ATON_LIB = @INET_ATON_LIB@
INET_NTOA_LIB = @INET_NTOA_LIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

1
aclocal.m4

@ -951,6 +951,7 @@ AC_SUBST([am__untar])
m4_include([m4/acx_pthread.m4])
m4_include([m4/inet_aton.m4])
m4_include([m4/inet_ntoa.m4])
m4_include([m4/libtool.m4])
m4_include([m4/ltoptions.m4])
m4_include([m4/ltsugar.m4])

7
config.h.in

@ -16,6 +16,10 @@
don't. */
#undef HAVE_DECL_INET_ATON
/* Define to 1 if you have the declaration of `inet_ntoa', and to 0 if you
don't. */
#undef HAVE_DECL_INET_NTOA
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
@ -40,6 +44,9 @@
/* Define to 1 if you have the `inet_aton' function. */
#undef HAVE_INET_ATON
/* Define to 1 if you have the `inet_ntoa' function. */
#undef HAVE_INET_NTOA
/* Define to 1 if you have the `inotify_init' function. */
#undef HAVE_INOTIFY_INIT

136
configure

@ -754,6 +754,7 @@ acx_pthread_config
LIBOBJS
BUILD_REDIRECTOR_FALSE
BUILD_REDIRECTOR_TRUE
INET_NTOA_LIB
INET_ATON_LIB
CPP
OTOOL64
@ -4647,13 +4648,13 @@ if test "${lt_cv_nm_interface+set}" = set; then :
else
lt_cv_nm_interface="BSD nm"
echo "int some_variable = 0;" > conftest.$ac_ext
(eval echo "\"\$as_me:4650: $ac_compile\"" >&5)
(eval echo "\"\$as_me:4651: $ac_compile\"" >&5)
(eval "$ac_compile" 2>conftest.err)
cat conftest.err >&5
(eval echo "\"\$as_me:4653: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval echo "\"\$as_me:4654: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
(eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
cat conftest.err >&5
(eval echo "\"\$as_me:4656: output\"" >&5)
(eval echo "\"\$as_me:4657: output\"" >&5)
cat conftest.out >&5
if $GREP 'External.*some_variable' conftest.out > /dev/null; then
lt_cv_nm_interface="MS dumpbin"
@ -5859,7 +5860,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 5862 "configure"' > conftest.$ac_ext
echo '#line 5863 "configure"' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -7388,11 +7389,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7391: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7392: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7395: \$? = $ac_status" >&5
echo "$as_me:7396: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7727,11 +7728,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7730: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7731: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:7734: \$? = $ac_status" >&5
echo "$as_me:7735: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7832,11 +7833,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7835: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7836: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7839: \$? = $ac_status" >&5
echo "$as_me:7840: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -7887,11 +7888,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7890: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7891: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7894: \$? = $ac_status" >&5
echo "$as_me:7895: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -10271,7 +10272,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10274 "configure"
#line 10275 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -10367,7 +10368,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<_LT_EOF
#line 10370 "configure"
#line 10371 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11253,6 +11254,113 @@ _ACEOF
HAVE_INET_NTOA=1
INET_NTOA_LIB=
ss_save_LIBS=$LIBS
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing inet_ntoa" >&5
$as_echo_n "checking for library containing inet_ntoa... " >&6; }
if test "${ac_cv_search_inet_ntoa+set}" = set; then :
$as_echo_n "(cached) " >&6
else
ac_func_search_save_LIBS=$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. */
#ifdef __cplusplus
extern "C"
#endif
char inet_ntoa ();
int
main ()
{
return inet_ntoa ();
;
return 0;
}
_ACEOF
for ac_lib in '' nsl resolv; do
if test -z "$ac_lib"; then
ac_res="none required"
else
ac_res=-l$ac_lib
LIBS="-l$ac_lib $ac_func_search_save_LIBS"
fi
if ac_fn_c_try_link "$LINENO"; then :
ac_cv_search_inet_ntoa=$ac_res
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext
if test "${ac_cv_search_inet_ntoa+set}" = set; then :
break
fi
done
if test "${ac_cv_search_inet_ntoa+set}" = set; then :
else
ac_cv_search_inet_ntoa=no
fi
rm conftest.$ac_ext
LIBS=$ac_func_search_save_LIBS
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_inet_ntoa" >&5
$as_echo "$ac_cv_search_inet_ntoa" >&6; }
ac_res=$ac_cv_search_inet_ntoa
if test "$ac_res" != no; then :
test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
else
for ac_func in inet_ntoa
do :
ac_fn_c_check_func "$LINENO" "inet_ntoa" "ac_cv_func_inet_ntoa"
if test "x$ac_cv_func_inet_ntoa" = x""yes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_INET_NTOA 1
_ACEOF
fi
done
if test $ac_cv_func_inet_ntoa = no; then
HAVE_INET_NTOA=0
fi
fi
LIBS=$ss_save_LIBS
if test "$ac_cv_search_inet_ntoa" != "no" \
&& test "$ac_cv_search_inet_ntoa" != "none required"; then
INET_NTOA_LIB="$ac_cv_search_inet_ntoa"
fi
ac_fn_c_check_decl "$LINENO" "inet_ntoa" "ac_cv_have_decl_inet_ntoa" "#include <arpa/inet.h>
#if HAVE_NETDB_H
# include <netdb.h>
#endif
"
if test "x$ac_cv_have_decl_inet_ntoa" = x""yes; then :
ac_have_decl=1
else
ac_have_decl=0
fi
cat >>confdefs.h <<_ACEOF
#define HAVE_DECL_INET_NTOA $ac_have_decl
_ACEOF
if test $ac_cv_have_decl_inet_ntoa = no; then
HAVE_DECL_INET_NTOA=0
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for what kind of host" >&5
$as_echo_n "checking for what kind of host... " >&6; }
case $host in

3
configure.ac

@ -22,8 +22,9 @@ m4_include([libev/libev.m4])
dnl Checks for openssl
ss_OPENSSL
dnl Checks for inet_aton
dnl Checks for inet_aton and inet_ntoa
ss_FUNC_INET_ATON
ss_FUNC_INET_NTOA
dnl Checks for host.
AC_MSG_CHECKING(for what kind of host)

11
libasyncns/Makefile.in

@ -56,11 +56,11 @@ subdir = libasyncns
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/libev/libev.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/inet_ntoa.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/openssl.m4 \
$(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -118,6 +118,7 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INET_ATON_LIB = @INET_ATON_LIB@
INET_NTOA_LIB = @INET_NTOA_LIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

11
libev/Makefile.in

@ -40,11 +40,11 @@ DIST_COMMON = README $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
mkinstalldirs
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/libev/libev.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/inet_ntoa.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/openssl.m4 \
$(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -101,6 +101,7 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INET_ATON_LIB = @INET_ATON_LIB@
INET_NTOA_LIB = @INET_NTOA_LIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@

41
m4/inet_ntoa.m4

@ -0,0 +1,41 @@
# inet_ntoa.m4 serial 19
dnl Copyright (C) 2005-2006, 2008-2013 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
AC_DEFUN([ss_FUNC_INET_NTOA],
[
AC_REQUIRE([AC_C_RESTRICT])
dnl Most platforms that provide inet_ntoa define it in libc.
dnl Solaris 8..10 provide inet_ntoa in libnsl instead.
dnl Solaris 2.6..7 provide inet_ntoa in libresolv instead.
HAVE_INET_NTOA=1
INET_NTOA_LIB=
ss_save_LIBS=$LIBS
AC_SEARCH_LIBS([inet_ntoa], [nsl resolv], [],
[AC_CHECK_FUNCS([inet_ntoa])
if test $ac_cv_func_inet_ntoa = no; then
HAVE_INET_NTOA=0
fi
])
LIBS=$ss_save_LIBS
if test "$ac_cv_search_inet_ntoa" != "no" \
&& test "$ac_cv_search_inet_ntoa" != "none required"; then
INET_NTOA_LIB="$ac_cv_search_inet_ntoa"
fi
AC_CHECK_HEADERS_ONCE([netdb.h])
AC_CHECK_DECLS([inet_ntoa],,,
[[#include <arpa/inet.h>
#if HAVE_NETDB_H
# include <netdb.h>
#endif
]])
if test $ac_cv_have_decl_inet_ntoa = no; then
HAVE_DECL_INET_NTOA=0
fi
AC_SUBST([INET_NTOA_LIB])
])

2
src/Makefile.am

@ -4,7 +4,7 @@ AM_CFLAGS += -I$(top_builddir)/libasyncns
AM_LDFLAGS = -static
SS_COMMON_LIBS = $(top_builddir)/libev/libev.la $(INET_ATON_LIB)
SS_COMMON_LIBS = $(top_builddir)/libev/libev.la $(INET_ATON_LIB) $(INET_NTOA_LIB)
bin_PROGRAMS = ss-local ss-server
ss_local_SOURCES = utils.c \

15
src/Makefile.in

@ -40,11 +40,11 @@ subdir = src
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/acx_pthread.m4 \
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
$(top_srcdir)/m4/ltversion.m4 $(top_srcdir)/m4/lt~obsolete.m4 \
$(top_srcdir)/m4/openssl.m4 $(top_srcdir)/libev/libev.m4 \
$(top_srcdir)/configure.ac
$(top_srcdir)/m4/inet_aton.m4 $(top_srcdir)/m4/inet_ntoa.m4 \
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/m4/openssl.m4 \
$(top_srcdir)/libev/libev.m4 $(top_srcdir)/configure.ac
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
$(ACLOCAL_M4)
mkinstalldirs = $(install_sh) -d
@ -59,7 +59,7 @@ am_ss_local_OBJECTS = utils.$(OBJEXT) jconf.$(OBJEXT) json.$(OBJEXT) \
ss_local_OBJECTS = $(am_ss_local_OBJECTS)
am__DEPENDENCIES_1 =
am__DEPENDENCIES_2 = $(top_builddir)/libev/libev.la \
$(am__DEPENDENCIES_1)
$(am__DEPENDENCIES_1) $(am__DEPENDENCIES_1)
ss_local_DEPENDENCIES = $(am__DEPENDENCIES_2)
am__ss_redir_SOURCES_DIST = utils.c jconf.c json.c encrypt.c redir.c
@BUILD_REDIRECTOR_TRUE@am_ss_redir_OBJECTS = utils.$(OBJEXT) \
@ -116,6 +116,7 @@ EXEEXT = @EXEEXT@
FGREP = @FGREP@
GREP = @GREP@
INET_ATON_LIB = @INET_ATON_LIB@
INET_NTOA_LIB = @INET_NTOA_LIB@
INSTALL = @INSTALL@
INSTALL_DATA = @INSTALL_DATA@
INSTALL_PROGRAM = @INSTALL_PROGRAM@
@ -210,7 +211,7 @@ top_srcdir = @top_srcdir@
AM_CFLAGS = -g -O2 -Wall -fno-strict-aliasing -I$(top_builddir)/libev \
-I$(top_builddir)/libasyncns
AM_LDFLAGS = -static
SS_COMMON_LIBS = $(top_builddir)/libev/libev.la $(INET_ATON_LIB)
SS_COMMON_LIBS = $(top_builddir)/libev/libev.la $(INET_ATON_LIB) $(INET_NTOA_LIB)
ss_local_SOURCES = utils.c \
jconf.c \
json.c \

Loading…
Cancel
Save