# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ(2.59) AC_INIT([wxMaxima], [0.7.3a], [andrejv@users.sourceforge.net]) AC_CONFIG_SRCDIR([src/wxMaxima.h]) AM_CONFIG_HEADER(src/Setup.h) AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_CANONICAL_TARGET dnl Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_INSTALL AC_PROG_MAKE_SET AM_INIT_AUTOMAKE([wxMaxima], [0.7.3a]) dnl check for host case "$host" in *mingw*) win32=true ;; *cygwin*) win32=true ;; *) win32=false esac dnl optional support for glyphs drawing, printing and drag'n'drop AC_ARG_ENABLE(unicode-glyphs, [ --enable-unicode-glyphs Enable support for drawing with unicode fonts.], [case "${enableval}" in yes) wxm_unicode_glyphs=true ;; no) wxm_unicode_glyphs=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-unicode-glyphs) ;; esac], [wxm_unicode_glyphs=false]) if test x"${wxm_unicode_glyphs}" = x"true" ; then AC_DEFINE([WXM_UNICODE_GLYPHS], [1], ["Add support for drawing with unicode glyphs"]) else AC_DEFINE([WXM_UNICODE_GLYPHS], [0], ["Add support for drawing with unicode glyphs"]) fi AC_ARG_ENABLE(printing, [ --enable-printing Enable printing support.], [case "${enableval}" in yes) wxm_print=true ;; no) wxm_print=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-printing) ;; esac], [wxm_print=true]) if test x"${wxm_print}" = x"true" ; then AC_DEFINE([WXM_PRINT], [1], ["Add printing support"]) else AC_DEFINE([WXM_PRINT], [0], ["Add printing support"]) fi AC_ARG_ENABLE(dnd, [ --enable-dnd Enable drag'n'drop support.], [case "${enableval}" in yes) wxm_dnd=true ;; no) wxm_dnd=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-dnd) ;; esac], [wxm_dnd=false]) if test x"${wxm_dnd}" = x"true" ; then AC_DEFINE([WXM_DND], [1], ["Add support for drag'n'drop"]) else AC_DEFINE([WXM_DND], [0], ["Add support for drag'n'drop"]) fi dnl check for wxWidgets AM_OPTIONS_WXCONFIG AC_ARG_ENABLE(static-wx, [ --enable-static-wx Compile with static wx libraries.], [case "${enableval}" in yes) static_wx=true ;; no) static_wx=false ;; *) AC_MSG_ERROR(bad value ${enableval} for --enable-static-wx) ;; esac], [static_wx=false]) AM_PATH_WXCONFIG(2.6.0, wxWin=1) if test "$wxWin" != 1; then AC_MSG_ERROR([ wxWidgets must be installed on your system. Please check that wx-config is in path, the directory where wxWidgets libraries are installed (returned by 'wx-config --libs' or 'wx-config --static --libs' command) is in LD_LIBRARY_PATH or equivalent variable and wxWidgets version is 2.6.0 or above. ]) else if test x"${static_wx}" = x"true" ; then WX_LIBS="$WX_LIBS_STATIC" fi dnl Quick hack until wx-config does it ac_save_LIBS=$LIBS ac_save_CXXFLAGS=$CXXFLAGS LIBS=$WX_LIBS CXXFLAGS=$WX_CXXFLAGS AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_MSG_CHECKING([if we can compile a wxWidgets program]) AC_TRY_LINK([#include ], [wxString test=wxT("")], [AC_MSG_RESULT([yes])], [echo "" echo "" echo "*** The test program failed to compile or link. See the file config.log for the" echo "*** exact error that occured. This usually means that wxWidgets library was" echo "*** incorrectly installed." echo "" AC_MSG_ERROR([Failed to compile a test program])]) AC_LANG_RESTORE LIBS=$ac_save_LIBS CXXFLAGS=$ac_save_CXXFLAGS CPPFLAGS=$WX_CXXFLAGS fi dnl dnl we have to setup rc compiling under Windows dnl if test x"${win32}" = x"true" ; then RC_OBJ="Resources.o" wx_prefix=`$WX_CONFIG_NAME --prefix` WX_RC_PATH="${wx_prefix}/include" else RC_OBJ="" WX_RC_PATH="" fi CXXFLAGS="$CXXFLAGS" dnl dnl check for xml2 dnl AM_PATH_XML2(2.5.0, xml2=1) if test "$xml2" != 1; then AC_MSG_ERROR([ xml2 must be installed on your system but xml2-config script couldn't be found. Please check that xml2-config is in path, the directory where xml2 libraries are installed (returned by 'xml2-config --libs' command) is in LD_LIBRARY_PATH or equivalent variable and xml2 version is 2.5.0 or above. ]) fi CPPFLAGS="$CPPFLAGS $XML_CPPFLAGS" WX_LIBS="$WX_LIBS $XML_LIBS" dnl dnl translations dnl CATALOGS_TO_INSTALL="install-wxmaxima-catalogs" if test x"${static_wx}" = x"true" ; then CATALOGS_TO_INSTALL="$CATALOGS_TO_INSTALL install-wxstd-catalogs" fi AC_SUBST(CATALOGS_TO_INSTALL) AC_SUBST(WX_LIBS) AC_SUBST(WX_RC_PATH) AC_SUBST(RC_OBJ) # Checks for libraries. # Checks for header files. # Checks for typedefs, structures, and compiler characteristics. # Checks for library functions. AC_CONFIG_FILES([ Makefile src/Makefile locales/Makefile data/Makefile ]) AC_OUTPUT(wxmaxima.spec data/Info.plist)