This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
applied patch, moved #define mkfifo ... from perl.h to POSIX.xs
[perl5.git] / Configure
index 38072f0..ffd7e08 100755 (executable)
--- a/Configure
+++ b/Configure
@@ -20,7 +20,7 @@
 
 # $Id: Head.U,v 3.0.1.9 1997/02/28 15:02:09 ram Exp $
 #
-# Generated on Thu May 28 12:01:39 EDT 1998 [metaconfig 3.0 PL70]
+# Generated on Tue Jun  9 14:56:54 EDT 1998 [metaconfig 3.0 PL70]
 
 cat >/tmp/c1$$ <<EOF
 ARGGGHHHH!!!!!
@@ -140,13 +140,14 @@ esac
 
 : Configure runs within the UU subdirectory
 test -d UU || mkdir UU
-CDPATH=''
+CDPATH='.'
 cd UU && rm -f ./*
 
 dynamic_ext=''
 extensions=''
 known_extensions=''
 static_ext=''
+nonxs_ext=''
 useopcode=''
 useposix=''
 d_bsd=''
@@ -375,7 +376,7 @@ d_memmove=''
 d_memset=''
 d_mkdir=''
 d_mkfifo=''
-d_mkstemp=''
+d_mknod=''
 d_mktime=''
 d_msg=''
 d_msgctl=''
@@ -589,6 +590,7 @@ plibpth=''
 xlibpth=''
 libs=''
 lns=''
+devtype=''
 lseektype=''
 make_set_make=''
 d_mymalloc=''
@@ -921,6 +923,23 @@ else
 fi
 rm -f try
 
+
+: Save command line options in file UU/cmdline.opt for later use in
+: generating config.sh.
+cat > cmdline.opt <<EOSH
+# Configure command line arguments.
+config_arg0='$0'
+config_args='$*'
+config_argc=$#
+EOSH
+argn=1
+for arg in "$@"; do
+       cat >>cmdline.opt <<EOSH
+config_arg$argn='$arg'
+EOSH
+       argn=`expr $argn + 1`
+done
+
 : produce awk script to parse command line options
 cat >options.awk <<'EOF'
 BEGIN {
@@ -4024,15 +4043,19 @@ $cc $optimize $ccflags $ldflags -o ${mc_file} $* ${mc_file}.c $libs;'
 echo " "
 echo "Checking for GNU C Library..." >&4
 cat >gnulibc.c <<EOM
+#include <stdio.h>
 int
 main()
 {
-       return __libc_main();
+#ifdef __GLIBC__
+    exit(0);
+#else
+    exit(1);
+#endif
 }
 EOM
 set gnulibc
-if eval $compile && \
-  ./gnulibc | $contains '^GNU C Library'; then
+if eval $compile_ok && ./gnulibc; then
        val="$define"
        echo "You are using the GNU C Library"
 else
@@ -6196,10 +6219,14 @@ main()
        $xxx i32;
        double f, g;
        int result = 0;
+       char str[16];
        signal(SIGFPE, blech);
 
-       /* Don't let compiler optimize the test away */
-       sscanf("2147483647", "%lf", &f); /* f = (double) 0x7fffffff; */
+       /* Don't let compiler optimize the test away.  Store the number 
+          in a writable string for gcc to pass to sscanf under HP/UX.
+       */
+       sprintf(str, "2147483647");
+       sscanf(str, "%lf", &f); /* f = (double) 0x7fffffff; */
        g = 10 * f;
        i32  = ($xxx) g;
 
@@ -6252,11 +6279,17 @@ main()
        unsigned int aint;
        unsigned short ashort;
        int result = 0;
+       char str[16];
+       
        /* Frustrate gcc-2.7.2's optimizer which failed this test with
           a direct f = -123. assignment.  gcc-2.8.0 reportedly
           optimized the whole file away
        */
-       sscanf("-123.", "%lf", &f);  /* f = -123.; */
+       /* Store the number in a writable string for gcc to pass to 
+          sscanf under HP/UX.
+       */
+       sprintf(str, "-123");
+       sscanf(str, "%lf", &f);  /* f = -123.; */
 
        signal(SIGFPE, blech);
        along = (unsigned long)f;
@@ -6268,7 +6301,8 @@ main()
                result |= 1;
        if (ashort != (unsigned short)-123)
                result |= 1;
-       sscanf("1073741824.", "%lf", &f); /* f = (double)0x40000000; */
+       sprintf(str, "1073741824.");
+       sscanf(str, "%lf", &f); /* f = (double)0x40000000; */
        f = f + f;
        along = 0;
        along = (unsigned long)f;
@@ -6287,7 +6321,8 @@ main()
        if (result)
                exit(result);
        signal(SIGFPE, blech_in_list);
-       sscanf("123.", "%lf", &f);  /* f = 123.; */
+       sprintf(str, "123.");
+       sscanf(str, "%lf", &f);  /* f = 123.; */
        along = dummy_long((unsigned long)f);
        aint = dummy_int((unsigned int)f);
        ashort = dummy_short((unsigned short)f);
