Compatibility updates; Boost Regex is now statically linked, changed to <hunspell/hunspell.hxx>

git-svn-id: svn://svn.code.sf.net/p/magicseteditor/code/trunk@1286 0fc631ac-6414-0410-93d0-97cfa31319b6
This commit is contained in:
coppro
2009-01-02 21:52:08 +00:00
parent ab5ea48a9d
commit 46dda0ef30
7 changed files with 397 additions and 309 deletions
+4 -2
View File
@@ -13,9 +13,11 @@ AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = magicseteditor
AM_CXXFLAGS = @WX_CXXFLAGS@ \$(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
AM_LDFLAGS = @WX_LIBS@ \$(BOOST_LDFLAGS) \$(BOOST_REGEX_LIB)
AM_LDFLAGS = @WX_LIBS@ \$(BOOST_LDFLAGS)
magicseteditor_SOURCES =
magicseteditor_LDADD = \$(BOOST_REGEX_LIB)
magicseteditor_SOURCES =
# The script used to generate is MakeAM.sh " > Makefile.am;
+5 -3
View File
@@ -205,7 +205,8 @@ am_magicseteditor_OBJECTS = ./src/util/version.$(OBJEXT) \
./src/cli/text_io_handler.$(OBJEXT) \
./src/code_template.$(OBJEXT)
magicseteditor_OBJECTS = $(am_magicseteditor_OBJECTS)
magicseteditor_LDADD = $(LDADD)
am__DEPENDENCIES_1 =
magicseteditor_DEPENDENCIES = $(am__DEPENDENCIES_1)
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
@@ -334,9 +335,10 @@ top_srcdir = @top_srcdir@
# This flag allows us to use subdirectories:
AUTOMAKE_OPTIONS = subdir-objects
AM_CXXFLAGS = @WX_CXXFLAGS@ $(BOOST_CXXFLAGS) -DUNICODE -I . -Wall
AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS) $(BOOST_REGEX_LIB)
AM_LDFLAGS = @WX_LIBS@ $(BOOST_LDFLAGS)
magicseteditor_LDADD = $(BOOST_REGEX_LIB)
# The script used to generate is MakeAM.sh
# The script used to generate is MakeAM.sh
magicseteditor_SOURCES = ./src/util/version.cpp \
./src/util/alignment.cpp ./src/util/rotation.cpp \
./src/util/tagged_string.cpp ./src/util/spell_checker.cpp \
Vendored
+351 -279
View File
@@ -690,14 +690,14 @@ AMDEPBACKSLASH
CXXDEPMODE
am__fastdepCXX_TRUE
am__fastdepCXX_FALSE
BOOST_CPPFLAGS
BOOST_LDFLAGS
CC
CFLAGS
ac_ct_CC
CCDEPMODE
am__fastdepCC_TRUE
am__fastdepCC_FALSE
BOOST_CPPFLAGS
BOOST_LDFLAGS
BOOST_REGEX_LIB
WX_CONFIG_PATH
WX_CPPFLAGS
@@ -3033,281 +3033,6 @@ fi
# Do not pass -O2, because that causes failures for now.
CXXFLAGS=-g
# Checks for libraries.
# Check for Boost
# Check whether --with-boost was given.
if test "${with_boost+set}" = set; then
withval=$with_boost;
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
else
want_boost="yes"
fi
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=1.36.0
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`
{ echo "$as_me:$LINENO: checking for boostlib >= $boost_lib_version_req" >&5
echo $ECHO_N "checking for boostlib >= $boost_lib_version_req... $ECHO_C" >&6; }
succeeded=no
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 ; 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
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <boost/version.hpp>
int
main ()
{
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
succeeded=yes
found_system=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
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 ; 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"
BOOST_LDFLAGS="-L$best_path/lib"
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" ; then
{ echo "$as_me:$LINENO: We will use a staged boost library from $BOOST_ROOT" >&5
echo "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;}
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_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <boost/version.hpp>
int
main ()
{
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
succeeded=yes
found_system=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
{ { echo "$as_me:$LINENO: 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." >&5
echo "$as_me: 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." >&2;}
{ (exit 1); exit 1; }; }
else
{ echo "$as_me:$LINENO: Your boost libraries seems to old (version $_version)." >&5
echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
fi
else
cat >>confdefs.h <<\_ACEOF
#define HAVE_BOOST
_ACEOF
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4094,6 +3819,352 @@ fi
{ echo "$as_me:$LINENO: checking for Hunspell_create in -lhunspell" >&5
echo $ECHO_N "checking for Hunspell_create in -lhunspell... $ECHO_C" >&6; }
if test "${ac_cv_lib_hunspell_Hunspell_create+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lhunspell $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
#ifdef __cplusplus
extern "C"
#endif
char Hunspell_create ();
int
main ()
{
return Hunspell_create ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (ac_try="$ac_link"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_link") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_c_werror_flag" ||
test ! -s conftest.err
} && test -s conftest$ac_exeext &&
$as_test_x conftest$ac_exeext; then
ac_cv_lib_hunspell_Hunspell_create=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_hunspell_Hunspell_create=no
fi
rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_hunspell_Hunspell_create" >&5
echo "${ECHO_T}$ac_cv_lib_hunspell_Hunspell_create" >&6; }
if test $ac_cv_lib_hunspell_Hunspell_create = yes; then
cat >>confdefs.h <<_ACEOF
#define HAVE_LIBHUNSPELL 1
_ACEOF
LIBS="-lhunspell $LIBS"
fi
# Check for Boost
# Check whether --with-boost was given.
if test "${with_boost+set}" = set; then
withval=$with_boost;
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
else
want_boost="yes"
fi
if test "x$want_boost" = "xyes"; then
boost_lib_version_req=1.37.0
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`
{ echo "$as_me:$LINENO: checking for boostlib >= $boost_lib_version_req" >&5
echo $ECHO_N "checking for boostlib >= $boost_lib_version_req... $ECHO_C" >&6; }
succeeded=no
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 ; 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
CPPFLAGS_SAVED="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $BOOST_CPPFLAGS"
export CPPFLAGS
LDFLAGS_SAVED="$LDFLAGS"
LDFLAGS="$LDFLAGS $BOOST_LDFLAGS"
export LDFLAGS
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <boost/version.hpp>
int
main ()
{
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
succeeded=yes
found_system=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
if test "x$succeeded" != "xyes"; then
_version=0
if test "$ac_boost_path" != ""; then
BOOST_LDFLAGS="-L$ac_boost_path/lib"
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 ; 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"
BOOST_LDFLAGS="-L$best_path/lib"
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" ; then
{ echo "$as_me:$LINENO: We will use a staged boost library from $BOOST_ROOT" >&5
echo "$as_me: We will use a staged boost library from $BOOST_ROOT" >&6;}
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_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_cxx_compiler_gnu
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <boost/version.hpp>
int
main ()
{
#if BOOST_VERSION >= $WANT_BOOST_VERSION
// Everything is okay
#else
# error Boost version is too old
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (ac_try="$ac_compile"
case "(($ac_try" in
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
*) ac_try_echo=$ac_try;;
esac
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
(eval "$ac_compile") 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } && {
test -z "$ac_cxx_werror_flag" ||
test ! -s conftest.err
} && test -s conftest.$ac_objext; then
{ echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6; }
succeeded=yes
found_system=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
fi
if test "$succeeded" != "yes" ; then
if test "$_version" = "0" ; then
{ { echo "$as_me:$LINENO: 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." >&5
echo "$as_me: 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." >&2;}
{ (exit 1); exit 1; }; }
else
{ echo "$as_me:$LINENO: Your boost libraries seems to old (version $_version)." >&5
echo "$as_me: Your boost libraries seems to old (version $_version)." >&6;}
fi
else
cat >>confdefs.h <<\_ACEOF
#define HAVE_BOOST
_ACEOF
fi
CPPFLAGS="$CPPFLAGS_SAVED"
LDFLAGS="$LDFLAGS_SAVED"
fi
# Check whether --with-boost-regex was given.
if test "${with_boost_regex+set}" = set; then
@@ -4340,6 +4411,7 @@ echo "$as_me: error: Could not link against $ax_lib !" >&2;}
LDFLAGS="$LDFLAGS_SAVED"
fi
BOOST_REGEX_LIB="-Wl,-Bstatic $BOOST_REGEX_LIB -Wl,-Bdynamic"
# Check for wxWidgets
@@ -6956,14 +7028,14 @@ AMDEPBACKSLASH!$AMDEPBACKSLASH$ac_delim
CXXDEPMODE!$CXXDEPMODE$ac_delim
am__fastdepCXX_TRUE!$am__fastdepCXX_TRUE$ac_delim
am__fastdepCXX_FALSE!$am__fastdepCXX_FALSE$ac_delim
BOOST_CPPFLAGS!$BOOST_CPPFLAGS$ac_delim
BOOST_LDFLAGS!$BOOST_LDFLAGS$ac_delim
CC!$CC$ac_delim
CFLAGS!$CFLAGS$ac_delim
ac_ct_CC!$ac_ct_CC$ac_delim
CCDEPMODE!$CCDEPMODE$ac_delim
am__fastdepCC_TRUE!$am__fastdepCC_TRUE$ac_delim
am__fastdepCC_FALSE!$am__fastdepCC_FALSE$ac_delim
BOOST_CPPFLAGS!$BOOST_CPPFLAGS$ac_delim
BOOST_LDFLAGS!$BOOST_LDFLAGS$ac_delim
BOOST_REGEX_LIB!$BOOST_REGEX_LIB$ac_delim
WX_CONFIG_PATH!$WX_CONFIG_PATH$ac_delim
WX_CPPFLAGS!$WX_CPPFLAGS$ac_delim
+3 -1
View File
@@ -18,10 +18,12 @@ AC_PROG_CXX
# Do not pass -O2, because that causes failures for now.
CXXFLAGS=-g
# Checks for libraries.
AC_CHECK_LIB([hunspell],[Hunspell_create])
# Check for Boost
AX_BOOST_BASE([1.36.0])
AX_BOOST_BASE([1.37.0])
AX_BOOST_REGEX
BOOST_REGEX_LIB="-Wl,-Bstatic $BOOST_REGEX_LIB -Wl,-Bdynamic"
# Check for wxWidgets
AM_OPTIONS_WXCONFIG
+15 -5
View File
@@ -13,7 +13,9 @@
#include <script/script.hpp>
#include <script/context.hpp>
#ifndef USE_SCRIPT_PROFILING
#define USE_SCRIPT_PROFILING 1
#endif
#if USE_SCRIPT_PROFILING
@@ -23,7 +25,7 @@ DECLARE_POINTER_TYPE(FunctionProfile);
#ifdef WIN32
typedef LONGLONG ProfileTime;
inline ProfileTime timer_now() {
LARGE_INTEGER i;
QueryPerformanceCounter(&i);
@@ -34,17 +36,25 @@ DECLARE_POINTER_TYPE(FunctionProfile);
QueryPerformanceFrequency(&i);
return i.QuadPart;
}
inline const char * mangled_name(const type_info& t) {
return t.raw_name();
}
#else
// clock() has nanosecond resolution on Linux
// on any other platform, stil the best way.
typedef clock_t ProfileTime;
inline ProfileTime timer_now() {
return clock();
}
inline ProfileTime timer_resolution() {
return CLOCKS_PER_SEC;
}
inline const char * mangled_name(const type_info& t) {
return t.name();
}
#endif
/// Simple execution timer
@@ -66,17 +76,17 @@ class Timer {
class FunctionProfile : public IntrusivePtrBase<FunctionProfile> {
public:
FunctionProfile(const String& name) : name(name), time_ticks(0), calls(0) {}
String name;
ProfileTime time_ticks;
UInt calls;
/// for each id, called children
/** we (ab)use the fact that all pointers are even to store both pointers and ids */
map<size_t,FunctionProfileP> children;
/// The children, sorted by time
void get_children(vector<FunctionProfileP>& out) const;
/// Time in seconds
inline double time() const { return time_ticks / (double)timer_resolution(); }
inline double avg_time() const { return time() / calls; }
+12 -12
View File
@@ -69,9 +69,9 @@ template <typename T> inline String to_code(const intrusive_ptr<T>& p) {
class ScriptDelayedError : public ScriptValue {
public:
inline ScriptDelayedError(const ScriptError& error) : error(error) {}
virtual ScriptType type() const;// { return SCRIPT_ERROR; }
// all of these throw
virtual String typeName() const;
virtual operator String() const;
@@ -105,7 +105,7 @@ struct ScriptIterator : public ScriptValue {
virtual ScriptType type() const;// { return SCRIPT_ITERATOR; }
virtual String typeName() const;// { return "iterator"; }
virtual CompareWhat compareAs(String&, void const*&) const; // { return COMPARE_NO; }
/// Return the next item for this iterator, or ScriptValueP() if there is no such item
virtual ScriptValueP next(ScriptValueP* key_out = nullptr) = 0;
virtual ScriptValueP makeIterator(const ScriptValueP& thisP) const;
@@ -128,7 +128,7 @@ class ScriptCollectionBase : public ScriptValue {
// Iterator over a collection
template <typename Collection>
class ScriptCollectionIterator : public ScriptIterator {
public:
public:
ScriptCollectionIterator(const Collection* col) : pos(0), col(col) {}
virtual ScriptValueP next(ScriptValueP* key_out) {
if (pos < col->size()) {
@@ -231,7 +231,7 @@ class ScriptCustomCollection : public ScriptCollectionBase {
compare_ptr = this;
return COMPARE_AS_POINTER;
}
/// The collection as a list (contains only the values that don't have a key)
vector<ScriptValueP> value;
/// The collection as a map (contains only the values that have a key)
@@ -255,7 +255,7 @@ class ScriptConcatCollection : public ScriptCollectionBase {
compare_ptr = this;
return COMPARE_AS_POINTER;
}
private:
ScriptValueP a,b;
friend class ScriptConcatCollectionIterator;
@@ -282,7 +282,7 @@ class ScriptObject : public ScriptValue {
virtual ScriptValueP getMember(const String& name) const {
#if USE_SCRIPT_PROFILING
Timer t;
Profiler prof(t, (void*)typeid(T).raw_name(), _("get member of ") + type_name(*value));
Profiler prof(t, (void*)mangled_name(typeid(T)), _("get member of ") + type_name(*value));
#endif
GetMember gm(name);
gm.handle(*value);
@@ -346,25 +346,25 @@ class ScriptObject : public ScriptValue {
class ScriptClosure : public ScriptValue {
public:
ScriptClosure(ScriptValueP fun) : fun(fun) {}
virtual ScriptType type() const;
virtual String typeName() const;
virtual ScriptValueP eval(Context& ctx) const;
virtual ScriptValueP dependencies(Context& ctx, const Dependency& dep) const;
/// Add a binding
void addBinding(Variable v, const ScriptValueP& value);
/// Is there a binding for the given variable? If so, retrieve it
ScriptValueP getBinding(Variable v) const;
/// Try to simplify this closure, returns a value if successful
ScriptValueP simplify();
/// The wrapped function
ScriptValueP fun;
/// The default argument bindings
vector<pair<Variable,ScriptValueP> > bindings;
private:
/// Apply the bindings in a context
void applyBindings(Context& ctx) const;
+7 -7
View File
@@ -4,13 +4,13 @@
//| License: GNU General Public License 2 or later (see file COPYING) |
//+----------------------------------------------------------------------------+
#ifndef HEADER_UTIL_SPELL_CHECKER
#define HEADER_UTIL_SPELL_CHECKER
#ifndef HEADER_UTIL_SPELL_CHECKER
#define HEADER_UTIL_SPELL_CHECKER
// ----------------------------------------------------------------------------- : Includes
#include <util/prec.hpp>
#include "hunspell.hxx"
#include "hunspell/hunspell.hxx"
DECLARE_POINTER_TYPE(SpellChecker);
@@ -33,20 +33,20 @@ class SpellChecker : public Hunspell, public IntrusivePtrBase<SpellChecker> {
static SpellChecker& get(const String& filename, const String& language);
/// Destroy all cached SpellChecker objects
static void destroyAll();
/// Check the spelling of a single word
bool spell(const String& word);
/// Check the spelling of a single word, ignore punctuation
bool spell_with_punctuation(const String& word);
/// Give spelling suggestions
void suggest(const String& word, vector<String>& suggestions_out);
private:
/// Convert between String and dictionary encoding
wxCSConv encoding;
bool convert_encoding(const String& word, CharBuffer& out);
SpellChecker(const char* aff_path, const char* dic_path);
static map<String,SpellCheckerP> spellers; //< Cached checkers for each language
};