autumn cleanup of configure:

1. we now consistently use WXCONFIG_C[PP|XX]_FLAGS instead of a mix of CODE_GEN_FLAGS
   plus tons of ad hoc variables (TOOLCHAIN_DEFS, WX_LARGEFILE_FLAGS, WXDEBUG_DEFINE
   and so on) which could all be simply removed now

2. output more stuff which used to be in CFLAGS only in wx-config output:
 a) pthread options (they are needed for user code compilation too)
 b) -D__STDC__EXT needed under HP-UX, this should finally fix the build there

3. also removed GCC_PRAGMA_FLAGS which is unused any more

4. use consitent naming for a couple of other variables


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@36220 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2005-11-22 02:06:16 +00:00
parent 4647fc0833
commit 5ff751d600
3 changed files with 538 additions and 884 deletions

1145
configure vendored

File diff suppressed because one or more lines are too long

View File

@ -1866,7 +1866,7 @@ dnl sizeof(off_t) in different source files of the same program and linking
dnl problems
if test "x$wx_largefile" = "xyes"; then
if test "x$ac_cv_sys_file_offset_bits" = "x64"; then
WX_LARGEFILE_FLAGS="-D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGE_FILES"
dnl We get "Large Files (ILP32) not supported in strict ANSI mode."
dnl #error from HP standard headers unless __STDC_EXT__ is defined.
@ -1895,18 +1895,17 @@ if test "x$wx_largefile" = "xyes"; then
]
)
if test "x$wx_cv_STDC_EXT_required" = "xyes"; then
CXXFLAGS="$CXXFLAGS -D__STDC_EXT__"
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -D__STDC_EXT__"
fi
fi
else
WX_LARGEFILE_FLAGS="-D_LARGE_FILES"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGE_FILES"
fi
dnl AC_FUNC_FSEEKO sets HAVE_FSEEKO and $ac_cv_sys_largefile_source
AC_FUNC_FSEEKO
if test "$ac_cv_sys_largefile_source" != no; then
WX_LARGEFILE_FLAGS="$WX_LARGEFILE_FLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_LARGEFILE_SOURCE=$ac_cv_sys_largefile_source"
fi
CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS"
fi
dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling)
@ -2710,7 +2709,6 @@ if test "$USE_WIN32" = 1 ; then
*-*-cygwin* )
dnl Cygwin doesn't include these by default
LIBS="$LIBS -lkernel32 -luser32"
TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WIN95__"
esac
dnl add extra odbc libs if we have compiled in odbc
@ -3546,7 +3544,7 @@ if test "$wxUSE_ODBC" != "no" ; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
dnl is this still necessary?
WXODBCFLAG="-D_IODBC_"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_IODBC_"
fi
dnl ---------------------------------------------------------------------------
@ -3778,7 +3776,9 @@ EOF
;;
*-*-cygwin* | *-*-mingw32* )
TOOLCHAIN_DLL_DEFS="${TOOLCHAIN_DLL_DEFS} -DWXUSINGDLL=1"
dnl this one shouldn't be used for the library build so put it in a
dnl separate variable from WXCONFIG_CPPFLAGS
WXCONFIG_ONLY_CPPFLAGS="$WXCONFIG_ONLY_CPPFLAGS -DWXUSINGDLL"
;;
*-*-hpux* )
@ -4614,7 +4614,6 @@ dnl the next matching "else")
dnl ---------------------------------------------------------------------------
dnl under MSW (except mingw32) we always have thread support
CPP_MT_FLAG=
if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
dnl the code below:
@ -4788,11 +4787,8 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
THREADS_CFLAGS="$THREADS_CFLAGS $flag"
fi
if test "x$THREADS_CFLAGS" != "x"; then
dnl don't add these options to CPPFLAGS as cpp might not know them
CFLAGS="$CFLAGS $THREADS_CFLAGS"
CXXFLAGS="$CXXFLAGS $THREADS_CFLAGS"
fi
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS $THREADS_CFLAGS"
fi
fi
@ -4954,8 +4950,7 @@ else
if test "$wx_cv_cflags_mthread" = "yes"; then
dnl it does, use it
CXXFLAGS="$CXXFLAGS -mthreads"
TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads"
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mthreads"
LDFLAGS="$LDFLAGS -mthreads"
else
dnl it doesn't
@ -4963,8 +4958,8 @@ else
fi
;;
*-pc-os2*emx )
CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -Zmt -D__ST_MT_ERRNO__"
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
LDFLAGS="$LDFLAGS -Zmt"
;;
esac
@ -4981,7 +4976,7 @@ else
if test "$ac_cv_func_strtok_r" = "yes"; then
AC_MSG_CHECKING(if -D_REENTRANT is needed)
if test "$NEEDS_D_REENTRANT_FOR_R_FUNCS" = 1; then
TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D_REENTRANT"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D_REENTRANT"
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
@ -5006,26 +5001,27 @@ if test "$WXGPE" = 1 ; then
AC_DEFINE_UNQUOTED(__WXGPE__,$WXGPE)
fi
WXDEBUG=
dnl DEBUG_FLAG contains debugging options (supposed to be the same for C and C++
dnl compilers: we'd need a separate WXDEBUG_CXX if this is ever not the case)
DEBUG_FLAG=
if test "$wxUSE_DEBUG_INFO" = "yes" ; then
WXDEBUG="-g"
DEBUG_FLAG="-g"
wxUSE_OPTIMISE=no
fi
if test "$wxUSE_DEBUG_GDB" = "yes" ; then
wxUSE_DEBUG_INFO=yes
if test "$GCC" = yes; then
WXDEBUG="-ggdb"
DEBUG_FLAG="-ggdb"
fi
fi
if test "$wxUSE_DEBUG_FLAG" = "yes" ; then
AC_DEFINE(WXDEBUG)
WXDEBUG_DEFINE="-D__WXDEBUG__"
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS -D__WXDEBUG__"
else
if test "$wxUSE_GTK" = 1 ; then
WXDEBUG_DEFINE="-DGTK_NO_CHECK_CASTS"
CPPFLAGS="$CPPFLAGS -DGTK_NO_CHECK_CASTS"
fi
fi
@ -5040,22 +5036,21 @@ if test "$wxUSE_DMALLOC" = "yes" ; then
DMALLOC_LIBS="-ldmallocthcxx"
fi
PROFILE=
dnl cc/cxx/ld option for profiling
PROFILE_FLAG=
if test "$wxUSE_PROFILE" = "yes" ; then
PROFILE=" -pg"
PROFILE_FLAG=" -pg"
fi
CODE_GEN_FLAGS=
CODE_GEN_FLAGS_CXX=
if test "$GCC" = "yes" ; then
if test "$wxUSE_NO_RTTI" = "yes" ; then
CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-rtti"
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-rtti"
fi
if test "$wxUSE_NO_EXCEPTIONS" = "yes" ; then
CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fno-exceptions"
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fno-exceptions"
fi
if test "$wxUSE_PERMISSIVE" = "yes" ; then
CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fpermissive"
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -fpermissive"
fi
dnl Ian Brown <ian.brown@printsoft.de> reports that versions of gcc before
@ -5071,33 +5066,27 @@ if test "$GCC" = "yes" ; then
dnl TODO: test for the gcc version here (how?)
case "${host}" in
powerpc*-*-aix* )
CODE_GEN_FLAGS="$CODE_GEN_FLAGS -mminimal-toc"
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -mminimal-toc"
;;
*-hppa* )
CODE_GEN_FLAGS="$CODE_GEN_FLAGS -ffunction-sections"
WXCONFIG_CFLAGS="$WXCONFIG_CFLAGS -ffunction-sections"
;;
esac
fi
OPTIMISE=
dnl C/C++ compiler option for optimization (supposed to be the same for both)
OPTIMISE_FLAG=
if test "$wxUSE_OPTIMISE" = "no" ; then
if test "$GCC" = yes ; then
dnl use -O0 because compiling with it is faster than compiling with no
dnl optimization options at all (at least with g++ 3.2)
OPTIMISE="-O0"
OPTIMISE_FLAG="-O0"
fi
else
if test "$GCC" = yes ; then
OPTIMISE="-O2"
dnl VZ: does anybody know what does this do??
case "${host}" in
i586-*-*|i686-*-* )
OPTIMISE="${OPTIMISE} "
;;
esac
OPTIMISE_FLAG="-O2"
else
OPTIMISE="-O"
OPTIMISE_FLAG="-O"
fi
fi
@ -6047,7 +6036,7 @@ if test "$USE_WIN32" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \
[],
[AC_MSG_RESULT(no)],
[AC_MSG_RESULT(yes)
CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"])
WXCONFIG_CXXFLAGS="$WXCONFIG_CXXFLAGS -fvtable-thunks"])
AC_LANG_RESTORE
LIBS=" -lrpcrt4 -loleaut32 -lole32 -luuid$LIBS"
if test "$wxUSE_OLE" = "yes" ; then
@ -6932,15 +6921,6 @@ else
fi
dnl all -I options we must pass to the compiler
dnl
dnl note that the order is somewhat important: wxWidgets headers should
dnl come first and the one with setup.h should be before $(top_srcdir)/include
dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g.
dnl CodeWarrior):
INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \
-I\${top_srcdir}/include $TOOLKIT_INCLUDE"
dnl C/C++ compiler options used to compile wxWidgets
dnl
dnl check for icc before gcc as icc is also recognized as gcc
@ -6980,12 +6960,30 @@ elif test "$GXX" = yes ; then
CXXWARNINGS="-Wall -Wundef -Wno-ctor-dtor-privacy"
fi
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE"
dnl remove the extra white space from the cc/c++/ld options
CPPFLAGS=`echo $WXDEBUG_DEFINE $INCLUDES $CPPFLAGS`
CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CWARNINGS`
CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS`
dnl combine everything together and remove the extra white space while doing it
WXCONFIG_CFLAGS=`echo $WXCONFIG_CFLAGS`
WXCONFIG_CXXFLAGS=`echo $WXCONFIG_CFLAGS $WXCONFIG_CXXFLAGS`
dnl add -I options we use during library compilation
dnl
dnl note that the order is somewhat important: wxWidgets headers should
dnl come first and the one with setup.h should be before $(top_srcdir)/include
dnl in case the latter contains setup.h used by non-autoconf makefiles (e.g.
dnl CodeWarrior):
CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $CPPFLAGS \
-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \
-I\${top_srcdir}/include $TOOLKIT_INCLUDE`
C_AND_CXX_FLAGS="$DEBUG_FLAG $PROFILE_FLAG $OPTIMISE_FLAG"
CFLAGS=`echo $WXCONFIG_CFLAGS $CFLAGS $CWARNINGS $C_AND_CXX_FLAGS`
CXXFLAGS=`echo $WXCONFIG_CXXFLAGS $CXXFLAGS $C_AND_CXX_FLAGS`
dnl now that we added WXCONFIG_CPPFLAGS to CPPFLAGS we can add the wx-config
dnl only stuff to it
WXCONFIG_CPPFLAGS=`echo $WXCONFIG_CPPFLAGS $WXCONFIG_ONLY_CPPFLAGS`
if test "x$MWCC" = "xyes"; then
dnl Correct MW 8.3 to be more similar to GCC. In particular we
@ -7015,16 +7013,9 @@ if test "$wxUSE_OPENGL" = "yes"; then
EXTRALIBS_OPENGL="$LDFLAGS_GL $OPENGL_LIBS"
fi
LDFLAGS="$LDFLAGS $PROFILE"
LDFLAGS="$LDFLAGS $PROFILE_FLAG"
dnl wxGTK does not need TOOLKIT includes in wx-config
if test "$wxUSE_GTK" = 1; then
WXCONFIG_INCLUDE=
else
WXCONFIG_INCLUDE="$TOOLKIT_INCLUDE"
fi
WXCONFIG_EXTRALIBS="$LIBS"
WXCONFIG_LIBS="$LIBS"
dnl wx-config must output builtin 3rd party libs in --libs in static build:
if test "$wxUSE_REGEX" = "builtin" ; then
@ -7050,7 +7041,7 @@ if test "$wxUSE_ZLIB" = "builtin" ; then
fi
for i in $wxconfig_3rdparty ; do
WXCONFIG_EXTRALIBS="-lwx${i}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_EXTRALIBS"
WXCONFIG_LIBS="-lwx${i}${lib_debug_suffix}${WX_LIB_FLAVOUR}-${WX_RELEASE}${HOST_SUFFIX} $WXCONFIG_LIBS"
done
@ -7193,9 +7184,8 @@ if test $GCC_PCH = 1 ; then
CPPFLAGS="-DWX_PRECOMP $CPPFLAGS"
fi
dnl TOOLCHAIN_DEFS are used by wx-config but should be also used for wx build
dnl itself
CPPFLAGS="$CPPFLAGS $TOOLCHAIN_DEFS"
dnl TOOLCHAIN_DEFS should be used for both wx and client code
WXCONFIG_CPPFLAGS="$WXCONFIG_CPPFLAGS $TOOLCHAIN_DEFS"
dnl for convenience, sort the samples in alphabetical order
dnl
@ -7217,9 +7207,6 @@ dnl global options
AC_SUBST(WX_LIBRARY_BASENAME_NOGUI)
AC_SUBST(WX_LIBRARY_BASENAME_GUI)
dnl debugging options
AC_SUBST(WXDEBUG_DEFINE)
dnl toolkit options
AC_SUBST(USE_GUI)
AC_SUBST(AFMINSTALL)
@ -7228,8 +7215,6 @@ AC_SUBST(TOOLKIT)
AC_SUBST(TOOLKIT_DIR)
AC_SUBST(TOOLCHAIN_NAME)
AC_SUBST(TOOLCHAIN_FULLNAME)
AC_SUBST(TOOLCHAIN_DEFS)
AC_SUBST(TOOLCHAIN_DLL_DEFS)
dnl wx-config options
AC_SUBST(host_alias)
@ -7240,14 +7225,24 @@ AC_SUBST(WX_VERSION)
AC_SUBST(WX_SUBVERSION)
AC_SUBST(WX_CHARTYPE)
AC_SUBST(WX_DEBUGTYPE)
AC_SUBST(WXCONFIG_EXTRALIBS)
AC_SUBST(WXCONFIG_INCLUDE)
dnl note that in addition to the usual CPP/C/CXXFLAGS which are used for
dnl building the library itself, we also have WXCONFIG_-prefixed variants which
dnl are used when building the libraries using the library
dnl
dnl so put anything which should be used only during the library build in, e.g.
dnl CXXFLAGS, but put everything else (by default) into WXCONFIG_CXXFLAGS
dnl
dnl and, finally, for some things which should be only used by wx-config but
dnl not during the library compilation, use WXCONFIG_ONLY_CPPFLAGS which is
dnl added to WXCONFIG_CPPFLAGS after adding the latter to CPPFLAGS
AC_SUBST(WXCONFIG_CPPFLAGS)
AC_SUBST(WXCONFIG_CFLAGS)
AC_SUBST(WXCONFIG_CXXFLAGS)
AC_SUBST(WXCONFIG_LIBS)
AC_SUBST(WXCONFIG_RPATH)
AC_SUBST(WXCONFIG_LDFLAGS_GUI)
AC_SUBST(WX_LARGEFILE_FLAGS)
AC_SUBST(GCC_PRAGMA_FLAGS)
AC_SUBST(CODE_GEN_FLAGS)
AC_SUBST(CODE_GEN_FLAGS_CXX)
AC_SUBST(EXE_LINKER)
dnl distribution vars

View File

@ -946,7 +946,7 @@ fi
# Additional configuration for individual library components.
ldflags_gl="@LDFLAGS_GL@"
ldlibs_base="@WXCONFIG_EXTRALIBS@"
ldlibs_base="@WXCONFIG_LIBS@"
ldlibs_core="@EXTRALIBS_GUI@"
ldlibs_gl="@OPENGL_LIBS@"
ldlibs_html="@EXTRALIBS_HTML@"
@ -1143,12 +1143,12 @@ else
_include_cppflags="-I${includedir} -I${prefix}/contrib/include"
fi
_cppflags=$(echo "-I${libdir}/wx/include/@TOOLCHAIN_FULLNAME@" $_include_cppflags "@WXDEBUG_DEFINE@" "@TOOLCHAIN_DEFS@" "@TOOLCHAIN_DLL_DEFS@" $_gui_cppflags "@WXCONFIG_INCLUDE@" "@WX_LARGEFILE_FLAGS@" "@GCC_PRAGMA_FLAGS@")
_cppflags=$(echo "-I${libdir}/wx/include/@TOOLCHAIN_FULLNAME@" $_include_cppflags "@WXCONFIG_CPPFLAGS@" $_gui_cppflags)
# now without further ado, we can answer these too.
[ -z "$output_option_cppflags" ] || echo $_cppflags
[ -z "$output_option_cflags" ] || echo $_cppflags "@CODE_GEN_FLAGS@"
[ -z "$output_option_cxxflags" ] || echo $_cppflags "@CODE_GEN_FLAGS@" "@CODE_GEN_FLAGS_CXX@"
[ -z "$output_option_cflags" ] || echo $_cppflags "@WXCONFIG_CFLAGS@"
[ -z "$output_option_cxxflags" ] || echo $_cppflags "@WXCONFIG_CXXFLAGS@"
[ -z "$output_option_gl_libs" ] || echo $(lib_flags_for gl)
[ -z "$output_option_linkdeps" ] || echo $link_deps