develooper Front page | perl.perl5.porters | Postings from October 2008

fix for failed Gconvert detection under C++

Thread Next
From:
Tony Cook
Date:
October 28, 2008 04:24
Subject:
fix for failed Gconvert detection under C++
Message ID:
20081028112405.GA14163@mars.tony.develop-help.com
For example:

http://www.nntp.perl.org/group/perl.daily-build.reports/2008/10/msg61028.html

The problem being that the test try.c isn't valid C++.

The attached patch:

- changes the K&R function definition into a prototype, since other
test code uses prototypes

- moves detection of string.h further up, so $i_string can be included
if available for strcmp().

- fixes the stdlib define in the test code

I guess this will need some re-work into metaconfig.

Tony

--- perl-master/Configure	2008-10-28 05:36:47.000000000 +1100
+++ work/Configure	2008-10-28 21:32:50.000000000 +1100
@@ -5532,6 +5532,46 @@
 set stdlib.h i_stdlib
 eval $inhdr
 
+: script used to emit important warnings
+cat >warn <<EOS
+$startsh
+if test \$# -gt 0; then
+	echo "\$@" >msg
+else
+	cat >msg
+fi
+echo "*** WARNING:" >&4
+sed -e 's/^/*** /' <msg >&4
+echo "*** " >&4
+cat msg >>config.msg
+echo " " >>config.msg
+rm -f msg
+EOS
+chmod +x warn
+$eunicefix warn
+
+: see which of string.h or strings.h is needed
+echo " "
+strings=`./findhdr string.h`
+if $test "$strings" && $test -r "$strings"; then
+	echo "Using <string.h> instead of <strings.h>." >&4
+	val="$define"
+else
+	val="$undef"
+	strings=`./findhdr strings.h`
+	if $test "$strings" && $test -r "$strings"; then
+		echo "Using <strings.h> instead of <string.h>." >&4
+	else
+		./warn "No string header found -- You'll surely have problems."
+	fi
+fi
+set i_string
+eval $setvar
+case "$i_string" in
+"$undef") strings=`./findhdr strings.h`;;
+*)	  strings=`./findhdr string.h`;;
+esac
+
 : check for lengths of integral types
 echo " "
 case "$intsize" in
@@ -9673,15 +9713,18 @@
 
 #include <stdio.h>
 
-#define I_STDLIB $i_stdlib
+#$i_stdlib I_STDLIB
 #ifdef I_STDLIB
 #include <stdlib.h>
 #endif
 
+#$i_string I_STRING
+#ifdef I_STRING
+#include <string.h>
+#endif
+
 int
-checkit(expect, got)
-char *expect;
-char *got;
+checkit(char *expect, char *got)
 {
     if (strcmp(expect, got)) {
 		printf("%s oddity:  Expected %s, got %s\n",
@@ -12353,45 +12396,6 @@
 eval $setvar
 $rm_try
 
-: script used to emit important warnings
-cat >warn <<EOS
-$startsh
-if test \$# -gt 0; then
-	echo "\$@" >msg
-else
-	cat >msg
-fi
-echo "*** WARNING:" >&4
-sed -e 's/^/*** /' <msg >&4
-echo "*** " >&4
-cat msg >>config.msg
-echo " " >>config.msg
-rm -f msg
-EOS
-chmod +x warn
-$eunicefix warn
-
-: see which of string.h or strings.h is needed
-echo " "
-strings=`./findhdr string.h`
-if $test "$strings" && $test -r "$strings"; then
-	echo "Using <string.h> instead of <strings.h>." >&4
-	val="$define"
-else
-	val="$undef"
-	strings=`./findhdr strings.h`
-	if $test "$strings" && $test -r "$strings"; then
-		echo "Using <strings.h> instead of <string.h>." >&4
-	else
-		./warn "No string header found -- You'll surely have problems."
-	fi
-fi
-set i_string
-eval $setvar
-case "$i_string" in
-"$undef") strings=`./findhdr strings.h`;;
-*)	  strings=`./findhdr string.h`;;
-esac
 
 : see if this is a sys/file.h system
 val=''

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About