# $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
#
-# Generated on Wed Jun 13 22:10:15 CEST 2007 [metaconfig 3.0 PL70]
+# Generated on Mon Oct 8 10:22:27 CEST 2007 [metaconfig 3.0 PL70]
# (with additional metaconfig patches by perlbug@perl.org)
cat >c1$$ <<EOF
esac
;;
esac
+test -x "${newsh}" || unset newsh
: if needed set CDPATH to a harmless value that is not chatty
: avoid bash 2.02 problems with empty CDPATH.
cf_email=''
cf_by=''
cf_time=''
-charsize=''
contains=''
cpp_stuff=''
cpplast=''
html3dir=''
html3direxp=''
installhtml3dir=''
+i_assert=''
i_arpainet=''
i_crypt=''
db_hashtype=''
-U symbol= symbol gets completely empty
e.g.: -Uversiononly
-A : manipulate symbol after the platform specific hints have been applied:
- -A symbol=value append " "value to symbol
- -A append:symbol=value append value to symbol
- -A define:symbol=value define symbol to have value
- -A clear:symbol define symbol to be ''
- -A define:symbol define symbol to be 'define'
- -A eval:symbol=value define symbol to be eval of value
- -A prepend:symbol=value prepend value to symbol
- -A undef:symbol define symbol to be 'undef'
- -A undef:symbol= define symbol to be ''
+ -A append:symbol=value append value to symbol
+ -A symbol=value like append:, but with a separating space
+ -A define:symbol=value define symbol to have value
+ -A clear:symbol define symbol to be ''
+ -A define:symbol define symbol to be 'define'
+ -A eval:symbol=value define symbol to be eval of value
+ -A prepend:symbol=value prepend value to symbol
+ -A undef:symbol define symbol to be 'undef'
+ -A undef:symbol= define symbol to be ''
e.g.: -A prepend:libswanted='cl pthread '
+ -A ccflags=-DSOME_MACRO
-V : print version number and exit (with a zero status).
EOM
exit 1
;;
esac
+# This question was auctioned at YAPC::Europe-2007 in Vienna
+# I never promised you could answer it. I only auctioned the question.
+cat <<FOO
+The following message is sponsored by
+
+ Dresden.pm<--The stars should be here.
+
+Dear Perl user, system administrator or package
+maintainer, the Perl community sends greetings to
+you. Do you (emblematical) greet back [Y/n]? n
+
+FOO
+
cat <<EOS >trygcc
$startsh
EOS
case "$cc" in
*gcc*) trygcc=no ;;
esac
- case "`$cc -v -c try.c 2>&1`" in
- *gcc*) trygcc=no ;;
- esac
+ # Skip this test because it gives a false match on output like:
+ # ./trygcc: line 23: cc: command not found
+ # case "`$cc -v -c try.c 2>&1`" in
+ # *gcc*) trygcc=no ;;
+ # esac
if $test X"$trygcc" = Xyes; then
if gcc -o try -c try.c; then
echo " "
echo "You seem to have a working gcc, though." >&4
- rp="Would you like to use it?"
- dflt=y
+ # Switching compilers may undo the work of hints files.
+ # The most common problem is -D_REENTRANT for threads.
+ # This heuristic catches that case, but gets false positives
+ # if -Dusethreads was not actually specified. Better to
+ # bail out here with a useful message than fail
+ # mysteriously later. Should we perhaps just try to
+ # re-invoke Configure -Dcc=gcc config_args ?
+ if $test -f usethreads.cbu; then
+ $cat >&4 <<EOM
+
+*** However, any setting of the C compiler flags (e.g. for thread support)
+*** will be lost. It may be necessary for you to restart Configure and
+*** add -Dcc=gcc to your Configure command line.
+
+EOM
+ rp="Would you like to go ahead and try gcc anyway?"
+ dflt=n
+ else
+ rp="Would you like to use it?"
+ dflt=y
+ fi
if $test -f myread; then
. ./myread
else
fi
case "$ans" in
[yY]*) cc=gcc; ccname=gcc; ccflags=''; despair=no;
- if $test -f usethreads.cbu; then
- $cat >&4 <<EOM
-
-*** However, any setting of the C compiler flags (e.g. for thread support)
-*** has been lost. It may be necessary to pass -Dcc=gcc to Configure
-*** (together with e.g. -Dusethreads).
-
-EOM
- fi;;
esac
fi
fi
api_revision=`awk '/define[ ]+PERL_API_REVISION/ {print $3}' $rsrc/patchlevel.h`
api_version=`awk '/define[ ]+PERL_API_VERSION/ {print $3}' $rsrc/patchlevel.h`
api_subversion=`awk '/define[ ]+PERL_API_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
- perl_patchlevel=`egrep 'define PERL_PATCHNUM [0-9][0-9]|,"MAINT[0-9][0-9]*"' $rsrc/patchlevel.h|sed 's/[^0-9]//g'`
+ perl_patchlevel=`egrep ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
else
revision=0
patchlevel=0
both|$define) dflt='-DDEBUGGING'
esac
+: argument order is deliberate, as the flag will start with - which set could
+: think is an option
+checkccflag='check=$1; flag=$2; callback=$3;
+echo " ";
+echo "Checking if your compiler accepts $flag" 2>&1;
+echo "int main(void) { return 0; }" > gcctest.c;
+if $cc -O2 $flag -o gcctest gcctest.c && ./gcctest; then
+ echo "Yes, it does." 2>&1;
+ case "$ccflags" in
+ *$check*)
+ echo "Leaving current flags $ccflags alone." 2>&1
+ ;;
+ *) dflt="$dflt $flag";
+ eval $callback
+ ;;
+ esac
+else
+ echo "Nope, it does not, but that is ok." 2>&1;
+fi
+'
+
: We will not override a previous value, but we might want to
: augment a hint file
case "$hint" in
case "$gccversion" in
1*) ;;
2.[0-8]*) ;;
- ?*) echo " "
- echo "Checking if your compiler accepts -fno-strict-aliasing" 2>&1
- echo 'int main(void) { return 0; }' > gcctest.c
- if $cc -O2 -fno-strict-aliasing -o gcctest gcctest.c; then
- echo "Yes, it does." 2>&1
- case "$ccflags" in
- *strict-aliasing*)
- echo "Leaving current flags $ccflags alone." 2>&1
- ;;
- *) dflt="$dflt -fno-strict-aliasing" ;;
- esac
- else
- echo "Nope, it doesn't, but that's ok." 2>&1
- fi
+ ?*) set strict-aliasing -fno-strict-aliasing
+ eval $checkccflag
;;
esac
# For gcc, adding -pipe speeds up compilations for some, but apparently
# some assemblers can't read from stdin. (It also slows down compilations
# in other cases, but those are apparently rarer these days.) AD 5/2004.
case "$gccversion" in
- ?*) echo " "
- echo "Checking if your compiler accepts -pipe" 2>&1
- echo 'int main(void) { return 0; }' > gcctest.c
- if $cc -pipe -o gcctest gcctest.c; then
- echo "Yes, it does." 2>&1
- case "$ccflags" in
- *-pipe*)
- echo "Leaving current flags $ccflags alone." 2>&1
- ;;
- *) dflt="$dflt -pipe" ;;
- esac
- else
- echo "Nope, it doesn't, but that's ok." 2>&1
- fi
+ ?*) set pipe -pipe
+ eval $checkccflag
+ ;;
+ esac
+
+ # on x86_64 (at least) we require an extra library (libssp) in the
+ # link command line. This library is not named, so I infer that it is
+ # an implementation detail that may change. Hence the safest approach
+ # is to add the flag to the flags passed to the compiler at link time,
+ # as that way the compiler can do the right implementation dependant
+ # thing. (NWC)
+ case "$gccversion" in
+ ?*) set stack-protector -fstack-protector 'ldflags="$ldflags -fstack-protector"'
+ eval $checkccflag
;;
esac
;;
echo 'vprintf() found.' >&4
val="$define"
$cat >try.c <<EOF
-#include <varargs.h>
+#$i_stdarg I_STDARG /* Only one of these can be defined by i_varhrd */
+#$i_varargs I_VARARGS
+
#$i_stdlib I_STDLIB
+#$i_unistd I_UNISTD
+
+#ifdef I_STDARG
+# include <stdarg.h>
+#else /* I_VARARGS */
+# include <varargs.h>
+#endif
+
+#ifdef I_UNISTD
+# include <unistd.h>
+#endif
+
#ifdef I_STDLIB
-#include <stdlib.h>
+# include <stdlib.h>
#endif
-int main() { xxx("foo"); }
+#include <stdio.h> /* vsprintf prototype */
+
+#ifdef I_STDARG
+void xxx(int n, ...)
+{
+ va_list args;
+ char buf[10];
+ va_start(args, n);
+ exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
+}
+int main() { xxx(1, "foo"); }
+
+#else /* I_VARARGS */
xxx(va_alist)
va_dcl
{
- va_list args;
- char buf[10];
-
- va_start(args);
- exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
+ va_list args;
+ char buf[10];
+ va_start(args);
+ exit((unsigned long)vsprintf(buf,"%s",args) > 10L);
}
+int main() { xxx("foo"); }
+
+#endif
+
EOF
set try
- if eval $compile && $run ./try; then
- echo "Your vsprintf() returns (int)." >&4
- val2="$undef"
+ if eval $compile_ok; then
+ if $run ./try; then
+ echo "Your vsprintf() returns (int)." >&4
+ val2="$undef"
+ else
+ echo "Your vsprintf() returns (char*)." >&4
+ val2="$define"
+ fi
else
- echo "Your vsprintf() returns (char*)." >&4
- val2="$define"
+ echo 'I am unable to compile the vsprintf() test program.' >&4
+ # We shouldn't get here. If we do, assume the standard signature,
+ # not the old BSD one.
+ echo 'Guessing that vsprintf() returns (int).' >&4
+ val2="$undef"
fi
else
echo 'vprintf() NOT found.' >&4
- val="$undef"
- val2="$undef"
+ val="$undef"
+ val2="$undef"
fi
$rm_try
set d_vprintf
set nl_langinfo d_nl_langinfo
eval $inlibc
-: check for length of character
-echo " "
-case "$charsize" in
-'')
- echo "Checking to see how big your characters are (hey, you never know)..." >&4
- $cat >try.c <<EOCP
-#include <stdio.h>
-#$i_stdlib I_STDLIB
-#ifdef I_STDLIB
-#include <stdlib.h>
-#endif
-int main()
-{
- printf("%d\n", (int)sizeof(char));
- exit(0);
-}
-EOCP
- set try
- if eval $compile_ok; then
- dflt=`$run ./try`
- else
- dflt='1'
- echo "(I can't seem to compile the test program. Guessing...)"
- fi
- ;;
-*)
- dflt="$charsize"
- ;;
-esac
-rp="What is the size of a character (in bytes)?"
-. ./myread
-charsize="$ans"
-$rm_try
-
: check for volatile keyword
echo " "
echo 'Checking to see if your C compiler knows about "volatile"...' >&4
}
EOCP
-case "$i8type" in
-'') case "$charsize" in
- 1) i8type=char
- u8type="unsigned char"
- i8size=$charsize
- u8size=$charsize
- ;;
- esac
- ;;
-esac
-case "$i8type" in
-'') set try -DINT8
- if eval $compile; then
- case "`$run ./try`" in
- int8_t) i8type=int8_t
- u8type=uint8_t
- i8size=1
- u8size=1
- ;;
- esac
- fi
- ;;
-esac
-case "$i8type" in
-'') if $test $charsize -ge 1; then
- i8type=char
- u8type="unsigned char"
- i8size=$charsize
- u8size=$charsize
- fi
- ;;
-esac
+i8type="signed char"
+u8type="unsigned char"
+i8size=1
+u8size=1
case "$i16type" in
'') case "$shortsize" in
INLINE_INTRINSICS INTRINSICS INT64 interdata is68k ksr1
LANGUAGE_C LARGE_FILE_API LARGEFILE64_SOURCE
LARGEFILE_SOURCE LFS64_LARGEFILE LFS_LARGEFILE
-Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
+LIBCATAMOUNT Linux LITTLE_ENDIAN LONG64 LONG_DOUBLE LONG_LONG
LONGDOUBLE LONGLONG LP64 luna luna88k Lynx
M68000 m68k m88100 m88k M88KBCS_TARGET M_COFF
M_I186 M_I286 M_I386 M_I8086 M_I86 M_I86SM M_SYS3
pc532 pdp11 PGC PIC plexus PORTAR posix
POSIX1B_SOURCE POSIX2_SOURCE POSIX4_SOURCE
POSIX_C_SOURCE POSIX_SOURCE POWER
-PROTOTYPES PWB pyr QNX R3000 REENTRANT RES Rhapsody RISC6000
+PROTOTYPES PWB pyr QNX QK_USER R3000 REENTRANT RES Rhapsody RISC6000
riscix riscos RT S390 SA110 scs SCO sequent sgi SGI_SOURCE SH3 sinix
SIZE_INT SIZE_LONG SIZE_PTR SOCKET_SOURCE SOCKETS_SOURCE
sony sony_news sonyrisc sparc sparclite spectrum
set stddef.h i_stddef
eval $inhdr
+: see if assert.h is available
+set assert.h i_assert
+eval $inhdr
+
: see if sys/access.h is available
set sys/access.h i_sysaccess
eval $inhdr
set X
shift
eval $find_extensions
-# Special case: Add in threads/shared since it is not picked up by the
-# recursive find above (and adding in general recursive finding breaks
-# SDBM_File/sdbm). A.D. 10/25/2001.
-known_extensions="$known_extensions threads/shared"
+# Special case: Add in modules that nest beyond the first level.
+# Currently threads/shared and Hash/Util/FieldHash, since they are
+# not picked up by the recursive find above (and adding in general
+# recursive finding breaks SDBM_File/sdbm).
+# A.D. 20011025 (SDBM), ajgough 20071008 (FieldHash)
+known_extensions="$known_extensions threads/shared Hash/Util/FieldHash"
set X $known_extensions
shift
known_extensions="$*"
cf_by='$cf_by'
cf_email='$cf_email'
cf_time='$cf_time'
-charsize='$charsize'
chgrp='$chgrp'
chmod='$chmod'
chown='$chown'
i8size='$i8size'
i8type='$i8type'
i_arpainet='$i_arpainet'
+i_assert='$i_assert'
i_bsdioctl='$i_bsdioctl'
i_crypt='$i_crypt'
i_db='$i_db'