X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/937e42a3242eaa176414c87481fab9854daf49be..e926f2efc7d2f19c869d660d71f58bc413c81350:/configure.in diff --git a/configure.in b/configure.in index 84583ed334..0bf2f2b30e 100644 --- a/configure.in +++ b/configure.in @@ -1740,7 +1740,8 @@ AC_CACHE_CHECK([for va_copy], } int main() { - return foo("hi", 17); + foo("hi", 17); + return 0; }], wx_cv_func_va_copy=yes, wx_cv_func_va_copy=no @@ -1801,6 +1802,11 @@ if test "x$wx_largefile" = "xyes"; then else WX_LARGEFILE_FLAGS="-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" + fi CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS" fi @@ -2369,7 +2375,6 @@ dnl Check for libmspack dnl ------------------------------------------------------------------------ if test "$wxUSE_LIBMSPACK" != "no"; then - AC_CHECK_HEADER([mspack.h], [found_mspack_h=1]) if test "x$found_mspack_h" = "x1"; then AC_CHECK_LIB(mspack, mspack_create_chm_decompressor, @@ -2377,11 +2382,13 @@ if test "$wxUSE_LIBMSPACK" != "no"; then fi if test "x$MSPACK_LINK" = "x" ; then wxUSE_LIBMSPACK=no - else - AC_DEFINE(wxUSE_LIBMSPACK) fi fi +if test "$wxUSE_LIBMSPACK" != "no"; then + AC_DEFINE(wxUSE_LIBMSPACK) +fi + dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) @@ -2767,6 +2774,7 @@ equivalent variable and GTK+ is version 1.2.3 or above. ) PKG_CHECK_MODULES(PANGOXFT, pangoxft, [ + AC_DEFINE(HAVE_PANGO_XFT) CXXFLAGS="$CXXFLAGS $PANGOXFT_CFLAGS" GUI_TK_LIBRARY="$GUI_TK_LIBRARY $PANGOXFT_LIBS" ], @@ -3200,10 +3208,12 @@ dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl DirectDraw / Multimon for MSW dnl --------------------------------------------------------------------------- - AC_CHECK_HEADERS([multimon.h ddraw.h], [], [ - wxUSE_DISPLAY="no" - AC_MSG_WARN([ddraw.h or multimon.h not found; disabling wxDisplay]) - ] ) + AC_CHECK_HEADERS([multimon.h ddraw.h], [], + [ + wxUSE_DISPLAY="no" + AC_MSG_WARN([ddraw.h or multimon.h not found; disabling wxDisplay]) + ], + [#include ]) fi fi @@ -3217,17 +3227,19 @@ dnl --------------------------------------------------------------------------- dnl DirectShow MSW dnl --------------------------------------------------------------------------- wxUSE_DIRECTSHOW="yes" - AC_CHECK_HEADERS([dshow.h], [], [ - wxUSE_DIRECTSHOW="no" - AC_MSG_WARN([DirectShow not installed; consider installing the DirectX7 SDK or higher]) - ] ) + AC_CHECK_HEADERS([dshow.h], [], + [ + wxUSE_DIRECTSHOW="no" + AC_MSG_WARN([DirectShow not installed; consider installing the DirectX7 SDK or higher]) + ], + [#include ]) if test "$wxUSE_DIRECTSHOW" = "yes"; then - AC_DEFINE(wxUSE_DIRECTSHOW) - LIBS="$LIBS -lstrmiids" + AC_DEFINE(wxUSE_DIRECTSHOW) + LIBS="$LIBS -lstrmiids" fi fi - + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mediaplayer" AC_DEFINE(wxUSE_MEDIACTRL) fi @@ -4163,10 +4175,6 @@ if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then if test "x$GCC" != "xyes"; then dnl see http://docs.hp.com/hpux/onlinedocs/2213/threads.htm flag="$flag -D_RWSTD_MULTI_THREAD" - - dnl we also need -lcma for user threads (-lpthread is for - dnl kernel threads only) according to Ian Brown - LIBS="$LIBS -lcma" fi ;; *solaris* | alpha*-osf*) @@ -4489,21 +4497,19 @@ dnl the library may be built without GUI classes at all dnl --------------------------------------------------------------------------- if test "$wxUSE_GUI" = "yes"; then - AC_DEFINE(wxUSE_GUI) - - dnl the things we always pull in the GUI version of the library: - dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the - dnl library really can't be built without those) - dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in - dnl almost any program and the first 2 are needed to show a message box - dnl which want to be always able to do) - dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice - dnl to compile without them (if the app doesn't do any drawing, it doesn't - dnl need the dcs, pens, brushes, ...), this just can't be done now - dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem - dnl 5. misc stuff: timers, settings, message box -else - AC_DEFINE(wxUSE_NOGUI) + AC_DEFINE(wxUSE_GUI) + + dnl the things we always pull in the GUI version of the library: + dnl 1. basic things like wxApp, wxWindow, wxControl, wxFrame, wxDialog (the + dnl library really can't be built without those) + dnl 2. basic controls: wxButton, wxStaticText, wxTextCtrl (these are used in + dnl almost any program and the first 2 are needed to show a message box + dnl which want to be always able to do) + dnl 3. GDI stuff: icon, cursors and all that. Although it would be very nice + dnl to compile without them (if the app doesn't do any drawing, it doesn't + dnl need the dcs, pens, brushes, ...), this just can't be done now + dnl 4. menu stuff: wxMenu, wxMenuBar, wxMenuItem + dnl 5. misc stuff: timers, settings, message box fi dnl --------------------------------------------------------------------------- @@ -4662,7 +4668,7 @@ if test "$WXGTK20" = 1; then PKG_CHECK_MODULES(LIBGNOMEPRINTUI, [libgnomeprintui-2.2 >= 2.8], [ - EXTRALIBS_GNOMEPRINT="$LIBGNOMEPRINTUI_LIBS" +dnl EXTRALIBS_GNOMEPRINT="$LIBGNOMEPRINTUI_LIBS" CXXFLAGS="$CXXFLAGS $LIBGNOMEPRINTUI_CFLAGS" AC_DEFINE(wxUSE_LIBGNOMEPRINT) ], @@ -5032,6 +5038,67 @@ if test "$wxUSE_SOCKETS" = "yes" ; then else AC_DEFINE_UNQUOTED(SOCKLEN_T, $wx_cv_type_getsockname3) fi + dnl Do this again for getsockopt as it may be different + AC_CACHE_CHECK([what is the type of the fifth argument of getsockopt], + wx_cv_type_getsockopt5, + [ + AC_TRY_COMPILE( + [ + #include + #include + ], + [ + socklen_t len; + getsockopt(0, 0, 0, 0, &len); + ], + wx_cv_type_getsockopt5=socklen_t, + [ + dnl the compiler will compile the version with size_t + dnl even if the real type of the last parameter is int + dnl but it should give at least a warning about + dnl converting between incompatible pointer types, so + dnl try to use it to get the correct behaviour at + dnl least with gcc (otherwise we'd always use size_t) + CFLAGS_OLD="$CFLAGS" + if test "$GCC" = yes ; then + CFLAGS="$CFLAGS -Werror" + fi + + AC_TRY_COMPILE( + [ + #include + #include + ], + [ + size_t len; + getsockopt(0, 0, 0, 0, &len); + ], + wx_cv_type_getsockopt5=size_t, + AC_TRY_COMPILE( + [ + #include + #include + ], + [ + int len; + getsockopt(0, 0, 0, 0, &len); + ], + wx_cv_type_getsockopt5=int, + wx_cv_type_getsockopt5=unknown + ) + ) + + CFLAGS="$CFLAGS_OLD" + ] + ) + ]) + + if test "$wx_cv_type_getsockopt5" = "unknown"; then + wxUSE_SOCKETS=no + AC_MSG_WARN([Couldn't find socklen_t synonym for this system]) + else + AC_DEFINE_UNQUOTED(SOCKOPTLEN_T, $wx_cv_type_getsockopt5) + fi AC_LANG_POP fi fi @@ -5982,7 +6049,8 @@ INCLUDES="-I\${top_builddir}lib/wx/include/${TOOLCHAIN_FULLNAME} \ dnl C/C++ compiler options used to compile wxWidgets if test "$GXX" = yes ; then dnl CXXWARNINGS="-Wall -W -Wcast-qual -Werror" - CXXWARNINGS="-Wall" + CWARNINGS="-Wall" + CXXWARNINGS="$CWARNINGS -Wno-ctor-dtor-privacy" dnl should enable this one day... dnl CXXWARNINGS="-Wall -Werror" fi @@ -5991,7 +6059,7 @@ 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 $CXXWARNINGS` +CFLAGS=`echo $CODE_GEN_FLAGS $EXTRA_CFLAGS $CFLAGS $CWARNINGS` CXXFLAGS=`echo $CODE_GEN_FLAGS $CODE_GEN_FLAGS_CXX $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS` @@ -6144,6 +6212,17 @@ if test "$wxUSE_SHARED" = "yes"; then sanitised_bakefile_mess=`echo "$SHARED_LD_CXX" | tr -d '()'` EXE_LINKER=`eval echo "$sanitised_bakefile_mess"` + dnl Need addtional flag on OS/2, so override bakefiles value + dnl (there currently is no suitable variable to which the + dnl missing flags could be added, AFAICS. SN, 18.12.2004. ) + case "${host}" in + *-pc-os2_emx | *-pc-os2-emx ) + SHARED_LD_CC="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + SHARED_LD_CXX="`pwd`/dllar.sh -name-mangler-script ./dllnames.sh -libf INITINSTANCE -libf TERMINSTANCE -o" + cp -p ${srcdir}/src/os2/dllnames.sh . + cp -p ${srcdir}/src/os2/dllar.sh . + ;; + esac else dnl No bakefile support for static builds, but this should be ok for most. @@ -6151,19 +6230,16 @@ else fi +dnl Check to see if the platform always requires NO_GCC_PRAGMA GCC_PRAGMA_FLAGS="" -dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP: -if test $GCC_PCH = 1 ; then - GCC_PRAGMA_FLAGS="-DWX_PRECOMP -DNO_GCC_PRAGMA" -else case "${host}" in powerpc-*-darwin* ) dnl Some Apple's GCC version are broken and can't handle the dnl pragmas: GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" ;; - *-*-mingw32* | *-pc-os2_emx | *-pc-os2-emx ) - dnl MinGW and Innotek's GCC versions >= 3.2 have problems with + *-*-mingw32* ) + dnl MinGW GCC versions >= 3.2 have problems with dnl static member of classes derived from templates dnl in combination with #pragma interface/implementation dnl (the test case uses 4 files) @@ -6172,7 +6248,23 @@ else if test "$wxUSE_STL" = "yes" -o \ "$wxUSE_NO_EXCEPTIONS" != "yes" -o \ "$wxUSE_NO_RTTI" != "yes"; then - AC_MSG_CHECKING([if this compiler version needs -DNO_GCC_PRAGMA]) + AC_MSG_CHECKING([if this MinGW version needs -DNO_GCC_PRAGMA]) + AC_TRY_COMPILE([], + [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) + #error "Not GCC 3.2 or greater" + #endif + ], + [GCC_PRAGMA_FLAGS="-DNO_GCC_PRAGMA" + AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no])]) + fi + ;; + *-pc-os2_emx | *-pc-os2-emx ) + dnl GCC versions ported to OS/2 have similar problems with + dnl static member of classes in combination with STL and + dnl pragma interface/implementation + if test "$wxUSE_STL" = "yes"; then + AC_MSG_CHECKING([if this gcc version needs -DNO_GCC_PRAGMA]) AC_TRY_COMPILE([], [#if !(__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2)) #error "Not GCC 3.2 or greater" @@ -6184,8 +6276,18 @@ else fi ;; esac + +dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP: +PCH_FLAGS="" +if test $GCC_PCH = 1 ; then + if test "x$GCC_PRAGMA_FLAGS" = "x"; then + PCH_FLAGS="-DWX_PRECOMP -DNO_GCC_PRAGMA" + else + PCH_FLAGS="-DWX_PRECOMP" + fi fi -CPPFLAGS="$GCC_PRAGMA_FLAGS $CPPFLAGS" + +CPPFLAGS="$PCH_FLAGS $GCC_PRAGMA_FLAGS $CPPFLAGS" dnl for convenience, sort the samples in alphabetical order @@ -6391,7 +6493,7 @@ echo " odbc ${wxUSE_ODBC}" echo " expat ${wxUSE_EXPAT}" echo " libmspack ${wxUSE_LIBMSPACK}" echo " sdl ${wxUSE_LIBSDL}" -echo " gnomeprint ${wxUSE_LIBGNOMEPRINT}" +echo " gnomeprint ${wxUSE_LIBGNOMEPRINT-none}" echo ""