d_asctime_r=''
d_asinh=''
d_atanh=''
+d_attribute_always_inline=''
d_attribute_deprecated=''
d_attribute_format=''
d_attribute_malloc=''
signal_t=''
d_wait4=''
d_waitpid=''
+d_wcrtomb=''
d_wcscmp=''
d_wcstombs=''
d_wcsxfrm=''
fi
$rm -f try try.*
case "$gccversion" in
-1.*) cpp=`./loc gcc-cpp $cpp $pth` ;;
+1*) cpp=`./loc gcc-cpp $cpp $pth` ;;
esac
case "$gccversion" in
'') gccosandvers='' ;;
# gcc 3.* complain about adding -Idirectories that they already know about,
# so we will take those off from locincpth.
case "$gccversion" in
-3.*)
+3*)
echo "main(){}">try.c
for incdir in $locincpth; do
warn=`$cc $ccflags -I$incdir -c try.c 2>&1 | \
case "$hint" in
default|recommended)
case "$gccversion" in
- 1.*) dflt="$dflt -fpcc-struct-return" ;;
+ 1*) dflt="$dflt -fpcc-struct-return" ;;
esac
case "$optimize:$DEBUGGING" in
*-g*:old) dflt="$dflt -DDEBUGGING";;
esac
case "$gccversion" in
- 2.*) if $test -d /etc/conf/kconfig.d &&
+ 2*) if $test -d /etc/conf/kconfig.d &&
$contains _POSIX_VERSION $usrinc/sys/unistd.h >/dev/null 2>&1
then
# Interactive Systems (ISC) POSIX mode.
;;
esac
case "$gccversion" in
- 1.*) ;;
+ 1*) ;;
2.[0-8]*) ;;
?*) set strict-aliasing -fno-strict-aliasing
eval $checkccflag
;;
esac
case "$gccversion" in
-1.*) cppflags="$cppflags -D__GNUC__"
+1*) cppflags="$cppflags -D__GNUC__"
esac
case "$mips_type" in
'');;
set backtrace d_backtrace
eval $inlibc
-: add flags if using c backtrace
+: Check if C backtrace is actually supported.
case "$usecbacktrace" in
"") usecbacktrace=$undef ;;
[yY]*|true|$define)
case "$d_backtrace" in
[yY]*|true|$define)
- case " $ccflags " in
- *" -DUSE_C_BACKTRACE "*) ;; # Already there.
- *) ccflags="$ccflags -DUSE_C_BACKTRACE -g" ;;
- esac
;;
*)
echo "This system does not support backtrace" >&4
eval $setvar
$rm -f attrib*
+: Look for GCC-style attribute always_inline
+case "$d_attribute_always_inline" in
+'')
+echo " "
+echo "Checking whether your compiler can handle __attribute__((always_inline)) ..." >&4
+$cat >attrib.c <<'EOCP'
+#include <stdio.h>
+static __inline__ __attribute__((always_inline)) int I_will_always_be_inlined(void);
+EOCP
+if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
+ if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ echo "Your C compiler doesn't support __attribute__((always_inline))."
+ val="$undef"
+ else
+ echo "Your C compiler supports __attribute__((always_inline))."
+ val="$define"
+ fi
+else
+ echo "Your C compiler doesn't seem to understand __attribute__ at all."
+ val="$undef"
+fi
+;;
+*) val="$d_attribute_always_inline" ;;
+esac
+set d_attribute_always_inline
+eval $setvar
+$rm -f attrib*
+
: see if getpgrp exists
set getpgrp d_getpgrp
eval $inlibc
echo "Checking to see if you have isless..." >&4
$cat >try.c <<EOCP
#include <math.h>
-int main() { return isless(0.0); }
+int main() { return isless(2.0, 1.0); }
EOCP
set try
if eval $compile; then
;;
esac
+: Checking 32bit alignedness
$cat <<EOM
Checking to see whether you can access character data unalignedly...
-
-We assume only aligned access is permitted.
EOM
-: Checking 32bit alignedness
-: We no longer check and assume it is required.
case "$d_u32align" in
-'') d_u32align="$define" ;;
+'') $cat >try.c <<EOCP
+#include <stdio.h>
+#$i_stdlib I_STDLIB
+#ifdef I_STDLIB
+#include <stdlib.h>
+#endif
+#define U32 $u32type
+#define BYTEORDER 0x$byteorder
+#define U8 $u8type
+#include <signal.h>
+#ifdef SIGBUS
+$signal_t bletch(int s) { exit(4); }
+#endif
+int main() {
+#if BYTEORDER == 0x1234 || BYTEORDER == 0x4321
+ volatile U8 buf[8];
+ volatile U32 *up;
+ int i;
+
+ if (sizeof(U32) != 4) {
+ printf("sizeof(U32) is not 4, but %d\n", sizeof(U32));
+ exit(1);
+ }
+
+ fflush(stdout);
+
+#ifdef SIGBUS
+ signal(SIGBUS, bletch);
+#endif
+
+ buf[0] = 0;
+ buf[1] = 0;
+ buf[2] = 0;
+ buf[3] = 1;
+ buf[4] = 0;
+ buf[5] = 0;
+ buf[6] = 0;
+ buf[7] = 1;
+
+ for (i = 0; i < 4; i++) {
+ up = (U32*)(buf + i);
+ if (! ((*up == 1 << (8*i)) || /* big-endian */
+ (*up == 1 << (8*(3-i))) /* little-endian */
+ )
+ )
+ {
+ printf("read failed (%x)\n", *up);
+ exit(2);
+ }
+ }
+
+ /* write test */
+ for (i = 0; i < 4; i++) {
+ up = (U32*)(buf + i);
+ *up = 0xBeef;
+ if (*up != 0xBeef) {
+ printf("write failed (%x)\n", *up);
+ exit(3);
+ }
+ }
+
+ exit(0);
+#else
+ printf("1\n");
+ exit(1);
+#endif
+ return 0;
+}
+EOCP
+set try
+if eval $compile_ok; then
+ echo "(Testing for character data alignment may crash the test. That's okay.)" >&4
+ $run ./try 2>&1 >/dev/null
+ case "$?" in
+ 0) cat >&4 <<EOM
+You can access character data pretty unalignedly.
+EOM
+ d_u32align="$undef"
+ ;;
+ *) cat >&4 <<EOM
+It seems that you must access character data in an aligned manner.
+EOM
+ d_u32align="$define"
+ ;;
+ esac
+else
+ rp='Can you access character data at unaligned addresses?'
+ dflt='n'
+ . ./myread
+ case "$ans" in
+ [yY]*) d_u32align="$undef" ;;
+ *) d_u32align="$define" ;;
+ esac
+fi
+$rm_try
+;;
esac
: see if ualarm exists
set waitpid d_waitpid
eval $inlibc
+: see if wcrtomb exists
+set wcrtomb d_wcrtomb
+eval $inlibc
+
: look for wcscmp
echo " "
$cat >try.c <<'EOCP'
: add -D_FORTIFY_SOURCE if feasible and not already there
case "$gccversion" in
-[456789].*|[1-9][0-9]*) case "$optimize$ccflags" in
+[456789].*) case "$optimize$ccflags" in
*-O*) case "$ccflags$cppsymbols" in
*_FORTIFY_SOURCE=*) # Don't add it again.
echo "You seem to have -D_FORTIFY_SOURCE already, not adding it." >&4
d_atanh='$d_atanh'
d_atolf='$d_atolf'
d_atoll='$d_atoll'
+d_attribute_always_inline='$d_attribute_always_inline'
d_attribute_deprecated='$d_attribute_deprecated'
d_attribute_format='$d_attribute_format'
d_attribute_malloc='$d_attribute_malloc'
d_vsnprintf='$d_vsnprintf'
d_wait4='$d_wait4'
d_waitpid='$d_waitpid'
+d_wcrtomb='$d_wcrtomb'
d_wcscmp='$d_wcscmp'
d_wcstombs='$d_wcstombs'
d_wcsxfrm='$d_wcsxfrm'
d_atanh='undef'
d_atolf='undef'
d_atoll='define'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='define'
d_wait4='define'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='define'
d_wcsxfrm='undef'
d_atanh='undef'
d_atolf='undef'
d_atoll='define'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='define'
d_wait4='define'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='define'
d_wcsxfrm='undef'
d_atanh='undef'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='undef'
d_wait4='undef'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='define'
d_wcsxfrm='undef'
d_atanh='define'
d_atolf='undef'
d_atoll='define'
+d_attribute_always_inline='undef'
d_attribute_deprecated='define'
d_attribute_format='define'
d_attribute_malloc='define'
d_vsnprintf='define'
d_wait4='define'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='define'
d_wcstombs='define'
d_wcsxfrm='define'
#
# See Porting/config_h.pl
+#!/bin/sh
+#
+# THIS IS A GENERATED FILE
+# DO NOT HAND-EDIT
+#
+# See Porting/config_h.pl
+
: Set up for generating config_h.SH
case "$CONFIG_SH" in
'') CONFIG_SH=config.sh;;
case "$CONFIG_H" in
already-done) echo "Not re-extracting config.h" ;;
*)
+case "$CONFIG_H" in
+already-done) echo "Not re-extracting config.h" ;;
+*)
echo "Extracting $CONFIG_H (with variable substitutions)"
sed <<!GROK!THIS! >$CONFIG_H -e 's!^#undef\(.*/\)\*!/\*#define\1 \*!' -e 's!^#un-def!#undef!'
/* This file was produced by running the config_h.SH script, which
#$d_attribute_pure HASATTRIBUTE_PURE /**/
#$d_attribute_unused HASATTRIBUTE_UNUSED /**/
#$d_attribute_warn_unused_result HASATTRIBUTE_WARN_UNUSED_RESULT /**/
+#$d_attribute_always_inline HASATTRIBUTE_ALWAYS_INLINE /**/
/* HAS_BACKTRACE:
* This symbol, if defined, indicates that the backtrace() routine is
#$d_ttyname_r HAS_TTYNAME_R /**/
#define TTYNAME_R_PROTO $ttyname_r_proto /**/
+/* HAS_WCRTOMB:
+ * This symbol, if defined, indicates that the wcrtomb routine is
+ * available to convert a wide character into a multi-byte character.
+ */
+#$d_wcrtomb HAS_WCRTOMB /**/
+
/* I_MACH_CTHREADS:
* This symbol, if defined, indicates to the C program that it should
* include <mach/cthreads.h>.
!GROK!THIS!
;;
esac
+;;
+esac
$ WC "d_atanh='" + d_atanh + "'"
$ WC "d_atolf='" + d_atolf + "'"
$ WC "d_atoll='" + d_atoll + "'"
+$ WC "d_attribute_always_inline='undef'"
$ WC "d_attribute_format='" + d_attribut + "'"
$ WC "d_attribute_deprecated='undef'"
$ WC "d_attribute_malloc='undef'"
$ WC "d_vsnprintf='" + d_vsnprintf + "'"
$ WC "d_wait4='" + d_wait4 + "'"
$ WC "d_waitpid='define'"
+$ WC "d_wcrtomb='define'"
$ WC "d_wcscmp='define'"
$ WC "d_wcstombs='define'"
$ WC "d_wcsxfrm='define'"
d_atanh='undef'
d_atolf='undef'
d_atoll='define'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='undef'
d_wait4='undef'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='define'
d_wcsxfrm='undef'
d_atanh='undef'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='undef'
d_wait4='undef'
d_waitpid='undef'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='undef'
d_wcsxfrm='undef'
/*#define HASATTRIBUTE_PURE / **/
/*#define HASATTRIBUTE_UNUSED / **/
/*#define HASATTRIBUTE_WARN_UNUSED_RESULT / **/
+/*#define HASATTRIBUTE_ALWAYS_INLINE / **/
/* HAS_BACKTRACE:
* This symbol, if defined, indicates that the backtrace() routine is
/*#define HAS_TTYNAME_R / **/
#define TTYNAME_R_PROTO 0 /**/
+/* HAS_WCRTOMB:
+ * This symbol, if defined, indicates that the wcrtomb routine is
+ * available to convert a wide character into a multi-byte character.
+ */
+/*#define HAS_WCRTOMB / **/
+
/* I_MACH_CTHREADS:
* This symbol, if defined, indicates to the C program that it should
* include <mach/cthreads.h>.
#endif
/* Generated from:
- * e3dbc17ac938c9df0df81930ccebf94a0425dbff9d20c3edd18a84075eff4fc2 config_h.SH
- * a11d95f56af200907b9285ed0da243a4c20db34f5684af313d18195eaba2b18b uconfig.sh
+ * 0c6730559753fa1aa79fa3a10b50df81c20cae46d1fe3e3faef1c7d3aa13c92c config_h.SH
+ * 31c25f95118efbf99e358f81091058e6723b4cccb8474dfbc6d06c2b7d46ff17 uconfig.sh
* ex: set ro: */
d_atanh='undef'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='undef'
d_wait4='undef'
d_waitpid='undef'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='undef'
d_wcsxfrm='undef'
d_atanh='undef'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='undef'
d_wait4='undef'
d_waitpid='undef'
+d_wcrtomb='undef'
d_wcscmp='undef'
d_wcstombs='undef'
d_wcsxfrm='undef'
d_atanh='define'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='define'
d_wait4='undef'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='define'
d_wcstombs='define'
d_wcsxfrm='define'
d_atanh='undef'
d_atolf='undef'
d_atoll='undef'
+d_attribute_always_inline='undef'
d_attribute_deprecated='undef'
d_attribute_format='undef'
d_attribute_malloc='undef'
d_vsnprintf='define'
d_wait4='undef'
d_waitpid='define'
+d_wcrtomb='undef'
d_wcscmp='define'
d_wcstombs='define'
d_wcsxfrm='define'