$NetBSD: patch-Configure,v 1.18 2025/07/04 08:58:56 wiz Exp $ * Use "uname -r" to get OS version for *BSD. * Move $loclibpth to the end of $dlist, instead of the beginning. * Honor more ldflags in shared objects. * Add Minix * Several other changes. * Add rpath for QNX --- Configure.orig 2025-03-30 10:35:38.000000000 +0000 +++ Configure @@ -3525,7 +3525,8 @@ EOM osvers=`echo "$4"|sed 's/^v//'` ;; freebsd) osname=freebsd - osvers="$3" ;; + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` + ;; genix) osname=genix ;; gnu) osname=gnu osvers="$3" ;; @@ -3547,11 +3548,11 @@ EOM ;; MiNT) osname=mint ;; - minix) osname=minix + minix*) osname=minix osvers=`$uname -r` ;; netbsd*) osname=netbsd - osvers="$3" + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` ;; news-os) osvers="$3" case "$3" in @@ -3561,7 +3562,7 @@ EOM ;; nonstop-ux) osname=nonstopux ;; openbsd) osname=openbsd - osvers="$3" + osvers=`$uname -r | UU/tr '[A-Z]' '[a-z]'` ;; os2) osname=os2 osvers="$4" @@ -3576,6 +3577,9 @@ EOM qnx) osname=qnx osvers="$4" ;; + sco_sv) osname=sco_sv + osvers=`$uname -r`v`$uname -v` + ;; solaris) osname=solaris case "$3" in 5*) osvers=`echo $3 | $sed 's/^5/2/g'` ;; @@ -4953,7 +4957,7 @@ esac # If using gcc or clang, we can get better values for libpth, incpth # and usrinc directly from the compiler. # Note that ccname for clang is also gcc. -case "$ccname" in +case "xx$ccname" in gcc) realpath=`which realpath 2>/dev/null | sed 's/no realpath in.*//'` $echo 'extern int foo;' > try.c @@ -5037,14 +5041,14 @@ case "$plibpth" in esac case "$libpth" in ' ') dlist='';; -'') dlist="$loclibpth $plibpth $glibpth";; +'') dlist="$plibpth $glibpth $loclibpth";; *) dlist="$libpth";; esac : Now check and see which directories actually exist, avoiding duplicates for xxx in $dlist do - if $test -d $xxx; then + if $test -d $xxx -o "$xxx" = "$prefix/lib"; then case " $libpth " in *" $xxx "*) ;; *) libpth="$libpth $xxx";; @@ -5160,7 +5164,7 @@ lib_ext=$_a obj_ext=$_o path_sep=$p_ -rm_try="$rm -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" +rm_try="@TOOLS_RM@ -f try try$_exe a.out .out try.[cho] try.$_o core core.try* try.core*" : Which makefile gets called first. This is used by make depend. case "$firstmakefile" in @@ -5480,7 +5484,7 @@ default|recommended) *-fno-stack-protector*) echo "Do not add -fstack-protector nor -fstack-protector-strong" 2>&1 ;; - *) case "$gccversion" in + nothing) case "$gccversion" in ?*) set stack-protector-strong -fstack-protector-strong eval $checkccflag case "$dflt" in @@ -6464,6 +6468,15 @@ case "$nm_so_opt" in ;; esac +: Mac OS X 10.7 is different +case "$osname" in + darwin) + case "$osvers" in + 11.*) + libnames="$libnames /usr/lib/system/libsystem_*.dylib" + esac +esac + : Figure out where the libc is located case "$runnm" in true) @@ -7665,7 +7678,9 @@ rp='Pathname for the site-specific libra . ./getfile prefixvar=sitelib . ./setprefixvar -sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` +if $test -z "$sitelib_stem"; then + sitelib_stem=`echo "$sitelibexp" | sed "s,/$version$,,"` +fi : Determine list of previous versions to include in @INC $cat > getverlist <cpp_stuff.out 2>&1 -if $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then +# yuck, what a hack. +# MIPSPro compiler/preprocessor behaves differently if invoked on +# stdin vs file. Here we test for stdin, but lateron we use files. +# So force it to work the way we know it does: +if [ x"${OPSYS}" = x"IRIX" ]; then + echo "Hacking MIPSPro on file vs. stdin..." >&4 + echo "We know we can catify or stringify, separately or together!" + cpp_stuff=42 +elif $contains 'Circus' cpp_stuff.out >/dev/null 2>&1; then echo "Oh! Smells like ANSI's been here." >&4 echo "We can catify or stringify, separately or together!" cpp_stuff=42