This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] fix testsuite iconv discovery


This fixes the bug that David reported on AIX with the new
dg-require-iconv machinery. If there are any other bugs with it, let me
know please :)

OK?

-eric

-- 
Eric Christopher <echristo@redhat.com>

2004-03-03  Eric Christopher  <echristo@redhat.com>

	* Makefile.in: Export LIBICONV when testing.
	* testsuite/lib/target-supports.exp: Use above information
	when compiling tmp.c.

Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1257
diff -u -p -w -r1.1257 Makefile.in
--- Makefile.in	2 Mar 2004 05:51:35 -0000	1.1257
+++ Makefile.in	3 Mar 2004 20:23:16 -0000
@@ -3243,6 +3243,7 @@ $(lang_checks): check-% : $(TESTSUITEDIR
 	if [ -f $${rootme}/../expect/expect ] ; then  \
 	   TCL_LIBRARY=`cd .. ; cd ${srcdir}/../tcl/library ; ${PWD_COMMAND}`
; \
 	    export TCL_LIBRARY ; fi ; \
+	LIBICONV=$(LIBICONV) ; export LIBICONV ; \
 	$(RUNTEST) --tool $* $(RUNTESTFLAGS))
 
 check-consistency: testsuite/site.exp
Index: testsuite/lib/target-supports.exp
===================================================================
RCS file: /cvs/gcc/gcc/gcc/testsuite/lib/target-supports.exp,v
retrieving revision 1.13
diff -u -p -w -r1.13 target-supports.exp
--- testsuite/lib/target-supports.exp	27 Feb 2004 02:01:10 -0000	1.13
+++ testsuite/lib/target-supports.exp	3 Mar 2004 20:23:16 -0000
@@ -216,9 +216,16 @@ proc check_profiling_available { test_wh
 
 proc check_iconv_available { test_what } {
     global tool
+    global env
 
     set result ""
 
+    set libiconv ""
+
+    if [info exists env(LIBICONV)] {
+	set libiconv $env(LIBICONV)
+    }
+
     verbose "check_iconv_available compiling testfile" 1
     set f [open "tmp.c" "w"]
     # Compile a small test program.
@@ -229,7 +236,10 @@ proc check_iconv_available { test_what }
     puts $f "return 0;\n}"
     close $f
 
-    set lines [${tool}_target_compile "tmp.c" "tmp.x" executable ""]
+    set lines [${tool}_target_compile "tmp.c" "tmp.x" executable
"libs=$libiconv" ]
+
+    if [string match "" $lines] then {
+	# No error messages, everything is OK.
 
     set result [${tool}_load "./tmp.x" "" ""]
     set status [lindex $result 0];
@@ -238,6 +248,7 @@ proc check_iconv_available { test_what }
 
     if { $status == "pass" } then {
 	return 1
+	}
     }
 
     return 0



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]