1## @configure_input@
2##
3## \file    Makefile.PL
4## \brief   Perl-specific SWIG directives for wrapping libSBML API
5## \author  TBI {xtof,raim}@tbi.univie.ac.at
6##
7
8##
9## Copyright 2004 TBI
10##
11## This library is free software; you can redistribute it and/or modify it
12## under the terms of the GNU Lesser General Public License as published
13## by the Free Software Foundation; either version 2.1 of the License, or
14## any later version.
15##
16## This library is distributed in the hope that it will be useful, but
17## WITHOUT ANY WARRANTY, WITHOUT EVEN THE IMPLIED WARRANTY OF
18## MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.  The software and
19## documentation provided hereunder is on an "as is" basis, and the
20## California Institute of Technology and Japan Science and Technology
21## Corporation have no obligations to provide maintenance, support,
22## updates, enhancements or modifications.  In no event shall the
23## California Institute of Technology or the Japan Science and Technology
24## Corporation be liable to any party for direct, indirect, special,
25## incidental or consequential damages, including lost profits, arising
26## out of the use of this software and its documentation, even if the
27## California Institute of Technology and/or Japan Science and Technology
28## Corporation have been advised of the possibility of such damage.  See
29## the GNU Lesser General Public License for more details.
30##
31## You should have received a copy of the GNU Lesser General Public License
32## along with this library; if not, write to the Free Software Foundation,
33## Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
34##
35## The original code contained here was initially developed by:
36##
37##     Christoph Flamm and Rainer Machne
38##     Institut fuer Theoretische Chemie
39##     Universitaet Wien
40##     Waehringerstrasse 17/3/308
41##     A-1090 Wien, Austria
42
43
44use ExtUtils::MakeMaker;
45use Config;
46
47$lddlfags = "@LDFLAGS@ ";
48if ("@host_os@" eq "cygwin")
49{
50  $lddlflags .= "-shared";
51}
52else
53{
54  $lddlflags .= "$Config{lddlflags}";
55}
56
57WriteMakefile(
58              NAME        => "LibSBML",
59	      PREFIX      => "@prefix@",
60              MAKEFILE    => 'Makefile-perl',
61              INSTALLDIRS => "site",
62              LIBS        => "@XERCES_LDFLAGS@ @EXPAT_LDFLAGS@ @LIBXML_LDFLAGS@ @XERCES_LIBS@ @EXPAT_LIBS@ @LIBXML_LIBS@ @ZLIB_LIBS@ @BZ2_LIBS@ @LIBS@ -lm",
63              LDDLFLAGS   => $lddlflags,
64              CC          => "@CXX@",
65	      CCFLAGS     => "@PERL_CPPFLAGS@ @CXXFLAGS@",
66              INC         => "-I../swig -I../../sbml -I../.. -I../../../include",
67              MYEXTLIB    => "../../libsbml.la",
68              macro       => {USE_SWIG => q[@USE_SWIG@]},
69              OBJECT      => "LibSBML_wrap.o",
70	      MAN1PODS    => {},
71	      MAN3PODS    => {},
72              AUTHOR      => "Christoph Flamm <xtof@tbi.univie.ac.at>",
73              VERSION     => "@PACKAGE_VERSION@",
74);
75
76package MY;
77sub postamble {
78	return <<'MAKE_FRAG';
79
80extra_sources  = \
81  LibSBML.i \
82  local.cpp \
83  local.i \
84  list_get_fix.i \
85  list_of_fix.i
86
87swig_sources =      \
88  $(extra_sources)  \
89  ../swig/libsbml.h \
90  ../swig/libsbml.i
91
92PACKAGE_ARGS=
93
94ifeq ("@USE_COMP@", "1")
95	PACKAGE_ARGS += -DUSE_COMP
96	SWIGDOCDEFINES += --define USE_COMP
97endif
98
99ifeq ("@USE_FBC@", "1")
100	PACKAGE_ARGS += -DUSE_FBC
101	SWIGDOCDEFINES += --define USE_FBC
102endif
103
104ifeq ("@USE_GROUPS@", "1")
105	PACKAGE_ARGS += -DUSE_GROUPS
106	SWIGDOCDEFINES += --define USE_GROUPS
107endif
108
109ifeq ("@USE_LAYOUT@", "1")
110	PACKAGE_ARGS += -DUSE_LAYOUT
111	SWIGDOCDEFINES += --define USE_LAYOUT
112endif
113
114ifeq ("@USE_QUAL@", "1")
115	PACKAGE_ARGS += -DUSE_QUAL
116	SWIGDOCDEFINES += --define USE_QUAL
117endif
118
119ifeq ("@USE_MULTI@", "1")
120	PACKAGE_ARGS += -DUSE_MULTI
121	SWIGDOCDEFINES += --define USE_MULTI
122endif
123
124ifeq ("@USE_RENDER@", "1")
125  SWIGFLAGS      += -DUSE_RENDER
126  SWIGDOCDEFINES += --define USE_RENDER
127endif # USE_RENDER
128
129ifeq ("@USE_L3V2EXTENDEDMATH@", "1")
130	PACKAGE_ARGS += -DUSE_L3V2EXTENDEDMATH
131	SWIGDOCDEFINES += --define USE_L3V2EXTENDEDMATH
132endif
133
134
135main_sources = \
136  $(shell grep '%include sbml' ../swig/libsbml.i | grep -v 'libsbml-version.h' \
137    | cut -f2- -d'/' | sed -e 's,^,../../sbml/,g')
138
139LibSBML.pm: LibSBML_wrap.cxx
140
141LibSBML_wrap.cxx: LibSBML.pod $(swig_sources)
142	@top_srcdir@/config/chk_swig_version.sh || exit
143	@SWIG@ @SWIGFLAGS@ -c++ -perl5 -proxy $(PACKAGE_ARGS) -I../../../include -I../.. LibSBML.i
144
145LibSBML.pod: $(main_sources) ../swig/libsbml.i ../swig/swigdoc.py
146	../swig/swigdoc.py --language perl --top ../../.. $(SWIGDOCDEFINES) \
147		--master ../swig/libsbml.i --output LibSBML.pod
148
149MYPACKLIST = $(DESTINSTALLSITEARCH)/auto/$(FULLEXT)/.packlist
150#MYPERLLOCAL = $(INSTALLARCHLIB)/perllocal.pod
151myuninstall:
152	$(NOECHO) dirs=`cat $(MYPACKLIST) | xargs -n 1 dirname`; \
153	$(PERLRUN) -MExtUtils::Install -e \
154	  'uninstall('\''$(MYPACKLIST)'\',1,0')'; \
155	for d in $$dirs; do \
156          if test -d $$d && test -n "`find $$d -maxdepth 0 -empty`"; then \
157	    echo rmdir $$d; \
158	    rmdir $$d; \
159          fi; \
160        done;
161MAKE_FRAG
162}
163# End of file
164