## -V: Workaround for python
changequote(<<, >>)#dnl
+
## Assume and hunt for dotted version multiplet.
## use eval trickery, because we cannot use multi-level $() instead of ``
## for compatibility reasons.
- ## FIXME: what systems still do not have $() in /bin/sh?
- eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\.[0-9]' \
+
+ ## grab the first version number in --version output.
+ eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '\(^\| \)[0-9][0-9]*\.[0-9]' \
| head -n 1 \
- | sed -e 's/.*[^-.0-9]\([0-9][0-9]*\.[0-9][.0-9]*\).*/\1/' \
- -e 's/^[^.0-9]*//' -e 's/[^.0-9]*$//'\`\"
+ | tr ' ' '\n' | sed 's/\([0-9][0-9]*\.[0-9][0-9.]*\).*/\1/g' | grep '\(^\| \)[0-9][0-9]*\.[0-9]' | head -n 1\`\"
+
if test -z "$_ver"; then
## If empty, try date [fontforge]
eval _ver=\"\`("$1" --version || "$1" -V) 2>&1 | grep '[0-9]\{6,8\}' \
if test "$optimise_b" = yes; then
AC_DEFINE(NDEBUG)
DEFINES="$DEFINES -DNDEBUG"
- OPTIMIZE="-O2 -finline-functions"
+ OPTIMIZE=" -O2 -finline-functions"
fi
if test $profile_b = yes; then
# If -pipe requested, test if it works and add to CFLAGS.
if test "$pipe_b" = yes; then
save_cflags="$CFLAGS"
- CFLAGS="-pipe $CFLAGS";
+ CFLAGS=" -pipe $CFLAGS";
AC_CACHE_CHECK([whether compiler understands -pipe],
[stepmake_cflags_pipe],
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[/* -pipe test */]])],
alpha*-*-*)
dnl should do compile test?
AC_MSG_RESULT(-mieee)
- CFLAGS="-mieee $CFLAGS"
+ CFLAGS=" -mieee $CFLAGS"
;;
*)
AC_MSG_RESULT([none])
build_package_datadir=$ugh_ugh_autoconf250_builddir/out$CONFIGSUFFIX/share/$package
- DATADIR=`echo ${datadir} | sed "s!\\\${prefix}!$presome!"`
+ DATADIR=`echo ${datadir} | sed "s!\\\${datarootdir}!${prefix}/share!"`
+ DATADIR=`echo ${DATADIR} | sed "s!\\\${prefix}!$presome!"`
BUILD_PACKAGE_DATADIR=`echo ${build_package_datadir} | sed "s!\\\${prefix}!$presome!"`
AC_SUBST(datadir)
+ AC_SUBST(datarootdir)
AC_SUBST(build_package_datadir)
AC_DEFINE_UNQUOTED(DATADIR, ["${DATADIR}"])
AC_DEFINE_UNQUOTED(BUILD_PACKAGE_DATADIR, ["${BUILD_PACKAGE_DATADIR}"])
mkdir -p $(dirname $mf)
cat <<EOF | $PYTHON - > $mf
print 'depth=' + ('../' * ( $d-1 ) )
-print 'include \$(depth)/config.make'
+print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make'
print 'include \$(configure-srcdir)/$mf'
EOF
done
for mf in `cd $srcdir ; find -maxdepth $d -mindepth $d -name '*.make' | grep -v config.make `; do
mkdir -p $(dirname $mf)
cat <<EOF | $PYTHON - > $mf
-print 'include \$(depth)/config.make'
+print 'include \$(depth)/config\$(if \$(conf),-\$(conf),).make'
print 'include \$(configure-srcdir)/$mf'
EOF
done
cat <<EOF > GNUmakefile
depth = ./
-include config.make
+include config\$(if \$(conf),-\$(conf),).make
include \$(configure-srcdir)/GNUmakefile.in
EOF
AC_SUBST(VPATH)
using namespace std;
#include <FlexLexer.h>
EOF
- FLEXLEXER_FILE=`$CXX -E conftest.cc | \
+ FLEXLEXER_FILE=`eval $ac_cpp conftest.cc | \
sed 's!# 1 "\(.*FlexLexer.h\)"!@FLEXLEXER@\1@@!g' | grep '@@' | \
- sed 's!.*@FLEXLEXER@\(.*\)@@.*$!\1!g' ` >& /dev/null
+ sed 's!.*@FLEXLEXER@\(.*\)@@.*$!\1!g' ` 1> /dev/null 2> /dev/null
rm conftest.cc
AC_SUBST(FLEXLEXER_FILE)
AC_MSG_RESULT($FLEXLEXER_FILE)
AC_MSG_CHECKING(builddir)
ugh_ugh_autoconf250_builddir="`pwd`"
- if test "$srcdir" = "."; then
+
+ here_dir=$(cd . && pwd)
+ full_src_dir=$(cd $srcdir && pwd)
+
+ if test "$full_src_dir" = "$here_dir"; then
srcdir_build=yes
else
srcdir_build=no
CONFIGSUFFIX=
AC_ARG_ENABLE(config,
[ --enable-config=CONF put settings in config-CONF.make and config-CONF.h;
- do \`make conf=CONF' to get output in ./out-CONF],
+ do `make conf=CONF' to get output in ./out-CONF],
[CONFIGURATION=$enableval])
- ##'
+ ##'`#
test -n "$CONFIGURATION" && CONFIGSUFFIX="-$CONFIGURATION"
CONFIGFILE=config$CONFIGSUFFIX
LN=ln
LN_S='ln -s'
ZIP="zip -r -9"
- INSTALL="\$(SHELL) \$(stepdir)/../bin/install-sh -c"
AC_SUBST(program_prefix)
AC_SUBST(program_suffix)
AC_SUBST(ZIP)
AC_SUBST(LN)
AC_SUBST(LN_S)
- AC_SUBST(INSTALL)
AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
AC_SUBST(DIRSEP)
])
-AC_DEFUN(STEPMAKE_KPATHSEA, [
-
- AC_ARG_WITH(kpathsea-include,
- [ --with-kpathsea-include=DIR
- location of the kpathsea include dir],[
- if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_WARN(Usage: --with-kpathsea-include=includedir)
- else
- CPPFLAGS="$CPPFLAGS -I${withval}"
- fi
- ])
-
- AC_ARG_WITH(kpathsea-lib,
- [ --with-kpathsea-lib=DIR location of the kpathsea lib dir],[
- if test "$withval" = "yes" -o "$withval" = "no"; then
- AC_MSG_WARN(Usage: --with-kpathsea-lib=libdir)
- else
- LDFLAGS="$LDFLAGS -L${withval}"
- fi
- ])
-
- kpathsea_b=yes
- #FIXME --with-xxx is meant for specifying a PATH too,
- # so this should read: --enable-kpathsea,
- # or --with-kpathsea-include=PATH --with-kpathsea-lib=PATH
- AC_ARG_WITH(kpathsea,
- [ --with-kpathsea use kpathsea lib. Default: on],
- [kpathsea_b=$with_kpathsea])
-
- save_LIBS="$LIBS"
- if test "$kpathsea_b" != "no"; then
- AC_CHECK_HEADERS([kpathsea/kpathsea.h],,kpathsea_b=no)
- AC_CHECK_LIB(kpathsea, kpse_find_file)
- AC_CHECK_FUNCS(kpse_find_file,,kpathsea_b=no)
- if test "$kpathsea_b" = "no"; then
- STEPMAKE_ADD_ENTRY(OPTIONAL, $warn)
- fi
- fi
-
- save_CFLAGS="$CFLAGS"
- CFLAGS=`echo "-shared $CFLAGS" | sed -e 's/ -g//'`
- AC_MSG_CHECKING([for shared libkpathsea])
- AC_TRY_LINK([#include <kpathsea/kpathsea.h>],
- [kpse_var_expand ("\$TEXMF");],
- [have_libkpathsea_so=maybe;
- shared_size=`wc -c conftest$ac_exeext`;
- shared_size=`echo $shared_size | sed -e 's/ .*//g'`],
- [have_libkpathsea_so=no])
-
- if test "$have_libkpathsea_so" = "maybe"; then
- if test "$shared_size" -lt 40000 ; then
- have_libkpathsea_so=yes
- else
- have_libkpathsea_so=no
- fi
- fi
-
- AC_MSG_RESULT($have_libkpathsea_so)
- if test "$have_libkpathsea_so" = "yes"; then
- AC_DEFINE(HAVE_LIBKPATHSEA_SO)
- fi
- CFLAGS="$save_CFLAGS"
-
- KPATHSEA_LIBS="$LIBS"
- LIBS="$save_LIBS"
- AC_MSG_CHECKING(whether to use kpathsea)
- if test "$kpathsea_b" != no; then
- AC_MSG_RESULT(yes)
- KPATHSEA=1
- else
- AC_MSG_RESULT(no)
- KPATHSEA=0
- fi
-
- AC_SUBST(KPATHSEA)
- AC_SUBST(KPATHSEA_LIBS)
- AC_SUBST(HAVE_LIBKPATHSEA_SO, $have_libkpathsea_so)
- AC_DEFINE_UNQUOTED(KPATHSEA, $KPATHSEA)
-])
-
-
AC_DEFUN(STEPMAKE_LIB, [
STEPMAKE_PROGS(AR, ar, $1)
AC_PROG_RANLIB
# with/enable ??
AC_ARG_WITH(localedir,
- [ --with-localedir=LOCALE use LOCALE as locale dir. Default:
- PREFIX/share/locale ],
+ [ --with-localedir=DIR location of locales. Default: PREFIX/share/locale ],
localedir=$with_localedir,
localedir='${prefix}/share/locale')
if test -n "$pv"; then
STEPMAKE_ADD_ENTRY($1, $pv)
fi
+ # clear cached value since arg 2 might point us to a new binary
+ unset ac_cv_path_PYTHON
+
AC_PATH_PROG(PYTHON, $PYTHON)
AC_SUBST(PYTHON)
])
])
AC_ARG_WITH(python-lib,
- [ --with-python-lib=NAME name of the python lib],[
+ [ --with-python-lib=NAME name of the python lib],[
if test "$withval" = "yes" -o "$withval" = "no"; then
AC_MSG_WARN(Usage: --with-python-lib=name)
else
fi
])
- if test "$cross_compiling" = "no" -a -z "$PYTHON_CFLAGS"; then
+ AC_CHECK_PROGS(PYTHON_CONFIG, python-config, no)
+
+ if test -z "$PYTHON_CFLAGS" -a "$PYTHON_CONFIG" != "no"; then
+ # Clean out junk: http://bugs.python.org/issue3290
+ # Python headers may need some -f* flags, leave them in.
+ PYTHON_CFLAGS=`$PYTHON_CONFIG --cflags | sed -e 's/ -\(W\|D\|O\|m\)\(\w\|-\|=\|,\)\+//g'`
+ PYTHON_LDFLAGS=`$PYTHON_CONFIG --ldflags`
+ fi
+
+ if test -z "$PYTHON_CFLAGS" -a "$cross_compiling" = "no"; then
changequote(<<, >>)#dnl
# alternatively, for python >= 2.0
# 'import sys, distutils.sysconfig; sys.stdout.write (distutils.sysconfig.get_python_inc ())'
fi
])
+
+
+AC_DEFUN(STEPMAKE_STL_DATA_METHOD, [
+ AC_LANG_PUSH(C++)
+ AC_CACHE_CHECK([for stl.data () method],
+ [stepmake_stl_data_method],
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
+#include <vector>
+using namespace std;
+vector <int> v;
+void *p = v.data ();
+]])],
+ [stepmake_stl_data_method=yes],
+ [stepmake_stl_data_method=no]))
+ if test $stepmake_stl_data_method = yes; then
+ AC_DEFINE(HAVE_STL_DATA_METHOD, 1, [define if stl classes have data () method])
+ fi
+ AC_LANG_POP(C++)
+])
+
+
AC_DEFUN(STEPMAKE_TEXMF_DIRS, [
# ugh
STEPMAKE_PROGS(KPSEWHICH, kpsewhich, OPTIONAL)
AC_DEFUN(STEPMAKE_TEXMF, [
STEPMAKE_PROGS(METAFONT, mf-nowin mf mfw mfont, $1)
+ STEPMAKE_PROGS(METAPOST, mpost, $1)
# STEPMAKE_PROGS(INIMETAFONT, inimf inimfont "$METAFONT -ini", $1)
AC_MSG_CHECKING(for working metafont mode)
AC_CYGWIN
AC_MINGW32
- if test "$CYGWIN" == "yes"; then
+ if test "$CYGWIN" = "yes"; then
LN_S='cp -r' # Cygwin symbolic links do not work for native apps.
program_suffix=.exe
INSTALL="\$(SHELL) \$(stepdir)/../bin/install-dot-exe.sh -c"
- elif test "$MINGW32" == "yes"; then
+ elif test "$MINGW32" = "yes"; then
LN='cp -r'
LN_S='cp -r'
program_suffix=.exe
AC_SUBST(LN)
AC_SUBST(LN_S)
- AC_SUBST(INSTALL)
AC_DEFINE_UNQUOTED(DIRSEP, ['${DIRSEP}'])
AC_DEFINE_UNQUOTED(PATHSEP, ['${PATHSEP}'])
AC_SUBST(DIRSEP)
AC_SUBST(program_suffix)
AC_MSG_CHECKING([for some flavor of Windows])
- if test "$CYGWIN$MINGW32" == "nono"; then
+ if test "$CYGWIN$MINGW32" = "nono"; then
PLATFORM_WINDOWS=no
else
PLATFORM_WINDOWS=yes