dnl 'just' a POSIX platform, so the Win32 API must not be available
dnl ---------------------------------------------------------------------------
-define_win32=0
+dnl (Windows-only piece)
+wants_win32=0
+doesnt_want_win32=0
case "${host}" in
*-*-cygwin*)
if test "$wxUSE_MSW" = 1 ; then
- define_win32=1
+ wants_win32=1
+ else
+ doesnt_want_win32=1
fi
;;
*-*-mingw*)
- define_win32=1
+ wants_win32=1
;;
esac
-if test "$define_win32" = 1 ; then
+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(__GNUWIN32__)
AC_DEFINE(STRICT)
AC_DEFINE(WINVER, 0x0400)
-else
+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
dnl check for glibc version
dnl
dnl VZ: I have no idea why had this check been there originally, but now
-dnl it is only used to get the recursive mutexes under Linux
+dnl we could probably do without it by just always adding _GNU_SOURCE
if test "$USE_LINUX" = 1; then
AC_CACHE_CHECK([for glibc 2.1 or later], wx_cv_lib_glibc21,[
AC_TRY_COMPILE([#include <features.h>],
fi
fi
+dnl we may need _GNU_SOURCE for 2 things:
+dnl
+dnl 1. to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+ (strictly speaking we
+dnl only need _XOPEN_SOURCE=500 but just defining this disables _BSD_SOURCE
+dnl which breaks libtiff compilation, so it is simpler to just define
+dnl _GNU_SOURCE to get everything)
+dnl
+dnl 2. for Unicode functions
+if test "x$wx_cv_lib_glibc21" = "xyes"; then
+ if test "$wxUSE_UNICODE" = "yes" -o "$wxUSE_THREADS" = "yes"; then
+ AC_DEFINE(_GNU_SOURCE)
+ fi
+fi
+
dnl ---------------------------------------------------------------------------
dnl Optional libraries
dnl
;;
esac
+ if test "$WXGTK20" = 1; then
+ if test "$wxUSE_PRINTING_ARCHITECTURE" = "yes" ; then
+ PKG_CHECK_MODULES(PANGOFT2, pangoft2,
+ [
+ CXXFLAGS="$CXXFLAGS $PANGOFT2_CFLAGS"
+ LIBS="$LIBS $PANGOFT2_LIBS"
+ ],
+ [
+ AC_MSG_WARN([pangoft2 library not found, library will be compiled without printing support])
+ wxUSE_PRINTING_ARCHITECTURE="no"
+ ]
+ )
+ fi
+ fi
+
TOOLKIT_INCLUDE="$wx_cv_cflags_gtk"
GUI_TK_LIBRARY="$wx_cv_libs_gtk"
AC_MSG_CHECKING(for Motif/Lesstif headers)
WX_PATH_FIND_INCLUDES($SEARCH_INCLUDE, Xm/Xm.h)
if test "$ac_find_includes" != "" ; then
- AC_MSG_RESULT(found $ac_find_includes)
+ AC_MSG_RESULT(found in $ac_find_includes)
+ WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
+ TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
else
AC_TRY_COMPILE(
[
AC_MSG_CHECKING(for Motif/Lesstif library)
WX_PATH_FIND_LIBRARIES($SEARCH_LIB, Xm)
if test "$ac_find_libraries" != "" ; then
- WX_INCLUDE_PATH_EXIST($ac_find_includes, $TOOLKIT_INCLUDE)
- WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
+ AC_MSG_RESULT(found at $ac_find_libraries)
+ WX_LINK_PATH_EXIST($ac_find_libraries, $GUI_TK_LIBRARY)
GUI_TK_LIBRARY="$GUI_TK_LIBRARY$ac_path_to_link"
- TOOLKIT_INCLUDE="$TOOLKIT_INCLUDE$ac_path_to_include"
- AC_MSG_RESULT(found at $ac_find_libraries)
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
+ 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_TRY_COMPILE(
[
#include <Xm/Xm.h>
AC_MSG_ERROR(please set LDFLAGS to contain the location of libXm)
]
)
+
+ CFLAGS=$save_CFLAGS
fi
fi
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
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $TOOLKIT_INCLUDE"
+
AC_TRY_COMPILE(
[
#include <X11/xpm.h>
AC_MSG_WARN(library will be compiled without support for images in XPM format)
]
)
+
+ CFLAGS=$save_CFLAGS
fi
- dnl MBN: this should really be an AC_TRY_LINK, but it is faster
- dnl to special case it
- xt_needs_sm_ice=
- case "${host}" in
- *-*-cygwin* )
- xt_needs_sm_ice=" -lSM -lICE"
- ;;
- esac
+ 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"
+ save_CFLAGS=$CFLAGS
+ CFLAGS="$CFLAGS $TOOLKIT_INCLUDE"
+
+ AC_TRY_LINK(
+ [
+ #include <Xm/Xm.h>
+ #include <Xm/List.h>
+ ],
+ [
+ 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"
+ CFLAGS=$save_CFLAGS
+ fi
+ done
+ fi
+ done
- GUI_TK_LIBRARY="$GUI_TK_LIBRARY -lXm$xpm_link -lXmu -lXext -lXt${xt_needs_sm_ice} -lX11"
+ 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
dnl defined, we do it by directly assigned
dnl PTHREAD_MUTEX_RECURSIVE_MUTEX_INITIALIZER_NP to attr
- dnl we need _GNU_SOURCE to get PTHREAD_MUTEX_RECURSIVE with glibc 2.1+
- dnl (strictly speaking we only need _XOPEN_SOURCE=500 but just defining
- dnl this disables _BSD_SOURCE which breaks libtiff compilation, so it is
- dnl simpler to just define _GNU_SOURCE to get everything)
- if test "x$wx_cv_lib_glibc21" = "xyes"; then
- CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
- fi
-
AC_CACHE_CHECK([for pthread_mutexattr_t], wx_cv_type_pthread_mutexattr_t,
[
AC_TRY_COMPILE([#include <pthread.h>],
dnl VZ: the GUI hooks wxSocket needs are not implemented yet in wxX11
if test "$wxUSE_SOCKETS" = "yes"; 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
if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
- if test "$wxUSE_UNIVERSAL" = "yes"; then
- AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
- wxUSE_MDI_ARCHITECTURE=no
- fi
- if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
- AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
- fi
+dnl There is now experimental generic MDI support
+dnl if test "$wxUSE_UNIVERSAL" = "yes"; then
+dnl AC_MSG_WARN(MDI not yet supported for wxUniversal... disabled)
+dnl wxUSE_MDI_ARCHITECTURE=no
+dnl fi
+
+ if test "$wxUSE_MDI_ARCHITECTURE" = "yes"; then
+ AC_DEFINE(wxUSE_MDI_ARCHITECTURE)
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS mdi"
+ fi
fi
if test "$wxUSE_DOC_VIEW_ARCHITECTURE" = "yes" ; then
dnl ipc, mfc, nativdlg, oleauto, ownerdrw
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \
drawing dynamic erase event exec font image \
- minimal richedit rotate widgets"
+ minimal propsize rotate widgets"
dnl this is needed to be able to find AFM files
CPPFLAGS="$CPPFLAGS \$(EXTRADEFS) \$(APPEXTRADEFS)"
EXTRA_CFLAGS="$WXDEBUG $WXODBCFLAG $PROFILE $OPTIMISE $INCLUDES"
dnl remove the extra white space from the cc/c++/ld options
-CFLAGS=`echo $CFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
-CXXFLAGS=`echo $CXXFLAGS $EXTRA_CFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
+CFLAGS=`echo $EXTRA_CFLAGS $CFLAGS $CXXWARNINGS | sed 's/ \\+/ /g'`
+CXXFLAGS=`echo $EXTRA_CFLAGS $CXXFLAGS $CXXWARNINGS | sed 's/ \+/ /g'`
LIBS=`echo $LIBS | sed 's/ \+/ /g'`
LDFLAGS="$LDFLAGS $PROFILE"