mirror of
https://github.com/nmap/nmap.git
synced 2026-10-22 11:51:52 +00:00
Modernize autoconf macros for nbase
This commit is contained in:
parent
12963cfefe
commit
5de629e3dd
5 changed files with 58 additions and 35 deletions
|
|
@ -13,7 +13,7 @@ dnl describing the error codes.
|
|||
dnl
|
||||
AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[
|
||||
AC_CACHE_CHECK(for working getaddrinfo, ac_cv_working_getaddrinfo,[
|
||||
AC_TRY_RUN( [
|
||||
AC_RUN_IFELSE( [AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
|
@ -26,8 +26,7 @@ AC_DEFUN(APR_CHECK_WORKING_GETADDRINFO,[
|
|||
#ifdef HAVE_SYS_SOCKET_H
|
||||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
],[
|
||||
struct addrinfo hints, *ai;
|
||||
int error;
|
||||
|
||||
|
|
@ -43,14 +42,14 @@ int main(void) {
|
|||
}
|
||||
freeaddrinfo(ai);
|
||||
return 0;
|
||||
}
|
||||
],[
|
||||
])],[
|
||||
ac_cv_working_getaddrinfo="yes"
|
||||
],[
|
||||
ac_cv_working_getaddrinfo="no"
|
||||
],[
|
||||
ac_cv_working_getaddrinfo="yes"
|
||||
])])
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_working_getaddrinfo" = "yes"; then
|
||||
if test "$ac_cv_func_gai_strerror" != "yes"; then
|
||||
ac_cv_working_getaddrinfo="no"
|
||||
|
|
@ -65,7 +64,7 @@ dnl check for working getnameinfo() -- from Apache 2.0.40
|
|||
dnl
|
||||
AC_DEFUN(APR_CHECK_WORKING_GETNAMEINFO,[
|
||||
AC_CACHE_CHECK(for working getnameinfo, ac_cv_working_getnameinfo,[
|
||||
AC_TRY_RUN( [
|
||||
AC_RUN_IFELSE( [AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_NETDB_H
|
||||
#include <netdb.h>
|
||||
#endif
|
||||
|
|
@ -84,8 +83,7 @@ AC_DEFUN(APR_CHECK_WORKING_GETNAMEINFO,[
|
|||
#ifdef HAVE_ARPA_INET_H
|
||||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
],[[
|
||||
struct sockaddr_in sa;
|
||||
char hbuf[256];
|
||||
int error;
|
||||
|
|
@ -105,14 +103,14 @@ int main(void) {
|
|||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
],[
|
||||
]])],[
|
||||
ac_cv_working_getnameinfo="yes"
|
||||
],[
|
||||
ac_cv_working_getnameinfo="no"
|
||||
],[
|
||||
ac_cv_working_getnameinfo="yes"
|
||||
])])
|
||||
])
|
||||
])
|
||||
if test "$ac_cv_working_getnameinfo" = "yes"; then
|
||||
AC_DEFINE(HAVE_GETNAMEINFO, 1, [Define if getnameinfo exists])
|
||||
fi
|
||||
|
|
@ -120,7 +118,7 @@ fi
|
|||
|
||||
AC_DEFUN(APR_CHECK_SOCKADDR_IN6,[
|
||||
AC_CACHE_CHECK(for sockaddr_in6, ac_cv_define_sockaddr_in6,[
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
|
@ -129,7 +127,7 @@ AC_TRY_COMPILE([
|
|||
#endif
|
||||
],[
|
||||
struct sockaddr_in6 sa;
|
||||
],[
|
||||
])],[
|
||||
ac_cv_define_sockaddr_in6=yes
|
||||
],[
|
||||
ac_cv_define_sockaddr_in6=no
|
||||
|
|
@ -146,7 +144,7 @@ fi
|
|||
|
||||
AC_DEFUN(CHECK_AF_INET6_DEFINE,[
|
||||
AC_CACHE_CHECK(for AF_INET6 definition, ac_cv_define_af_inet6,[
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
|
@ -158,7 +156,7 @@ AC_TRY_COMPILE([
|
|||
#endif
|
||||
],[
|
||||
int af = AF_INET6;
|
||||
],[
|
||||
])],[
|
||||
ac_cv_define_af_inet6=yes
|
||||
],[
|
||||
ac_cv_define_af_inet6=no
|
||||
|
|
@ -175,7 +173,7 @@ fi
|
|||
|
||||
AC_DEFUN(APR_CHECK_SOCKADDR_STORAGE,[
|
||||
AC_CACHE_CHECK(for sockaddr_storage, ac_cv_define_sockaddr_storage,[
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#ifdef HAVE_SYS_TYPES_H
|
||||
#include <sys/types.h>
|
||||
#endif
|
||||
|
|
@ -187,7 +185,7 @@ AC_TRY_COMPILE([
|
|||
#endif
|
||||
],[
|
||||
struct sockaddr_storage sa;
|
||||
],[
|
||||
])],[
|
||||
ac_cv_define_sockaddr_storage=yes
|
||||
],[
|
||||
ac_cv_define_sockaddr_storage=no
|
||||
|
|
|
|||
30
nbase/configure
vendored
30
nbase/configure
vendored
|
|
@ -4056,10 +4056,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|||
|
||||
fi
|
||||
|
||||
if test "$ac_cv___attribute__" = "yes"; then
|
||||
if test "x$ac_cv___attribute__" = "xyes"
|
||||
then :
|
||||
|
||||
|
||||
printf "%s\n" "#define HAVE___ATTRIBUTE__ 1" >>confdefs.h
|
||||
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv___attribute__" >&5
|
||||
printf "%s\n" "$ac_cv___attribute__" >&6; }
|
||||
|
|
@ -4096,10 +4099,13 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
|
|||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_sockaddr_has_sa_len" >&5
|
||||
printf "%s\n" "$ac_cv_sockaddr_has_sa_len" >&6; }
|
||||
if test $ac_cv_sockaddr_has_sa_len = yes ; then
|
||||
if test x$ac_cv_sockaddr_has_sa_len = xyes
|
||||
then :
|
||||
|
||||
|
||||
printf "%s\n" "#define HAVE_SOCKADDR_SA_LEN 1" >>confdefs.h
|
||||
|
||||
|
||||
fi
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
|
||||
|
|
@ -4987,7 +4993,10 @@ else $as_nop
|
|||
#include <sys/socket.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
struct addrinfo hints, *ai;
|
||||
int error;
|
||||
|
||||
|
|
@ -5003,8 +5012,10 @@ int main(void) {
|
|||
}
|
||||
freeaddrinfo(ai);
|
||||
return 0;
|
||||
}
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"
|
||||
then :
|
||||
|
|
@ -5020,6 +5031,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_getaddrinfo" >&5
|
||||
printf "%s\n" "$ac_cv_working_getaddrinfo" >&6; }
|
||||
|
|
@ -5129,7 +5141,10 @@ else $as_nop
|
|||
#include <arpa/inet.h>
|
||||
#endif
|
||||
|
||||
int main(void) {
|
||||
int
|
||||
main (void)
|
||||
{
|
||||
|
||||
struct sockaddr_in sa;
|
||||
char hbuf[256];
|
||||
int error;
|
||||
|
|
@ -5149,8 +5164,10 @@ int main(void) {
|
|||
} else {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
;
|
||||
return 0;
|
||||
}
|
||||
_ACEOF
|
||||
if ac_fn_c_try_run "$LINENO"
|
||||
then :
|
||||
|
|
@ -5166,6 +5183,7 @@ rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
|
|||
conftest.$ac_objext conftest.beam conftest.$ac_ext
|
||||
fi
|
||||
|
||||
|
||||
fi
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $ac_cv_working_getnameinfo" >&5
|
||||
printf "%s\n" "$ac_cv_working_getnameinfo" >&6; }
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@ if test "$user_localdirs" = 1; then
|
|||
fi
|
||||
|
||||
dnl use config.h instad of -D macros
|
||||
AC_CONFIG_HEADER(nbase_config.h)
|
||||
AC_CONFIG_HEADERS([nbase_config.h])
|
||||
|
||||
dnl Checks for programs.
|
||||
AC_PROG_CC
|
||||
|
|
@ -90,7 +90,7 @@ AC_CHECK_HEADERS([net/if.h], [], [],
|
|||
|
||||
AC_MSG_CHECKING(for __attribute__)
|
||||
AC_CACHE_VAL(ac_cv___attribute__, [
|
||||
AC_TRY_COMPILE(
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
|
||||
[
|
||||
#include <stdlib.h>
|
||||
|
||||
|
|
@ -104,14 +104,14 @@ AC_CACHE_VAL(ac_cv___attribute__, [
|
|||
],
|
||||
[
|
||||
foo();
|
||||
],
|
||||
])],
|
||||
ac_cv___attribute__=yes,
|
||||
ac_cv___attribute__=no
|
||||
)
|
||||
])
|
||||
if test "$ac_cv___attribute__" = "yes"; then
|
||||
AS_IF([test "x$ac_cv___attribute__" = "xyes"], [
|
||||
AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
|
||||
fi
|
||||
])
|
||||
AC_MSG_RESULT($ac_cv___attribute__)
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
|
@ -123,15 +123,15 @@ dnl ##################################################################
|
|||
dnl Check if sockaddr{} has sa_len member.
|
||||
dnl
|
||||
AC_CACHE_CHECK(if sockaddr{} has sa_len member, ac_cv_sockaddr_has_sa_len,
|
||||
AC_TRY_COMPILE([
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||
#include <sys/types.h>
|
||||
#include <sys/socket.h>],
|
||||
[unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)],
|
||||
[unsigned int i = sizeof(((struct sockaddr *)0)->sa_len)])],
|
||||
ac_cv_sockaddr_has_sa_len=yes,
|
||||
ac_cv_sockaddr_has_sa_len=no))
|
||||
if test $ac_cv_sockaddr_has_sa_len = yes ; then
|
||||
AS_IF([test x$ac_cv_sockaddr_has_sa_len = xyes], [
|
||||
AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1, [define if sockaddr has sa_len member])
|
||||
fi
|
||||
])
|
||||
|
||||
dnl check endedness
|
||||
AC_C_BIGENDIAN
|
||||
|
|
@ -237,5 +237,6 @@ fi
|
|||
|
||||
CHECK_PROC_SELF_EXE
|
||||
|
||||
AC_OUTPUT(Makefile)
|
||||
AC_CONFIG_FILES([Makefile])
|
||||
AC_OUTPUT
|
||||
|
||||
|
|
|
|||
6
nping/configure
vendored
6
nping/configure
vendored
|
|
@ -5487,6 +5487,12 @@ then :
|
|||
printf "%s\n" "#define HAVE_SYS_SOCKIO_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
ac_fn_c_check_header_compile "$LINENO" "sys/time.h" "ac_cv_header_sys_time_h" "$ac_includes_default"
|
||||
if test "x$ac_cv_header_sys_time_h" = xyes
|
||||
then :
|
||||
printf "%s\n" "#define HAVE_SYS_TIME_H 1" >>confdefs.h
|
||||
|
||||
fi
|
||||
|
||||
|
||||
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for library containing setsockopt" >&5
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ dnl Generate these files
|
|||
AC_CONFIG_FILES([Makefile ../tests/Makefile])
|
||||
|
||||
dnl use nsock_config.h instad of -D macros
|
||||
AC_CONFIG_HEADER(../include/nsock_config.h)
|
||||
AC_CONFIG_HEADERS([../include/nsock_config.h])
|
||||
|
||||
dnl Host specific hacks
|
||||
AC_CANONICAL_HOST
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue