How about this?
I don't have good answers yet to provide wrt .obj, maybe you should
try to set it by hand in configure.in just to see if it works. We
will address this second issue later (note that ./configure
ac_objext=obj should be enough).
Index: ChangeLog
from Akim Demaille <[EMAIL PROTECTED]>
* aclang.m4: Use `$ac_ext' instead of `.c', `.cc', `.f' etc.
Same with $ac_objext.
Index: aclang.m4
===================================================================
RCS file: /cvs/autoconf/aclang.m4,v
retrieving revision 1.49
diff -u -r1.49 aclang.m4
--- aclang.m4 2000/07/19 09:56:18 1.49
+++ aclang.m4 2000/07/19 12:07:40
@@ -574,12 +574,12 @@
define([_AC_PROG_CC_GNU],
[AC_CACHE_CHECK(whether we are using GNU C, ac_cv_prog_gcc,
[# The semicolon is to pacify NeXT's syntax-checking cpp.
-cat >conftest.c <<EOF
+cat >conftest.$ac_ext <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
-if AC_TRY_COMMAND(${CC-cc} -E conftest.c) | egrep yes >/dev/null 2>&1; then
+if AC_TRY_COMMAND(${CC-cc} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gcc=yes
else
ac_cv_prog_gcc=no
@@ -603,8 +603,11 @@
ac_save_CFLAGS=$CFLAGS
CFLAGS=
AC_CACHE_CHECK(whether ${CC-cc} accepts -g, ac_cv_prog_cc_g,
-[echo 'void f(){}' >conftest.c
-if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then
+[cat >conftest.$ac_ext <<EOF
+AC_LANG_PROGRAM([])
+EOF
+echo 'void f(){}' >conftest.$ac_ext
+if test -z "`${CC-cc} -g -c conftest.$ac_ext 2>&1`"; then
ac_cv_prog_cc_g=yes
else
ac_cv_prog_cc_g=no
@@ -666,21 +669,23 @@
set dummy $CC; ac_cc=`echo $[2] |
sed 's/[[^a-zA-Z0-9_]]/_/g;s/^[[0-9]]/_/'`
AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
-[echo 'foo(){}' >conftest.c
+[cat >conftest.$ac_ext <<EOF
+AC_LANG_PROGRAM([])
+EOF
# Make sure it works both with $CC and with simple cc.
# We do the test twice because some compilers refuse to overwrite an
# existing .o file with -o, though they will create one.
-ac_try='${CC-cc} -c conftest.c -o conftest.o >&AC_FD_LOG'
+ac_try='${CC-cc} -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG'
if AC_TRY_EVAL(ac_try) &&
- test -f conftest.o && AC_TRY_EVAL(ac_try);
+ test -f conftest.$objext && AC_TRY_EVAL(ac_try);
then
eval ac_cv_prog_cc_${ac_cc}_c_o=yes
if test "x$CC" != xcc; then
# Test first that cc exists at all.
- if AC_TRY_COMMAND(cc -c conftest.c >&AC_FD_LOG); then
- ac_try='cc -c conftest.c -o conftest.o >&AC_FD_LOG'
+ if AC_TRY_COMMAND(cc -c conftest.$ac_ext >&AC_FD_LOG); then
+ ac_try='cc -c conftest.$ac_ext -o conftest.$ac_objext >&AC_FD_LOG'
if AC_TRY_EVAL(ac_try) &&
- test -f conftest.o && AC_TRY_EVAL(ac_try);
+ test -f conftest.$objext && AC_TRY_EVAL(ac_try);
then
# cc works too.
:
@@ -766,12 +771,12 @@
define([_AC_PROG_CXX_GNU],
[AC_CACHE_CHECK(whether we are using GNU C++, ac_cv_prog_gxx,
[# The semicolon is to pacify NeXT's syntax-checking cpp.
-cat >conftest.cc <<EOF
+cat >conftest.$ac_ext <<EOF
#ifdef __GNUC__
yes;
#endif
EOF
-if AC_TRY_COMMAND(${CXX-g++} -E conftest.cc) | egrep yes >/dev/null 2>&1; then
+if AC_TRY_COMMAND(${CXX-g++} -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then
ac_cv_prog_gxx=yes
else
ac_cv_prog_gxx=no
@@ -795,8 +800,10 @@
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS=
AC_CACHE_CHECK(whether ${CXX-g++} accepts -g, ac_cv_prog_cxx_g,
-[echo 'void f(){}' >conftest.cc
-if test -z "`${CXX-g++} -g -c conftest.cc 2>&1`"; then
+[cat >conftest.$ac_ext <<EOF
+AC_LANG_PROGRAM([])
+EOF
+if test -z "`${CXX-g++} -g -c conftest.$ac_ext 2>&1`"; then
ac_cv_prog_cxx_g=yes
else
ac_cv_prog_cxx_g=no
@@ -868,12 +875,12 @@
# do CPP pre-processing.
define([_AC_PROG_F77_GNU],
[AC_CACHE_CHECK(whether we are using GNU Fortran 77, ac_cv_prog_g77,
-[cat >conftest.f <<EOF
+[cat >conftest.$ac_ext <<EOF
#ifdef __GNUC__
yes
#endif
EOF
-if AC_TRY_COMMAND($F77 -E conftest.f) | egrep yes >/dev/null 2>&1; then
+if AC_TRY_COMMAND($F77 -E conftest.$ac_ext) | egrep yes >/dev/null 2>&1; then
ac_cv_prog_g77=yes
else
ac_cv_prog_g77=no
@@ -932,14 +939,14 @@
[AC_REQUIRE([AC_PROG_F77])dnl
AC_CACHE_CHECK([whether $F77 understand -c and -o together],
[ac_cv_prog_f77_c_o],
-[cat >conftest.f <<EOF
+[cat >conftest.$ac_ext <<EOF
AC_LANG_PROGRAM([])
EOF
# We do the `AC_TRY_EVAL' test twice because some compilers refuse to
# overwrite an existing `.o' file with `-o', although they will create
# one.
-ac_try='$F77 $FFLAGS -c conftest.f -o conftest.o >&AC_FD_LOG'
-if AC_TRY_EVAL(ac_try) && test -f conftest.o && AC_TRY_EVAL(ac_try); then
+ac_try='$F77 $FFLAGS -c conftest.$ac_ext -o conftest.$objext >&AC_FD_LOG'
+if AC_TRY_EVAL(ac_try) && test -f conftest.$objext && AC_TRY_EVAL(ac_try); then
ac_cv_prog_f77_c_o=yes
else
ac_cv_prog_f77_c_o=no