summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-09-23 21:34:15 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2003-09-23 21:34:15 +0000
commit6b75773822c0ec6a61861e79c0346152fb81ca4a (patch)
tree8d596df6969e58c32a31b4e438844d5935177bde
parenta1d64b115abe65e79c49e9ce69b44def625912c7 (diff)
downloadperl-6b75773822c0ec6a61861e79c0346152fb81ca4a.tar.gz
In Configure, integrate a more modern way to guess whether
a C symbol is defined. (See change #21267.) p4raw-link: @21267 on //depot/perl: 373dfab3839ca168fd2249c0b2b694722e478652 p4raw-id: //depot/maint-5.6/perl-5.6.2@21347
-rwxr-xr-xConfigure37
1 files changed, 20 insertions, 17 deletions
diff --git a/Configure b/Configure
index dcea234fc1..cb73dee402 100755
--- a/Configure
+++ b/Configure
@@ -5096,9 +5096,9 @@ $rm -f libnames libpath
: is a C symbol defined?
csym='tlook=$1;
case "$3" in
--v) tf=libc.tmp; tc=""; tdc="";;
--a) tf=libc.tmp; tc="[0]"; tdc="[]";;
-*) tlook="^$1\$"; tf=libc.list; tc="()"; tdc="()";;
+-v) tf=libc.tmp; tdc="";;
+-a) tf=libc.tmp; tdc="[]";;
+*) tlook="^$1\$"; tf=libc.list; tdc="()";;
esac;
tx=yes;
case "$reuseval-$4" in
@@ -5107,25 +5107,28 @@ true-*) tx=no; eval "tval=\$$4"; case "$tval" in "") tx=yes;; esac;;
esac;
case "$tx" in
yes)
- case "$runnm" in
- true)
- if $contains $tlook $tf >/dev/null 2>&1;
- then tval=true;
- else tval=false;
- fi;;
- *)
- echo "int main() { extern short $1$tdc; printf(\"%hd\", $1$tc); }" > t.c;
- if $cc -o t $optimize $ccflags $ldflags t.c $libs >/dev/null 2>&1;
- then tval=true;
- else tval=false;
+ tval=false;
+ if $test "$runnm" = true; then
+ if $contains $tlook $tf >/dev/null 2>&1; then
+ tval=true;
+ elif $test "$mistrustnm" = compile -o "$mistrustnm" = run; then
+ echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+ $cc -o try $optimize $ccflags $ldflags try.c >/dev/null 2>&1 $libs && tval=true;
+ $test "$mistrustnm" = run -a -x try && { $run ./try$_exe >/dev/null 2>&1 || tval=false; };
+ $rm -f try$_exe try.c core core.* try.core;
fi;
- $rm -f t t.c;;
- esac;;
+ else
+ echo "void *(*(p()))$tdc { extern void *$1$tdc; return &$1; } int main() { if(p()) return(0); else return(1); }"> try.c;
+ $cc -o try $optimize $ccflags $ldflags try.c $libs >/dev/null 2>&1 && tval=true;
+ $rm -f try$_exe try.c;
+ fi;
+ ;;
*)
case "$tval" in
$define) tval=true;;
*) tval=false;;
- esac;;
+ esac;
+ ;;
esac;
eval "$2=$tval"'