Merge pull request #86 from joshtriplett/testsuite-CC-CXX

testsuite ignores CC parameter supplied to configure or make
This commit is contained in:
Anthony Green
2014-04-12 19:37:21 -04:00
6 changed files with 33 additions and 34 deletions

View File

@@ -1,17 +1,22 @@
language: c language: cpp
compiler: compiler:
- gcc - gcc
- clang - clang
env: env:
- build32=false -
- build32=true - HOST=i386-pc-linux-gnu
matrix: matrix:
exclude: exclude:
- compiler: clang - compiler: clang
env: build32=true env: HOST=i386-pc-linux-gnu
before_script: before_script:
- sudo apt-get install dejagnu texinfo - sudo apt-get install dejagnu texinfo
- if $build32 ; then sudo apt-get install gcc-multilib g++-multilib ; fi - if [ "$HOST" = i386-pc-linux-gnu ] ; then sudo apt-get install gcc-multilib g++-multilib && CC="$CC -m32" && CXX="$CXX -m32" ; fi
script: run= && if $build32 ; then run=i386 && mkdir path32 && PATH="$(pwd)/path32:$PATH" && printf '#!/bin/sh\nexec /usr/bin/'"$CC"' -m32 "$@"' > "path32/$CC" && chmod a+x "path32/$CC" ; fi && ./autogen.sh && $run ./configure && make && make dist && make check script:
- ./autogen.sh
- ./configure ${HOST+--host=$HOST}
- make
- make dist
- make check

19
README
View File

@@ -146,13 +146,16 @@ It's also possible to build libffi on Windows platforms with
Microsoft's Visual C++ compiler. In this case, use the msvcc.sh Microsoft's Visual C++ compiler. In this case, use the msvcc.sh
wrapper script during configuration like so: wrapper script during configuration like so:
path/to/configure CC=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\" path/to/configure CC=path/to/msvcc.sh CXX=path/to/msvcc.sh LD=link CPP=\"cl -nologo -EP\"
For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64". For 64-bit Windows builds, use CC="path/to/msvcc.sh -m64" and
You may also need to specify --build appropriately. When building with MSVC CXX="path/to/msvcc.sh -m64". You may also need to specify --build
under a MingW environment, you may need to remove the line in configure appropriately.
that sets 'fix_srcfile_path' to a 'cygpath' command. ('cygpath' is not
present in MingW, and is not required when using MingW-style paths.) When building with MSVC under a MingW environment, you may need to
remove the line in configure that sets 'fix_srcfile_path' to a 'cygpath'
command. ('cygpath' is not present in MingW, and is not required when
using MingW-style paths.)
For iOS builds, the 'libffi.xcodeproj' Xcode project is available. For iOS builds, the 'libffi.xcodeproj' Xcode project is available.
@@ -180,8 +183,8 @@ See the git log for details at http://github.com/atgreen/libffi.
32-bit x86 targets such as Linux. 32-bit x86 targets such as Linux.
Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi Various Android, MIPS N32, x86, FreeBSD and UltraSPARC IIi
fixes. fixes.
Make the testsuite more robust: eliminated several spurious Make the testsuite more robust: eliminate several spurious
failures. failures, and respect the $CC and $CXX environment variables.
Archive off the manually maintained ChangeLog in favor of git Archive off the manually maintained ChangeLog in favor of git
log. log.

View File

@@ -29,6 +29,7 @@ m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
m4_define([_AC_ARG_VAR_PRECIOUS],[]) m4_define([_AC_ARG_VAR_PRECIOUS],[])
save_CFLAGS=$CFLAGS save_CFLAGS=$CFLAGS
AC_PROG_CC AC_PROG_CC
AC_PROG_CXX
CFLAGS=$save_CFLAGS CFLAGS=$save_CFLAGS
m4_undefine([_AC_ARG_VAR_PRECIOUS]) m4_undefine([_AC_ARG_VAR_PRECIOUS])
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS]) m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
@@ -53,13 +54,13 @@ fi
if test "x$GCC" = "xyes"; then if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -fexceptions" CFLAGS="$CFLAGS -fexceptions"
touch local.exp
else
cat > local.exp <<EOF
set CC_FOR_TARGET "$CC"
EOF
fi fi
cat > local.exp <<EOF
set CC_FOR_TARGET "$CC"
set CXX_FOR_TARGET "$CXX"
EOF
AM_MAINTAINER_MODE AM_MAINTAINER_MODE
AC_CHECK_HEADERS(sys/mman.h) AC_CHECK_HEADERS(sys/mman.h)

View File

@@ -2,17 +2,6 @@
AUTOMAKE_OPTIONS = foreign dejagnu AUTOMAKE_OPTIONS = foreign dejagnu
# Setup the testing framework, if you have one
EXPECT = `if [ -f $(top_builddir)/../expect/expect ] ; then \
echo $(top_builddir)/../expect/expect ; \
else echo expect ; fi`
RUNTEST = `if [ -f $(top_srcdir)/../dejagnu/runtest ] ; then \
echo $(top_srcdir)/../dejagnu/runtest ; \
else echo runtest; fi`
AM_RUNTESTFLAGS =
EXTRA_DEJAGNU_SITE_CONFIG=../local.exp EXTRA_DEJAGNU_SITE_CONFIG=../local.exp
CLEANFILES = *.exe core* *.log *.sum CLEANFILES = *.exe core* *.log *.sum

View File

@@ -222,6 +222,10 @@ proc libffi_target_compile { source dest type options } {
lappend options "libs= -lpthread" lappend options "libs= -lpthread"
} }
if { [string match "*.cc" $source] } {
lappend options "c++"
}
verbose "options: $options" verbose "options: $options"
return [target_compile $source $dest $type $options] return [target_compile $source $dest $type $options]
} }

View File

@@ -19,10 +19,7 @@ libffi-init
global srcdir subdir global srcdir subdir
run-many-tests [lsort [glob -nocomplain $srcdir/$subdir/*.\[cS\]]] "" run-many-tests [lsort [glob -nocomplain -- $srcdir/$subdir/*.{c,cc}]] ""
if { [string match $using_gcc "yes"] } {
run-many-tests [lsort [glob -nocomplain $srcdir/$subdir/*.cc]] "-shared-libgcc -lstdc++"
}
dg-finish dg-finish