X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/15b17d22b02331e1e7acff9fa701df1b11e20428..7ea07c5342eaa56f14f33462bed4d68ac5ba5faf:/configure.in?ds=sidebyside diff --git a/configure.in b/configure.in index a74bac5c66..1f4a71bb13 100644 --- a/configure.in +++ b/configure.in @@ -2091,9 +2091,6 @@ SEARCH_INCLUDE="\ /usr/Motif-2.1/include \ /usr/Motif-1.2/include \ /usr/include/Motif1.2 \ - /opt/xpm/include/X11 \ - /opt/GBxpm/include/ \ - /opt/GBxpm/X11/include/ \ \ /usr/dt/include \ /usr/openwin/include \ @@ -2122,39 +2119,37 @@ SEARCH_INCLUDE="\ /usr/local/X11/include \ /usr/local/include/X11 \ \ - /usr/X386/include \ - /usr/x386/include \ /usr/XFree86/include/X11 \ - \ /usr/pkg/include \ \ - X:/XFree86/include \ - X:/XFree86/include/X11 \ - \ - /usr/include/gtk \ - /usr/local/include/gtk \ - /usr/include/glib \ - /usr/local/include/glib \ - \ - /usr/include/qt \ - /usr/local/include/qt \ - \ - /usr/local/arm/3.3.2/include \ - \ - /usr/include/windows \ - /usr/include/wine \ - /usr/local/include/wine \ - \ - /usr/unsupported/include \ - /usr/athena/include \ - /usr/local/x11r5/include \ - /usr/lpp/Xamples/include \ - \ /usr/openwin/share/include" -dnl add 64 bit X11 libs for Linux on AMD, they must come before the usual -dnl locations or 64 bit compilation failed -SEARCH_LIB="/usr/X11R6/lib64 `echo "$SEARCH_INCLUDE" | sed s/include/lib/g`" +dnl try to find out the standard lib locations +AC_CACHE_CHECK([for libraries directory], + wx_cv_std_libpath, + [ + for d in WX_STD_LIBPATH(); do + for e in a so sl dylib dll.a; do + libc="$d/libc.$e" + if test -f $libc; then + save_LIBS="$LIBS" + LIBS="$libc" + AC_LINK_IFELSE([int main() { return 0; }], + wx_cv_std_libpath=`echo $d | sed s@/usr/@@`) + LIBS="$save_LIBS" + if test "x$wx_cv_std_libpath" != "x"; then + break 2 + fi + fi + done + done + if test "x$wx_cv_std_libpath" = "x"; then + wx_cv_std_libpath="lib" + fi + ] +) + +SEARCH_LIB=`echo "$SEARCH_INCLUDE" | sed s@include@$wx_cv_std_libpath@g` dnl Cross compiling with gcc? if test "$build" != "$host" -a "$GCC" = yes; then @@ -3082,41 +3077,41 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config CFLAGS=$save_CFLAGS fi - if test "$COMPILED_X_PROGRAM" = 0; then - AC_MSG_CHECKING(for Motif/Lesstif library) - WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) - if test "$ac_find_libraries" != "" ; then - AC_MSG_RESULT(found in $ac_find_libraries) - WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) - GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" - else - dnl it might happen that we found headers in one of the - dnl standard paths but the libs are elsewhere - we do need to - dnl try to compile a sample program then here - save_CFLAGS=$CFLAGS - CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" + AC_MSG_CHECKING(for Motif/Lesstif library) + WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm) - AC_TRY_COMPILE( - [ - #include - ], - [ - int version; - version = xmUseVersion; - ], - [ - AC_MSG_RESULT(found in default search path) - COMPILED_X_PROGRAM=1 - ], - [ + if test "x$ac_find_libraries" != "x" ; then + AC_MSG_RESULT(found in $ac_find_libraries) + + WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY) + GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link" + else + dnl it might happen that we found headers in one of the standard + dnl paths but the libs are elsewhere but still in default (linker) + dnl path -- try to compile a test program to check for this + save_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" + + AC_TRY_LINK( + [ + #include + ], + [ + int version; + version = xmUseVersion; + ], + [ + AC_MSG_RESULT(found in default search path) + COMPILED_X_PROGRAM=1 + ], + [ AC_MSG_RESULT(no) AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm) ] ) - CFLAGS=$save_CFLAGS - fi + CFLAGS=$save_CFLAGS fi AC_MSG_CHECKING([if we need -lXp and/or -lSM -lICE]) @@ -3170,41 +3165,44 @@ libraries returned by 'pkg-config gtk+-2.0 --libs' or 'gtk-config save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS $TOOLKIT_INCLUDE" - AC_MSG_CHECKING([for Motif 2]) - AC_TRY_COMPILE([ - #include - ], - [ - #if XmVersion < 2000 - Not Motif 2 - #endif - ], - [ - AC_DEFINE(__WXMOTIF20__,1) - AC_MSG_RESULT([found]) - ], - [ - AC_DEFINE(__WXMOTIF20__,0) - AC_MSG_RESULT([not found]) - ]) - - AC_MSG_CHECKING([whether Motif is Lesstif]) - AC_TRY_COMPILE([ - #include - ], - [ - #if !defined(LesstifVersion) || LesstifVersion <= 0 - Not Lesstif - #endif - ], - [ - AC_DEFINE(__WXLESSTIF__,1) - AC_MSG_RESULT([yes]) - ], - [ - AC_DEFINE(__WXLESSTIF__,0) - AC_MSG_RESULT([no]) - ]) + + AC_CACHE_CHECK([for Motif 2], + wx_cv_lib_motif2, + AC_TRY_COMPILE([ + #include + ], + [ + #if XmVersion < 2000 + Not Motif 2 + #endif + ], + wx_cv_lib_motif2="yes", + wx_cv_lib_motif2="no")) + if test "$wx_cv_lib_motif2" = "yes"; then + AC_DEFINE(__WXMOTIF20__,1) + else + AC_DEFINE(__WXMOTIF20__,0) + fi + + AC_CACHE_CHECK([whether Motif is Lesstif], + wx_cv_lib_lesstif, + AC_TRY_COMPILE([ + #include + ], + [ + #if !defined(LesstifVersion) || LesstifVersion <= 0 + Not Lesstif + #endif + ], + wx_cv_lib_lesstif="yes", + wx_cv_lib_lesstif="no") + ) + if test "$wx_cv_lib_lesstif" = "yes"; then + AC_DEFINE(__WXLESSTIF__,1) + else + AC_DEFINE(__WXLESSTIF__,0) + fi + CFLAGS=$save_CFLAGS GUI_TK_LIBRARY="$GUI_TK_LIBRARY${libsgm_link} -lXm${libp_link} -lXmu -lXext -lXt${libsm_ice_link} -lX11"