mirror of
https://github.com/nmap/nmap.git
synced 2026-01-20 21:29:06 +00:00
when deciding whether to build Zenmap. Those versions are required for the Cairo functions used by RadialNet.
551 lines
21 KiB
Plaintext
551 lines
21 KiB
Plaintext
# generated automatically by aclocal 1.10.1 -*- Autoconf -*-
|
|
|
|
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
|
# 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.
|
|
|
|
# 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.
|
|
|
|
# Configure paths for GTK+
|
|
# Owen Taylor 1997-2001
|
|
|
|
dnl AM_PATH_GTK_2_0([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
|
|
dnl Test for GTK+, and define GTK_CFLAGS and GTK_LIBS, if gthread is specified in MODULES,
|
|
dnl pass to pkg-config
|
|
dnl
|
|
AC_DEFUN([AM_PATH_GTK_2_0],
|
|
[dnl
|
|
dnl Get the cflags and libraries from pkg-config
|
|
dnl
|
|
AC_ARG_ENABLE(gtktest, [ --disable-gtktest do not try to compile and run a test GTK+ program],
|
|
, enable_gtktest=yes)
|
|
|
|
pkg_config_args=gtk+-2.0
|
|
for module in . $4
|
|
do
|
|
case "$module" in
|
|
gthread)
|
|
pkg_config_args="$pkg_config_args gthread-2.0"
|
|
;;
|
|
esac
|
|
done
|
|
|
|
no_gtk=""
|
|
|
|
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
|
|
|
|
if test x$PKG_CONFIG != xno ; then
|
|
if pkg-config --atleast-pkgconfig-version 0.7 ; then
|
|
:
|
|
else
|
|
echo "*** pkg-config too old; version 0.7 or better required."
|
|
no_gtk=yes
|
|
PKG_CONFIG=no
|
|
fi
|
|
else
|
|
no_gtk=yes
|
|
fi
|
|
|
|
min_gtk_version=ifelse([$1], ,2.0.0,$1)
|
|
AC_MSG_CHECKING(for GTK+ - version >= $min_gtk_version)
|
|
|
|
if test x$PKG_CONFIG != xno ; then
|
|
## don't try to run the test against uninstalled libtool libs
|
|
if $PKG_CONFIG --uninstalled $pkg_config_args; then
|
|
echo "Will use uninstalled version of GTK+ found in PKG_CONFIG_PATH"
|
|
enable_gtktest=no
|
|
fi
|
|
|
|
if $PKG_CONFIG --atleast-version $min_gtk_version $pkg_config_args; then
|
|
:
|
|
else
|
|
no_gtk=yes
|
|
fi
|
|
fi
|
|
|
|
if test x"$no_gtk" = x ; then
|
|
GTK_CFLAGS=`$PKG_CONFIG $pkg_config_args --cflags`
|
|
GTK_LIBS=`$PKG_CONFIG $pkg_config_args --libs`
|
|
gtk_config_major_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
|
|
gtk_config_minor_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
|
|
gtk_config_micro_version=`$PKG_CONFIG --modversion gtk+-2.0 | \
|
|
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
|
|
if test "x$enable_gtktest" = "xyes" ; then
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
ac_save_LIBS="$LIBS"
|
|
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
|
LIBS="$GTK_LIBS $LIBS"
|
|
dnl
|
|
dnl Now check if the installed GTK+ is sufficiently new. (Also sanity
|
|
dnl checks the results of pkg-config to some extent)
|
|
dnl
|
|
rm -f conf.gtktest
|
|
AC_TRY_RUN([
|
|
#include <gtk/gtk.h>
|
|
#include <stdio.h>
|
|
#include <stdlib.h>
|
|
|
|
int
|
|
main ()
|
|
{
|
|
int major, minor, micro;
|
|
char *tmp_version;
|
|
|
|
system ("touch conf.gtktest");
|
|
|
|
/* HP/UX 9 (%@#!) writes to sscanf strings */
|
|
tmp_version = g_strdup("$min_gtk_version");
|
|
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
|
|
printf("%s, bad version string\n", "$min_gtk_version");
|
|
exit(1);
|
|
}
|
|
|
|
if ((gtk_major_version != $gtk_config_major_version) ||
|
|
(gtk_minor_version != $gtk_config_minor_version) ||
|
|
(gtk_micro_version != $gtk_config_micro_version))
|
|
{
|
|
printf("\n*** 'pkg-config --modversion gtk+-2.0' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
|
|
$gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
|
|
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
|
printf ("*** was found! If pkg-config was correct, then it is best\n");
|
|
printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
|
|
printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
|
|
printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
|
|
printf("*** required on your system.\n");
|
|
printf("*** If pkg-config was wrong, set the environment variable PKG_CONFIG_PATH\n");
|
|
printf("*** to point to the correct configuration files\n");
|
|
}
|
|
else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
|
|
(gtk_minor_version != GTK_MINOR_VERSION) ||
|
|
(gtk_micro_version != GTK_MICRO_VERSION))
|
|
{
|
|
printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
|
|
GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
|
|
printf("*** library (version %d.%d.%d)\n",
|
|
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
|
}
|
|
else
|
|
{
|
|
if ((gtk_major_version > major) ||
|
|
((gtk_major_version == major) && (gtk_minor_version > minor)) ||
|
|
((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
|
|
{
|
|
return 0;
|
|
}
|
|
else
|
|
{
|
|
printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
|
|
gtk_major_version, gtk_minor_version, gtk_micro_version);
|
|
printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
|
|
major, minor, micro);
|
|
printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
|
|
printf("***\n");
|
|
printf("*** If you have already installed a sufficiently new version, this error\n");
|
|
printf("*** probably means that the wrong copy of the pkg-config shell script is\n");
|
|
printf("*** being found. The easiest way to fix this is to remove the old version\n");
|
|
printf("*** of GTK+, but you can also set the PKG_CONFIG environment to point to the\n");
|
|
printf("*** correct copy of pkg-config. (In this case, you will have to\n");
|
|
printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
|
|
printf("*** so that the correct libraries are found at run-time))\n");
|
|
}
|
|
}
|
|
return 1;
|
|
}
|
|
],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
LIBS="$ac_save_LIBS"
|
|
fi
|
|
fi
|
|
if test "x$no_gtk" = x ; then
|
|
AC_MSG_RESULT(yes (version $gtk_config_major_version.$gtk_config_minor_version.$gtk_config_micro_version))
|
|
ifelse([$2], , :, [$2])
|
|
else
|
|
AC_MSG_RESULT(no)
|
|
if test "$PKG_CONFIG" = "no" ; then
|
|
echo "*** A new enough version of pkg-config was not found."
|
|
echo "*** See http://pkgconfig.sourceforge.net"
|
|
else
|
|
if test -f conf.gtktest ; then
|
|
:
|
|
else
|
|
echo "*** Could not run GTK+ test program, checking why..."
|
|
ac_save_CFLAGS="$CFLAGS"
|
|
ac_save_LIBS="$LIBS"
|
|
CFLAGS="$CFLAGS $GTK_CFLAGS"
|
|
LIBS="$LIBS $GTK_LIBS"
|
|
AC_TRY_LINK([
|
|
#include <gtk/gtk.h>
|
|
#include <stdio.h>
|
|
], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
|
|
[ echo "*** The test program compiled, but did not run. This usually means"
|
|
echo "*** that the run-time linker is not finding GTK+ or finding the wrong"
|
|
echo "*** version of GTK+. If it is not finding GTK+, you'll need to set your"
|
|
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
|
|
echo "*** to the installed location Also, make sure you have run ldconfig if that"
|
|
echo "*** is required on your system"
|
|
echo "***"
|
|
echo "*** If you have an old version installed, it is best to remove it, although"
|
|
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" ],
|
|
[ echo "*** The test program failed to compile or link. See the file config.log for the"
|
|
echo "*** exact error that occured. This usually means GTK+ is incorrectly installed."])
|
|
CFLAGS="$ac_save_CFLAGS"
|
|
LIBS="$ac_save_LIBS"
|
|
fi
|
|
fi
|
|
GTK_CFLAGS=""
|
|
GTK_LIBS=""
|
|
ifelse([$3], , :, [$3])
|
|
fi
|
|
AC_SUBST(GTK_CFLAGS)
|
|
AC_SUBST(GTK_LIBS)
|
|
rm -f conf.gtktest
|
|
])
|
|
|
|
# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
|
|
#
|
|
# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
|
|
#
|
|
# This program is free software; you can redistribute it and/or modify
|
|
# it under the terms of the GNU General Public License as published by
|
|
# the Free Software Foundation; either version 2 of the License, or
|
|
# (at your option) any later version.
|
|
#
|
|
# This program is distributed in the hope that it will be useful, but
|
|
# WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
# General Public License for more details.
|
|
#
|
|
# You should have received a copy of the GNU General Public License
|
|
# along with this program; if not, write to the Free Software
|
|
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
|
#
|
|
# As a special exception to the GNU General Public License, if you
|
|
# distribute this file as part of a program that contains a
|
|
# configuration script generated by Autoconf, you may include it under
|
|
# the same distribution terms that you use for the rest of that program.
|
|
|
|
# PKG_PROG_PKG_CONFIG([MIN-VERSION])
|
|
# ----------------------------------
|
|
AC_DEFUN([PKG_PROG_PKG_CONFIG],
|
|
[m4_pattern_forbid([^_?PKG_[A-Z_]+$])
|
|
m4_pattern_allow([^PKG_CONFIG(_PATH)?$])
|
|
AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl
|
|
if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then
|
|
AC_PATH_TOOL([PKG_CONFIG], [pkg-config])
|
|
fi
|
|
if test -n "$PKG_CONFIG"; then
|
|
_pkg_min_version=m4_default([$1], [0.9.0])
|
|
AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version])
|
|
if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then
|
|
AC_MSG_RESULT([yes])
|
|
else
|
|
AC_MSG_RESULT([no])
|
|
PKG_CONFIG=""
|
|
fi
|
|
|
|
fi[]dnl
|
|
])# PKG_PROG_PKG_CONFIG
|
|
|
|
# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
#
|
|
# Check to see whether a particular set of modules exists. Similar
|
|
# to PKG_CHECK_MODULES(), but does not set variables or print errors.
|
|
#
|
|
#
|
|
# Similar to PKG_CHECK_MODULES, make sure that the first instance of
|
|
# this or PKG_CHECK_MODULES is called, or make sure to call
|
|
# PKG_CHECK_EXISTS manually
|
|
# --------------------------------------------------------------
|
|
AC_DEFUN([PKG_CHECK_EXISTS],
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
if test -n "$PKG_CONFIG" && \
|
|
AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then
|
|
m4_ifval([$2], [$2], [:])
|
|
m4_ifvaln([$3], [else
|
|
$3])dnl
|
|
fi])
|
|
|
|
|
|
# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES])
|
|
# ---------------------------------------------
|
|
m4_define([_PKG_CONFIG],
|
|
[if test -n "$PKG_CONFIG"; then
|
|
if test -n "$$1"; then
|
|
pkg_cv_[]$1="$$1"
|
|
else
|
|
PKG_CHECK_EXISTS([$3],
|
|
[pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null`],
|
|
[pkg_failed=yes])
|
|
fi
|
|
else
|
|
pkg_failed=untried
|
|
fi[]dnl
|
|
])# _PKG_CONFIG
|
|
|
|
# _PKG_SHORT_ERRORS_SUPPORTED
|
|
# -----------------------------
|
|
AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED],
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])
|
|
if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
|
|
_pkg_short_errors_supported=yes
|
|
else
|
|
_pkg_short_errors_supported=no
|
|
fi[]dnl
|
|
])# _PKG_SHORT_ERRORS_SUPPORTED
|
|
|
|
|
|
# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND],
|
|
# [ACTION-IF-NOT-FOUND])
|
|
#
|
|
#
|
|
# Note that if there is a possibility the first call to
|
|
# PKG_CHECK_MODULES might not happen, you should be sure to include an
|
|
# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac
|
|
#
|
|
#
|
|
# --------------------------------------------------------------
|
|
AC_DEFUN([PKG_CHECK_MODULES],
|
|
[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl
|
|
AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl
|
|
AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl
|
|
|
|
pkg_failed=no
|
|
AC_MSG_CHECKING([for $1])
|
|
|
|
_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])
|
|
_PKG_CONFIG([$1][_LIBS], [libs], [$2])
|
|
|
|
m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS
|
|
and $1[]_LIBS to avoid the need to call pkg-config.
|
|
See the pkg-config man page for more details.])
|
|
|
|
if test $pkg_failed = yes; then
|
|
_PKG_SHORT_ERRORS_SUPPORTED
|
|
if test $_pkg_short_errors_supported = yes; then
|
|
$1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --errors-to-stdout --print-errors "$2"`
|
|
else
|
|
$1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"`
|
|
fi
|
|
# Put the nasty error message in config.log where it belongs
|
|
echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD
|
|
|
|
ifelse([$4], , [AC_MSG_ERROR(dnl
|
|
[Package requirements ($2) were not met:
|
|
|
|
$$1_PKG_ERRORS
|
|
|
|
Consider adjusting the PKG_CONFIG_PATH environment variable if you
|
|
installed software in a non-standard prefix.
|
|
|
|
_PKG_TEXT
|
|
])],
|
|
[AC_MSG_RESULT([no])
|
|
$4])
|
|
elif test $pkg_failed = untried; then
|
|
ifelse([$4], , [AC_MSG_FAILURE(dnl
|
|
[The pkg-config script could not be found or is too old. Make sure it
|
|
is in your PATH or set the PKG_CONFIG environment variable to the full
|
|
path to pkg-config.
|
|
|
|
_PKG_TEXT
|
|
|
|
To get pkg-config, see <http://www.freedesktop.org/software/pkgconfig>.])],
|
|
[$4])
|
|
else
|
|
$1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS
|
|
$1[]_LIBS=$pkg_cv_[]$1[]_LIBS
|
|
AC_MSG_RESULT([yes])
|
|
ifelse([$3], , :, [$3])
|
|
fi[]dnl
|
|
])# PKG_CHECK_MODULES
|
|
|
|
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 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.
|
|
|
|
# AM_PATH_PYTHON([MINIMUM-VERSION], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
# ---------------------------------------------------------------------------
|
|
# Adds support for distributing Python modules and packages. To
|
|
# install modules, copy them to $(pythondir), using the python_PYTHON
|
|
# automake variable. To install a package with the same name as the
|
|
# automake package, install to $(pkgpythondir), or use the
|
|
# pkgpython_PYTHON automake variable.
|
|
#
|
|
# The variables $(pyexecdir) and $(pkgpyexecdir) are provided as
|
|
# locations to install python extension modules (shared libraries).
|
|
# Another macro is required to find the appropriate flags to compile
|
|
# extension modules.
|
|
#
|
|
# If your package is configured with a different prefix to python,
|
|
# users will have to add the install directory to the PYTHONPATH
|
|
# environment variable, or create a .pth file (see the python
|
|
# documentation for details).
|
|
#
|
|
# If the MINIMUM-VERSION argument is passed, AM_PATH_PYTHON will
|
|
# cause an error if the version of python installed on the system
|
|
# doesn't meet the requirement. MINIMUM-VERSION should consist of
|
|
# numbers and dots only.
|
|
AC_DEFUN([AM_PATH_PYTHON],
|
|
[
|
|
dnl Find a Python interpreter. Python versions prior to 1.5 are not
|
|
dnl supported because the default installation locations changed from
|
|
dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages
|
|
dnl in 1.5.
|
|
m4_define_default([_AM_PYTHON_INTERPRETER_LIST],
|
|
[python python2 python2.5 python2.4 python2.3 python2.2 dnl
|
|
python2.1 python2.0 python1.6 python1.5])
|
|
|
|
m4_if([$1],[],[
|
|
dnl No version check is needed.
|
|
# Find any Python interpreter.
|
|
if test -z "$PYTHON"; then
|
|
AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :)
|
|
fi
|
|
am_display_PYTHON=python
|
|
], [
|
|
dnl A version check is needed.
|
|
if test -n "$PYTHON"; then
|
|
# If the user set $PYTHON, use it and don't search something else.
|
|
AC_MSG_CHECKING([whether $PYTHON version >= $1])
|
|
AM_PYTHON_CHECK_VERSION([$PYTHON], [$1],
|
|
[AC_MSG_RESULT(yes)],
|
|
[AC_MSG_ERROR(too old)])
|
|
am_display_PYTHON=$PYTHON
|
|
else
|
|
# Otherwise, try each interpreter until we find one that satisfies
|
|
# VERSION.
|
|
AC_CACHE_CHECK([for a Python interpreter with version >= $1],
|
|
[am_cv_pathless_PYTHON],[
|
|
for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do
|
|
test "$am_cv_pathless_PYTHON" = none && break
|
|
AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$1], [break])
|
|
done])
|
|
# Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON.
|
|
if test "$am_cv_pathless_PYTHON" = none; then
|
|
PYTHON=:
|
|
else
|
|
AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON])
|
|
fi
|
|
am_display_PYTHON=$am_cv_pathless_PYTHON
|
|
fi
|
|
])
|
|
|
|
if test "$PYTHON" = :; then
|
|
dnl Run any user-specified action, or abort.
|
|
m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found])])
|
|
else
|
|
|
|
dnl Query Python for its version number. Getting [:3] seems to be
|
|
dnl the best way to do this; it's what "site.py" does in the standard
|
|
dnl library.
|
|
|
|
AC_CACHE_CHECK([for $am_display_PYTHON version], [am_cv_python_version],
|
|
[am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"`])
|
|
AC_SUBST([PYTHON_VERSION], [$am_cv_python_version])
|
|
|
|
dnl Use the values of $prefix and $exec_prefix for the corresponding
|
|
dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made
|
|
dnl distinct variables so they can be overridden if need be. However,
|
|
dnl general consensus is that you shouldn't need this ability.
|
|
|
|
AC_SUBST([PYTHON_PREFIX], ['${prefix}'])
|
|
AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}'])
|
|
|
|
dnl At times (like when building shared libraries) you may want
|
|
dnl to know which OS platform Python thinks this is.
|
|
|
|
AC_CACHE_CHECK([for $am_display_PYTHON platform], [am_cv_python_platform],
|
|
[am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"`])
|
|
AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform])
|
|
|
|
|
|
dnl Set up 4 directories:
|
|
|
|
dnl pythondir -- where to install python scripts. This is the
|
|
dnl site-packages directory, not the python standard library
|
|
dnl directory like in previous automake betas. This behavior
|
|
dnl is more consistent with lispdir.m4 for example.
|
|
dnl Query distutils for this directory. distutils does not exist in
|
|
dnl Python 1.5, so we fall back to the hardcoded directory if it
|
|
dnl doesn't work.
|
|
AC_CACHE_CHECK([for $am_display_PYTHON script directory],
|
|
[am_cv_python_pythondir],
|
|
[am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null ||
|
|
echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"`])
|
|
AC_SUBST([pythondir], [$am_cv_python_pythondir])
|
|
|
|
dnl pkgpythondir -- $PACKAGE directory under pythondir. Was
|
|
dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is
|
|
dnl more consistent with the rest of automake.
|
|
|
|
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])
|
|
|
|
dnl pyexecdir -- directory for installing python extension modules
|
|
dnl (shared libraries)
|
|
dnl Query distutils for this directory. distutils does not exist in
|
|
dnl Python 1.5, so we fall back to the hardcoded directory if it
|
|
dnl doesn't work.
|
|
AC_CACHE_CHECK([for $am_display_PYTHON extension module directory],
|
|
[am_cv_python_pyexecdir],
|
|
[am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null ||
|
|
echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"`])
|
|
AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir])
|
|
|
|
dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE)
|
|
|
|
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])
|
|
|
|
dnl Run any user-specified action.
|
|
$2
|
|
fi
|
|
|
|
])
|
|
|
|
|
|
# AM_PYTHON_CHECK_VERSION(PROG, VERSION, [ACTION-IF-TRUE], [ACTION-IF-FALSE])
|
|
# ---------------------------------------------------------------------------
|
|
# Run ACTION-IF-TRUE if the Python interpreter PROG has version >= VERSION.
|
|
# Run ACTION-IF-FALSE otherwise.
|
|
# This test uses sys.hexversion instead of the string equivalent (first
|
|
# word of sys.version), in order to cope with versions such as 2.2c1.
|
|
# hexversion has been introduced in Python 1.5.2; it's probably not
|
|
# worth to support older versions (1.5.1 was released on October 31, 1998).
|
|
AC_DEFUN([AM_PYTHON_CHECK_VERSION],
|
|
[prog="import sys, string
|
|
# split strings by '.' and convert to numeric. Append some zeros
|
|
# because we need at least 4 digits for the hex conversion.
|
|
minver = map(int, string.split('$2', '.')) + [[0, 0, 0]]
|
|
minverhex = 0
|
|
for i in xrange(0, 4): minverhex = (minverhex << 8) + minver[[i]]
|
|
sys.exit(sys.hexversion < minverhex)"
|
|
AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])])
|
|
|
|
# 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_RUN_LOG(COMMAND)
|
|
# -------------------
|
|
# Run COMMAND, save the exit status in ac_status, and log it.
|
|
# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
|
|
AC_DEFUN([AM_RUN_LOG],
|
|
[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
|
|
($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
|
|
ac_status=$?
|
|
echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
|
|
(exit $ac_status); }])
|
|
|
|
m4_include([acinclude.m4])
|