gsrc-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gsrc-commit] /srv/bzr/gsrc/trunk r1334: remove python-configure stuff s


From: Brandon Invergo
Subject: [Gsrc-commit] /srv/bzr/gsrc/trunk r1334: remove python-configure stuff since it is a separate gnu pkg now
Date: Fri, 07 Dec 2012 00:56:09 +0100
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 1334
committer: Brandon Invergo <address@hidden>
branch nick: trunk
timestamp: Fri 2012-12-07 00:56:09 +0100
message:
  remove python-configure stuff since it is a separate gnu pkg now
removed:
  util/python-configure/
  util/python-configure/Makefile.in
  util/python-configure/configure.ac
  util/python-configure/m4/
  util/python-configure/m4/python.m4
modified:
  TODO
  doc/gsrc.texi
=== modified file 'TODO'
--- a/TODO      2012-11-25 22:05:34 +0000
+++ b/TODO      2012-12-06 23:56:09 +0000
@@ -145,5 +145,5 @@
 ** swbis: won't include tar.h properly(?)
 ** termutils: weird string.h build error
 ** xlogmaster: gnome hell
-** zrtp: cmake hell
+
 

=== modified file 'doc/gsrc.texi'
--- a/doc/gsrc.texi     2012-10-17 22:05:31 +0000
+++ b/doc/gsrc.texi     2012-12-06 23:56:09 +0000
@@ -73,10 +73,6 @@
 * Package configuration::
 * Maintaining multiple versions of a package::
 
-Appendix
-
-* Configuring Python packages
-
 @end detailmenu
 @end menu
 
@@ -398,7 +394,7 @@
 @end example
 
 
address@hidden Advanced configuration, Appendix, Getting started, Top
address@hidden Advanced configuration, GNU Free Documentation License, Getting 
started, Top
 @chapter Advanced configuration
 
 The default behavior of GSRC may be configured, both globally and for
@@ -572,220 +568,7 @@
 This would install the newly configured package to
 @file{/gnu/packages/hello-2.8-no-nls/}. 
 
