"Fossies" - the Fresh Open Source Software Archive

Member "nsd-4.3.6/acx_nlnetlabs.m4" (6 Apr 2021, 43673 Bytes) of package /linux/misc/dns/nsd-4.3.6.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "acx_nlnetlabs.m4": 4.3.5_vs_4.3.6.

    1 # acx_nlnetlabs.m4 - common macros for configure checks
    2 # Copyright 2009, Wouter Wijngaards, NLnet Labs.   
    3 # BSD licensed.
    4 #
    5 # Version 38
    6 # 2021-03-24 fix ACX_FUNC_DEPRECATED to use CPPFLAGS and CFLAGS.
    7 # 2021-01-05 fix defun for aclocal
    8 # 2021-01-05 autoconf 2.70 autoupdate and fixes, no AC_TRY_COMPILE
    9 # 2020-08-24 Use EVP_sha256 instead of HMAC_Update (for openssl-3.0.0).
   10 # 2016-03-21 Check -ldl -pthread for libcrypto for ldns and openssl 1.1.0.
   11 # 2016-03-21 Use HMAC_Update instead of HMAC_CTX_Init (for openssl-1.1.0).
   12 # 2016-01-04 -D_DEFAULT_SOURCE defined with -D_BSD_SOURCE for Linux glibc 2.20
   13 # 2015-12-11 FLTO check for new OSX, clang.
   14 # 2015-11-18 spelling check fix.
   15 # 2015-11-05 ACX_SSL_CHECKS no longer adds -ldl needlessly.
   16 # 2015-08-28 ACX_CHECK_PIE and ACX_CHECK_RELRO_NOW added.
   17 # 2015-03-17 AHX_CONFIG_REALLOCARRAY added
   18 # 2013-09-19 FLTO help text improved.
   19 # 2013-07-18 Enable ACX_CHECK_COMPILER_FLAG to test for -Wstrict-prototypes
   20 # 2013-06-25 FLTO has --disable-flto option.
   21 # 2013-05-03 Update W32_SLEEP for newer mingw that links but not defines it.
   22 # 2013-03-22 Fix ACX_RSRC_VERSION for long version numbers.
   23 # 2012-02-09 Fix AHX_MEMCMP_BROKEN with undef in compat/memcmp.h.
   24 # 2012-01-20 Fix COMPILER_FLAGS_UNBOUND for gcc 4.6.2 assigned-not-used-warns.
   25 # 2011-12-05 Fix getaddrinfowithincludes on windows with fedora16 mingw32-gcc.
   26 # 	     Fix ACX_MALLOC for redefined malloc error.
   27 # 	     Fix GETADDRINFO_WITH_INCLUDES to add -lws2_32
   28 # 2011-11-10 Fix FLTO test to not drop a.out in current directory.
   29 # 2011-11-01 Fix FLTO test for llvm on Lion.
   30 # 2011-08-01 Fix nonblock test (broken at v13).
   31 # 2011-08-01 Fix autoconf 2.68 warnings
   32 # 2011-06-23 Add ACX_CHECK_FLTO to check -flto.
   33 # 2010-08-16 Fix FLAG_OMITTED for AS_TR_CPP changes in autoconf-2.66.
   34 # 2010-07-02 Add check for ss_family (for minix).
   35 # 2010-04-26 Fix to use CPPFLAGS for CHECK_COMPILER_FLAGS.
   36 # 2010-03-01 Fix RPATH using CONFIG_COMMANDS to run at the very end.
   37 # 2010-02-18 WITH_SSL outputs the LIBSSL_LDFLAGS, LIBS, CPPFLAGS separate, -ldl
   38 # 2010-02-01 added ACX_CHECK_MEMCMP_SIGNED, AHX_MEMCMP_BROKEN
   39 # 2010-01-20 added AHX_COONFIG_STRLCAT
   40 # 2009-07-14 U_CHAR detection improved for windows crosscompile.
   41 #            added ACX_FUNC_MALLOC
   42 #            fixup some #if to #ifdef
   43 #            NONBLOCKING test for mingw crosscompile.
   44 # 2009-07-13 added ACX_WITH_SSL_OPTIONAL
   45 # 2009-07-03 fixup LDFLAGS for empty ssl dir.
   46 #
   47 # Automates some of the checking constructs.  Aims at portability for POSIX.
   48 # Documentation for functions is below.
   49 #
   50 # the following macro's are provided in this file:
   51 # (see below for details on each macro).
   52 #
   53 # ACX_ESCAPE_BACKSLASH		- escape backslashes in var for C-preproc.
   54 # ACX_RSRC_VERSION		- create windows resource version number.
   55 # ACX_CHECK_COMPILER_FLAG	- see if cc supports a flag.
   56 # ACX_CHECK_ERROR_FLAGS		- see which flag is -werror (used below).
   57 # ACX_CHECK_COMPILER_FLAG_NEEDED - see if flags make the code compile cleanly.
   58 # ACX_DEPFLAG			- find cc dependency flags.
   59 # ACX_DETERMINE_EXT_FLAGS_UNBOUND - find out which flags enable BSD and POSIX.
   60 # ACX_CHECK_FORMAT_ATTRIBUTE	- find cc printf format syntax.
   61 # ACX_CHECK_UNUSED_ATTRIBUTE	- find cc variable unused syntax.
   62 # ACX_CHECK_FLTO		- see if cc supports -flto and use it if so.
   63 # ACX_LIBTOOL_C_ONLY		- create libtool for C only, improved.
   64 # ACX_TYPE_U_CHAR		- u_char type.
   65 # ACX_TYPE_RLIM_T		- rlim_t type.
   66 # ACX_TYPE_SOCKLEN_T		- socklen_t type.
   67 # ACX_TYPE_IN_ADDR_T		- in_addr_t type.
   68 # ACX_TYPE_IN_PORT_T		- in_port_t type.
   69 # ACX_ARG_RPATH			- add --disable-rpath option.
   70 # ACX_WITH_SSL			- add --with-ssl option, link -lcrypto.
   71 # ACX_WITH_SSL_OPTIONAL		- add --with-ssl option, link -lcrypto,
   72 #				  where --without-ssl is also accepted
   73 # ACX_LIB_SSL			- setup to link -lssl.
   74 # ACX_SYS_LARGEFILE		- improved sys_largefile, fseeko, >2G files.
   75 # ACX_CHECK_GETADDRINFO_WITH_INCLUDES - find getaddrinfo, portably.
   76 # ACX_FUNC_DEPRECATED		- see if func is deprecated.
   77 # ACX_CHECK_NONBLOCKING_BROKEN	- see if nonblocking sockets really work.
   78 # ACX_MKDIR_ONE_ARG		- determine mkdir(2) number of arguments.
   79 # ACX_FUNC_IOCTLSOCKET		- find ioctlsocket, portably.
   80 # ACX_FUNC_MALLOC		- check malloc, define replacement .
   81 # AHX_CONFIG_FORMAT_ATTRIBUTE	- config.h text for format.
   82 # AHX_CONFIG_UNUSED_ATTRIBUTE	- config.h text for unused.
   83 # AHX_CONFIG_FSEEKO		- define fseeko, ftello fallback.
   84 # AHX_CONFIG_RAND_MAX		- define RAND_MAX if needed.
   85 # AHX_CONFIG_MAXHOSTNAMELEN	- define MAXHOSTNAMELEN if needed.
   86 # AHX_CONFIG_IPV6_MIN_MTU	- define IPV6_MIN_MTU if needed.
   87 # AHX_CONFIG_SNPRINTF		- snprintf compat prototype
   88 # AHX_CONFIG_INET_PTON		- inet_pton compat prototype
   89 # AHX_CONFIG_INET_NTOP		- inet_ntop compat prototype
   90 # AHX_CONFIG_INET_ATON		- inet_aton compat prototype
   91 # AHX_CONFIG_MEMMOVE		- memmove compat prototype
   92 # AHX_CONFIG_STRLCAT		- strlcat compat prototype
   93 # AHX_CONFIG_STRLCPY		- strlcpy compat prototype
   94 # AHX_CONFIG_GMTIME_R		- gmtime_r compat prototype
   95 # AHX_CONFIG_W32_SLEEP		- w32 compat for sleep
   96 # AHX_CONFIG_W32_USLEEP		- w32 compat for usleep
   97 # AHX_CONFIG_W32_RANDOM		- w32 compat for random
   98 # AHX_CONFIG_W32_SRANDOM	- w32 compat for srandom
   99 # AHX_CONFIG_W32_FD_SET_T	- w32 detection of FD_SET_T.
  100 # ACX_CFLAGS_STRIP		- strip one flag from CFLAGS
  101 # ACX_STRIP_EXT_FLAGS		- strip extension flags from CFLAGS
  102 # AHX_CONFIG_FLAG_OMITTED	- define omitted flag
  103 # AHX_CONFIG_FLAG_EXT		- define omitted extension flag
  104 # AHX_CONFIG_EXT_FLAGS		- define the stripped extension flags
  105 # ACX_CHECK_MEMCMP_SIGNED	- check if memcmp uses signed characters.
  106 # AHX_MEMCMP_BROKEN		- replace memcmp func for CHECK_MEMCMP_SIGNED.
  107 # ACX_CHECK_SS_FAMILY           - check for sockaddr_storage.ss_family
  108 # ACX_CHECK_PIE			- add --enable-pie option and check if works
  109 # ACX_CHECK_RELRO_NOW		- add --enable-relro-now option and check it
  110 #
  111 
  112 dnl Escape backslashes as \\, for C:\ paths, for the C preprocessor defines.
  113 dnl for example, ACX_ESCAPE_BACKSLASH($from_var, to_var)
  114 dnl $1: the text to change. 
  115 dnl $2: the result.
  116 AC_DEFUN([ACX_ESCAPE_BACKSLASH], [$2="`echo $1 | sed -e 's/\\\\/\\\\\\\\/g'`"
  117 ])
  118 
  119 dnl Calculate comma separated windows-resource numbers from package version.
  120 dnl Picks the first three(,0) or four numbers out of the name.
  121 dnl $1: variable for the result
  122 AC_DEFUN([ACX_RSRC_VERSION], 
  123 [$1=[`echo $PACKAGE_VERSION | sed -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\).*$/\1,\2,\3,\4/' -e 's/^[^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9][^0-9]*\([0-9][0-9]*\)[^0-9]*$/\1,\2,\3,0/' `]
  124 ])
  125 
  126 dnl Routine to help check for compiler flags.
  127 dnl Checks if the compiler will accept the flag.
  128 dnl $1: the flag without a - in front, so g to check -g.
  129 dnl $2: executed if yes
  130 dnl $3: executed if no
  131 AC_DEFUN([ACX_CHECK_COMPILER_FLAG], 
  132 [
  133 AC_REQUIRE([AC_PROG_CC])
  134 AC_MSG_CHECKING(whether $CC supports -$1)
  135 cache=`echo $1 | sed 'y%.=/+-%___p_%'`
  136 AC_CACHE_VAL(cv_prog_cc_flag_$cache,
  137 [
  138 echo 'void f(void){}' >conftest.c
  139 if test -z "`$CC $CPPFLAGS $CFLAGS -$1 -c conftest.c 2>&1`"; then
  140 eval "cv_prog_cc_flag_$cache=yes"
  141 else
  142 eval "cv_prog_cc_flag_$cache=no"
  143 fi
  144 rm -f conftest conftest.o conftest.c
  145 ])
  146 if eval "test \"`echo '$cv_prog_cc_flag_'$cache`\" = yes"; then
  147 AC_MSG_RESULT(yes)
  148 :
  149 $2
  150 else
  151 AC_MSG_RESULT(no)
  152 :
  153 $3
  154 fi
  155 ])
  156 
  157 dnl setup flags for ACX_CHECK_COMPILER_FLAG_NEEDED
  158 dnl ERRFLAG: result, compiler flag to turn warnings into errors
  159 AC_DEFUN([ACX_CHECK_ERROR_FLAGS],
  160 [
  161 ACX_CHECK_COMPILER_FLAG(Werror, [ERRFLAG="-Werror"], [ERRFLAG="-errwarn"])
  162 ACX_CHECK_COMPILER_FLAG(Wall, [ERRFLAG="$ERRFLAG -Wall"],
  163                         	[ERRFLAG="$ERRFLAG -errfmt"])
  164 ])
  165 
  166 dnl Routine to help check for needed compiler flags.
  167 dnl $1: flags for CC
  168 dnl $2: the includes and code
  169 dnl $3: if the given code only compiles with the flag, execute argument 3
  170 dnl $4: if the given code compiles without the flag, execute argument 4
  171 dnl $5: with and without flag the compile fails, execute argument 5.
  172 AC_DEFUN([ACX_CHECK_COMPILER_FLAG_NEEDED],
  173 [
  174 AC_REQUIRE([AC_PROG_CC])
  175 AC_REQUIRE([ACX_CHECK_ERROR_FLAGS])
  176 AC_MSG_CHECKING(whether we need $1 as a flag for $CC)
  177 cache=AS_TR_SH($1)
  178 dnl cache=`echo $1 | sed 'y%.=/+- %___p__%'`
  179 AC_CACHE_VAL(cv_prog_cc_flag_needed_$cache,
  180 [
  181 echo '$2' > conftest.c
  182 echo 'void f(){}' >>conftest.c
  183 if test -z "`$CC $CPPFLAGS $CFLAGS $ERRFLAG -c conftest.c 2>&1`"; then
  184 eval "cv_prog_cc_flag_needed_$cache=no"
  185 else
  186 [
  187 if test -z "`$CC $CPPFLAGS $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1`"; then
  188 eval "cv_prog_cc_flag_needed_$cache=yes"
  189 else
  190 eval "cv_prog_cc_flag_needed_$cache=fail"
  191 #echo 'Test with flag fails too!'
  192 #cat conftest.c
  193 #echo "$CC $CPPFLAGS $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1"
  194 #echo `$CC $CPPFLAGS $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1`
  195 #exit 1
  196 fi
  197 ]
  198 fi
  199 rm -f conftest conftest.c conftest.o
  200 ])
  201 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = yes"; then
  202 AC_MSG_RESULT(yes)
  203 :
  204 $3
  205 else
  206 if eval "test \"`echo '$cv_prog_cc_flag_needed_'$cache`\" = no"; then
  207 AC_MSG_RESULT(no)
  208 #echo 'Test with flag is no!'
  209 #cat conftest.c
  210 #echo "$CC $CPPFLAGS $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1"
  211 #echo `$CC $CPPFLAGS $CFLAGS $1 $ERRFLAG -c conftest.c 2>&1`
  212 #exit 1
  213 :
  214 $4
  215 else
  216 AC_MSG_RESULT(failed)
  217 :
  218 $5
  219 fi
  220 fi
  221 ])
  222 
  223 dnl Check for CC dependency flag
  224 dnl DEPFLAG: set to flag that generates dependencies.
  225 AC_DEFUN([ACX_DEPFLAG],
  226 [
  227 AC_MSG_CHECKING([$CC dependency flag])
  228 echo 'void f(){}' >conftest.c
  229 if test "`$CC -MM conftest.c 2>&1`" = "conftest.o: conftest.c"; then
  230 	DEPFLAG="-MM"
  231 else 
  232   if test "`$CC -xM1 conftest.c 2>&1`" = "conftest.o: conftest.c"; then
  233 	DEPFLAG="-xM1"
  234   else
  235 	DEPFLAG="-MM"  # dunno do something
  236   fi 
  237 fi
  238 AC_MSG_RESULT($DEPFLAG)
  239 rm -f conftest.c
  240 AC_SUBST(DEPFLAG)
  241 ])
  242 
  243 dnl Determine flags that gives POSIX and BSD functionality.
  244 dnl CFLAGS is modified for the result.
  245 AC_DEFUN([ACX_DETERMINE_EXT_FLAGS_UNBOUND],
  246 [
  247 ACX_CHECK_COMPILER_FLAG(std=c99, [C99FLAG="-std=c99"])
  248 ACX_CHECK_COMPILER_FLAG(xc99, [C99FLAG="-xc99"])
  249 
  250 AC_CHECK_HEADERS([getopt.h time.h],,, [AC_INCLUDES_DEFAULT])
  251 
  252 ACX_CHECK_COMPILER_FLAG_NEEDED($C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE,
  253 [
  254 #include "confdefs.h"
  255 #include <stdlib.h>
  256 #include <ctype.h>
  257 #include <sys/time.h>
  258 #ifdef HAVE_TIME_H
  259 #include <time.h>
  260 #endif
  261 #include <unistd.h>
  262 #include <netdb.h>
  263 #ifdef HAVE_GETOPT_H
  264 #include <getopt.h>
  265 #endif
  266 
  267 int test() {
  268 	int a;
  269 	char **opts = NULL;
  270 	struct timeval tv;
  271 	char *t;
  272 	time_t time = 0;
  273 	char *buf = NULL;
  274 	const char* str = NULL;
  275 	struct msghdr msg;
  276 	msg.msg_control = 0;
  277 	t = ctime_r(&time, buf);
  278 	tv.tv_usec = 10;
  279 	srandom(32);
  280 	a = getopt(2, opts, "a");
  281 	a = isascii(32);
  282 	str = gai_strerror(0);
  283 	if(str && t && tv.tv_usec && msg.msg_control)
  284 		a = 0;
  285 	return a;
  286 }
  287 ], [CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_XOPEN_SOURCE_EXTENDED=1 -D_ALL_SOURCE"])
  288 
  289 ACX_CHECK_COMPILER_FLAG_NEEDED($C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE,
  290 [
  291 #include "confdefs.h"
  292 #include <stdlib.h>
  293 #include <ctype.h>
  294 #include <sys/time.h>
  295 #ifdef HAVE_TIME_H
  296 #include <time.h>
  297 #endif
  298 #include <unistd.h>
  299 #include <netdb.h>
  300 #ifdef HAVE_GETOPT_H
  301 #include <getopt.h>
  302 #endif
  303 
  304 int test() {
  305 	int a;
  306 	char **opts = NULL;
  307 	struct timeval tv;
  308 	char *t;
  309 	time_t time = 0;
  310 	char *buf = NULL;
  311 	const char* str = NULL;
  312 	struct msghdr msg;
  313 	msg.msg_control = 0;
  314 	t = ctime_r(&time, buf);
  315 	tv.tv_usec = 10;
  316 	srandom(32);
  317 	a = getopt(2, opts, "a");
  318 	a = isascii(32);
  319 	str = gai_strerror(0);
  320 	if(str && t && tv.tv_usec && msg.msg_control)
  321 		a = 0;
  322 	return a;
  323 }
  324 ], [CFLAGS="$CFLAGS $C99FLAG -D__EXTENSIONS__ -D_BSD_SOURCE -D_DEFAULT_SOURCE -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -D_ALL_SOURCE"])
  325 
  326 ACX_CHECK_COMPILER_FLAG_NEEDED($C99FLAG,
  327 [
  328 #include <stdbool.h>
  329 #include <ctype.h>
  330 int test() {
  331         int a = 0;
  332         return a;
  333 }
  334 ], [CFLAGS="$CFLAGS $C99FLAG"])
  335 
  336 ACX_CHECK_COMPILER_FLAG_NEEDED(-D_BSD_SOURCE -D_DEFAULT_SOURCE,
  337 [
  338 #include <ctype.h>
  339 
  340 int test() {
  341         int a;
  342         a = isascii(32);
  343         return a;
  344 }
  345 ], [CFLAGS="$CFLAGS -D_BSD_SOURCE -D_DEFAULT_SOURCE"])
  346 
  347 ACX_CHECK_COMPILER_FLAG_NEEDED(-D_GNU_SOURCE,
  348 [
  349 #include <netinet/in.h>
  350 
  351 int test() {
  352         struct in6_pktinfo inf;
  353 	int a = (int)sizeof(inf);
  354         return a;
  355 }
  356 ], [CFLAGS="$CFLAGS -D_GNU_SOURCE"])
  357 
  358 # check again for GNU_SOURCE for setresgid. May fail if setresgid
  359 # is not available at all. -D_FRSRESGID is to make this check unique.
  360 # otherwise we would get the previous cached result.
  361 ACX_CHECK_COMPILER_FLAG_NEEDED(-D_GNU_SOURCE -D_FRSRESGID,
  362 [
  363 #include <unistd.h>
  364 
  365 int test() {
  366 	int a = setresgid(0,0,0);
  367 	a = setresuid(0,0,0);
  368         return a;
  369 }
  370 ], [CFLAGS="$CFLAGS -D_GNU_SOURCE"])
  371 
  372 ACX_CHECK_COMPILER_FLAG_NEEDED(-D_POSIX_C_SOURCE=200112,
  373 [
  374 #include "confdefs.h"
  375 #ifdef HAVE_TIME_H
  376 #include <time.h>
  377 #endif
  378 #include <netdb.h>
  379 
  380 int test() {
  381         int a = 0;
  382         char *t;
  383         time_t time = 0;
  384         char *buf = NULL;
  385 	const char* str = NULL;
  386         t = ctime_r(&time, buf);
  387 	str = gai_strerror(0);
  388 	if(t && str)
  389 		a = 0;
  390         return a;
  391 }
  392 ], [CFLAGS="$CFLAGS -D_POSIX_C_SOURCE=200112"])
  393 
  394 ACX_CHECK_COMPILER_FLAG_NEEDED(-D__EXTENSIONS__,
  395 [
  396 #include "confdefs.h"
  397 #include <stdlib.h>
  398 #include <ctype.h>
  399 #include <sys/time.h>
  400 #ifdef HAVE_TIME_H
  401 #include <time.h>
  402 #endif
  403 #include <unistd.h>
  404 #ifdef HAVE_GETOPT_H
  405 #include <getopt.h>
  406 #endif
  407 
  408 int test() {
  409         int a;
  410         char **opts = NULL;
  411         struct timeval tv;
  412         tv.tv_usec = 10;
  413         srandom(32);
  414         a = getopt(2, opts, "a");
  415         a = isascii(32);
  416 	if(tv.tv_usec)
  417 		a = 0;
  418         return a;
  419 }
  420 ], [CFLAGS="$CFLAGS -D__EXTENSIONS__"])
  421 
  422 ])dnl End of ACX_DETERMINE_EXT_FLAGS_UNBOUND
  423 
  424 dnl Check if CC supports -flto.
  425 dnl in a way that supports clang and suncc (that flag does something else,
  426 dnl but fails to link).  It sets it in CFLAGS if it works.
  427 AC_DEFUN([ACX_CHECK_FLTO], [
  428     AC_ARG_ENABLE([flto], AS_HELP_STRING([--disable-flto], [Disable link-time optimization (gcc specific option)]))
  429     AS_IF([test "x$enable_flto" != "xno"], [
  430         AC_MSG_CHECKING([if $CC supports -flto])
  431         BAKCFLAGS="$CFLAGS"
  432         CFLAGS="$CFLAGS -flto"
  433         AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
  434             if $CC $CFLAGS -o conftest conftest.c 2>&1 | $GREP -e "warning: no debug symbols in executable" -e "warning: object" >/dev/null; then
  435                 CFLAGS="$BAKCFLAGS"
  436                 AC_MSG_RESULT(no)
  437             else
  438                 AC_MSG_RESULT(yes)
  439             fi
  440             rm -f conftest conftest.c conftest.o
  441         ], [CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
  442     ])
  443 ])
  444 
  445 dnl Check the printf-format attribute (if any)
  446 dnl result in HAVE_ATTR_FORMAT.  
  447 dnl Make sure you also include the AHX_CONFIG_FORMAT_ATTRIBUTE.
  448 AC_DEFUN([ACX_CHECK_FORMAT_ATTRIBUTE],
  449 [AC_REQUIRE([AC_PROG_CC])
  450 AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "format" attribute)
  451 AC_CACHE_VAL(ac_cv_c_format_attribute,
  452 [ac_cv_c_format_attribute=no
  453 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
  454 void f (char *format, ...) __attribute__ ((format (printf, 1, 2)));
  455 void (*pf) (char *format, ...) __attribute__ ((format (printf, 1, 2)));
  456 ]], [[
  457    f ("%s", "str");
  458 ]])],[ac_cv_c_format_attribute="yes"],[ac_cv_c_format_attribute="no"])
  459 ])
  460 
  461 AC_MSG_RESULT($ac_cv_c_format_attribute)
  462 if test $ac_cv_c_format_attribute = yes; then
  463   AC_DEFINE(HAVE_ATTR_FORMAT, 1, [Whether the C compiler accepts the "format" attribute])
  464 fi
  465 ])dnl End of ACX_CHECK_FORMAT_ATTRIBUTE
  466 
  467 dnl Setup ATTR_FORMAT config.h parts.
  468 dnl make sure you call ACX_CHECK_FORMAT_ATTRIBUTE also.
  469 AC_DEFUN([AHX_CONFIG_FORMAT_ATTRIBUTE],
  470 [ 
  471 #ifdef HAVE_ATTR_FORMAT
  472 #  define ATTR_FORMAT(archetype, string_index, first_to_check) \
  473     __attribute__ ((format (archetype, string_index, first_to_check)))
  474 #else /* !HAVE_ATTR_FORMAT */
  475 #  define ATTR_FORMAT(archetype, string_index, first_to_check) /* empty */
  476 #endif /* !HAVE_ATTR_FORMAT */
  477 ])
  478 
  479 dnl Check how to mark function arguments as unused.
  480 dnl result in HAVE_ATTR_UNUSED.  
  481 dnl Make sure you include AHX_CONFIG_UNUSED_ATTRIBUTE also.
  482 AC_DEFUN([ACX_CHECK_UNUSED_ATTRIBUTE],
  483 [AC_REQUIRE([AC_PROG_CC])
  484 AC_MSG_CHECKING(whether the C compiler (${CC-cc}) accepts the "unused" attribute)
  485 AC_CACHE_VAL(ac_cv_c_unused_attribute,
  486 [ac_cv_c_unused_attribute=no
  487 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>
  488 void f (char *u __attribute__((unused)));
  489 ]], [[
  490    f ("x");
  491 ]])],[ac_cv_c_unused_attribute="yes"],[ac_cv_c_unused_attribute="no"])
  492 ])
  493 
  494 dnl Setup ATTR_UNUSED config.h parts.
  495 dnl make sure you call ACX_CHECK_UNUSED_ATTRIBUTE also.
  496 AC_DEFUN([AHX_CONFIG_UNUSED_ATTRIBUTE],
  497 [
  498 #if defined(DOXYGEN)
  499 #  define ATTR_UNUSED(x)  x
  500 #elif defined(__cplusplus)
  501 #  define ATTR_UNUSED(x)
  502 #elif defined(HAVE_ATTR_UNUSED)
  503 #  define ATTR_UNUSED(x)  x __attribute__((unused))
  504 #else /* !HAVE_ATTR_UNUSED */
  505 #  define ATTR_UNUSED(x)  x
  506 #endif /* !HAVE_ATTR_UNUSED */
  507 ])
  508 
  509 AC_MSG_RESULT($ac_cv_c_unused_attribute)
  510 if test $ac_cv_c_unused_attribute = yes; then
  511   AC_DEFINE(HAVE_ATTR_UNUSED, 1, [Whether the C compiler accepts the "unused" attribute])
  512 fi
  513 ])dnl
  514 
  515 dnl Pre-fun for ACX_LIBTOOL_C_ONLY
  516 AC_DEFUN([ACX_LIBTOOL_C_PRE], [
  517 # skip these tests, we do not need them.
  518 AC_DEFUN([AC_PROG_F77], [:])
  519 AC_DEFUN([AC_PROG_FC], [:])
  520 AC_DEFUN([AC_PROG_CXX], [:])
  521 AC_DEFUN([AC_PROG_CXXCPP], [:])
  522 AC_DEFUN([AC_PROG_OBJC], [:])
  523 AC_DEFUN([AC_PROG_OBJCCPP], [:])
  524 AC_DEFUN([AC_LIBTOOL_CXX], [:])
  525 AC_DEFUN([AC_LIBTOOL_F77], [:])
  526 # always use ./libtool unless override from commandline (libtool=mylibtool)
  527 if test -z "$libtool"; then
  528 	libtool="./libtool"
  529 fi
  530 AC_SUBST(libtool)
  531 # avoid libtool max commandline length test on systems that fork slowly.
  532 AC_CANONICAL_HOST
  533 if echo "$host_os" | grep "sunos4" >/dev/null; then
  534 	lt_cv_sys_max_cmd_len=32750;
  535 fi
  536 AC_PATH_TOOL(AR, ar, [false])
  537 if test $AR = false; then
  538 	AC_MSG_ERROR([Cannot find 'ar', please extend PATH to include it])
  539 fi
  540 ])
  541 
  542 dnl Perform libtool check, portably, only for C
  543 AC_DEFUN([ACX_LIBTOOL_C_ONLY], [
  544 dnl as a requirement so that is gets called before LIBTOOL
  545 dnl because libtools 'AC_REQUIRE' names are right after this one, before
  546 dnl this function contents.
  547 AC_REQUIRE([ACX_LIBTOOL_C_PRE])
  548 LT_INIT
  549 ])
  550 
  551 dnl Detect if u_char type is defined, otherwise define it.
  552 AC_DEFUN([ACX_TYPE_U_CHAR], 
  553 [AC_CHECK_TYPE([u_char], ,
  554 	[AC_DEFINE([u_char], [unsigned char], [Define to 'unsigned char if not defined])], [
  555 AC_INCLUDES_DEFAULT
  556 #ifdef HAVE_WINSOCK2_H
  557 #  include <winsock2.h>
  558 #endif
  559 ]) ])
  560 
  561 dnl Detect if rlim_t type is defined, otherwise define it.
  562 AC_DEFUN([ACX_TYPE_RLIM_T],
  563 [AC_CHECK_TYPE(rlim_t, , 
  564 	[AC_DEFINE([rlim_t], [unsigned long], [Define to 'int' if not defined])], [
  565 AC_INCLUDES_DEFAULT
  566 #ifdef HAVE_SYS_RESOURCE_H
  567 #  include <sys/resource.h>
  568 #endif
  569 ]) ])
  570 
  571 dnl Detect if socklen_t type is defined, otherwise define it.
  572 AC_DEFUN([ACX_TYPE_SOCKLEN_T],
  573 [
  574 AC_CHECK_TYPE(socklen_t, , 
  575 	[AC_DEFINE([socklen_t], [int], [Define to 'int' if not defined])], [
  576 AC_INCLUDES_DEFAULT
  577 #ifdef HAVE_SYS_SOCKET_H
  578 #  include <sys/socket.h>
  579 #endif
  580 #ifdef HAVE_WS2TCPIP_H
  581 #  include <ws2tcpip.h>
  582 #endif
  583 ]) ])
  584 
  585 dnl Detect if in_addr_t type is defined, otherwise define it.
  586 AC_DEFUN([ACX_TYPE_IN_ADDR_T],
  587 [ AC_CHECK_TYPE(in_addr_t, [], [AC_DEFINE([in_addr_t], [uint32_t], [in_addr_t])], [
  588 AC_INCLUDES_DEFAULT
  589 #ifdef HAVE_SYS_TYPES_H
  590 # include <sys/types.h>
  591 #endif
  592 #ifdef HAVE_NETINET_IN_H
  593 # include <netinet/in.h>
  594 #endif
  595 ]) ])
  596 
  597 dnl Detect if in_port_t type is defined, otherwise define it.
  598 AC_DEFUN([ACX_TYPE_IN_PORT_T],
  599 [ AC_CHECK_TYPE(in_port_t, [], [AC_DEFINE([in_port_t], [uint16_t], [in_port_t])], [
  600 AC_INCLUDES_DEFAULT
  601 #ifdef HAVE_SYS_TYPES_H
  602 # include <sys/types.h>
  603 #endif
  604 #ifdef HAVE_NETINET_IN_H
  605 # include <netinet/in.h>
  606 #endif
  607 ]) ])
  608 
  609 dnl Add option to disable the evil rpath. Check whether to use rpath or not.
  610 dnl Adds the --disable-rpath option. Uses trick to edit the ./libtool.
  611 AC_DEFUN([ACX_ARG_RPATH],
  612 [
  613 AC_ARG_ENABLE(rpath,
  614         [  --disable-rpath         disable hardcoded rpath (default=enabled)],
  615 	enable_rpath=$enableval, enable_rpath=yes)
  616 if test "x$enable_rpath" = xno; then
  617 	dnl AC_MSG_RESULT([Fixing libtool for -rpath problems.])
  618 	AC_CONFIG_COMMANDS([disable-rpath], [
  619 	sed < libtool > libtool-2 \
  620 	's/^hardcode_libdir_flag_spec.*$'/'hardcode_libdir_flag_spec=" -D__LIBTOOL_RPATH_SED__ "/'
  621 	mv libtool-2 libtool
  622 	chmod 755 libtool
  623 	libtool="./libtool"
  624 	])
  625 fi
  626 ])
  627 
  628 dnl Add a -R to the RUNTIME_PATH.  Only if rpath is enabled and it is
  629 dnl an absolute path.
  630 dnl $1: the pathname to add.
  631 AC_DEFUN([ACX_RUNTIME_PATH_ADD], [
  632 	if test "x$enable_rpath" = xyes; then
  633 		if echo "$1" | grep "^/" >/dev/null; then
  634 			RUNTIME_PATH="$RUNTIME_PATH -R$1"
  635 		fi
  636 	fi
  637 ])
  638 
  639 dnl Common code for both ACX_WITH_SSL and ACX_WITH_SSL_OPTIONAL
  640 dnl Takes one argument; the withval checked in those 2 functions
  641 dnl sets up the environment for the given openssl path
  642 AC_DEFUN([ACX_SSL_CHECKS], [
  643     withval=$1
  644     if test x_$withval != x_no; then
  645         AC_MSG_CHECKING(for SSL)
  646         if test x_$withval = x_ -o x_$withval = x_yes; then
  647             withval="/usr/local/ssl /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr"
  648         fi
  649         for dir in $withval; do
  650             ssldir="$dir"
  651             if test -f "$dir/include/openssl/ssl.h"; then
  652                 found_ssl="yes"
  653                 AC_DEFINE_UNQUOTED([HAVE_SSL], [], [Define if you have the SSL libraries installed.])
  654                 dnl assume /usr/include is already in the include-path.
  655                 if test "$ssldir" != "/usr"; then
  656                         CPPFLAGS="$CPPFLAGS -I$ssldir/include"
  657                         LIBSSL_CPPFLAGS="$LIBSSL_CPPFLAGS -I$ssldir/include"
  658                 fi
  659                 break;
  660             fi
  661         done
  662         if test x_$found_ssl != x_yes; then
  663             AC_MSG_ERROR(Cannot find the SSL libraries in $withval)
  664         else
  665             AC_MSG_RESULT(found in $ssldir)
  666             HAVE_SSL=yes
  667             dnl assume /usr is already in the lib and dynlib paths.
  668             if test "$ssldir" != "/usr" -a "$ssldir" != ""; then
  669                 LDFLAGS="$LDFLAGS -L$ssldir/lib"
  670                 LIBSSL_LDFLAGS="$LIBSSL_LDFLAGS -L$ssldir/lib"
  671                 ACX_RUNTIME_PATH_ADD([$ssldir/lib])
  672             fi
  673         
  674             AC_MSG_CHECKING([for EVP_sha256 in -lcrypto])
  675             LIBS="$LIBS -lcrypto"
  676             LIBSSL_LIBS="$LIBSSL_LIBS -lcrypto"
  677             AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  678                 int EVP_sha256(void);
  679                 (void)EVP_sha256();
  680               ]])],[
  681                 AC_MSG_RESULT(yes)
  682                 AC_DEFINE([HAVE_EVP_SHA256], 1,
  683                           [If you have EVP_sha256])
  684               ],[
  685                 AC_MSG_RESULT(no)
  686                 # check if -lwsock32 or -lgdi32 are needed.	
  687                 BAKLIBS="$LIBS"
  688                 BAKSSLLIBS="$LIBSSL_LIBS"
  689 		LIBS="$LIBS -lgdi32 -lws2_32"
  690 		LIBSSL_LIBS="$LIBSSL_LIBS -lgdi32 -lws2_32"
  691                 AC_MSG_CHECKING([if -lcrypto needs -lgdi32])
  692                 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  693                     int EVP_sha256(void);
  694                     (void)EVP_sha256();
  695                   ]])],[
  696                     AC_DEFINE([HAVE_EVP_SHA256], 1,
  697                         [If you have EVP_sha256])
  698                     AC_MSG_RESULT(yes) 
  699                   ],[
  700                     AC_MSG_RESULT(no)
  701                     LIBS="$BAKLIBS"
  702                     LIBSSL_LIBS="$BAKSSLLIBS"
  703                     LIBS="$LIBS -ldl"
  704                     LIBSSL_LIBS="$LIBSSL_LIBS -ldl"
  705                     AC_MSG_CHECKING([if -lcrypto needs -ldl])
  706                     AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  707                         int EVP_sha256(void);
  708                         (void)EVP_sha256();
  709                       ]])],[
  710                         AC_DEFINE([HAVE_EVP_SHA256], 1,
  711                             [If you have EVP_sha256])
  712                         AC_MSG_RESULT(yes) 
  713                       ],[
  714                         AC_MSG_RESULT(no)
  715                         LIBS="$BAKLIBS"
  716                         LIBSSL_LIBS="$BAKSSLLIBS"
  717                         LIBS="$LIBS -ldl -pthread"
  718                         LIBSSL_LIBS="$LIBSSL_LIBS -ldl -pthread"
  719                         AC_MSG_CHECKING([if -lcrypto needs -ldl -pthread])
  720                         AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[
  721                             int EVP_sha256(void);
  722                             (void)EVP_sha256();
  723                           ]])],[
  724                             AC_DEFINE([HAVE_EVP_SHA256], 1,
  725                                 [If you have EVP_sha256])
  726                             AC_MSG_RESULT(yes) 
  727                           ],[
  728                             AC_MSG_RESULT(no)
  729                             AC_MSG_ERROR([OpenSSL found in $ssldir, but version 0.9.7 or higher is required])
  730 			])
  731                     ])
  732                 ])
  733             ])
  734         fi
  735         AC_SUBST(HAVE_SSL)
  736         AC_SUBST(RUNTIME_PATH)
  737     fi
  738 AC_CHECK_HEADERS([openssl/ssl.h],,, [AC_INCLUDES_DEFAULT])
  739 AC_CHECK_HEADERS([openssl/err.h],,, [AC_INCLUDES_DEFAULT])
  740 AC_CHECK_HEADERS([openssl/rand.h],,, [AC_INCLUDES_DEFAULT])
  741 ])dnl End of ACX_SSL_CHECKS
  742 
  743 dnl Check for SSL, where SSL is mandatory
  744 dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
  745 dnl Setup of CPPFLAGS, CFLAGS.  Adds -lcrypto to LIBS. 
  746 dnl Checks main header files of SSL.
  747 dnl
  748 AC_DEFUN([ACX_WITH_SSL],
  749 [
  750 AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl=pathname],[enable SSL (will check /usr/local/ssl
  751                             /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
  752         ],[
  753             withval="yes"
  754         ])
  755     if test x_$withval = x_no; then
  756 	AC_MSG_ERROR([Need SSL library to do digital signature cryptography])
  757     fi
  758     ACX_SSL_CHECKS($withval)
  759 ])dnl End of ACX_WITH_SSL
  760 
  761 dnl Check for SSL, where ssl is optional (--without-ssl is allowed)
  762 dnl Adds --with-ssl option, searches for openssl and defines HAVE_SSL if found
  763 dnl Setup of CPPFLAGS, CFLAGS.  Adds -lcrypto to LIBS. 
  764 dnl Checks main header files of SSL.
  765 dnl
  766 AC_DEFUN([ACX_WITH_SSL_OPTIONAL],
  767 [
  768 AC_ARG_WITH(ssl, AS_HELP_STRING([--with-ssl=pathname],[enable SSL (will check /usr/local/ssl
  769                                 /usr/lib/ssl /usr/ssl /usr/pkg /usr/local /opt/local /usr/sfw /usr)]),[
  770         ],[
  771             withval="yes"
  772         ])
  773     ACX_SSL_CHECKS($withval)
  774 ])dnl End of ACX_WITH_SSL_OPTIONAL
  775 
  776 dnl Setup to use -lssl
  777 dnl To use -lcrypto, use the ACX_WITH_SSL setup (before this one).
  778 AC_DEFUN([ACX_LIB_SSL],
  779 [
  780 # check if libssl needs libdl
  781 BAKLIBS="$LIBS"
  782 LIBS="-lssl $LIBS"
  783 AC_MSG_CHECKING([if libssl needs libdl])
  784 AC_TRY_LINK_FUNC([SSL_CTX_new], [
  785 	AC_MSG_RESULT([no])
  786 	LIBS="$BAKLIBS"
  787 ] , [
  788 	AC_MSG_RESULT([yes])
  789 	LIBS="$BAKLIBS"
  790 	AC_SEARCH_LIBS([dlopen], [dl])
  791 ]) ])dnl End of ACX_LIB_SSL
  792 
  793 dnl Setup to use very large files (>2Gb).
  794 dnl setups fseeko and its own
  795 AC_DEFUN([ACX_SYS_LARGEFILE],
  796 [
  797 AC_SYS_LARGEFILE
  798 dnl try to see if an additional _LARGEFILE_SOURCE 1 is needed to get fseeko
  799 ACX_CHECK_COMPILER_FLAG_NEEDED(-D_LARGEFILE_SOURCE=1,
  800 [
  801 #include <stdio.h>
  802 int test() {
  803         int a = fseeko(stdin, 0, 0);
  804         return a;
  805 }
  806 ], [CFLAGS="$CFLAGS -D_LARGEFILE_SOURCE=1"])
  807 ])
  808 
  809 dnl Check getaddrinfo.
  810 dnl Works on linux, solaris, bsd and windows(links winsock).
  811 dnl defines HAVE_GETADDRINFO, USE_WINSOCK.
  812 AC_DEFUN([ACX_CHECK_GETADDRINFO_WITH_INCLUDES],
  813 [AC_REQUIRE([AC_PROG_CC])
  814 AC_MSG_CHECKING(for getaddrinfo)
  815 ac_cv_func_getaddrinfo=no
  816 AC_LINK_IFELSE(
  817 [AC_LANG_SOURCE([[
  818 #ifdef __cplusplus
  819 extern "C"
  820 {
  821 #endif
  822 char* getaddrinfo();
  823 char* (*f) () = getaddrinfo;
  824 #ifdef __cplusplus
  825 }
  826 #endif
  827 int main() {
  828         ;
  829         return 0;
  830 }
  831 ]])],
  832 dnl this case on linux, solaris, bsd
  833 [ac_cv_func_getaddrinfo="yes"
  834 dnl see if on windows
  835 if test "$ac_cv_header_windows_h" = "yes"; then
  836 	AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used])
  837 	USE_WINSOCK="1"
  838 	if echo $LIBS | grep 'lws2_32' >/dev/null; then
  839 		:
  840 	else
  841 		LIBS="$LIBS -lws2_32"
  842 	fi
  843 fi
  844 ],
  845 dnl no quick getaddrinfo, try mingw32 and winsock2 library.
  846 ORIGLIBS="$LIBS"
  847 LIBS="$LIBS -lws2_32"
  848 AC_LINK_IFELSE(
  849 [AC_LANG_PROGRAM(
  850 [
  851 #ifdef HAVE_WS2TCPIP_H
  852 #include <ws2tcpip.h>
  853 #endif
  854 ],
  855 [
  856         (void)getaddrinfo(NULL, NULL, NULL, NULL);
  857 ]
  858 )],
  859 [
  860 ac_cv_func_getaddrinfo="yes"
  861 dnl already: LIBS="$LIBS -lws2_32"
  862 AC_DEFINE(USE_WINSOCK, 1, [Whether the windows socket API is used])
  863 USE_WINSOCK="1"
  864 ],
  865 [
  866 ac_cv_func_getaddrinfo="no"
  867 LIBS="$ORIGLIBS"
  868 ])
  869 )
  870 
  871 AC_MSG_RESULT($ac_cv_func_getaddrinfo)
  872 if test $ac_cv_func_getaddrinfo = yes; then
  873   AC_DEFINE(HAVE_GETADDRINFO, 1, [Whether getaddrinfo is available])
  874 fi
  875 ])dnl Endof AC_CHECK_GETADDRINFO_WITH_INCLUDES
  876 
  877 dnl check if a function is deprecated. defines DEPRECATED_func in config.h.
  878 dnl $1: function name
  879 dnl $2: C-statement that calls the function.
  880 dnl $3: includes for the program.
  881 dnl $4: executes if yes
  882 dnl $5: executes if no
  883 AC_DEFUN([ACX_FUNC_DEPRECATED],
  884 [
  885 AC_REQUIRE([AC_PROG_CC])
  886 AC_MSG_CHECKING(if $1 is deprecated)
  887 cache=`echo $1 | sed 'y%.=/+-%___p_%'`
  888 AC_CACHE_VAL(cv_cc_deprecated_$cache,
  889 [
  890 echo '$3' >conftest.c
  891 echo 'void f(){ $2 }' >>conftest.c
  892 if test -z "`$CC $CPPFLAGS $CFLAGS -c conftest.c 2>&1 | grep -e deprecated -e unavailable`"; then
  893 eval "cv_cc_deprecated_$cache=no"
  894 else
  895 eval "cv_cc_deprecated_$cache=yes"
  896 fi
  897 rm -f conftest conftest.o conftest.c
  898 ])
  899 if eval "test \"`echo '$cv_cc_deprecated_'$cache`\" = yes"; then
  900 AC_MSG_RESULT(yes)
  901 AC_DEFINE_UNQUOTED(AS_TR_CPP([DEPRECATED_$1]), 1, [Whether $1 is deprecated])
  902 :
  903 $4
  904 else
  905 AC_MSG_RESULT(no)
  906 :
  907 $5
  908 fi
  909 ])dnl end of ACX_FUNC_DEPRECATED
  910 
  911 dnl check if select and nonblocking sockets actually work.
  912 dnl Needs fork(2) and select(2).
  913 dnl defines NONBLOCKING_IS_BROKEN, and if that is true multiple reads from
  914 dnl a nonblocking socket do not work, a new call to select is necessary.
  915 AC_DEFUN([ACX_CHECK_NONBLOCKING_BROKEN],
  916 [
  917 AC_MSG_CHECKING([if nonblocking sockets work])
  918 if echo $target | grep mingw32 >/dev/null; then 
  919 	AC_MSG_RESULT([no (windows)])
  920 	AC_DEFINE([NONBLOCKING_IS_BROKEN], 1, [Define if the network stack does not fully support nonblocking io (causes lower performance).])
  921 else
  922 AC_RUN_IFELSE([
  923 AC_LANG_SOURCE([[
  924 #include <stdio.h>
  925 #include <string.h>
  926 #include <stdlib.h>
  927 #include <fcntl.h>
  928 #include <errno.h>
  929 #ifdef HAVE_SYS_TYPES_H
  930 #include <sys/types.h>
  931 #endif
  932 #ifdef HAVE_SYS_SOCKET_H
  933 #include <sys/socket.h>
  934 #endif
  935 #ifdef HAVE_NETINET_IN_H
  936 #include <netinet/in.h>
  937 #endif
  938 #ifdef HAVE_ARPA_INET_H
  939 #include <arpa/inet.h>
  940 #endif
  941 #ifdef HAVE_UNISTD_H
  942 #include <unistd.h>
  943 #endif
  944 #ifdef HAVE_TIME_H
  945 #include <time.h>
  946 #endif
  947 
  948 int main(void)
  949 {
  950 	int port;
  951 	int sfd, cfd;
  952 	int num = 10;
  953 	int i, p;
  954 	struct sockaddr_in a;
  955 	/* test if select and nonblocking reads work well together */
  956 	/* open port.
  957 	   fork child to send 10 messages.
  958 	   select to read.
  959 	   then try to nonblocking read the 10 messages
  960 	   then, nonblocking read must give EAGAIN
  961 	*/
  962 
  963 	port = 12345 + (time(0)%32);
  964 	sfd = socket(PF_INET, SOCK_DGRAM, 0);
  965 	if(sfd == -1) {
  966 		perror("socket");
  967 		return 1;
  968 	}
  969 	memset(&a, 0, sizeof(a));
  970 	a.sin_family = AF_INET;
  971 	a.sin_port = htons(port);
  972 	a.sin_addr.s_addr = inet_addr("127.0.0.1");
  973 	if(bind(sfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
  974 		perror("bind");
  975 		return 1;
  976 	}
  977 	if(fcntl(sfd, F_SETFL, O_NONBLOCK) == -1) {
  978 		perror("fcntl");
  979 		return 1;
  980 	}
  981 
  982 	cfd = socket(PF_INET, SOCK_DGRAM, 0);
  983 	if(cfd == -1) {
  984 		perror("client socket");
  985 		return 1;
  986 	}
  987 	a.sin_port = 0;
  988 	if(bind(cfd, (struct sockaddr*)&a, sizeof(a)) < 0) {
  989 		perror("client bind");
  990 		return 1;
  991 	}
  992 	a.sin_port = htons(port);
  993 
  994 	/* no handler, causes exit in 10 seconds */
  995 	alarm(10);
  996 
  997 	/* send and receive on the socket */
  998 	if((p=fork()) == 0) {
  999 		for(i=0; i<num; i++) {
 1000 			if(sendto(cfd, &i, sizeof(i), 0, 
 1001 				(struct sockaddr*)&a, sizeof(a)) < 0) {
 1002 				perror("sendto");
 1003 				return 1;
 1004 			}
 1005 		}
 1006 	} else {
 1007 		/* parent */
 1008 		fd_set rset;
 1009 		int x;
 1010 		if(p == -1) {
 1011 			perror("fork");
 1012 			return 1;
 1013 		}
 1014 		FD_ZERO(&rset);
 1015 		FD_SET(sfd, &rset);
 1016 		if(select(sfd+1, &rset, NULL, NULL, NULL) < 1) {
 1017 			perror("select");
 1018 			return 1;
 1019 		}
 1020 		i = 0;
 1021 		while(i < num) {
 1022 			if(recv(sfd, &x, sizeof(x), 0) != sizeof(x)) {
 1023 				if(errno == EAGAIN)
 1024 					continue;
 1025 				perror("recv");
 1026 				return 1;
 1027 			}
 1028 			i++;
 1029 		}
 1030 		/* now we want to get EAGAIN: nonblocking goodness */
 1031 		errno = 0;
 1032 		recv(sfd, &x, sizeof(x), 0);
 1033 		if(errno != EAGAIN) {
 1034 			perror("trying to recv again");
 1035 			return 1;
 1036 		}
 1037 		/* EAGAIN encountered */
 1038 	}
 1039 
 1040 	close(sfd);
 1041 	close(cfd);
 1042 	return 0;
 1043 }
 1044 ]])], [
 1045 	AC_MSG_RESULT([yes])
 1046 ], [
 1047 	AC_MSG_RESULT([no])
 1048 	AC_DEFINE([NONBLOCKING_IS_BROKEN], 1, [Define if the network stack does not fully support nonblocking io (causes lower performance).])
 1049 ], [
 1050 	AC_MSG_RESULT([crosscompile(yes)])
 1051 ])
 1052 fi
 1053 ])dnl End of ACX_CHECK_NONBLOCKING_BROKEN
 1054 
 1055 dnl Check if mkdir has one or two arguments.
 1056 dnl defines MKDIR_HAS_ONE_ARG
 1057 AC_DEFUN([ACX_MKDIR_ONE_ARG],
 1058 [
 1059 AC_MSG_CHECKING([whether mkdir has one arg])
 1060 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 1061 #include <stdio.h>
 1062 #include <unistd.h>
 1063 #ifdef HAVE_WINSOCK2_H
 1064 #include <winsock2.h>
 1065 #endif
 1066 #ifdef HAVE_SYS_STAT_H
 1067 #include <sys/stat.h>
 1068 #endif
 1069 ]], [[
 1070 	(void)mkdir("directory");
 1071 ]])],[AC_MSG_RESULT(yes)
 1072 AC_DEFINE(MKDIR_HAS_ONE_ARG, 1, [Define if mkdir has one argument.])
 1073 ],[AC_MSG_RESULT(no)
 1074 ])
 1075 ])dnl end of ACX_MKDIR_ONE_ARG
 1076 
 1077 dnl Check for ioctlsocket function. works on mingw32 too.
 1078 AC_DEFUN([ACX_FUNC_IOCTLSOCKET],
 1079 [
 1080 # check ioctlsocket
 1081 AC_MSG_CHECKING(for ioctlsocket)
 1082 AC_LINK_IFELSE([AC_LANG_PROGRAM([
 1083 #ifdef HAVE_WINSOCK2_H
 1084 #include <winsock2.h>
 1085 #endif
 1086 ], [
 1087 	(void)ioctlsocket(0, 0, NULL);
 1088 ])], [
 1089 AC_MSG_RESULT(yes)
 1090 AC_DEFINE(HAVE_IOCTLSOCKET, 1, [if the function 'ioctlsocket' is available])
 1091 ],[AC_MSG_RESULT(no)])
 1092 ])dnl end of ACX_FUNC_IOCTLSOCKET
 1093 
 1094 dnl detect malloc and provide malloc compat prototype.
 1095 dnl $1: unique name for compat code
 1096 AC_DEFUN([ACX_FUNC_MALLOC],
 1097 [
 1098 	AC_MSG_CHECKING([for GNU libc compatible malloc])
 1099 	AC_RUN_IFELSE([AC_LANG_PROGRAM(
 1100 [[#if defined STDC_HEADERS || defined HAVE_STDLIB_H
 1101 #include <stdlib.h>
 1102 #else
 1103 char *malloc ();
 1104 #endif
 1105 ]], [ if(malloc(0) != 0) return 1;])
 1106 ],
 1107 	[AC_MSG_RESULT([no])
 1108 	AC_LIBOBJ(malloc)
 1109 	AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if  replacement function should be used.])] ,
 1110 	[AC_MSG_RESULT([yes])
 1111 	AC_DEFINE([HAVE_MALLOC], 1, [If have GNU libc compatible malloc])],
 1112 	[AC_MSG_RESULT([no (crosscompile)])
 1113 	AC_LIBOBJ(malloc)
 1114 	AC_DEFINE_UNQUOTED([malloc], [rpl_malloc_$1], [Define if  replacement function should be used.])] )
 1115 ])
 1116 
 1117 dnl Define fallback for fseeko and ftello if needed.
 1118 AC_DEFUN([AHX_CONFIG_FSEEKO],
 1119 [
 1120 #ifndef HAVE_FSEEKO
 1121 #define fseeko fseek
 1122 #define ftello ftell
 1123 #endif /* HAVE_FSEEKO */
 1124 ])
 1125 
 1126 dnl Define RAND_MAX if not defined
 1127 AC_DEFUN([AHX_CONFIG_RAND_MAX],
 1128 [
 1129 #ifndef RAND_MAX
 1130 #define RAND_MAX	2147483647
 1131 #endif
 1132 ])
 1133 
 1134 dnl Define MAXHOSTNAMELEN if not defined
 1135 AC_DEFUN([AHX_CONFIG_MAXHOSTNAMELEN],
 1136 [
 1137 #ifndef MAXHOSTNAMELEN
 1138 #define MAXHOSTNAMELEN 256
 1139 #endif
 1140 ])
 1141 
 1142 dnl Define IPV6_MIN_MTU if not defined
 1143 AC_DEFUN([AHX_CONFIG_IPV6_MIN_MTU],
 1144 [
 1145 #ifndef IPV6_MIN_MTU
 1146 #define IPV6_MIN_MTU 1280
 1147 #endif /* IPV6_MIN_MTU */
 1148 ])
 1149 
 1150 dnl provide snprintf, vsnprintf compat prototype
 1151 dnl $1: unique name for compat code
 1152 AC_DEFUN([AHX_CONFIG_SNPRINTF],
 1153 [
 1154 #ifndef HAVE_SNPRINTF
 1155 #define snprintf snprintf_$1
 1156 #define vsnprintf vsnprintf_$1
 1157 #include <stdarg.h>
 1158 int snprintf (char *str, size_t count, const char *fmt, ...);
 1159 int vsnprintf (char *str, size_t count, const char *fmt, va_list arg);
 1160 #endif /* HAVE_SNPRINTF */
 1161 ])
 1162 
 1163 dnl provide inet_pton compat prototype.
 1164 dnl $1: unique name for compat code
 1165 AC_DEFUN([AHX_CONFIG_INET_PTON],
 1166 [
 1167 #ifndef HAVE_INET_PTON
 1168 #define inet_pton inet_pton_$1
 1169 int inet_pton(int af, const char* src, void* dst);
 1170 #endif /* HAVE_INET_PTON */
 1171 ])
 1172 
 1173 dnl provide inet_ntop compat prototype.
 1174 dnl $1: unique name for compat code
 1175 AC_DEFUN([AHX_CONFIG_INET_NTOP],
 1176 [
 1177 #ifndef HAVE_INET_NTOP
 1178 #define inet_ntop inet_ntop_$1
 1179 const char *inet_ntop(int af, const void *src, char *dst, size_t size);
 1180 #endif
 1181 ])
 1182 
 1183 dnl provide inet_aton compat prototype.
 1184 dnl $1: unique name for compat code
 1185 AC_DEFUN([AHX_CONFIG_INET_ATON],
 1186 [
 1187 #ifndef HAVE_INET_ATON
 1188 #define inet_aton inet_aton_$1
 1189 int inet_aton(const char *cp, struct in_addr *addr);
 1190 #endif
 1191 ])
 1192 
 1193 dnl provide memmove compat prototype.
 1194 dnl $1: unique name for compat code
 1195 AC_DEFUN([AHX_CONFIG_MEMMOVE],
 1196 [
 1197 #ifndef HAVE_MEMMOVE
 1198 #define memmove memmove_$1
 1199 void *memmove(void *dest, const void *src, size_t n);
 1200 #endif
 1201 ])
 1202 
 1203 dnl provide strlcat compat prototype.
 1204 dnl $1: unique name for compat code
 1205 AC_DEFUN([AHX_CONFIG_STRLCAT],
 1206 [
 1207 #ifndef HAVE_STRLCAT
 1208 #define strlcat strlcat_$1
 1209 size_t strlcat(char *dst, const char *src, size_t siz);
 1210 #endif
 1211 ])
 1212 
 1213 dnl provide strlcpy compat prototype.
 1214 dnl $1: unique name for compat code
 1215 AC_DEFUN([AHX_CONFIG_STRLCPY],
 1216 [
 1217 #ifndef HAVE_STRLCPY
 1218 #define strlcpy strlcpy_$1
 1219 size_t strlcpy(char *dst, const char *src, size_t siz);
 1220 #endif
 1221 ])
 1222 
 1223 dnl provide gmtime_r compat prototype.
 1224 dnl $1: unique name for compat code
 1225 AC_DEFUN([AHX_CONFIG_GMTIME_R],
 1226 [
 1227 #ifndef HAVE_GMTIME_R
 1228 #define gmtime_r gmtime_r_$1
 1229 struct tm *gmtime_r(const time_t *timep, struct tm *result);
 1230 #endif
 1231 ])
 1232 
 1233 dnl provide reallocarray compat prototype.
 1234 dnl $1: unique name for compat code
 1235 AC_DEFUN([AHX_CONFIG_REALLOCARRAY],
 1236 [
 1237 #ifndef HAVE_REALLOCARRAY
 1238 #define reallocarray reallocarray$1
 1239 void* reallocarray(void *ptr, size_t nmemb, size_t size);
 1240 #endif
 1241 ])
 1242 
 1243 dnl provide w32 compat definition for sleep
 1244 AC_DEFUN([AHX_CONFIG_W32_SLEEP],
 1245 [
 1246 #if !defined(HAVE_SLEEP) || defined(HAVE_WINDOWS_H)
 1247 #define sleep(x) Sleep((x)*1000) /* on win32 */
 1248 #endif /* HAVE_SLEEP */
 1249 ])
 1250 
 1251 dnl provide w32 compat definition for usleep
 1252 AC_DEFUN([AHX_CONFIG_W32_USLEEP],
 1253 [
 1254 #ifndef HAVE_USLEEP
 1255 #define usleep(x) Sleep((x)/1000 + 1) /* on win32 */
 1256 #endif /* HAVE_USLEEP */
 1257 ])
 1258 
 1259 dnl provide w32 compat definition for random
 1260 AC_DEFUN([AHX_CONFIG_W32_RANDOM],
 1261 [
 1262 #ifndef HAVE_RANDOM
 1263 #define random rand /* on win32, for tests only (bad random) */
 1264 #endif /* HAVE_RANDOM */
 1265 ])
 1266 
 1267 dnl provide w32 compat definition for srandom
 1268 AC_DEFUN([AHX_CONFIG_W32_SRANDOM],
 1269 [
 1270 #ifndef HAVE_SRANDOM
 1271 #define srandom(x) srand(x) /* on win32, for tests only (bad random) */
 1272 #endif /* HAVE_SRANDOM */
 1273 ])
 1274 
 1275 dnl provide w32 compat definition for FD_SET_T
 1276 AC_DEFUN([AHX_CONFIG_W32_FD_SET_T],
 1277 [
 1278 /* detect if we need to cast to unsigned int for FD_SET to avoid warnings */
 1279 #ifdef HAVE_WINSOCK2_H
 1280 #define FD_SET_T (u_int)
 1281 #else
 1282 #define FD_SET_T 
 1283 #endif
 1284 ])
 1285 
 1286 dnl Remove an extension flag from CFLAGS, define replacement to be made.
 1287 dnl Used by ACX_STRIP_EXT_FLAGS.
 1288 dnl $1: the name of the flag, for example -D_GNU_SOURCE.
 1289 AC_DEFUN([ACX_CFLAGS_STRIP],
 1290 [
 1291   if echo $CFLAGS | grep " $1" >/dev/null 2>&1; then
 1292     CFLAGS="`echo $CFLAGS | sed -e 's/ $1//g'`"
 1293     AC_DEFINE(m4_bpatsubst(OMITTED_$1,[[-=]],_), 1, Put $1 define in config.h)
 1294   fi
 1295 ])
 1296 
 1297 dnl Remove EXT flags from the CFLAGS and set them to be defined in config.h
 1298 dnl use with ACX_DETERMINE_EXT_FLAGS.
 1299 AC_DEFUN([ACX_STRIP_EXT_FLAGS],
 1300 [
 1301   AC_MSG_NOTICE([Stripping extension flags...])
 1302   ACX_CFLAGS_STRIP(-D_GNU_SOURCE)
 1303   ACX_CFLAGS_STRIP(-D_BSD_SOURCE)
 1304   ACX_CFLAGS_STRIP(-D_DEFAULT_SOURCE)
 1305   ACX_CFLAGS_STRIP(-D__EXTENSIONS__)
 1306   ACX_CFLAGS_STRIP(-D_POSIX_C_SOURCE=200112)
 1307   ACX_CFLAGS_STRIP(-D_XOPEN_SOURCE=600)
 1308   ACX_CFLAGS_STRIP(-D_XOPEN_SOURCE_EXTENDED=1)
 1309   ACX_CFLAGS_STRIP(-D_ALL_SOURCE)
 1310   ACX_CFLAGS_STRIP(-D_LARGEFILE_SOURCE=1)
 1311 ]) dnl End of ACX_STRIP_EXT_FLAGS
 1312 
 1313 dnl define one omitted flag for config.h
 1314 dnl $1: flag name. -D_GNU_SOURCE
 1315 dnl $2: replacement define. _GNU_SOURCE
 1316 dnl $3: define value, 1
 1317 AC_DEFUN([AHX_CONFIG_FLAG_OMITTED],
 1318 [#if defined($1) && !defined($2)
 1319 #define $2 $3
 1320 [#]endif ])
 1321 
 1322 dnl Wrapper for AHX_CONFIG_FLAG_OMITTED for -D style flags
 1323 dnl $1: the -DNAME or -DNAME=value string.
 1324 AC_DEFUN([AHX_CONFIG_FLAG_EXT],
 1325 [AHX_CONFIG_FLAG_OMITTED(m4_bpatsubst(OMITTED_$1,[[-=]],_),m4_bpatsubst(m4_bpatsubst($1,-D,),=.*$,),m4_if(m4_bregexp($1,=),-1,1,m4_bpatsubst($1,^.*=,)))
 1326 ])
 1327 
 1328 dnl config.h part to define omitted cflags, use with ACX_STRIP_EXT_FLAGS.
 1329 AC_DEFUN([AHX_CONFIG_EXT_FLAGS],
 1330 [AHX_CONFIG_FLAG_EXT(-D_GNU_SOURCE)
 1331 AHX_CONFIG_FLAG_EXT(-D_BSD_SOURCE)
 1332 AHX_CONFIG_FLAG_EXT(-D_DEFAULT_SOURCE)
 1333 AHX_CONFIG_FLAG_EXT(-D__EXTENSIONS__)
 1334 AHX_CONFIG_FLAG_EXT(-D_POSIX_C_SOURCE=200112)
 1335 AHX_CONFIG_FLAG_EXT(-D_XOPEN_SOURCE=600)
 1336 AHX_CONFIG_FLAG_EXT(-D_XOPEN_SOURCE_EXTENDED=1)
 1337 AHX_CONFIG_FLAG_EXT(-D_ALL_SOURCE)
 1338 AHX_CONFIG_FLAG_EXT(-D_LARGEFILE_SOURCE=1)
 1339 ])
 1340 
 1341 dnl check if memcmp is using signed characters and replace if so.
 1342 AC_DEFUN([ACX_CHECK_MEMCMP_SIGNED],
 1343 [AC_MSG_CHECKING([if memcmp compares unsigned])
 1344 AC_RUN_IFELSE([AC_LANG_SOURCE([[
 1345 #include <stdio.h>
 1346 #include <stdlib.h>
 1347 #include <string.h>
 1348 int main(void)
 1349 {
 1350 	char a = 255, b = 0;
 1351 	if(memcmp(&a, &b, 1) < 0)
 1352 		return 1;
 1353 	return 0;
 1354 }
 1355 ]])], [AC_MSG_RESULT([yes]) ],
 1356 [ AC_MSG_RESULT([no])
 1357   AC_DEFINE([MEMCMP_IS_BROKEN], [1], [Define if memcmp() does not compare unsigned bytes])
 1358   AC_LIBOBJ([memcmp])
 1359 ], [ AC_MSG_RESULT([cross-compile no])
 1360   AC_DEFINE([MEMCMP_IS_BROKEN], [1], [Define if memcmp() does not compare unsigned bytes])
 1361   AC_LIBOBJ([memcmp]) 
 1362 ]) ])
 1363 
 1364 dnl define memcmp to its replacement, pass unique id for program as arg
 1365 AC_DEFUN([AHX_MEMCMP_BROKEN], [
 1366 #ifdef MEMCMP_IS_BROKEN
 1367 #include "compat/memcmp.h"
 1368 #define memcmp memcmp_$1
 1369 int memcmp(const void *x, const void *y, size_t n);
 1370 #endif
 1371 ])
 1372 
 1373 dnl ACX_CHECK_SS_FAMILY           - check for sockaddr_storage.ss_family
 1374 AC_DEFUN([ACX_CHECK_SS_FAMILY],
 1375 [AC_CHECK_MEMBER([struct sockaddr_storage.ss_family], [], [
 1376         AC_CHECK_MEMBER([struct sockaddr_storage.__ss_family], [
 1377                 AC_DEFINE([ss_family], [__ss_family], [Fallback member name for socket family in struct sockaddr_storage])
 1378         ],, [AC_INCLUDES_DEFAULT
 1379 #ifdef HAVE_NETINET_IN_H
 1380 #include <netinet/in.h>
 1381 #endif
 1382 #ifdef HAVE_SYS_SOCKET_H
 1383 #include <sys/socket.h>
 1384 #endif
 1385 #ifdef HAVE_NETDB_H
 1386 #include <netdb.h>
 1387 #endif
 1388 #ifdef HAVE_ARPA_INET_H
 1389 #include <arpa/inet.h>
 1390 #endif
 1391     ])
 1392 ], [AC_INCLUDES_DEFAULT
 1393 #ifdef HAVE_NETINET_IN_H
 1394 #include <netinet/in.h>
 1395 #endif
 1396 #ifdef HAVE_SYS_SOCKET_H
 1397 #include <sys/socket.h>
 1398 #endif
 1399 #ifdef HAVE_NETDB_H
 1400 #include <netdb.h>
 1401 #endif
 1402 #ifdef HAVE_ARPA_INET_H
 1403 #include <arpa/inet.h>
 1404 #endif
 1405 ]) ])
 1406 
 1407 dnl Check if CC and linker support -fPIE and -pie.
 1408 dnl If so, sets them in CFLAGS / LDFLAGS.
 1409 AC_DEFUN([ACX_CHECK_PIE], [
 1410     AC_ARG_ENABLE([pie], AS_HELP_STRING([--enable-pie], [Enable Position-Independent Executable (eg. to fully benefit from ASLR, small performance penalty)]))
 1411     AS_IF([test "x$enable_pie" = "xyes"], [
 1412 	AC_MSG_CHECKING([if $CC supports PIE])
 1413 	BAKLDFLAGS="$LDFLAGS"
 1414 	BAKCFLAGS="$CFLAGS"
 1415 	LDFLAGS="$LDFLAGS -pie"
 1416 	CFLAGS="$CFLAGS -fPIE"
 1417 	AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
 1418 	    if $CC $CFLAGS $LDFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
 1419 		LDFLAGS="$BAKLDFLAGS"
 1420 		AC_MSG_RESULT(no)
 1421 	    else
 1422 		AC_MSG_RESULT(yes)
 1423 	    fi
 1424 	    rm -f conftest conftest.c conftest.o
 1425 	], [LDFLAGS="$BAKLDFLAGS" ; CFLAGS="$BAKCFLAGS" ; AC_MSG_RESULT(no)])
 1426     ])
 1427 ])
 1428 
 1429 dnl Check if linker supports -Wl,-z,relro,-z,now.
 1430 dnl If so, adds it to LDFLAGS.
 1431 AC_DEFUN([ACX_CHECK_RELRO_NOW], [
 1432     AC_ARG_ENABLE([relro_now], AS_HELP_STRING([--enable-relro-now], [Enable full relocation binding at load-time (RELRO NOW, to protect GOT and .dtor areas)]))
 1433     AS_IF([test "x$enable_relro_now" = "xyes"], [
 1434 	AC_MSG_CHECKING([if $CC supports -Wl,-z,relro,-z,now])
 1435 	BAKLDFLAGS="$LDFLAGS"
 1436 	LDFLAGS="$LDFLAGS -Wl,-z,relro,-z,now"
 1437 	AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])], [
 1438 	    if $CC $CFLAGS $LDFLAGS -o conftest conftest.c 2>&1 | grep "warning: no debug symbols in executable" >/dev/null; then
 1439 		LDFLAGS="$BAKLDFLAGS"
 1440 		AC_MSG_RESULT(no)
 1441 	    else
 1442 		AC_MSG_RESULT(yes)
 1443 	    fi
 1444 	    rm -f conftest conftest.c conftest.o
 1445 	], [LDFLAGS="$BAKLDFLAGS" ; AC_MSG_RESULT(no)])
 1446     ])
 1447 ])
 1448 
 1449 dnl End of file