Re: [PATCH t/test.pl t/op/stat.t lib/Net/hostent.t] Unbail out
[p5sagit/p5-mst-13.2.git] / jpl / PerlInterpreter / Makefile.PL
CommitLineData
d50cb536 1#!/usr/bin/perl
2
3$JPL_SRC = "..";
4
5use Config;
6
7eval `$JPL_SRC/setvars -perl`;
8
9if ($^O eq 'linux') {
10 $flags = "-Dbool=char"; # avoid builtin bool altogether
11 $libs = "-lc -lm -ldl";
b83c0eaa 12} else {
d50cb536 13 $flags = "";
14 $libs = "-lc -lm -ldl";
15}
16
b83c0eaa 17# Needed for JNI.
18if ($^O eq 'solaris') {
19 $libs .= " -lthread";
20}
21
d50cb536 22open(MAKEFILE, ">Makefile");
23
24print MAKEFILE <<"SUBS";
25WHAT = PerlInterpreter
26JAVA_HOME = $ENV{JAVA_HOME}
27JPL_HOME = $ENV{JPL_HOME}
28ARCHNAME = $Config{archname}
29PERLARCHDIR = $Config{archlib}
30CC = $Config{cc}
31FLAGS = $Config{cccdlflags} $Config{ccdlflags} $Config{lddlflags} $flags
32INCL = -I\$(PERLARCHDIR)/CORE \\
33 -I\$(JAVA_HOME)/include \\
34 -I\$(JAVA_HOME)/include/$^O \\
35 -I\$(JAVA_HOME)/include/genunix
36LIBS = $libs
37
38SUBS
39
40
41print MAKEFILE <<'NOSUBS';
42.SUFFIXES: .java .class
43
44.java.class:
45 javac $*.java
46
47.class.h:
48 javah -jni $*
49
50all: PerlInterpreter.class libPerlInterpreter.so
51
52PerlInterpreter.class: PerlInterpreter.java
53
54PerlInterpreter.h: PerlInterpreter.class
55
56libPerlInterpreter.so: PerlInterpreter.c PerlInterpreter.h
57 $(CC) $(FLAGS) $(INCL) PerlInterpreter.c \
58 $(PERLARCHDIR)/auto/DynaLoader/DynaLoader.a \
59 $(LIBS) \
60 -o libPerlInterpreter.so
61
62test:
63
64install: all
65 mkdir -p $(JPL_HOME)/lib/$(ARCHNAME)
66 cp libPerlInterpreter.so $(JPL_HOME)/lib/$(ARCHNAME)
67 cp $(WHAT).class $(JPL_HOME)/lib
68
69clean:
70 rm -f libPerlInterpreter.so
71 rm -f PerlInterpreter.class
72NOSUBS
73
74close MAKEFILE;