dnl OS (assume Unix)
USE_UNIX=1
+USE_OS2=0
USE_WIN32=0
USE_DOS=0
USE_BEOS=0
PROGRAM_EXT=
SO_SUFFIX=so
SAMPLES_RPATH_FLAG=
+SAMPLES_RPATH_POSTLINK=
dnl to support a new system, you need to add its canonical name (as determined
dnl by config.sub or specified by the configure command line) to this "case"
*-pc-os2_emx | *-pc-os2-emx )
AC_DEFINE(__EMX__)
+ USE_OS2=1
PROGRAM_EXT=".exe"
DEFAULT_DEFAULT_wxUSE_PM=1
+ dnl "c++" wrapper is not always available, so always use plain gcc.
+ CXX=gcc
+ LDFLAGS="$LDFLAGS -Zcrtdll -Zsysv-signals"
+ dnl
+ dnl Some special code that's automatically added by autoconf-2.57 for OS/2
+ dnl and hopefully also by autoconf-2.58 and newer on all other platforms.
+ dnl For now however, we still need it to make sure the configure script
+ dnl works on OS/2 no matter what platform it is generated on.
+ ac_executable_extensions=".exe"
+ export ac_executable_extensions
+ dnl This strange code is necessary to deal with handling of
+ dnl backslashes by ksh and pdksh's sh variant.
+ ac_save_IFS="$IFS"
+ IFS="\\"
+ ac_TEMP_PATH=
+ for ac_dir in $PATH; do
+ IFS=$ac_save_IFS
+ if test -z "$ac_TEMP_PATH"; then
+ ac_TEMP_PATH="$ac_dir"
+ else
+ ac_TEMP_PATH="$ac_TEMP_PATH/$ac_dir"
+ fi
+ done
+ export PATH="$ac_TEMP_PATH"
+ unset ac_TEMP_PATH
;;
powerpc-*-darwin* )
DEFAULT_wxUSE_GAUGE=no
DEFAULT_wxUSE_GRID=no
DEFAULT_wxUSE_IMAGLIST=no
+ DEFAULT_wxUSE_LISTBOOK=no
DEFAULT_wxUSE_LISTBOX=no
DEFAULT_wxUSE_LISTCTRL=no
DEFAULT_wxUSE_NOTEBOOK=no
DEFAULT_wxUSE_GAUGE=yes
DEFAULT_wxUSE_GRID=yes
DEFAULT_wxUSE_IMAGLIST=yes
+ DEFAULT_wxUSE_LISTBOOK=yes
DEFAULT_wxUSE_LISTBOX=yes
DEFAULT_wxUSE_LISTCTRL=yes
DEFAULT_wxUSE_NOTEBOOK=yes
WX_ARG_ENABLE(permissive, [ --enable-permissive compile code disregarding strict ANSI], wxUSE_PERMISSIVE)
WX_ARG_ENABLE(no_deps, [ --enable-no_deps create code without dependency information], wxUSE_NO_DEPS)
-WX_ARG_ENABLE(compat20, [ --enable-compat20 enable wxWindows 2.0 compatibility], WXWIN_COMPATIBILITY_2)
WX_ARG_ENABLE(compat22, [ --enable-compat22 enable wxWindows 2.2 compatibility], WXWIN_COMPATIBILITY_2_2)
WX_ARG_ENABLE(compat24, [ --disable-compat24 disable wxWindows 2.4 compatibility], WXWIN_COMPATIBILITY_2_4, disable)
DEFAULT_wxUSE_GAUGE=yes
DEFAULT_wxUSE_GRID=yes
DEFAULT_wxUSE_IMAGLIST=yes
+ DEFAULT_wxUSE_LISTBOOK=yes
DEFAULT_wxUSE_LISTBOX=yes
DEFAULT_wxUSE_LISTCTRL=yes
DEFAULT_wxUSE_NOTEBOOK=yes
DEFAULT_wxUSE_GAUGE=no
DEFAULT_wxUSE_GRID=no
DEFAULT_wxUSE_IMAGLIST=no
+ DEFAULT_wxUSE_LISTBOOK=no
DEFAULT_wxUSE_LISTBOX=no
DEFAULT_wxUSE_LISTCTRL=no
DEFAULT_wxUSE_NOTEBOOK=no
WX_ARG_ENABLE(gauge, [ --enable-gauge use wxGauge class], wxUSE_GAUGE)
WX_ARG_ENABLE(grid, [ --enable-grid use wxGrid class], wxUSE_GRID)
WX_ARG_ENABLE(imaglist, [ --enable-imaglist use wxImageList class], wxUSE_IMAGLIST)
+WX_ARG_ENABLE(listbook, [ --enable-listbook use wxListbook class], wxUSE_LISTBOOK)
WX_ARG_ENABLE(listbox, [ --enable-listbox use wxListBox class], wxUSE_LISTBOX)
WX_ARG_ENABLE(listctrl, [ --enable-listctrl use wxListCtrl class], wxUSE_LISTCTRL)
WX_ARG_ENABLE(notebook, [ --enable-notebook use wxNotebook class], wxUSE_NOTEBOOK)
dnl General settings (needed for GUI and non-GUI compilations alike).
dnl Path separator; ':' for unix, ';' for OS/2
-dnl Stem for flex output; lexyy for OS/2, lex.yy otherwise
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
PATH_IFS=';'
-dnl Really ought to text for this as meanwhile there are flex versions using
-dnl lex.yy as well due to FAT support being more and more dropped...
- LEX_STEM="lexyy"
;;
*)
PATH_IFS=':'
- LEX_STEM="lex.yy"
;;
esac
dnl ar command
dnl defines AR with the appropriate command
-AC_CHECK_PROG(AR, ar, ar, ar)
+AC_CHECK_PROG(AR, ar, ar)
+if test "x$AR" = "x" ; then
+ AC_MSG_ERROR([ar is needed to build wxWindows])
+fi
dnl install checks
dnl defines INSTALL with the appropriate command
fi dnl make without VPATH
fi dnl not GNU make
-dnl YACC checks
-dnl defines YACC with the appropriate command
-AC_PROG_YACC
-
-dnl LEX checks
-dnl defines LEX with the appropriate command
-dnl defines LEXLIB with the appropriate library
-AC_PROG_LEX
-
dnl needed for making link to setup.h
AC_PROG_LN_S
dnl ---------------------------------------------------------------------------
dnl When we are using gcc on OS/2, we want to be either using resources (PM)
dnl or a more complete POSIX emulation for Motif/GTK+/X11
+dnl Moreover we need to link explicitly against either stdcpp.a or stdcxx.a
+dnl (depending on compiler version), since we are using "gcc", not "g++/c++".
dnl ---------------------------------------------------------------------------
dnl (OS/2-only piece)
case "${host}" in
*-pc-os2_emx | *-pc-os2-emx )
- dnl Explicitly link -lstdcpp, since we are using "gcc" not "g++"/"c++".
- LIBS="$LIBS -lstdcpp"
if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
dnl More complete Unix emulation for unix-like ports
dnl by linking in POSIX/2's cExt (if available).
dnl Include resources for the "native" port (wxPM).
RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res"
fi
+ AC_CACHE_CHECK([for gcc 3 or later], wx_cv_gcc3,[
+ AC_TRY_COMPILE([#include <features.h>],
+ [
+ #if (__GNUC__ < 3)
+ #error old gcc
+ #endif
+ ],
+ [
+ wx_cv_gcc3=yes
+ ],
+ [
+ wx_cv_gcc3=no
+ ]
+ )
+ ])
+ if test "$wx_cv_gcc3" = "no"; then
+ LIBS="$LIBS -lstdcpp"
+ else
+ LIBS="$LIBS -lstdcxx"
+ fi
;;
esac
dnl (end of OS/2-only piece)
esac
if test "$wxUSE_GUI" = "yes"; then
- if test "$wxUSE_UNIX" = "yes"; then
+ if test "$wxUSE_UNIX" = "yes" -a "$wxUSE_PM" != 1; then
dnl defines HAVE_X11_XKBLIB_H
- AC_CHECK_HEADERS(X11/XKBlib.h)
+ AC_CHECK_HEADERS(X11/Xlib.h)
+ AC_CHECK_HEADERS([X11/XKBlib.h], [], [],
+ [
+ #if HAVE_X11_XLIB_H
+ #include <X11/Xlib.h>
+ #endif
+ ])
fi
fi
TIFF_PREREQ_LINKS="$TIFF_PREREQ_LINKS $ZLIB_LINK"
fi
AC_CHECK_HEADER(tiffio.h,
- AC_CHECK_LIB(tiff, TIFFError,
- TIFF_LINK=" -ltiff",
- ,
- $TIFF_PREREQ_LINKS)
+ [
+ AC_CHECK_LIB(tiff, TIFFError,
+ TIFF_LINK=" -ltiff",
+ ,
+ $TIFF_PREREQ_LINKS)
+ ]
)
if test "x$TIFF_LINK" = "x" ; then
dnl ------------------------------------------------------------------------
if test "$wxUSE_EXPAT" != "no"; then
- wxUSE_XML=1
+ wxUSE_XML=yes
AC_DEFINE(wxUSE_EXPAT)
AC_DEFINE(wxUSE_XML)
if test "$wxUSE_MSW" = 1 ; then
TOOLKIT=MSW
GUIDIST=MSW_DIST
+
+ dnl -mwindows causes a heap of other default gui libs to be linked in.
+ dnl FIXME: If cygwin needs this, please push it above, if not, please
+ dnl remove this comment :-)
+ case "${host}" in
+ *-*-mingw32* )
+ WXCONFIG_LDFLAGS_GUI="$LDFLAGS -Wl,--subsystem,windows -mwindows"
+ esac
fi
if test "$wxUSE_GTK" = 1; then
if test "$wxUSE_PM" = 1; then
TOOLKIT=PM
GUIDIST=GTK_DIST
- AC_MSG_WARN([OS/2 threads are not yet supported... disabled])
- wxUSE_THREADS="no"
fi
dnl the name of the directory where the files for this toolkit live
fi
if test "$wxUSE_ODBC" != "no" ; then
AC_DEFINE(wxUSE_ODBC)
+ if test "$wxUSE_ODBC" = "builtin" ; then
+ AC_DEFINE(wxUSE_BUILTIN_IODBC)
+ fi
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS db"
dnl is this still necessary in 2.5?
USE_OPENGL=1
AC_DEFINE(wxUSE_OPENGL)
AC_DEFINE(wxUSE_GLCANVAS)
- SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl"
+ SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS opengl opengl/cube opengl/penguin opengl/isosurf"
fi
fi
case "${host}" in
*-*-linux* | *-*-gnu* )
SAMPLES_RPATH_FLAG="-Wl,-rpath,\$(top_builddir)lib"
- ;;
+ ;;
*-*-solaris2* )
if test "$GCC" = yes ; then
SAMPLES_RPATH_FLAG="-R\$(top_builddir)lib"
fi
;;
+
+ powerpc-*-darwin* )
+ SAMPLES_RPATH_POSTLINK="\$(top_builddir)change-install-names \$(LIBDIRNAME) \$(prefix) \$@"
+ cat <<EOF >change-install-names
+#!/bin/sh
+libnames=\`cd \${1} ; ls -1 | grep '\.[[0-9]][[0-9]]*\.dylib\$'\`
+inst_cmd="install_name_tool "
+for i in \${libnames} ; do
+ inst_cmd="\${inst_cmd} -change \${2}/lib/\${i} \${1}/\${i}"
+done
+\${inst_cmd} \${3}
+EOF
+ chmod +x change-install-names
+ ;;
+
esac
dnl set target to shared if not explicitly chose static before
[
AC_CHECK_LIB(nsl, inet_addr,
INET_LINK="nsl",
- AC_CHECK_LIB(resolv, inet_addr,
- INET_LINK="resolv",
- AC_CHECK_LIB(socket, inet_addr,
- INET_LINK="socket"
+ [
+ AC_CHECK_LIB(resolv, inet_addr,
+ INET_LINK="resolv",
+ [
+ AC_CHECK_LIB(socket, inet_addr,
+ INET_LINK="socket"
+ )
+ ]
)
- )
+ ]
)
]
)
AC_CACHE_SAVE
dnl ---------------------------------------------------------------------------
-dnl thread support for Unix (for Win32 see past the next matching "else")
+dnl thread support for Unix (for Win32 and OS/2 see past
+dnl the next matching "else")
dnl ---------------------------------------------------------------------------
dnl under MSW (except mingw32) we always have thread support
CPP_MT_FLAG=
-if test "$TOOLKIT" != "MSW"; then
+if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
dnl the code below:
dnl
CFLAGS="$CFLAGS_OLD"
fi
;;
+ *-pc-os2*emx )
+ CFLAGS="$CFLAGS -Zmt -D__ST_MT_ERRNO__"
+ CXXFLAGS="$CXXFLAGS -Zmt -D__ST_MT_ERRNO__"
+ LDFLAGS="$LDFLAGS -Zmt"
+ ;;
esac
fi
fi
dnl compatibility level
dnl ---------------------------------------------------------------------------
-if test "$WXWIN_COMPATIBILITY_2" = "yes"; then
- AC_DEFINE(WXWIN_COMPATIBILITY_2)
-
- WXWIN_COMPATIBILITY_2_2="yes"
-fi
-
if test "x$WXWIN_COMPATIBILITY_2_2" = "xyes"; then
AC_DEFINE(WXWIN_COMPATIBILITY_2_2)
if test "$TOOLKIT" != "MSW"; then
dnl under Solaris and OS/2, socket functions live in -lsocket
AC_CHECK_FUNC(socket,,
- AC_CHECK_LIB(socket, socket,
- if test "$INET_LINK" != " -lsocket"; then
- INET_LINK="$INET_LINK -lsocket"
- fi,
- [
- AC_MSG_WARN([socket library not found - sockets will be disabled])
- wxUSE_SOCKETS=no
- ]
- )
+ [
+ AC_CHECK_LIB(socket, socket,
+ if test "$INET_LINK" != " -lsocket"; then
+ INET_LINK="$INET_LINK -lsocket"
+ fi,
+ [
+ AC_MSG_WARN([socket library not found - sockets will be disabled])
+ wxUSE_SOCKETS=no
+ ]
+ )
+ ]
)
fi
fi
dnl ------------------------------------------------------------------------
dnl under MSW we always have LoadLibrary/GetProcAddress
-if test "$TOOLKIT" != "MSW"; then
+if test "$TOOLKIT" != "MSW" -a "$USE_OS2" != 1; then
HAVE_DL_FUNCS=0
HAVE_SHL_FUNCS=0
dnl check also for dlerror()
if test "$HAVE_DL_FUNCS" = 1; then
AC_CHECK_FUNCS(dlerror,
- AC_DEFINE(HAVE_DLERROR),
- AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR)))
+ AC_DEFINE(HAVE_DLERROR),
+ [
+ AC_CHECK_LIB(dl, dlerror, AC_DEFINE(HAVE_DLERROR))
+ ]
+ )
fi
fi
if test "$wxUSE_UNICODE" = "yes" ; then
AC_DEFINE(wxUSE_UNICODE)
- if test "$wxUSE_MSW" != 1; then
+ if test "$USE_WIN32" != 1; then
wxUSE_UNICODE_MSLU=no
fi
- if test "$wxUSE_MSW" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
+ if test "$USE_WIN32" = 1 -a "$wxUSE_UNICODE_MSLU" = "yes"; then
AC_CHECK_LIB(unicows,main,
[
AC_DEFINE(wxUSE_UNICODE_MSLU)
AC_DEFINE(wxUSE_IMAGLIST)
fi
+if test "$wxUSE_LISTBOOK" = "yes"; then
+ AC_DEFINE(wxUSE_LISTBOOK)
+ USES_CONTROLS=1
+fi
+
if test "$wxUSE_LISTBOX" = "yes"; then
AC_DEFINE(wxUSE_LISTBOX)
USES_CONTROLS=1
dnl ipc, mfc, nativdlg, oleauto, ownerdrw
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS artprov controls dialogs \
drawing dynamic erase event exec font image \
- minimal propsize rotate shaped widgets"
+ minimal propsize rotate shaped widgets render"
if test "$wxUSE_MONOLITHIC" != "yes"; then
SAMPLES_SUBDIRS="$SAMPLES_SUBDIRS console"
AC_SUBST(TOOLKIT_LOWERCASE)
AC_SUBST(TOOLKIT_VERSION)
AC_SUBST(SAMPLES_RPATH_FLAG)
+AC_SUBST(SAMPLES_RPATH_POSTLINK)
AC_SUBST(HOST_SUFFIX)
AC_BAKEFILE
+dnl Find out if we have to define NO_GCC_PRAGMA and WX_PRECOMP:
+if test $GCC_PCH = 1 ; then
+ CPPFLAGS="-DWX_PRECOMP -DNO_GCC_PRAGMA $CPPFLAGS"
+else
+ case "${host}" in
+ powerpc-*-darwin* )
+ dnl Some Apple's GCC version are broken and can't handle the
+ dnl pragmas:
+ CPPFLAGS="-DNO_GCC_PRAGMA $CPPFLAGS"
+ ;;
+ esac
+fi
+dnl We have to output NO_GCC_PRAGMA with wx-config on Apple, too:
+case "${host}" in
+ powerpc-*-darwin* )
+ dnl Some Apple's GCC version are broken and can't handle the
+ dnl pragmas:
+ CODE_GEN_FLAGS_CXX="-DNO_GCC_PRAGMA $CODE_GEN_FLAGS_CXX"
+ ;;
+esac
+
dnl for convenience, sort the samples in alphabetical order
dnl
SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '| tr -d '\r'`"
dnl makefile variables
-AC_SUBST(LEX_STEM)
AC_SUBST(PATH_IFS)
dnl global options
AC_SUBST(WXCONFIG_LIBS_STATIC_GL)
AC_SUBST(WXCONFIG_INCLUDE)
AC_SUBST(WXCONFIG_RPATH)
+AC_SUBST(WXCONFIG_LDFLAGS_GUI)
AC_SUBST(WX_LARGEFILE_FLAGS)
AC_SUBST(CODE_GEN_FLAGS)
AC_SUBST(CODE_GEN_FLAGS_CXX)
if test ${subdir} = "samples"; then
dnl only take those samples which compile in the current
dnl configuration and which exist
+ makefiles="samples/Makefile.in $makefiles"
for sample in `echo $SAMPLES_SUBDIRS`; do
if test -d $srcdir/samples/$sample; then
makefiles="samples/$sample/Makefile.in $makefiles"
dnl don't take all samples/utils, just those which build with
dnl wxBase
if test ${subdir} = "samples"; then
- makefiles="samples/console/Makefile.in"
+ makefiles="samples/Makefile.in samples/console/Makefile.in"
else dnl utils
makefiles="utils/HelpGen/Makefile.in \
utils/HelpGen/src/Makefile.in \
echo " Should wxWindows be compiled in Unicode mode? ${wxUSE_UNICODE:-no}"
echo " What level of wxWindows compatibility should be enabled?"
-echo " wxWindows 2.0 ${WXWIN_COMPATIBILITY_2:-no}"
echo " wxWindows 2.2 ${WXWIN_COMPATIBILITY_2_2:-no}"
echo " wxWindows 2.4 ${WXWIN_COMPATIBILITY_2_4:-yes}"