Building ExpectPy

Using make

The basic format of the make commands are:
$ make target
Make targets
all Build the targets
installbin Install the binary interpreter as exec_prefix/bin/python.exppy.
installshared Install the shared library into the distribution.
clean Remove the files created by the build process.
distclean Remove the files created by configure (and the build process).
test Perform tests on the just built module.

Using GNU make is preferred, but not required.

Python 1.4

Since 1.4 does not have PCRE, you must compile ExpectPy with either TclRE support or no regexp support.

There is currently a bug building shared modules with Python 1.4. ExpectPy will need to be statically linked.

Using makesetup

There are some bugs with the makesetup shipped with Python 1.4. If you want to use Python's makesetup, first apply the patch to makesetup for absolute pathnames and build option ordering. The patch files are in the etc/ directory.

Use the --with-setup option and create a Setup.local file.

$ ./configure { --without-pcre | --with-tcl } --with-setup options
$ make Setup.local
$ cat Setup.local >> builddir/Python-1.4/Modules/Setup.local
$ cd builddir/Python-1.4; make

Local build

When configuring, you must use the following options at least:.
$ ./configure {--without-pcre | --with-tcl} options
$ make

Python 1.5

Using makesetup

There are some bugs with the makesetup shipped with Python earlier than 1.5.2. If you want to use Python's makesetup, first apply the patch to makesetup for absolute pathnames. The patch files are in the etc/ directory.

If you can compile and install Python yourself

Configure with the option --with-setup and build the Setup.local file.
$ ./configure --with-setup options
$ make Setup.local
$ cat Setup.local >> builddir/Python-1.5.1/Modules/Setup.local
$ cd builddir/Python-1.5.1; make
Append the Setup.local file to the end of Python's Module/Setup.local file and recompile Python.

If you do not have access to the system's build directory for Python

$ ./configure --with-setup options
$ make
This builds the interpreter in a subdirectory ("pycnf" by default) and is then placed in the current directory.

Local build

$ ./configure options
$ make

Building in another location

If you would like to build ExpectPy outside of the source directory, choose a location and reference configure from that directory.
$ tar xf ExpectPy.tar # creates a directory ExpectPy
$ mkdir ExpectPy-sun5
$ cd ExpectPy-sun5
$ ../ExpectPy/configure options
$ make

Building with Expect and/or Tcl libraries

On some systems, ExpectPy may have difficulties building against the dynamic (shared) libraries from Expect or Tcl. In those situations, it may make ExpectPy more stable to use the configure --forcea option, to force building against static libraries (.a).