Index: head/lang/ecl/Makefile =================================================================== --- head/lang/ecl/Makefile +++ head/lang/ecl/Makefile @@ -3,7 +3,7 @@ PORTNAME= ecl PORTVERSION= 16.1.3 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= lang lisp MASTER_SITES= https://common-lisp.net/project/ecl/static/files/release/ @@ -16,21 +16,26 @@ BROKEN_mips= fails to build: qemu: uncaught target signal 11 (Segmentation fault) - core dumped BROKEN_mips64= fails to build: qemu: uncaught target signal 11 (Segmentation fault) - core dumped -LIB_DEPENDS= libgmp.so:math/gmp +BUILD_DEPENDS= ${LOCALBASE}/lib/libatomic_ops.a:devel/libatomic_ops +LIB_DEPENDS= libgmp.so:math/gmp \ + libgc.so:devel/boehm-gc MAKE_JOBS_UNSAFE= yes -USES= gmake perl5 tar:tgz +USES= autoreconf gmake localbase perl5 tar:tgz USE_PERL5= build GNU_CONFIGURE= yes -CONFIGURE_ARGS= --with-system-gmp --with-gmp-prefix=${LOCALBASE} --enable-boehm=system -CFLAGS+= -I${LOCALBASE}/include -LDFLAGS+= -L${LOCALBASE}/lib +AUTORECONF_WRKSRC= ${WRKSRC}/src +CONFIGURE_ARGS= --with-system-gmp \ + --with-gmp-prefix=${LOCALBASE} \ + --enable-boehm=system \ + --enable-libatomic=system USE_LDCONFIG= yes -OPTIONS_DEFINE= ASDF DFFI SOCKETS THREADS X11 -OPTIONS_DEFAULT=ASDF DFFI SOCKETS THREADS +OPTIONS_DEFINE= ASDF DFFI SAGE SOCKETS THREADS X11 +OPTIONS_DEFAULT=ASDF DFFI SAGE SOCKETS THREADS ASDF_DESC= Enable ASDF building facility +SAGE_DESC= Build with patches for sage SOCKETS_DESC= Enable socket interface DFFI_DESC= Dynamic foreign-function support @@ -45,6 +50,13 @@ X11_CONFIGURE_ON= --with-x=yes X11_CONFIGURE_OFF= --with-x=no +SAGE_EXTRA_PATCHES= ${PATCHDIR}/extra-patch-src_aclocal.m4 \ + ${PATCHDIR}/extra-patch-src_c_file.d \ + ${PATCHDIR}/extra-patch-src_compile.lsp.in \ + ${PATCHDIR}/extra-patch-src_configure.ac \ + ${PATCHDIR}/extra-patch-src_lsp_format.lsp \ + ${PATCHDIR}/extra-patch-src_Makefile.in + SOCKETS_CONFIGURE_ON= --with-tcp=yes SOCKETS_CONFIGURE_OFF= --with-tcp=no @@ -53,10 +65,9 @@ DFFI_CONFIGURE_OFF= --with-dffi=no THREADS_CONFIGURE_ON= --enable-threads=yes -THREADS_LDFLAGS= -lpthread +THREADS_LDFLAGS= -lpthread -lgc-threaded THREADS_LIB_DEPENDS= libgc-threaded.so:devel/boehm-gc-threaded THREADS_CONFIGURE_OFF= --enable-threads=no -THREADS_LIB_DEPENDS_OFF= libgc.so:devel/boehm-gc post-patch-THREADS-on: @${REINPLACE_CMD} -e 's|-lgc|-lgc-threaded|' ${WRKSRC}/src/configure Index: head/lang/ecl/files/extra-patch-src_Makefile.in =================================================================== --- head/lang/ecl/files/extra-patch-src_Makefile.in +++ head/lang/ecl/files/extra-patch-src_Makefile.in @@ -0,0 +1,19 @@ +--- src/Makefile.in.orig 2016-12-19 10:25:00 UTC ++++ src/Makefile.in +@@ -304,10 +304,14 @@ install: + if test -s $$i ; then \ + if echo $$i | grep dll; then \ + $(INSTALL_LIBRARY) $$i $(DESTDIR)$(bindir); \ +- fi; \ +- $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ ++ else \ ++ $(INSTALL_LIBRARY) $$i $(DESTDIR)$(libdir); \ ++ fi \ + fi \ + done ++ if [ "x@IMPLIB_NAME@" != "x" -a -f "@IMPLIB_NAME@" ]; then \ ++ $(INSTALL_LIBRARY) @IMPLIB_NAME@ $(DESTDIR)$(libdir); \ ++ fi + if [ "x@SONAME3@" != "x" -a -f "@SONAME3@" ]; then \ + ( $(INSTALL_LIBRARY) @SONAME3@ $(DESTDIR)$(libdir) && \ + cd $(DESTDIR)$(libdir) && $(RM) -f @SONAME2@ @SONAME1@ @SONAME@ && \ Index: head/lang/ecl/files/extra-patch-src_aclocal.m4 =================================================================== --- head/lang/ecl/files/extra-patch-src_aclocal.m4 +++ head/lang/ecl/files/extra-patch-src_aclocal.m4 @@ -0,0 +1,64 @@ +--- src/aclocal.m4.orig 2016-12-19 10:25:00 UTC ++++ src/aclocal.m4 +@@ -231,6 +231,8 @@ AC_SUBST(LIBPREFIX)dnl Name components of a statically + AC_SUBST(LIBEXT) + AC_SUBST(SHAREDEXT)dnl Name components of a dynamically linked library + AC_SUBST(SHAREDPREFIX) ++AC_SUBST(IMPLIB_EXT)dnl Name components of a dynamically linked library import file - borrowed from SageMath ++AC_SUBST(IMPLIB_PREFIX) + AC_SUBST(OBJEXT)dnl These are set by autoconf + AC_SUBST(EXEEXT) + AC_SUBST(INSTALL_TARGET)dnl Which type of installation: flat directory or unix like. +@@ -240,6 +242,8 @@ ECL_GC_DIR=bdwgc + ECL_LDRPATH='' + SHAREDEXT='so' + SHAREDPREFIX='lib' ++IMPLIB_EXT='' ++IMPLIB_PREFIX='' + LIBPREFIX='lib' + LIBEXT='a' + PICFLAG='-fPIC' +@@ -251,6 +255,8 @@ THREAD_OBJ="$THREAD_OBJ c/threads/process c/threads/qu + clibs='-lm' + SONAME='' + SONAME_LDFLAGS='' ++IMPLIB_NAME='' ++IMPLIB_LDFLAGS='' + case "${host_os}" in + linux-androideabi) + thehost='android' +@@ -366,10 +372,14 @@ case "${host_os}" in + shared='yes' + THREAD_CFLAGS='-D_THREAD_SAFE' + THREAD_LIBS='-lpthread' +- SHARED_LDFLAGS="-shared ${LDFLAGS}" +- BUNDLE_LDFLAGS="-shared ${LDFLAGS}" +- SHAREDPREFIX='' ++ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ SHAREDPREFIX='cyg' + SHAREDEXT='dll' ++ IMPLIB_PREFIX='lib' ++ IMPLIB_EXT='dll.a' ++ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" ++ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" + PICFLAG='' + if test "x$host_cpu" = "xx86_64" ; then + # Our GMP library is too old and does not support +@@ -387,10 +397,14 @@ case "${host_os}" in + enable_threads='yes' + THREAD_CFLAGS='-D_THREAD_SAFE' + THREAD_GC_FLAGS='--enable-threads=win32' +- SHARED_LDFLAGS='' +- BUNDLE_LDFLAGS='' ++ SHARED_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" ++ BUNDLE_LDFLAGS="-shared -Wl,--enable-auto-image-base ${LDFLAGS}" + SHAREDPREFIX='' + SHAREDEXT='dll' ++ IMPLIB_PREFIX='lib' ++ IMPLIB_EXT='dll.a' ++ IMPLIB_NAME="${IMPLIB_PREFIX}ecl.${IMPLIB_EXT}" ++ IMPLIB_LDFLAGS="-Wl,--out-implib,${IMPLIB_NAME}" + PICFLAG='' + INSTALL_TARGET='flatinstall' + TCPLIBS='-lws2_32' Index: head/lang/ecl/files/extra-patch-src_c_file.d =================================================================== --- head/lang/ecl/files/extra-patch-src_c_file.d +++ head/lang/ecl/files/extra-patch-src_c_file.d @@ -0,0 +1,15 @@ +--- src/c/file.d.orig 2016-12-19 10:25:00 UTC ++++ src/c/file.d +@@ -3351,8 +3351,10 @@ output_stream_write_byte8(cl_object strm, unsigned cha + ecl_disable_interrupts(); + do { + out = fwrite(c, sizeof(char), n, IO_STREAM_FILE(strm)); +- } while (out < n && restartable_io_error(strm, "fwrite")); +- ecl_enable_interrupts(); ++ /* Ignore write errors to stderr to avoid an infinite loop - patch from SageMath */ ++ } while (out < n && (IO_STREAM_FILE(strm) != stderr) && restartable_io_error(strm, "fwrite")); ++ ++ ecl_enable_interrupts(); + return out; + } + Index: head/lang/ecl/files/extra-patch-src_compile.lsp.in =================================================================== --- head/lang/ecl/files/extra-patch-src_compile.lsp.in +++ head/lang/ecl/files/extra-patch-src_compile.lsp.in @@ -0,0 +1,13 @@ +--- src/compile.lsp.in.orig 2016-12-19 10:25:00 UTC ++++ src/compile.lsp.in +@@ -142,8 +142,9 @@ + #+:wants-dlopen + ;;; + ;;; We do not need the -rpath flag for the library, nor -lecl. ++;;; Patch borrowed from SageMath + ;;; +-(let* ((c::*ld-shared-flags* #-msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @CORE_LIBS@ @FASL_LIBS@ @LIBS@" ++(let* ((c::*ld-shared-flags* #-msvc " @IMPLIB_LDFLAGS@ @SHARED_LDFLAGS@ @LDFLAGS@ @SONAME_LDFLAGS@ @CORE_LIBS@ @FASL_LIBS@ @LIBS@" + #+msvc "@SHARED_LDFLAGS@ @LDFLAGS@ @STATICLIBS@ @CLIBS@") + (c::*cc-flags* (concatenate 'string "-DECL_API -I@true_builddir@/c " c::*cc-flags*)) + (extra-args nil)) Index: head/lang/ecl/files/extra-patch-src_configure.ac =================================================================== --- head/lang/ecl/files/extra-patch-src_configure.ac +++ head/lang/ecl/files/extra-patch-src_configure.ac @@ -0,0 +1,22 @@ +--- src/configure.ac.orig 2016-12-19 10:25:00 UTC ++++ src/configure.ac +@@ -606,6 +606,19 @@ AC_SUBST(SONAME1) + AC_SUBST(SONAME) + AC_SUBST(SONAME_LDFLAGS) + ++dnl ---------------------------------------------------------------------- ++dnl IMPLIB_NAME is only active when IMPLIB_NAME is non nil ++dnl Patch borrowed from SageMath ++AC_MSG_CHECKING(for import name) ++if test "${enable_soname}" != yes; then ++ IMPLIB_NAME='' ++ AC_MSG_RESULT([none]) ++else ++ AC_MSG_RESULT([${IMPLIB_NAME}]) ++fi ++AC_SUBST(IMPLIB_NAME) ++AC_SUBST(IMPLIB_LDFLAGS) ++ + dnl Related to that, the package version number + ECL_VERSION_NUMBER=$(($PACKAGE_MAJOR * 10000 + $PACKAGE_MINOR * 100 + $PACKAGE_LEAST)) + AC_SUBST(ECL_VERSION_NUMBER) Index: head/lang/ecl/files/extra-patch-src_lsp_format.lsp =================================================================== --- head/lang/ecl/files/extra-patch-src_lsp_format.lsp +++ head/lang/ecl/files/extra-patch-src_lsp_format.lsp @@ -0,0 +1,78 @@ +--- src/lsp/format.lsp.orig 2016-12-19 10:25:00 UTC ++++ src/lsp/format.lsp +@@ -308,11 +308,14 @@ + :start (format-directive-start struct) + :end (format-directive-end struct)))) + ++;; Patch borrowed from SageMath ++(defconstant +format-directive-limit+ (1+ (char-code #\~))) ++ + #+formatter + (defparameter *format-directive-expanders* +- (make-array char-code-limit :initial-element nil)) ++ (make-array +format-directive-limit+ :initial-element nil)) + (defparameter *format-directive-interpreters* +- (make-array char-code-limit :initial-element nil)) ++ (make-array +format-directive-limit+ :initial-element nil)) + + (defparameter *default-format-error-control-string* nil) + (defparameter *default-format-error-offset* nil) +@@ -545,24 +548,24 @@ + (write-string directive stream) + (interpret-directive-list stream (cdr directives) orig-args args)) + (#-ecl format-directive #+ecl vector ++ (multiple-value-bind ++ (new-directives new-args) ++ (let* ((code (char-code (format-directive-character directive))) ++ (function ++ (and (< code +format-directive-limit+) ++ (svref *format-directive-interpreters* code))) ++ (*default-format-error-offset* ++ (1- (format-directive-end directive)))) ++ (unless function ++ (error 'format-error ++ :complaint "Unknown format directive.")) + (multiple-value-bind + (new-directives new-args) +- (let ((function +- (svref *format-directive-interpreters* +- (char-code (format-directive-character +- directive)))) +- (*default-format-error-offset* +- (1- (format-directive-end directive)))) +- (unless function +- (error 'format-error +- :complaint "Unknown format directive.")) +- (multiple-value-bind +- (new-directives new-args) +- (funcall function stream directive +- (cdr directives) orig-args args) +- (values new-directives new-args))) +- (interpret-directive-list stream new-directives +- orig-args new-args))))) ++ (funcall function stream directive ++ (cdr directives) orig-args args) ++ (values new-directives new-args))) ++ (interpret-directive-list stream new-directives ++ orig-args new-args))))) + args)) + + +@@ -634,11 +637,12 @@ + (values `(write-string ,directive stream) + more-directives)) + (format-directive +- (let ((expander +- (aref *format-directive-expanders* +- (char-code (format-directive-character directive)))) +- (*default-format-error-offset* +- (1- (format-directive-end directive)))) ++ (let* ((code (char-code (format-directive-character directive))) ++ (expander ++ (and (< code +format-directive-limit+) ++ (svref *format-directive-expanders* code))) ++ (*default-format-error-offset* ++ (1- (format-directive-end directive)))) + (if expander + (funcall expander directive more-directives) + (error 'format-error Index: head/lang/ecl/pkg-plist =================================================================== --- head/lang/ecl/pkg-plist +++ head/lang/ecl/pkg-plist @@ -1,67 +1,5 @@ bin/ecl bin/ecl-config -%%THREADS%%include/ecl/atomic_ops.h -%%THREADS%%include/ecl/atomic_ops/ao_version.h -%%THREADS%%include/ecl/atomic_ops/generalize-arithm.h -%%THREADS%%include/ecl/atomic_ops/generalize-small.h -%%THREADS%%include/ecl/atomic_ops/generalize.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/all_acquire_release_volatile.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/all_aligned_atomic_load_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/all_atomic_load_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/all_atomic_only_load.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/ao_t_is_int.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/armcc/arm_v6.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/emul_cas.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/aarch64.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/alpha.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/arm.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/avr32.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/cris.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/generic-arithm.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/generic-small.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/generic.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/hexagon.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/hppa.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/ia64.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/m68k.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/mips.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/powerpc.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/s390.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/sh.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/sparc.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/gcc/x86.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/generic_pthread.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/hpc/hppa.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/hpc/ia64.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/ibmc/powerpc.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/icc/ia64.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/acquire_release_volatile.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/atomic_load.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/atomic_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/char_acquire_release_volatile.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/char_atomic_load.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/char_atomic_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/double_atomic_load_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/int_acquire_release_volatile.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/int_atomic_load.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/int_atomic_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/ordered_loads_only.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/ordered_stores_only.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/short_acquire_release_volatile.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/short_atomic_load.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/loadstore/short_atomic_store.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/msftc/arm.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/msftc/common32_defs.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/msftc/x86.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/msftc/x86_64.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/ordered.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/ordered_except_wr.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/read_ordered.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/standard_ao_double_t.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/sunc/sparc.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/sunc/x86.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/test_and_set_t_is_ao_t.h -%%THREADS%%include/ecl/atomic_ops/sysdeps/test_and_set_t_is_char.h include/ecl/bytecodes.h include/ecl/cache.h include/ecl/config-internal.h