This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: If you don't have a previous incarnation of GCJ installed...
On Mar 10, 2001, Alexandre Oliva <aoliva@redhat.com> wrote:
> I suggest enclosing the `-c -o' test in an (expanded shell version of)
> AC_CACHE_CHECK, like most other tests, and setting the cache variable
> in ltcf-gcj.sh.
Like in the attached patch. However, IMO, it doesn't obviate my
previous patch for libjava's configure.in. We may not be as lucky
with other tests performed by ltconfig as to know the answer in
advance, so it should be possible to perform compilation tests while
configuring libjava.
Index: ChangeLog
from Alexandre Oliva <aoliva@redhat.com>
* ltconfig.in (lt_cv_compiler_c_o): Cache it.
* ltcf-gcj.sh (lt_cv_compiler_c_o): Set it.
Index: ltconfig.in
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltconfig.in,v
retrieving revision 1.246.2.50
diff -u -p -r1.246.2.50 ltconfig.in
--- ltconfig.in 2001/03/09 04:36:30 1.246.2.50
+++ ltconfig.in 2001/03/11 01:54:07
@@ -809,45 +809,48 @@ fi
# Check to see if options -o and -c are simultaneously supported by compiler
echo $ac_n "checking if $compiler supports -c -o file.$objext... $ac_c" 1>&6
-$rm -r conftest 2>/dev/null
-mkdir conftest
-cd conftest
-$rm conftest*
-echo $lt_simple_compile_test_code > conftest.$ac_ext
-mkdir out
-# According to Tom Tromey, Ian Lance Taylor reported there are C compilers
-# that will create temporary files in the current directory regardless of
-# the output directory. Thus, making CWD read-only will cause this test
-# to fail, enabling locking or at least warning the user not to do parallel
-# builds.
-chmod -w .
-save_CFLAGS="$CFLAGS"
-CFLAGS="$CFLAGS -o out/conftest2.$objext"
-echo "$progname:@LINENO@: checking if $compiler supports -c -o file.$objext" >&5
-if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
-
- # The compiler can only warn and ignore the option if not recognized
- # So say no if there are warnings
- if test -s out/conftest.err; then
- echo "$ac_t"no 1>&6
- compiler_c_o=no
- else
- echo "$ac_t"yes 1>&6
- compiler_c_o=yes
- fi
+if test "${lt_cv_compiler_c_o+set}" = set; then
+ echo $ac_n "(cached) $ac_c" 1>&6
else
- # Append any errors to the config.log.
- cat out/conftest.err 1>&5
- compiler_c_o=no
- echo "$ac_t"no 1>&6
+ $rm -r conftest 2>/dev/null
+ mkdir conftest
+ cd conftest
+ $rm conftest*
+ echo $lt_simple_compile_test_code > conftest.$ac_ext
+ mkdir out
+ # According to Tom Tromey, Ian Lance Taylor reported there are C compilers
+ # that will create temporary files in the current directory regardless of
+ # the output directory. Thus, making CWD read-only will cause this test
+ # to fail, enabling locking or at least warning the user not to do parallel
+ # builds.
+ chmod -w .
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -o out/conftest2.$objext"
+ echo "$progname:@LINENO@: checking if $compiler supports -c -o file.$objext" >&5
+ if { (eval echo $progname:@LINENO@: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$objext; then
+
+ # The compiler can only warn and ignore the option if not recognized
+ # So say no if there are warnings
+ if test -s out/conftest.err; then
+ lt_cv_compiler_c_o=no
+ else
+ lt_cv_compiler_c_o=yes
+ fi
+ else
+ # Append any errors to the config.log.
+ cat out/conftest.err 1>&5
+ lt_cv_compiler_c_o=no
+ fi
+ CFLAGS="$save_CFLAGS"
+ chmod u+w .
+ $rm conftest* out/*
+ rmdir out
+ cd ..
+ rmdir conftest
+ $rm -r conftest 2>/dev/null
fi
-CFLAGS="$save_CFLAGS"
-chmod u+w .
-$rm conftest* out/*
-rmdir out
-cd ..
-rmdir conftest
-$rm -r conftest 2>/dev/null
+compiler_c_o=$lt_cv_compiler_c_o
+echo "${ac_t}$compiler_c_o" 1>&6
# Check to see if we can do hard links to lock some files if needed
hard_links="nottested"
Index: ltcf-gcj.sh
===================================================================
RCS file: /cvsroot/libtool/libtool/Attic/ltcf-gcj.sh,v
retrieving revision 1.1.2.15
diff -u -p -r1.1.2.15 ltcf-gcj.sh
--- ltcf-gcj.sh 2001/03/07 01:51:20 1.1.2.15
+++ ltcf-gcj.sh 2001/03/11 01:54:08
@@ -627,3 +627,6 @@ fi
# GCJ did not exist at the time GCC didn't implicitly link libc in.
need_lc=no
+
+# All existing releases of GCJ support `-c -o'.
+lt_cv_compiler_c_o=yes
--
Alexandre Oliva Enjoy Guarana', see http://www.ic.unicamp.br/~oliva/
Red Hat GCC Developer aoliva@{cygnus.com, redhat.com}
CS PhD student at IC-Unicamp oliva@{lsd.ic.unicamp.br, gnu.org}
Free Software Evangelist *Please* write to mailing lists, not to me