X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/ef0add05f105d5950fc30436cf9274c6e13bf59c..18dbdd3c2785b504c02ebf3739503a0183cae39b:/configure.in diff --git a/configure.in b/configure.in index 7677c204e9..07da7033ad 100644 --- a/configure.in +++ b/configure.in @@ -73,6 +73,7 @@ dnl ------------------------------------------------------------------------ dnl OS (assume Unix) USE_UNIX=1 +USE_OS2=0 USE_WIN32=0 USE_DOS=0 USE_BEOS=0 @@ -288,8 +289,34 @@ case "${host}" in *-pc-os2_emx | *-pc-os2-emx ) AC_DEFINE(__EMX__) + USE_OS2=1 PROGRAM_EXT=".exe" DEFAULT_DEFAULT_wxUSE_PM=1 + dnl "c++" wrapper is not always available, so always use plain gcc. + CXX=gcc + LDFLAGS="$LDFLAGS -Zcrtdll -Zsysv-signals" + dnl + dnl Some special code that's automatically added by autoconf-2.57 for OS/2 + dnl and hopefully also by autoconf-2.58 and newer on all other platforms. + dnl For now however, we still need it to make sure the configure script + dnl works on OS/2 no matter what platform it is generated on. + ac_executable_extensions=".exe" + export ac_executable_extensions + dnl This strange code is necessary to deal with handling of + dnl backslashes by ksh and pdksh's sh variant. + ac_save_IFS="$IFS" + IFS="\\" + ac_TEMP_PATH= + for ac_dir in $PATH; do + IFS=$ac_save_IFS + if test -z "$ac_TEMP_PATH"; then + ac_TEMP_PATH="$ac_dir" + else + ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir" + fi + done + export PATH="$ac_TEMP_PATH" + unset ac_TEMP_PATH ;; powerpc-*-darwin* ) @@ -464,6 +491,7 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_GAUGE=no DEFAULT_wxUSE_GRID=no DEFAULT_wxUSE_IMAGLIST=no + DEFAULT_wxUSE_LISTBOOK=no DEFAULT_wxUSE_LISTBOX=no DEFAULT_wxUSE_LISTCTRL=no DEFAULT_wxUSE_NOTEBOOK=no @@ -640,6 +668,7 @@ else DEFAULT_wxUSE_GAUGE=yes DEFAULT_wxUSE_GRID=yes DEFAULT_wxUSE_IMAGLIST=yes + DEFAULT_wxUSE_LISTBOOK=yes DEFAULT_wxUSE_LISTBOX=yes DEFAULT_wxUSE_LISTCTRL=yes DEFAULT_wxUSE_NOTEBOOK=yes @@ -775,7 +804,6 @@ WX_ARG_ENABLE(no_exceptions, [ --enable-no_exceptions create code without C++ WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE) WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS) -WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2) WX_ARG_ENABLE(compat22, [ --enable-compat22 enable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2) WX_ARG_ENABLE(compat24, [ --disable-compat24 disable wxWindows 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, disable) @@ -916,6 +944,7 @@ if test "$wxUSE_CONTROLS" = "yes"; then DEFAULT_wxUSE_GAUGE=yes DEFAULT_wxUSE_GRID=yes DEFAULT_wxUSE_IMAGLIST=yes + DEFAULT_wxUSE_LISTBOOK=yes DEFAULT_wxUSE_LISTBOX=yes DEFAULT_wxUSE_LISTCTRL=yes DEFAULT_wxUSE_NOTEBOOK=yes @@ -953,6 +982,7 @@ elif test "$wxUSE_CONTROLS" = "no"; then DEFAULT_wxUSE_GAUGE=no DEFAULT_wxUSE_GRID=no DEFAULT_wxUSE_IMAGLIST=no + DEFAULT_wxUSE_LISTBOOK=no DEFAULT_wxUSE_LISTBOX=no DEFAULT_wxUSE_LISTCTRL=no DEFAULT_wxUSE_NOTEBOOK=no @@ -1004,6 +1034,7 @@ WX_ARG_ENABLE(display, [ --enable-display use wxDisplay class], wxUS WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE) WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID) WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST) +WX_ARG_ENABLE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK) WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX) WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL) WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK) @@ -1091,17 +1122,12 @@ fi dnl General settings (needed for GUI and non-GUI compilations alike). dnl Path separator; ':' for unix, ';' for OS/2 -dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise case "${host}" in *-pc-os2_emx | *-pc-os2-emx ) PATH_IFS=';' -dnl Really ought to text for this as meanwhile there are flex versions using -dnl lex.yy as well due to FAT support being more and more dropped... - LEX_STEM="lexyy" ;; *) PATH_IFS=':' - LEX_STEM="lex.yy" ;; esac @@ -1309,7 +1335,10 @@ AC_PROG_RANLIB dnl ar command dnl defines AR with the appropriate command -AC_CHECK_PROG(AR, ar, ar, ar) +AC_CHECK_PROG(AR, ar, ar) +if test "x$AR" = "x" ; then + AC_MSG_ERROR([ar is needed to build wxWindows]) +fi dnl install checks dnl defines INSTALL with the appropriate command @@ -1414,27 +1443,18 @@ you are trying to compile. fi dnl make without VPATH fi dnl not GNU make -dnl YACC checks -dnl defines YACC with the appropriate command -AC_PROG_YACC - -dnl LEX checks -dnl defines LEX with the appropriate command -dnl defines LEXLIB with the appropriate library -AC_PROG_LEX - dnl needed for making link to setup.h AC_PROG_LN_S dnl --------------------------------------------------------------------------- dnl When we are using gcc on OS/2, we want to be either using resources (PM) dnl or a more complete POSIX emulation for Motif/GTK+/X11 +dnl Moreover we need to link explicitly against either stdcpp.a or stdcxx.a +dnl (depending on compiler version), since we are using "gcc", not "g++/c++". dnl --------------------------------------------------------------------------- dnl (OS/2-only piece) case "${host}" in *-pc-os2_emx | *-pc-os2-emx ) - dnl Explicitly link -lstdcpp, since we are using "gcc" not "g++"/"c++". - LIBS="$LIBS -lstdcpp" if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then dnl More complete Unix emulation for unix-like ports dnl by linking in POSIX/2's cExt (if available). @@ -1443,6 +1463,26 @@ case "${host}" in dnl Include resources for the "native" port (wxPM). RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res" fi + AC_CACHE_CHECK([for gcc 3 or later], wx_cv_gcc3,[ + AC_TRY_COMPILE([#include ], + [ + #if (__GNUC__ < 3) + #error old gcc + #endif + ], + [ + wx_cv_gcc3=yes + ], + [ + wx_cv_gcc3=no + ] + ) + ]) + if test "$wx_cv_gcc3" = "no"; then + LIBS="$LIBS -lstdcpp" + else + LIBS="$LIBS -lstdcxx" + fi ;; esac dnl (end of OS/2-only piece) @@ -1508,9 +1548,15 @@ case "${host}" in esac if test "$wxUSE_GUI" = "yes"; then - if test "$wxUSE_UNIX" = "yes"; then + if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then dnl defines HAVE_X11_XKBLIB_H - AC_CHECK_HEADERS(X11/XKBlib.h) + AC_CHECK_HEADERS(X11/Xlib.h) + AC_CHECK_HEADERS([X11/XKBlib.h], [], [], + [ + #if HAVE_X11_XLIB_H + #include + #endif + ]) fi fi @@ -2078,10 +2124,12 @@ if test "$wxUSE_LIBTIFF" != "no" ; then TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK" fi AC_CHECK_HEADER(tiffio.h, - AC_CHECK_LIB(tiff, TIFFError, - TIFF_LINK=" -ltiff", - , - $TIFF_PREREQ_LINKS) + [ + AC_CHECK_LIB(tiff, TIFFError, + TIFF_LINK=" -ltiff", + , + $TIFF_PREREQ_LINKS) + ] ) if test "x$TIFF_LINK" = "x" ; then @@ -2107,7 +2155,7 @@ dnl Check for expat libraries dnl ------------------------------------------------------------------------ if test "$wxUSE_EXPAT" != "no"; then - wxUSE_XML=1 + wxUSE_XML=yes AC_DEFINE(wxUSE_EXPAT) AC_DEFINE(wxUSE_XML) @@ -2214,6 +2262,14 @@ if test "$wxUSE_GUI" = "yes"; then if test "$wxUSE_MSW" = 1 ; then TOOLKIT=MSW GUIDIST=MSW_DIST + + dnl -mwindows causes a heap of other default gui libs to be linked in. + dnl FIXME: If cygwin needs this, please push it above, if not, please + dnl remove this comment :-) + case "${host}" in + *-*-mingw32* ) + WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows" + esac fi if test "$wxUSE_GTK" = 1; then @@ -2756,8 +2812,6 @@ equivalent variable and GTK+ is version 1.2.3 or above. if test "$wxUSE_PM" = 1; then TOOLKIT=PM GUIDIST=GTK_DIST - AC_MSG_WARN([OS/2 threads are not yet supported... disabled]) - wxUSE_THREADS="no" fi dnl the name of the directory where the files for this toolkit live @@ -2889,6 +2943,9 @@ if test "$TOOLKIT" != "MSW" ; then fi if test "$wxUSE_ODBC" != "no" ; then AC_DEFINE(wxUSE_ODBC) + if test "$wxUSE_ODBC" = "builtin" ; then + AC_DEFINE(wxUSE_BUILTIN_IODBC) + fi SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db" dnl is this still necessary in 2.5? @@ -3106,6 +3163,7 @@ if test "$wxUSE_SHARED" = "yes"; then case "${host}" in *-*-linux* | *-*-gnu* ) SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib" + ;; *-*-solaris2* ) if test "$GCC" = yes ; then @@ -3656,12 +3714,16 @@ AC_CHECK_FUNCS(inet_addr, [ AC_CHECK_LIB(nsl, inet_addr, INET_LINK="nsl", - AC_CHECK_LIB(resolv, inet_addr, - INET_LINK="resolv", - AC_CHECK_LIB(socket, inet_addr, - INET_LINK="socket" + [ + AC_CHECK_LIB(resolv, inet_addr, + INET_LINK="resolv", + [ + AC_CHECK_LIB(socket, inet_addr, + INET_LINK="socket" + ) + ] ) - ) + ] ) ] ) @@ -3695,6 +3757,19 @@ AC_CHECK_LIB(esd, esd_close, [ ]) AC_SUBST(EXTRALIBS_ESD) +dnl check for known CD-ROM interface +AC_MSG_CHECKING([for known CD-ROM interface]) +AC_TRY_COMPILE([#ifdef __linux__ + #include + #else + /* For Solaris */ + #include + #endif + ], + [struct cdrom_tocentry entry, old_entry;], + [AC_MSG_RESULT([yes]) + AC_DEFINE(HAVE_KNOWN_CDROM_INTERFACE)], + [AC_MSG_RESULT([no])]) dnl =========================================================================== dnl Now we have all the info we need - use it! @@ -3704,12 +3779,13 @@ dnl flush the cache AC_CACHE_SAVE dnl --------------------------------------------------------------------------- -dnl thread support for Unix (for Win32 see past the next matching "else") +dnl thread support for Unix (for Win32 and OS/2 see past +dnl the next matching "else") dnl --------------------------------------------------------------------------- dnl under MSW (except mingw32) we always have thread support CPP_MT_FLAG= -if test "$TOOLKIT" != "MSW"; then +if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then dnl the code below: dnl @@ -4030,6 +4106,11 @@ else CFLAGS="$CFLAGS_OLD" fi ;; + *-pc-os2*emx ) + CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__" + CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__" + LDFLAGS="$LDFLAGS -Zmt" + ;; esac fi fi @@ -4162,12 +4243,6 @@ dnl --------------------------------------------------------------------------- dnl compatibility level dnl --------------------------------------------------------------------------- -if test "$WXWIN_COMPATIBILITY_2" = "yes"; then - AC_DEFINE(WXWIN_COMPATIBILITY_2) - - WXWIN_COMPATIBILITY_2_2="yes" -fi - if test "x$WXWIN_COMPATIBILITY_2_2" = "xyes"; then AC_DEFINE(WXWIN_COMPATIBILITY_2_2) @@ -4503,15 +4578,17 @@ if test "$wxUSE_SOCKETS" = "yes"; then if test "$TOOLKIT" != "MSW"; then dnl under Solaris and OS/2, socket functions live in -lsocket AC_CHECK_FUNC(socket,, - AC_CHECK_LIB(socket, socket, - if test "$INET_LINK" != " -lsocket"; then - INET_LINK="$INET_LINK -lsocket" - fi, - [ - AC_MSG_WARN([socket library not found - sockets will be disabled]) - wxUSE_SOCKETS=no - ] - ) + [ + AC_CHECK_LIB(socket, socket, + if test "$INET_LINK" != " -lsocket"; then + INET_LINK="$INET_LINK -lsocket" + fi, + [ + AC_MSG_WARN([socket library not found - sockets will be disabled]) + wxUSE_SOCKETS=no + ] + ) + ] ) fi fi @@ -4664,7 +4741,7 @@ dnl DLL support dnl ------------------------------------------------------------------------ dnl under MSW we always have LoadLibrary/GetProcAddress -if test "$TOOLKIT" != "MSW"; then +if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then HAVE_DL_FUNCS=0 HAVE_SHL_FUNCS=0 @@ -4707,8 +4784,11 @@ if test "$TOOLKIT" != "MSW"; then dnl check also for dlerror() if test "$HAVE_DL_FUNCS" = 1; then AC_CHECK_FUNCS(dlerror, - AC_DEFINE(HAVE_DLERROR), - AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))) + AC_DEFINE(HAVE_DLERROR), + [ + AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)) + ] + ) fi fi @@ -5015,6 +5095,11 @@ if test "$wxUSE_IMAGLIST" = "yes"; then AC_DEFINE(wxUSE_IMAGLIST) fi +if test "$wxUSE_LISTBOOK" = "yes"; then + AC_DEFINE(wxUSE_LISTBOOK) + USES_CONTROLS=1 +fi + if test "$wxUSE_LISTBOX" = "yes"; then AC_DEFINE(wxUSE_LISTBOX) USES_CONTROLS=1 @@ -5660,10 +5745,16 @@ else dnl pragmas: CPPFLAGS="-DNO_GCC_PRAGMA $CPPFLAGS" ;; - *) - ;; esac fi +dnl We have to output NO_GCC_PRAGMA with wx-config on Apple, too: +case "${host}" in + powerpc-*-darwin* ) + dnl Some Apple's GCC version are broken and can't handle the + dnl pragmas: + CODE_GEN_FLAGS_CXX="-DNO_GCC_PRAGMA $CODE_GEN_FLAGS_CXX" + ;; +esac dnl for convenience, sort the samples in alphabetical order @@ -5677,7 +5768,6 @@ dnl only removes the Unix-like part of the introduced line break. SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`" dnl makefile variables -AC_SUBST(LEX_STEM) AC_SUBST(PATH_IFS) dnl global options @@ -5737,6 +5827,7 @@ AC_SUBST(WXCONFIG_LIBS_STATIC) AC_SUBST(WXCONFIG_LIBS_STATIC_GL) AC_SUBST(WXCONFIG_INCLUDE) AC_SUBST(WXCONFIG_RPATH) +AC_SUBST(WXCONFIG_LDFLAGS_GUI) AC_SUBST(WX_LARGEFILE_FLAGS) AC_SUBST(CODE_GEN_FLAGS) AC_SUBST(CODE_GEN_FLAGS_CXX) @@ -5881,8 +5972,7 @@ for subdir in `echo $SUBDIRS`; do makefiles="samples/Makefile.in samples/console/Makefile.in" else dnl utils makefiles="utils/HelpGen/Makefile.in \ - utils/HelpGen/src/Makefile.in \ - utils/makegen/Makefile.in" + utils/HelpGen/src/Makefile.in" fi fi @@ -5908,7 +5998,6 @@ echo " Should wxWindows be linked as a shared library? ${wxUSE_SHARED:- echo " Should wxWindows be compiled in Unicode mode? ${wxUSE_UNICODE:-no}" echo " What level of wxWindows compatibility should be enabled?" -echo " wxWindows 2.0 ${WXWIN_COMPATIBILITY_2:-no}" echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-no}" echo " wxWindows 2.4 ${WXWIN_COMPATIBILITY_2_4:-yes}"