X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a0b9e27fd42c8dc951ee23ac545298c1fbef7976..4e3ad7c095f0a047b48445d76316fc20f394f3e9:/configure.in diff --git a/configure.in b/configure.in index b19393b144..b63d32b6a2 100644 --- a/configure.in +++ b/configure.in @@ -353,6 +353,8 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_FONTMAP=no DEFAULT_wxUSE_STREAMS=no DEFAULT_wxUSE_SOCKETS=no + DEFAULT_wxUSE_OLE=no + DEFAULT_wxUSE_DATAOBJ=no DEFAULT_wxUSE_DIALUP_MANAGER=no DEFAULT_wxUSE_JOYSTICK=no DEFAULT_wxUSE_DYNLIB_CLASS=no @@ -526,6 +528,8 @@ else DEFAULT_wxUSE_FONTMAP=yes DEFAULT_wxUSE_STREAMS=yes DEFAULT_wxUSE_SOCKETS=yes + DEFAULT_wxUSE_OLE=yes + DEFAULT_wxUSE_DATAOBJ=yes DEFAULT_wxUSE_DIALUP_MANAGER=yes DEFAULT_wxUSE_JOYSTICK=yes DEFAULT_wxUSE_DYNLIB_CLASS=yes @@ -711,8 +715,8 @@ WX_ARG_ENABLE(soname, [ --enable-soname set the DT_SONAME field in WX_ARG_ENABLE(optimise, [ --enable-optimise create optimised code], wxUSE_OPTIMISE) WX_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info], wxUSE_DEBUG) -dnl allow the precompiled header option to be disabled under Mac OS X -WX_ARG_ENABLE(precomp, [ --enable-precomp enable use of precompiled headers (Mac OS X)], wxUSE_PRECOMP) +dnl allow the precompiled header option to be disabled under Mac OS X/Darwin +WX_ARG_ENABLE(precomp, [ --enable-precomp enable use of precompiled headers (Mac OS X/Darwin)], wxUSE_PRECOMP) if test "$wxUSE_DEBUG" = "yes"; then DEFAULT_wxUSE_DEBUG_FLAG=yes @@ -755,6 +759,8 @@ WX_ARG_ENABLE(ftp, [ --enable-ftp use wxFTP (requires wxPr WX_ARG_ENABLE(http, [ --enable-http use wxHTTP (requires wxProtocol], wxUSE_PROTOCOL_HTTP) WX_ARG_ENABLE(fileproto, [ --enable-fileproto use wxFileProto class (requires wxProtocol], wxUSE_PROTOCOL_FILE) WX_ARG_ENABLE(sockets, [ --enable-sockets use socket/network classes], wxUSE_SOCKETS) +WX_ARG_ENABLE(ole, [ --enable-ole use OLE classes], wxUSE_OLE) +WX_ARG_ENABLE(dataobj, [ --enable-dataobj use data object classes], wxUSE_DATAOBJ) WX_ARG_ENABLE(ipc, [ --enable-ipc use interprocess communication (wxSocket etc.)], wxUSE_IPC) @@ -1457,6 +1463,20 @@ AC_DEFINE_UNQUOTED(SIZEOF_WCHAR_T, $wx_cv_sizeof_wchar_t) dnl check for large file support AC_SYS_LARGEFILE +dnl we need to define _FILE_OFFSET_BITS or _LARGE_FILES on the compiler command +dnl line because otherwise the system headers risk being included before +dnl wx/defs.h which defines these constants leading to inconsistent +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" + else + WX_LARGEFILE_FLAGS="-D_LARGE_FILES" + fi + CPPFLAGS="$CPPFLAGS $WX_LARGEFILE_FLAGS" +fi + dnl check for bytesex stuff (don't use AC_C_BIGENDIAN to allow cross-compiling) WX_C_BIGENDIAN @@ -1476,8 +1496,11 @@ dnl --------------------------------------------------------------------------- dnl notice that /usr/include should not be in this list, otherwise it breaks dnl compilation on Solaris/gcc because standard headers are included instead -dnl of the gcc ones (correction: it *is* needed for broken AIX compiler - but -dnl do put it last!) +dnl of the gcc ones. (recorrection.. sadly much depends on this since it was +dnl first created and then 'corrected'.. removing /usr/include means system +dnl GL and Xpm libs will dnl not be found on linux and probably other platforms +dnl now. We need to correct that first before removing /usr/include again. +dnl see the various (ab)uses of WX_PATH_FIND_LIBRARIES below ) dnl dnl Also try to put all directories which may contain X11R6 before those which dnl may contain X11R5/4 - we want to use R6 on machines which have both! @@ -1545,7 +1568,6 @@ SEARCH_INCLUDE="\ /usr/lpp/Xamples/include \ \ /usr/openwin/share/include \ - \ /usr/include" SEARCH_LIB="`echo "$SEARCH_INCLUDE" | sed s/include/lib/g` " @@ -1886,6 +1908,16 @@ if test "$USE_WIN32" = 1 ; then RESPROGRAMOBJ="\$(PROGRAM)_resources.o" fi +if test "$USE_DARWIN" = 1; then + dnl Mac OS X/Darwin GCC uses precompiled headers by default + dnl this can cause problems both when compiling wxMac and wxBase + if test "$wxUSE_PRECOMP" = "yes"; then + CPPFLAGS="$CPPFLAGS -cpp-precomp" + else + CPPFLAGS="$CPPFLAGS -no-cpp-precomp" + fi +fi + if test "$wxUSE_GUI" = "yes"; then USE_GUI=1 @@ -2174,7 +2206,9 @@ equivalent variable and GTK+ is version 1.2.3 or above. mesa_link=" -lMesaGL" AC_MSG_RESULT(found at $ac_find_libraries) else - AC_MSG_ERROR(no) + mesa_link="" + AC_MSG_RESULT(no) + AC_MSG_WARN(library will be compiled without Mesa support) fi GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lwine$mesa_link$xpm_link -lXxf86dga -lXxf86vm -lSM -lICE -lXext -lXmu -lX11 -lncurses" @@ -2304,7 +2338,7 @@ equivalent variable and GTK+ is version 1.2.3 or above. for libp in "" " -lXp"; do if test "$libs_found" = "0"; then for libsm_ice in " -lSM -lICE"; do - if test "$libs_found" = "0"; then + if test "$libs_found" = "0"; then save_LIBS="$LIBS" LIBS="$GUI_TK_LIBRARY -lXm${xpm_link} ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11" save_CFLAGS=$CFLAGS @@ -2349,14 +2383,7 @@ equivalent variable and GTK+ is version 1.2.3 or above. fi if test "$wxUSE_MAC" = 1; then - if test "$wxUSE_PRECOMP" = "yes"; then - CPPFLAGS="$CPPFLAGS -cpp-precomp" - else - CPPFLAGS="$CPPFLAGS -no-cpp-precomp" - fi - CPPFLAGS="$CPPFLAGS -I/Developer/Headers/FlatCarbon -I\${top_srcdir}/src/mac/morefile" - CFLAGS="$CFLAGS -fpascal-strings" - CXXFLAGS="$CXXFLAGS -fpascal-strings" + CPPFLAGS="$CPPFLAGS -fpascal-strings -I\${top_srcdir}/src/mac/morefile -I/Developer/Headers/FlatCarbon" TOOLKIT_VPATH="\${top_srcdir}/src/mac${PATH_IFS}\${top_srcdir}/src/mac/morefile" TOOLKIT=MAC @@ -2646,8 +2673,9 @@ if test "$wxUSE_SHARED" = "yes"; then case "${host}" in *-hp-hpux* ) dnl default settings are good for gcc but not for the native HP-UX - if test "$GCC" == "yes"; then - SHARED_LD="${SHARED_LD} ${PIC_FLAG}" + if test "$GCC" = "yes"; then + dnl -o flag must be after PIC flag + SHARED_LD="${CXX} -shared ${PIC_FLAG} -o" else dnl no idea why it wants it, but it does LDFLAGS="$LDFLAGS -L/usr/lib" @@ -2708,8 +2736,9 @@ if test "$wxUSE_SHARED" = "yes"; then *-*-darwin* ) dnl For Unix to MacOS X porting instructions, see: dnl http://fink.sourceforge.net/doc/porting/porting.html - CFLAGS="$CFLAGS -fno-common -DWXMAKINGDLL" - CXXFLAGS="$CXXFLAGS -fno-common -DWXMAKINGDLL" + TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -DWXMAKINGDLL" + CFLAGS="$CFLAGS -fno-common" + CXXFLAGS="$CXXFLAGS -fno-common" dnl wxWindows must be fully binded (lazy binding breaks RTTI classinfo) dnl this can be done either with the exe linker flag -Wl,-bind_at_load dnl or with a double stage link in order to create a single module @@ -2802,6 +2831,12 @@ if test "$wxUSE_SHARED" = "no"; then WX_TARGET_LIBRARY_TYPE="a" INSTALL_LIBRARY='$(INSTALL_DATA)' + + dnl wx-config should assume the --static flag by default if we don't have + dnl any shared libs anyhow + STATIC_FLAG="yes" +else + STATIC_FLAG="no" fi if test "$wxUSE_MAC" = 1; then @@ -3017,9 +3052,6 @@ if test "$wxUSE_ON_FATAL_EXCEPTION" = "yes" -a "$wxUSE_UNIX" = "yes"; then fi fi -dnl check for vfork() (even if it's the same as fork() in modern Unices) -AC_CHECK_FUNCS(vfork) - dnl check for the function for temp files creation AC_CHECK_FUNCS(mkstemp mktemp, break) @@ -3110,7 +3142,7 @@ if test "$USE_BEOS" = 1; then fi if test "$USE_DARWIN" = 1; then - dnl Mac OS X has both nanosleep and usleep + dnl Mac OS X/Darwin has both nanosleep and usleep dnl but only usleep is defined in unistd.h AC_DEFINE(HAVE_USLEEP) HAVE_SOME_SLEEP_FUNC=1 @@ -3196,7 +3228,6 @@ dnl --------------------------------------------------------------------------- dnl under MSW (except mingw32) we always have thread support CPP_MT_FLAG= -COMMON_THREADCPPFLAGS= if test "$TOOLKIT" != "MSW"; then dnl the code below: @@ -3319,6 +3350,9 @@ if test "$TOOLKIT" != "MSW"; then *-aix* | *-freebsd*) flag="-D_THREAD_SAFE" ;; + *-hp-hpux* ) + flag="-D_REENTRANT" + ;; *solaris* | alpha*-osf*) flag="-D_REENTRANT" ;; @@ -3456,10 +3490,28 @@ else if test "$wxUSE_THREADS" = "yes" ; then case "${host}" in *-*-mingw32* ) - CFLAGS="$CFLAGS -mthreads" - CXXFLAGS="$CXXFLAGS -mthreads" - COMMON_THREADCPPFLAGS="-mthreads" - LDFLAGS="$LDFLAGS -mthreads" + dnl check if the compiler accepts -mthreads + AC_CACHE_CHECK([if compiler supports -mthreads], + wx_cv_cflags_mthread, + [ + CFLAGS_OLD="$CFLAGS" + CFLAGS="$CFLAGS -mthreads" + AC_TRY_COMPILE([], [], + wx_cv_cflags_mthread=yes, + wx_cv_cflags_mthread=no + ) + ] + ) + + if test "$wx_cv_cflags_mthread" = "yes"; then + dnl it does, use it + CXXFLAGS="$CXXFLAGS -mthreads" + TOOLCHAIN_DEFS="$TOOLCHAIN_DEFS -mthreads" + LDFLAGS="$LDFLAGS -mthreads" + else + dnl it doesn't + CFLAGS="$CFLAGS_OLD" + fi ;; esac fi @@ -3903,7 +3955,7 @@ dnl ------------------------------------------------------------------------ dnl wxSocket dnl ------------------------------------------------------------------------ -dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11 +dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxMGL if test "$wxUSE_SOCKETS" = "yes"; then if test "$wxUSE_MGL" = "1"; then AC_MSG_WARN([wxSocket not yet supported under MGL... disabled]) @@ -4170,7 +4222,7 @@ fi if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then -dnl There is now experimental generic MDI support +dnl There is now experimental generic MDI support dnl if test "$wxUSE_UNIVERSAL" = "yes"; then dnl AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled) dnl wxUSE_MDI_ARCHITECTURE=no @@ -4244,6 +4296,7 @@ dnl check for ole headers and disable a few features requiring it if not dnl present (earlier versions of mingw32 don't have ole2.h) if test "$wxUSE_MSW" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \ -o "$wxUSE_CLIPBOARD" = "yes" \ + -o "$wxUSE_OLE" = "yes" \ -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then AC_CHECK_HEADERS(ole2.h) @@ -4274,6 +4327,51 @@ if test "$wxUSE_MSW" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \ wxUSE_CLIPBOARD=no wxUSE_DRAG_AND_DROP=no wxUSE_DATAOBJ=no + wxUSE_OLE=no + fi + + if test "$wxUSE_METAFILE" = "yes"; then + AC_DEFINE(wxUSE_METAFILE) + + dnl this one should probably be made separately configurable + AC_DEFINE(wxUSE_ENH_METAFILE) + fi +fi + +if test "$wxUSE_WINE" = 1 -a \( "$wxUSE_DATAOBJ" = "yes" \ + -o "$wxUSE_CLIPBOARD" = "yes" \ + -o "$wxUSE_OLE" = "yes" \ + -o "$wxUSE_DRAG_AND_DROP" = "yes" \) ; then + AC_CHECK_HEADERS(ole2.h) + + if test "$ac_cv_header_ole2_h" = "yes" ; then + if test "$GCC" = yes ; then + AC_LANG_SAVE + AC_LANG_CPLUSPLUS + + AC_MSG_CHECKING([if g++ requires -fvtable-thunks]) + AC_TRY_COMPILE([#include + #include ], + [], + [AC_MSG_RESULT(no)], + [AC_MSG_RESULT(yes) + CODE_GEN_FLAGS_CXX="$CODE_GEN_FLAGS_CXX -fvtable-thunks"]) + AC_LANG_RESTORE + ALL_OBJECTS="$ALL_OBJECTS \$(OLEOBJS)" + LIBS=" -lwine_uuid$LIBS" + AC_DEFINE(wxUSE_OLE) + + fi + + dnl for OLE clipboard and dnd + AC_DEFINE(wxUSE_DATAOBJ) + else + AC_MSG_WARN([Some features disabled because OLE headers not found]) + + wxUSE_CLIPBOARD=no + wxUSE_DRAG_AND_DROP=no + wxUSE_DATAOBJ=no + wxUSE_OLE=no fi if test "$wxUSE_METAFILE" = "yes"; then @@ -4911,9 +5009,10 @@ if test "$GXX" = yes ; then fi fi -EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES" +EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE" dnl remove the extra white space from the cc/c++/ld options +CPPFLAGS=`echo $INCLUDES $CPPFLAGS | sed 's/ \\+/ /g'` CFLAGS=`echo $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'` CXXFLAGS=`echo $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS | sed 's/ \+/ /g'` LIBS=`echo $LIBS | sed 's/ \+/ /g'` @@ -4967,6 +5066,8 @@ AC_SUBST(SONAME_FLAGS_GL) AC_SUBST(WX_TARGET_LIBRARY_SONAME) AC_SUBST(WX_TARGET_LIBRARY_TYPE) +AC_SUBST(STATIC_FLAG) + dnl debugging options AC_SUBST(WXDEBUG_DEFINE) @@ -4989,6 +5090,7 @@ AC_SUBST(WXCONFIG_LIBS_STATIC) AC_SUBST(WXCONFIG_LIBS_STATIC_GL) AC_SUBST(WXCONFIG_INCLUDE) AC_SUBST(WXCONFIG_RPATH) +AC_SUBST(WX_LARGEFILE_FLAGS) dnl the list of files to compile/install AC_SUBST(ALL_OBJECTS) @@ -5000,7 +5102,6 @@ AC_SUBST(GUIDIST) AC_SUBST(PORT_FILES) AC_SUBST(DISTDIR) -AC_SUBST(COMMON_THREADCPPFLAGS) dnl additional subdirectories where we will build AC_SUBST(SAMPLES_SUBDIRS)