Skip to content
Snippets Groups Projects
Commit e00a9794 authored by Matt Johnston's avatar Matt Johnston
Browse files

Replace some deprecated macros with other ones, from Daniel Richard G.

parent a65f84db
No related merge requests found
...@@ -5,8 +5,9 @@ ...@@ -5,8 +5,9 @@
# of the platform checks have been taken straight from OpenSSH's configure.ac # of the platform checks have been taken straight from OpenSSH's configure.ac
# Huge thanks to them for dealing with the horrible platform-specifics :) # Huge thanks to them for dealing with the horrible platform-specifics :)
AC_PREREQ(2.50) AC_PREREQ(2.59)
AC_INIT(buffer.c) AC_INIT
AC_CONFIG_SRCDIR(buffer.c)
OLDCFLAGS=$CFLAGS OLDCFLAGS=$CFLAGS
# Checks for programs. # Checks for programs.
...@@ -221,7 +222,8 @@ AC_TYPE_PID_T ...@@ -221,7 +222,8 @@ AC_TYPE_PID_T
AC_TYPE_SIZE_T AC_TYPE_SIZE_T
AC_HEADER_TIME AC_HEADER_TIME
AC_CHECK_TYPES([uint16_t, u_int16_t, struct sockaddr_storage]) AC_CHECK_TYPES([uint8_t, u_int8_t, uint16_t, u_int16_t, uint32_t, u_int32_t])
AC_CHECK_TYPES([struct sockaddr_storage])
AC_CHECK_TYPE([socklen_t], ,[ AC_CHECK_TYPE([socklen_t], ,[
AC_MSG_CHECKING([for socklen_t equivalent]) AC_MSG_CHECKING([for socklen_t equivalent])
AC_CACHE_VAL([curl_cv_socklen_t_equiv], AC_CACHE_VAL([curl_cv_socklen_t_equiv],
...@@ -231,15 +233,15 @@ AC_CHECK_TYPE([socklen_t], ,[ ...@@ -231,15 +233,15 @@ AC_CHECK_TYPE([socklen_t], ,[
curl_cv_socklen_t_equiv= curl_cv_socklen_t_equiv=
for arg2 in "struct sockaddr" void; do for arg2 in "struct sockaddr" void; do
for t in int size_t unsigned long "unsigned long"; do for t in int size_t unsigned long "unsigned long"; do
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
int getpeername (int, $arg2 *, $t *); int getpeername (int, $arg2 *, $t *);
],[ ]],[[
$t len; $t len;
getpeername(0,0,&len); getpeername(0,0,&len);
],[ ]])],[
curl_cv_socklen_t_equiv="$t" curl_cv_socklen_t_equiv="$t"
break break
]) ])
...@@ -259,12 +261,11 @@ AC_CHECK_TYPE([socklen_t], ,[ ...@@ -259,12 +261,11 @@ AC_CHECK_TYPE([socklen_t], ,[
# for the fake-rfc2553 stuff - straight from OpenSSH # for the fake-rfc2553 stuff - straight from OpenSSH
AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [ AC_CACHE_CHECK([for struct sockaddr_storage], ac_cv_have_struct_sockaddr_storage, [
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
], ]],
[ struct sockaddr_storage s; ], [[ struct sockaddr_storage s; ]])],
[ ac_cv_have_struct_sockaddr_storage="yes" ], [ ac_cv_have_struct_sockaddr_storage="yes" ],
[ ac_cv_have_struct_sockaddr_storage="no" ] [ ac_cv_have_struct_sockaddr_storage="no" ]
) )
...@@ -274,12 +275,11 @@ if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then ...@@ -274,12 +275,11 @@ if test "x$ac_cv_have_struct_sockaddr_storage" = "xyes" ; then
fi fi
AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [ AC_CACHE_CHECK([for struct sockaddr_in6], ac_cv_have_struct_sockaddr_in6, [
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
], ]],
[ struct sockaddr_in6 s; s.sin6_family = 0; ], [[ struct sockaddr_in6 s; s.sin6_family = 0; ]])],
[ ac_cv_have_struct_sockaddr_in6="yes" ], [ ac_cv_have_struct_sockaddr_in6="yes" ],
[ ac_cv_have_struct_sockaddr_in6="no" ] [ ac_cv_have_struct_sockaddr_in6="no" ]
) )
...@@ -289,12 +289,11 @@ if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then ...@@ -289,12 +289,11 @@ if test "x$ac_cv_have_struct_sockaddr_in6" = "xyes" ; then
fi fi
AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [ AC_CACHE_CHECK([for struct in6_addr], ac_cv_have_struct_in6_addr, [
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[
#include <sys/types.h> #include <sys/types.h>
#include <netinet/in.h> #include <netinet/in.h>
], ]],
[ struct in6_addr s; s.s6_addr[0] = 0; ], [[ struct in6_addr s; s.s6_addr[0] = 0; ]])],
[ ac_cv_have_struct_in6_addr="yes" ], [ ac_cv_have_struct_in6_addr="yes" ],
[ ac_cv_have_struct_in6_addr="no" ] [ ac_cv_have_struct_in6_addr="no" ]
) )
...@@ -304,13 +303,12 @@ if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then ...@@ -304,13 +303,12 @@ if test "x$ac_cv_have_struct_in6_addr" = "xyes" ; then
fi fi
AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [ AC_CACHE_CHECK([for struct addrinfo], ac_cv_have_struct_addrinfo, [
AC_TRY_COMPILE( AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
], ]],
[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ], [[ struct addrinfo s; s.ai_flags = AI_PASSIVE; ]])],
[ ac_cv_have_struct_addrinfo="yes" ], [ ac_cv_have_struct_addrinfo="yes" ],
[ ac_cv_have_struct_addrinfo="no" ] [ ac_cv_have_struct_addrinfo="no" ]
) )
...@@ -323,15 +321,15 @@ fi ...@@ -323,15 +321,15 @@ fi
# IRIX has a const char return value for gai_strerror() # IRIX has a const char return value for gai_strerror()
AC_CHECK_FUNCS(gai_strerror,[ AC_CHECK_FUNCS(gai_strerror,[
AC_DEFINE(HAVE_GAI_STRERROR) AC_DEFINE(HAVE_GAI_STRERROR)
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <netdb.h> #include <netdb.h>
const char *gai_strerror(int);],[ const char *gai_strerror(int);]],[[
char *str; char *str;
str = gai_strerror(0);],[ str = gai_strerror(0);]])],[
AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1, AC_DEFINE(HAVE_CONST_GAI_STRERROR_PROTO, 1,
[Define if gai_strerror() returns const char *])])]) [Define if gai_strerror() returns const char *])])])
...@@ -453,7 +451,7 @@ dnl lastlog and [uw]tmp are subject to a file search if all else fails ...@@ -453,7 +451,7 @@ dnl lastlog and [uw]tmp are subject to a file search if all else fails
dnl lastlog detection dnl lastlog detection
dnl NOTE: the code itself will detect if lastlog is a directory dnl NOTE: the code itself will detect if lastlog is a directory
AC_MSG_CHECKING([if your system defines LASTLOG_FILE]) AC_MSG_CHECKING([if your system defines LASTLOG_FILE])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_LASTLOG_H #ifdef HAVE_LASTLOG_H
...@@ -465,13 +463,13 @@ AC_TRY_COMPILE([ ...@@ -465,13 +463,13 @@ AC_TRY_COMPILE([
#ifdef HAVE_LOGIN_H #ifdef HAVE_LOGIN_H
# include <login.h> # include <login.h>
#endif #endif
], ]],
[ char *lastlog = LASTLOG_FILE; ], [[ char *lastlog = LASTLOG_FILE; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ [
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
AC_MSG_CHECKING([if your system defines _PATH_LASTLOG]) AC_MSG_CHECKING([if your system defines _PATH_LASTLOG])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_LASTLOG_H #ifdef HAVE_LASTLOG_H
...@@ -480,8 +478,8 @@ AC_TRY_COMPILE([ ...@@ -480,8 +478,8 @@ AC_TRY_COMPILE([
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
# include <paths.h> # include <paths.h>
#endif #endif
], ]],
[ char *lastlog = _PATH_LASTLOG; ], [[ char *lastlog = _PATH_LASTLOG; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ [
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
...@@ -510,14 +508,14 @@ fi ...@@ -510,14 +508,14 @@ fi
dnl utmp detection dnl utmp detection
AC_MSG_CHECKING([if your system defines UTMP_FILE]) AC_MSG_CHECKING([if your system defines UTMP_FILE])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
# include <paths.h> # include <paths.h>
#endif #endif
], ]],
[ char *utmp = UTMP_FILE; ], [[ char *utmp = UTMP_FILE; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) [ AC_MSG_RESULT(no)
system_utmp_path=no ] system_utmp_path=no ]
...@@ -540,14 +538,14 @@ fi ...@@ -540,14 +538,14 @@ fi
dnl wtmp detection dnl wtmp detection
AC_MSG_CHECKING([if your system defines WTMP_FILE]) AC_MSG_CHECKING([if your system defines WTMP_FILE])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
# include <paths.h> # include <paths.h>
#endif #endif
], ]],
[ char *wtmp = WTMP_FILE; ], [[ char *wtmp = WTMP_FILE; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) [ AC_MSG_RESULT(no)
system_wtmp_path=no ] system_wtmp_path=no ]
...@@ -573,7 +571,7 @@ dnl utmpx detection - I don't know any system so perverse as to require ...@@ -573,7 +571,7 @@ dnl utmpx detection - I don't know any system so perverse as to require
dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out dnl utmpx, but not define UTMPX_FILE (ditto wtmpx.) No doubt it's out
dnl there, though. dnl there, though.
AC_MSG_CHECKING([if your system defines UTMPX_FILE]) AC_MSG_CHECKING([if your system defines UTMPX_FILE])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
...@@ -582,8 +580,8 @@ AC_TRY_COMPILE([ ...@@ -582,8 +580,8 @@ AC_TRY_COMPILE([
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
# include <paths.h> # include <paths.h>
#endif #endif
], ]],
[ char *utmpx = UTMPX_FILE; ], [[ char *utmpx = UTMPX_FILE; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) [ AC_MSG_RESULT(no)
system_utmpx_path=no ] system_utmpx_path=no ]
...@@ -598,7 +596,7 @@ fi ...@@ -598,7 +596,7 @@ fi
dnl wtmpx detection dnl wtmpx detection
AC_MSG_CHECKING([if your system defines WTMPX_FILE]) AC_MSG_CHECKING([if your system defines WTMPX_FILE])
AC_TRY_COMPILE([ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
#include <sys/types.h> #include <sys/types.h>
#include <utmp.h> #include <utmp.h>
#ifdef HAVE_UTMPX_H #ifdef HAVE_UTMPX_H
...@@ -607,8 +605,8 @@ AC_TRY_COMPILE([ ...@@ -607,8 +605,8 @@ AC_TRY_COMPILE([
#ifdef HAVE_PATHS_H #ifdef HAVE_PATHS_H
# include <paths.h> # include <paths.h>
#endif #endif
], ]],
[ char *wtmpx = WTMPX_FILE; ], [[ char *wtmpx = WTMPX_FILE; ]])],
[ AC_MSG_RESULT(yes) ], [ AC_MSG_RESULT(yes) ],
[ AC_MSG_RESULT(no) [ AC_MSG_RESULT(no)
system_wtmpx_path=no ] system_wtmpx_path=no ]
...@@ -625,7 +623,6 @@ fi ...@@ -625,7 +623,6 @@ fi
AC_PROG_GCC_TRADITIONAL AC_PROG_GCC_TRADITIONAL
AC_FUNC_MEMCMP AC_FUNC_MEMCMP
AC_FUNC_SELECT_ARGTYPES AC_FUNC_SELECT_ARGTYPES
AC_TYPE_SIGNAL
AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty getaddrinfo freeaddrinfo getnameinfo fork writev]) AC_CHECK_FUNCS([dup2 getspnam getusershell memset putenv select socket strdup clearenv strlcpy strlcat daemon basename _getpty getaddrinfo freeaddrinfo getnameinfo fork writev])
AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME)) AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
...@@ -633,7 +630,9 @@ AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME)) ...@@ -633,7 +630,9 @@ AC_SEARCH_LIBS(basename, gen, AC_DEFINE(HAVE_BASENAME))
# Solaris needs ptmx # Solaris needs ptmx
if test -z "$no_ptmx_check" ; then if test -z "$no_ptmx_check" ; then
if test x"$cross_compiling" = x"no" ; then if test x"$cross_compiling" = x"no" ; then
AC_CHECK_FILE("/dev/ptmx", AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx)) if test -e /dev/ptmx ; then
AC_DEFINE(USE_DEV_PTMX,,Use /dev/ptmx)
fi
else else
AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling]) AC_MSG_NOTICE([Not checking for /dev/ptmx, we're cross-compiling])
fi fi
...@@ -641,7 +640,9 @@ fi ...@@ -641,7 +640,9 @@ fi
if test -z "$no_ptc_check" ; then if test -z "$no_ptc_check" ; then
if test x"$cross_compiling" = x"no" ; then if test x"$cross_compiling" = x"no" ; then
AC_CHECK_FILE("/dev/ptc", AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts)) if test -e /dev/ptc ; then
AC_DEFINE(HAVE_DEV_PTS_AND_PTC,,Use /dev/ptc & /dev/pts)
fi
else else
AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling]) AC_MSG_NOTICE([Not checking for /dev/ptc & /dev/pts since we're cross-compiling])
fi fi
...@@ -681,6 +682,7 @@ AS_MKDIR_P(libtomcrypt/src/modes/ofb) ...@@ -681,6 +682,7 @@ AS_MKDIR_P(libtomcrypt/src/modes/ofb)
AS_MKDIR_P(libtomcrypt/src/modes/f8) AS_MKDIR_P(libtomcrypt/src/modes/f8)
AS_MKDIR_P(libtomcrypt/src/modes/lrw) AS_MKDIR_P(libtomcrypt/src/modes/lrw)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/bit)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/boolean)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/choice)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/ia5)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/integer)
...@@ -688,18 +690,20 @@ AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier) ...@@ -688,18 +690,20 @@ AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/object_identifier)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/octet)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/printable_string)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/sequence)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/set)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/short_integer)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime) AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utctime)
AS_MKDIR_P(libtomcrypt/src/pk/asn1/der/utf8)
AS_MKDIR_P(libtomcrypt/src/pk/dh) AS_MKDIR_P(libtomcrypt/src/pk/dh)
AS_MKDIR_P(libtomcrypt/src/pk/dsa) AS_MKDIR_P(libtomcrypt/src/pk/dsa)
AS_MKDIR_P(libtomcrypt/src/pk/ecc) AS_MKDIR_P(libtomcrypt/src/pk/ecc)
AS_MKDIR_P(libtomcrypt/src/pk/katja)
AS_MKDIR_P(libtomcrypt/src/pk/pkcs1) AS_MKDIR_P(libtomcrypt/src/pk/pkcs1)
AS_MKDIR_P(libtomcrypt/src/pk/rsa) AS_MKDIR_P(libtomcrypt/src/pk/rsa)
AS_MKDIR_P(libtomcrypt/src/prngs) AS_MKDIR_P(libtomcrypt/src/prngs)
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_OUTPUT(Makefile) AC_CONFIG_FILES(Makefile libtomcrypt/Makefile libtommath/Makefile)
AC_OUTPUT(libtomcrypt/Makefile) AC_OUTPUT
AC_OUTPUT(libtommath/Makefile)
AC_MSG_NOTICE() AC_MSG_NOTICE()
if test $BUNDLED_LIBTOM = 1 ; then if test $BUNDLED_LIBTOM = 1 ; then
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment