Merge branch 'emscripten-shared-library-build' into 'develop'

Improvements for emscripten target

See merge request embeddable-common-lisp/ecl!321
This commit is contained in:
Daniel Kochmański 2024-02-25 10:19:15 +00:00 committed by Marius Gerbershagen
commit 1621f57cd9
9 changed files with 37 additions and 18 deletions

5
src/aclocal.m4 vendored
View file

@ -533,6 +533,11 @@ case "${host}" in
enable_threads='no'
enable_libffi='no'
enable_gmp='portable'
with_c_gmp=yes
SHARED_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
BUNDLE_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
PROGRAM_LDFLAGS="-sMAIN_MODULE -sERROR_ON_UNDEFINED_SYMBOLS=0 ${LDFLAGS}"
INSTALL_TARGET='flatinstall'
;;
esac

View file

@ -103,7 +103,9 @@ the environment variable TMPDIR to a different value." template))
#+msvc
(defun linker-cc (o-pathname object-files &key
(type :program)
(ld-flags (split-program-options *ld-flags*))
(ld-flags (split-program-options (if (eq type :program)
*ld-program-flags*
*ld-flags*)))
(ld-libs (split-program-options *ld-libs*)))
(safe-run-program
*ld*
@ -126,7 +128,9 @@ the environment variable TMPDIR to a different value." template))
#-msvc
(defun linker-cc (o-pathname object-files &key
(type :program)
(ld-flags (split-program-options *ld-flags*))
(ld-flags (split-program-options (if (eq type :program)
*ld-program-flags*
*ld-flags*)))
(ld-libs (split-program-options *ld-libs*)))
(declare (ignore type))
(safe-run-program

View file

@ -57,6 +57,7 @@ coprocessor).")
(defvar *ld-shared-flags* "@SHARED_LDFLAGS@ @LDFLAGS@")
#+dlopen
(defvar *ld-bundle-flags* "@BUNDLE_LDFLAGS@ @LDFLAGS@")
(defvar *ld-program-flags* "@PROGRAM_LDFLAGS@ @LDFLAGS@")
(defvar +shared-library-prefix+ "@SHAREDPREFIX@")
(defvar +shared-library-extension+ "@SHAREDEXT@")

View file

@ -95,7 +95,9 @@
c::*ld-shared-flags*
"@SHARED_LDFLAGS@ @LDFLAGS@"
c::*ld-bundle-flags*
"@BUNDLE_LDFLAGS@ @LDFLAGS@")
"@BUNDLE_LDFLAGS@ @LDFLAGS@"
c::*ld-program-flags*
"@PROGRAM_LDFLAGS@ @LDFLAGS@")
;;; FIXME: The nonstop platform does not support soname
#+(and :wants-dlopen nonstop)
(setf c::*ld-libs*
@ -182,7 +184,7 @@
(push "@LIBPREFIX@eclgmp.@LIBEXT@" extra-args)))
(print extra-args)
(c::shared-cc (compile-file-pathname "ecl" :type :dll)
(list* "c/main.@OBJEXT@"
(list* #-emscripten "c/main.@OBJEXT@"
"c/all_symbols2.@OBJEXT@"
"@LIBPREFIX@lsp.@LIBEXT@"
"@LIBPREFIX@eclmin.@LIBEXT@"

16
src/configure vendored
View file

@ -739,6 +739,7 @@ LIBRARIES
SUBDIRS
TARGETS
EXTRA_OBJS
PROGRAM_LDFLAGS
BUNDLE_LDFLAGS
SHARED_LDFLAGS
CORE_LIBS
@ -3692,7 +3693,7 @@ test -z "${ecldir}" && ecldir="${libdir}/ecl-${PACKAGE_VERSION}"
boehm_configure_flags=""
TARGETS='bin/ecl$(EXE)'
TARGETS='bin/ecl$(EXE)'
SUBDIRS='c doc'
LSP_FEATURES='*features*'
@ -5052,11 +5053,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++11 features" >&5
printf %s "checking for $CXX option to enable C++11 features... " >&6; }
if test ${ac_cv_prog_cxx_11+y}
if test ${ac_cv_prog_cxx_cxx11+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_11=no
ac_cv_prog_cxx_cxx11=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -5098,11 +5099,11 @@ if test x$ac_prog_cxx_stdcxx = xno
then :
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for $CXX option to enable C++98 features" >&5
printf %s "checking for $CXX option to enable C++98 features... " >&6; }
if test ${ac_cv_prog_cxx_98+y}
if test ${ac_cv_prog_cxx_cxx98+y}
then :
printf %s "(cached) " >&6
else $as_nop
ac_cv_prog_cxx_98=no
ac_cv_prog_cxx_cxx98=no
ac_save_CXX=$CXX
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
@ -6233,6 +6234,11 @@ LSP_FEATURES="(cons :android ${LSP_FEATURES})"
enable_threads='no'
enable_libffi='no'
enable_gmp='portable'
with_c_gmp=yes
SHARED_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
BUNDLE_LDFLAGS="-shared -sSIDE_MODULE ${LDFLAGS}"
PROGRAM_LDFLAGS="-sMAIN_MODULE -sERROR_ON_UNDEFINED_SYMBOLS=0 ${LDFLAGS}"
INSTALL_TARGET='flatinstall'
;;
esac

View file

@ -317,6 +317,7 @@ AC_SUBST(CORE_LIBS, []) dnl Locally compiled libs to link into
dnl ecl/ecl_min/libecl.so and nowhere else.
AC_SUBST(SHARED_LDFLAGS) dnl Flags for shared libraries linker
AC_SUBST(BUNDLE_LDFLAGS) dnl Flags for FASL files linker
AC_SUBST(PROGRAM_LDFLAGS) dnl Flags for executable program linker
AC_SUBST(EXTRA_OBJS) dnl Extra *.o files to be compiled into libecl.a
AC_SUBST(TARGETS, ['bin/ecl$(EXE)'])dnl Versions of ECL to be built
AC_SUBST(SUBDIRS, ['c doc']) dnl Subdirectories that make should process