X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90dd450cf3c48124a6eb9c815f47dfafea141a92..98e78a5eb45c4e7b90bb045b7ed7a0b234f4eea4:/configure.in diff --git a/configure.in b/configure.in index 9a68484a47..cb11a6970f 100644 --- a/configure.in +++ b/configure.in @@ -224,6 +224,9 @@ case "${host}" in USE_AIX=1 USE_SYSV=1 USE_SVR4=1 + dnl Irvin Probst reports that the shared + dnl libraries under AIX have the same suffix as the normal ones + SO_SUFFIX=a AC_DEFINE(__AIX__) AC_DEFINE(__SYSV__) AC_DEFINE(__SVR4__) @@ -231,15 +234,10 @@ case "${host}" in ;; *-*-cygwin* | *-*-mingw32* ) - USE_UNIX=0 - USE_WIN32=1 + dnl MBN: some of the defines have been moved after toolkit detection + dnl because for wxMotif/wxGTK/wxX11 to build on Cygwin + dnl USE_UNIX must be set and not USE_WIN32 SO_SUFFIX=dll - AC_DEFINE(__WIN32__) - AC_DEFINE(__WIN95__) - AC_DEFINE(__WINDOWS__) - AC_DEFINE(__GNUWIN32__) - AC_DEFINE(STRICT) - AC_DEFINE(WINVER, 0x0400) PROGRAM_EXT=".exe" RESCOMP=windres DEFAULT_DEFAULT_wxUSE_MSW=1 @@ -251,6 +249,8 @@ case "${host}" in AC_DEFINE(__DOS__) PROGRAM_EXT=".exe" DEFAULT_DEFAULT_wxUSE_MGL=1 + dnl DJGPP needs explicit -lstdc++ for some reason (VS: mayb some versions only?) + LIBS="$LIBS -lstdc++" ;; *-pc-os2_emx | *-pc-os2-emx ) @@ -281,11 +281,6 @@ case "${host}" in AC_MSG_ERROR(unknown system type ${host}.) esac -if test "$USE_UNIX" = 1 ; then - wxUSE_UNIX=yes - AC_DEFINE(__UNIX__) -fi - dnl --------------------------------------------------------------------------- dnl command line options for configure dnl --------------------------------------------------------------------------- @@ -397,7 +392,7 @@ if test $DEBUG_CONFIGURE = 1; then DEFAULT_wxUSE_PROTOCOL_FTP=no DEFAULT_wxUSE_PROTOCOL_FILE=no DEFAULT_wxUSE_URL=no - + DEFAULT_wxUSE_COMMONDLGS=no DEFAULT_wxUSE_CHOICEDLG=no DEFAULT_wxUSE_COLOURDLG=no @@ -688,7 +683,7 @@ AC_ARG_WITH(mac, [ --with-mac use Mac OS X], [wxUSE_MAC= AC_ARG_WITH(wine, [ --with-wine use WINE], [wxUSE_WINE="$withval" CACHE_WINE=1 TOOLKIT_GIVEN=1]) AC_ARG_WITH(msw, [ --with-msw use MS-Windows], [wxUSE_MSW="$withval" CACHE_MSW=1 TOOLKIT_GIVEN=1]) 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(mgl, [ --with-mgl use SciTech MGL], [wxUSE_MGL="$withval" wxUSE_UNIVERSAL="yes" 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) @@ -742,6 +737,13 @@ WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without depe WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2) WX_ARG_ENABLE(compat22, [ --disable-compat22 disable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2) +AC_ARG_ENABLE(rpath, [ --enable-rpath=DIR output the rpath flag from wx-config], [wxRPATH_DIR="$enableval"]) + +if test "$wxRPATH_DIR" != "" -a "$wxRPATH_DIR" != "disable"; then + WXCONFIG_RPATH="-Wl,-rpath -Wl,$wxRPATH_DIR" +fi + + dnl --------------------------------------------------------------------------- dnl (small) optional non GUI classes dnl --------------------------------------------------------------------------- @@ -1118,6 +1120,50 @@ else AC_MSG_RESULT(base ($host_alias hosted) only) fi +dnl --------------------------------------------------------------------------- +dnl When we are using Cygwin with Motif/GTK+, we want it to appear like +dnl 'just' a POSIX platform, so the Win32 API must not be available +dnl --------------------------------------------------------------------------- + +dnl (Windows-only piece) +wants_win32=0 +doesnt_want_win32=0 +case "${host}" in + *-*-cygwin*) + if test "$wxUSE_MSW" = 1 ; then + wants_win32=1 + else + doesnt_want_win32=1 + fi + ;; + *-*-mingw*) + wants_win32=1 + ;; +esac + +dnl NB: The two tests bellow are *NOT* mutually exclusive! They should only +dnl take effect on Cygwin/Mingw and not other platforms. +if test "$wants_win32" = 1 ; then + USE_UNIX=0 + USE_WIN32=1 + AC_DEFINE(__WIN32__) + AC_DEFINE(__WIN95__) + AC_DEFINE(__WINDOWS__) + AC_DEFINE(__GNUWIN32__) + AC_DEFINE(STRICT) + AC_DEFINE(WINVER, 0x0400) +fi +if test "$doesnt_want_win32" = 1 ; then + USE_UNIX=1 + USE_WIN32=0 +fi +dnl (end of Windows-only piece) + +if test "$USE_UNIX" = 1 ; then + wxUSE_UNIX=yes + AC_DEFINE(__UNIX__) +fi + dnl --------------------------------------------------------------------------- dnl Checks for programs dnl --------------------------------------------------------------------------- @@ -1185,6 +1231,16 @@ AC_CHECK_PROG(AR, ar, ar, ar) dnl install checks dnl defines INSTALL with the appropriate command AC_PROG_INSTALL + +dnl make install path absolute (if not already); will fail with MSDOS paths +case ${INSTALL} in + /* ) # Absolute + ;; + *) + INSTALL=`pwd`/${INSTALL} ;; +esac + + case "${host}" in dnl The other BSD's should probably go in here too, since this is @@ -1274,6 +1330,54 @@ AC_PROG_LEX dnl needed for making link to setup.h AC_PROG_LN_S +dnl ------------------------------------------------------------------------ +dnl Check for headers +dnl ------------------------------------------------------------------------ + +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 + AC_CHECK_HEADERS(strings.h) +fi + +dnl defines HAVE_STDLIB_H +AC_CHECK_HEADERS(stdlib.h) +dnl defines HAVE_MALLOC_H +AC_CHECK_HEADERS(malloc.h) +dnl defines HAVE_UNISTD_H +AC_CHECK_HEADERS(unistd.h) +dnl defines HAVE_WCHAR_H +AC_CHECK_HEADERS(wchar.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) + +if test "x$ac_cv_header_fnmatch_h" = "xyes"; then + AC_CHECK_FUNCS(fnmatch) +fi + +dnl defines HAVE_LANGINFO_H (GNU libc locale parameters) +AC_CHECK_HEADERS(langinfo.h) + +if test "$wxUSE_GUI" = "yes"; then + if test "$wxUSE_UNIX" = "yes"; then + dnl defines HAVE_X11_XKBLIB_H + AC_CHECK_HEADERS(X11/XKBlib.h) + fi +fi + dnl --------------------------------------------------------------------------- dnl Checks for compiler characteristics dnl --------------------------------------------------------------------------- @@ -1300,7 +1404,6 @@ case "${host}" in 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 dnl Mac OS X does not provide wchar.h and wchar_t is defined by stdlib.h (GD) @@ -1346,6 +1449,9 @@ WX_CPP_NEW_HEADERS(, AC_DEFINE(wxUSE_IOSTREAMH)) dnl check whether C++ compiler supports bool built-in type WX_CPP_BOOL +dnl check whether C++ compiler supports explicit keyword +WX_CPP_EXPLICIT + dnl --------------------------------------------------------------------------- dnl Define search path for includes and libraries: all headers and libs will be dnl looked for in all directories of this path @@ -1548,7 +1654,7 @@ 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 @@ -1887,6 +1993,8 @@ equivalent variable and GTK+ is version 1.2.3 or above. fi fi + wxUSE_UNIVERSAL="yes" + TOOLKIT_INCLUDE="-I$MGL_ROOT/include" GUI_TK_LIBRARY="-L$MGL_ROOT/lib/$mgl_lib_type/$mgl_os -lmgl -lmglcpp -lpm" @@ -1913,11 +2021,13 @@ equivalent variable and GTK+ is version 1.2.3 or above. TOOLKIT_INCLUDE="-I$MICROWINDOWS/include" GUI_TK_LIBRARY="-L$MICROWINDOWS/lib -lmwin -lmwengine -mwfonts -mwdrivers -mwinlib" + wxUSE_UNIVERSAL="yes" + AFMINSTALL=afminstall TOOLKIT=MICROWIN GUIDIST=MICROWIN_DIST - - TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXUNIVERSAL__ -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1" + + TOOLCHAIN_DEFS="${TOOLCHAIN_DEFS} -D__WXMSW__ -D__WIN95__ -D__WIN32__ -DMWIN -DMICROWIN_NOCONTROLS -DMICROWIN_TODO=1" fi if test "$wxUSE_X11" = 1; then @@ -1976,6 +2086,8 @@ equivalent variable and GTK+ is version 1.2.3 or above. ) fi + wxUSE_UNIVERSAL="yes" + 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" @@ -2128,7 +2240,47 @@ equivalent variable and GTK+ is version 1.2.3 or above. ) fi - GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt -lX11" + AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) + libp_link="" + libsm_ice_link="" + libs_found=0 + for libp in "" " -lXp"; do + if test "$libs_found" = "0"; then + for libsm_ice in " -lSM -lICE"; do + if test "$libs_found" = "0"; then + save_LIBS="$LIBS" + LIBS="$GUI_TK_LIBRARY -lXm${xpm_link} ${libp} -lXmu -lXext -lXt${libsm_ice} -lX11" + AC_TRY_LINK( + [ + #include + #include + ], + [ + XmString string = NULL; + Widget w = NULL; + int position = 0; + XmListAddItem(w, string, position); + ], + [ + libp_link="$libp" + libsm_ice_link="$libsm_ice" + AC_MSG_RESULT( + [need${libp_link}${libsm_ice_link}]) + libs_found=1 + ], [] + ) + LIBS="$save_LIBS" + fi + done + fi + done + + if test "$libs_found" = "0"; then + AC_MSG_RESULT([can't find the right libraries]) + AC_MSG_ERROR([can't link a simple motif program]) + fi + + GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11" TOOLKIT_VPATH="\${top_srcdir}/src/motif${PATH_IFS}\${top_srcdir}/src/motif/xmcombo" TOOLKIT=MOTIF GUIDIST=MOTIF_DIST @@ -2360,7 +2512,7 @@ case "${host}" in dnl FIXME: is this GL stuff actually even used for wxMSW? should it be?? - if test "$cross_compiling" != "yes"; then + if test "$cross_compiling" != "yes" -a "$TOOLKIT_DIR" = "msw"; then WX_LIBRARY="wxmsw${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}" WX_LIBRARY_GL="wxmsw_gl${WX_MSW_VERSION}${lib_unicode_suffix}${lib_debug_suffix}" WX_LIBRARY_NAME_SHARED="${WX_LIBRARY}.${SO_SUFFIX}" @@ -2376,7 +2528,7 @@ case "${host}" in dnl dynamic shared libraries (in order to embed the resources) if test "$wxUSE_MAC" = 1; then dnl the name of the resources file for wxMac - WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r" + WX_RESOURCES_MACOSX_ASCII="lib${WX_LIBRARY}.r" WX_RESOURCES_MACOSX_DATA="lib${WX_LIBRARY}.rsrc" fi ;; @@ -2507,7 +2659,12 @@ if test "$wxUSE_SHARED" = "yes"; then ;; *-*-aix* ) - SHARED_LD="/usr/lpp/xlC/bin/makeC++SharedLib -p 0 -o" + dnl the abs path below used to be hardcoded here so I guess it must + dnl be some sort of standard location under AIX? + AC_CHECK_PROG(AIX_CXX_LD, makeC++SharedLib, + makeC++SharedLib, /usr/lpp/xlC/bin/makeC++SharedLib) + + SHARED_LD="$(AIX_CXX_LD) -p 0 -o" ;; *-*-cygwin* | *-*-mingw32* ) @@ -2608,54 +2765,6 @@ else fi fi -dnl ------------------------------------------------------------------------ -dnl Check for headers -dnl ------------------------------------------------------------------------ - -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 - AC_CHECK_HEADERS(strings.h) -fi - -dnl defines HAVE_STDLIB_H -AC_CHECK_HEADERS(stdlib.h) -dnl defines HAVE_MALLOC_H -AC_CHECK_HEADERS(malloc.h) -dnl defines HAVE_UNISTD_H -AC_CHECK_HEADERS(unistd.h) -dnl defines HAVE_WCHAR_H -AC_CHECK_HEADERS(wchar.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) - -if test "x$ac_cv_header_fnmatch_h" = "xyes"; then - AC_CHECK_FUNCS(fnmatch) -fi - -dnl defines HAVE_LANGINFO_H (GNU libc locale parameters) -AC_CHECK_HEADERS(langinfo.h) - -if test "$wxUSE_GUI" = "yes"; then - if test "$wxUSE_UNIX" = "yes"; then - dnl defines HAVE_X11_XKBLIB_H - AC_CHECK_HEADERS(X11/XKBlib.h) - fi -fi - dnl --------------------------------------------------------------------------- dnl Checks for typedefs dnl --------------------------------------------------------------------------- @@ -3181,8 +3290,9 @@ if test "$TOOLKIT" != "MSW"; then dnl and finally the userland threads THREAD_OPTS="-kthread lthread $THREAD_OPTS c_r" ;; - *-*-darwin*) + *-*-darwin* | *-*-cygwin* ) dnl Darwin / Mac OS X just uses -lpthread tested below + dnl and so does Cygwin THREAD_OPTS="" ;; *-*-aix*) @@ -3479,6 +3589,18 @@ if test "$GCC" = "yes" ; then # they had a reason, right?? CODE_GEN_FLAGS="$CODE_GEN_FLAGS -fno-pcc-struct-return" fi + + dnl Ian Brown reports that versions of gcc before + dnl 3.0 overflow the table of contents on rs6000 as they create an entry + dnl for each subroutine by default -- using the switch below only creates + dnl one entry per file instead at the price of minor performance penalty + dnl + dnl TODO: test for the gcc version here (how?) + case "${host}" in + powerpc*-*-aix* ) + CODE_GEN_FLAGS="$CODE_GEN_FLAGS -mminimal-toc" + ;; + esac fi if test "$wxUSE_OPTIMISE" = "no" ; then @@ -3821,10 +3943,15 @@ dnl ------------------------------------------------------------------------ dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11 if test "$wxUSE_SOCKETS" = "yes"; then - if test "$TOOLKIT" = "X11"; then + if test "$wxUSE_X11" = "1"; then AC_MSG_WARN([wxSocket not yet supported under X11... disabled]) wxUSE_SOCKETS="no" fi + + if test "$wxUSE_MGL" = "1"; then + AC_MSG_WARN([wxSocket not yet supported under MGL... disabled]) + wxUSE_SOCKETS="no" + fi fi if test "$wxUSE_SOCKETS" = "yes"; then @@ -4029,7 +4156,7 @@ fi if test "$wxUSE_UNICODE" = "yes" ; then AC_DEFINE(wxUSE_UNICODE) - + if test "$wxUSE_MSW" != 1; then wxUSE_UNICODE_MSLU=no fi @@ -4197,10 +4324,17 @@ if test "$wxUSE_IPC" = "yes"; then fi if test "$wxUSE_CLIPBOARD" = "yes"; then - AC_DEFINE(wxUSE_CLIPBOARD) + if test "$wxUSE_MGL" = 1; then + AC_MSG_WARN([Clipboard not yet supported under MGL... disabled]) + wxUSE_CLIPBOARD=no + fi - dnl required by clipboard code in configuration check - AC_DEFINE(wxUSE_DATAOBJ) + if test "$wxUSE_CLIPBOARD" = "yes"; then + AC_DEFINE(wxUSE_CLIPBOARD) + + dnl required by clipboard code in configuration check + AC_DEFINE(wxUSE_DATAOBJ) + fi fi if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then @@ -4221,6 +4355,11 @@ if test "$wxUSE_DRAG_AND_DROP" = "yes" ; then wxUSE_DRAG_AND_DROP=no fi + if test "$wxUSE_MGL" = 1; then + AC_MSG_WARN([Drag and drop not yet supported under MGL... 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" @@ -4495,7 +4634,7 @@ if test "$wxUSE_POPUPWIN" = "yes"; then else if test "$wxUSE_PM" = 1; then AC_MSG_WARN([wxPopupWindow not yet supported under PM... disabled]) - else + else AC_DEFINE(wxUSE_POPUPWIN) USES_CONTROLS=1 @@ -4507,7 +4646,7 @@ fi if test "$wxUSE_TIPWINDOW" = "yes"; then if test "$wxUSE_PM" = 1; then AC_MSG_WARN([wxTipWindow not yet supported under PM... disabled]) - else + else AC_DEFINE(wxUSE_TIPWINDOW) fi fi @@ -4545,6 +4684,10 @@ fi if test "$wxUSE_SYSTEM_OPTIONS" = "yes"; then AC_DEFINE(wxUSE_SYSTEM_OPTIONS) +if test "$TOOLKIT" = "MSW"; then + SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS taskbar" +fi + fi if test "$wxUSE_PROTOCOL" = "yes"; then @@ -4876,6 +5019,7 @@ AC_SUBST(WXCONFIG_LIBS_GL) AC_SUBST(WXCONFIG_LIBS_STATIC) AC_SUBST(WXCONFIG_LIBS_STATIC_GL) AC_SUBST(WXCONFIG_INCLUDE) +AC_SUBST(WXCONFIG_RPATH) dnl the list of files to compile/install AC_SUBST(ALL_OBJECTS)