This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Hurd should understand gnu
[metaconfig.git] / U / modified / Oldconfig.U
index ed37788..f020653 100644 (file)
@@ -58,6 +58,7 @@
 ?X: for the sake of setting defaults.
 ?X:
 ?MAKE:Oldconfig hint myuname osname osvers: Instruct Myread uname \
+       Checkcc Mksymlinks run \
        sh awk sed test cat rm lns tr n c contains Loc Options Tr src trnl ln
 ?MAKE: -pick wipe $@ %<
 ?S:myuname:
 ?C:    by Configure.  You shouldn't rely on it too much; the specific
 ?C:    feature tests from Configure are generally more reliable.
 ?C:.
+?C:OSVERS:
+?C:    This symbol contains the version of the operating system, as determined
+?C:    by Configure.  You shouldn't rely on it too much; the specific
+?C:    feature tests from Configure are generally more reliable.
+?C:.
 ?H:#define OSNAME "$osname"            /**/
+?H:#define OSVERS "$osvers"            /**/
 ?H:.
 ?F:!config.sh
 ?T:tmp tmp_n tmp_c tmp_sh file
 ?T:tans _ isesix INITPROG DJGPP
 ?D:osname=''
 ?LINT:change n c sh
+?LINT:extern targetarch
+?LINT:extern hostarch
+?LINT:change hostarch
+?LINT:use run
+?LINT:extern is_os2
 : Try to determine whether config.sh was made on this system
 case "$config_sh" in
 '')
@@ -105,7 +117,9 @@ case "$config_sh" in
 ?X: Leave a white space between first two '(' for ksh. The sub-shell is needed
 ?X: on some machines to avoid the error message when uname is not found; e.g.
 ?X: old SUN-OS 3.2 would not execute hostname in (uname -a || hostname). Sigh!
-myuname=`( ($uname -a) 2>/dev/null || hostname) 2>&1`
+?X: Now not using a subshell but instead $test.
+myuname=`$uname -a 2>/dev/null`
+$test -z "$myuname" && myuname=`hostname 2>/dev/null`
 ?X: Special mention for Xenix, whose 'uname -a' gives us output like this:
 ?X:  sysname=XENIX
 ?X:  nodename=whatever
@@ -145,7 +159,10 @@ if test -f config.sh; then
        rp="I see a config.sh file.  Shall I use it to set the defaults?"
        . UU/myread
        case "$ans" in
-       n*|N*) echo "OK, I'll ignore it."; mv config.sh config.sh.old;;
+       n*|N*) echo "OK, I'll ignore it."
+               mv config.sh config.sh.old
+               myuname="$newmyuname"
+               ;;
        *)  echo "Fetching default answers from your old config.sh file..." >&4
                tmp_n="$n"
                tmp_c="$c"
@@ -163,6 +180,7 @@ if test -f config.sh; then
                ;;
        esac
 fi
+. ./UU/checkcc
 if test ! -f config.sh; then
        $cat <<EOM
 
@@ -181,6 +199,7 @@ EOM
        $test -f /dnix && osname=dnix
        $test -f /lynx.os && osname=lynxos
        $test -f /unicos && osname=unicos && osvers=`$uname -r`
