Moved compiler detection macros to Bakefile.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@33061 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
David Elliott 2005-03-26 03:49:38 +00:00
parent dc993cbfc6
commit 6dcfc2898e
4 changed files with 794 additions and 830 deletions

View file

@ -8,75 +8,6 @@ dnl
dnl Version: $Id$
dnl ---------------------------------------------------------------------------
dnl ===========================================================================
dnl macros to detect specialty compiler options
dnl ===========================================================================
dnl Figure out if we need to pass -ext o to compiler (MetroWerks)
AC_DEFUN([AC_WX_METROWERKS_EXTO],
[AC_CACHE_CHECK([if the _AC_LANG compiler requires -ext o], wx_cv_[]_AC_LANG_ABBREV[]_exto,
dnl First create an empty conf test
[AC_LANG_CONFTEST([AC_LANG_PROGRAM()])
dnl Now remove .o and .c.o or .cc.o
rm -f conftest.$ac_objext conftest.$ac_ext.o
dnl Now compile the test
AS_IF([AC_TRY_EVAL(ac_compile)],
dnl If the test succeeded look for conftest.c.o or conftest.cc.o
[for ac_file in `(ls conftest.* 2>/dev/null)`; do
case $ac_file in
conftest.$ac_ext.o)
wx_cv_[]_AC_LANG_ABBREV[]_exto="-ext o"
;;
*)
;;
esac
done],
[AC_MSG_FAILURE([cannot figure out if compiler needs -ext o: cannot compile])
]) dnl AS_IF
rm -f conftest.$ac_ext.o conftest.$ac_objext conftest.$ac_ext
]) dnl AC_CACHE_CHECK
if test "x$wx_cv_[]_AC_LANG_ABBREV[]_exto" '!=' "x"; then
if test "[]_AC_LANG_ABBREV[]" = "c"; then
CFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CFLAGS"
fi
if test "[]_AC_LANG_ABBREV[]" = "cxx"; then
CXXFLAGS="$wx_cv_[]_AC_LANG_ABBREV[]_exto $CXXFLAGS"
fi
fi
]) dnl AC_DEFUN
dnl Based on autoconf _AC_LANG_COMPILER_GNU
AC_DEFUN([_AC_WX_LANG_COMPILER_XLC],
[AC_CACHE_CHECK([whether we are using the IBM xlC _AC_LANG compiler],
[wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc],
[AC_TRY_COMPILE([],[#ifndef __xlC__
choke me
#endif
],
[wx_compiler_xlc=yes],
[wx_compiler_xlc=no])
wx_cv_[]_AC_LANG_ABBREV[]_compiler_xlc=$wx_compiler_xlc
])
])
dnl Loosely based on autoconf AC_PROG_CC
AC_DEFUN([AC_WX_PROG_XLCC],
[AC_LANG_PUSH(C)
_AC_WX_LANG_COMPILER_XLC
XLCC=`test $wx_cv_c_compiler_xlc = yes && echo yes`
AC_LANG_POP(C)
])
dnl Loosely based on autoconf AC_PROG_CXX
AC_DEFUN([AC_WX_PROG_XLCXX],
[AC_LANG_PUSH(C++)
_AC_WX_LANG_COMPILER_XLC
XLCXX=`test $wx_cv_cxx_compiler_xlc = yes && echo yes`
AC_LANG_POP(C++)
])
dnl ===========================================================================
dnl Objective-C(++) related macros

1497
aclocal.m4 vendored

File diff suppressed because it is too large Load diff

40
configure vendored
View file

@ -10608,7 +10608,9 @@ echo "$as_me: error: $build_alias -> $host_alias cross compilation not supported
fi
CFLAGS=${CFLAGS:=}
ac_ext=c
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -11532,7 +11534,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
echo "$as_me:$LINENO: checking if the C compiler requires -ext o" >&5
echo "$as_me:$LINENO: checking if the C compiler requires -ext o" >&5
echo $ECHO_N "checking if the C compiler requires -ext o... $ECHO_C" >&6
if test "${wx_cv_c_exto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@ -11590,9 +11592,9 @@ if test "x$wx_cv_c_exto" '!=' "x"; then
fi
fi
if test "x$wx_cv_c_exto" '!=' "x"; then
unset ac_cv_prog_cc_g
ac_test_CFLAGS=${CFLAGS+set}
if test "x$wx_cv_c_exto" '!=' "x"; then
unset ac_cv_prog_cc_g
ac_test_CFLAGS=${CFLAGS+set}
ac_save_CFLAGS=$CFLAGS
CFLAGS="-g"
echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5
@ -11662,9 +11664,8 @@ else
CFLAGS=
fi
fi
fi
ac_ext=c
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -11736,7 +11737,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -11809,6 +11810,7 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@ -12120,7 +12122,9 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
CXXFLAGS=${CXXFLAGS:=}
ac_ext=cc
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -12471,7 +12475,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
echo "$as_me:$LINENO: checking if the C++ compiler requires -ext o" >&5
echo "$as_me:$LINENO: checking if the C++ compiler requires -ext o" >&5
echo $ECHO_N "checking if the C++ compiler requires -ext o... $ECHO_C" >&6
if test "${wx_cv_cxx_exto+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@ -12529,9 +12533,9 @@ if test "x$wx_cv_cxx_exto" '!=' "x"; then
fi
fi
if test "x$wx_cv_cxx_exto" '!=' "x"; then
unset ac_cv_prog_cxx_g
ac_test_CXXFLAGS=${CXXFLAGS+set}
if test "x$wx_cv_cxx_exto" '!=' "x"; then
unset ac_cv_prog_cxx_g
ac_test_CXXFLAGS=${CXXFLAGS+set}
ac_save_CXXFLAGS=$CXXFLAGS
CXXFLAGS="-g"
echo "$as_me:$LINENO: checking whether $CXX accepts -g" >&5
@ -12601,9 +12605,8 @@ else
CXXFLAGS=
fi
fi
fi
ac_ext=cc
fi
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -12675,7 +12678,7 @@ ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ex
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_ext=cc
ac_ext=cc
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
@ -12748,6 +12751,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'

View file

@ -1366,14 +1366,7 @@ dnl this magic incantation is needed to prevent AC_PROG_CC from setting the
dnl default CFLAGS (something like "-g -O2") -- we don't need this as we add
dnl -g and -O flags ourselves below
CFLAGS=${CFLAGS:=}
AC_PROG_CC
AC_WX_METROWERKS_EXTO
if test "x$wx_cv_c_exto" '!=' "x"; then
unset ac_cv_prog_cc_g
_AC_PROG_CC_G
fi
AC_BAKEFILE_PROG_MWCC
AC_WX_PROG_XLCC
AC_BAKEFILE_PROG_CC
dnl is -traditional needed for correct compilations
dnl adds -traditional for gcc if needed
@ -1390,14 +1383,7 @@ dnl defines CXXFLAGS
dnl
dnl see CFLAGS line above
CXXFLAGS=${CXXFLAGS:=}
AC_PROG_CXX
AC_WX_METROWERKS_EXTO
if test "x$wx_cv_cxx_exto" '!=' "x"; then
unset ac_cv_prog_cxx_g
_AC_PROG_CXX_G
fi
AC_BAKEFILE_PROG_MWCXX
AC_WX_PROG_XLCXX
AC_BAKEFILE_PROG_CXX
AC_LANG_RESTORE