summaryrefslogtreecommitdiff
path: root/Configure
diff options
context:
space:
mode:
authorH.Merijn Brand <perl5@tux.freedom.nl>2020-08-22 16:12:58 +0200
committerH.Merijn Brand <perl5@tux.freedom.nl>2020-08-22 17:11:54 +0200
commit34050ace1c1445f04d7c1a95d3c2a4961eb1c547 (patch)
treed1280bafaf1ac28dacbd4e61dbb3de0494b713e9 /Configure
parent2e8a5b7670884e12a43041522bfe7cc4d36a033c (diff)
downloadperl-34050ace1c1445f04d7c1a95d3c2a4961eb1c547.tar.gz
Merge Configure changes for z/OS and AIX
Thank you Karl!
Diffstat (limited to 'Configure')
-rwxr-xr-xConfigure307
1 files changed, 188 insertions, 119 deletions
diff --git a/Configure b/Configure
index 23364b41e8..15549ed7a7 100755
--- a/Configure
+++ b/Configure
@@ -365,6 +365,7 @@ cf_by=''
cf_time=''
charbits=''
charsize=''
+compiler_warning=''
contains=''
cpp_stuff=''
cpplast=''
@@ -1921,12 +1922,13 @@ rm -f grimble
: the following should work in any shell
case "$contains" in
contains*)
- echo " "
- echo "AGH! Grep doesn't return a status. Attempting remedial action."
+ echo " " >&4
+ echo "AGH! Grep doesn't return a status. Attempting remedial action." >&4
cat >contains <<'EOSS'
grep "$1" "$2" >.greptmp && cat .greptmp && test -s .greptmp
EOSS
-chmod +x contains
+contains=./contains
+chmod +x $contains
esac
: Find the path to the source tree
@@ -4334,59 +4336,6 @@ $undef$define) . ./whoa; eval "$var=\$tu";;
*) eval "$var=$val";;
esac'
-: get the patchlevel
-echo " "
-echo "Getting the current patchlevel..." >&4
-if $test -r $rsrc/patchlevel.h;then
- revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
- patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
- subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
- 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 ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
-else
- revision=0
- patchlevel=0
- subversion=0
- api_revision=0
- api_version=0
- api_subversion=0
- perl_patchlevel=0
- $echo "(You do not have patchlevel.h. Eek.)"
-fi
-: Define a handy string here to avoid duplication in myconfig.SH and configpm.
-version_patchlevel_string="version $patchlevel subversion $subversion"
-case "$perl_patchlevel" in
-0|'') ;;
-*) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
- version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
- ;;
-esac
-
-$echo "(You have $package $version_patchlevel_string.)"
-
-case "$osname" in
-dos|vms)
- : XXX Should be a Configure test for double-dots in filenames.
- version=`echo $revision $patchlevel $subversion | \
- $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
- api_versionstring=`echo $api_revision $api_version $api_subversion | \
- $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
- ;;
-*)
- version=`echo $revision $patchlevel $subversion | \
- $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
- api_versionstring=`echo $api_revision $api_version $api_subversion | \
- $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
- ;;
-esac
-: Special case the 5.005_xx maintenance series, which used 5.005
-: without any subversion label as a subdirectory in $sitelib
-if test "${api_revision}${api_version}${api_subversion}" = "550"; then
- api_versionstring='5.005'
-fi
-
: Do we want threads support and if so, what type
case "$usethreads" in
$define|true|[yY]*) dflt='y';;
@@ -6841,16 +6790,16 @@ esac
$rm_try
: check for long doubles
-echo " "
+echo " " >&4
echo "Checking to see if you have long double..." >&4
echo 'int main() { long double x = 7.0; }' > try.c
set try
if eval $compile; then
val="$define"
- echo "You have long double."
+ echo "You have long double." >&4
else
val="$undef"
- echo "You do not have long double."
+ echo "You do not have long double." >&4
fi
$rm_try
set d_longdbl
@@ -6863,7 +6812,7 @@ eval $inlibc
: check for length of long double
case "${d_longdbl}${longdblsize}" in
$define)
- echo " "
+ echo " " >&4
echo "Checking to see how big your long doubles are..." >&4
$cat >try.c <<'EOCP'
#include <stdio.h>
@@ -6876,19 +6825,19 @@ EOCP
set try
if eval $compile; then
longdblsize=`$run ./try`
- echo "Your long doubles are $longdblsize bytes long."
+ echo "Your long doubles are $longdblsize bytes long." >&4
else
dflt='8'
- echo " "
+ echo " " >&4
echo "(I can't seem to compile the test program. Guessing...)" >&4
rp="What is the size of a long double (in bytes)?"
. ./myread
longdblsize="$ans"
fi
if $test "X$doublesize" = "X$longdblsize"; then
- echo "That isn't any different from an ordinary double."
- echo "I'll keep your setting anyway, but you may see some"
- echo "harmless compilation warnings."
+ echo "That isn't any different from an ordinary double." >&4
+ echo "I'll keep your setting anyway, but you may see some" >&4
+ echo "harmless compilation warnings." >&4
fi
;;
esac
@@ -7011,13 +6960,13 @@ case "$longdblkind" in
0) echo "Your long doubles are doubles." >&4 ;;
1) echo "You have IEEE 754 128-bit little endian long doubles." >&4 ;;
2) echo "You have IEEE 754 128-bit big endian long doubles." >&4 ;;
-3) echo "You have x86 80-bit little endian long doubles." >& 4 ;;
-4) echo "You have x86 80-bit big endian long doubles." >& 4 ;;
-5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >& 4 ;;
-6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >& 4 ;;
-7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >& 4 ;;
-8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >& 4 ;;
-9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >& 4 ;;
+3) echo "You have x86 80-bit little endian long doubles." >&4 ;;
+4) echo "You have x86 80-bit big endian long doubles." >&4 ;;
+5) echo "You have 128-bit fully little-endian double-double long doubles (64-bit LEs in LE)." >&4 ;;
+6) echo "You have 128-bit fully big-endian double-double long doubles (64-bit BEs in BE)." >&4 ;;
+7) echo "You have 128-bit mixed-endian double-double long doubles (64-bit LEs in BE)." >&4 ;;
+8) echo "You have 128-bit mixed-endian double-double long doubles (64-bit BEs in LE)." >&4 ;;
+9) echo "You have 128-bit PDP-style mixed-endian long doubles (VAX format H)." >&4 ;;
*) echo "Cannot figure out your long double." >&4 ;;
esac
d_long_double_style_ieee=$undef
@@ -7042,6 +6991,59 @@ case "$longdblkind" in
esac
$rm_try
+: get the patchlevel
+echo " "
+echo "Getting the current patchlevel..." >&4
+if $test -r $rsrc/patchlevel.h;then
+ revision=`awk '/define[ ]+PERL_REVISION/ {print $3}' $rsrc/patchlevel.h`
+ patchlevel=`awk '/define[ ]+PERL_VERSION/ {print $3}' $rsrc/patchlevel.h`
+ subversion=`awk '/define[ ]+PERL_SUBVERSION/ {print $3}' $rsrc/patchlevel.h`
+ 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 ',"(MAINT|SMOKE)[0-9][0-9]*"' $rsrc/patchlevel.h|tail -1|sed 's/[^0-9]//g'`
+else
+ revision=0
+ patchlevel=0
+ subversion=0
+ api_revision=0
+ api_version=0
+ api_subversion=0
+ perl_patchlevel=0
+ $echo "(You do not have patchlevel.h. Eek.)"
+fi
+: Define a handy string here to avoid duplication in myconfig.SH and configpm.
+version_patchlevel_string="version $patchlevel subversion $subversion"
+case "$perl_patchlevel" in
+0|'') ;;
+*) perl_patchlevel=`echo $perl_patchlevel | sed 's/.* //'`
+ version_patchlevel_string="$version_patchlevel_string patch $perl_patchlevel"
+ ;;
+esac
+
+$echo "(You have $package $version_patchlevel_string.)"
+
+case "$osname" in
+dos|vms)
+ : XXX Should be a Configure test for double-dots in filenames.
+ version=`echo $revision $patchlevel $subversion | \
+ $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
+ api_versionstring=`echo $api_revision $api_version $api_subversion | \
+ $awk '{ printf "%d_%d_%d", $1, $2, $3 }'`
+ ;;
+*)
+ version=`echo $revision $patchlevel $subversion | \
+ $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
+ api_versionstring=`echo $api_revision $api_version $api_subversion | \
+ $awk '{ printf "%d.%d.%d", $1, $2, $3 }'`
+ ;;
+esac
+: Special case the 5.005_xx maintenance series, which used 5.005
+: without any subversion label as a subdirectory in $sitelib
+if test "${api_revision}${api_version}${api_subversion}" = "550"; then
+ api_versionstring='5.005'
+fi
+
: determine the architecture name
echo " "
if xxx=`./loc arch blurfl $pth`; $test -f "$xxx"; then
@@ -10912,6 +10914,26 @@ eval $inlibc
set atoll d_atoll
eval $inlibc
+: See if a file contains compiler warnings
+: See if a file contains compiler warnings
+case "$osname" in
+ 'aix')
+ cat >compiler_warning <<EOSS
+# Sample for aix ('.5' indicates the column number in the line):
+# "op.h", line 203.5: 1506-159 (E) Bit field type specified for op_type
+# Since the word 'warning' isn't present, use a fairly rigorous match of what
+# warning messages look like
+# " o p . h ", line 203 . 5 : 1506 - 159 ( E )
+$grep -E "^\\"[A-Za-z][A-Za-z0-9_]*\.[ch]\\", line [1-9][0-9]*[.][1-9][0-9]*: [1-9][0-9]*-[1-9][0-9]* \([EW][)] " "\$1"
+EOSS
+ compiler_warning=./compiler_warning
+ chmod +x $compiler_warning
+ ;;
+ # Maybe a colon after the 'warning' would be appropriate
+ *) compiler_warning="$contains -i warning"
+ ;;
+esac
+
: Look for GCC-style attribute format
case "$d_attribute_format" in
'')
@@ -10922,7 +10944,7 @@ $cat >attrib.c <<'EOCP'
void my_special_printf(char* pat,...) __attribute__((__format__(__printf__,1,2)));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((format))."
val="$undef"
else
@@ -10966,7 +10988,7 @@ EOCP
if $cc $ccflags -o attrib attrib.c >attrib.out 2>&1 ; then
: run the executable in case it produces a run-time warning
if $run ./attrib >>attrib.out 2>&1; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't allow __printf__ format to be null."
val="$undef"
else
@@ -11001,7 +11023,7 @@ $cat >attrib.c <<'EOCP'
char *go_get_some_memory( int how_many_bytes ) __attribute__((malloc));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((malloc))."
val="$undef"
else
@@ -11029,7 +11051,7 @@ $cat >attrib.c <<'EOCP'
void do_something (char *some_pointer,...) __attribute__((nonnull(1)));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((nonnull))."
val="$undef"
else
@@ -11057,7 +11079,7 @@ $cat >attrib.c <<'EOCP'
void fall_over_dead( void ) __attribute__((noreturn));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((noreturn))."
val="$undef"
else
@@ -11085,7 +11107,7 @@ $cat >attrib.c <<'EOCP'
int square( int n ) __attribute__((pure));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((pure))."
val="$undef"
else
@@ -11113,7 +11135,7 @@ $cat >attrib.c <<'EOCP'
int do_something( int dummy __attribute__((unused)), int n );
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((unused))."
val="$undef"
else
@@ -11141,7 +11163,7 @@ $cat >attrib.c <<'EOCP'
int I_am_deprecated(void) __attribute__((deprecated));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((deprecated))."
val="$undef"
else
@@ -11169,7 +11191,7 @@ $cat >attrib.c <<'EOCP'
int I_will_not_be_ignored(void) __attribute__((warn_unused_result));
EOCP
if $cc $ccflags -c attrib.c >attrib.out 2>&1 ; then
- if $contains 'warning' attrib.out >/dev/null 2>&1; then
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((warn_unused_result))."
val="$undef"
else
@@ -11197,7 +11219,7 @@ $cat >attrib.c <<'EOCP'
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
+ if $compiler_warning attrib.out >/dev/null 2>&1; then
echo "Your C compiler doesn't support __attribute__((always_inline))."
val="$undef"
else
@@ -17788,7 +17810,9 @@ set towupper d_towupper
eval $inlibc
: check for setlocale function and behavior
-$cat <<EOM
+case "$d_setlocale" in
+'')
+$cat >&4 <<EOM
Checking to see if you have setlocale() and its behavior
EOM
@@ -17918,44 +17942,88 @@ int main() {
}
EOCP
-set try
-if eval $compile; then
- echo "Your system has setlocale()..." >&4
- $run ./try
- case $? in
- 0) echo "and it seems sane" >&4
- d_setlocale="$define"
- d_setlocale_accepts_any_locale_name="$undef"
- d_has_C_UTF8="false"
- ;;
- 1) echo "and it seems sane, but accepts any locale name as valid" >&4
- d_setlocale="$define"
- d_setlocale_accepts_any_locale_name="$define"
- d_has_C_UTF8="false"
- ;;
- 2) echo "and it seems sane" >&4
- d_setlocale="$define"
- d_setlocale_accepts_any_locale_name="$undef"
- d_has_C_UTF8="true"
- ;;
- 3) echo "and it seems sane, but accepts any locale name as valid" >&4
- d_setlocale="$define"
- d_setlocale_accepts_any_locale_name="$define"
- d_has_C_UTF8="true"
- ;;
- *) echo "but it doesn't seem to work, so we won't use it." >&4
+val=
+set d_setlocale
+eval $setvar
+case $d_setlocale in
+ $undef) d_setlocale_accepts_any_locale_name="$undef"
+ d_has_C_UTF8="false"
+ ;;
+ *) set try
+ if eval $compile; then
+ echo "Your system has setlocale()..." >&4
+ $run ./try
+ case $? in
+ 0) echo "and it seems sane; you don't have a C.UTF8 locale" >&4
+ d_setlocale="$define"
+ d_setlocale_accepts_any_locale_name="$undef"
+ d_has_C_UTF8="false"
+ ;;
+ 1) echo "and it seems sane, but accepts any locale name as valid" >&4
+ d_setlocale="$define"
+ d_setlocale_accepts_any_locale_name="$define"
+ d_has_C_UTF8="false"
+ ;;
+ 2) echo "and it seems sane; you have a C.UTF8 locale" >&4
+ d_setlocale="$define"
+ d_setlocale_accepts_any_locale_name="$undef"
+ d_has_C_UTF8="true"
+ ;;
+ 3) echo "and it seems sane, but accepts any locale name as valid" >&4
+ d_setlocale="$define"
+ d_setlocale_accepts_any_locale_name="$define"
+ d_has_C_UTF8="true"
+ ;;
+ *) echo "but it doesn't seem to work, so we won't use it." >&4
+ d_setlocale="$undef"
+ d_setlocale_accepts_any_locale_name="$undef"
+ d_has_C_UTF8="false"
+ ;;
+ esac
+ else
+ echo "your system does not have setlocale()" >&4
d_setlocale="$undef"
d_setlocale_accepts_any_locale_name="$undef"
d_has_C_UTF8="false"
- ;;
- esac
-else
- echo "your system does not have setlocale()" >&4
- d_setlocale="$undef"
- d_setlocale_accepts_any_locale_name="$undef"
- d_has_C_UTF8="false"
-fi
+ fi
+esac
$rm_try
+;;
+*) val="$d_setlocale"
+ set d_setlocale
+ eval $setvar
+ case "$d_setlocale" in
+ $undef) echo "There may be other ways to set the locale on your system, so we need to ask:" >&4
+ ;;
+ esac
+ rp="Does your system have the C.UTF8 locale?"
+ dflt=n
+ . ./myread
+ case "$ans" in
+ [Yy]*) d_has_C_UTF8="true"
+ c_utf8_locale=" or C.UTF8"
+ ;;
+ *) d_has_C_UTF8="false"
+ c_utf8_locale=""
+ ;;
+ esac
+ case "$d_setlocale" in
+ $define)
+ rp="When you set your locale to something besides C$c_utf8_locale, does it do so, or just pretend to?" >&4
+ dflt=n
+ . ./myread
+ case "$ans" in
+ true|[Yy]*)
+ d_setlocale_accepts_any_locale_name="$undef"
+ ;;
+ *) d_setlocale_accepts_any_locale_name="$define"
+ ;;
+ esac
+ ;;
+ *) d_setlocale_accepts_any_locale_name="$undef"
+ ;;
+ esac
+esac
: see if setlocale_r exists
set setlocale_r d_setlocale_r
@@ -20182,7 +20250,7 @@ int main()
#endif
EOCP
if $cc $ccflags -c try.c >try.out 2>&1 ; then
- if $contains warning try.out >>/dev/null 2>&1 ; then
+ if $compiler_warning try.out >>/dev/null 2>&1 ; then
db_hashtype='int'
else
db_hashtype='u_int32_t'
@@ -20222,7 +20290,7 @@ int main()
#endif
EOCP
if $cc $ccflags -c try.c >try.out 2>&1 ; then
- if $contains warning try.out >>/dev/null 2>&1 ; then
+ if $compiler_warning try.out >>/dev/null 2>&1 ; then
db_prefixtype='int'
else
db_prefixtype='size_t'
@@ -23969,6 +24037,7 @@ chmod='$chmod'
chown='$chown'
clocktype='$clocktype'
comm='$comm'
+compiler_warning='$compiler_warning'
compress='$compress'
contains='$contains'
cp='$cp'