address@hidden Appendix, GNU Free Documentation License, Advanced 
configuration, Top
address@hidden Appendix
-
address@hidden
-* Configuring Python packages::
address@hidden menu
-
address@hidden Configuring Python packages, , , Appendix
address@hidden Configuring Python packages
-
-Python packages are typically built using Python's distutils module or
-other similar methods. The result is a file called @file{setup.py},
-which the user runs, passing it directives similar to those passed to
-a standard Makefile. Creating a GSRC Makefile for a Python package is
-relatively uncomplicated, however it lacks the power of the
-traditional @file{configure}/@file{Makefile} paradigm. Furthermore,
-the GNU coding standards require a @file{configure} script when
-packaging a software release.
-
-In the interest of standardizing GSRC Makefiles for GNU packages as
-well as to provide maintainers of Python-based GNU packages an easy
-means of including standards-conforming @file{configure} and
address@hidden files, several files are included in GSRC for
-configuring Python projects. These files are located in the
address@hidden/python-configure/} directory in the GSRC package.
-
-The files may be included without modification in a Python project's
-directory. As such, they will provide a thin wrapper around the project's
address@hidden script. This configure script primarily allows the
-user to set the @code{--prefix} flag, as well as to define the
address@hidden variable declaring the location of the Python
-interpreter.
-
-These template files may, however, be greatly expanded and customized
-to fit the needs of a given software package. To this end, several
-Autoconf macros are included in the @file{m4/python.m4} file. This
-file defines Python as a language in Autoconf, meaning that, for
-example, you can include arbitrary Python code with
address@hidden Furthermore, several useful macros are defined:
-
address@hidden @columnfractions .33 .33 .33
address@hidden
-Macro Name & Arguments
address@hidden
-Description
address@hidden
-Variables exported
-
address@hidden
address@hidden([NAME-TO-CHECK])}
address@hidden
-Find a Python interpreter
address@hidden
address@hidden
-
address@hidden
address@hidden([NAME-TO-CHECK])}
address@hidden
-Find a python-config program
address@hidden
address@hidden
-
address@hidden
address@hidden(VERSION, [ACTION-IF-TRUE], [ACTION-IF-NOT-TRUE])}
address@hidden
-Verify that the Python interpreter is of a sufficient version number
address@hidden
-
address@hidden
address@hidden
address@hidden
-Get the version of the Python interpreter
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check what Python thinks is the prefix
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check what Python thinks is the exec_prefix
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check the include flags ('-I[header]...') for including the Python
-header files
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check for the Python header files (i.e. @file{Python.h})
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check for the proper LIBS flags to load the Python shared libraries
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Test for the presence of the Python shared libraries
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Find the CFLAGS that Python expects
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Find the LDFLAGS that Python expects
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check the extension suffix given to Python extension modules (Python 3
-only)
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check the ABI flags used by Python (Python 3 only)
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check what platform Python thinks this is
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check the appropriate place to install Python packages (i.e.
address@hidden(prefix)/lib/python2.7/site-packages})
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-A convenience macro; adds the package's name to @code{pythondir}
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Check directory for installing Python extension modules
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-A convenience macro; adds the package's name to @code{pyexecdir}
address@hidden
address@hidden
-
address@hidden
address@hidden
address@hidden
-Test if a given Python module can be successfully loaded
address@hidden
-
address@hidden
address@hidden
address@hidden
-Test if a given Python function can be called successfully.
address@hidden
address@hidden multitable
-
-Once these macros are integrated into your @file{configure.ac} file as
-necessary, simply run @code{autoconf} to generate a new
address@hidden script. The variables exported by this
address@hidden script may then be used in @file{Makefile.in} to
-influence the build process. 
-
-To include these scripts in a GSRC Makefile, simply create a .tar.gz
-archive including at least @file{configure}, @file{Makefile.in} and
address@hidden/}, such that the contents will extract into a directory called
address@hidden(DISTNAME)} (i.e. the contents should extract into a directory
-called ``mypackage-0.1/''). Put the archive into the @file{files/}
-sub-directory of the package's GSRC directory. Finally, simply add the
-archive's name to the @code{DISTFILES} list in the GSRC Makefile for
-the package and update the checksums file with @code{make
-makesums}. Now your GSRC Makefile can simply include
address@hidden/auto.mk} to automate the configuration and installation
-of the software.
-
address@hidden GNU Free Documentation License,  , Appendix, Top
address@hidden GNU Free Documentation License,  , Advanced configuration, Top
 @appendix GNU Free Documentation License
 
 @include fdl.texi

