summaryrefslogtreecommitdiff
path: root/lang/ossp-js
diff options
context:
space:
mode:
authorbjs <bjs@pkgsrc.org>2008-02-06 04:22:33 +0000
committerbjs <bjs@pkgsrc.org>2008-02-06 04:22:33 +0000
commit1215a7b7a9523cff41f8885462c03cb7d2ba6c9a (patch)
tree701c5a0896f5961efb9dcce4503dd464484ea3f4 /lang/ossp-js
parent5d3864617e9418ff24568140d941fe0df3890157 (diff)
downloadpkgsrc-1215a7b7a9523cff41f8885462c03cb7d2ba6c9a.tar.gz
Import of OSSP js-1.6.20070208, a portable, sanitized version of
Mozilla's SpiderMonkey. I wish I knew about this sooner! I've tried this out with elinks, and the javsascript support seems more reliable. Thanks, OSSP! I vote for killing spidermonkey once we verify all packages using it build with this. Local modifications: --Only build fdlibm into libjs if necessary. This follows in the spirit of lang/spidermonkey, though someone with more knowledge of this probably will want to change the list of platforms in the Makefile. --Following the aforementioned change, link the library against -lm (and list -lm in js-config, etc.) only if required. --Use pkgsrc-provided installation tools instead of shtool. --Apply fix for __VA_COPY_USE_CPP. Blurb (DESCR): OSSP js is a stand-alone distribution of the JavaScript (JS) programming language reference implementation from Mozilla -- aka "JSRef" or "SpiderMonkey". This distribution provides a smart, stand-alone and portable distribution of Mozilla JavaScript through a GNU autotools-based build environment. Additionally, the C API in "libjs" contains both the JavaScript engine and the required Sun math library ("fdlibm") and with all internal symbols carefully protected under the "js" namespace. Finally, a js-config(1) utility and a pkg-config(1) specification is provided to allow applications to easily build with the JavaScript C API. OSSP js was created because for OSSP and similar pedantic C coding projects a smart, stand-alone, portable, clean, powerful and robust scripting language engine is required. JavaScript is a great programming language and Mozilla JavaScript "SpiderMonkey" definitely is an acceptable clean, powerful and robust implementation. Unfortunately there is just a stand-alone distribution released from time to time by Mozilla and it is far away from really being smart, stand-alone and portable. OSSP js combines the best from two worlds: the 1:1 repackaged JavaScript code base from Mozilla with the GNU autotools-based build environment as always used by OSSP. Additionally, this package provides stdio-based file object support and does not depend upon the Mozilla NSPR library.
Diffstat (limited to 'lang/ossp-js')
-rw-r--r--lang/ossp-js/DESCR23
-rw-r--r--lang/ossp-js/Makefile65
-rw-r--r--lang/ossp-js/PLIST58
-rw-r--r--lang/ossp-js/buildlink3.mk22
-rw-r--r--lang/ossp-js/distinfo10
-rw-r--r--lang/ossp-js/hacks.mk13
-rw-r--r--lang/ossp-js/patches/patch-aa17
-rw-r--r--lang/ossp-js/patches/patch-ab77
-rw-r--r--lang/ossp-js/patches/patch-ac19
-rw-r--r--lang/ossp-js/patches/patch-ad17
-rw-r--r--lang/ossp-js/patches/patch-ae45
11 files changed, 366 insertions, 0 deletions
diff --git a/lang/ossp-js/DESCR b/lang/ossp-js/DESCR
new file mode 100644
index 00000000000..651cb4d1d3b
--- /dev/null
+++ b/lang/ossp-js/DESCR
@@ -0,0 +1,23 @@
+OSSP js is a stand-alone distribution of the JavaScript (JS)
+programming language reference implementation from Mozilla -- aka
+"JSRef" or "SpiderMonkey". This distribution provides a smart,
+stand-alone and portable distribution of Mozilla JavaScript through a
+GNU autotools-based build environment. Additionally,
+the C API in "libjs" contains both the JavaScript engine and the
+required Sun math library ("fdlibm") and with all internal symbols
+carefully protected under the "js" namespace. Finally, a js-config(1)
+utility and a pkg-config(1) specification is provided to allow
+applications to easily build with the JavaScript C API.
+
+OSSP js was created because for OSSP and similar pedantic C coding
+projects a smart, stand-alone, portable, clean, powerful and
+robust scripting language engine is required. JavaScript is a
+great programming language and Mozilla JavaScript "SpiderMonkey"
+definitely is an acceptable clean, powerful and robust implementation.
+Unfortunately there is just a stand-alone distribution released from
+time to time by Mozilla and it is far away from really being smart,
+stand-alone and portable. OSSP js combines the best from two worlds:
+the 1:1 repackaged JavaScript code base from Mozilla with the GNU
+autotools-based build environment as always used by OSSP. Additionally,
+this package provides stdio-based file object support and does not depend
+upon the Mozilla NSPR library.
diff --git a/lang/ossp-js/Makefile b/lang/ossp-js/Makefile
new file mode 100644
index 00000000000..bffe5d1df67
--- /dev/null
+++ b/lang/ossp-js/Makefile
@@ -0,0 +1,65 @@
+# $NetBSD: Makefile,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+#
+
+DISTNAME= js-1.6.20070208
+PKGNAME= ossp-${DISTNAME}
+CATEGORIES= lang
+MASTER_SITES= ftp://ftp.ossp.org/pkg/lib/js/
+
+MAINTAINER= bjs@NetBSD.org
+HOMEPAGE= ftp://ftp.ossp.org/pkg/lib/js/
+COMMENT= Sanitized distribution of Mozilla's JavaScript implementation
+
+PKG_DESTDIR_SUPPORT= user-destdir
+
+###
+### XXX This could be eliminated with buildlinkery, but I do not have time
+### right now. You'll probably want to use this package in lieu of
+### spidermonkey anyway.
+###
+CONFLICTS+= spidermonkey-[0-9]*
+
+GNU_CONFIGURE= yes
+USE_LIBTOOL= yes
+USE_TOOLS+= pkg-config
+
+PKGCONFIG_OVERRIDE+= js.pc.in
+
+CONFIGURE_ARGS+= --with-dso
+CONFIGURE_ARGS+= --with-editline
+CONFIGURE_ARGS+= --with-file
+CONFIGURE_ARGS+= --without-perl
+
+REPLACE_SH= js-config.sh.in
+
+REPLACE_INTERPRETER+= js
+REPLACE.js.old= ./js
+REPLACE.js.new= ${PREFIX}/bin/js
+REPLACE_FILES.js= jslint.js jspack.js
+
+.include "../../mk/bsd.prefs.mk"
+
+.if defined(PKG_DEVELOPER)
+CPPFLAGS+= -Wall
+.endif
+
+###
+### XXX I took this from jslibmath.h. If this is not correct, please feel
+### free to change it. Our lang/spidermonkey package never uses
+### the Sun math library, and I'm not sure if this is correct.
+###
+JS_FDLIBM_PLATFORMS= Linux-*-* IRIX-*-* SunOS-*-* \
+ Solaris-*-* AIX-*-* HPUX-*-*
+
+.if !empty(JS_FDLIBM_PLATFORMS:M${MACHINE_PLATFORM})
+CPPFLAGS+= -DPKG_FDLIBM_MATH_REQUESTED=1
+MAKE_ENV+= -DPKG_FDLIBM_MATH_REQUESTED=1
+CONFIGURE_ENV+= LIBM=""
+.else
+CPPFLAGS+= -DPKG_FDLIBM_MATH_REQUESTED=0
+CONFIGURE_ENV+= LIBM="-lm"
+.endif
+
+.include "../../mk/dlopen.buildlink3.mk"
+.include "../../devel/readline/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/lang/ossp-js/PLIST b/lang/ossp-js/PLIST
new file mode 100644
index 00000000000..9c04ca5b78f
--- /dev/null
+++ b/lang/ossp-js/PLIST
@@ -0,0 +1,58 @@
+@comment $NetBSD: PLIST,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+bin/js
+bin/js-config
+bin/jslint
+bin/jspack
+include/js/jsapi.h
+include/js/jsarena.h
+include/js/jsarray.h
+include/js/jsatom.h
+include/js/jsautocfg.h
+include/js/jsbit.h
+include/js/jsbool.h
+include/js/jsclist.h
+include/js/jscntxt.h
+include/js/jscompat.h
+include/js/jsconfig.h
+include/js/jscpucfg.h
+include/js/jsdate.h
+include/js/jsdbgapi.h
+include/js/jsdhash.h
+include/js/jsdso.h
+include/js/jsdtoa.h
+include/js/jsemit.h
+include/js/jsexn.h
+include/js/jsfile.h
+include/js/jsfun.h
+include/js/jsgc.h
+include/js/jshash.h
+include/js/jsinterp.h
+include/js/jslibmath.h
+include/js/jslock.h
+include/js/jslong.h
+include/js/jsmath.h
+include/js/jsnum.h
+include/js/jsobj.h
+include/js/jsopcode.h
+include/js/jsosdep.h
+include/js/jsotypes.h
+include/js/jsparse.h
+include/js/jsprf.h
+include/js/jsprvtd.h
+include/js/jspubtd.h
+include/js/jsregexp.h
+include/js/jsscan.h
+include/js/jsscope.h
+include/js/jsscript.h
+include/js/jsstddef.h
+include/js/jsstr.h
+include/js/jstypes.h
+include/js/jsutil.h
+include/js/jsxdrapi.h
+include/js/jsxml.h
+lib/libjs.la
+lib/pkgconfig/js.pc
+man/man1/js-config.1
+man/man1/js.1
+man/man3/js.3
+@dirrm include/js
diff --git a/lang/ossp-js/buildlink3.mk b/lang/ossp-js/buildlink3.mk
new file mode 100644
index 00000000000..7709ac8ea88
--- /dev/null
+++ b/lang/ossp-js/buildlink3.mk
@@ -0,0 +1,22 @@
+# $NetBSD: buildlink3.mk,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH}+
+OSSP_JS_BUILDLINK3_MK:= ${OSSP_JS_BUILDLINK3_MK}+
+
+.if ${BUILDLINK_DEPTH} == "+"
+BUILDLINK_DEPENDS+= ossp-js
+.endif
+
+BUILDLINK_PACKAGES:= ${BUILDLINK_PACKAGES:Nossp-js}
+BUILDLINK_PACKAGES+= ossp-js
+BUILDLINK_ORDER:= ${BUILDLINK_ORDER} ${BUILDLINK_DEPTH}ossp-js
+
+.if ${OSSP_JS_BUILDLINK3_MK} == "+"
+BUILDLINK_API_DEPENDS.ossp-js+= ossp-js>=1.6.20070208
+BUILDLINK_PKGSRCDIR.ossp-js?= ../../lang/ossp-js
+.endif # OSSP_JS_BUILDLINK3_MK
+
+.include "../../devel/readline/buildlink3.mk"
+.include "../../mk/dlopen.buildlink3.mk"
+
+BUILDLINK_DEPTH:= ${BUILDLINK_DEPTH:S/+$//}
diff --git a/lang/ossp-js/distinfo b/lang/ossp-js/distinfo
new file mode 100644
index 00000000000..06bdda1b4b8
--- /dev/null
+++ b/lang/ossp-js/distinfo
@@ -0,0 +1,10 @@
+$NetBSD: distinfo,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+SHA1 (js-1.6.20070208.tar.gz) = 3c8c4b81637b84fa344334a2c0bb093244620d9e
+RMD160 (js-1.6.20070208.tar.gz) = e2e5a1f50026d50caae672bf1122f728991ca377
+Size (js-1.6.20070208.tar.gz) = 1109930 bytes
+SHA1 (patch-aa) = 850e025755cd2f5099a0779b54d9ba1d76fb938b
+SHA1 (patch-ab) = f7e8d00401df8c7f86f2b3c2c342d3869562fe4a
+SHA1 (patch-ac) = cfb32539e82762755090c90fd22978d541edb1d7
+SHA1 (patch-ad) = 9cee1435756bd1d6dec029d81444ec45418a4b18
+SHA1 (patch-ae) = 0a031230be8fc001e510a26d296b5bfdc2a7e1d7
diff --git a/lang/ossp-js/hacks.mk b/lang/ossp-js/hacks.mk
new file mode 100644
index 00000000000..edb4f47f6de
--- /dev/null
+++ b/lang/ossp-js/hacks.mk
@@ -0,0 +1,13 @@
+# $NetBSD: hacks.mk,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+.if !defined(OSSP_JS_HACKS_MK)
+OSSP_JS_HACKS_MK= # defined
+
+.include "../../mk/compiler.mk"
+
+.if !empty(CC_VERSION:Mgcc-[34]*)
+CFLAGS+= -fno-strict-aliasing
+PKG_HACKS+= no-strict-aliasing
+.endif
+
+.endif
diff --git a/lang/ossp-js/patches/patch-aa b/lang/ossp-js/patches/patch-aa
new file mode 100644
index 00000000000..438e0b9cbc1
--- /dev/null
+++ b/lang/ossp-js/patches/patch-aa
@@ -0,0 +1,17 @@
+$NetBSD: patch-aa,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+--- src/jslibmath.h.orig 2006-07-23 08:22:18.000000000 -0400
++++ src/jslibmath.h
+@@ -85,11 +85,7 @@
+
+ #ifdef OSSP
+ #undef JS_USE_FDLIBM_MATH
+-#if defined(__FreeBSD__)
+-#define JS_USE_FDLIBM_MATH 0
+-#else
+-#define JS_USE_FDLIBM_MATH 1
+-#endif
++#define JS_USE_FDLIBM_MATH PKG_JS_FDLIBM_REQUESTED
+ #endif
+
+ #if !JS_USE_FDLIBM_MATH
diff --git a/lang/ossp-js/patches/patch-ab b/lang/ossp-js/patches/patch-ab
new file mode 100644
index 00000000000..619a018150c
--- /dev/null
+++ b/lang/ossp-js/patches/patch-ab
@@ -0,0 +1,77 @@
+$NetBSD: patch-ab,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+--- Makefile.in.orig 2007-02-08 04:25:33.000000000 -0500
++++ Makefile.in
+@@ -95,8 +95,9 @@ LIB_OBJS = src/jsapi.lo
+ src/jsxdrapi.lo \
+ src/jsxml.lo \
+ src/prmjtime.lo \
+- src/jsdso.lo \
+- src/fdlibm/e_acos.lo \
++ src/jsdso.lo
++.if defined(PKG_FDLIBM_MATH_REQUESTED)
++LIB_OBJS+= src/fdlibm/e_acos.lo \
+ src/fdlibm/e_asin.lo \
+ src/fdlibm/e_atan2.lo \
+ src/fdlibm/e_exp.lo \
+@@ -129,6 +130,7 @@ LIB_OBJS = src/jsapi.lo
+ src/fdlibm/w_log.lo \
+ src/fdlibm/w_pow.lo \
+ src/fdlibm/w_sqrt.lo
++.endif
+ LIB_NAME = libjs.la
+
+ CLI_OBJS = src/js.o @CLI_OBJS@
+@@ -155,7 +157,7 @@ subdirs:
+ @$(LIBTOOL) --mode=compile $(CC) $(CPPFLAGS) $(CFLAGS) -o $@ -c $<
+
+ $(LIB_NAME): $(LIB_OBJS)
+- @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) -rpath $(libdir) -version-info 1:6
++ @$(LIBTOOL) --mode=link $(CC) -o $(LIB_NAME) $(LIB_OBJS) $(LIBS) -rpath $(libdir) -version-info 1:6
+
+ $(CLI_NAME): $(CLI_OBJS) $(LIB_NAME)
+ @$(LIBTOOL) --mode=link $(CC) $(LDFLAGS) $(CLI_LDFLAGS) -o $(CLI_NAME) $(CLI_OBJS) $(LIB_NAME) $(LIBS) $(CLI_LIBS)
+@@ -176,22 +178,27 @@ src/jsopcode.h src/jsopcode.c: src/jsopc
+
+ .PHONY: install
+ install: all
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(prefix)
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(bindir)
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man1
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(mandir)/man3
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(includedir)/js
+- $(SHTOOL) mkdir -f -p -m 755 $(DESTDIR)$(libdir)/pkgconfig
+- $(SHTOOL) install -c -m 644 js.1 $(DESTDIR)$(mandir)/man1/
+- $(SHTOOL) install -c -m 644 js-config.1 $(DESTDIR)$(mandir)/man1/
+- $(SHTOOL) install -c -m 644 js.3 $(DESTDIR)$(mandir)/man3/
+- $(SHTOOL) install -c -m 644 src/js*.h $(DESTDIR)$(includedir)/js/
+- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 644 $(LIB_NAME) $(DESTDIR)$(libdir)/
+- $(SHTOOL) install -c -m 644 js.pc $(DESTDIR)$(libdir)/pkgconfig/
+- $(SHTOOL) install -c -m 755 js-config.sh $(DESTDIR)$(bindir)/js-config
+- @$(LIBTOOL) --mode=install $(SHTOOL) install -c -m 755 js $(DESTDIR)$(bindir)/
+- $(SHTOOL) install -e 's;#!\./js;#!$(bindir)/js;' -c -m 755 jslint.js $(DESTDIR)$(bindir)/jslint
+- $(SHTOOL) install -e 's;#!\./js;#!$(bindir)/js;' -c -m 755 jspack.js $(DESTDIR)$(bindir)/jspack
++ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(prefix)
++ $(BSD_INSTALL_PROGRAM_DIR) $(DESTDIR)$(bindir)
++ $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man1
++ $(BSD_INSTALL_MAN_DIR) $(DESTDIR)$(mandir)/man3
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(includedir)/js
++ $(BSD_INSTALL_DATA_DIR) $(DESTDIR)$(libdir)/pkgconfig
++ $(BSD_INSTALL_MAN) js.1 $(DESTDIR)$(mandir)/man1/
++ $(BSD_INSTALL_MAN) js-config.1 $(DESTDIR)$(mandir)/man1/
++ $(BSD_INSTALL_MAN) js.3 $(DESTDIR)$(mandir)/man3/
++ @for fn in src/js*.h; do \
++ $(BSD_INSTALL_DATA) $$fn $(DESTDIR)$(includedir)/js/; \
++ done
++ @$(LIBTOOL) --mode=install $(BSD_INSTALL_LIB) $(LIB_NAME) $(DESTDIR)$(libdir)/
++ $(BSD_INSTALL_DATA) js.pc $(DESTDIR)$(libdir)/pkgconfig/
++ $(BSD_INSTALL_SCRIPT) js-config.sh $(DESTDIR)$(bindir)/js-config
++ @$(LIBTOOL) --mode=install $(BSD_INSTALL_PROGRAM) \
++ js $(DESTDIR)$(bindir)/
++ for fn in jslint jspack; do \
++ $(BSD_INSTALL_SCRIPT) $${fn}.js $(DESTDIR)$(bindir)/$${fn}; \
++ done
++
+ @if [ ".$(WITH_PERL)" = ".yes" ]; then \
+ (cd src/perlconnect; $(MAKE) $(MFLAGS) install DESTDIR=$(DESTDIR)); \
+ fi
diff --git a/lang/ossp-js/patches/patch-ac b/lang/ossp-js/patches/patch-ac
new file mode 100644
index 00000000000..a1e576717f8
--- /dev/null
+++ b/lang/ossp-js/patches/patch-ac
@@ -0,0 +1,19 @@
+$NetBSD: patch-ac,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+Move two closed parentheses to their proper places. The patch-a[de] files
+reflect this change.
+
+--- aclocal.m4.orig 2006-08-03 08:16:32.000000000 -0400
++++ aclocal.m4
+@@ -195,9 +195,9 @@ AC_DEFUN(AC_CHECK_VA_COPY,[
+ dnl # 6. check for assignment approach (assuming va_list is a pointer)
+ __va_copy_check(ASP, [do { *(d) = *(s); } while (0)])
+ dnl # 7. check for memory copying approach (assuming va_list is a struct)
+- __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s)), sizeof((s))])
++ __va_copy_check(CPS, [memcpy((void *)&(d), (void *)&(s), sizeof((s)))])
+ dnl # 8. check for memory copying approach (assuming va_list is a pointer)
+- __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s)), sizeof(*(s))])
++ __va_copy_check(CPP, [memcpy((void *)(d), (void *)(s), sizeof(*(s)))])
+ if test ".$ac_cv_va_copy" = .; then
+ AC_ERROR([no working implementation found])
+ fi
diff --git a/lang/ossp-js/patches/patch-ad b/lang/ossp-js/patches/patch-ad
new file mode 100644
index 00000000000..53e85d8605f
--- /dev/null
+++ b/lang/ossp-js/patches/patch-ad
@@ -0,0 +1,17 @@
+$NetBSD: patch-ad,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+--- config.h.in.orig 2007-02-08 04:39:29.000000000 -0500
++++ config.h.in
+@@ -10,10 +10,10 @@
+ #define __VA_COPY_USE_C99(d, s) va_copy((d), (s))
+
+ /* Predefined possible va_copy() implementation (id: CPP) */
+-#define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s)), sizeof(*(s))
++#define __VA_COPY_USE_CPP(d, s) memcpy((void *)(d), (void *)(s), sizeof(*(s)))
+
+ /* Predefined possible va_copy() implementation (id: CPS) */
+-#define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s)), sizeof((s))
++#define __VA_COPY_USE_CPS(d, s) memcpy((void *)&(d), (void *)&(s), sizeof((s)))
+
+ /* Predefined possible va_copy() implementation (id: GCB) */
+ #define __VA_COPY_USE_GCB(d, s) __builtin_va_copy((d), (s))
diff --git a/lang/ossp-js/patches/patch-ae b/lang/ossp-js/patches/patch-ae
new file mode 100644
index 00000000000..690d32e1a8c
--- /dev/null
+++ b/lang/ossp-js/patches/patch-ae
@@ -0,0 +1,45 @@
+$NetBSD: patch-ae,v 1.1.1.1 2008/02/06 04:22:33 bjs Exp $
+
+${LIBM} is defined as -lm if we're using the system math library; otherwise
+it's blank. This should configure everything properly downstream.
+
+--- configure.orig 2007-02-08 04:39:29.000000000 -0500
++++ configure
+@@ -3894,7 +3894,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
+-#define DO_VA_COPY(d, s) memcpy((void *)&(d), (void *)&(s))
++#define DO_VA_COPY(d, s) memcpy((void *)&(d), (void *)&(s), sizeof((s)))
+ void test(char *str, ...)
+ {
+ va_list ap, ap2;
+@@ -3975,7 +3975,7 @@ cat >>conftest.$ac_ext <<_ACEOF
+ #include <stdlib.h>
+ #include <stdarg.h>
+ #include <string.h>
+-#define DO_VA_COPY(d, s) memcpy((void *)(d), (void *)(s))
++#define DO_VA_COPY(d, s) memcpy((void *)(d), (void *)(s), sizeof(*(s)))
+ void test(char *str, ...)
+ {
+ va_list ap, ap2;
+@@ -4338,7 +4338,7 @@ sed 's/^/| /' conftest.$ac_ext >&5
+ fi
+
+ rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+- conftest$ac_exeext conftest.$ac_ext
++ conftest$ac_xexeext conftest.$ac_ext
+ LIBS=$ac_check_lib_save_LIBS
+ fi
+ { echo "$as_me:$LINENO: result: $ac_cv_lib_m_floor" >&5
+@@ -4348,7 +4348,9 @@ if test $ac_cv_lib_m_floor = yes; then
+ #define HAVE_LIBM 1
+ _ACEOF
+
+- LIBS="-lm $LIBS"
++if test "x$LIBM" != x; then
++ LIBS="${LIBM} $LIBS"
++fi
+
+ fi
+