This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Thou shalt not printf longs with %d.
[perl5.git] / hints / solaris_2.sh
index 236db7d..a2a4087 100644 (file)
@@ -285,19 +285,6 @@ rm -f core
 # XXX
 EOSH
 
-# Damon.Atkins@nabaus.com.au 19-Mar-1999
-# Large Files Support
-if [ -x /usr/bin/getconf ] ; then
-    ccflags="$ccflags `/usr/bin/getconf LFS_CFLAGS`"
-    [ "X${ccflags}"    = "X " ]    && ccflags=''
-    ldflags="$ldflags `/usr/bin/getconf LFS_LDFLAGS`"
-    [ "X${ldflags}" = "X " ]       && ldflags=''
-    libswanted="$libswanted `/usr/bin/getconf LFS_LIBS`"
-    [ "X${libswanted}" = "X " ]    && libswanted=''
-    lintflags="$lintflags `/usr/bin/getconf LFS_LINTFLAGS`"
-    [ "X${lintflags}"  = "X " ]    && lintflags=''
-fi
-
 # This script UU/usethreads.cbu will get 'called-back' by Configure 
 # after it has prompted the user for whether to use threads.
 cat > UU/usethreads.cbu <<'EOCBU'
@@ -346,6 +333,34 @@ EOM
 esac
 EOCBU
 
+# This script UU/uselfs.cbu will get 'called-back' by Configure 
+# after it has prompted the user for whether to use large files.
+cat > UU/uselfs.cbu <<'EOCBU'
+case "$uselargefiles" in
+$define|true|[yY]*)
+       lfcflags="`getconf LFS_CFLAGS 2>/dev/null`"
+       lfldflags="`getconf LFS_LDFLAGS 2>/dev/null`"
+       lflibs="`getconf LFS_LIBS 2>/dev/null|sed -e 's@^-l@@' -e 's@ -l@ @g`"
+       case "$lfcflags$lfldflags$lflibs" in
+       '');;
+       *) use64bits="$define"
+           echo "(Large files in Solaris require also using long longs...)"
+          case "$ccflags" in
+          *-DUSE_64_BITS*) ;;
+          *) ccflags="$ccflags -DUSE_64_BITS" ;;
+          esac
+          ccflags="$ccflags $lfcflags"
+          ldflags="$ldflags $lfldflags"
+          libswanted="$libswanted $lflibs"
+          ;;
+       esac
+       lfcflags=''
+       lfldflags=''
+       lflibs=''
+       ;;
+esac
+EOCBU
+
 # This script UU/use64bits.cbu will get 'called-back' by Configure 
 # after it has prompted the user for whether to use 64 bits.
 cat > UU/use64bits.cbu <<'EOCBU'
@@ -360,9 +375,10 @@ EOM
                exit 1
                ;;
            esac
-           ccflags="$ccflags `getconf LFS_CFLAGS` -DUSE_LONG_LONG"
-           ldflags="$ldflags `getconf LFS_LDFLAGS`"
-           libswanted="$libswanted `getconf LFS_LIBS`"
+           case "$ccflags" in
+           *-DUSE_64_BITS*) ;;
+           *) ccflags="$ccflags -DUSE_64_BITS" ;;
+           esac
            # When a 64-bit cc becomes available $archname64
            # may need setting so that $archname gets it attached.
            ;;