2. first Motif fixes
3. --enable-debug option in configure
4. default toolkit detection actually works - and --with-gtk/motif too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2650
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX exec prefix where GTK is installed],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
AC_ARG_WITH(gtk, [ --with-gtk use GTK+],
AC_ARG_WITH(gtk-exec-prefix, [ --with-gtk-exec-prefix=PFX exec prefix where GTK is installed],
gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
AC_ARG_WITH(gtk, [ --with-gtk use GTK+],
- wxUSE_GTK="$withval",wxUSE_GTK=$DEFAULT_wxUSE_GTK)
+ [wxUSE_GTK="$withval" TOOLKIT_GIVEN=1])
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif],
AC_ARG_WITH(motif, [ --with-motif use Motif/Lesstif],
- wxUSE_MOTIF="$withval",wxUSE_MOTIF=$DEFAULT_wxUSE_MOTIF)
+ [wxUSE_MOTIF="$withval" TOOLKIT_GIVEN=1])
AC_ARG_WITH(cygwin, [ --with-cygwin use Cygwin for MS-Windows],
AC_ARG_WITH(cygwin, [ --with-cygwin use Cygwin for MS-Windows],
- wxUSE_CYGWIN="$withval",wxUSE_CYGWIN=$DEFAULT_wxUSE_CYGWIN)
+ [wxUSE_CYGWIN="$withval" TOOLKIT_GIVEN=1])
AC_ARG_WITH(mingw, [ --with-mingw use GCC Minimal MS-Windows],
AC_ARG_WITH(mingw, [ --with-mingw use GCC Minimal MS-Windows],
- wxUSE_MINGW="$withval",wxUSE_MINGW=$DEFAULT_wxUSE_MINGW)
+ [wxUSE_MINGW="$withval" TOOLKIT_GIVEN=1])
AC_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)],
wxUSE_DMALLOC="$withval",wxUSE_DMALLOC=$DEFAULT_wxUSE_DMALLOC)
AC_ARG_WITH(dmalloc, [ --with-dmalloc use dmalloc library (www.letters.com/dmalloc)],
wxUSE_DMALLOC="$withval",wxUSE_DMALLOC=$DEFAULT_wxUSE_DMALLOC)
wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE)
AC_ARG_ENABLE(optimize, [ --enable-optimize create optimized code],
wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE)
wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE)
AC_ARG_ENABLE(optimize, [ --enable-optimize create optimized code],
wxUSE_OPTIMISE="$enableval",wxUSE_OPTIMISE=$DEFAULT_wxUSE_OPTIMISE)
+AC_ARG_ENABLE(debug, [ --enable-debug same as debug_flag and debug_info],
+ wxUSE_DEBUG="${enableval}",wxUSE_DEBUG=$DEFAULT_wxUSE_DEBUG)
+
+if test "$wxUSE_DEBUG" = "yes"; then
+ DEFAULT_wxUSE_DEBUG_FLAG=yes
+ DEFAULT_wxUSE_DEBUG_INFO=yes
+elif test "$wxUSE_DEBUG" = "no"; then
+ DEFAULT_wxUSE_DEBUG_FLAG=no
+ DEFAULT_wxUSE_DEBUG_INFO=no
+fi
+
AC_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)],
wxUSE_DEBUG_FLAG="$enableval",wxUSE_DEBUG_FLAG=$DEFAULT_wxUSE_DEBUG_FLAG)
AC_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information],
AC_ARG_ENABLE(debug_flag, [ --enable-debug_flag set __WXDEBUG__ flag (recommended for developers!)],
wxUSE_DEBUG_FLAG="$enableval",wxUSE_DEBUG_FLAG=$DEFAULT_wxUSE_DEBUG_FLAG)
AC_ARG_ENABLE(debug_info, [ --enable-debug_info create code with debugging information],
dnl check that no more than one toolkit is given and that if none are given that
dnl we have a default one
dnl check that no more than one toolkit is given and that if none are given that
dnl we have a default one
-dnl convert "yes" to 1 and "no" to 0
-wxUSE_GTK=`echo $wxUSE_GTK | sed -e 's/yes/1/' -e 's/no/0/'`
-wxUSE_MOTIF=`echo $wxUSE_MOTIF | sed -e 's/yes/1/' -e 's/no/0/'`
-wxUSE_MSW=`echo $wxUSE_MSW | sed -e 's/yes/1/' -e 's/no/0/'`
+if test "$TOOLKIT_GIVEN" = 1; then
+ dnl convert "yes" to 1 and "no" to 0
+ wxUSE_GTK=`echo $wxUSE_GTK | sed -e 's/yes/1/' -e 's/no/0/'`
+ wxUSE_MOTIF=`echo $wxUSE_MOTIF | sed -e 's/yes/1/' -e 's/no/0/'`
+ wxUSE_MSW=`echo $wxUSE_MSW | sed -e 's/yes/1/' -e 's/no/0/'`
+else
+ dnl try to guess the most apropriate toolkit for this platform
+ wxUSE_GTK=$DEFAULT_wxUSE_GTK
+ wxUSE_MOTIF=$DEFAULT_wxUSE_MOTIF
+ wxUSE_MSW=$DEFAULT_wxUSE_MSW
+fi
dnl NB: this supposes that the shell is able to handle arithmetic expansion and
dnl the ${VAR:-VALUE} construction. It does simplify our life though...
dnl NB: this supposes that the shell is able to handle arithmetic expansion and
dnl the ${VAR:-VALUE} construction. It does simplify our life though...
AC_MSG_WARN(library will be compiled without support for images in XPM format)
fi
AC_MSG_WARN(library will be compiled without support for images in XPM format)
fi
- GUI_TK_LINK="-lXm $(XPM_LINK)-lXmu -lXt -lX11 -lm"
+ GUI_TK_LINK="-lXm $XPM_LINK -lXmu -lXt -lX11 -lm"
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
TOOLKIT=MOTIF
fi
GUI_TK_LIBRARY="$CHECK_LIB $GUI_TK_LINK"
TOOLKIT=MOTIF
fi
dnl the symbol which allows conditional compilation for the given toolkit
TOOLKIT_DEF=-D__WX${TOOLKIT}__
dnl the symbol which allows conditional compilation for the given toolkit
TOOLKIT_DEF=-D__WX${TOOLKIT}__
-dnl the name (without leading 'wx_') of the library
-WX_LIBRARY=${TOOLKIT_DIR}2
+dnl the name of the (libtool) library
+WX_LIBRARY_NAME="libwx_${TOOLKIT_DIR}2.la"
dnl ------------------------------------------------------------------------
dnl Check for headers
dnl ------------------------------------------------------------------------
dnl Check for headers
dnl all the libraries needed to link wxWindows programs (when the library is not
dnl yet installed)
dnl all the libraries needed to link wxWindows programs (when the library is not
dnl yet installed)
-LIBS="\${top_builddir}/src/libwx_${WX_LIBRARY}.la $EXTRA_LIBS"
+LIBS="\${top_builddir}/src/${WX_LIBRARY_NAME} $EXTRA_LIBS"
dnl all -I options we must pass to the compiler
INCLUDES="$TOOLKIT_INCLUDE $ZLIB_INCLUDE $LIBPNG_INCLUDE -I. -I\${top_builddir}/include -I\${top_srcdir}/include"
dnl all -I options we must pass to the compiler
INCLUDES="$TOOLKIT_INCLUDE $ZLIB_INCLUDE $LIBPNG_INCLUDE -I. -I\${top_builddir}/include -I\${top_srcdir}/include"
forty fractal image wxpoem"
fi
forty fractal image wxpoem"
fi
+dnl for convenience, sort the files to build in alphabetical order
+dnl
+dnl another shell command to do it which might be faster but is less clear:
+dnl LTLIBOBJS="`for obj in $LTLIBOBJS; do echo $obj; done | sort | sed 's@^@ @'`"
+LTLIBOBJS="`echo $LTLIBOBJS | tr -s ' ' | tr ' ' '\n' | sort | tr '\n' ' '`"
+
+dnl for convenience, sort the samples in alphabetical order
+dnl
+dnl FIXME For some mysterious reasons, sometimes the directories are duplicated
+dnl in this list - hence uniq. But normally, this shouldn't be needed!
+SAMPLES_SUBDIRS="`echo $SAMPLES_SUBDIRS | tr -s ' ' | tr ' ' '\n' | sort | uniq | tr '\n' ' '`"
+
dnl global options
AC_SUBST(WX_MAJOR_VERSION_NUMBER)
AC_SUBST(WX_MINOR_VERSION_NUMBER)
AC_SUBST(WX_RELEASE_NUMBER)
dnl global options
AC_SUBST(WX_MAJOR_VERSION_NUMBER)
AC_SUBST(WX_MINOR_VERSION_NUMBER)
AC_SUBST(WX_RELEASE_NUMBER)
+AC_SUBST(WX_LIBRARY_NAME)
dnl suppress libtool's informational messages - they duplicate its command line
LIBTOOL="$LIBTOOL --silent"
dnl suppress libtool's informational messages - they duplicate its command line
LIBTOOL="$LIBTOOL --silent"
DEFS = $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
LIBS = $(GUILIBS)
DEFS = $(TOOLKIT_DEF) $(WXDEBUG_DEFINE)
LIBS = $(GUILIBS)
-VPATH = .:${srcdir}:$(srcdir)/common:$(srcdir)/@TOOLKIT_DIR@:$(srcdir)/generic:$(EXTRA_VPATH)
+VPATH = .:${srcdir}:${srcdir}/common:${srcdir}/@TOOLKIT_DIR@:${srcdir}/generic:${EXTRA_VPATH}
-lib_LTLIBRARIES = libwx_@WX_LIBRARY@.la
+EXTRA_DIST = "${srcdir}/common ${srcdir}/generic ${srcdir}/@TOOLKIT_DIR@"
+
+lib_LTLIBRARIES = @WX_LIBRARY_NAME@
+EXTRA_LTLIBRARIES = libwx_gtk2.la libwx_motif2.la
# these are the common files which always make part of the library
# these are the common files which always make part of the library
-libwx__WX_LIBRARY__la_SOURCES = \
+libwx_gtk2_la_SOURCES = \
cmndata.cpp \
dynarray.cpp \
filefn.cpp \
cmndata.cpp \
dynarray.cpp \
filefn.cpp \
#
# NB: the files are listed in directory/alphabetical order: first the files
# from common, then from generic, then from unix, then from gtk.
#
# NB: the files are listed in directory/alphabetical order: first the files
# from common, then from generic, then from unix, then from gtk.
-EXTRA_libwx__WX_LIBRARY__la_SOURCES = \
+EXTRA_libwx_gtk2_la_SOURCES = \
config.cpp \
date.cpp \
datetime.cpp \
config.cpp \
date.cpp \
datetime.cpp \
-libwx__WX_LIBRARY__la_LDFLAGS = -release @WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
-libwx__WX_LIBRARY__la_LIBADD = $(LTLIBOBJS)
-libwx__WX_LIBRARY__la_DEPENDENCIES = $(libwx__WX_LIBRARY__la_LIBADD) lexer.l
+libwx_gtk2_la_LDFLAGS = -rpath @libdir@ -release @WX_MINOR_VERSION_NUMBER@.@WX_RELEASE_NUMBER@
+libwx_gtk2_la_LIBADD = $(LTLIBOBJS)
+libwx_gtk2_la_DEPENDENCIES = $(libwx_gtk2_la_LIBADD) lexer.l
+
+libwx_motif2_la_SOURCES = ${libwx_gtk2_la_SOURCES}
+EXTRA_libwx_motif2_la_SOURCES = ${EXTRA_libwx_gtk2_la_SOURCES}
+libwx_motif2_la_LDFLAGS = -rpath @libdir@ ${libwx_gtk2_la_LDFLAGS}
+libwx_motif2_la_LIBADD = ${libwx_gtk2_la_LIBADD}
+libwx_motif2_la_DEPENDENCIES = ${libwx_gtk2_la_DEPENDENCIES}