X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/22c3fb2ba3c6236525e147e5b10d0bc62bc5e2e5..15bee36fdf12ec78f61e1372a460a7606f7ccb7e:/configure.in?ds=inline diff --git a/configure.in b/configure.in index d97cc61ae7..417c406f68 100644 --- a/configure.in +++ b/configure.in @@ -102,7 +102,7 @@ CPP_MT_FLAG=-D_REENTRANT dnl the list of all available toolkits dnl dnl update NUM_TOOLKITS calculation below when adding a new toolkit here! -ALL_TOOLKITS="GTK MAC MGL MICROWIN MOTIF MSW PM WINE" +ALL_TOOLKITS="GTK MAC MGL MICROWIN MOTIF MSW PM WINE X11" dnl NB: these wxUSE_XXX constants have value of 0 or 1 unlike all the other ones dnl which are either yes or no @@ -114,6 +114,7 @@ DEFAULT_wxUSE_MOTIF=0 DEFAULT_wxUSE_MSW=0 DEFAULT_wxUSE_PM=0 DEFAULT_wxUSE_WINE=0 +DEFAULT_wxUSE_X11=0 dnl these are the values which are really default for the given platform - dnl they're not cached and are only used if no --with-toolkit was given *and* @@ -126,6 +127,7 @@ DEFAULT_DEFAULT_wxUSE_MOTIF=0 DEFAULT_DEFAULT_wxUSE_MSW=0 DEFAULT_DEFAULT_wxUSE_PM=0 DEFAULT_DEFAULT_wxUSE_WINE=0 +DEFAULT_DEFAULT_wxUSE_X11=0 PROGRAM_EXT= SO_SUFFIX=so @@ -253,13 +255,13 @@ case "${host}" in AC_DEFINE(__DOS__) PROGRAM_EXT=".exe" DEFAULT_DEFAULT_wxUSE_MGL=1 - DEFAULT_DEFAULT_wxUSE_SHARED=0 ;; *-pc-os2_emx | *-pc-os2-emx ) AC_DEFINE(__EMX__) PROGRAM_EXT=".exe" DEFAULT_DEFAULT_wxUSE_PM=1 + LIBS="$LIBS -lstdcpp" ;; powerpc-*-darwin* ) @@ -329,6 +331,8 @@ DEBUG_CONFIGURE=0 if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_UNIVERSAL=no + DEFAULT_wxUSE_NANOX=no + DEFAULT_wxUSE_THREADS=yes DEFAULT_wxUSE_SHARED=yes @@ -362,7 +366,6 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_LIBJPEG=no DEFAULT_wxUSE_LIBTIFF=no DEFAULT_wxUSE_ODBC=no - DEFAULT_wxUSE_FREETYPE=no DEFAULT_wxUSE_OPENGL=no DEFAULT_wxUSE_ON_FATAL_EXCEPTION=no @@ -502,6 +505,8 @@ if test $DEBUG_CONFIGURE = 1; then else DEFAULT_wxUSE_UNIVERSAL=no + DEFAULT_wxUSE_NANOX=no + DEFAULT_wxUSE_THREADS=yes DEFAULT_wxUSE_SHARED=yes @@ -534,7 +539,6 @@ else DEFAULT_wxUSE_LIBJPEG=yes DEFAULT_wxUSE_LIBTIFF=yes DEFAULT_wxUSE_ODBC=no - DEFAULT_wxUSE_FREETYPE=no DEFAULT_wxUSE_OPENGL=no DEFAULT_wxUSE_ON_FATAL_EXCEPTION=yes @@ -558,7 +562,7 @@ else DEFAULT_wxUSE_DIALUP_MANAGER=yes DEFAULT_wxUSE_JOYSTICK=yes DEFAULT_wxUSE_DYNLIB_CLASS=yes - DEFAULT_wxUSE_DYNAMIC_LOADER=no + DEFAULT_wxUSE_DYNAMIC_LOADER=yes DEFAULT_wxUSE_LONGLONG=yes DEFAULT_wxUSE_GEOMETRY=yes @@ -713,13 +717,14 @@ AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MS AC_ARG_WITH(pm, [ --with-pm use OS/2 Presentation Manager], [wxUSE_PM="$withval" CACHE_PM=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" CACHE_MGL=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(microwin, [ --with-microwin use MicroWindows], [wxUSE_MICROWIN="$withval" CACHE_MICROWIN=1 TOOLKIT_GIVEN=1]) +AC_ARG_WITH(x11, [ --with-x11 use X11], [wxUSE_X11="$withval" wxUSE_UNIVERSAL="yes" CACHE_X11=1 TOOLKIT_GIVEN=1]) +WX_ARG_ENABLE(nanox, [ --enable-nanox use NanoX], wxUSE_NANOX) -AC_ARG_ENABLE(gtk2, [ --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)],wxUSE_GTK2=1,wxUSE_GTK2=0) +AC_ARG_ENABLE(gtk2, [ --enable-gtk2 use GTK+ 2.0 if available (EXPERIMENTAL)],wxUSE_GTK2="yes",wxUSE_GTK2="no") WX_ARG_SYS_WITH(libpng, [ --with-libpng use libpng (PNG image format)], wxUSE_LIBPNG) WX_ARG_SYS_WITH(libjpeg, [ --with-libjpeg use libjpeg (JPEG file format)], wxUSE_LIBJPEG) WX_ARG_SYS_WITH(libtiff, [ --with-libtiff use libtiff (TIFF file format)], wxUSE_LIBTIFF) -WX_ARG_SYS_WITH(freetype, [ --with-freetype use freetype (font rasterizer)], wxUSE_FREETYPE) WX_ARG_WITH(opengl, [ --with-opengl use OpenGL (or Mesa)], wxUSE_OPENGL) fi @@ -762,7 +767,7 @@ WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregardin 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(compat22, [ --disable-compat22 disable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2) dnl --------------------------------------------------------------------------- dnl (small) optional non GUI classes @@ -1049,6 +1054,21 @@ WX_ARG_ENABLE(xpm, [ --enable-xpm use xpm images (XPM file f WX_ARG_ENABLE(ico_cur, [ --enable-icocur use Windows ICO and CUR formats], wxUSE_ICO_CUR) 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 ) + dnl PATH_IFS is autodetected by OS/2's configure (usually ';') + LEX_STEM="lexyy" + ;; + *) + PATH_IFS=':' + LEX_STEM="lex.yy" + ;; +esac + dnl for GUI only dnl cache the options values before (may be) aborting below @@ -1087,21 +1107,12 @@ if test "$wxUSE_GUI" = "yes"; then dnl we suppose that expr is available (maybe there is a better way to do dnl this? what about using ALL_TOOLKITS? TODO) NUM_TOOLKITS=`expr ${wxUSE_GTK:-0} + ${wxUSE_MOTIF:-0} + ${wxUSE_MAC:-0} \ - + ${wxUSE_WINE:-0} + ${wxUSE_MSW:-0} + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0}` + + ${wxUSE_WINE:-0} + ${wxUSE_MSW:-0} + ${wxUSE_MGL:-0} + ${wxUSE_MICROWIN:-0} + ${wxUSE_X11:-0}` dnl Allow wxUSE_PM only for OS/2 with EMX. - dnl Path separator; ':' for unix. - dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise case "${host}" in *-pc-os2_emx | *-pc-os2-emx ) - # PATH_IFS is autodetected by OS/2's configure (usually ';') NUM_TOOLKITS=`expr ${NUM_TOOLKITS} + ${wxUSE_PM:-0}` - LEX_STEM="lexyy" - ;; - *) - PATH_IFS=':' - LEX_STEM="lex.yy" - ;; esac case "$NUM_TOOLKITS" in @@ -1131,7 +1142,6 @@ if test "$wxUSE_GUI" = "yes"; then fi done else - PATH_IFS=':' AC_MSG_RESULT(base ($host_alias hosted) only) fi @@ -1145,7 +1155,7 @@ AC_CACHE_SAVE dnl cross-compiling support: we're cross compiling if the build system is dnl different from the target one (assume host and target be always the same) if test "$build" != "$host" ; then - if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 ; then + if test "$USE_WIN32" = 1 -o "$USE_DOS" = 1 -o "$USE_UNIX"; then CC=$host_alias-gcc CXX=$host_alias-c++ AR=$host_alias-ar @@ -1219,7 +1229,7 @@ dnl does make support "-include" (only GNU make does AFAIK)? AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu, [ if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null | - egrep -s GNU); then + egrep -s GNU > /dev/null); then wx_cv_prog_makeisgnu="yes" else wx_cv_prog_makeisgnu="no" @@ -1464,32 +1474,41 @@ PNG_INCLUDE= PNG_LINK= if test "$wxUSE_LIBPNG" != "no" ; then AC_DEFINE(wxUSE_LIBPNG) + + if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBPNG" = "builtin" ; then + AC_MSG_WARN([wxMGL doesn't work with builtin png library, will use MGL one instead]) + wxUSE_LIBPNG=sys + fi dnl for the check below to have a chance to succeed, we must already have - dnl libz somewhere - if test "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then + dnl libz somewhere (don't do this when bulding wxMGL since its libpng + dnl doesn't depend on zlib) + if test "$wxUSE_MGL" != 1 -a "$wxUSE_LIBPNG" = "sys" -a "$wxUSE_ZLIB" != "sys" ; then AC_MSG_WARN([system png library doesn't work without system zlib, will use built-in instead]) wxUSE_LIBPNG=builtin fi - if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then - AC_CHECK_HEADER(png.h, - AC_CHECK_LIB(png, png_check_sig, - PNG_LINK=" -lpng", - , - [-lz -lm]) - ) + if test "$wxUSE_MGL" != 1 ; then + dnl Don't check for libpng when building wxMGL, libmgl contains it + if test "$wxUSE_LIBPNG" = "sys" -o "$wxUSE_LIBPNG" = "yes" ; then + AC_CHECK_HEADER(png.h, + AC_CHECK_LIB(png, png_check_sig, + PNG_LINK=" -lpng", + , + [-lz -lm]) + ) - if test "x$PNG_LINK" = "x" ; then - if test "$wxUSE_LIBPNG" = "sys" ; then - AC_MSG_ERROR([system png library not found! Use --with-libpng=builtin to use built-in version]) + if test "x$PNG_LINK" = "x" ; then + if test "$wxUSE_LIBPNG" = "sys" ; then + AC_MSG_ERROR([system png library not found! Use --with-libpng=builtin to use built-in version]) + else + AC_MSG_WARN([system png library not found, will use built-in instead]) + wxUSE_LIBPNG=builtin + fi else - AC_MSG_WARN([system png library not found, will use built-in instead]) - wxUSE_LIBPNG=builtin + dnl we are using the system library + wxUSE_LIBPNG=yes fi - else - dnl we are using the system library - wxUSE_LIBPNG=yes fi fi @@ -1509,40 +1528,48 @@ JPEG_LINK= if test "$wxUSE_LIBJPEG" != "no" ; then AC_DEFINE(wxUSE_LIBJPEG) - if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then - dnl can't use AC_CHECK_HEADER as jconfig.h defines things like - dnl HAVE_STDLIB_H which are already defined and this provokes - dnl a compiler warning which configure considers as an error... - AC_MSG_CHECKING(for jpeglib.h) - AC_CACHE_VAL(ac_cv_header_jpeglib_h, - AC_TRY_COMPILE( - [ - #undef HAVE_STDLIB_H - #include - #include - ], - [ - ], - ac_cv_header_jpeglib_h=yes, - ac_cv_header_jpeglib_h=no + if test "$wxUSE_MGL" = 1 -a "$wxUSE_LIBJPEG" = "builtin" ; then + AC_MSG_WARN([wxMGL doesn't work with builtin jpeg library, will use MGL one instead]) + wxUSE_LIBJPEG=sys + fi + + if test "$wxUSE_MGL" != 1 ; then + dnl Don't check for libjpeg when building wxMGL, libmgl contains it + if test "$wxUSE_LIBJPEG" = "sys" -o "$wxUSE_LIBJPEG" = "yes" ; then + dnl can't use AC_CHECK_HEADER as jconfig.h defines things like + dnl HAVE_STDLIB_H which are already defined and this provokes + dnl a compiler warning which configure considers as an error... + AC_MSG_CHECKING(for jpeglib.h) + AC_CACHE_VAL(ac_cv_header_jpeglib_h, + AC_TRY_COMPILE( + [ + #undef HAVE_STDLIB_H + #include + #include + ], + [ + ], + ac_cv_header_jpeglib_h=yes, + ac_cv_header_jpeglib_h=no + ) ) - ) - AC_MSG_RESULT($ac_cv_header_jpeglib_h) + AC_MSG_RESULT($ac_cv_header_jpeglib_h) - if test "$ac_cv_header_jpeglib_h" = "yes"; then - AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg") - fi + if test "$ac_cv_header_jpeglib_h" = "yes"; then + AC_CHECK_LIB(jpeg, jpeg_read_header, JPEG_LINK=" -ljpeg") + fi - if test "x$JPEG_LINK" = "x" ; then - if test "$wxUSE_LIBJPEG" = "sys" ; then - AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version]) + if test "x$JPEG_LINK" = "x" ; then + if test "$wxUSE_LIBJPEG" = "sys" ; then + AC_MSG_ERROR([system jpeg library not found! Use --with-libjpeg=builtin to use built-in version]) + else + AC_MSG_WARN([system jpeg library not found, will use built-in instead]) + wxUSE_LIBJPEG=builtin + fi else - AC_MSG_WARN([system jpeg library not found, will use built-in instead]) - wxUSE_LIBJPEG=builtin + dnl we are using the system library + wxUSE_LIBJPEG=sys fi - else - dnl we are using the system library - wxUSE_LIBJPEG=sys fi fi @@ -1586,41 +1613,6 @@ if test "$wxUSE_LIBTIFF" != "no" ; then fi fi -dnl ------------------------------------------------------------------------ -dnl Check for freetype library -dnl ------------------------------------------------------------------------ - -FREETYPE_INCLUDE= -FREETYPE_LINK= -if test "$wxUSE_FREETYPE" != "no" ; then - AC_DEFINE(wxUSE_FREETYPE) - - if test "$wxUSE_FREETYPE" = "sys" -o "$wxUSE_FREETYPE" = "yes" ; then - AC_CHECK_HEADER(freetype.h, - AC_CHECK_LIB(freetype, FT_Render_Glyph, - FREETYPE_LINK=" -lfreetype", - , - [-lm]) - ) - - if test "x$FREETYPE_LINK" = "x" ; then - if test "$wxUSE_FREETYPE" = "sys" ; then - AC_MSG_ERROR([system freetype library not found! Use --with-freetype=builtin to use built-in version]) - else - AC_MSG_WARN([system freetype library not found, will use built-in instead]) - wxUSE_FREETYPE=builtin - fi - else - dnl we are using the system library - wxUSE_FREETYPE=sys - fi - fi - - if test "$wxUSE_FREETYPE" = "builtin" ; then - FREETYPE_INCLUDE="-I\${top_srcdir}/src/freetype" - fi -fi - dnl ---------------------------------------------------------------- dnl search for toolkit (widget sets) dnl ---------------------------------------------------------------- @@ -1725,7 +1717,7 @@ if test "$wxUSE_GUI" = "yes"; then wx_cv_lib_gtk= if test "x$wxUSE_GTK2" = "xyes"; then - AM_PATH_GTK_2_0(1.3.1, wx_cv_lib_gtk=2.0, , $GTK_MODULES) + AM_PATH_GTK_2_0(2.0.0, wx_cv_lib_gtk=2.0, , $GTK_MODULES) fi if test -z "$wx_cv_lib_gtk"; then @@ -1854,6 +1846,75 @@ equivalent variable and GTK+ is version 1.2.3 or above. TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__ -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1" fi + if test "$wxUSE_X11" = 1; then + dnl use standard macros to check for X headers/libs, this brings support + dnl for the standard configure options --x-includes and --x-libraries + AC_PATH_XTRA + + if test "$no_x" = "yes"; then + AC_MSG_ERROR(X11 not found, please use --x-includes and/or --x-libraries options) + fi + + GUI_TK_LIBRARY="$X_LIBS" + TOOLKIT_INCLUDE="$X_CFLAGS" + AFMINSTALL=afminstall + COMPILED_X_PROGRAM=0 + + if test "$wxUSE_NANOX" = "yes"; then + AC_MSG_CHECKING(for MicroWindows/NanoX distribution) + if test "x$MICROWIN" = x ; then + AC_MSG_RESULT(not found) + AC_MSG_ERROR([Cannot find MicroWindows library. Make sure MICROWIN is set.]) + else + AC_MSG_RESULT($MICROWIN) + AC_DEFINE(wxUSE_NANOX) + fi + fi + + xpm_link= + AC_MSG_CHECKING(for Xpm library) + WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xpm) + if test "$ac_find_libraries" != "" ; then + WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY) + GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" + xpm_link=" -lXpm" + AC_DEFINE(wxHAVE_LIB_XPM) + AC_MSG_RESULT(found at $ac_find_libraries) + else + AC_TRY_COMPILE( + [ + #include + ], + [ + int version; + version = XpmLibraryVersion(); + ], + [ + xpm_link=" -lXpm" + AC_DEFINE(wxHAVE_LIB_XPM) + AC_MSG_RESULT(found in default search path) + COMPILED_X_PROGRAM=0 + ], + [ + AC_MSG_RESULT(no) + AC_MSG_WARN(library will be compiled without support for images in XPM format) + ] + ) + fi + + if test "$wxUSE_NANOX" = "yes"; then + TOOLKIT_INCLUDE="-I\$(top_srcdir)/include/wx/x11/nanox -I\$(MICROWIN)/src/include $TOOLKIT_INCLUDE" + TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__NANOX__ -DMWPIXEL_FORMAT=MWPF_TRUECOLOR0888 -DHAVE_FILEIO -DHAVE_BMP_SUPPORT=1 -DHAVE_GIF_SUPPORT=1 -DHAVE_PNM_SUPPORT=1 -DHAVE_XPM_SUPPORT=1 -DLINUX=1 -DUNIX=1 -DUSE_EXPOSURE -DSCREEN_HEIGHT=480 -DSCREEN_WIDTH=640 -DSCREEN_DEPTH=4 -DX11=1" + GUI_TK_LIBRARY="$GUI_TK_LIBRARY \$(MICROWIN)/src/lib/libnano-X.a" + else + GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lX11$xpm_link" + fi + + TOOLKIT_VPATH="\${top_srcdir}/src/x11" + TOOLKIT=X11 + GUIDIST=X11_DIST + fi + if test "$wxUSE_WINE" = 1; then AC_CHECK_HEADER(windows.h, [], [ @@ -2030,12 +2091,25 @@ equivalent variable and GTK+ is version 1.2.3 or above. if test "$wxUSE_UNIVERSAL" = "yes"; then ALL_OBJECTS="\$(GUI_LOWLEVEL_OBJS) \${UNIVOBJS}" + + dnl ALL_SOURCES and ALL_HEADERS shouldn't include really all sources + dnl and headers as some/most are not needed for wxUniv but I don't + dnl have time to add GUI_LOWLEVEL_SOURCES/HEADERS stuff now (TODO!) + ALL_SOURCES="\$(ALL_SOURCES) \${UNIV_SOURCES}" + ALL_HEADERS="\$(ALL_HEADERS) \${UNIV_HEADERS}" + PORT_FILES="${PORT_FILES} \${top_srcdir}/src/univ/files.lst" - TOOLKIT_VPATH="\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes${PATH_IFS}\${top_srcdir}/src/${TOOLKIT_DIR}" + if test "$wxUSE_X11" = 1; then + TOOLKIT_VPATH="\${top_srcdir}/src/${TOOLKIT_DIR}${PATH_IFS}\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes" + else + TOOLKIT_VPATH="\${top_srcdir}/src/univ${PATH_IFS}\${top_srcdir}/src/univ/themes${PATH_IFS}\${top_srcdir}/src/${TOOLKIT_DIR}" + fi TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__" WIDGET_SET=univ else ALL_OBJECTS="\$(GUIOBJS)" + ALL_SOURCES="\$(ALL_SOURCES)" + ALL_HEADERS="\$(ALL_HEADERS)" fi ALL_OBJECTS="${ALL_OBJECTS} \$(COMMONOBJS) \$(GENERICOBJS)" @@ -2048,10 +2122,6 @@ equivalent variable and GTK+ is version 1.2.3 or above. ALL_OBJECTS="${ALL_OBJECTS} \$(HTMLOBJS)" fi - dnl ODBC objects are Unix only - if test "$TOOLKIT" != "MSW" -a "$wxUSE_ODBC" = "yes" ; then - ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)" - fi if test "$wxUSE_LIBJPEG" = "builtin" ; then ALL_OBJECTS="${ALL_OBJECTS} \$(JPEGOBJS)" fi @@ -2061,9 +2131,6 @@ equivalent variable and GTK+ is version 1.2.3 or above. if test "$wxUSE_LIBPNG" = "builtin" ; then ALL_OBJECTS="${ALL_OBJECTS} \$(PNGOBJS)" fi - if test "$wxUSE_FREETYPE" = "builtin" ; then - ALL_OBJECTS="${ALL_OBJECTS} \$(FREETYPEOBJS)" - fi dnl distribute samples/demos/utils with GUI versions GUIDIST="${GUIDIST} SAMPLES_DIST DEMOS_DIST UTILS_DIST MISC_DIST" @@ -2088,6 +2155,9 @@ else TOOLKIT_VPATH="\${top_srcdir}/src/unix" fi + ALL_SOURCES="\$(ALL_SOURCES)" + ALL_HEADERS="\$(ALL_HEADERS)" + PORT_FILES="\${top_srcdir}/src/files.lst" dnl distribute only wxBase sources/headers @@ -2098,6 +2168,12 @@ fi dnl --------------------------------------------------------------------------- dnl Optional libraries included when system library is not used dnl --------------------------------------------------------------------------- + +dnl ODBC objects are Unix only +if test "$TOOLKIT" != "MSW" -a "$wxUSE_ODBC" = "yes" ; then + ALL_OBJECTS="${ALL_OBJECTS} \$(IODBCOBJS)" +fi + if test "$wxUSE_REGEX" = "builtin" ; then ALL_OBJECTS="${ALL_OBJECTS} \$(REGEXOBJS)" fi @@ -2258,6 +2334,17 @@ fi dnl --- the marker for quick search, leave it here: SHARED_LIB_SETUP --- +if test "$wxUSE_SHARED" = "yes"; then + case "${host}" in + *-pc-os2_emx | *-pc-os2-emx | \ + *-pc-msdosdjgpp ) + dnl only static for now + wxUSE_SHARED=no + AC_MSG_WARN([Host system doesn't support shared libraries, disabling]) + ;; + esac +fi + if test "$wxUSE_SHARED" = "yes"; then dnl install targets @@ -2341,10 +2428,14 @@ 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 -DDYLIB_INIT" CXXFLAGS="$CXXFLAGS -fno-common -DDYLIB_INIT" SHARED_LD="$CXX -dynamiclib -init _wxWindowsDylibInit -o" PIC_FLAG="-dynamic -fPIC" + SONAME_FLAGS="-compatibility_version ${WX_RELEASE} -current_version ${WX_VERSION}" + SONAME_FLAGS_GL=${SONAME_FLAGS} ;; *-*-aix* ) @@ -2369,11 +2460,6 @@ if test "$wxUSE_SHARED" = "yes"; then fi ;; - *-pc-os2_emx | *-pc-os2-emx ) - dnl only static for now - wxUSE_SHARED=no - ;; - *-*-beos* ) dnl can't use gcc under BeOS for shared library creation because it dnl complains about missing 'main' @@ -2437,20 +2523,25 @@ if test "$wxUSE_MAC" = 1; then WX_ALL_INSTALLED="${WX_ALL_INSTALLED} preinstall_res" AC_CHECK_PROG(RESCOMP, Rez, Rez, /Developer/Tools/Rez) AC_CHECK_PROG(DEREZ, DeRez, DeRez, /Developer/Tools/DeRez) + MACOSX_BUNDLE="bundle" LIBWXMACRES="\$(top_builddir)/lib/lib${WX_LIBRARY}.r" LIBWXMACRESCOMP="\$(RESCOMP) Carbon.r -t APPL ${LIBWXMACRES} -o \$(BIN_PROGRAM)" LIBWXMACRESWXCONFIG="${RESCOMP} Carbon.r -t APPL \${prefix}/lib/${WX_RESOURCES_MACOSX_COMPILED} -o" +else + if test "$wxUSE_PM" = 1; then + LIBWXMACRESCOMP="emxbind -ep \$(BIN_PROGRAM)" + fi fi dnl ------------------------------------------------------------------------ dnl Check for headers dnl ------------------------------------------------------------------------ -dnl do not check for strings.h for wxMac -dnl it exists but is only a simple redirection to string.h -dnl it is in conflict with Strings.h in FlatCarbon headers +dnl test for strings.h needed under AIX, but do not check for it wxMac as +dnl it exists but is only a simple redirection to string.h and it is in +dnl conflict with Strings.h in FlatCarbon headers if test "$wxUSE_MAC" != 1; then - dnl defines HAVE_STRINGS_H (where some string functions live on AIX for example) + dnl defines HAVE_STRINGS_H AC_CHECK_HEADERS(strings.h) fi @@ -2462,10 +2553,17 @@ dnl defines HAVE_UNISTD_H AC_CHECK_HEADERS(unistd.h) dnl defines HAVE_WCHAR_H AC_CHECK_HEADERS(wchar.h) -dnl defines HAVE_WCSTR_H -AC_CHECK_HEADERS(wcstr.h) -dnl defined HAVE_WCTYPE_H -AC_CHECK_HEADERS(wctype.h) + +dnl maybe wchar_t is in wcstr.h if we don't have wchar.h? +if test "$ac_cv_header_wchar_h" != "yes"; then + dnl defines HAVE_WCSTR_H + AC_CHECK_HEADERS(wcstr.h) +fi + +dnl checking for wctype.h is useless as we need wcslen(), not just wchar_t and +dnl this function is never provided by it +dnl AC_CHECK_HEADERS(wctype.h) + dnl defines HAVE_FNMATCH_H AC_CHECK_HEADERS(fnmatch.h) dnl defines HAVE_LANGINFO_H (GNU libc locale parameters) @@ -2615,10 +2713,18 @@ dnl cross-compiling) dnl defines the size of certain types of variables in SIZEOF_ AC_CHECK_SIZEOF(char, 1) AC_CHECK_SIZEOF(short, 2) -AC_CHECK_SIZEOF(int *, 4) +AC_CHECK_SIZEOF(void *, 4) AC_CHECK_SIZEOF(int, 4) AC_CHECK_SIZEOF(long, 4) -AC_CHECK_SIZEOF(long long, 0) + +case "${host}" in + arm-*-linux* ) + AC_CHECK_SIZEOF(long long, 8) + ;; + * ) + AC_CHECK_SIZEOF(long long, 0) +esac + dnl we have to do it ourselves because SGI/Irix's stdio.h does not include dnl wchar_t and AC_CHECK_SIZEOF only includes stdio.h @@ -2975,7 +3081,7 @@ AC_CHECK_FUNCS(strtok_r) AC_LANG_RESTORE dnl check for inet_addr and inet_aton (these may live either in libc, or in -dnl libnsl or libresolv) +dnl libnsl or libresolv or libsocket) INET_LINK= AC_CHECK_FUNCS(inet_addr, AC_DEFINE(HAVE_INET_ADDR), @@ -2983,7 +3089,10 @@ AC_CHECK_FUNCS(inet_addr, AC_CHECK_LIB(nsl, inet_addr, INET_LINK="nsl", AC_CHECK_LIB(resolv, inet_addr, - INET_LINK="resolv" + INET_LINK="resolv", + AC_CHECK_LIB(socket, inet_addr, + INET_LINK="socket" + ) ) ) ] @@ -3333,7 +3442,7 @@ if test "$WXWIN_COMPATIBILITY_2" = "yes"; then WXWIN_COMPATIBILITY_2_2="yes" fi -if test "$WXWIN_COMPATIBILITY_2_2" = "yes"; then +if test "x$WXWIN_COMPATIBILITY_2_2" != "xno"; then AC_DEFINE(WXWIN_COMPATIBILITY_2_2) fi @@ -3649,14 +3758,23 @@ dnl ------------------------------------------------------------------------ dnl wxSocket dnl ------------------------------------------------------------------------ -dnl under MSW we always have sockets -if test "$TOOLKIT" != "MSW"; then +dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11 +if test "$wxUSE_SOCKETS" = "yes"; then + if test "$TOOLKIT" = "X11"; then + AC_MSG_WARN([wxSocket not yet supported under X11... disabled]) + wxUSE_SOCKETS="no" + fi +fi - if test "$wxUSE_SOCKETS" = "yes"; then - dnl under Solaris, socket functions live in -lsocket +if test "$wxUSE_SOCKETS" = "yes"; then + dnl under MSW we always have sockets + 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, - INET_LINK="$INET_LINK -lsocket", + 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 @@ -3664,12 +3782,13 @@ if test "$TOOLKIT" != "MSW"; then ) ) fi +fi +if test "$wxUSE_SOCKETS" = "yes" ; then dnl this test may be appropriate if building under cygwin dnl right now I'm assuming it also uses the winsock stuff dnl like mingw does.. -- RL - - if test "$wxUSE_SOCKETS" = "yes" ; then + if test "$TOOLKIT" != "MSW"; then dnl determine the type of third argument for getsockname AC_CACHE_CHECK([what is the type of the third argument of getsockname], wx_cv_type_getsockname3, @@ -3723,7 +3842,6 @@ if test "$TOOLKIT" != "MSW"; then fi fi fi -dnl if !MSW if test "$wxUSE_SOCKETS" = "yes" ; then AC_DEFINE(wxUSE_SOCKETS) @@ -3744,6 +3862,10 @@ if test "$wxUSE_GUI" = "yes"; then AC_MSG_WARN([Joystick not yet supported under Motif... disabled]) wxUSE_JOYSTICK=no fi + if test "$TOOLKIT" = "X11"; then + AC_MSG_WARN([Joystick not yet supported under X11... disabled]) + wxUSE_JOYSTICK=no + fi dnl under MSW we always have joystick support if test "$TOOLKIT" != "MSW"; then @@ -3846,6 +3968,10 @@ fi if test "$wxUSE_UNICODE" = "yes" ; then AC_DEFINE(wxUSE_UNICODE) + + if test "$wxUSE_MSW" != 1; then + wxUSE_UNICODE_MSLU=no + fi if test "$wxUSE_MSW" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then AC_CHECK_LIB(unicows,main, @@ -3899,7 +4025,7 @@ fi if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then if test "$wxUSE_UNIVERSAL" = "yes"; then - AC_MSG_WARN(MDI not yet supported for wxUNIVERSAL... disabled) + AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled) wxUSE_MDI_ARCHITECTURE=no fi @@ -3923,14 +4049,7 @@ if test "$wxUSE_HELP" = "yes"; then if test "$wxUSE_MSW" = 1; then if test "$wxUSE_MS_HTML_HELP" = "yes"; then - AC_CHECK_HEADER(htmlhelp.h, - [ - AC_DEFINE(wxUSE_MS_HTML_HELP) - ], - [ - AC_MSG_WARN([MS HTML Help cannot be used without htmlhelp.h... disabled]) - wxUSE_MS_HTML_HELP=no - ]) + AC_DEFINE(wxUSE_MS_HTML_HELP) fi fi @@ -3958,8 +4077,12 @@ if test "$wxUSE_PROLOGIO" = "yes" ; then fi if test "$wxUSE_RESOURCES" = "yes" ; then - AC_DEFINE(wxUSE_RESOURCES) - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource" + if test "$wxUSE_NANOX" = "yes"; then + AC_MSG_WARN([Cannot use resource database functions in NanoX]) + else + AC_DEFINE(wxUSE_RESOURCES) + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS resource" + fi fi if test "$wxUSE_X_RESOURCES" = "yes"; then @@ -4032,6 +4155,11 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then wxUSE_DRAG_AND_DROP=no fi + if test "$wxUSE_X11" = 1; then + AC_MSG_WARN([Drag and drop not yet supported under X11... disabled]) + wxUSE_DRAG_AND_DROP=no + fi + if test "$wxUSE_DRAG_AND_DROP" = "yes"; then AC_DEFINE(wxUSE_DRAG_AND_DROP) SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS dnd" @@ -4238,7 +4366,7 @@ if test "$wxUSE_TOGGLEBTN" = "yes"; then wxUSE_TOGGLEBTN=no fi if test "$wxUSE_UNIVERSAL" = "yes"; then - AC_MSG_WARN([Toggle button not yet supported under wxUNIVERSAL... disabled]) + AC_MSG_WARN([Toggle button not yet supported under wxUniversal... disabled]) wxUSE_TOGGLEBTN=no fi @@ -4279,7 +4407,7 @@ if test "$wxUSE_TOOLTIPS" = "yes"; then AC_MSG_WARN([wxTooltip not supported under WINE... disabled]) else if test "$wxUSE_UNIVERSAL" = "yes"; then - AC_MSG_WARN([wxTooltip not supported yet in wxUNIVERSAL... disabled]) + AC_MSG_WARN([wxTooltip not supported yet in wxUniversal... disabled]) else AC_DEFINE(wxUSE_TOOLTIPS) fi @@ -4304,15 +4432,23 @@ if test "$wxUSE_POPUPWIN" = "yes"; then if test "$wxUSE_MOTIF" = 1; then AC_MSG_WARN([wxPopupWindow not yet supported under Motif... disabled]) else - AC_DEFINE(wxUSE_POPUPWIN) + if test "$wxUSE_PM" = 1; then + AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled]) + else + AC_DEFINE(wxUSE_POPUPWIN) - USES_CONTROLS=1 + USES_CONTROLS=1 + fi fi fi fi if test "$wxUSE_TIPWINDOW" = "yes"; then - AC_DEFINE(wxUSE_TIPWINDOW) + if test "$wxUSE_PM" = 1; then + AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled]) + else + AC_DEFINE(wxUSE_TIPWINDOW) + fi fi if test "$USES_CONTROLS" = 1; then @@ -4458,14 +4594,10 @@ if test "$wxUSE_FONTDLG" = "yes"; then fi if test "$wxUSE_DIRDLG" = "yes"; then - if test "$wxUSE_CONSTRAINTS" != "yes"; then - AC_MSG_WARN(wxDirDialog requires constraints so it won't be compiled without them) + if test "$wxUSE_TREECTRL" != "yes"; then + AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it) else - if test "$wxUSE_TREECTRL" != "yes"; then - AC_MSG_WARN(wxDirDialog requires wxTreeCtrl so it won't be compiled without it) - else - AC_DEFINE(wxUSE_DIRDLG) - fi + AC_DEFINE(wxUSE_DIRDLG) fi fi @@ -4550,18 +4682,18 @@ dnl FIXME: should this be covered by the conditional above dnl given the -lm comment there? Or should that comment (and dnl this one) be removed.. [ 7 Nov 2001 ] -LIBS="$ZLIB_LINK$POSIX4_LINK$INET_LINK$WCHAR_LINK$THREADS_LINK$DL_LINK -lm$LIBS" +LIBS="$ZLIB_LINK $POSIX4_LINK $INET_LINK $WCHAR_LINK $THREADS_LINK $DL_LINK -lm $LIBS" if test "$wxUSE_GUI" = "yes"; then - LIBS=" $GUI_TK_LIBRARY$PNG_LINK$JPEG_LINK$TIFF_LINK$FREETYPE_LINK$LIBS" + LIBS="$GUI_TK_LIBRARY $PNG_LINK $JPEG_LINK $TIFF_LINK $LIBS" dnl TODO add checks that these samples will really compile (i.e. all the dnl library features they need are present) dnl TODO some samples are never built so far: dnl ipc, mfc, nativdlg, oleauto, ownerdrw - SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS controls dialogs \ + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \ drawing dynamic erase event exec font image \ minimal richedit rotate widgets" @@ -4574,8 +4706,7 @@ fi dnl all -I options we must pass to the compiler INCLUDES="-I\${top_builddir}/lib/wx/include/${TOOLCHAIN_NAME} -I\${top_srcdir}/include \ -$REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE \ -$FREETYPE_INCLUDE $TOOLKIT_INCLUDE" +$REGEX_INCLUDE $ZLIB_INCLUDE $PNG_INCLUDE $JPEG_INCLUDE $TIFF_INCLUDE $TOOLKIT_INCLUDE" dnl wxGTK does not need TOOLKIT includes in wx-config if test "$wxUSE_GTK" = 1; then @@ -4675,8 +4806,10 @@ AC_SUBST(WXCONFIG_LIBS_STATIC) AC_SUBST(WXCONFIG_LIBS_STATIC_GL) AC_SUBST(WXCONFIG_INCLUDE) -dnl what to compile +dnl the list of files to compile/install AC_SUBST(ALL_OBJECTS) +AC_SUBST(ALL_HEADERS) +AC_SUBST(ALL_SOURCES) dnl distribution vars AC_SUBST(GUIDIST) @@ -4702,6 +4835,7 @@ AC_SUBST(WX_RESOURCES_MACOSX_COMPILED) dnl additional for Mac OS X AC_SUBST(DEREZ) +AC_SUBST(MACOSX_BUNDLE) AC_SUBST(LIBWXMACRES) AC_SUBST(LIBWXMACRESCOMP) AC_SUBST(LIBWXMACRESWXCONFIG) @@ -4742,7 +4876,7 @@ if test "$wxUSE_GUI" = "yes"; then export wx_cv_path_samplesubdirs wx_cv_if_gnu_make \ wx_cv_path_ifs wx_cv_program_ext \ wx_cv_target_library wx_cv_target_library_gl wx_cv_target_libtype - AC_CONFIG_SUBDIRS(demos samples utils contrib) + AC_CONFIG_SUBDIRS(demos samples utils contrib mobile) fi dnl create each of the files in the space separated list from the file.in