mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-30 08:12:05 +00:00
More tweaks to perlconnect build system -
Added jsperlbuild.pl file to abstract the location of xsubpp. Many thanks to Dave Neuer (dneuer@futuristics.net) for this and much other porting help with perlconnect. Combined jsperl.so and JS.pm into a JS.so object for use from both javascript and perl. Fixed rules.mk to recur into DIRS for clean, clobber.
This commit is contained in:
parent
540e024aae
commit
fd4be6cd3a
@ -65,7 +65,7 @@ PC_CFILES = \
|
||||
$(NULL)
|
||||
|
||||
JS.c: JS.xs typemap
|
||||
perl /usr/lib/perl5/ExtUtils/xsubpp -typemap /usr/lib/perl5/ExtUtils/typemap -typemap typemap JS.xs > JS.c
|
||||
perl jsperlbuild.pl
|
||||
|
||||
LIB_CFILES = $(PC_CFILES)
|
||||
|
||||
@ -93,12 +93,12 @@ endif
|
||||
endif
|
||||
|
||||
ifdef USE_MSVC
|
||||
LIBRARY = $(OBJDIR)/jsperl.lib
|
||||
SHARED_LIBRARY = $(OBJDIR)/jsperl.dll
|
||||
LIBRARY = $(OBJDIR)/JS.lib
|
||||
SHARED_LIBRARY = $(OBJDIR)/JS.dll
|
||||
PROGRAM = $(OBJDIR)/jsperl.exe
|
||||
else
|
||||
LIBRARY = $(OBJDIR)/jsperl.a
|
||||
SHARED_LIBRARY = $(OBJDIR)/jsperl.so
|
||||
LIBRARY = $(OBJDIR)/JS.a
|
||||
SHARED_LIBRARY = $(OBJDIR)/JS.so
|
||||
PROGRAM = $(OBJDIR)/jsperl
|
||||
endif
|
||||
|
||||
|
64
js/src/perlconnect/jsperlbuild.pl
Normal file
64
js/src/perlconnect/jsperlbuild.pl
Normal file
@ -0,0 +1,64 @@
|
||||
#
|
||||
# The contents of this file are subject to the Netscape Public License
|
||||
# Version 1.0 (the "NPL"); you may not use this file except in
|
||||
# compliance with the NPL. You may obtain a copy of the NPL at
|
||||
# http://www.mozilla.org/NPL/
|
||||
#
|
||||
# Software distributed under the NPL is distributed on an "AS IS" basis,
|
||||
# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
|
||||
# for the specific language governing rights and limitations under the
|
||||
# NPL.
|
||||
#
|
||||
# The Initial Developer of this code under the NPL is Netscape
|
||||
# Communications Corporation. Portions created by Netscape are
|
||||
# Copyright (C) 1999 Netscape Communications Corporation. All Rights
|
||||
# Reserved.
|
||||
|
||||
#
|
||||
# Helper perl script to abstract the location of xsubpp
|
||||
#
|
||||
|
||||
# Thanks to Dave Neuer <dneuer@futuristics.net> for the original
|
||||
# version of this file. Entered as NPL with his permission.
|
||||
|
||||
use File::Find;
|
||||
use Cwd;
|
||||
|
||||
$notfound = 1;
|
||||
|
||||
foreach(@INC){
|
||||
next if /^\.$/;
|
||||
if(-e $_){
|
||||
find(\&find_ExtUtils, $_);
|
||||
}
|
||||
}
|
||||
|
||||
if(-e $xsubpp && -e $typemap){
|
||||
$res = `perl $xsubpp -typemap $typemap -typemap typemap JS.xs > JS.c`;
|
||||
if(-e "JS.c"){
|
||||
exit(0);
|
||||
}
|
||||
else{
|
||||
die("Couldn't build JS.c: $res");
|
||||
}
|
||||
}
|
||||
else{
|
||||
die("Couldn't locate files neccessary for building JS.c");
|
||||
}
|
||||
|
||||
sub failed{
|
||||
my $message = shift;
|
||||
print STDERR $message, "\n";
|
||||
exit(1);
|
||||
}
|
||||
|
||||
sub find_ExtUtils{
|
||||
if($notfound){
|
||||
if($File::Find::dir =~ /ExtUtils/){
|
||||
my $path = cwd;
|
||||
$xsubpp = $path . "/xsubpp";
|
||||
$typemap = $path . "/typemap";
|
||||
undef $notfound;
|
||||
}
|
||||
}
|
||||
}
|
@ -105,12 +105,11 @@ export:
|
||||
|
||||
clean:
|
||||
rm -rf $(OBJS)
|
||||
cd fdlibm; $(MAKE) -f Makefile.ref clean
|
||||
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
clobber:
|
||||
rm -rf $(OBJS) $(TARGETS) $(DEPENDENCIES)
|
||||
cd fdlibm; $(MAKE) -f Makefile.ref clobber
|
||||
+$(LOOP_OVER_DIRS)
|
||||
|
||||
depend:
|
||||
gcc -MM $(CFLAGS) $(LIB_CFILES)
|
||||
|
Loading…
Reference in New Issue
Block a user