This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi 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] libffi testsuite standalone vs. gcc


Hi,

this is a try to keep the differences between the gcc-libffi testsuite and the libffi-standalone minimal.

Tested in both environments.

Thoughts?

Andreas

P.S, the diff is against gcc svn 148292.

2009-06-08 Andreas Tobler <a.tobler@schweiz.org>

	* configure.ac: Introduce a STANDALONE variable to be able to run the
	testsuite accordingly.
	* configure: Regenerate.
	* testsuite/Makefile.am (AM_RUNTESTFLAGS): Pass the STANDALONE variable
	to the testsuite.
	* Makefile.in: Regenerate.
	* include/Makefile.in: Likewise.
	* testsuite/Makefile.in: Likewise.
	* testsuite/lib/libffi-dg.exp (load_gcc_lib): Use the STANDALONE
	variable.
	(libffi-init): Likewise.
Index: configure.ac
===================================================================
--- configure.ac	(revision 148292)
+++ configure.ac	(working copy)
@@ -39,6 +39,13 @@
 dnl The -no-testsuite modules omit the test subdir.
 AM_CONDITIONAL(TESTSUBDIR, test -d $srcdir/testsuite)
 
+# Merge attention!
+# If we build libffi standalone, set STANDALONE to "yes", if we build it inside
+# gcc set it to "no". This variable is needed for the testsuite.
+
+STANDALONE="no"
+AC_SUBST(STANDALONE)
+
 TARGETDIR="unknown"
 case "$host" in
   alpha*-*-*)
Index: testsuite/Makefile.am
===================================================================
--- testsuite/Makefile.am	(revision 148292)
+++ testsuite/Makefile.am	(working copy)
@@ -7,10 +7,10 @@
             echo $(top_builddir)/../expect/expect ; \
           else echo expect ; fi`
 
-RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
+RUNTEST = "`if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
 	       echo $(top_srcdir)/../dejagnu/runtest ; \
-	    else echo runtest; fi`
+	    else echo runtest; fi` $(AM_RUNTESTFLAGS)"
 
-AM_RUNTESTFLAGS =
+AM_RUNTESTFLAGS = STANDALONE=$(STANDALONE)
 
 CLEANFILES = *.exe core* *.log *.sum
Index: testsuite/lib/libffi-dg.exp
===================================================================
--- testsuite/lib/libffi-dg.exp	(revision 148292)
+++ testsuite/lib/libffi-dg.exp	(working copy)
@@ -16,7 +16,13 @@
 
 proc load_gcc_lib { filename } {
     global srcdir
-    load_file $srcdir/../../gcc/testsuite/lib/$filename
+    global STANDALONE
+    
+     if {$STANDALONE == "yes"} {
+	 load_file $srcdir/lib/$filename
+     } else {
+         load_file $srcdir/../../gcc/testsuite/lib/$filename
+     }
 }
 
 load_lib dg.exp
@@ -101,11 +107,17 @@
     global libffi_link_flags
     global tool_root_dir
     global ld_library_path
+    global STANDALONE
 
-    set blddirffi [lookfor_file [get_multilibs] libffi]
+    if {$STANDALONE == "yes"} {
+	set blddirffi [pwd]/..
+    } else {
+	set blddirffi [lookfor_file [get_multilibs] libffi]
+	set blddircxx [lookfor_file [get_multilibs] libstdc++-v3]
+	verbose "libstdc++ $blddircxx"
+    }
+
     verbose "libffi $blddirffi"
-    set blddircxx [lookfor_file [get_multilibs] libstdc++-v3]
-    verbose "libstdc++ $blddircxx"
 
     set gccdir [lookfor_file $tool_root_dir gcc/libgcc.a]
     if {$gccdir != ""} {
@@ -132,8 +144,10 @@
     }
     # add the library path for libffi.
     append ld_library_path ":${blddirffi}/.libs"
-    # add the library path for libstdc++ as well.
-    append ld_library_path ":${blddircxx}/src/.libs"
+    if {$STANDALONE == "no"} {
+	# add the library path for libstdc++ as well.
+	append ld_library_path ":${blddircxx}/src/.libs"
+    }
 
     verbose "ld_library_path: $ld_library_path"
 
@@ -146,7 +160,9 @@
     if { $libffi_dir != "" } {
 	set libffi_dir [file dirname ${libffi_dir}]
 	set libffi_link_flags "-L${libffi_dir}/.libs"
-	lappend libffi_link_flags "-L${blddircxx}/src/.libs"
+	if {$STANDALONE == "no"} {
+	    lappend libffi_link_flags "-L${blddircxx}/src/.libs"
+	}
     }
 
     set_ld_library_path_env_vars

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