=== removed directory 'util/python-configure'
=== removed file 'util/python-configure/Makefile.in'
--- a/util/python-configure/Makefile.in 2012-09-22 14:25:13 +0000
+++ b/util/python-configure/Makefile.in 1970-01-01 00:00:00 +0000
@@ -1,135 +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@
-pythondir = @pythondir@
-pyexecdir = @pyexecdir@
-pkgdatadir = $(datadir)/@PACKAGE_NAME@
-pkgincludedir = $(includedir)/@PACKAGE_NAME@
-pkgpythondir = @pkgpythondir@
-pkgpyexecdir = @pkgpyexecdir@
-PYTHONPATH = $(pythondir)$(PATH_SEPARATOR)$(DESTDIR)$(pythondir)
-
-all: install
-
-.PHONY: all install uninstall distclean info install-html html install-pdf pdf 
install-dvi dvi install-ps ps clean dist check installdirs
-
-
-
-# Since installing to a virtualenv is all the rage these days, support it 
here. If the VIRTUALENV
-# variable is set to anything other than "no", set up a new virtualenv and 
install there, otherwise
-# install as usual from setup.py
-install: installdirs
-       $(NORMAL_INSTALL)
-ifneq ($(VIRTUALENV),no)
-       $(VIRTUALENV) $(VIRTUALENV_FLAGS) $(DESTDIR)$(prefix) || $(VIRTUALENV) 
$(DESTDIR)$(prefix)
-       $(DESTDIR)$(prefix)/bin/python $(srcdir)/setup.py install 
--prefix=$(DESTDIR)$(prefix)
-else
-       $(PYTHON) $(srcdir)/setup.py install --prefix=$(DESTDIR)$(prefix)
-endif
-
-
-# setup.py doesn't (yet) support an uninstall command, so until it does, you 
must manually remove
-# everything that was installed here
-uninstall: $(wildcard $(srcdir)/docs/source/*)
-       rm -rf $(pkgpythondir)
-
-
-# Just use the usual setup.py clean command
-clean:
-       $(PYTHON) setup.py clean
-
-
-# Clean up the output of configure
-distclean: $(wildcard $(srcdir)/docs/source/*)
-       rm $(srcdir)/config.log
-       rm $(srcdir)/config.status
-
-
-# The following show how to install documentation, following the example of 
GNU MediaGoblin
-# In that case, docs are built from a separate Makefile contained in the docs 
directory which
-# uses the SPHINXBUILD variable to store the location of the sphinx-build 
(Python doc tool) 
-# binary to use.
-
-# $(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:
-
-
-# Just use the setup.py sdist (source distribution) command
-dist:
-       $(PYTHON) setup.py sdist
-
-# Use the setup.py check command
-check:
-       $(PYTHON) setup.py check
-
-# setup.py might complain if a directory doesn't exist so just in case, make 
the directory
-# here
-installdirs:
-       $(MKDIR_P) $(DESTDIR)$(pkgpythondir)

=== removed file 'util/python-configure/configure.ac'
--- a/util/python-configure/configure.ac        2012-09-22 14:25:13 +0000
+++ b/util/python-configure/configure.ac        1970-01-01 00:00:00 +0000
@@ -1,96 +0,0 @@
-# Copyright 2012 Brandon Invergo <address@hidden>
-#
-# 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(projectname, projectversion)
-
-# 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 and it's not supported, look for the most recent Python 2 
-# interpreter
-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
-
-# If the program uses sphinx-build to build documentation, uncomment this to 
-# create a SPHINXBUILD variable in the Makefile pointing to the program
-#AC_CHECK_PROGS([SPHINXBUILD], [sphinx-build sphinx-build3 sphinx-build2], 
[no])
-#AS_IF([test "x$SPHINXBUILD" = xno], 
-#          AC_MSG_WARN(sphinx-build is required to build documentation))
-
-
-# Support installing to a virtualenv via the --with-virtualenv configure flag
-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])
-
-# A couple extra useful commands
-AC_PROG_MKDIR_P
-AC_PROG_INSTALL            
-
-# If your program requires the Python headers, uncomment this
-# PC_PYTHON_CHECK_HEADERS(,[AC_MSG_ERROR(could not find Python headers)])
-
-# Find out where Python packages should be installed
-PC_PYTHON_SITE_PACKAGE_DIR
-PC_PYTHON_EXEC_PACKAGE_DIR
-
-# Here you can check for the presence of prerequisite Python modules. Uncomment
-# these lines and adapt them to your needs
-#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

=== removed directory 'util/python-configure/m4'
=== removed file 'util/python-configure/m4/python.m4'
--- a/util/python-configure/m4/python.m4        2012-09-23 16:45:06 +0000
+++ b/util/python-configure/m4/python.m4        1970-01-01 00:00:00 +0000
@@ -1,550 +0,0 @@
-# Copyright 2012 Brandon Invergo <address@hidden>
-#
-# 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
address@hidden:@!$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(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($1, [\.], [_]))
-AC_CACHE_CHECK([if Python >= '$1'],
-    [[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, '$1'.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"], [$3], 
[$2])
-])# 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]