Check-in Number:
|
5460 | |
Date: |
2006-Jul-22 17:40:04 (local)
2006-Jul-22 15:40:04 (UTC) |
User: | rse |
Branch: | |
Comment: |
improve Perl support |
Tickets: |
|
Inspections: |
|
Files: |
|
ossp-pkg/js/Makefile.in 1.4 -> 1.5
--- Makefile.in 2006/07/22 15:02:07 1.4
+++ Makefile.in 2006/07/22 15:40:04 1.5
@@ -48,6 +48,7 @@
LDFLAGS = @LDFLAGS@
LIBS = @LIBS@
+CLI_CFLAGS = @CLI_CFLAGS@
CLI_CPPFLAGS = @CLI_CPPFLAGS@
CLI_LDFLAGS = @CLI_LDFLAGS@
CLI_LIBS = @CLI_LIBS@
@@ -57,6 +58,7 @@
RMDIR = rmdir
SHTOOL = ./shtool
LIBTOOL = ./libtool
+PERL = @PERL@
TRUE = true
LIB_HDR_API = src/jsapi.h \
@@ -175,28 +177,41 @@
src/fdlibm/w_log.lo \
src/fdlibm/w_pow.lo \
src/fdlibm/w_sqrt.lo
+LIB_NAME = libjs.la
-TARGETS = libjs.la js
+CLI_OBJS = src/js.o @CLI_OBJS@
+CLI_NAME = js
+
+WITH_PERL = @WITH_PERL@
+
+TARGETS = $(LIB_NAME) $(CLI_NAME) subdirs
.SUFFIXES:
.SUFFIXES: .c .o .lo
all: $(TARGETS)
+subdirs:
+ @if [ ".$(WITH_PERL)" = ".yes" ]; then \
+ (cd src/perlconnect; $(PERL) Makefile.PL; $(MAKE) $(MFLAGS)); \
+ fi
+
.c.o:
$(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
.c.lo:
@$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
-libjs.la: $(LIB_OBJS)
- @$(LIBTOOL) --mode=link $(CC) -o libjs.la $(LIB_OBJS) -rpath $(libdir) \
+$(LIB_NAME): $(LIB_OBJS)
+ @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) \
-version-info `$(SHTOOL) version -l txt -d libtool VERSION`
-js: src/js.o
- @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(CLI_LDFLAGS) -o js src/js.o libjs.la $(LIBS) $(CLI_LIBS)
+$(CLI_NAME): $(CLI_OBJS)
+ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(CLI_LDFLAGS) -o $(CLI_NAME) $(CLI_OBJS) $(LIB_NAME) $(LIBS) $(CLI_LIBS)
src/js.o: src/js.c
- $(CC) $(CPPFLAGS) $(CFLAGS) $(CLI_CPPFLAGS) -o $@ -c $<
+ $(CC) $(CPPFLAGS) $(CLI_CPPFLAGS) $(CFLAGS) $(CLI_CFLAGS) -o $@ -c $<
+src/perlconnect/jsperl.o: src/perlconnect/jsperl.c
+ $(CC) $(CPPFLAGS) $(CLI_CPPFLAGS) $(CFLAGS) $(CLI_CFLAGS) -o $@ -c $<
$(LIB_OBJS): src/jsautocfg.h
src/jsautocfg.h: jscpucfg
@@ -218,12 +233,15 @@
$(SHTOOL) install -c -m 755 js $(DESTDIR)$(bindir)/
$(SHTOOL) install -c -m 644 js.1 $(DESTDIR)$(mandir)/man1/
$(SHTOOL) install -c -m 644 $(LIB_HDR_API) $(DESTDIR)$(includedir)/
- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 libjs.la $(DESTDIR)$(libdir)/
+ @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(LIB_NAME) $(DESTDIR)$(libdir)/
$(SHTOOL) install -c -m 644 js.pc $(DESTDIR)$(libdir)/pkgconfig/
+ @if [ ".$(WITH_PERL)" = ".yes" ]; then \
+ (cd src/perlconnect; $(MAKE) $(MFLAGS) install); \
+ fi
.PHONY: clean
clean:
- -$(RM) libjs.la $(LIB_OBJS)
+ -$(RM) $(LIB_NAME) $(LIB_OBJS)
-$(RM) js src/js.o
-$(RM) -r .libs >/dev/null 2>&1 || $(TRUE)
-$(RM) *.o *.lo
|
|
ossp-pkg/js/configure.ac 1.4 -> 1.5
--- configure.ac 2006/07/22 15:02:07 1.4
+++ configure.ac 2006/07/22 15:40:04 1.5
@@ -48,15 +48,19 @@
CPPFLAGS="$CPPFLAGS -DOSSP"
CLI_CPPFLAGS=""
+CLI_CFLAGS=""
CLI_LDFLAGS=""
CLI_LIBS=""
+CLI_OBJS=""
+
+dnl # configure option --with-editline[=path]
AC_ARG_WITH([editline],
AC_HELP_STRING([--with-editline], [build command line interface with line editing support via editline, libedit or GNU readline]),
[ac_cv_with_editline=$withval], [ac_cv_with_editline=no])
AC_CACHE_CHECK([whether to build command line interface with line editing support],
[ac_cv_with_editline], [ac_cv_with_editline=no])
if test ".$ac_cv_with_editline" != ".no"; then
- CLI_CPPFLAGS="-DEDITLINE"
+ CLI_CPPFLAGS="$CLI_CPPFLAGS -DEDITLINE"
case "$ac_cv_with_editline" in
/* ) CLI_LDFLAGS="-L$ac_cv_with_editline" ;;
esac
@@ -72,15 +76,43 @@
LDFLAGS="$OLD_LDFLAGS"
LIBS="$OLD_LIBS"
fi
+
+dnl # configure option --with-perl
+AC_ARG_WITH([perl],
+ AS_HELP_STRING([--with-perl], [build Perl-to-JS and JS-to-Perl bindings]),
+ [ac_cv_with_perl=$withval], [ac_cv_with_perl=no])
+AC_CACHE_CHECK([whether to build Perl-to-JS and JS-to-Perl bindings], [ac_cv_with_perl], [ac_cv_with_perl=no])
+if test ".$ac_cv_with_perl" != ".no"; then
+ WITH_PERL="yes"
+ CLI_OBJS="$CLI_OBJS src/perlconnect/jsperl.o"
+ CLI_CPPFLAGS="$CLI_CPPFLAGS -DPERLCONNECT"
+else
+ WITH_PERL="no"
+fi
+AC_SUBST(WITH_PERL)
+case "$ac_cv_with_perl" in
+ /* ) PERL="$ac_cv_with_perl" ;;
+esac
+AC_PATH_PROG(PERL, perl, NA)
+if test ".$ac_cv_with_perl" = ".yes" -a ".$PERL" = ".NA"; then
+ AC_ERROR([required Perl interpreter not found in \$PATH])
+fi
+if test ".$ac_cv_with_perl" != ".no"; then
+ CLI_CFLAGS="$CLI_CFLAGS `$PERL -MExtUtils::Embed -e ccopts`"
+ CLI_LIBS="$CLI_LIBS `$PERL -MExtUtils::Embed -e ldopts`"
+fi
+
+AC_SUBST(CLI_CFLAGS)
AC_SUBST(CLI_CPPFLAGS)
AC_SUBST(CLI_LDFLAGS)
AC_SUBST(CLI_LIBS)
+AC_SUBST(CLI_OBJS)
with_tags=""
sinclude(libtool.m4)
AC_PROG_LIBTOOL
AC_CONFIG_HEADERS(config.h)
-AC_CONFIG_FILES([Makefile js.pc])
+AC_CONFIG_FILES([Makefile js.pc src/perlconnect/Makefile.PL])
AC_OUTPUT
|
|
ossp-pkg/js/devtool.conf 1.3 -> 1.4
--- devtool.conf 2006/07/22 15:02:07 1.3
+++ devtool.conf 2006/07/22 15:40:04 1.4
@@ -16,6 +16,7 @@
./configure \
--prefix=/tmp/js \
--with-editline=/usr/opkg/lib \
+ --with-perl=/usr/opkg/bin/perl \
--disable-shared \
"$@"
|
|
ossp-pkg/js/src/perlconnect/Makefile.PL.in 1.1 -> 1.2
--- Makefile.PL.in 2006/07/22 15:09:45 1.1
+++ Makefile.PL.in 2006/07/22 15:40:04 1.2
@@ -3,7 +3,7 @@
WriteMakefile(
NAME => 'JS',
- DEFINE => '-DXP_UNIX';
+ DEFINE => '-DXP_UNIX',
INC => "-I..",
LIBS => "-L../../.libs -ljs @LIBS@",
VERSION_FROM => 'JS.pm',
|
|