Commit e3abdb69 authored by coppro's avatar coppro

(sorry for making this all one commit)

Fiddled with the backbone for scripts some more.
VCS are now suppported in sets but configuration/non-svn-systems missing
Linux build now uses precompiled headers (build time--)
A couple warning fixes too.
parent a5ee2b69
rm Makefile.am; rm Makefile.am;
echo " echo '
#+----------------------------------------------------------------------------+ #+----------------------------------------------------------------------------+
#| Description: Magic Set Editor - Program to make Magic (tm) cards | #| Description: Magic Set Editor - Program to make Magic (tm) cards |
#| Copyright: (C) 2001 - 2008 Twan van Laarhoven and \"coppro\" | #| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
#| License: GNU General Public License 2 or later (see file COPYING) | #| License: GNU General Public License 2 or later (see file COPYING) |
#+----------------------------------------------------------------------------+ #+----------------------------------------------------------------------------+
...@@ -12,13 +12,30 @@ echo " ...@@ -12,13 +12,30 @@ echo "
AUTOMAKE_OPTIONS = subdir-objects AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = magicseteditor bin_PROGRAMS = magicseteditor
AM_CXXFLAGS = @WX_CXXFLAGS@ \$(BOOST_CXXFLAGS) -DUNICODE -I . -Wall AM_CXXFLAGS = @WX_CXXFLAGS@ $(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
AM_LDFLAGS = @WX_LIBS@ \$(BOOST_LDFLAGS) AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS)
magicseteditor_LDADD = \$(BOOST_REGEX_LIB) .hpp.gch:
target=`echo $@ | sed "s|.gch$$|.hpp|"`;\
depbase=`echo $$target | sed "s|[^/]*\$$|$(DEPDIR)/&|;s|\\.hpp\$$||"`;\
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpch -c $$target &&\
$(am__mv) $$depbase.Tpch $$depbase.Pch
touch $@
.gch.o:
gcc -x c - -c -o $@ <<<""
magicseteditor_SOURCES = magicseteditor_LDADD = $(BOOST_REGEX_LIB)
magicseteditor_CXXFLAGS = -fpch-deps $(AM_CXXFLAGS)
magicseteditor_SOURCES =
# The script used to generate is MakeAM.sh " > Makefile.am; if GLIBCPP_BUILD_PCH
clean-local:
rm -f ./src/util/prec.hpp.gch
rm -f ./src/util/prec.gch
include ./src/util/$(DEPDIR)/prec.Pch
magicseteditor_SOURCES += ./src/util/prec.gch
endif
# The script used to generate is MakeAM.sh' > Makefile.am;
find . -name *.cpp | sed "s/\./magicseteditor_SOURCES += ./" >> Makefile.am; find . -name *.cpp | sed "s/\./magicseteditor_SOURCES += ./" >> Makefile.am;
#+----------------------------------------------------------------------------+
#| Description: Magic Set Editor - Program to make Magic (tm) cards |
#| Copyright: (C) 2001 - 2008 Twan van Laarhoven and "coppro" |
#| License: GNU General Public License 2 or later (see file COPYING) |
#+----------------------------------------------------------------------------+
# This file is generated by MakeAM.sh. DO NOT EDIT!
# This flag allows us to use subdirectories:
AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = magicseteditor
AM_CXXFLAGS = @WX_CXXFLAGS@ $(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS)
.hpp.gch:
target=`echo $@ | sed "s|.gch$$|.hpp|"`;\
depbase=`echo $$target | sed "s|[^/]*\$$|$(DEPDIR)/&|;s|\\.hpp\$$||"`;\
$(CXXCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpch -c $$target &&\
$(am__mv) $$depbase.Tpch $$depbase.Pch
touch $@
.gch.o:
gcc -x c - -c -o $@ <<<""
magicseteditor_LDADD = $(BOOST_REGEX_LIB)
magicseteditor_CXXFLAGS = -fpch-deps $(AM_CXXFLAGS)
magicseteditor_SOURCES =
if GLIBCPP_BUILD_PCH
clean-local:
rm -f ./src/util/prec.hpp.gch
rm -f ./src/util/prec.gch
include ./src/util/$(DEPDIR)/prec.Pch
magicseteditor_SOURCES += ./src/util/prec.gch
endif
# The script used to generate is MakeAM.sh
magicseteditor_SOURCES += ./src/util/version.cpp
magicseteditor_SOURCES += ./src/util/alignment.cpp
magicseteditor_SOURCES += ./src/util/rotation.cpp
magicseteditor_SOURCES += ./src/util/tagged_string.cpp
magicseteditor_SOURCES += ./src/util/spell_checker.cpp
magicseteditor_SOURCES += ./src/util/vcs/subversion.cpp
magicseteditor_SOURCES += ./src/util/vcs.cpp
magicseteditor_SOURCES += ./src/util/regex.cpp
magicseteditor_SOURCES += ./src/util/spec_sort.cpp
magicseteditor_SOURCES += ./src/util/io/get_member.cpp
magicseteditor_SOURCES += ./src/util/io/package_manager.cpp
magicseteditor_SOURCES += ./src/util/io/writer.cpp
magicseteditor_SOURCES += ./src/util/io/reader.cpp
magicseteditor_SOURCES += ./src/util/io/package.cpp
magicseteditor_SOURCES += ./src/util/action_stack.cpp
magicseteditor_SOURCES += ./src/util/error.cpp
magicseteditor_SOURCES += ./src/util/age.cpp
magicseteditor_SOURCES += ./src/util/file_utils.cpp
magicseteditor_SOURCES += ./src/util/string.cpp
magicseteditor_SOURCES += ./src/gfx/color.cpp
magicseteditor_SOURCES += ./src/gfx/mask_image.cpp
magicseteditor_SOURCES += ./src/gfx/rotate_image.cpp
magicseteditor_SOURCES += ./src/gfx/image_effects.cpp
magicseteditor_SOURCES += ./src/gfx/resample_text.cpp
magicseteditor_SOURCES += ./src/gfx/combine_image.cpp
magicseteditor_SOURCES += ./src/gfx/polynomial.cpp
magicseteditor_SOURCES += ./src/gfx/bezier.cpp
magicseteditor_SOURCES += ./src/gfx/generated_image.cpp
magicseteditor_SOURCES += ./src/gfx/resample_image.cpp
magicseteditor_SOURCES += ./src/gfx/blend_image.cpp
magicseteditor_SOURCES += ./src/main.cpp
magicseteditor_SOURCES += ./src/render/card/viewer.cpp
magicseteditor_SOURCES += ./src/render/text/compound.cpp
magicseteditor_SOURCES += ./src/render/text/symbol.cpp
magicseteditor_SOURCES += ./src/render/text/font.cpp
magicseteditor_SOURCES += ./src/render/text/viewer.cpp
magicseteditor_SOURCES += ./src/render/text/element.cpp
magicseteditor_SOURCES += ./src/render/symbol/filter.cpp
magicseteditor_SOURCES += ./src/render/symbol/viewer.cpp
magicseteditor_SOURCES += ./src/render/value/multiple_choice.cpp
magicseteditor_SOURCES += ./src/render/value/symbol.cpp
magicseteditor_SOURCES += ./src/render/value/color.cpp
magicseteditor_SOURCES += ./src/render/value/package_choice.cpp
magicseteditor_SOURCES += ./src/render/value/viewer.cpp
magicseteditor_SOURCES += ./src/render/value/text.cpp
magicseteditor_SOURCES += ./src/render/value/information.cpp
magicseteditor_SOURCES += ./src/render/value/choice.cpp
magicseteditor_SOURCES += ./src/render/value/image.cpp
magicseteditor_SOURCES += ./src/script/scriptable.cpp
magicseteditor_SOURCES += ./src/script/profiler.cpp
magicseteditor_SOURCES += ./src/script/script_manager.cpp
magicseteditor_SOURCES += ./src/script/functions/spelling.cpp
magicseteditor_SOURCES += ./src/script/functions/english.cpp
magicseteditor_SOURCES += ./src/script/functions/basic.cpp
magicseteditor_SOURCES += ./src/script/functions/construction.cpp
magicseteditor_SOURCES += ./src/script/functions/regex.cpp
magicseteditor_SOURCES += ./src/script/functions/editor.cpp
magicseteditor_SOURCES += ./src/script/functions/image.cpp
magicseteditor_SOURCES += ./src/script/functions/export.cpp
magicseteditor_SOURCES += ./src/script/context.cpp
magicseteditor_SOURCES += ./src/script/dependency.cpp
magicseteditor_SOURCES += ./src/script/value.cpp
magicseteditor_SOURCES += ./src/script/script.cpp
magicseteditor_SOURCES += ./src/script/parser.cpp
magicseteditor_SOURCES += ./src/script/image.cpp
magicseteditor_SOURCES += ./src/data/statistics.cpp
magicseteditor_SOURCES += ./src/data/add_cards_script.cpp
magicseteditor_SOURCES += ./src/data/locale.cpp
magicseteditor_SOURCES += ./src/data/card.cpp
magicseteditor_SOURCES += ./src/data/symbol.cpp
magicseteditor_SOURCES += ./src/data/game.cpp
magicseteditor_SOURCES += ./src/data/font.cpp
magicseteditor_SOURCES += ./src/data/symbol_font.cpp
magicseteditor_SOURCES += ./src/data/stylesheet.cpp
magicseteditor_SOURCES += ./src/data/format/html.cpp
magicseteditor_SOURCES += ./src/data/format/mse1.cpp
magicseteditor_SOURCES += ./src/data/format/mse2.cpp
magicseteditor_SOURCES += ./src/data/format/apprentice.cpp
magicseteditor_SOURCES += ./src/data/format/clipboard.cpp
magicseteditor_SOURCES += ./src/data/format/image_to_symbol.cpp
magicseteditor_SOURCES += ./src/data/format/mws.cpp
magicseteditor_SOURCES += ./src/data/format/image.cpp
magicseteditor_SOURCES += ./src/data/format/mtg_editor.cpp
magicseteditor_SOURCES += ./src/data/format/formats.cpp
magicseteditor_SOURCES += ./src/data/settings.cpp
magicseteditor_SOURCES += ./src/data/keyword.cpp
magicseteditor_SOURCES += ./src/data/export_template.cpp
magicseteditor_SOURCES += ./src/data/field.cpp
magicseteditor_SOURCES += ./src/data/word_list.cpp
magicseteditor_SOURCES += ./src/data/field/multiple_choice.cpp
magicseteditor_SOURCES += ./src/data/field/symbol.cpp
magicseteditor_SOURCES += ./src/data/field/color.cpp
magicseteditor_SOURCES += ./src/data/field/package_choice.cpp
magicseteditor_SOURCES += ./src/data/field/boolean.cpp
magicseteditor_SOURCES += ./src/data/field/text.cpp
magicseteditor_SOURCES += ./src/data/field/information.cpp
magicseteditor_SOURCES += ./src/data/field/choice.cpp
magicseteditor_SOURCES += ./src/data/field/image.cpp
magicseteditor_SOURCES += ./src/data/installer.cpp
magicseteditor_SOURCES += ./src/data/set.cpp
magicseteditor_SOURCES += ./src/data/action/symbol_part.cpp
magicseteditor_SOURCES += ./src/data/action/symbol.cpp
magicseteditor_SOURCES += ./src/data/action/keyword.cpp
magicseteditor_SOURCES += ./src/data/action/value.cpp
magicseteditor_SOURCES += ./src/data/action/set.cpp
magicseteditor_SOURCES += ./src/data/pack.cpp
magicseteditor_SOURCES += ./src/gui/new_window.cpp
magicseteditor_SOURCES += ./src/gui/update_checker.cpp
magicseteditor_SOURCES += ./src/gui/icon_menu.cpp
magicseteditor_SOURCES += ./src/gui/util.cpp
magicseteditor_SOURCES += ./src/gui/image_slice_window.cpp
magicseteditor_SOURCES += ./src/gui/preferences_window.cpp
magicseteditor_SOURCES += ./src/gui/card_select_window.cpp
magicseteditor_SOURCES += ./src/gui/symbol/control.cpp
magicseteditor_SOURCES += ./src/gui/symbol/point_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/symmetry_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/select_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/basic_shape_editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/editor.cpp
magicseteditor_SOURCES += ./src/gui/symbol/window.cpp
magicseteditor_SOURCES += ./src/gui/symbol/part_list.cpp
magicseteditor_SOURCES += ./src/gui/symbol/selection.cpp
magicseteditor_SOURCES += ./src/gui/set/cards_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/style_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/set_info_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/keywords_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/panel.cpp
magicseteditor_SOURCES += ./src/gui/set/stats_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/random_pack_panel.cpp
magicseteditor_SOURCES += ./src/gui/set/window.cpp
magicseteditor_SOURCES += ./src/gui/thumbnail_thread.cpp
magicseteditor_SOURCES += ./src/gui/welcome_window.cpp
magicseteditor_SOURCES += ./src/gui/value/multiple_choice.cpp
magicseteditor_SOURCES += ./src/gui/value/symbol.cpp
magicseteditor_SOURCES += ./src/gui/value/color.cpp
magicseteditor_SOURCES += ./src/gui/value/package_choice.cpp
magicseteditor_SOURCES += ./src/gui/value/editor.cpp
magicseteditor_SOURCES += ./src/gui/value/text.cpp
magicseteditor_SOURCES += ./src/gui/value/information.cpp
magicseteditor_SOURCES += ./src/gui/value/choice.cpp
magicseteditor_SOURCES += ./src/gui/value/image.cpp
magicseteditor_SOURCES += ./src/gui/images_export_window.cpp
magicseteditor_SOURCES += ./src/gui/print_window.cpp
magicseteditor_SOURCES += ./src/gui/control/card_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/package_list.cpp
magicseteditor_SOURCES += ./src/gui/control/native_look_editor.cpp
magicseteditor_SOURCES += ./src/gui/control/keyword_list.cpp
magicseteditor_SOURCES += ./src/gui/control/graph.cpp
magicseteditor_SOURCES += ./src/gui/control/card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/gallery_list.cpp
magicseteditor_SOURCES += ./src/gui/control/item_list.cpp
magicseteditor_SOURCES += ./src/gui/control/filtered_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/image_card_list.cpp
magicseteditor_SOURCES += ./src/gui/control/card_viewer.cpp
magicseteditor_SOURCES += ./src/gui/control/tree_list.cpp
magicseteditor_SOURCES += ./src/gui/control/text_ctrl.cpp
magicseteditor_SOURCES += ./src/gui/control/card_list_column_select.cpp
magicseteditor_SOURCES += ./src/gui/control/select_card_list.cpp
magicseteditor_SOURCES += ./src/gui/package_update_list.cpp
magicseteditor_SOURCES += ./src/gui/about_window.cpp
magicseteditor_SOURCES += ./src/gui/drop_down_list.cpp
magicseteditor_SOURCES += ./src/gui/auto_replace_window.cpp
magicseteditor_SOURCES += ./src/gui/packages_window.cpp
magicseteditor_SOURCES += ./src/gui/html_export_window.cpp
magicseteditor_SOURCES += ./src/cli/win32_cli_wrapper.cpp
magicseteditor_SOURCES += ./src/cli/cli_main.cpp
magicseteditor_SOURCES += ./src/cli/text_io_handler.cpp
magicseteditor_SOURCES += ./src/code_template.cpp
This source diff could not be displayed because it is too large. You can view the blob instead.
# generated automatically by aclocal 1.11 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
[m4_warning([this file was generated for autoconf 2.64.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
To do so, use the procedure documented by the package, typically `autoreconf'.])])
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_base.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_BASE([MINIMUM-VERSION])
#
# DESCRIPTION
#
# Test for the Boost C++ libraries of a particular version (or newer)
#
# If no path to the installed boost library is given the macro searchs
# under /usr, /usr/local, /opt and /opt/local and evaluates the
# $BOOST_ROOT environment variable. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_CPPFLAGS) / AC_SUBST(BOOST_LDFLAGS)
#
# And sets:
#
# HAVE_BOOST
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_BASE],
[
AC_ARG_WITH([boost],
AS_HELP_STRING([--with-boost@<:@=DIR@:>@], [use boost (default is yes) - it is possible to specify the root directory for boost (optional)]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ac_boost_path=""
else
want_boost="yes"
ac_boost_path="$withval"
fi
],
[want_boost="yes"])
AC_ARG_WITH([boost-libdir],
AS_HELP_STRING([--with-boost-libdir=LIB_DIR],
[Force given directory for boost libraries. Note that this will overwrite library path detection, so use this parameter only if default library detection fails and you know exactly where your boost libraries are located.]),
[
if test -d $withval
then
ac_boost_lib_path="$withval"
else
AC_MSG_ERROR(--with-boost-libdir expected directory name)
fi
],
[ac_boost_lib_path=""]
)
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=ifelse([$1], ,1.20.0,$1)
boost_lib_version_req_shorten=`expr $boost_lib_version_req : '\([[0-9]]*\.[[0-9]]*\)'`
boost_lib_version_req_major=`expr $boost_lib_version_req : '\([[0-9]]*\)'`
boost_lib_version_req_minor=`expr $boost_lib_version_req : '[[0-9]]*\.\([[0-9]]*\)'`
boost_lib_version_req_sub_minor=`expr $boost_lib_version_req : '[[0-9]]*\.[[0-9]]*\.\([[0-9]]*\)'`
if test "x$boost_lib_version_req_sub_minor" = "x" ; then
boost_lib_version_req_sub_minor="0"
fi
WANT_BOOST_VERSION=`expr $boost_lib_version_req_major \* 100000 \+ $boost_lib_version_req_minor \* 100 \+ $boost_lib_version_req_sub_minor`
AC_MSG_CHECKING(for boostlib >= $boost_lib_version_req)
succeeded=no
dnl first we check the system location for boost libraries
dnl this location ist chosen if boost libraries are installed with the --layout=system option
dnl or if you install boost with RPM
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
BOOST_CPPFLAGS="-I$ac_boost_path/include"
else
for ac_boost_path_tmp in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path_tmp/include/boost" && test -r "$ac_boost_path_tmp/include/boost"; then
BOOST_LDFLAGS="-L$ac_boost_path_tmp/lib"
BOOST_CPPFLAGS="-I$ac_boost_path_tmp/include"
break;
fi
done
fi
dnl overwrite ld flags if we have required special directory with
dnl --with-boost-libdir parameter
if test "$ac_boost_lib_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_lib_path"
fi
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
dnl if we found no boost with system layout we search for boost libraries
dnl built and installed without the --layout=system option or for a staged(not installed) version
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
fi
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$ac_boost_path/include/boost-$VERSION_UNDERSCORE"
done
fi
else
for ac_boost_path in /usr /usr/local /opt /opt/local ; do
if test -d "$ac_boost_path" && test -r "$ac_boost_path"; then
for i in `ls -d $ac_boost_path/include/boost-* 2>/dev/null`; do
_version_tmp=`echo $i | sed "s#$ac_boost_path##" | sed 's/\/include\/boost-//' | sed 's/_/./'`
V_CHECK=`expr $_version_tmp \> $_version`
if test "$V_CHECK" = "1" ; then
_version=$_version_tmp
best_path=$ac_boost_path
fi
done
fi
done
VERSION_UNDERSCORE=`echo $_version | sed 's/\./_/'`
BOOST_CPPFLAGS="-I$best_path/include/boost-$VERSION_UNDERSCORE"
if test "$ac_boost_lib_path" = ""
then
BOOST_LDFLAGS="-L$best_path/lib"
fi
if test "x$BOOST_ROOT" != "x"; then
if test -d "$BOOST_ROOT" && test -r "$BOOST_ROOT" && test -d "$BOOST_ROOT/stage/lib" && test -r "$BOOST_ROOT/stage/lib"; then
version_dir=`expr //$BOOST_ROOT : '.*/\(.*\)'`
stage_version=`echo $version_dir | sed 's/boost_//' | sed 's/_/./g'`
stage_version_shorten=`expr $stage_version : '\([[0-9]]*\.[[0-9]]*\)'`
V_CHECK=`expr $stage_version_shorten \>\= $_version`
if test "$V_CHECK" = "1" -a "$ac_boost_lib_path" = "" ; then
AC_MSG_NOTICE(We will use a staged boost library from $BOOST_ROOT)
BOOST_CPPFLAGS="-I$BOOST_ROOT"
BOOST_LDFLAGS="-L$BOOST_ROOT/stage/lib"
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_LANG_PUSH(C++)
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@%:@include <boost/version.hpp>
]], [[
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
]])],[
AC_MSG_RESULT(yes)
succeeded=yes
found_system=yes
],[
])
AC_LANG_POP([C++])
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
AC_MSG_ERROR([[We could not detect the boost libraries (version $boost_lib_version_req_shorten or higher). If you have a staged boost library (still not installed) please specify \$BOOST_ROOT in your environment and do not give a PATH to --with-boost option. If you are sure you have boost installed, then check your version number looking in <boost/version.hpp>. See http://randspringer.de/boost for more documentation.]])
else
AC_MSG_NOTICE([Your boost libraries seems to old (version $_version).])
fi
else
AC_SUBST(BOOST_CPPFLAGS)
AC_SUBST(BOOST_LDFLAGS)
AC_DEFINE(HAVE_BOOST,,[define if the Boost library is available])
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
# ===========================================================================
# http://autoconf-archive.cryp.to/ax_boost_regex.html
# ===========================================================================
#
# SYNOPSIS
#
# AX_BOOST_REGEX
#
# DESCRIPTION
#
# Test for Regex library from the Boost C++ libraries. The macro requires
# a preceding call to AX_BOOST_BASE. Further documentation is available at
# <http://randspringer.de/boost/index.html>.
#
# This macro calls:
#
# AC_SUBST(BOOST_REGEX_LIB)
#
# And sets:
#
# HAVE_BOOST_REGEX
#
# LICENSE
#
# Copyright (c) 2008 Thomas Porschberg <thomas@randspringer.de>
# Copyright (c) 2008 Michael Tindal
#
# Copying and distribution of this file, with or without modification, are
# permitted in any medium without royalty provided the copyright notice
# and this notice are preserved.
AC_DEFUN([AX_BOOST_REGEX],
[
AC_ARG_WITH([boost-regex],
AS_HELP_STRING([--with-boost-regex@<:@=special-lib@:>@],
[use the Regex library from boost - it is possible to specify a certain library for the linker
e.g. --with-boost-regex=boost_regex-gcc-mt-d-1_33_1 ]),
[
if test "$withval" = "no"; then
want_boost="no"
elif test "$withval" = "yes"; then
want_boost="yes"
ax_boost_user_regex_lib=""
else
want_boost="yes"
ax_boost_user_regex_lib="$withval"
fi
],
[want_boost="yes"]
)
if test "x$want_boost" = "xyes"; then
AC_REQUIRE([AC_PROG_CC])
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
AC_CACHE_CHECK(whether the Boost::Regex library is available,
ax_cv_boost_regex,
[AC_LANG_PUSH([C++])
AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[@%:@include <boost/regex.hpp>
]],
[[boost::regex r(); return 0;]]),
ax_cv_boost_regex=yes, ax_cv_boost_regex=no)
AC_LANG_POP([C++])
])
if test "x$ax_cv_boost_regex" = "xyes"; then
AC_DEFINE(HAVE_BOOST_REGEX,,[define if the Boost::Regex library is available])
BOOSTLIBDIR=`echo $BOOST_LDFLAGS | sed -e 's/@<:@^\/@:>@*//'`
if test "x$ax_boost_user_regex_lib" = "x"; then
for libextension in `ls $BOOSTLIBDIR/libboost_regex*.{so,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^lib\(boost_regex.*\)\.so.*$;\1;' -e 's;^lib\(boost_regex.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
if test "x$link_regex" != "xyes"; then
for libextension in `ls $BOOSTLIBDIR/boost_regex*.{dll,a}* 2>/dev/null | sed 's,.*/,,' | sed -e 's;^\(boost_regex.*\)\.dll.*$;\1;' -e 's;^\(boost_regex.*\)\.a*$;\1;'` ; do
ax_lib=${libextension}
AC_CHECK_LIB($ax_lib, exit,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
else
for ax_lib in $ax_boost_user_regex_lib boost_regex-$ax_boost_user_regex_lib; do
AC_CHECK_LIB($ax_lib, main,
[BOOST_REGEX_LIB="-l$ax_lib"; AC_SUBST(BOOST_REGEX_LIB) link_regex="yes"; break],
[link_regex="no"])
done
fi
if test "x$link_regex" != "xyes"; then
AC_MSG_ERROR(Could not link against $ax_lib !)
fi
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
])
dnl ---------------------------------------------------------------------------
dnl Macros for wxWidgets detection. Typically used in configure.in as:
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl ...
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWidgets must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWidgets libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWidgets version is 2.3.4 or above.
dnl ])
dnl fi
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LIBS="$LIBS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_OPTIONS_WXCONFIG
dnl
dnl adds support for --wx-prefix, --wx-exec-prefix, --with-wxdir and
dnl --wx-config command line options
dnl ---------------------------------------------------------------------------
AC_DEFUN([AM_OPTIONS_WXCONFIG],
[
AC_ARG_WITH(wxdir,
[ --with-wxdir=PATH Use uninstalled version of wxWidgets in PATH],
[ wx_config_name="$withval/wx-config"
wx_config_args="--inplace"])
AC_ARG_WITH(wx-config,
[ --with-wx-config=CONFIG wx-config script to use (optional)],
wx_config_name="$withval" )
AC_ARG_WITH(wx-prefix,
[ --with-wx-prefix=PREFIX Prefix where wxWidgets is installed (optional)],
wx_config_prefix="$withval", wx_config_prefix="")
AC_ARG_WITH(wx-exec-prefix,
[ --with-wx-exec-prefix=PREFIX
Exec prefix where wxWidgets is installed (optional)],
wx_config_exec_prefix="$withval", wx_config_exec_prefix="")
])
dnl Helper macro for checking if wx version is at least $1.$2.$3, set's
dnl wx_ver_ok=yes if it is:
AC_DEFUN([_WX_PRIVATE_CHECK_VERSION],
[
wx_ver_ok=""
if test "x$WX_VERSION" != x ; then
if test $wx_config_major_version -gt $1; then
wx_ver_ok=yes
else
if test $wx_config_major_version -eq $1; then
if test $wx_config_minor_version -gt $2; then
wx_ver_ok=yes
else
if test $wx_config_minor_version -eq $2; then
if test $wx_config_micro_version -ge $3; then
wx_ver_ok=yes
fi
fi
fi
fi
fi
fi
])
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXCONFIG(VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND
dnl [, WX-LIBS [, ADDITIONAL-WX-CONFIG-FLAGS]]]])
dnl
dnl Test for wxWidgets, and define WX_C*FLAGS, WX_LIBS and WX_LIBS_STATIC
dnl (the latter is for static linking against wxWidgets). Set WX_CONFIG_NAME
dnl environment variable to override the default name of the wx-config script
dnl to use. Set WX_CONFIG_PATH to specify the full path to wx-config - in this
dnl case the macro won't even waste time on tests for its existence.
dnl
dnl Optional WX-LIBS argument contains comma- or space-separated list of
dnl wxWidgets libraries to link against (it may include contrib libraries). If
dnl it is not specified then WX_LIBS and WX_LIBS_STATIC will contain flags to
dnl link with all of the core wxWidgets libraries.
dnl
dnl Optional ADDITIONAL-WX-CONFIG-FLAGS argument is appended to wx-config
dnl invocation command in present. It can be used to fine-tune lookup of
dnl best wxWidgets build available.
dnl
dnl Example use:
dnl AM_PATH_WXCONFIG([2.6.0], [wxWin=1], [wxWin=0], [html,core,net]
dnl [--unicode --debug])
dnl ---------------------------------------------------------------------------
dnl
dnl Get the cflags and libraries from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXCONFIG],
[
dnl do we have wx-config name: it can be wx-config or wxd-config or ...
if test x${WX_CONFIG_NAME+set} != xset ; then
WX_CONFIG_NAME=wx-config
fi
if test "x$wx_config_name" != x ; then
WX_CONFIG_NAME="$wx_config_name"
fi
dnl deal with optional prefixes
if test x$wx_config_exec_prefix != x ; then
wx_config_args="$wx_config_args --exec-prefix=$wx_config_exec_prefix"
WX_LOOKUP_PATH="$wx_config_exec_prefix/bin"
fi
if test x$wx_config_prefix != x ; then
wx_config_args="$wx_config_args --prefix=$wx_config_prefix"
WX_LOOKUP_PATH="$WX_LOOKUP_PATH:$wx_config_prefix/bin"
fi
if test "$cross_compiling" = "yes"; then
wx_config_args="$wx_config_args --host=$host_alias"
fi
dnl don't search the PATH if WX_CONFIG_NAME is absolute filename
if test -x "$WX_CONFIG_NAME" ; then
AC_MSG_CHECKING(for wx-config)
WX_CONFIG_PATH="$WX_CONFIG_NAME"
AC_MSG_RESULT($WX_CONFIG_PATH)
else
AC_PATH_PROG(WX_CONFIG_PATH, $WX_CONFIG_NAME, no, "$WX_LOOKUP_PATH:$PATH")
fi
if test "$WX_CONFIG_PATH" != "no" ; then
WX_VERSION=""
min_wx_version=ifelse([$1], ,2.2.1,$1)
if test -z "$5" ; then
AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version])
else
AC_MSG_CHECKING([for wxWidgets version >= $min_wx_version ($5)])
fi
WX_CONFIG_WITH_ARGS="$WX_CONFIG_PATH $wx_config_args $5 $4"
WX_VERSION=`$WX_CONFIG_WITH_ARGS --version 2>/dev/null`
wx_config_major_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_config_minor_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_config_micro_version=`echo $WX_VERSION | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
wx_requested_major_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
wx_requested_minor_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
wx_requested_micro_version=`echo $min_wx_version | \
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
_WX_PRIVATE_CHECK_VERSION([$wx_requested_major_version],
[$wx_requested_minor_version],
[$wx_requested_micro_version])
if test -n "$wx_ver_ok"; then
AC_MSG_RESULT(yes (version $WX_VERSION))
WX_LIBS=`$WX_CONFIG_WITH_ARGS --libs`
dnl is this even still appropriate? --static is a real option now
dnl and WX_CONFIG_WITH_ARGS is likely to contain it if that is
dnl what the user actually wants, making this redundant at best.
dnl For now keep it in case anyone actually used it in the past.
AC_MSG_CHECKING([for wxWidgets static library])
WX_LIBS_STATIC=`$WX_CONFIG_WITH_ARGS --static --libs 2>/dev/null`
if test "x$WX_LIBS_STATIC" = "x"; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
fi
dnl starting with version 2.2.6 wx-config has --cppflags argument
wx_has_cppflags=""
if test $wx_config_major_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -gt 2; then
wx_has_cppflags=yes
else
if test $wx_config_minor_version -eq 2; then
if test $wx_config_micro_version -ge 6; then
wx_has_cppflags=yes
fi
fi
fi
fi
fi
dnl starting with version 2.7.0 wx-config has --rescomp option
wx_has_rescomp=""
if test $wx_config_major_version -gt 2; then
wx_has_rescomp=yes
else
if test $wx_config_major_version -eq 2; then
if test $wx_config_minor_version -ge 7; then
wx_has_rescomp=yes
fi
fi
fi
if test "x$wx_has_rescomp" = x ; then
dnl cannot give any useful info for resource compiler
WX_RESCOMP=
else
WX_RESCOMP=`$WX_CONFIG_WITH_ARGS --rescomp`
fi
if test "x$wx_has_cppflags" = x ; then
dnl no choice but to define all flags like CFLAGS
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CPPFLAGS=$WX_CFLAGS
WX_CXXFLAGS=$WX_CFLAGS
WX_CFLAGS_ONLY=$WX_CFLAGS
WX_CXXFLAGS_ONLY=$WX_CFLAGS
else
dnl we have CPPFLAGS included in CFLAGS included in CXXFLAGS
WX_CPPFLAGS=`$WX_CONFIG_WITH_ARGS --cppflags`
WX_CXXFLAGS=`$WX_CONFIG_WITH_ARGS --cxxflags`
WX_CFLAGS=`$WX_CONFIG_WITH_ARGS --cflags`
WX_CFLAGS_ONLY=`echo $WX_CFLAGS | sed "s@^$WX_CPPFLAGS *@@"`
WX_CXXFLAGS_ONLY=`echo $WX_CXXFLAGS | sed "s@^$WX_CFLAGS *@@"`
fi
ifelse([$2], , :, [$2])
else
if test "x$WX_VERSION" = x; then
dnl no wx-config at all
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(no (version $WX_VERSION is not new enough))
fi
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
ifelse([$3], , :, [$3])
fi
else
WX_CFLAGS=""
WX_CPPFLAGS=""
WX_CXXFLAGS=""
WX_LIBS=""
WX_LIBS_STATIC=""
WX_RESCOMP=""
ifelse([$3], , :, [$3])
fi
AC_SUBST(WX_CPPFLAGS)
AC_SUBST(WX_CFLAGS)
AC_SUBST(WX_CXXFLAGS)
AC_SUBST(WX_CFLAGS_ONLY)
AC_SUBST(WX_CXXFLAGS_ONLY)
AC_SUBST(WX_LIBS)
AC_SUBST(WX_LIBS_STATIC)
AC_SUBST(WX_VERSION)
AC_SUBST(WX_RESCOMP)
])
dnl ---------------------------------------------------------------------------
dnl Get information on the wxrc program for making C++, Python and xrs
dnl resource files.
dnl
dnl AC_ARG_ENABLE(...)
dnl AC_ARG_WITH(...)
dnl ...
dnl AM_OPTIONS_WXCONFIG
dnl ...
dnl AM_PATH_WXCONFIG(2.6.0, wxWin=1)
dnl if test "$wxWin" != 1; then
dnl AC_MSG_ERROR([
dnl wxWidgets must be installed on your system
dnl but wx-config script couldn't be found.
dnl
dnl Please check that wx-config is in path, the directory
dnl where wxWidgets libraries are installed (returned by
dnl 'wx-config --libs' command) is in LD_LIBRARY_PATH or
dnl equivalent variable and wxWidgets version is 2.6.0 or above.
dnl ])
dnl fi
dnl
dnl AM_PATH_WXRC([HAVE_WXRC=1], [HAVE_WXRC=0])
dnl if test "x$HAVE_WXRC" != x1; then
dnl AC_MSG_ERROR([
dnl The wxrc program was not installed or not found.
dnl
dnl Please check the wxWidgets installation.
dnl ])
dnl fi
dnl
dnl CPPFLAGS="$CPPFLAGS $WX_CPPFLAGS"
dnl CXXFLAGS="$CXXFLAGS $WX_CXXFLAGS_ONLY"
dnl CFLAGS="$CFLAGS $WX_CFLAGS_ONLY"
dnl
dnl LDFLAGS="$LDFLAGS $WX_LIBS"
dnl ---------------------------------------------------------------------------
dnl ---------------------------------------------------------------------------
dnl AM_PATH_WXRC([ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
dnl
dnl Test for wxWidgets' wxrc program for creating either C++, Python or XRS
dnl resources. The variable WXRC will be set and substituted in the configure
dnl script and Makefiles.
dnl
dnl Example use:
dnl AM_PATH_WXRC([wxrc=1], [wxrc=0])
dnl ---------------------------------------------------------------------------
dnl
dnl wxrc program from the wx-config script
dnl
AC_DEFUN([AM_PATH_WXRC],
[
AC_ARG_VAR([WXRC], [Path to wxWidget's wxrc resource compiler])
if test "x$WX_CONFIG_NAME" = x; then
AC_MSG_ERROR([The wxrc tests must run after wxWidgets test.])
else
AC_MSG_CHECKING([for wxrc])
if test "x$WXRC" = x ; then
dnl wx-config --utility is a new addition to wxWidgets:
_WX_PRIVATE_CHECK_VERSION(2,5,3)
if test -n "$wx_ver_ok"; then
WXRC=`$WX_CONFIG_WITH_ARGS --utility=wxrc`
fi
fi
if test "x$WXRC" = x ; then
AC_MSG_RESULT([not found])
ifelse([$2], , :, [$2])
else
AC_MSG_RESULT([$WXRC])
ifelse([$1], , :, [$1])
fi
AC_SUBST(WXRC)
fi
])
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
[am__api_version='1.11'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
m4_if([$1], [1.11], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
# _AM_AUTOCONF_VERSION(VERSION)
# -----------------------------
# aclocal traces this macro to find the Autoconf version.
# This is a private macro too. Using m4_define simplifies
# the logic in aclocal, which can simply ignore this definition.
m4_define([_AM_AUTOCONF_VERSION], [])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.11])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 9
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
m4_define([_AM_COND_VALUE_$1], [$2])dnl
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 10
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], UPC, [depcc="$UPC" am_compiler_list=],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
am__universal=false
m4_case([$1], [CC],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac],
[CXX],
[case " $depcc " in #(
*\ -arch\ *\ -arch\ *) am__universal=true ;;
esac])
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this. Also, some Intel
# versions had trouble with output in subdirs
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
gcc)
# This depmode causes a compiler race in universal mode.
test "$am__universal" = false || continue
;;
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
msvisualcpp | msvcmsys)
# This compiler won't grok `-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
am__minus_obj=
;;
none) break ;;
esac
if depmode=$depmode \
source=sub/conftest.c object=$am__obj \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep $am__obj sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
# Autoconf 2.62 quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
*\'*) eval set x "$CONFIG_FILES" ;;
*) set x $CONFIG_FILES ;;
esac
shift
for mf
do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# Grep'ing the whole file is not good either: AIX grep has a line
# limit of 2048, but all sed's we know have understand at least 4000.
if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
}
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 16
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.62])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
# test to see if srcdir already configured
if test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
[_AM_DEPENDENCIES(OBJC)],
[define([AC_PROG_OBJC],
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
])
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
])
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_arg=$1
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$_am_arg | $_am_arg:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
if test x"${install_sh}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
*)
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo this is the am__doit target
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# Ignore all kinds of additional output from `make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
am__quote=
_am_result=GNU
;;
esac
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=.include
am__quote="\""
_am_result=BSD
;;
esac
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 6
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
*)
MISSING="\${SHELL} $am_aux_dir/missing" ;;
esac
fi
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check for `mkdir -p'.
AC_DEFUN([AM_PROG_MKDIR_P],
[AC_PREREQ([2.60])dnl
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
dnl while keeping a definition of mkdir_p for backward compatibility.
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
dnl Makefile.ins that do not define MKDIR_P, so we do our own
dnl adjustment using top_builddir (which is defined more often than
dnl MKDIR_P).
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
case $mkdir_p in
[[\\/$]]* | ?:[[\\/]]*) ;;
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
esac
])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 5
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
'
case `pwd` in
*[[\\\"\#\$\&\'\`$am_lf]]*)
AC_MSG_ERROR([unsafe absolute working directory name]);;
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
esac
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t "$srcdir/configure" conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
# This macro is traced by Automake.
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
...@@ -598,6 +598,8 @@ LIBOBJS ...@@ -598,6 +598,8 @@ LIBOBJS
EGREP EGREP
GREP GREP
CPP CPP
GLIBCPP_BUILD_PCH_FALSE
GLIBCPP_BUILD_PCH_TRUE
WX_RESCOMP WX_RESCOMP
WX_VERSION WX_VERSION
WX_LIBS_STATIC WX_LIBS_STATIC
...@@ -4910,6 +4912,17 @@ if test "${HAVE_WX}" != 1; then ...@@ -4910,6 +4912,17 @@ if test "${HAVE_WX}" != 1; then
" "$LINENO" 5 " "$LINENO" 5
fi fi
# Check for precompiled headers
# TODO: Deal with braindead GCC and actually check
if test "x$CXX" = "xg++"; then
GLIBCPP_BUILD_PCH_TRUE=
GLIBCPP_BUILD_PCH_FALSE='#'
else
GLIBCPP_BUILD_PCH_TRUE='#'
GLIBCPP_BUILD_PCH_FALSE=
fi
# Checks for header files. # Checks for header files.
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
...@@ -5813,6 +5826,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then ...@@ -5813,6 +5826,10 @@ if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then
as_fn_error "conditional \"am__fastdepCC\" was never defined. as_fn_error "conditional \"am__fastdepCC\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5 Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi fi
if test -z "${GLIBCPP_BUILD_PCH_TRUE}" && test -z "${GLIBCPP_BUILD_PCH_FALSE}"; then
as_fn_error "conditional \"GLIBCPP_BUILD_PCH\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
fi
: ${CONFIG_STATUS=./config.status} : ${CONFIG_STATUS=./config.status}
ac_write_fail=0 ac_write_fail=0
......
...@@ -11,7 +11,7 @@ AC_CONFIG_SRCDIR([src/main.cpp]) ...@@ -11,7 +11,7 @@ AC_CONFIG_SRCDIR([src/main.cpp])
# TODO: Actually use the config header # TODO: Actually use the config header
AC_CONFIG_HEADER([src/config.h]) AC_CONFIG_HEADER([src/config.h])
AM_INIT_AUTOMAKE([-Wall foreign]) AM_INIT_AUTOMAKE([foreign])
# Checks for programs. # Checks for programs.
if test -n "${CXXFLAGS}"; then if test -n "${CXXFLAGS}"; then
...@@ -56,6 +56,10 @@ if test "${HAVE_WX}" != 1; then ...@@ -56,6 +56,10 @@ if test "${HAVE_WX}" != 1; then
]) ])
fi fi
# Check for precompiled headers
# TODO: Deal with braindead GCC and actually check
AM_CONDITIONAL(GLIBCPP_BUILD_PCH, test "x$CXX" = "xg++")
# Checks for header files. # Checks for header files.
# Checks for typedefs, structures, and compiler characteristics. # Checks for typedefs, structures, and compiler characteristics.
......
...@@ -79,6 +79,9 @@ ...@@ -79,6 +79,9 @@
/* Define to the one symbol short name of this package. */ /* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME #undef PACKAGE_TARNAME
/* Define to the home page for this package. */
#undef PACKAGE_URL
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
......
...@@ -29,11 +29,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA ValueP>); ...@@ -29,11 +29,13 @@ DECLARE_TYPEOF_NO_REV(IndexMap<FieldP COMMA ValueP>);
Set::Set() Set::Set()
: script_manager(new SetScriptManager(*this)) : script_manager(new SetScriptManager(*this))
, vcs (new_intrusive<VCS>())
{} {}
Set::Set(const GameP& game) Set::Set(const GameP& game)
: game(game) : game(game)
, script_manager(new SetScriptManager(*this)) , script_manager(new SetScriptManager(*this))
, vcs (new_intrusive<VCS>())
{ {
data.init(game->set_fields); data.init(game->set_fields);
} }
...@@ -42,6 +44,7 @@ Set::Set(const StyleSheetP& stylesheet) ...@@ -42,6 +44,7 @@ Set::Set(const StyleSheetP& stylesheet)
: game(stylesheet->game) : game(stylesheet->game)
, stylesheet(stylesheet) , stylesheet(stylesheet)
, script_manager(new SetScriptManager(*this)) , script_manager(new SetScriptManager(*this))
, vcs (new_intrusive<VCS>())
{ {
data.init(game->set_fields); data.init(game->set_fields);
} }
...@@ -186,6 +189,7 @@ IMPLEMENT_REFLECTION(Set) { ...@@ -186,6 +189,7 @@ IMPLEMENT_REFLECTION(Set) {
REFLECT(pack_types); REFLECT(pack_types);
} }
reflect_set_info_get_member(tag,data); reflect_set_info_get_member(tag,data);
REFLECT_NO_SCRIPT_N("version control", vcs);
REFLECT(apprentice_code); REFLECT(apprentice_code);
} }
...@@ -206,7 +210,7 @@ void Set::reflect_cards<Writer> (Writer& tag) { ...@@ -206,7 +210,7 @@ void Set::reflect_cards<Writer> (Writer& tag) {
int i = 0; int i = 0;
while (used.find(full_name) != used.end()) { while (used.find(full_name) != used.end()) {
full_name = filename << _(".") << ++i; full_name = String(filename) << _(".") << ++i;
} }
used.insert(full_name); used.insert(full_name);
......
...@@ -61,6 +61,7 @@ class Set : public Packaged { ...@@ -61,6 +61,7 @@ class Set : public Packaged {
ActionStack actions; ///< Actions performed on this set and the cards in it ActionStack actions; ///< Actions performed on this set and the cards in it
KeywordDatabase keyword_db; ///< Database for matching keywords, must be cleared when keywords change KeywordDatabase keyword_db; ///< Database for matching keywords, must be cleared when keywords change
VCSP vcs; ///< The version control system to use
/// A context for performing scripts /// A context for performing scripts
/** Should only be used from the main thread! */ /** Should only be used from the main thread! */
...@@ -119,6 +120,11 @@ class Set : public Packaged { ...@@ -119,6 +120,11 @@ class Set : public Packaged {
Version fileVersion() const; Version fileVersion() const;
/// Validate that the set is correctly loaded /// Validate that the set is correctly loaded
virtual void validate(Version = app_version); virtual void validate(Version = app_version);
protected:
virtual VCSP getVCS() {
return vcs;
}
private: private:
DECLARE_REFLECTION(); DECLARE_REFLECTION();
......
...@@ -193,7 +193,7 @@ class SetCombineImage : public SimpleFilterImage { ...@@ -193,7 +193,7 @@ class SetCombineImage : public SimpleFilterImage {
/// Saturate/desaturate an image /// Saturate/desaturate an image
class SaturateImage : public SimpleFilterImage { class SaturateImage : public SimpleFilterImage {
public: public:
inline SaturateImage(const GeneratedImageP& image, double alpha) inline SaturateImage(const GeneratedImageP& image, double amount)
: SimpleFilterImage(image), amount(amount) : SimpleFilterImage(image), amount(amount)
{} {}
virtual Image generate(const Options& opt) const; virtual Image generate(const Options& opt) const;
......
...@@ -51,7 +51,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) { ...@@ -51,7 +51,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
// Evaluate the current instruction // Evaluate the current instruction
Instruction i = *instr++; Instruction i = *instr++;
// If a scope is created, destroy it at end of block. // If a scope is created, destroy it at end of block.
scoped_ptr<LocalScope> scope; scoped_ptr<LocalScope> new_scope;
switch (i.instr) { switch (i.instr) {
case I_NOP: break; case I_NOP: break;
...@@ -126,7 +126,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) { ...@@ -126,7 +126,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
} }
// Function call // Function call
case I_CALL: scope.reset(new LocalScope(*this)); //new scope case I_CALL: new_scope.reset(new LocalScope(*this)); //new scope
case I_TAILCALL: { case I_TAILCALL: {
// prepare arguments // prepare arguments
for (unsigned int j = 0 ; j < i.data ; ++j) { for (unsigned int j = 0 ; j < i.data ; ++j) {
...@@ -144,7 +144,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) { ...@@ -144,7 +144,7 @@ ScriptValueP Context::eval(const Script& script, bool useScope) {
Profiler prof(timer, function); Profiler prof(timer, function);
#endif #endif
// get function and call // get function and call
stack.back() = stack.back()->eval(*this); stack.back() = stack.back()->eval(*this, false);
// finish profiling // finish profiling
#if USE_SCRIPT_PROFILING #if USE_SCRIPT_PROFILING
//profile_add(function, timer.time()); //profile_add(function, timer.time());
...@@ -366,7 +366,14 @@ class ScriptCompose : public ScriptValue { ...@@ -366,7 +366,14 @@ class ScriptCompose : public ScriptValue {
virtual ScriptType type() const { return SCRIPT_FUNCTION; } virtual ScriptType type() const { return SCRIPT_FUNCTION; }
virtual String typeName() const { return _("function composition"); } virtual String typeName() const { return _("function composition"); }
virtual ScriptValueP eval(Context& ctx) const {
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const {
ctx.setVariable(SCRIPT_VAR_input, a->dependencies(ctx, dep));
return b->dependencies(ctx, dep);
}
protected:
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const {
#if USE_SCRIPT_PROFILING #if USE_SCRIPT_PROFILING
Timer timer; Timer timer;
{ {
...@@ -382,14 +389,13 @@ class ScriptCompose : public ScriptValue { ...@@ -382,14 +389,13 @@ class ScriptCompose : public ScriptValue {
return b->eval(ctx); return b->eval(ctx);
} }
#else #else
// Always open a scope for a; variables it makes need to be
// cleared for b's call.
ctx.setVariable(SCRIPT_VAR_input, a->eval(ctx)); ctx.setVariable(SCRIPT_VAR_input, a->eval(ctx));
return b->eval(ctx); return b->eval(ctx, openScope);
#endif #endif
} }
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const {
ctx.setVariable(SCRIPT_VAR_input, a->dependencies(ctx, dep));
return b->dependencies(ctx, dep);
}
private: private:
ScriptValueP a,b; ScriptValueP a,b;
}; };
......
...@@ -173,8 +173,6 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script) ...@@ -173,8 +173,6 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
// Analyze the current instruction // Analyze the current instruction
Instruction i = *instr++; Instruction i = *instr++;
// If a scope is created, destroy it at end of block.
scoped_ptr<LocalScope> scope;
switch (i.instr) { switch (i.instr) {
case I_NOP: break; case I_NOP: break;
// Push a constant (as normal) // Push a constant (as normal)
...@@ -263,8 +261,10 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script) ...@@ -263,8 +261,10 @@ ScriptValueP Context::dependencies(const Dependency& dep, const Script& script)
} }
// Function call (as normal) // Function call (as normal)
case I_CALL: scope.reset(new LocalScope(*this)); //new scope // Don't optimize tail calls; we may not jump as we normally do
case I_TAILCALL: { case I_CALL: case I_TAILCALL: {
// open a new scope
LocalScope new_scope(*this);
// prepare arguments // prepare arguments
for (unsigned int j = 0 ; j < i.data ; ++j) { for (unsigned int j = 0 ; j < i.data ; ++j) {
setVariable((Variable)instr[i.data - j - 1].data, stack.back()); setVariable((Variable)instr[i.data - j - 1].data, stack.back());
......
...@@ -59,10 +59,10 @@ ...@@ -59,10 +59,10 @@
{ return SCRIPT_FUNCTION; } \ { return SCRIPT_FUNCTION; } \
virtual String typeName() const \ virtual String typeName() const \
{ return _("built-in function '") _(#name) _("'"); } \ { return _("built-in function '") _(#name) _("'"); } \
virtual ScriptValueP eval(Context&) const; \ virtual ScriptValueP do_eval(Context&, bool) const; \
}; \ }; \
ScriptValueP script_##name(new ScriptBuiltIn_##name); \ ScriptValueP script_##name(new ScriptBuiltIn_##name); \
ScriptValueP ScriptBuiltIn_##name::eval(Context& ctx) const ScriptValueP ScriptBuiltIn_##name::do_eval(Context& ctx, bool) const
/// Return a value from a SCRIPT_FUNCTION /// Return a value from a SCRIPT_FUNCTION
#define SCRIPT_RETURN(value) return to_script(value) #define SCRIPT_RETURN(value) return to_script(value)
...@@ -160,7 +160,8 @@ inline Type from_script(const ScriptValueP& v, Variable var) { ...@@ -160,7 +160,8 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
inline ScriptRule_##funname(const type1& name1) : name1(name1) {} \ inline ScriptRule_##funname(const type1& name1) : name1(name1) {} \
virtual ScriptType type() const { return SCRIPT_FUNCTION; } \ virtual ScriptType type() const { return SCRIPT_FUNCTION; } \
virtual String typeName() const { return _(#funname)_("_rule"); } \ virtual String typeName() const { return _(#funname)_("_rule"); } \
virtual ScriptValueP eval(Context& ctx) const; \ protected: \
virtual ScriptValueP do_eval(Context& ctx, bool) const; \
private: \ private: \
type1 name1; \ type1 name1; \
}; \ }; \
...@@ -172,7 +173,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) { ...@@ -172,7 +173,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
SCRIPT_PARAM_N(type1, str1, name1); \ SCRIPT_PARAM_N(type1, str1, name1); \
return ScriptRule_##funname(name1).eval(ctx); \ return ScriptRule_##funname(name1).eval(ctx); \
} \ } \
ScriptValueP ScriptRule_##funname::eval(Context& ctx) const ScriptValueP ScriptRule_##funname::do_eval(Context& ctx, bool) const
/// Utility for defining a script rule with two parameters /// Utility for defining a script rule with two parameters
#define SCRIPT_RULE_2(funname, type1, name1, type2, name2) \ #define SCRIPT_RULE_2(funname, type1, name1, type2, name2) \
...@@ -199,8 +200,9 @@ inline Type from_script(const ScriptValueP& v, Variable var) { ...@@ -199,8 +200,9 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
: name1(name1), name2(name2) {} \ : name1(name1), name2(name2) {} \
virtual ScriptType type() const { return SCRIPT_FUNCTION; } \ virtual ScriptType type() const { return SCRIPT_FUNCTION; } \
virtual String typeName() const { return _(#funname)_("_rule"); } \ virtual String typeName() const { return _(#funname)_("_rule"); } \
virtual ScriptValueP eval(Context& ctx) const; \
dep \ dep \
protected: \
virtual ScriptValueP do_eval(Context& ctx, bool) const; \
private: \ private: \
type1 name1; \ type1 name1; \
type2 name2; \ type2 name2; \
...@@ -216,7 +218,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) { ...@@ -216,7 +218,7 @@ inline Type from_script(const ScriptValueP& v, Variable var) {
return ScriptRule_##funname(name1, name2).eval(ctx); \ return ScriptRule_##funname(name1, name2).eval(ctx); \
} \ } \
more \ more \
ScriptValueP ScriptRule_##funname::eval(Context& ctx) const ScriptValueP ScriptRule_##funname::do_eval(Context& ctx, bool) const
#define SCRIPT_RULE_2_DEPENDENCIES(name) \ #define SCRIPT_RULE_2_DEPENDENCIES(name) \
ScriptValueP ScriptRule_##name::dependencies(Context& ctx, const Dependency& dep) const ScriptValueP ScriptRule_##name::dependencies(Context& ctx, const Dependency& dep) const
......
...@@ -89,8 +89,8 @@ ScriptType Script::type() const { ...@@ -89,8 +89,8 @@ ScriptType Script::type() const {
String Script::typeName() const { String Script::typeName() const {
return _("function"); return _("function");
} }
ScriptValueP Script::eval(Context& ctx) const { ScriptValueP Script::do_eval(Context& ctx, bool openScope) const {
return ctx.eval(*this); return ctx.eval(*this, openScope);
} }
ScriptValueP Script::dependencies(Context& ctx, const Dependency& dep) const { ScriptValueP Script::dependencies(Context& ctx, const Dependency& dep) const {
return ctx.dependencies(dep, *this); return ctx.dependencies(dep, *this);
...@@ -239,11 +239,12 @@ String Script::dumpInstr(unsigned int pos, Instruction i) const { ...@@ -239,11 +239,12 @@ String Script::dumpInstr(unsigned int pos, Instruction i) const {
const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip) const { const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip) const {
unsigned int initial = instr - &instructions[0]; unsigned int initial = instr - &instructions[0];
for (;instr >= &instructions[0] && for (;instr >= &instructions[0] &&
(to_skip || // we have something to skip (to_skip || (// we have something to skip
instr >= &instructions[1] && ( instr >= &instructions[1] && (
(instr-1)->instr == I_JUMP // always look inside a jump (instr-1)->instr == I_JUMP // always look inside a jump
|| (instr-1)->instr == I_NOP // and skip nops || (instr-1)->instr == I_NOP // and skip nops
) )
)
) ; --instr) { ) ; --instr) {
// skip an instruction // skip an instruction
switch (instr->instr) { switch (instr->instr) {
...@@ -317,7 +318,7 @@ const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip) ...@@ -317,7 +318,7 @@ const Instruction* Script::backtraceSkip(const Instruction* instr, int to_skip)
} }
String Script::instructionName(const Instruction* instr) const { String Script::instructionName(const Instruction* instr) const {
if (instr < &instructions[0] || instr >= &instructions[instructions.size()]) return _("??\?"); if (instr < &instructions[0] || instr >= &instructions[0] + instructions.size()) return _("??\?");
if (instr->instr == I_GET_VAR) { if (instr->instr == I_GET_VAR) {
return variable_to_string((Variable)instr->data); return variable_to_string((Variable)instr->data);
} else if (instr->instr == I_MEMBER_C) { } else if (instr->instr == I_MEMBER_C) {
......
...@@ -165,7 +165,6 @@ class Script : public ScriptValue { ...@@ -165,7 +165,6 @@ class Script : public ScriptValue {
virtual ScriptType type() const; virtual ScriptType type() const;
virtual String typeName() const; virtual String typeName() const;
virtual ScriptValueP eval(Context& ctx) const;
virtual ScriptValueP dependencies(Context& ctx, const Dependency&) const; virtual ScriptValueP dependencies(Context& ctx, const Dependency&) const;
/// Add a jump instruction, later comeFrom should be called on the returned value /// Add a jump instruction, later comeFrom should be called on the returned value
...@@ -194,7 +193,10 @@ class Script : public ScriptValue { ...@@ -194,7 +193,10 @@ class Script : public ScriptValue {
String dumpScript() const; String dumpScript() const;
/// Output an instruction in a human readable format /// Output an instruction in a human readable format
String dumpInstr(unsigned int pos, Instruction i) const; String dumpInstr(unsigned int pos, Instruction i) const;
protected:
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
private: private:
/// Data of the instructions that make up this script /// Data of the instructions that make up this script
vector<Instruction> instructions; vector<Instruction> instructions;
......
...@@ -84,9 +84,12 @@ class ScriptDelayedError : public ScriptValue { ...@@ -84,9 +84,12 @@ class ScriptDelayedError : public ScriptValue {
// these can propagate the error // these can propagate the error
virtual ScriptValueP getMember(const String& name) const; virtual ScriptValueP getMember(const String& name) const;
virtual ScriptValueP dependencyMember(const String& name, const Dependency&) const; virtual ScriptValueP dependencyMember(const String& name, const Dependency&) const;
virtual ScriptValueP eval(Context&) const;
virtual ScriptValueP dependencies(Context&, const Dependency&) const; virtual ScriptValueP dependencies(Context&, const Dependency&) const;
virtual ScriptValueP makeIterator(const ScriptValueP& thisP) const; virtual ScriptValueP makeIterator(const ScriptValueP& thisP) const;
protected:
virtual ScriptValueP do_eval(Context&, bool openScope) const;
private: private:
ScriptError error; // the error message ScriptError error; // the error message
}; };
...@@ -349,7 +352,6 @@ class ScriptClosure : public ScriptValue { ...@@ -349,7 +352,6 @@ class ScriptClosure : public ScriptValue {
virtual ScriptType type() const; virtual ScriptType type() const;
virtual String typeName() const; virtual String typeName() const;
virtual ScriptValueP eval(Context& ctx) const;
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const; virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const;
/// Add a binding /// Add a binding
...@@ -365,6 +367,9 @@ class ScriptClosure : public ScriptValue { ...@@ -365,6 +367,9 @@ class ScriptClosure : public ScriptValue {
/// The default argument bindings /// The default argument bindings
vector<pair<Variable,ScriptValueP> > bindings; vector<pair<Variable,ScriptValueP> > bindings;
protected:
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
private: private:
/// Apply the bindings in a context /// Apply the bindings in a context
void applyBindings(Context& ctx) const; void applyBindings(Context& ctx) const;
...@@ -376,7 +381,10 @@ class ScriptRule : public ScriptValue { ...@@ -376,7 +381,10 @@ class ScriptRule : public ScriptValue {
inline ScriptRule(const ScriptValueP& fun) : fun(fun) {} inline ScriptRule(const ScriptValueP& fun) : fun(fun) {}
virtual ScriptType type() const; virtual ScriptType type() const;
virtual String typeName() const; virtual String typeName() const;
virtual ScriptValueP eval(Context& ctx) const;
protected:
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
private: private:
ScriptValueP fun; ScriptValueP fun;
}; };
......
...@@ -25,7 +25,7 @@ ScriptValue::operator bool() const { throw Script ...@@ -25,7 +25,7 @@ ScriptValue::operator bool() const { throw Script
ScriptValue::operator double() const { throw ScriptErrorConversion(typeName(), _TYPE_("double" )); } ScriptValue::operator double() const { throw ScriptErrorConversion(typeName(), _TYPE_("double" )); }
ScriptValue::operator AColor() const { throw ScriptErrorConversion(typeName(), _TYPE_("color" )); } ScriptValue::operator AColor() const { throw ScriptErrorConversion(typeName(), _TYPE_("color" )); }
ScriptValue::operator wxDateTime() const { throw ScriptErrorConversion(typeName(), _TYPE_("date" )); } ScriptValue::operator wxDateTime() const { throw ScriptErrorConversion(typeName(), _TYPE_("date" )); }
ScriptValueP ScriptValue::eval(Context&) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("function"))); } ScriptValueP ScriptValue::do_eval(Context&, bool) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("function"))); }
ScriptValueP ScriptValue::next(ScriptValueP* key_out) { throw InternalError(_("Can't convert from ")+typeName()+_(" to iterator")); } ScriptValueP ScriptValue::next(ScriptValueP* key_out) { throw InternalError(_("Can't convert from ")+typeName()+_(" to iterator")); }
ScriptValueP ScriptValue::makeIterator(const ScriptValueP&) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("collection"))); } ScriptValueP ScriptValue::makeIterator(const ScriptValueP&) const { return delay_error(ScriptErrorConversion(typeName(), _TYPE_("collection"))); }
int ScriptValue::itemCount() const { throw ScriptErrorConversion(typeName(), _TYPE_("collection")); } int ScriptValue::itemCount() const { throw ScriptErrorConversion(typeName(), _TYPE_("collection")); }
...@@ -113,7 +113,7 @@ int ScriptDelayedError::itemCount() const { throw error; } ...@@ -113,7 +113,7 @@ int ScriptDelayedError::itemCount() const { throw error; }
CompareWhat ScriptDelayedError::compareAs(String&, void const*&) const { throw error; } CompareWhat ScriptDelayedError::compareAs(String&, void const*&) const { throw error; }
ScriptValueP ScriptDelayedError::getMember(const String&) const { return new_intrusive1<ScriptDelayedError>(error); } ScriptValueP ScriptDelayedError::getMember(const String&) const { return new_intrusive1<ScriptDelayedError>(error); }
ScriptValueP ScriptDelayedError::dependencyMember(const String&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); } ScriptValueP ScriptDelayedError::dependencyMember(const String&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); }
ScriptValueP ScriptDelayedError::eval(Context&) const { return new_intrusive1<ScriptDelayedError>(error); } ScriptValueP ScriptDelayedError::do_eval(Context&, bool) const { return new_intrusive1<ScriptDelayedError>(error); }
ScriptValueP ScriptDelayedError::dependencies(Context&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); } ScriptValueP ScriptDelayedError::dependencies(Context&, const Dependency&) const { return new_intrusive1<ScriptDelayedError>(error); }
ScriptValueP ScriptDelayedError::makeIterator(const ScriptValueP& thisP) const { return thisP; } ScriptValueP ScriptDelayedError::makeIterator(const ScriptValueP& thisP) const { return thisP; }
...@@ -370,7 +370,9 @@ class ScriptNil : public ScriptValue { ...@@ -370,7 +370,9 @@ class ScriptNil : public ScriptValue {
virtual GeneratedImageP toImage(const ScriptValueP&) const { virtual GeneratedImageP toImage(const ScriptValueP&) const {
return new_intrusive<BlankImage>(); return new_intrusive<BlankImage>();
} }
virtual ScriptValueP eval(Context& ctx) const {
protected:
virtual ScriptValueP do_eval(Context& ctx, bool) const {
// nil(input) == input // nil(input) == input
return ctx.getVariable(SCRIPT_VAR_input); return ctx.getVariable(SCRIPT_VAR_input);
} }
...@@ -513,10 +515,10 @@ ScriptValueP ScriptClosure::simplify() { ...@@ -513,10 +515,10 @@ ScriptValueP ScriptClosure::simplify() {
return fun->simplifyClosure(*this); return fun->simplifyClosure(*this);
} }
ScriptValueP ScriptClosure::eval(Context& ctx) const { ScriptValueP ScriptClosure::do_eval(Context& ctx, bool openScope) const {
LocalScope scope(ctx); scoped_ptr<LocalScope> scope(openScope ? new LocalScope(ctx) : nullptr);
applyBindings(ctx); applyBindings(ctx);
return fun->eval(ctx); return fun->eval(ctx, openScope);
} }
ScriptValueP ScriptClosure::dependencies(Context& ctx, const Dependency& dep) const { ScriptValueP ScriptClosure::dependencies(Context& ctx, const Dependency& dep) const {
LocalScope scope(ctx); LocalScope scope(ctx);
...@@ -534,6 +536,6 @@ void ScriptClosure::applyBindings(Context& ctx) const { ...@@ -534,6 +536,6 @@ void ScriptClosure::applyBindings(Context& ctx) const {
ScriptType ScriptRule::type() const { return SCRIPT_FUNCTION; } ScriptType ScriptRule::type() const { return SCRIPT_FUNCTION; }
String ScriptRule::typeName() const { return fun->typeName() + _(" rule"); } String ScriptRule::typeName() const { return fun->typeName() + _(" rule"); }
ScriptValueP ScriptRule::eval(Context& ctx) const { ScriptValueP ScriptRule::do_eval(Context& ctx, bool openScope) const {
return ctx.makeClosure(fun); return ctx.makeClosure(fun);
} }
...@@ -97,7 +97,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete { ...@@ -97,7 +97,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete {
virtual ScriptValueP dependencyName(const ScriptValue& container, const Dependency&) const; virtual ScriptValueP dependencyName(const ScriptValue& container, const Dependency&) const;
/// Evaluate this value (if it is a function) /// Evaluate this value (if it is a function)
virtual ScriptValueP eval(Context&) const; ScriptValueP eval(Context& ctx, bool openScope = true) const {
return do_eval(ctx, openScope);
}
/// Mark the scripts that this function depends on /// Mark the scripts that this function depends on
/** Return value is an abstract version of the return value of eval */ /** Return value is an abstract version of the return value of eval */
virtual ScriptValueP dependencies(Context&, const Dependency&) const; virtual ScriptValueP dependencies(Context&, const Dependency&) const;
...@@ -117,6 +119,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete { ...@@ -117,6 +119,9 @@ class ScriptValue : public IntrusivePtrBaseWithDelete {
virtual int itemCount() const; virtual int itemCount() const;
/// Get a member at the given index /// Get a member at the given index
virtual ScriptValueP getIndex(int index) const; virtual ScriptValueP getIndex(int index) const;
protected:
virtual ScriptValueP do_eval(Context& ctx, bool openScope) const;
}; };
extern ScriptValueP script_nil; ///< The preallocated nil value extern ScriptValueP script_nil; ///< The preallocated nil value
......
...@@ -513,7 +513,6 @@ IMPLEMENT_REFLECTION(Packaged) { ...@@ -513,7 +513,6 @@ IMPLEMENT_REFLECTION(Packaged) {
Packaged::Packaged() Packaged::Packaged()
: position_hint(100000) : position_hint(100000)
, fully_loaded(true) , fully_loaded(true)
, vcs(nullptr)
{} {}
InputStreamP Packaged::openIconFile() { InputStreamP Packaged::openIconFile() {
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#include <util/dynamic_arg.hpp> #include <util/dynamic_arg.hpp>
#include <util/error.hpp> #include <util/error.hpp>
#include <util/file_utils.hpp> #include <util/file_utils.hpp>
#include <util/io/vcs.hpp> #include <util/vcs.hpp>
class Package; class Package;
class wxFileInputStream; class wxFileInputStream;
...@@ -143,7 +143,7 @@ class Package : public IntrusivePtrVirtualBase { ...@@ -143,7 +143,7 @@ class Package : public IntrusivePtrVirtualBase {
} }
protected: protected:
// TODO: I dislike this very much. There ought to be a better way. // TODO: I dislike putting this here very much. There ought to be a better way.
virtual VCSP getVCS() { return new_intrusive<VCS>(); } virtual VCSP getVCS() { return new_intrusive<VCS>(); }
// --------------------------------------------------- : Private stuff // --------------------------------------------------- : Private stuff
...@@ -219,7 +219,6 @@ class Packaged : public Package { ...@@ -219,7 +219,6 @@ class Packaged : public Package {
String icon_filename; ///< Filename of icon to use in package lists String icon_filename; ///< Filename of icon to use in package lists
vector<PackageDependencyP> dependencies; ///< Dependencies of this package vector<PackageDependencyP> dependencies; ///< Dependencies of this package
int position_hint; ///< A hint for the package list int position_hint; ///< A hint for the package list
VCSP vcs; ///< The version control system to use
/// Get an input stream for the package icon, if there is any /// Get an input stream for the package icon, if there is any
InputStreamP openIconFile(); InputStreamP openIconFile();
...@@ -243,10 +242,6 @@ class Packaged : public Package { ...@@ -243,10 +242,6 @@ class Packaged : public Package {
} }
protected: protected:
virtual VCSP getVCS() {
return vcs;
}
/// filename of the data file, and extension of the package file /// filename of the data file, and extension of the package file
virtual String typeName() const = 0; virtual String typeName() const = 0;
/// Can be overloaded to do validation after loading /// Can be overloaded to do validation after loading
......
...@@ -20,7 +20,7 @@ void Regex::assign(const String& code) { ...@@ -20,7 +20,7 @@ void Regex::assign(const String& code) {
} catch (const boost::regex_error& e) { } catch (const boost::regex_error& e) {
/// TODO: be more precise /// TODO: be more precise
throw ScriptError(String::Format(_("Error while compiling regular expression: '%s'\nAt position: %d\n%s"), throw ScriptError(String::Format(_("Error while compiling regular expression: '%s'\nAt position: %d\n%s"),
code.c_str(), e.position(), String(e.what(), IF_UNICODE(wxConvUTF8,String::npos)))); code.c_str(), e.position(), String(e.what(), IF_UNICODE(wxConvUTF8,String::npos)).c_str()));
} }
} }
......
...@@ -12,11 +12,13 @@ case $UID in ...@@ -12,11 +12,13 @@ case $UID in
0) 0)
INSTALL_DIR='/usr/local/share/magicseteditor/'; INSTALL_DIR='/usr/local/share/magicseteditor/';
EXEC_SYMLINK='/usr/local/bin/magicseteditor'; EXEC_SYMLINK='/usr/local/bin/magicseteditor';
FONTS_DIR='/usr/local/share/fonts/';; FONTS_DIR='/usr/local/share/fonts/';
CHMOD='chmod +x';;
*) *)
INSTALL_DIR='$HOME/.magicseteditor/'; INSTALL_DIR='$HOME/.magicseteditor/';
EXEC_SYMLINK='$HOME/bin/magicseteditor'; EXEC_SYMLINK='$HOME/bin/magicseteditor';
FONTS_DIR='$HOME/.fonts/';; FONTS_DIR='$HOME/.fonts/';
CHMOD='chmod u+x';;
esac esac
if [ "$MSE_INSTALL_DIR" != "" ]; then if [ "$MSE_INSTALL_DIR" != "" ]; then
...@@ -49,5 +51,6 @@ echo "Installing..."; ...@@ -49,5 +51,6 @@ echo "Installing...";
mkdir "$INSTALL_DIR"; mkdir "$INSTALL_DIR";
cp -r program/* "$INSTALL_DIR"; cp -r program/* "$INSTALL_DIR";
$CHMOD "$INSTALL_DIR/magicseteditor";
cp fonts/* "$FONTS_DIR"; cp fonts/* "$FONTS_DIR";
ln -s "$INSTALL_DIR/magicseteditor" "$EXEC_SYMLINK" ln -s "$INSTALL_DIR/magicseteditor" "$EXEC_SYMLINK"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment