;;
*-*-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
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 )
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 ---------------------------------------------------------------------------
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
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 ---------------------------------------------------------------------------
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 ---------------------------------------------------------------------------
case ${INSTALL} in
/* ) # Absolute
;;
- *)
+ *)
INSTALL=`pwd`/${INSTALL} ;;
esac
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
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
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
;;
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
- 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"
+ 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
+
+ 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 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}"
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
;;
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*)
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"
if test "$wxUSE_UNICODE" = "yes" ; then
AC_DEFINE(wxUSE_UNICODE)
-
+
if test "$wxUSE_MSW" != 1; then
wxUSE_UNICODE_MSLU=no
fi
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
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
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
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"
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)