@@ -7364,8 +7399,8 @@ eval $inlibc
 set mkfifo d_mkfifo
 eval $inlibc
 
-: see if mkstemp exists
-set mkstemp d_mkstemp
+: see if mknod exists
+set mknod d_mknod
 eval $inlibc
 
 : see if mktime exists
@@ -9445,6 +9480,11 @@ EOM
 *)  groupstype="$gidtype";;
 esac
 
+: see what type is used for devices
+rp="What is the type used for device numbers on this system?"
+set dev_t devtype long stdio.h sys/types.h
+eval $typedef_ask
+
 : see what type lseek is declared as in the kernel
 rp="What is the type used for lseek's offset on this system?"
 set off_t lseektype long stdio.h sys/types.h
@@ -10839,6 +10879,7 @@ cd $rsrc/ext
 : If we are using the old config.sh, known_extensions may contain
 : old or inaccurate or duplicate values.
 known_extensions=''
+nonxs_extensions=''
 : We do not use find because it might not be available.
 : We do not just use MANIFEST because the user may have dropped
 : some additional extensions into the source tree and expect them
@@ -10851,17 +10892,27 @@ for xxx in * ; do
                else
                        if $test -d $xxx; then
                                cd $xxx
+                               zzz=$known_extensions
                                for yyy in * ; do
                                if $test -f $yyy/$yyy.xs; then
                                        known_extensions="$known_extensions $xxx/$yyy"
                                fi
                                done
                                cd ..
+                               if $test "$zzz" = "$known_extensions"; then
+                                       if $test -f $xxx/Makefile.PL; then
+                                               known_extensions="$known_extensions $xxx"
+                                               nonxs_extensions="$nonxs_extensions $xxx"
+                                       fi
+                               fi
                        fi
                fi 
                ;;
        esac
 done
+set X $nonxs_extensions
+shift
+nonxs_extensions="$*"
 set X $known_extensions
 shift
 known_extensions="$*"
@@ -10911,7 +10962,11 @@ for xxx in $known_extensions ; do
                true|$define|y) avail_ext="$avail_ext $xxx" ;;
                esac
                ;;
-       *)      avail_ext="$avail_ext $xxx"
+       *)
+               case " $nonxs_extensions " in
+               *" $xxx "*) ;;
+               *) avail_ext="$avail_ext $xxx" ;;
+               esac
                ;;
        esac
 done
@@ -10920,6 +10975,19 @@ set X $avail_ext
 shift
 avail_ext="$*"
 
+: Now see which nonxs extensions are supported on this system.
+nonxs_ext=''
+for xxx in $nonxs_extensions ; do
+       case "$xxx" in
+       *)      nonxs_ext="$nonxs_ext $xxx"
+               ;;
+       esac
+done
+
+set X $nonxs_ext
+shift
+nonxs_ext="$*"
+
 case $usedl in
 $define)
        $cat <<EOM
@@ -10950,6 +11018,7 @@ EOM
                esac
                ;;
        esac
+       : Exclude those that are not xs extensions
        case "$dflt" in
        '')     dflt=none;;
        esac
@@ -10965,7 +11034,7 @@ EOM
                : Exclude those already listed in dynamic linking
                dflt=''
                for xxx in $avail_ext; do
-                       case " $dynamic_ext " in
+                       case " $dynamic_ext $nonxs_ext " in
                        *" $xxx "*) ;;
                        *) dflt="$dflt $xxx" ;;
                        esac
@@ -11254,7 +11323,7 @@ d_memmove='$d_memmove'
 d_memset='$d_memset'
 d_mkdir='$d_mkdir'
 d_mkfifo='$d_mkfifo'
-d_mkstemp='$d_mkstemp'
+d_mknod='$d_mknod'
 d_mktime='$d_mktime'
 d_msg='$d_msg'
 d_msgctl='$d_msgctl'
@@ -11376,6 +11445,7 @@ date='$date'
 db_hashtype='$db_hashtype'
 db_prefixtype='$db_prefixtype'
 defvoidused='$defvoidused'
+devtype='$devtype'
 direntrytype='$direntrytype'
 dlext='$dlext'
 dlsrc='$dlsrc'
@@ -11547,6 +11617,7 @@ path_sep='$path_sep'
 perl='$perl'
 perladmin='$perladmin'
 perlpath='$perlpath'
+nonxs_ext='$nonxs_ext'
 pg='$pg'
 phostname='$phostname'
 pidtype='$pidtype'
@@ -11643,6 +11714,9 @@ zcat='$zcat'
 zip='$zip'
 EOT
 
+: Add in command line options if available
+$test -f UU/cmdline.opt && $cat UU/cmdline.opt >> config.sh
+
 : add special variables
 $test -f $src/patchlevel.h && \
 awk '/^#define/ {printf "%s=%s\n",$2,$3}' $src/patchlevel.h >>config.sh