clean up
This commit is contained in:
parent
ef513974ab
commit
60c42337ef
132
Makefile.in
132
Makefile.in
@ -1,132 +0,0 @@
|
|||||||
VPATH = @srcdir@
|
|
||||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
|
||||||
PACKAGE_NAME = @PACKAGE_NAME@
|
|
||||||
PACKAGE_STRING = @PACKAGE_STRING@
|
|
||||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
|
||||||
PACKAGE_URL = @PACKAGE_URL@
|
|
||||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
|
||||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
|
||||||
PYTHON = @PYTHON@
|
|
||||||
VIRTUALENV = @VIRTUALENV@
|
|
||||||
SPHINXBUILD = @SPHINXBUILD@
|
|
||||||
SHELL = @SHELL@
|
|
||||||
MKDIR_P = @MKDIR_P@
|
|
||||||
INSTALL = @INSTALL@
|
|
||||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
|
||||||
INSTALL_DATA = @INSTALL_DATA@
|
|
||||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
|
||||||
docdir = @docdir@
|
|
||||||
dvidir = @dvidir@
|
|
||||||
exec_prefix = @exec_prefix@
|
|
||||||
htmldir = @htmldir@
|
|
||||||
includedir = @includedir@
|
|
||||||
infodir = @infodir@
|
|
||||||
prefix = @prefix@
|
|
||||||
srcdir = @srcdir@
|
|
||||||
datadir = @datadir@
|
|
||||||
datarootdir = @datarootdir@
|
|
||||||
pythondir = @pythondir@
|
|
||||||
pyexecdir = @pyexecdir@
|
|
||||||
pkgdatadir = $(datadir)/@PACKAGE_NAME@
|
|
||||||
pkgincludedir = $(includedir)/@PACKAGE_NAME@
|
|
||||||
pkgpythondir = @pkgpythondir@
|
|
||||||
pkgpyexecdir = @pkgpyexecdir@
|
|
||||||
PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
|
|
||||||
|
|
||||||
INSTALL_TARGET = develop
|
|
||||||
|
|
||||||
all: install
|
|
||||||
|
|
||||||
|
|
||||||
.PHONY: all install uninstall distclean info install-html html install-pdf pdf install-dvi dvi install-ps ps clean dist check installdirs
|
|
||||||
|
|
||||||
|
|
||||||
install: installdirs
|
|
||||||
$(NORMAL_INSTALL)
|
|
||||||
ifneq ($(VIRTUALENV),no)
|
|
||||||
$(VIRTUALENV) $(VIRTUALENV_FLAGS) $(DESTDIR)$(prefix) || $(VIRTUALENV) $(DESTDIR)$(prefix)
|
|
||||||
$(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py $(INSTALL_TARGET) --prefix=$(DESTDIR)$(prefix)
|
|
||||||
else
|
|
||||||
$(PYTHON) $(srcdir)/setup.py $(INSTALL_TARGET) --prefix=$(DESTDIR)$(prefix)
|
|
||||||
endif
|
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/lazyserver.sh $(DESTDIR)$(pkgdatadir)
|
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/lazycelery.sh $(DESTDIR)$(pkgdatadir)
|
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/lazystarter.sh $(DESTDIR)$(pkgdatadir)
|
|
||||||
$(INSTALL_DATA) $(srcdir)/mediagoblin.ini $(DESTDIR)$(pkgdatadir)
|
|
||||||
$(INSTALL_DATA) $(srcdir)/paste.ini $(DESTDIR)$(pkgdatadir)
|
|
||||||
|
|
||||||
|
|
||||||
uninstall: $(wildcard $(srcdir)/docs/source/*)
|
|
||||||
rm -rf $(DESTDIR)$(pkgdatadir)
|
|
||||||
rm -rf $(DESTDIR)$(htmldir)
|
|
||||||
rm -rf $(DESTDIR)$(pdfdir)
|
|
||||||
|
|
||||||
|
|
||||||
clean:
|
|
||||||
$(PYTHON) setup.py clean
|
|
||||||
|
|
||||||
|
|
||||||
distclean: $(wildcard $(srcdir)/docs/source/*)
|
|
||||||
rm $(srcdir)/config.log
|
|
||||||
rm $(srcdir)/config.status
|
|
||||||
|
|
||||||
|
|
||||||
$(DESTDIR)$(infodir)/gnumediagoblin.info: docs/build/texinfo/gnumediagoblin.info
|
|
||||||
$(POST_INSTALL)
|
|
||||||
$(INSTALL_DATA) @< $(DESTDIR)$@
|
|
||||||
if $(SHELL) -c 'install-info --version' >/dev/null 2>&1; then
|
|
||||||
install-info --dir-file=$(DESTDIR)$(infodir)/dir \
|
|
||||||
$(DESTDIR)$(infodir)/gnumediagoblin.info;
|
|
||||||
else true; fi
|
|
||||||
|
|
||||||
info: docs/build/texinfo/gnumediagoblin.info
|
|
||||||
|
|
||||||
docs/build/texinfo/gnumediagoblin.info: $(wildcard docs/source/*)
|
|
||||||
ifneq ($(SPHINX_BUILD),no)
|
|
||||||
$(MAKE) -C docs info SPHINXBUILD=$(SPHINXBUILD)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
install-html: html installdirs
|
|
||||||
$(INSTALL_DATA) docs/build/html/* $(DESTDIR)$(htmldir)
|
|
||||||
|
|
||||||
html: docs/build/html/index.html
|
|
||||||
|
|
||||||
docs/build/html/index.html: $(wildcard $(srcdir)/docs/source/*)
|
|
||||||
ifneq ($(SPHINX_BUILD),no)
|
|
||||||
$(MAKE) -C docs html SPHINXBUILD=$(SPHINXBUILD)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
install-pdf: pdf installdirs
|
|
||||||
$(INSTALL_DATA) docs/build/latex/GNUMediaGoblin.pdf $(DESTDIR)$(pdfdir)
|
|
||||||
|
|
||||||
pdf: docs/build/latex/GNUMediaGoblin.pdf
|
|
||||||
|
|
||||||
docs/build/latex/GNUMediaGoblin.pdf: $(wildcard $(srcdir)/docs/source/*)
|
|
||||||
ifneq ($(SPHINX_BUILD),no)
|
|
||||||
$(MAKE) -C docs latexpdf SPHINXBUILD=$(SPHINXBUILD)
|
|
||||||
endif
|
|
||||||
|
|
||||||
|
|
||||||
install-dvi:
|
|
||||||
|
|
||||||
dvi:
|
|
||||||
|
|
||||||
install-ps:
|
|
||||||
|
|
||||||
ps:
|
|
||||||
|
|
||||||
|
|
||||||
dist:
|
|
||||||
$(PYTHON) setup.py sdist
|
|
||||||
|
|
||||||
check:
|
|
||||||
$(PYTHON) setup.py check
|
|
||||||
|
|
||||||
installdirs:
|
|
||||||
$(MKDIR_P) \
|
|
||||||
$(DESTDIR)$(pkgpythondir) \
|
|
||||||
$(DESTDIR)$(pkgdatadir) \
|
|
||||||
$(DESTDIR)$(htmldir) \
|
|
||||||
$(DESTDIR)$(pdfdir)
|
|
944
aclocal.m4
vendored
944
aclocal.m4
vendored
@ -1,944 +0,0 @@
|
|||||||
# generated automatically by aclocal 1.12.4 -*- Autoconf -*-
|
|
||||||
|
|
||||||
# Copyright (C) 1996-2012 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.69],,
|
|
||||||
[m4_warning([this file was generated for autoconf 2.69.
|
|
||||||
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'.])])
|
|
||||||
|
|
||||||
# Copyright (C) 2002-2012 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.12'
|
|
||||||
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.12.4], [],
|
|
||||||
[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.12.4])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-2012 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-2012 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_CONDITIONAL(NAME, SHELL-CONDITION)
|
|
||||||
# -------------------------------------
|
|
||||||
# Define a conditional.
|
|
||||||
AC_DEFUN([AM_CONDITIONAL],
|
|
||||||
[AC_PREREQ([2.52])dnl
|
|
||||||
m4_if([$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-2012 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.
|
|
||||||
|
|
||||||
|
|
||||||
# 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", "OBJC", "OBJCXX", "UPC", or "GJC".
|
|
||||||
# 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
|
|
||||||
|
|
||||||
m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
|
|
||||||
[$1], [CXX], [depcc="$CXX" am_compiler_list=],
|
|
||||||
[$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
|
|
||||||
[$1], [OBJCXX], [depcc="$OBJCXX" 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".
|
|
||||||
rm -rf conftest.dir
|
|
||||||
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 10 /bin/sh.
|
|
||||||
echo '/* dummy */' > 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
|
|
||||||
;;
|
|
||||||
msvc7 | msvc7msys | 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], [dnl
|
|
||||||
AS_HELP_STRING(
|
|
||||||
[--enable-dependency-tracking],
|
|
||||||
[do not reject slow dependency extractors])
|
|
||||||
AS_HELP_STRING(
|
|
||||||
[--disable-dependency-tracking],
|
|
||||||
[speeds up one-time build])])
|
|
||||||
if test "x$enable_dependency_tracking" != xno; then
|
|
||||||
am_depcomp="$ac_aux_dir/depcomp"
|
|
||||||
AMDEPBACKSLASH='\'
|
|
||||||
am__nodep='_no'
|
|
||||||
fi
|
|
||||||
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
|
|
||||||
AC_SUBST([AMDEPBACKSLASH])dnl
|
|
||||||
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
|
|
||||||
AC_SUBST([am__nodep])dnl
|
|
||||||
_AM_SUBST_NOTMAKE([am__nodep])dnl
|
|
||||||
])
|
|
||||||
|
|
||||||
# Generate code to set up dependency tracking. -*- Autoconf -*-
|
|
||||||
|
|
||||||
# Copyright (C) 1999-2012 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_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"`
|
|
||||||
# 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'`; 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-2012 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 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],
|
|
||||||
[AC_DIAGNOSE([obsolete],
|
|
||||||
[$0: two- and three-arguments forms are deprecated. For more info, see:
|
|
||||||
http://www.gnu.org/software/automake/manual/automake.html#Modernize-AM_INIT_AUTOMAKE-invocation])
|
|
||||||
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], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
|
|
||||||
[ok:ok],,
|
|
||||||
[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([AC_PROG_MKDIR_P])dnl
|
|
||||||
# For better backward compatibility. To be removed once Automake 1.9.x
|
|
||||||
# dies out for good. For more background, see:
|
|
||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
|
|
||||||
# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
|
|
||||||
AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
|
|
||||||
# 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])],
|
|
||||||
[m4_define([AC_PROG_CC],
|
|
||||||
m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
|
||||||
[_AM_DEPENDENCIES([CXX])],
|
|
||||||
[m4_define([AC_PROG_CXX],
|
|
||||||
m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
|
|
||||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
|
||||||
[_AM_DEPENDENCIES([OBJC])],
|
|
||||||
[m4_define([AC_PROG_OBJC],
|
|
||||||
m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
|
|
||||||
dnl Support for Objective C++ was only introduced in Autoconf 2.65,
|
|
||||||
dnl but we still cater to Autoconf 2.62.
|
|
||||||
m4_ifdef([AC_PROG_OBJCXX],
|
|
||||||
[AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
|
|
||||||
[_AM_DEPENDENCIES([OBJCXX])],
|
|
||||||
[m4_define([AC_PROG_OBJCXX],
|
|
||||||
m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])])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-2012 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-2012 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.
|
|
||||||
|
|
||||||
# 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-2012 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_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-2012 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_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
|
|
||||||
])
|
|
||||||
|
|
||||||
# Helper functions for option handling. -*- Autoconf -*-
|
|
||||||
|
|
||||||
# Copyright (C) 2001-2012 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_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-2012 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_SANITY_CHECK
|
|
||||||
# ---------------
|
|
||||||
AC_DEFUN([AM_SANITY_CHECK],
|
|
||||||
[AC_MSG_CHECKING([whether build environment is sane])
|
|
||||||
# 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 (
|
|
||||||
am_has_slept=no
|
|
||||||
for am_try in 1 2; do
|
|
||||||
echo "timestamp, slept: $am_has_slept" > conftest.file
|
|
||||||
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
|
|
||||||
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
|
|
||||||
if test "$[2]" = conftest.file || test $am_try -eq 2; then
|
|
||||||
break
|
|
||||||
fi
|
|
||||||
# Just in case.
|
|
||||||
sleep 1
|
|
||||||
am_has_slept=yes
|
|
||||||
done
|
|
||||||
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])
|
|
||||||
# If we didn't sleep, we still need to ensure time stamps of config.status and
|
|
||||||
# generated files are strictly newer.
|
|
||||||
am_sleep_pid=
|
|
||||||
if grep 'slept: no' conftest.file >/dev/null 2>&1; then
|
|
||||||
( sleep 1 ) &
|
|
||||||
am_sleep_pid=$!
|
|
||||||
fi
|
|
||||||
AC_CONFIG_COMMANDS_PRE(
|
|
||||||
[AC_MSG_CHECKING([that generated files are newer than configure])
|
|
||||||
if test -n "$am_sleep_pid"; then
|
|
||||||
# Hide warnings about reused PIDs.
|
|
||||||
wait $am_sleep_pid 2>/dev/null
|
|
||||||
fi
|
|
||||||
AC_MSG_RESULT([done])])
|
|
||||||
rm -f conftest.file
|
|
||||||
])
|
|
||||||
|
|
||||||
# Copyright (C) 2001-2012 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-2012 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_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-2012 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_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. Yes, it's still used
|
|
||||||
# in the wild :-( We should find a proper way to deprecate it ...
|
|
||||||
AC_SUBST([AMTAR], ['$${TAR-tar}'])
|
|
||||||
m4_if([$1], [v7],
|
|
||||||
[am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} 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
|
|
||||||
|
|
87
configure.ac
87
configure.ac
@ -1,87 +0,0 @@
|
|||||||
# Copyright 2012 Brandon Invergo <brandon@invergo.net>
|
|
||||||
#
|
|
||||||
# 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. This file is offered as-is,
|
|
||||||
# without any warranty.
|
|
||||||
|
|
||||||
# This is a basic Autoconf configure.ac file for Python-based
|
|
||||||
# projects. It is not intended to be used as-is, but rather to be
|
|
||||||
# modified to the specific needs of the project.
|
|
||||||
|
|
||||||
|
|
||||||
dnl####################################
|
|
||||||
dnl Define some macros here as needed #
|
|
||||||
dnl####################################
|
|
||||||
|
|
||||||
# The minimum-required Python versions
|
|
||||||
m4_define(python_min_ver, 2.6)
|
|
||||||
|
|
||||||
|
|
||||||
dnl#############################################
|
|
||||||
dnl Import the Python-specific Autoconf macros #
|
|
||||||
dnl#############################################
|
|
||||||
|
|
||||||
# Unless these macros are included upstream somewhere, this must be included
|
|
||||||
m4_include([m4/python.m4])
|
|
||||||
|
|
||||||
|
|
||||||
dnl#######################################
|
|
||||||
dnl Autoconf and Automake initialization #
|
|
||||||
dnl#######################################
|
|
||||||
|
|
||||||
# Initialize Autoconf.
|
|
||||||
AC_INIT(mediagoblin, 0.3.1)
|
|
||||||
|
|
||||||
# Load macros from the m4/ directory
|
|
||||||
AC_CONFIG_MACRO_DIR([m4])
|
|
||||||
AM_INIT_AUTOMAKE
|
|
||||||
|
|
||||||
# Here we check if we are using Python 3
|
|
||||||
PC_PYTHON_VERIFY_VERSION([$PYTHON], 3.0,
|
|
||||||
py3k=true,
|
|
||||||
py3k=false)
|
|
||||||
# If using python 3, try to find python 2 instead
|
|
||||||
if test "$py3k" = "true" ; then
|
|
||||||
m4_define_default([_PYTHON2_BINS], [python2 python2.7 python2.6])
|
|
||||||
AC_PATH_PROGS(PYTHON, [_PYTHON2_BINS])
|
|
||||||
else
|
|
||||||
# otherwise check that the Python 2 version is sufficient
|
|
||||||
PC_PYTHON_VERIFY_VERSION([$PYTHON], python_min_ver, ,
|
|
||||||
[AC_MSG_ERROR(Python interpreter too old)])
|
|
||||||
fi
|
|
||||||
|
|
||||||
AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build2], [no])
|
|
||||||
AS_IF([test "x$SPHINXBUILD" = xno],
|
|
||||||
AC_MSG_WARN(sphinx-build is required to build documentation))
|
|
||||||
|
|
||||||
|
|
||||||
AC_ARG_WITH([virtualenv],
|
|
||||||
[AS_HELP_STRING([--with-virtualenv], [install to a Python virtualenv])],
|
|
||||||
[],
|
|
||||||
[with_virtualenv=no])
|
|
||||||
AS_IF([test "x$with_virtualenv" != xno],
|
|
||||||
AC_CHECK_PROGS([VIRTUALENV], [virtualenv virtualenv2], [no])
|
|
||||||
AS_IF([test "x$VIRTUALENV" = xno],
|
|
||||||
[AC_MSG_FAILURE(
|
|
||||||
[--with-virtualenv given but virtualenv could not be found])]),
|
|
||||||
AC_SUBST([VIRTUALENV], [no]))
|
|
||||||
AC_ARG_VAR([VIRTUALENV_FLAGS], [flags to pass to the virtualenv command])
|
|
||||||
|
|
||||||
AC_PROG_MKDIR_P
|
|
||||||
AC_PROG_INSTALL
|
|
||||||
|
|
||||||
PC_PYTHON_CHECK_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
|
|
||||||
|
|
||||||
PC_PYTHON_SITE_PACKAGE_DIR
|
|
||||||
PC_PYTHON_EXEC_PACKAGE_DIR
|
|
||||||
|
|
||||||
PC_PYTHON_CHECK_MODULE([lxml],,[AC_MSG_ERROR(could not find Python lxml module)])
|
|
||||||
PC_PYTHON_CHECK_MODULE([Image],,[AC_MSG_ERROR(could not find Python Imaging Library)])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Files to be configured
|
|
||||||
AC_CONFIG_FILES([Makefile])
|
|
||||||
# Generate config.status
|
|
||||||
AC_OUTPUT
|
|
527
install-sh
527
install-sh
@ -1,527 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
# install - install a program, script, or datafile
|
|
||||||
|
|
||||||
scriptversion=2011-11-20.07; # UTC
|
|
||||||
|
|
||||||
# This originates from X11R5 (mit/util/scripts/install.sh), which was
|
|
||||||
# later released in X11R6 (xc/config/util/install.sh) with the
|
|
||||||
# following copyright and license.
|
|
||||||
#
|
|
||||||
# Copyright (C) 1994 X Consortium
|
|
||||||
#
|
|
||||||
# Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
||||||
# of this software and associated documentation files (the "Software"), to
|
|
||||||
# deal in the Software without restriction, including without limitation the
|
|
||||||
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
||||||
# sell copies of the Software, and to permit persons to whom the Software is
|
|
||||||
# furnished to do so, subject to the following conditions:
|
|
||||||
#
|
|
||||||
# The above copyright notice and this permission notice shall be included in
|
|
||||||
# all copies or substantial portions of the Software.
|
|
||||||
#
|
|
||||||
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
||||||
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
||||||
# X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
|
|
||||||
# AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC-
|
|
||||||
# TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
#
|
|
||||||
# Except as contained in this notice, the name of the X Consortium shall not
|
|
||||||
# be used in advertising or otherwise to promote the sale, use or other deal-
|
|
||||||
# ings in this Software without prior written authorization from the X Consor-
|
|
||||||
# tium.
|
|
||||||
#
|
|
||||||
#
|
|
||||||
# FSF changes to this file are in the public domain.
|
|
||||||
#
|
|
||||||
# Calling this script install-sh is preferred over install.sh, to prevent
|
|
||||||
# 'make' implicit rules from creating a file called install from it
|
|
||||||
# when there is no Makefile.
|
|
||||||
#
|
|
||||||
# This script is compatible with the BSD install script, but was written
|
|
||||||
# from scratch.
|
|
||||||
|
|
||||||
nl='
|
|
||||||
'
|
|
||||||
IFS=" "" $nl"
|
|
||||||
|
|
||||||
# set DOITPROG to echo to test this script
|
|
||||||
|
|
||||||
# Don't use :- since 4.3BSD and earlier shells don't like it.
|
|
||||||
doit=${DOITPROG-}
|
|
||||||
if test -z "$doit"; then
|
|
||||||
doit_exec=exec
|
|
||||||
else
|
|
||||||
doit_exec=$doit
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Put in absolute file names if you don't have them in your path;
|
|
||||||
# or use environment vars.
|
|
||||||
|
|
||||||
chgrpprog=${CHGRPPROG-chgrp}
|
|
||||||
chmodprog=${CHMODPROG-chmod}
|
|
||||||
chownprog=${CHOWNPROG-chown}
|
|
||||||
cmpprog=${CMPPROG-cmp}
|
|
||||||
cpprog=${CPPROG-cp}
|
|
||||||
mkdirprog=${MKDIRPROG-mkdir}
|
|
||||||
mvprog=${MVPROG-mv}
|
|
||||||
rmprog=${RMPROG-rm}
|
|
||||||
stripprog=${STRIPPROG-strip}
|
|
||||||
|
|
||||||
posix_glob='?'
|
|
||||||
initialize_posix_glob='
|
|
||||||
test "$posix_glob" != "?" || {
|
|
||||||
if (set -f) 2>/dev/null; then
|
|
||||||
posix_glob=
|
|
||||||
else
|
|
||||||
posix_glob=:
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
'
|
|
||||||
|
|
||||||
posix_mkdir=
|
|
||||||
|
|
||||||
# Desired mode of installed file.
|
|
||||||
mode=0755
|
|
||||||
|
|
||||||
chgrpcmd=
|
|
||||||
chmodcmd=$chmodprog
|
|
||||||
chowncmd=
|
|
||||||
mvcmd=$mvprog
|
|
||||||
rmcmd="$rmprog -f"
|
|
||||||
stripcmd=
|
|
||||||
|
|
||||||
src=
|
|
||||||
dst=
|
|
||||||
dir_arg=
|
|
||||||
dst_arg=
|
|
||||||
|
|
||||||
copy_on_change=false
|
|
||||||
no_target_directory=
|
|
||||||
|
|
||||||
usage="\
|
|
||||||
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
|
|
||||||
or: $0 [OPTION]... SRCFILES... DIRECTORY
|
|
||||||
or: $0 [OPTION]... -t DIRECTORY SRCFILES...
|
|
||||||
or: $0 [OPTION]... -d DIRECTORIES...
|
|
||||||
|
|
||||||
In the 1st form, copy SRCFILE to DSTFILE.
|
|
||||||
In the 2nd and 3rd, copy all SRCFILES to DIRECTORY.
|
|
||||||
In the 4th, create DIRECTORIES.
|
|
||||||
|
|
||||||
Options:
|
|
||||||
--help display this help and exit.
|
|
||||||
--version display version info and exit.
|
|
||||||
|
|
||||||
-c (ignored)
|
|
||||||
-C install only if different (preserve the last data modification time)
|
|
||||||
-d create directories instead of installing files.
|
|
||||||
-g GROUP $chgrpprog installed files to GROUP.
|
|
||||||
-m MODE $chmodprog installed files to MODE.
|
|
||||||
-o USER $chownprog installed files to USER.
|
|
||||||
-s $stripprog installed files.
|
|
||||||
-t DIRECTORY install into DIRECTORY.
|
|
||||||
-T report an error if DSTFILE is a directory.
|
|
||||||
|
|
||||||
Environment variables override the default commands:
|
|
||||||
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
|
|
||||||
RMPROG STRIPPROG
|
|
||||||
"
|
|
||||||
|
|
||||||
while test $# -ne 0; do
|
|
||||||
case $1 in
|
|
||||||
-c) ;;
|
|
||||||
|
|
||||||
-C) copy_on_change=true;;
|
|
||||||
|
|
||||||
-d) dir_arg=true;;
|
|
||||||
|
|
||||||
-g) chgrpcmd="$chgrpprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
--help) echo "$usage"; exit $?;;
|
|
||||||
|
|
||||||
-m) mode=$2
|
|
||||||
case $mode in
|
|
||||||
*' '* | *' '* | *'
|
|
||||||
'* | *'*'* | *'?'* | *'['*)
|
|
||||||
echo "$0: invalid mode: $mode" >&2
|
|
||||||
exit 1;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-o) chowncmd="$chownprog $2"
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-s) stripcmd=$stripprog;;
|
|
||||||
|
|
||||||
-t) dst_arg=$2
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
shift;;
|
|
||||||
|
|
||||||
-T) no_target_directory=true;;
|
|
||||||
|
|
||||||
--version) echo "$0 $scriptversion"; exit $?;;
|
|
||||||
|
|
||||||
--) shift
|
|
||||||
break;;
|
|
||||||
|
|
||||||
-*) echo "$0: invalid option: $1" >&2
|
|
||||||
exit 1;;
|
|
||||||
|
|
||||||
*) break;;
|
|
||||||
esac
|
|
||||||
shift
|
|
||||||
done
|
|
||||||
|
|
||||||
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
|
|
||||||
# When -d is used, all remaining arguments are directories to create.
|
|
||||||
# When -t is used, the destination is already specified.
|
|
||||||
# Otherwise, the last argument is the destination. Remove it from $@.
|
|
||||||
for arg
|
|
||||||
do
|
|
||||||
if test -n "$dst_arg"; then
|
|
||||||
# $@ is not empty: it contains at least $arg.
|
|
||||||
set fnord "$@" "$dst_arg"
|
|
||||||
shift # fnord
|
|
||||||
fi
|
|
||||||
shift # arg
|
|
||||||
dst_arg=$arg
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $dst_arg in
|
|
||||||
-* | [=\(\)!]) dst_arg=./$dst_arg;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test $# -eq 0; then
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
echo "$0: no input file specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
# It's OK to call 'install-sh -d' without argument.
|
|
||||||
# This can happen when creating conditional directories.
|
|
||||||
exit 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dir_arg"; then
|
|
||||||
do_exit='(exit $ret); exit $ret'
|
|
||||||
trap "ret=129; $do_exit" 1
|
|
||||||
trap "ret=130; $do_exit" 2
|
|
||||||
trap "ret=141; $do_exit" 13
|
|
||||||
trap "ret=143; $do_exit" 15
|
|
||||||
|
|
||||||
# Set umask so as not to create temps with too-generous modes.
|
|
||||||
# However, 'strip' requires both read and write access to temps.
|
|
||||||
case $mode in
|
|
||||||
# Optimize common cases.
|
|
||||||
*644) cp_umask=133;;
|
|
||||||
*755) cp_umask=22;;
|
|
||||||
|
|
||||||
*[0-7])
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw='% 200'
|
|
||||||
fi
|
|
||||||
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
|
|
||||||
*)
|
|
||||||
if test -z "$stripcmd"; then
|
|
||||||
u_plus_rw=
|
|
||||||
else
|
|
||||||
u_plus_rw=,u+rw
|
|
||||||
fi
|
|
||||||
cp_umask=$mode$u_plus_rw;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
for src
|
|
||||||
do
|
|
||||||
# Protect names problematic for 'test' and other utilities.
|
|
||||||
case $src in
|
|
||||||
-* | [=\(\)!]) src=./$src;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
dst=$src
|
|
||||||
dstdir=$dst
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
else
|
|
||||||
|
|
||||||
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
|
|
||||||
# might cause directories to be created, which would be especially bad
|
|
||||||
# if $src (and thus $dsttmp) contains '*'.
|
|
||||||
if test ! -f "$src" && test ! -d "$src"; then
|
|
||||||
echo "$0: $src does not exist." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -z "$dst_arg"; then
|
|
||||||
echo "$0: no destination specified." >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dst=$dst_arg
|
|
||||||
|
|
||||||
# If destination is a directory, append the input filename; won't work
|
|
||||||
# if double slashes aren't ignored.
|
|
||||||
if test -d "$dst"; then
|
|
||||||
if test -n "$no_target_directory"; then
|
|
||||||
echo "$0: $dst_arg: Is a directory" >&2
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
dstdir=$dst
|
|
||||||
dst=$dstdir/`basename "$src"`
|
|
||||||
dstdir_status=0
|
|
||||||
else
|
|
||||||
# Prefer dirname, but fall back on a substitute if dirname fails.
|
|
||||||
dstdir=`
|
|
||||||
(dirname "$dst") 2>/dev/null ||
|
|
||||||
expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
|
|
||||||
X"$dst" : 'X\(//\)[^/]' \| \
|
|
||||||
X"$dst" : 'X\(//\)$' \| \
|
|
||||||
X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
|
|
||||||
echo X"$dst" |
|
|
||||||
sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\/\)[^/].*/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\/\)$/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
/^X\(\/\).*/{
|
|
||||||
s//\1/
|
|
||||||
q
|
|
||||||
}
|
|
||||||
s/.*/./; q'
|
|
||||||
`
|
|
||||||
|
|
||||||
test -d "$dstdir"
|
|
||||||
dstdir_status=$?
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
obsolete_mkdir_used=false
|
|
||||||
|
|
||||||
if test $dstdir_status != 0; then
|
|
||||||
case $posix_mkdir in
|
|
||||||
'')
|
|
||||||
# Create intermediate dirs using mode 755 as modified by the umask.
|
|
||||||
# This is like FreeBSD 'install' as of 1997-10-28.
|
|
||||||
umask=`umask`
|
|
||||||
case $stripcmd.$umask in
|
|
||||||
# Optimize common cases.
|
|
||||||
*[2367][2367]) mkdir_umask=$umask;;
|
|
||||||
.*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
|
|
||||||
|
|
||||||
*[0-7])
|
|
||||||
mkdir_umask=`expr $umask + 22 \
|
|
||||||
- $umask % 100 % 40 + $umask % 20 \
|
|
||||||
- $umask % 10 % 4 + $umask % 2
|
|
||||||
`;;
|
|
||||||
*) mkdir_umask=$umask,go-w;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
# With -d, create the new directory with the user-specified mode.
|
|
||||||
# Otherwise, rely on $mkdir_umask.
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
mkdir_mode=-m$mode
|
|
||||||
else
|
|
||||||
mkdir_mode=
|
|
||||||
fi
|
|
||||||
|
|
||||||
posix_mkdir=false
|
|
||||||
case $umask in
|
|
||||||
*[123567][0-7][0-7])
|
|
||||||
# POSIX mkdir -p sets u+wx bits regardless of umask, which
|
|
||||||
# is incompatible with FreeBSD 'install' when (umask & 300) != 0.
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
|
|
||||||
trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
|
|
||||||
|
|
||||||
if (umask $mkdir_umask &&
|
|
||||||
exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
if test -z "$dir_arg" || {
|
|
||||||
# Check for POSIX incompatibilities with -m.
|
|
||||||
# HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
|
|
||||||
# other-writable bit of parent directory when it shouldn't.
|
|
||||||
# FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
|
|
||||||
ls_ld_tmpdir=`ls -ld "$tmpdir"`
|
|
||||||
case $ls_ld_tmpdir in
|
|
||||||
d????-?r-*) different_mode=700;;
|
|
||||||
d????-?--*) different_mode=755;;
|
|
||||||
*) false;;
|
|
||||||
esac &&
|
|
||||||
$mkdirprog -m$different_mode -p -- "$tmpdir" && {
|
|
||||||
ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
|
|
||||||
test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
then posix_mkdir=:
|
|
||||||
fi
|
|
||||||
rmdir "$tmpdir/d" "$tmpdir"
|
|
||||||
else
|
|
||||||
# Remove any dirs left behind by ancient mkdir implementations.
|
|
||||||
rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
|
|
||||||
fi
|
|
||||||
trap '' 0;;
|
|
||||||
esac;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
if
|
|
||||||
$posix_mkdir && (
|
|
||||||
umask $mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
|
|
||||||
)
|
|
||||||
then :
|
|
||||||
else
|
|
||||||
|
|
||||||
# The umask is ridiculous, or mkdir does not conform to POSIX,
|
|
||||||
# or it failed possibly due to a race condition. Create the
|
|
||||||
# directory the slow way, step by step, checking for races as we go.
|
|
||||||
|
|
||||||
case $dstdir in
|
|
||||||
/*) prefix='/';;
|
|
||||||
[-=\(\)!]*) prefix='./';;
|
|
||||||
*) prefix='';;
|
|
||||||
esac
|
|
||||||
|
|
||||||
eval "$initialize_posix_glob"
|
|
||||||
|
|
||||||
oIFS=$IFS
|
|
||||||
IFS=/
|
|
||||||
$posix_glob set -f
|
|
||||||
set fnord $dstdir
|
|
||||||
shift
|
|
||||||
$posix_glob set +f
|
|
||||||
IFS=$oIFS
|
|
||||||
|
|
||||||
prefixes=
|
|
||||||
|
|
||||||
for d
|
|
||||||
do
|
|
||||||
test X"$d" = X && continue
|
|
||||||
|
|
||||||
prefix=$prefix$d
|
|
||||||
if test -d "$prefix"; then
|
|
||||||
prefixes=
|
|
||||||
else
|
|
||||||
if $posix_mkdir; then
|
|
||||||
(umask=$mkdir_umask &&
|
|
||||||
$doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
test -d "$prefix" || exit 1
|
|
||||||
else
|
|
||||||
case $prefix in
|
|
||||||
*\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
|
|
||||||
*) qprefix=$prefix;;
|
|
||||||
esac
|
|
||||||
prefixes="$prefixes '$qprefix'"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
prefix=$prefix/
|
|
||||||
done
|
|
||||||
|
|
||||||
if test -n "$prefixes"; then
|
|
||||||
# Don't fail if two instances are running concurrently.
|
|
||||||
(umask $mkdir_umask &&
|
|
||||||
eval "\$doit_exec \$mkdirprog $prefixes") ||
|
|
||||||
test -d "$dstdir" || exit 1
|
|
||||||
obsolete_mkdir_used=true
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
if test -n "$dir_arg"; then
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dst"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } &&
|
|
||||||
{ test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false ||
|
|
||||||
test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1
|
|
||||||
else
|
|
||||||
|
|
||||||
# Make a couple of temp file names in the proper directory.
|
|
||||||
dsttmp=$dstdir/_inst.$$_
|
|
||||||
rmtmp=$dstdir/_rm.$$_
|
|
||||||
|
|
||||||
# Trap to clean up those temp files at exit.
|
|
||||||
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
|
|
||||||
|
|
||||||
# Copy the file name to the temp name.
|
|
||||||
(umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
|
|
||||||
|
|
||||||
# and set any options; do chmod last to preserve setuid bits.
|
|
||||||
#
|
|
||||||
# If any of these fail, we abort the whole thing. If we want to
|
|
||||||
# ignore errors from any of these, just make sure not to ignore
|
|
||||||
# errors from the above "$doit $cpprog $src $dsttmp" command.
|
|
||||||
#
|
|
||||||
{ test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } &&
|
|
||||||
{ test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } &&
|
|
||||||
|
|
||||||
# If -C, don't bother to copy if it wouldn't change the file.
|
|
||||||
if $copy_on_change &&
|
|
||||||
old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
|
|
||||||
new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
|
|
||||||
|
|
||||||
eval "$initialize_posix_glob" &&
|
|
||||||
$posix_glob set -f &&
|
|
||||||
set X $old && old=:$2:$4:$5:$6 &&
|
|
||||||
set X $new && new=:$2:$4:$5:$6 &&
|
|
||||||
$posix_glob set +f &&
|
|
||||||
|
|
||||||
test "$old" = "$new" &&
|
|
||||||
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
|
|
||||||
then
|
|
||||||
rm -f "$dsttmp"
|
|
||||||
else
|
|
||||||
# Rename the file to the real destination.
|
|
||||||
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
|
|
||||||
|
|
||||||
# The rename failed, perhaps because mv can't rename something else
|
|
||||||
# to itself, or perhaps because mv is so ancient that it does not
|
|
||||||
# support -f.
|
|
||||||
{
|
|
||||||
# Now remove or move aside any old file at destination location.
|
|
||||||
# We try this two ways since rm can't unlink itself on some
|
|
||||||
# systems and the destination file might be busy for other
|
|
||||||
# reasons. In this case, the final cleanup might fail but the new
|
|
||||||
# file should still install successfully.
|
|
||||||
{
|
|
||||||
test ! -f "$dst" ||
|
|
||||||
$doit $rmcmd -f "$dst" 2>/dev/null ||
|
|
||||||
{ $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
|
|
||||||
{ $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
|
|
||||||
} ||
|
|
||||||
{ echo "$0: cannot unlink or rename $dst" >&2
|
|
||||||
(exit 1); exit 1
|
|
||||||
}
|
|
||||||
} &&
|
|
||||||
|
|
||||||
# Now rename the file to the real destination.
|
|
||||||
$doit $mvcmd "$dsttmp" "$dst"
|
|
||||||
}
|
|
||||||
fi || exit 1
|
|
||||||
|
|
||||||
trap '' 0
|
|
||||||
fi
|
|
||||||
done
|
|
||||||
|
|
||||||
# Local variables:
|
|
||||||
# eval: (add-hook 'write-file-hooks 'time-stamp)
|
|
||||||
# time-stamp-start: "scriptversion="
|
|
||||||
# time-stamp-format: "%:y-%02m-%02d.%02H"
|
|
||||||
# time-stamp-time-zone: "UTC"
|
|
||||||
# time-stamp-end: "; # UTC"
|
|
||||||
# End:
|
|
550
m4/python.m4
550
m4/python.m4
@ -1,550 +0,0 @@
|
|||||||
# Copyright 2012 Brandon Invergo <brandon@invergo.net>
|
|
||||||
#
|
|
||||||
# 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. This file is offered as-is,
|
|
||||||
# without any warranty.
|
|
||||||
|
|
||||||
# Many of these macros were adapted from ones written by Andrew Dalke
|
|
||||||
# and James Henstridge and are included with the Automake utility
|
|
||||||
# under the following copyright terms:
|
|
||||||
#
|
|
||||||
# Copyright (C) 1999-2012 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.
|
|
||||||
|
|
||||||
# Table of Contents:
|
|
||||||
#
|
|
||||||
# 1. Language selection
|
|
||||||
# and routines to produce programs in a given language.
|
|
||||||
#
|
|
||||||
# 2. Producing programs in a given language.
|
|
||||||
#
|
|
||||||
# 3. Looking for a compiler
|
|
||||||
# And possibly the associated preprocessor.
|
|
||||||
#
|
|
||||||
# 4. Looking for specific libs & functionality
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------------- ##
|
|
||||||
## 1. Language selection. ##
|
|
||||||
## ----------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# AC_LANG(Python)
|
|
||||||
# ---------------
|
|
||||||
AC_LANG_DEFINE([Python], [py], [PY], [PYTHON], [],
|
|
||||||
[ac_ext=py
|
|
||||||
ac_compile='chmod +x conftest.$ac_ext >&AS_MESSAGE_LOG_FD'
|
|
||||||
ac_link='chmod +x conftest.$ac_ext && cp conftest.$ac_ext conftest >&AS_MESSAGE_LOG_FD'
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# AC_LANG_PYTHON
|
|
||||||
# --------------
|
|
||||||
AU_DEFUN([AC_LANG_PYTHON], [AC_LANG(Python)])
|
|
||||||
|
|
||||||
|
|
||||||
## ----------------------- ##
|
|
||||||
## 2. Producing programs. ##
|
|
||||||
## ----------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# AC_LANG_PROGRAM(Python)([PROLOGUE], [BODY])
|
|
||||||
# -------------------------------------------
|
|
||||||
m4_define([AC_LANG_PROGRAM(Python)], [dnl
|
|
||||||
@%:@!$PYTHON
|
|
||||||
$1
|
|
||||||
m4_if([$2], [], [], [dnl
|
|
||||||
if __name__ == '__main__':
|
|
||||||
$2])])
|
|
||||||
|
|
||||||
|
|
||||||
# _AC_LANG_IO_PROGRAM(Python)
|
|
||||||
# ---------------------------
|
|
||||||
# Produce source that performs I/O.
|
|
||||||
m4_define([_AC_LANG_IO_PROGRAM(Python)],
|
|
||||||
[AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
h = open('conftest.out')
|
|
||||||
except:
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
close(h)
|
|
||||||
sys.exit(0)
|
|
||||||
], [])])
|
|
||||||
|
|
||||||
|
|
||||||
# _AC_LANG_CALL(Python)([PROLOGUE], [FUNCTION])
|
|
||||||
# ---------------------
|
|
||||||
# Produce source that calls FUNCTION
|
|
||||||
m4_define([_AC_LANG_CALL(Python)],
|
|
||||||
[AC_LANG_PROGRAM([$1], [$2])])
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
## -------------------------------------------- ##
|
|
||||||
## 3. Looking for Compilers and Interpreters. ##
|
|
||||||
## -------------------------------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
AC_DEFUN([AC_LANG_COMPILER(Python)],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])])
|
|
||||||
|
|
||||||
|
|
||||||
# AC_PROG_PYTHON(PROG-TO-CHECK-FOR)
|
|
||||||
# ---------------------------------
|
|
||||||
# Find a Python interpreter. Python versions prior to 2.0 are not
|
|
||||||
# supported. (2.0 was released on October 16, 2000).
|
|
||||||
AC_DEFUN([AC_PROG_PYTHON],
|
|
||||||
[AC_ARG_VAR([PYTHON], [the Python interpreter])
|
|
||||||
m4_define_default([_PC_PYTHON_INTERPRETER_LIST],
|
|
||||||
[python python3 python3.2 python3.1 python3.0 python2 python2.7 dnl
|
|
||||||
python2.6 python2.5 python2.4 python2.3 python2.2 python2.1 python2.0])
|
|
||||||
m4_ifval([$1],
|
|
||||||
[AC_PATH_PROGS(PYTHON, [$1 _PC_PYTHON_INTERPRETER_LIST])],
|
|
||||||
[AC_PATH_PROGS(PYTHON, [_PC_PYTHON_INTERPRETER_LIST])])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_PROG_PYTHON_CONFIG(PROG-TO-CHECK-FOR)
|
|
||||||
# ----------------------------------------------
|
|
||||||
# Find the python-config program
|
|
||||||
AC_DEFUN([PC_PYTHON_PROG_PYTHON_CONFIG],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
AC_ARG_VAR([PYTHON_CONFIG], [the Python-config program])
|
|
||||||
m4_define([_PYTHON_BASENAME], [`basename $PYTHON`])
|
|
||||||
m4_ifval([$1],
|
|
||||||
[AC_PATH_PROGS(PYTHON_CONFIG, [$1 _PYTHON_BASENAME-config])],
|
|
||||||
[AC_PATH_PROG(PYTHON_CONFIG, _PYTHON_BASENAME-config)])
|
|
||||||
]) # PC_PYTHON_PROG_PYTHON_CONFIG
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_VERIFY_VERSION(PYTHON-PROGRAM, VERSION, [ACTION-IF-TRUE], [ACTION-IF-NOT-FOUND])
|
|
||||||
# ---------------------------------------------------------------------------
|
|
||||||
# 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.
|
|
||||||
# This supports Python 2.0 or higher. (2.0 was released on October 16, 2000).
|
|
||||||
AC_DEFUN([PC_PYTHON_VERIFY_VERSION],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
m4_define([pc_python_safe_ver], m4_bpatsubsts($2, [\.], [_]))
|
|
||||||
AC_CACHE_CHECK([if Python >= '$2'],
|
|
||||||
[[pc_cv_python_min_version_]pc_python_safe_ver],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
AC_RUN_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
], [dnl
|
|
||||||
# split strings by '.' and convert to numeric. Append some zeros
|
|
||||||
# because we need at least 4 digits for the hex conversion.
|
|
||||||
# map returns an iterator in Python 3.0 and a list in 2.x
|
|
||||||
minver = list(map(int, '$2'.split('.'))) + [[0, 0, 0]]
|
|
||||||
minverhex = 0
|
|
||||||
# xrange is not present in Python 3.0 and range returns an iterator
|
|
||||||
for i in list(range(4)):
|
|
||||||
minverhex = (minverhex << 8) + minver[[i]]
|
|
||||||
sys.exit(sys.hexversion < minverhex)
|
|
||||||
])],
|
|
||||||
[[pc_cv_python_min_version_]pc_python_safe_ver="yes"],
|
|
||||||
[[pc_cv_python_min_version_]pc_python_safe_ver="no"])
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
])
|
|
||||||
AS_IF([test "$[pc_cv_python_min_version_]pc_python_safe_ver" = "no"], [$4], [$3])
|
|
||||||
])# PC_PYTHON_VERIFY_VERSION
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_VERSION
|
|
||||||
# -----------------------
|
|
||||||
# Query Python for its version number. Getting [:3] seems to be
|
|
||||||
# the best way to do this; it's what "site.py" does in the standard
|
|
||||||
# library.
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_VERSION],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
AC_CACHE_CHECK([for $1 version],
|
|
||||||
[pc_cv_python_version],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
AC_LANG_CONFTEST([
|
|
||||||
AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
], [dnl
|
|
||||||
sys.stdout.write(sys.version[[:3]])
|
|
||||||
])])
|
|
||||||
pc_cv_python_version=`$PYTHON conftest.py`
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_VERSION], [$pc_cv_python_version])
|
|
||||||
])# PC_PYTHON_CHECK_VERSION
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_PREFIX
|
|
||||||
# ----------------------
|
|
||||||
# Use the value of $prefix for the corresponding value of
|
|
||||||
# PYTHON_PREFIX. This is made a distinct variable so it can be
|
|
||||||
# overridden if need be. However, general consensus is that you
|
|
||||||
# shouldn't need this ability.
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_PREFIX],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python prefix], [pc_cv_python_prefix],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_prefix=`$PYTHON_CONFIG --prefix 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
AC_LANG_PUSH(Python)[]dnl
|
|
||||||
pc_cv_python_prefix=AC_LANG_CONFTEST([AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
], [dnl
|
|
||||||
sys.exit(sys.prefix)
|
|
||||||
])])
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
fi])
|
|
||||||
AC_SUBST([PYTHON_PREFIX], [$pc_cv_python_prefix])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_EXEC_PREFIX
|
|
||||||
# --------------------------
|
|
||||||
# Like above, but for $exec_prefix
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_EXEC_PREFIX],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python exec-prefix], [pc_cv_python_exec_prefix],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_exec_prefix=`$PYTHON_CONFIG --exec-prefix 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
AC_LANG_PUSH(Python)[]dnl
|
|
||||||
pc_cv_python_exec_prefix=AC_LANG_CONFTEST([AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
], [dnl
|
|
||||||
sys.exit(sys.exec_prefix)
|
|
||||||
])])
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_EXEC_PREFIX], [$pc_cv_python_exec_prefix])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_INCLUDES
|
|
||||||
# ------------------------
|
|
||||||
# Find the Python header file include flags (ie
|
|
||||||
# '-I/usr/include/python')
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_INCLUDES],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python includes], [pc_cv_python_includes],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_includes=`$PYTHON_CONFIG --includes 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_includes="[-I$includedir/$_PYTHON_BASENAME]m4_ifdef(PYTHON_ABI_FLAGS,
|
|
||||||
PYTHON_ABI_FLAGS,)"
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_INCLUDES], [$pc_cv_python_includes])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_HEADERS([ACTION-IF-PRESENT], [ACTION-IF-ABSENT])
|
|
||||||
# -----------------------
|
|
||||||
# Check for the presence and usability of Python.h
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_HEADERS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_CHECK_INCLUDES])[]dnl
|
|
||||||
pc_cflags_store=$CPPFLAGS
|
|
||||||
CPPFLAGS="$CFLAGS $PYTHON_INCLUDES"
|
|
||||||
AC_CHECK_HEADER([Python.h], [$1], [$2])
|
|
||||||
CPPFLAGS=$pc_cflags_store
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_LIBS
|
|
||||||
# --------------------
|
|
||||||
# Find the Python lib flags (ie '-lpython')
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_LIBS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python libs], [pc_cv_python_libs],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_libs=`$PYTHON_CONFIG --libs 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_libs="[-l$_PYTHON_BASENAME]m4_ifdef(PYTHON_ABI_FLAGS, PYTHON_ABI_FLAGS,)"
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_LIBS], [$pc_cv_python_libs])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_TEST_LIBS(LIBRARY-FUNCTION, [ACTION-IF-PRESENT], [ACTION-IF-ABSENT])
|
|
||||||
# -------------------
|
|
||||||
# Verify that the Python libs can be loaded
|
|
||||||
AC_DEFUN([PC_PYTHON_TEST_LIBS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_CHECK_LIBS])[]dnl
|
|
||||||
pc_libflags_store=$LIBS
|
|
||||||
for lflag in $PYTHON_LIBS; do
|
|
||||||
case $lflag in
|
|
||||||
-lpython*@:}@
|
|
||||||
LIBS="$LIBS $lflag"
|
|
||||||
pc_libpython=`echo $lflag | sed -e 's/^-l//'`
|
|
||||||
;;
|
|
||||||
*@:}@;;
|
|
||||||
esac
|
|
||||||
done
|
|
||||||
AC_CHECK_LIB([$pc_libpython], [$1], [$2], [$3])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_CFLAGS
|
|
||||||
# ----------------------
|
|
||||||
# Find the Python CFLAGS
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_CFLAGS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python CFLAGS], [pc_cv_python_cflags],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_cflags=`$PYTHON_CONFIG --cflags 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_cflags=
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_CFLAGS], [$pc_cv_python_cflags])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_LDFLAGS
|
|
||||||
# -----------------------
|
|
||||||
# Find the Python LDFLAGS
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_LDFLAGS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python LDFLAGS], [pc_cv_python_ldflags],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_ldflags=`$PYTHON_CONFIG --ldflags 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_ldflags=
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_LDFLAGS], [$pc_cv_python_ldflags])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_EXTENSION_SUFFIX
|
|
||||||
# --------------------------------
|
|
||||||
# Find the Python extension suffix (i.e. '.cpython-32.so')
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_EXTENSION_SUFFIX],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python extension suffix], [pc_cv_python_extension_suffix],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_extension_suffix=`$PYTHON_CONFIG --extension-suffix 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_extension_suffix=
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_EXTENSION_SUFFIX], [$pc_cv_python_extension_suffix])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_ABI_FLAGS
|
|
||||||
# -------------------------
|
|
||||||
# Find the Python ABI flags
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_ABI_FLAGS],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_PROG_PYTHON_CONFIG])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python ABI flags], [pc_cv_python_abi_flags],
|
|
||||||
[if test -x "$PYTHON_CONFIG"; then
|
|
||||||
pc_cv_python_abi_flags=`$PYTHON_CONFIG --abiflags 2>> AS_MESSAGE_LOG_FD`
|
|
||||||
else
|
|
||||||
pc_cv_python_abi_flags=
|
|
||||||
fi
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_ABI_FLAGS], [$pc_cv_python_abi_flags])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_PLATFORM
|
|
||||||
# ------------------------
|
|
||||||
# At times (like when building shared libraries) you may want
|
|
||||||
# to know which OS platform Python thinks this is.
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_PLATFORM],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python platform],
|
|
||||||
[pc_cv_python_platform],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
AC_LANG_CONFTEST([
|
|
||||||
AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
], [dnl
|
|
||||||
sys.stdout.write(sys.platform)
|
|
||||||
])])
|
|
||||||
pc_cv_python_platform=`$PYTHON conftest.py`
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
])
|
|
||||||
AC_SUBST([PYTHON_PLATFORM], [$pc_cv_python_platform])
|
|
||||||
])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_SITE_DIR
|
|
||||||
# ---------------------
|
|
||||||
# The directory to which new libraries are installed (i.e. the
|
|
||||||
# "site-packages" directory.
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_SITE_DIR],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])AC_REQUIRE([PC_PYTHON_CHECK_PREFIX])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python site-packages directory],
|
|
||||||
[pc_cv_python_site_dir],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
if test "x$prefix" = xNONE
|
|
||||||
then
|
|
||||||
pc_py_prefix=$ac_default_prefix
|
|
||||||
else
|
|
||||||
pc_py_prefix=$prefix
|
|
||||||
fi
|
|
||||||
AC_LANG_CONFTEST([
|
|
||||||
AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
import sysconfig
|
|
||||||
except:
|
|
||||||
from distutils import sysconfig
|
|
||||||
sitedir = sysconfig.get_python_lib(False, False, prefix='$pc_py_prefix')
|
|
||||||
else:
|
|
||||||
sitedir = sysconfig.get_path('purelib', vars={'base':'$pc_py_prefix'})
|
|
||||||
], [dnl
|
|
||||||
sys.stdout.write(sitedir)
|
|
||||||
])])
|
|
||||||
pc_cv_python_site_dir=`$PYTHON conftest.py`
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
case $pc_cv_python_site_dir in
|
|
||||||
$pc_py_prefix*)
|
|
||||||
pc__strip_prefix=`echo "$pc_py_prefix" | sed 's|.|.|g'`
|
|
||||||
pc_cv_python_site_dir=`echo "$pc_cv_python_site_dir" | sed "s,^$pc__strip_prefix/,,"`
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case $pc_py_prefix in
|
|
||||||
/usr|/System*) ;;
|
|
||||||
*)
|
|
||||||
pc_cv_python_site_dir=lib/python$PYTHON_VERSION/site-packages
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
])
|
|
||||||
AC_SUBST([pythondir], [\${prefix}/$pc_cv_python_site_dir])])# PC_PYTHON_CHECK_SITE_DIR
|
|
||||||
])
|
|
||||||
|
|
||||||
# PC_PYTHON_SITE_PACKAGE_DIR
|
|
||||||
# --------------------------
|
|
||||||
# $PACKAGE directory under PYTHON_SITE_DIR
|
|
||||||
AC_DEFUN([PC_PYTHON_SITE_PACKAGE_DIR],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_CHECK_SITE_DIR])[]dnl
|
|
||||||
AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE])])
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_EXEC_DIR
|
|
||||||
# ------------------------
|
|
||||||
# directory for installing python extension modules (shared libraries)
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_EXEC_DIR],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])AC_REQUIRE([PC_PYTHON_CHECK_EXEC_PREFIX])[]dnl
|
|
||||||
AC_CACHE_CHECK([for Python extension module directory],
|
|
||||||
[pc_cv_python_exec_dir],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
if test "x$pc_cv_python_exec_prefix" = xNONE
|
|
||||||
then
|
|
||||||
pc_py_exec_prefix=$pc_cv_python_prefix
|
|
||||||
else
|
|
||||||
pc_py_exec_prefix=$pc_cv_python_exec_prefix
|
|
||||||
fi
|
|
||||||
AC_LANG_CONFTEST([
|
|
||||||
AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
import sysconfig
|
|
||||||
except:
|
|
||||||
from distutils import sysconfig
|
|
||||||
sitedir = sysconfig.get_python_lib(True, False, prefix='$pc_py_exec_prefix')
|
|
||||||
else:
|
|
||||||
sitedir = sysconfig.get_path('platlib', vars={'platbase':'$pc_py_exec_prefix'})
|
|
||||||
], [dnl
|
|
||||||
sys.stdout.write(sitedir)
|
|
||||||
])])
|
|
||||||
pc_cv_python_exec_dir=`$PYTHON conftest.py`
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
case $pc_cv_python_exec_dir in
|
|
||||||
$pc_py_exec_prefix*)
|
|
||||||
pc__strip_prefix=`echo "$pc_py_exec_prefix" | sed 's|.|.|g'`
|
|
||||||
pc_cv_python_exec_dir=`echo "$pc_cv_python_exec_dir" | sed "s,^$pc__strip_prefix/,,"`
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
case $pc_py_exec_prefix in
|
|
||||||
/usr|/System*) ;;
|
|
||||||
*)
|
|
||||||
pc_cv_python_exec_dir=lib/python$PYTHON_VERSION/site-packages
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
])
|
|
||||||
AC_SUBST([pyexecdir], [\${exec_prefix}/$pc_cv_python_pyexecdir])]) #PY_PYTHON_CHECK_EXEC_LIB_DIR
|
|
||||||
])
|
|
||||||
|
|
||||||
# PC_PYTHON_EXEC_PACKAGE_DIR
|
|
||||||
# --------------------------
|
|
||||||
# $PACKAGE directory under PYTHON_SITE_DIR
|
|
||||||
AC_DEFUN([PC_PYTHON_EXEC_PACKAGE_DIR],
|
|
||||||
[AC_REQUIRE([PC_PYTHON_CHECK_EXEC_DIR])[]dnl
|
|
||||||
AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE])])
|
|
||||||
|
|
||||||
|
|
||||||
## -------------------------------------------- ##
|
|
||||||
## 4. Looking for specific libs & functionality ##
|
|
||||||
## -------------------------------------------- ##
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_MODULE(LIBRARY, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
||||||
# ----------------------------------------------------------------------
|
|
||||||
# Macro for checking if a Python library is installed
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_MODULE],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
m4_define([pc_python_safe_mod], m4_bpatsubsts($1, [\.], [_]))
|
|
||||||
AC_CACHE_CHECK([for Python '$1' library],
|
|
||||||
[[pc_cv_python_module_]pc_python_safe_mod],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
AC_RUN_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
try:
|
|
||||||
import $1
|
|
||||||
except:
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
sys.exit(0)
|
|
||||||
], [])],
|
|
||||||
[[pc_cv_python_module_]pc_python_safe_mod="yes"],
|
|
||||||
[[pc_cv_python_module_]pc_python_safe_mod="no"])
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
])
|
|
||||||
AS_IF([test "$[pc_cv_python_module_]pc_python_safe_mod" = "no"], [$3], [$2])
|
|
||||||
])# PC_PYTHON_CHECK_MODULE
|
|
||||||
|
|
||||||
|
|
||||||
# PC_PYTHON_CHECK_FUNC([LIBRARY], FUNCTION, ARGS, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND])
|
|
||||||
# ---------------------------------------------------------------------------------------
|
|
||||||
# Check to see if a given function call, optionally from a module, can
|
|
||||||
# be successfully called
|
|
||||||
AC_DEFUN([PC_PYTHON_CHECK_FUNC],
|
|
||||||
[AC_REQUIRE([AC_PROG_PYTHON])[]dnl
|
|
||||||
m4_define([pc_python_safe_mod], m4_bpatsubsts($1, [\.], [_]))
|
|
||||||
AC_CACHE_CHECK([for Python m4_ifnblank($1, '$1.$2()', '$2()') function],
|
|
||||||
[[pc_cv_python_func_]pc_python_safe_mod[_$2]],
|
|
||||||
[AC_LANG_PUSH(Python)[]dnl
|
|
||||||
AC_RUN_IFELSE(
|
|
||||||
[AC_LANG_PROGRAM([dnl
|
|
||||||
import sys
|
|
||||||
m4_ifnblank([$1], [dnl
|
|
||||||
try:
|
|
||||||
import $1
|
|
||||||
except:
|
|
||||||
sys.exit(1)
|
|
||||||
], [])],
|
|
||||||
[
|
|
||||||
m4_ifnblank([$1], [
|
|
||||||
try:
|
|
||||||
$1.$2($3)], [
|
|
||||||
try:
|
|
||||||
$2($3)])
|
|
||||||
except:
|
|
||||||
sys.exit(1)
|
|
||||||
else:
|
|
||||||
sys.exit(0)
|
|
||||||
])],
|
|
||||||
[[pc_cv_python_func_]pc_python_safe_mod[_$2]="yes"],
|
|
||||||
[[pc_cv_python_func_]pc_python_safe_mod[_$2]="no"])
|
|
||||||
AC_LANG_POP(Python)[]dnl
|
|
||||||
])
|
|
||||||
AS_IF([test "$[pc_cv_python_func_]pc_python_safe_mod[_$2]" = "no"], [$5], [$4])
|
|
||||||
])# PC_PYTHON_CHECK_FUNC
|
|
Loading…
x
Reference in New Issue
Block a user