I have a non-standard (Enthought) Python 2.7.3 installation located in my home directory $PREFIX ='/Users/skips/Library/Enthought/Canopy_32bit/System' .  Under that directory there are the usual folders $PREFIX/bin, $PREFIX/include; $PREFIX/lib.  I installed swig-2.0.9 after first installing pcre-8.32 from the respective *.tar.gz files.  In the configuration process, I used the  option '--prefix=$PREFIX'.  In both cases, the installation completed without indicating an error.  But on closer examination of the output from the swig configure command, I see that configure could not find the 'Python Library'  (see output clip below).  I see the swig library directory in $PREFIX/share/2.0.9 (along with a previous installation folder 1.3.40).

checking for python... python
checking for Python prefix... /Users/skips/Library/Enthought/Canopy_32bit/System
checking for Python exec-prefix... /Users/skips/Library/Enthought/Canopy_32bit/System
checking for Python version… python2.7  
checking for Python lib dir... lib
checking for Python header files... -I/Users/skips/Library/Enthought/Canopy_32bit/System/include/python2.7 -I/Users/skips/Library/Enthought/Canopy_32bit/System/lib/python2.7/config
checking for Python library... Not found
checking for python3... no
checking for python3.6... no
checking for python3.5... no
checking for python3.4... no
checking for python3.3... no
checking for python3.2... no
checking for python3.1... no
checking for python3.0... no
checking for perl... perl

When I execute 'make -k check' I see lots of check output for Tcl, Perl5, and others.  But no checks for the Python language, indicating to me that I have not successfully compiled SWIG for the Python language.  My guess is that the problem lies with the 'Python Library' because it is not located in a standard place.  In reading through the configure.in file for swig, I see that there may be some questions about this part of the configure process (see snippet from configure.in below)

#----------------------------------------------------------------
# Look for Python
#----------------------------------------------------------------

PYINCLUDE=
PYLIB=
PYPACKAGE=

    # Set the include directory

    AC_MSG_CHECKING(for Python header files)
    if test -r $PYPREFIX/include/$PYVERSION/Python.h; then
      PYINCLUDE="-I$PYPREFIX/include/$PYVERSION -I$PYEPREFIX/$PYLIBDIR/$PYVERSION/config"
    fi
    if test -z "$PYINCLUDE"; then
      if test -r $PYPREFIX/include/Py/Python.h; then
        PYINCLUDE="-I$PYPREFIX/include/Py -I$PYEPREFIX/$PYLIBDIR/python/lib"
      fi
    fi
    AC_MSG_RESULT($PYINCLUDE)
.
.
.
.
checking for python... python
checking for Python prefix... /Users/skips/Library/Enthought/Canopy_32bit/System
checking for Python exec-prefix... /Users/skips/Library/Enthought/Canopy_32bit/System
checking for Python version... python2.7
checking for Python lib dir... lib
checking for Python header files... -I/Users/skips/Library/Enthought/Canopy_32bit/System/include/python2.7 -I/Users/skips/Library/Enthought/Canopy_32bit/System/lib/python2.7/config

    # Set the library directory blindly.   This probably won't work with older versions
    AC_MSG_CHECKING(for Python library)
    dirs="$PYVERSION/config $PYVERSION/$PYLIBDIR python/$PYLIBDIR"
    for i in $dirs; do
      if test -d $PYEPREFIX/$PYLIBDIR/$i; then
        PYLIB="$PYEPREFIX/$PYLIBDIR/$i"
        break
      fi
    done
    if test -z "$PYLIB"; then
      AC_MSG_RESULT(Not found)
    else
      AC_MSG_RESULT($PYLIB)
    fi

Questions:

1.  What exactly is the 'Python Library'?  Is it my directory $PREFIX/lib?  (That directory has a sub-directory ./lib/python2.7 and also ./lib/python2.7/pkgconfig but no ./lib/python2.7/config.)  I suspect that many of my problems
have to do with the fact that the configure.in file appears to have a preconceived notion about the OSx installation of python (2.7) located at '/System/Library/Frameworks/Python.framework/Versions/2.7'
2.  Is there a way of editing the swig configure.in so the correct paths are established?  (I have attached the configure.log file.  Perhaps that will provide more clues about how configure went wrong.)

I will very much appreciate any comments or help.  By the way -- I am a rank beginner in swig, python, and all the various tools being employed to affect an installation (e.g., configure, make, …).


Skip

  

D.D. "Skip" Snyder
Snyder Geoscience, Inc
671 Crescent Ct
Grand Junction, CO 81505
(970) 254-0330
(970) 261-5825 (cell)
skips@bresnan.net