Added runtime libraries
git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@199 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
b6043660c8
commit
4d684adb60
3 changed files with 124 additions and 0 deletions
79
SWIG/Runtime/Makefile.in
Normal file
79
SWIG/Runtime/Makefile.in
Normal file
|
|
@ -0,0 +1,79 @@
|
|||
# Makefile for producing SWIG runtime libraries.
|
||||
#
|
||||
# The runtime libraries contain the pointer-type checking code and other
|
||||
# support functions that are needed when creating multi-file SWIG modules.
|
||||
#
|
||||
# At the moment, libtool is used to create these libraries
|
||||
|
||||
prefix = @prefix@
|
||||
exec_prefix = @exec_prefix@
|
||||
CC = @CC@
|
||||
LIBTOOL = ../Tools/libtool
|
||||
SWIGLIB = ../Lib
|
||||
LIBS = libswigpl.la libswigpy.la libswigtcl8.la
|
||||
LIB_DIR = $(exec_prefix)/lib
|
||||
|
||||
all:
|
||||
@sh make.sh
|
||||
|
||||
|
||||
install:
|
||||
@echo "Installing runtime libraries"
|
||||
@for i in $(LIBS); \
|
||||
do \
|
||||
if [ -f $$i ]; then \
|
||||
$(LIBTOOL) install -c $$i $(LIB_DIR)/$$i; \
|
||||
fi; \
|
||||
done;
|
||||
|
||||
clean::
|
||||
rm -rf *.o *.lo *.la *.a *.c *.swg *~ core .libs
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Tcl runtime library
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
TCL_INCLUDE = @TCLINCLUDE@
|
||||
TCL_RUNTIME = $(SWIGLIB)/tcl/swigtcl8.swg
|
||||
# Tcl 8.x
|
||||
|
||||
tcl: libswigtcl8.la
|
||||
|
||||
libswigtcl8.la:
|
||||
cp $(TCL_RUNTIME) swigtcl8.c
|
||||
$(LIBTOOL) $(CC) -c $(TCL_INCLUDE) -DSWIG_GLOBAL swigtcl8.c
|
||||
$(LIBTOOL) $(CC) -o libswigtcl8.la swigtcl8.lo -rpath $(LIB_DIR) -avoid-version
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Python run-time library
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
PYTHON_INCLUDE= -DHAVE_CONFIG_H @PYINCLUDE@
|
||||
PYTHON_RUNTIME= $(SWIGLIB)/python/python.swg
|
||||
|
||||
# Python shared
|
||||
|
||||
python: libswigpy.la
|
||||
|
||||
libswigpy.la:
|
||||
cp $(PYTHON_RUNTIME) libpy.c
|
||||
$(LIBTOOL) $(CC) -c $(PYTHON_INCLUDE) -DSWIG_GLOBAL libpy.c
|
||||
$(LIBTOOL) $(CC) -o libswigpy.la libpy.lo -rpath $(LIB_DIR) -avoid-version
|
||||
|
||||
# ----------------------------------------------------------------------
|
||||
# Perl run-time library
|
||||
# ----------------------------------------------------------------------
|
||||
|
||||
PERL5_INCLUDE= -I@PERL5EXT@
|
||||
PERL5_RUNTIME= $(SWIGLIB)/perl5/perl5.swg
|
||||
|
||||
# Perl shared
|
||||
|
||||
perl5: libswigpl.la
|
||||
|
||||
libswigpl.la:
|
||||
@rm -f libperl.c
|
||||
cat perlrun.h >> libperl.c
|
||||
cat $(PERL5_RUNTIME) >> libperl.c
|
||||
$(LIBTOOL) $(CC) -c $(PERL5_INCLUDE) -DSWIG_GLOBAL -Dbool=char -Dexplicit= libperl.c
|
||||
$(LIBTOOL) $(CC) -o libswigpl.la libperl.lo -rpath $(LIB_DIR) -avoid-version
|
||||
42
SWIG/Runtime/make.sh
Normal file
42
SWIG/Runtime/make.sh
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
#
|
||||
# Build run-time libraries for SWIG. This script will attempt to build libraries
|
||||
# for all of SWIG's target languages, but may report failures for uninstalled
|
||||
# packages.
|
||||
#
|
||||
|
||||
necho() {
|
||||
if [ "`echo -n`" = "-n" ]; then
|
||||
echo "${@}\c"
|
||||
else
|
||||
echo -n "${@}"
|
||||
fi
|
||||
}
|
||||
|
||||
# Script that attempts to produce different run-time libraries
|
||||
|
||||
TARGET='perl5 python tcl'
|
||||
|
||||
echo "Building the SWIG runtime libraries."
|
||||
echo ""
|
||||
echo "The runtime libraries are only needed if you are building"
|
||||
echo "multiple extension modules that need to share information."
|
||||
echo ""
|
||||
echo "*** Note ***"
|
||||
echo "Some of these builds may fail due to uninstalled packages."
|
||||
echo "If a build fails and you want to know what is wrong, do"
|
||||
echo "a manual build by going into the Runtime directory and"
|
||||
echo "typing 'make target' where target is the name of the target"
|
||||
echo "that is failing."
|
||||
echo ""
|
||||
|
||||
for i in ${TARGET}; do
|
||||
necho " Building ${i}";
|
||||
if make ${i} >/dev/null 2>&1; then
|
||||
# See if SWIG generated any errors at all
|
||||
echo " ....... OK.";
|
||||
else
|
||||
echo " ....... failed.";
|
||||
fi;
|
||||
done
|
||||
|
||||
3
SWIG/Runtime/perlrun.h
Normal file
3
SWIG/Runtime/perlrun.h
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
#include "EXTERN.h"
|
||||
#include "perl.h"
|
||||
#include "XSUB.h"
|
||||
Loading…
Add table
Add a link
Reference in a new issue