+       $test -f /unicosmk && osname=unicosmk && osvers=`$uname -r`
        $test -f /unicosmk.ar && osname=unicosmk && osvers=`$uname -r`
        $test -f /bin/mips && /bin/mips && osname=mips
        $test -d /NextApps && set X `hostinfo | grep 'NeXT Mach.*:' | \
@@ -188,6 +207,7 @@ EOM
        $test -d /usr/apollo/bin && osname=apollo
        $test -f /etc/saf/_sactab && osname=svr4
        $test -d /usr/include/minix && osname=minix
+       $test -f /system/gnu_library/bin/ar.pm && osname=vos
        if $test -d /MachTen -o -d /MachTen_Folder; then
 ?X:            MachTen uname -a output looks like
 ?X:            xxx 4 0.0 Macintosh
@@ -205,12 +225,14 @@ EOM
                        osvers="$2.$3"
                fi
        fi
-       $test -f /sys/posix.dll &&
-              $test -f /usr/bin/what &&
-              set X `/usr/bin/what /sys/posix.dll` &&
-              $test "$3" = UWIN &&
-              osname=uwin &&
-              osvers="$5"
+
+       $test -f /sys/posix.dll &&
+               $test -f /usr/bin/what &&
+               set X `/usr/bin/what /sys/posix.dll` &&
+               $test "$3" = UWIN &&
+               osname=uwin &&
+               osvers="$5"
+
 ?X: If we have uname, we already computed a suitable uname -a output, correctly
 ?X: formatted for Xenix, and it lies in $myuname.
        if $test -f $uname; then
@@ -279,6 +301,12 @@ EOM
                        *) osvers=$tmp;;
                        esac
                        ;;
+               bsd386) osname=bsd386
+                       osvers=`$uname -r`
+                       ;;
+               cygwin*) osname=cygwin
+                       osvers="$3"
+                       ;;
                *dc.osx) osname=dcosx
                        osvers="$3"
                        ;;
@@ -288,7 +316,7 @@ EOM
                domainos) osname=apollo
                        osvers="$3"
                        ;;
-               dgux) osname=dgux 
+               dgux)   osname=dgux 
                        osvers="$3"
                        ;;
 ?X:            uname -a returns
@@ -298,27 +326,29 @@ EOM
                        ;;
                freebsd) osname=freebsd 
                        osvers="$3" ;;
-               genix) osname=genix ;;
+               genix)  osname=genix ;;
+               gnu)    osname=gnu
+                       osvers="$3" ;;
 ?X: HP-UX uname -a gives something like
 ?X: HP-UX foobar B.10.20 A 9000/735 2016483812 two-user license
 ?X: Preserve the full 10.20 string instead of the previous plain '10'.
 ?X:  Thanks to Graham Barr.    --AD 6/30/1998
-               hp*) osname=hpux 
+               hp*)    osname=hpux 
                        osvers=`echo "$3" | $sed 's,.*\.\([0-9]*\.[0-9]*\),\1,'`
                        ;;
-               irix*) osname=irix
+               irix*)  osname=irix
                        case "$3" in
                        4*) osvers=4 ;;
                        5*) osvers=5 ;;
                        *)      osvers="$3" ;;
                        esac
                        ;;
-               linux) osname=linux
+               linux)  osname=linux
                        case "$3" in
                        *)      osvers="$3" ;;
                        esac
                        ;;
-               MiNT) osname=mint
+               MiNT)   osname=mint
                        ;;
                netbsd*) osname=netbsd
                        osvers="$3"
@@ -329,17 +359,24 @@ EOM
                        *) osname=newsos ;;
                        esac
                        ;;
-               bsd386) osname=bsd386
-                       osvers=`$uname -r`
+               next*) osname=next ;;
+               nonstop-ux) osname=nonstopux ;;
+               openbsd) osname=openbsd
+                       osvers="$3"
+                       ;;
+               os2)    osname=os2
+                       osvers="$4"
+                       ;;
+               POSIX-BC | posix-bc ) osname=posix-bc
+                       osvers="$3"
                        ;;
-                POSIX-BC | posix-bc ) osname=posix-bc
-                        osvers="$3"
-                        ;;
                powerux | power_ux | powermax_os | powermaxos | \
                powerunix | power_unix) osname=powerux
                        osvers="$3"
                        ;;
-               next*) osname=next ;;
+               qnx) osname=qnx
+                       osvers="$4"
+                       ;;
                solaris) osname=solaris
                        case "$3" in
                        5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;;
@@ -370,18 +407,26 @@ EOM
 ?X: DEC OSF/1 myuname -a output looks like:  osf1 xxxx t3.2 123.4 alpha
 ?X: where the version number can be something like [xvt]n.n
                                        osname=dec_osf
-                                       osvers=`echo "$3" | sed 's/^[xvt]//'`
+?X: sizer knows the minor minor version: the letter
+                                       osvers=`sizer -v | awk -FUNIX '{print $2}' | awk '{print $1}' |  tr '[A-Z]' '[a-z]' | sed 's/^[xvt]//'`
+                                       case "$osvers" in
+                                       [1-9].[0-9]*) ;;
+                                       *) osvers=`echo "$3" | sed 's/^[xvt]//'` ;;
+                                       esac
                                        ;;
                        hp*)    osname=hp_osf1  ;;
                        mips)   osname=mips_osf1 ;;
 ?X:    hp and mips were unsupported Technology Releases -- ADO, 24/10/94
                        esac
                        ;;
-               uts) osname=uts 
+               # UnixWare 7.1.2 is known as Open UNIX 8
+               openunix|unixware) osname=svr5
+                       osvers="$4"
+                       ;;
+               uts)    osname=uts
                        osvers="$3"
                        ;;
-               qnx) osname=qnx
-                       osvers="$4"
+               vos) osvers="$3"
                        ;;
                $2) case "$osname" in
                        *isc*) ;;
@@ -447,23 +492,31 @@ EOM
                        fi
                        $rm -f UU/kernel.what
 ?X: Maybe it's OS/2 or DOS or something similar
-               elif test -d c:/.; then
+               elif test -d c:/. -o -n "$is_os2" ; then
                        set X $myuname
                        osname=os2
                        osvers="$5"
                fi
        fi
        
+        case "$targetarch" in
+        '') ;;
+        *)  hostarch=$osname
+            osname=`echo $targetarch|sed 's,^[^-]*-,,'`
+            osvers=''
+            ;;
+        esac
+
        : Now look for a hint file osname_osvers, unless one has been
        : specified already.
        case "$hintfile" in
        ''|' ')
-               file=`echo "${osname}_${osvers}" | $sed -e 's@\.@_@g' -e 's@_$@@'`
+               file=`echo "${osname}_${osvers}" | $sed -e 's%\.%_%g' -e 's%_$%%'`
                : Also try without trailing minor version numbers.
-               xfile=`echo $file | $sed -e 's@_[^_]*$@@'`
-               xxfile=`echo $xfile | $sed -e 's@_[^_]*$@@'`
-               xxxfile=`echo $xxfile | $sed -e 's@_[^_]*$@@'`
-               xxxxfile=`echo $xxxfile | $sed -e 's@_[^_]*$@@'`
+               xfile=`echo $file | $sed -e 's%_[^_]*$%%'`
+               xxfile=`echo $xfile | $sed -e 's%_[^_]*$%%'`
+               xxxfile=`echo $xxfile | $sed -e 's%_[^_]*$%%'`
+               xxxxfile=`echo $xxxfile | $sed -e 's%_[^_]*$%%'`
                case "$file" in
                '') dflt=none ;;
                *)  case "$osvers" in
@@ -528,7 +581,7 @@ EOM
                elif $test -f $src/hints/$file.sh; then
                        . $src/hints/$file.sh
                        $cat $src/hints/$file.sh >> UU/config.sh
-               elif $test X$tans = X -o X$tans = Xnone ; then
+               elif $test X"$tans" = X -o X"$tans" = Xnone ; then
                        : nothing
                else
                        : Give one chance to correct a possible typo.
@@ -601,7 +654,6 @@ fi
        ;;
 esac
 test "$override" && . ./optdef.sh
-myuname="$newmyuname"
 
 : Restore computed paths
 for file in $loclist $trylist; do
@@ -661,3 +713,6 @@ none)  osvers='' ;;
 esac
 
 @end
+
+. ./posthint.sh
+