@@ -7626,7 +7626,142 @@ fi
76267626# other libraries can pull in the pthread functions as a side-effect. We
76277627# want to use the -pthread or similar flags directly, and not rely on
76287628# the side-effects of linking with some other library.
7629- if test " $enable_thread_safety " = yes -a " $PORTNAME " ! = " win32" ; then
7629+ #
7630+ # note: We have to use AS_IF here rather than plain if. The AC_CHECK_HEADER
7631+ # invocation below is the first one in the script, and autoconf generates
7632+ # additional code for that, which must not be inside the if-block. AS_IF
7633+ # knows how to do that.
7634+ { $as_echo " $as_me :${as_lineno-$LINENO } : checking for ANSI C header files" >&5
7635+ $as_echo_n " checking for ANSI C header files... " >&6 ; }
7636+ if ${ac_cv_header_stdc+: } false ; then :
7637+ $as_echo_n " (cached) " >&6
7638+ else
7639+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
7640+ /* end confdefs.h. */
7641+ #include <stdlib.h>
7642+ #include <stdarg.h>
7643+ #include <string.h>
7644+ #include <float.h>
7645+
7646+ int
7647+ main ()
7648+ {
7649+
7650+ ;
7651+ return 0;
7652+ }
7653+ _ACEOF
7654+ if ac_fn_c_try_compile " $LINENO " ; then :
7655+ ac_cv_header_stdc=yes
7656+ else
7657+ ac_cv_header_stdc=no
7658+ fi
7659+ rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
7660+
7661+ if test $ac_cv_header_stdc = yes; then
7662+ # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
7663+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
7664+ /* end confdefs.h. */
7665+ #include <string.h>
7666+
7667+ _ACEOF
7668+ if (eval " $ac_cpp conftest.$ac_ext " ) 2>&5 |
7669+ $EGREP " memchr" > /dev/null 2>&1 ; then :
7670+
7671+ else
7672+ ac_cv_header_stdc=no
7673+ fi
7674+ rm -f conftest*
7675+
7676+ fi
7677+
7678+ if test $ac_cv_header_stdc = yes; then
7679+ # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
7680+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
7681+ /* end confdefs.h. */
7682+ #include <stdlib.h>
7683+
7684+ _ACEOF
7685+ if (eval " $ac_cpp conftest.$ac_ext " ) 2>&5 |
7686+ $EGREP " free" > /dev/null 2>&1 ; then :
7687+
7688+ else
7689+ ac_cv_header_stdc=no
7690+ fi
7691+ rm -f conftest*
7692+
7693+ fi
7694+
7695+ if test $ac_cv_header_stdc = yes; then
7696+ # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
7697+ if test " $cross_compiling " = yes; then :
7698+ :
7699+ else
7700+ cat confdefs.h - << _ACEOF >conftest.$ac_ext
7701+ /* end confdefs.h. */
7702+ #include <ctype.h>
7703+ #include <stdlib.h>
7704+ #if ((' ' & 0x0FF) == 0x020)
7705+ # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
7706+ # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
7707+ #else
7708+ # define ISLOWER(c) \
7709+ (('a' <= (c) && (c) <= 'i') \
7710+ || ('j' <= (c) && (c) <= 'r') \
7711+ || ('s' <= (c) && (c) <= 'z'))
7712+ # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
7713+ #endif
7714+
7715+ #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
7716+ int
7717+ main ()
7718+ {
7719+ int i;
7720+ for (i = 0; i < 256; i++)
7721+ if (XOR (islower (i), ISLOWER (i))
7722+ || toupper (i) != TOUPPER (i))
7723+ return 2;
7724+ return 0;
7725+ }
7726+ _ACEOF
7727+ if ac_fn_c_try_run " $LINENO " ; then :
7728+
7729+ else
7730+ ac_cv_header_stdc=no
7731+ fi
7732+ rm -f core * .core core.conftest.* gmon.out bb.out conftest$ac_exeext \
7733+ conftest.$ac_objext conftest.beam conftest.$ac_ext
7734+ fi
7735+
7736+ fi
7737+ fi
7738+ { $as_echo " $as_me :${as_lineno-$LINENO } : result: $ac_cv_header_stdc " >&5
7739+ $as_echo " $ac_cv_header_stdc " >&6 ; }
7740+ if test $ac_cv_header_stdc = yes; then
7741+
7742+ $as_echo " #define STDC_HEADERS 1" >> confdefs.h
7743+
7744+ fi
7745+
7746+ # On IRIX 5.3, sys/types and inttypes.h are conflicting.
7747+ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
7748+ inttypes.h stdint.h unistd.h
7749+ do :
7750+ as_ac_Header=` $as_echo " ac_cv_header_$ac_header " | $as_tr_sh `
7751+ ac_fn_c_check_header_compile " $LINENO " " $ac_header " " $as_ac_Header " " $ac_includes_default
7752+ "
7753+ if eval test \" x\$ " $as_ac_Header " \" = x" yes" ; then :
7754+ cat >> confdefs.h << _ACEOF
7755+ #define ` $as_echo " HAVE_$ac_header " | $as_tr_cpp ` 1
7756+ _ACEOF
7757+
7758+ fi
7759+
7760+ done
7761+
7762+
7763+ if test " $enable_thread_safety " = yes -a " $PORTNAME " ! = " win32" ; then :
7764+ # then
76307765
76317766
76327767ac_ext=c
@@ -8081,136 +8216,6 @@ _LIBS="$LIBS"
80818216CFLAGS=" $CFLAGS $PTHREAD_CFLAGS "
80828217LIBS=" $LIBS $PTHREAD_LIBS "
80838218
8084- if test " $PORTNAME " ! = " win32" ; then
8085- { $as_echo " $as_me :${as_lineno-$LINENO } : checking for ANSI C header files" >&5
8086- $as_echo_n " checking for ANSI C header files... " >&6 ; }
8087- if ${ac_cv_header_stdc+: } false ; then :
8088- $as_echo_n " (cached) " >&6
8089- else
8090- cat confdefs.h - << _ACEOF >conftest.$ac_ext
8091- /* end confdefs.h. */
8092- #include <stdlib.h>
8093- #include <stdarg.h>
8094- #include <string.h>
8095- #include <float.h>
8096-
8097- int
8098- main ()
8099- {
8100-
8101- ;
8102- return 0;
8103- }
8104- _ACEOF
8105- if ac_fn_c_try_compile " $LINENO " ; then :
8106- ac_cv_header_stdc=yes
8107- else
8108- ac_cv_header_stdc=no
8109- fi
8110- rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
8111-
8112- if test $ac_cv_header_stdc = yes; then
8113- # SunOS 4.x string.h does not declare mem*, contrary to ANSI.
8114- cat confdefs.h - << _ACEOF >conftest.$ac_ext
8115- /* end confdefs.h. */
8116- #include <string.h>
8117-
8118- _ACEOF
8119- if (eval " $ac_cpp conftest.$ac_ext " ) 2>&5 |
8120- $EGREP " memchr" > /dev/null 2>&1 ; then :
8121-
8122- else
8123- ac_cv_header_stdc=no
8124- fi
8125- rm -f conftest*
8126-
8127- fi
8128-
8129- if test $ac_cv_header_stdc = yes; then
8130- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI.
8131- cat confdefs.h - << _ACEOF >conftest.$ac_ext
8132- /* end confdefs.h. */
8133- #include <stdlib.h>
8134-
8135- _ACEOF
8136- if (eval " $ac_cpp conftest.$ac_ext " ) 2>&5 |
8137- $EGREP " free" > /dev/null 2>&1 ; then :
8138-
8139- else
8140- ac_cv_header_stdc=no
8141- fi
8142- rm -f conftest*
8143-
8144- fi
8145-
8146- if test $ac_cv_header_stdc = yes; then
8147- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
8148- if test " $cross_compiling " = yes; then :
8149- :
8150- else
8151- cat confdefs.h - << _ACEOF >conftest.$ac_ext
8152- /* end confdefs.h. */
8153- #include <ctype.h>
8154- #include <stdlib.h>
8155- #if ((' ' & 0x0FF) == 0x020)
8156- # define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
8157- # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
8158- #else
8159- # define ISLOWER(c) \
8160- (('a' <= (c) && (c) <= 'i') \
8161- || ('j' <= (c) && (c) <= 'r') \
8162- || ('s' <= (c) && (c) <= 'z'))
8163- # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
8164- #endif
8165-
8166- #define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
8167- int
8168- main ()
8169- {
8170- int i;
8171- for (i = 0; i < 256; i++)
8172- if (XOR (islower (i), ISLOWER (i))
8173- || toupper (i) != TOUPPER (i))
8174- return 2;
8175- return 0;
8176- }
8177- _ACEOF
8178- if ac_fn_c_try_run " $LINENO " ; then :
8179-
8180- else
8181- ac_cv_header_stdc=no
8182- fi
8183- rm -f core * .core core.conftest.* gmon.out bb.out conftest$ac_exeext \
8184- conftest.$ac_objext conftest.beam conftest.$ac_ext
8185- fi
8186-
8187- fi
8188- fi
8189- { $as_echo " $as_me :${as_lineno-$LINENO } : result: $ac_cv_header_stdc " >&5
8190- $as_echo " $ac_cv_header_stdc " >&6 ; }
8191- if test $ac_cv_header_stdc = yes; then
8192-
8193- $as_echo " #define STDC_HEADERS 1" >> confdefs.h
8194-
8195- fi
8196-
8197- # On IRIX 5.3, sys/types and inttypes.h are conflicting.
8198- for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \
8199- inttypes.h stdint.h unistd.h
8200- do :
8201- as_ac_Header=` $as_echo " ac_cv_header_$ac_header " | $as_tr_sh `
8202- ac_fn_c_check_header_compile " $LINENO " " $ac_header " " $as_ac_Header " " $ac_includes_default
8203- "
8204- if eval test \" x\$ " $as_ac_Header " \" = x" yes" ; then :
8205- cat >> confdefs.h << _ACEOF
8206- #define ` $as_echo " HAVE_$ac_header " | $as_tr_cpp ` 1
8207- _ACEOF
8208-
8209- fi
8210-
8211- done
8212-
8213-
82148219ac_fn_c_check_header_mongrel " $LINENO " " pthread.h" " ac_cv_header_pthread_h" " $ac_includes_default "
82158220if test " x$ac_cv_header_pthread_h " = xyes; then :
82168221
@@ -8220,7 +8225,6 @@ pthread.h not found; use --disable-thread-safety to disable thread safety" "$LI
82208225fi
82218226
82228227
8223- fi
82248228
82258229for ac_func in strerror_r getpwuid_r gethostbyname_r
82268230do :
@@ -8276,11 +8280,14 @@ fi
82768280CFLAGS=" $_CFLAGS "
82778281LIBS=" $_LIBS "
82788282
8283+
82798284else
8285+ # else
82808286# do not use values from template file
82818287PTHREAD_CFLAGS=
82828288PTHREAD_LIBS=
8283- fi
8289+
8290+ fi # fi
82848291
82858292
82868293
0 commit comments