3 $JPL_HOME = $ENV{JPL_HOME}
4 or die "You have not run setvars to set your environment variables.\n" .
5 "See the JPL README file for more information.\n";
9 eval `$JPL_HOME/setvars -perl`;
15 $flags = "-Dbool=char"; # avoid builtin bool altogether
16 $libs = "-lc -lm -ldl";
20 $libs = "-lc -lm -ldl";
23 ($jpldir = $cwd) =~ s#/[^/]*$##;
25 open(MAKEFILE, ">Makefile");
27 print MAKEFILE <<"SUBS";
31 ARCHNAME = $Config{archname}
32 JAVA_HOME = $ENV{JAVA_HOME}
33 JPL_HOME = $ENV{JPL_HOME}
34 PERLARCHDIR = $Config{archlib}
35 FLAGS = $Config{cccdlflags} $Config{ccdlflags} $Config{lddlflags} $flags
36 INCL = -I\$(PERLARCHDIR)/CORE \\
37 -I\$(JAVA_HOME)/include \\
38 -I\$(JAVA_HOME)/include/$^O \\
39 -I\$(JAVA_HOME)/include/genunix
44 print MAKEFILE <<'NOSUBS';
45 .SUFFIXES: .jpl .class
48 $(PERL) -MJPL::Compile -e "file('$*.jpl')"
50 all: $(WHAT).class lib$(WHAT).so
52 debug: $(WHAT)_g.class lib$(WHAT)_g.so
54 lib$(WHAT).so: $(WHAT).c $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter.so
55 $(CC) $(FLAGS) $(INCL) $(WHAT).c \
56 $(PERLARCHDIR)/CORE/libperl.so \
57 $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter.so \
61 lib$(WHAT)_g.so: $(WHAT).c $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter_g.so
62 $(CC) -g $(FLAGS) $(INCL) $(WHAT).c \
63 $(PERLARCHDIR)/CORE/libperl.so \
64 $(JPL_HOME)/lib/$(ARCHNAME)/libPerlInterpreter_g.so \
71 cp $(WHAT).class $(JPL_HOME)/lib
72 cp lib$(WHAT).so $(JPL_HOME)/lib/$(ARCHNAME)
73 cp $(WHAT).pl $(JPL_HOME)/perl
76 rm -f $(WHAT).c $(WHAT).h \
77 $(WHAT)*.class $(WHAT)*.pl lib$(WHAT).so $(WHAT)*.java