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] again on iconv detection for testsuite


Thanks to Alex's suggestion I avoid polluting the environment a bit.

OK?

-eric

-- 
Eric Christopher <echristo@redhat.com>

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

	* Makefile.in (site.exp): Add libiconv variable definition.

testsuite/ChangeLog
2004-03-08  Eric Christopher  <echristo@redhat.com>

	* lib/target-supports.exp: Enable libiconv in test
	compilation.  Fix up error checking.


Index: Makefile.in
===================================================================
RCS file: /cvs/gcc/gcc/gcc/Makefile.in,v
retrieving revision 1.1260
diff -u -p -w -r1.1260 Makefile.in
--- Makefile.in	5 Mar 2004 10:32:53 -0000	1.1260
+++ Makefile.in	9 Mar 2004 01:09:14 -0000
@@ -3165,6 +3165,7 @@ site.exp: ./config.status Makefile
 	@echo "set build_triplet $(build)" >> ./tmp0
 	@echo "set target_triplet $(target)" >> ./tmp0
 	@echo "set target_alias $(target_noncanonical)" >> ./tmp0
+	@echo "set libiconv \"$(LIBICONV)\"" >> ./tmp0
 # CFLAGS is set even though it's empty to show we reserve the right to set it.
 	@echo "set CFLAGS \"\"" >> ./tmp0
 	@echo "set CXXFLAGS \"\"" >> ./tmp0
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	9 Mar 2004 01:09:14 -0000
@@ -216,6 +216,7 @@ proc check_profiling_available { test_wh
 
 proc check_iconv_available { test_what } {
     global tool
+    global libiconv
 
     set result ""
 
@@ -229,7 +230,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 +242,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]