added checks for Xm/Xpm headers/libs in CFLAGS/LDFLAGS
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5903 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
96
configure.in
96
configure.in
@@ -1659,15 +1659,34 @@ if test "$wxUSE_MOTIF" = 1; then
|
|||||||
dnl AC_MSG_ERROR(please set LDFLAGS to contain the location of libX11)
|
dnl AC_MSG_ERROR(please set LDFLAGS to contain the location of libX11)
|
||||||
dnl fi
|
dnl fi
|
||||||
|
|
||||||
|
COMPILED_X_PROGRAM=0
|
||||||
|
|
||||||
AC_MSG_CHECKING(for Motif/Lesstif headers)
|
AC_MSG_CHECKING(for Motif/Lesstif headers)
|
||||||
WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
|
WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
|
||||||
if test "$ac_find_includes" != "" ; then
|
if test "$ac_find_includes" != "" ; then
|
||||||
AC_MSG_RESULT(found $ac_find_includes)
|
AC_MSG_RESULT(found $ac_find_includes)
|
||||||
else
|
else
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[
|
||||||
|
#include <Xm/Xm.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
int version;
|
||||||
|
|
||||||
|
version = xmUseVersion;
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(found in default search path)
|
||||||
|
COMPILED_X_PROGRAM=1
|
||||||
|
],
|
||||||
|
[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
|
AC_MSG_ERROR(please set CFLAGS to contain the location of Xm/Xm.h)
|
||||||
|
]
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if test "$COMPILED_X_PROGRAM" = 0; then
|
||||||
AC_MSG_CHECKING(for Motif/Lesstif library)
|
AC_MSG_CHECKING(for Motif/Lesstif library)
|
||||||
WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
|
WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
|
||||||
if test "$ac_find_libraries" != "" ; then
|
if test "$ac_find_libraries" != "" ; then
|
||||||
@@ -1678,20 +1697,61 @@ if test "$wxUSE_MOTIF" = 1; then
|
|||||||
TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
|
TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE $ac_path_to_include"
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
else
|
else
|
||||||
|
dnl it might happen that we found headers in one of the standard
|
||||||
|
dnl paths but the libs are elsewhere - we do need to try to
|
||||||
|
dnl compile a sample program then here
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[
|
||||||
|
#include <Xm/Xm.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
int version;
|
||||||
|
|
||||||
|
version = xmUseVersion;
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(found in default search path)
|
||||||
|
COMPILED_X_PROGRAM=1
|
||||||
|
],
|
||||||
|
[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
|
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
|
||||||
|
]
|
||||||
|
)
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
AC_MSG_CHECKING(for Xt library)
|
dnl we don't need this as we used AC_PATH_XTRA above which does it for us
|
||||||
WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
|
dnl
|
||||||
if test "$ac_find_libraries" != "" ; then
|
dnl dnl if we already compiled a sample program, X libs are surely there
|
||||||
WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
|
dnl if test "$COMPILED_X_PROGRAM" = 0; then
|
||||||
GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
|
dnl AC_MSG_CHECKING(for Xt library)
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
dnl WX_PATH_FIND_LIBRARIES($SEARCH_LIB,Xt)
|
||||||
else
|
dnl if test "$ac_find_libraries" != "" ; then
|
||||||
AC_MSG_RESULT(no)
|
dnl WX_LINK_PATH_EXIST($ac_find_libraries,$GUI_TK_LIBRARY)
|
||||||
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt)
|
dnl GUI_TK_LIBRARY="$GUI_TK_LIBRARY $ac_path_to_link"
|
||||||
fi
|
dnl AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
|
dnl else
|
||||||
|
dnl AC_TRY_COMPILE
|
||||||
|
dnl (
|
||||||
|
dnl [
|
||||||
|
dnl #include <X11/Intrinsic.h>
|
||||||
|
dnl ],
|
||||||
|
dnl [
|
||||||
|
dnl char *p;
|
||||||
|
dnl p = XtMalloc(5);
|
||||||
|
dnl ],
|
||||||
|
dnl [
|
||||||
|
dnl AC_MSG_RESULT(found in default search path)
|
||||||
|
dnl COMPILED_X_PROGRAM=1
|
||||||
|
dnl ],
|
||||||
|
dnl [
|
||||||
|
dnl AC_MSG_RESULT(no)
|
||||||
|
dnl AC_MSG_ERROR(please set LDFLAGS to contain the location of libXt)
|
||||||
|
dnl ]
|
||||||
|
dnl )
|
||||||
|
dnl fi
|
||||||
|
dnl fi
|
||||||
|
|
||||||
XPM_LINK=""
|
XPM_LINK=""
|
||||||
AC_MSG_CHECKING(for Xpm library)
|
AC_MSG_CHECKING(for Xpm library)
|
||||||
@@ -1703,8 +1763,24 @@ if test "$wxUSE_MOTIF" = 1; then
|
|||||||
AC_DEFINE(wxHAVE_LIB_XPM)
|
AC_DEFINE(wxHAVE_LIB_XPM)
|
||||||
AC_MSG_RESULT(found at $ac_find_libraries)
|
AC_MSG_RESULT(found at $ac_find_libraries)
|
||||||
else
|
else
|
||||||
|
AC_TRY_COMPILE(
|
||||||
|
[
|
||||||
|
#include <X11/xpm.h>
|
||||||
|
],
|
||||||
|
[
|
||||||
|
int version;
|
||||||
|
|
||||||
|
version = XpmLibraryVersion();
|
||||||
|
],
|
||||||
|
[
|
||||||
|
AC_MSG_RESULT(found in default search path),
|
||||||
|
COMPILED_X_PROGRAM=0
|
||||||
|
],
|
||||||
|
[
|
||||||
AC_MSG_RESULT(no)
|
AC_MSG_RESULT(no)
|
||||||
AC_MSG_WARN(library will be compiled without support for images in XPM format)
|
AC_MSG_WARN(library will be compiled without support for images in XPM format)
|
||||||
|
]
|
||||||
|
)
|
||||||
fi
|
fi
|
||||||
|
|
||||||
GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXext -lXt -lX11 -lm"
|
GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXext -lXt -lX11 -lm"
|
||||||
|
Reference in New Issue
Block a user