ac_ext is set to "cc" right after the objext test is done.
Lars J
######################################################################
The inline for-loop macro:
AC_DEFUN([SIM_COMPILER_INLINE_FOR], [
AC_PREREQ([2.14])
AC_CACHE_CHECK(
[whether the C++ compiler handles inlined loops],
sim_cv_c_inlinefor,
[cat > sim_ac_test.h <<EOF
class TestClass {
public:
TestClass(int);
};
inline TestClass::TestClass(int) { for (int i=0; i<1; i++) i=0; }
EOF
AC_TRY_COMPILE([#include "sim_ac_test.h"],
[TestClass t(0);],
[sim_cv_c_inlinefor=yes],
[sim_cv_c_inlinefor=no])
])
rm -rf sim_ac_test.h
if test x"$sim_cv_c_inlinefor" = x"yes"; then
ifelse([$1], , :, [$1])
else
ifelse([$2], , :, [$2])
fi
])
######################################################################
The configure.in parts:
AC_INIT(src/misc/SoDB.cpp)
AC_PROG_CXX
AC_LANG_CPLUSPLUS
SIM_COMPILER_INLINE_FOR(, AC_MSG_ERROR(the "$CXX" C++ compiler is not capable of
compiling Coin))
######################################################################
The configure run:
$ CC=cl CXX=cl CFLAGS=/TP bash -x configure ac_objext=obj >output.log 2>&1
[output.log]
+ ac_default_prefix=/usr/local
+ cross_compiling=no
+ subdirs=
+ MFLAGS=
+ MAKEFLAGS=
+ SHELL=/bin/sh
+ : 38
+ ac_tr_sh=sed y%*+%pp%;s%[^a-zA-Z0-9_]%_%g
+ ac_tr_cpp=sed
+y%*abcdefghijklmnopqrstuvwxyz%PABCDEFGHIJKLMNOPQRSTUVWXYZ%;s%[^A-Z0-9_]%_%g
+ ac_exeext=
+ ac_objext=o
+ ac_includes_default=#include <stdio.h>
#include <sys/types.h>
#if STDC_HEADERS
# include <stdlib.h>
# include <stddef.h>
#else
# if HAVE_STDLIB_H
# include <stdlib.h>
# endif
#endif
#if HAVE_STRING_H
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif
# include <string.h>
#else
# if HAVE_STRINGS_H
# include <strings.h>
# endif
#endif
#if HAVE_INTTYPES_H
# include <inttypes.h>
#endif
#if HAVE_UNISTD_H
# include <unistd.h>
#endif
+ ac_unique_file=src/misc/SoDB.cpp
+ ac_init_help=
+ ac_init_version=false
+ cache_file=/dev/null
+ exec_prefix=NONE
+ no_create=
+ no_recursion=
+ prefix=NONE
+ program_prefix=NONE
+ program_suffix=NONE
+ program_transform_name=s,x,x,
+ silent=
+ site=
+ srcdir=
+ verbose=
+ x_includes=NONE
+ x_libraries=NONE
+ bindir=${exec_prefix}/bin
+ sbindir=${exec_prefix}/sbin
+ libexecdir=${exec_prefix}/libexec
+ datadir=${prefix}/share
+ sysconfdir=${prefix}/etc
+ sharedstatedir=${prefix}/com
+ localstatedir=${prefix}/var
+ libdir=${exec_prefix}/lib
+ includedir=${prefix}/include
+ oldincludedir=/usr/include
+ infodir=${prefix}/info
+ mandir=${prefix}/man
+ ac_prev=
+ test -n ''
++ expr xac_objext=obj : 'x[^=]*=\(.*\)'
+ ac_optarg=obj
++ expr xac_objext=obj : 'x\([^=]*\)='
+ ac_envvar=ac_objext
+ expr xac_objext : '.*[^a-zA-Z0-9_]'
++ echo obj
++ sed 's/'\''/'\''\\'\'''\''/g'
+ ac_optarg=obj
+ eval 'ac_objext='\''obj'\'''
++ ac_objext=obj
+ export ac_objext
+ test -n ''
++ echo bindir
+ eval 'ac_val=$bindir'
++ ac_val=${exec_prefix}/bin
++ echo sbindir
+ eval 'ac_val=$sbindir'
++ ac_val=${exec_prefix}/sbin
++ echo libexecdir
+ eval 'ac_val=$libexecdir'
++ ac_val=${exec_prefix}/libexec
++ echo datadir
+ eval 'ac_val=$datadir'
++ ac_val=${prefix}/share
++ echo sysconfdir
+ eval 'ac_val=$sysconfdir'
++ ac_val=${prefix}/etc
++ echo sharedstatedir
+ eval 'ac_val=$sharedstatedir'
++ ac_val=${prefix}/com
++ echo localstatedir
+ eval 'ac_val=$localstatedir'
++ ac_val=${prefix}/var
++ echo libdir
+ eval 'ac_val=$libdir'
++ ac_val=${exec_prefix}/lib
++ echo includedir
+ eval 'ac_val=$includedir'
++ ac_val=${prefix}/include
++ echo oldincludedir
+ eval 'ac_val=$oldincludedir'
++ ac_val=/usr/include
++ echo infodir
+ eval 'ac_val=$infodir'
++ ac_val=${prefix}/info
++ echo mandir
+ eval 'ac_val=$mandir'
++ ac_val=${prefix}/man
++ echo exec_prefix
+ eval 'ac_val=$exec_prefix'
++ ac_val=NONE
++ echo prefix
+ eval 'ac_val=$prefix'
++ ac_val=NONE
+ build=
+ host=
+ target=
+ test x '!=' x
+ ac_tool_prefix=
+ test -n ''
+ test -z ''
+ ac_srcdir_defaulted=yes
+ ac_prog=/home/Coin/configure
++ echo /home/Coin/configure
++ sed 's%/[^/][^/]*$%%'
+ ac_confdir=/home/Coin
+ test x/home/Coin = x/home/Coin/configure
+ srcdir=/home/Coin
+ test '!' -r /home/Coin/src/misc/SoDB.cpp
+ test '!' -r /home/Coin/src/misc/SoDB.cpp
++ echo /home/Coin
++ sed 's%\([^/]\)/*$%\1%'
+ srcdir=/home/Coin
+ test '' = long
+ test -n ''
+ test '' = recursive
+ test -n ''
+ false
+ test -n ''
+ test -n set
+ set -o posix
+ ac_unset=false
+ false LANG
+ test '' '!=' set
+ export LANG
+ false LC_ALL
+ test '' '!=' set
+ export LC_ALL
+ false LC_CTYPE
+ test '' '!=' set
+ export LC_CTYPE
+ false LANGUAGE
+ test '' '!=' set
+ export LANGUAGE
+ false LC_MESSAGES
+ test '' '!=' set
+ export LC_MESSAGES
+ ac_nl=
+ IFS=
+ false CDPATH
+ test '' '!=' set
+ export CDPATH
+ trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15
+ ac_configure_args=
+ ac_sep=
+ ac_configure_args=ac_objext=obj
+ ac_sep=
+ test '' = yes
+ exec
+ exec
+ echo 'This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure 2.14a, executed with
> /home/Coin/configure ac_objext=obj
'
+ rm -rf 'conftest*' confdefs.h
+ echo
+ test -z ''
+ test xNONE '!=' xNONE
+ CONFIG_SITE=/usr/local/share/config.site /usr/local/etc/config.site
+ test -r /usr/local/share/config.site
+ test -r /usr/local/etc/config.site
+ test -r /dev/null
+ test -f /dev/null
+ ac_ext=c
+ ac_cpp=$CPP $CPPFLAGS
+ ac_compile=${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5
+ ac_link=${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext
+$LIBS >&5
+ ac_gnu_compiler=
++ echo 'testing\c'
++ echo 1,2,3
++ echo -n testing
++ echo 1,2,3
+ ECHO_N=-n
+ ECHO_C=
+ ECHO_T=
+ ac_ext=cc
+ ac_cpp=$CXXCPP $CPPFLAGS
+ ac_compile=${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5
+ ac_link=${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS
+conftest.$ac_ext $LIBS >&5
+ ac_gnu_compiler=
+ ac_configure_args=CXX='cl' ac_objext=obj
+ set dummy g++
+ ac_word=g++
+ echo 'configure:688: checking for g++'
+ echo -n 'checking for g++... '
checking for g++... + test '' = set
+ test -n cl
+ ac_cv_prog_CXX=cl
+ CXX=cl
+ test -n cl
+ echo 'configure:709: result: cl'
+ echo cl
cl
+ test cl '!=' ''
+ break
+ test cl = ''
+ echo 'configure:753: checking for a source file extension accepted by the C++
+compiler'
+ echo -n 'checking for a source file extension accepted by the C++ compiler... '
checking for a source file extension accepted by the C++ compiler... + test '' = set
+ cat
+ eval echo configure:772: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS' 'conftest.$ac_ext'
+'>&5"'
++ echo configure:772: 'cl -c conftest.cc >&5'
+ test -s conftest.obj
+ echo 'configure: failed program was:'
+ cat conftest.cc
+ rm -f conftest.cc
+ cat
+ eval echo configure:772: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS' 'conftest.$ac_ext'
+'>&5"'
++ echo configure:772: 'cl -c conftest.cxx >&5'
+ test -s conftest.obj
+ ac_cv_Cpp_inext=cxx
+ break
+ echo 'configure:782: result: cxx'
+ echo cxx
cxx
+ test -z cxx
+ echo 'configure:786: checking whether the C++ compiler works'
+ echo -n 'checking whether the C++ compiler works... '
checking whether the C++ compiler works... + cat
+ eval echo configure:801: '"${CXX-g++}' -o 'conftest${ac_exeext}' '$CXXFLAGS'
+'$CPPFLAGS' '$LDFLAGS' 'conftest.$ac_ext' '$LIBS' '>&5"'
++ echo configure:801: 'cl -o conftest conftest.cxx >&5'
+ test -s conftest
+ test no '!=' yes
+ ac_try=./conftest
+ eval echo configure:805: '"./conftest"'
++ echo configure:805: ./conftest
+ cross_compiling=no
+ echo 'configure:816: result: yes'
+ echo yes
yes
+ rm -f 'conftest*echo' 'configure:825: checking whether we are cross compiling'
+ echo -n 'checking whether we are cross compiling... '
checking whether we are cross compiling... + echo 'configure:827: result: no'
+ echo no
no
+ echo 'configure:829: checking whether we are using GNU C++'
+ echo -n 'checking whether we are using GNU C++... '
checking whether we are using GNU C++... + test '' = set
+ cat
+ ac_try=${CXX-g++} -E conftest.$ac_ext
+ egrep yes
+ eval echo configure:840: '"${CXX-g++}' -E 'conftest.$ac_ext"'
++ echo configure:840: 'cl -E conftest.cxx'
+ ac_cv_prog_gxx=no
+ echo 'configure:846: result: no'
+ echo no
no
+ ac_gnu_compiler=no
+ test no = yes
+ GXX=
+ ac_test_CXXFLAGS=
+ ac_save_CXXFLAGS=
+ CXXFLAGS=
+ echo 'configure:857: checking whether cl accepts -g'
+ echo -n 'checking whether cl accepts -g... '
checking whether cl accepts -g... + test '' = set
+ cat
++ cl -g -c conftest.cxx
+ test -z 'Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 12.00.8168 for 80x86
Copyright (C) Microsoft Corp 1984-1998. All rights reserved.
Command line warning D4002 : ignoring unknown option '\''-g'\''
conftest.cxx
'
+ ac_cv_prog_cxx_g=no
+ rm -f conftest.cxx conftest.exe conftest.obj
+ echo 'configure:882: result: no'
+ echo no
no
+ test '' = set
+ test no = yes
+ test '' = yes
+ CXXFLAGS=
+ echo 'configure:899: checking for Cygwin environment'
+ echo -n 'checking for Cygwin environment... '
checking for Cygwin environment... + test '' = set
+ cat
+ eval echo configure:921: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS' 'conftest.$ac_ext'
+'>&5"'
++ echo configure:921: 'cl -c conftest.cxx >&5'
+ echo 'configure: failed program was:'
+ cat conftest.cxx
+ ac_cv_cygwin=no
+ rm -f conftest.cxx
+ echo 'configure:930: result: no'
+ echo no
no
+ test no = yes
+ echo 'configure:933: checking for mingw32 environment'
+ echo -n 'checking for mingw32 environment... '
checking for mingw32 environment... + test '' = set
+ cat
+ eval echo configure:952: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS' 'conftest.$ac_ext'
+'>&5"'
++ echo configure:952: 'cl -c conftest.cxx >&5'
+ echo 'configure: failed program was:'
+ cat conftest.cxx
+ ac_cv_mingw32=no
+ rm -f conftest.cxx
+ echo 'configure:961: result: no'
+ echo no
no
+ test no = yes
+ echo 'configure:964: checking for EMX OS/2 environment'
+ echo -n 'checking for EMX OS/2 environment... '
checking for EMX OS/2 environment... + test '' = set
+ cat
+ eval echo configure:983: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS' 'conftest.$ac_ext'
+'>&5"'
++ echo configure:983: 'cl -c conftest.cxx >&5'
+ echo 'configure: failed program was:'
+ cat conftest.cxx
+ ac_cv_emxos2=no
+ rm -f conftest.cxx
+ echo 'configure:992: result: no'
+ echo no
no
+ test no = yes
+ echo 'configure:995: checking for executable suffix'
+ echo -n 'checking for executable suffix... '
checking for executable suffix... + test '' = set
+ test '' = yes
+ test '' = yes
+ test '' = yes
+ cat
+ eval echo configure:1016: '"${CXX-g++}' -o 'conftest${ac_exeext}' '$CXXFLAGS'
+'$CPPFLAGS' '$LDFLAGS' 'conftest.$ac_ext' '$LIBS' '>&5"'
++ echo configure:1016: 'cl -o conftest conftest.cxx >&5'
+ test -s conftest
++ echo conftest.exe
++ sed s/conftest//
+ ac_cv_exeext=.exe
+ rm -f conftest.cxx conftest.exe conftest.obj
+ test -n .exe
+ ac_cv_exeext=no
+ echo 'configure:1032: result: no'
+ echo no
no
+ EXEEXT=
+ test no '!=' no
+ ac_exeext=
+ echo 'configure:1037: checking for object suffix'
+ echo -n 'checking for object suffix... '
checking for object suffix... + test '' = set
+ cat
+ eval echo configure:1055: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS'
+'conftest.$ac_ext' '>&5"'
++ echo configure:1055: 'cl -c conftest.cxx >&5'
+ test -s conftest.obj
++ echo conftest.obj
++ sed s/conftest.//
+ ac_cv_objext=obj
+ rm -f conftest.cxx conftest.obj
+ echo 'configure:1069: result: obj'
+ echo obj
obj
+ OBJEXT=obj
+ ac_objext=obj
+ ac_ext=c
+ ac_cpp=$CPP $CPPFLAGS
+ ac_compile=${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5
+ ac_link=${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext
+$LIBS >&5
+ ac_gnu_compiler=
+ ac_ext=cc
+ ac_cpp=$CXXCPP $CPPFLAGS
+ ac_compile=${CXX-g++} -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5
+ ac_link=${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS
+conftest.$ac_ext $LIBS >&5
+ ac_gnu_compiler=no
+ echo 'configure:1085: checking whether the C++ compiler handles inlined loops'
+ echo -n 'checking whether the C++ compiler handles inlined loops... '
checking whether the C++ compiler handles inlined loops... + test '' = set
+ cat
+ cat
+ eval echo configure:1112: '"${CXX-g++}' -c '$CXXFLAGS' '$CPPFLAGS'
+'conftest.$ac_ext' '>&5"'
++ echo configure:1112: 'cl -c conftest.cc >&5'
+ test -s conftest.obj
+ echo 'configure: failed program was:'
+ cat conftest.cc
+ sim_cv_c_inlinefor=no
+ rm -f conftest.cc
+ echo 'configure:1121: result: no'
+ echo no
no
+ rm -rf sim_ac_test.h
+ test xno = xyes
+ echo 'configure: error: the "cl" C++ compiler is not capable of compiling Coin'
configure: error: the "cl" C++ compiler is not capable of compiling Coin
+ exit 1