diff --git a/src/CHANGELOG b/src/CHANGELOG index 61ef370bb..44f78ecff 100644 --- a/src/CHANGELOG +++ b/src/CHANGELOG @@ -6,6 +6,13 @@ ECL 9.8.2: - The C inline expansion for sin, cos, and tan were wrong due to three recently introduced typos. +* Visible changes: + + - A new configuration flag, --enable-rpath, allows hardcoding in ECL the + location of its shared library. This is not needed in Windows, it should + work on all supported platforms and its purpose is to simplify the + installation of ECL in nonstandard locations. + ECL 9.8.1: ========== diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 7a7067a27..50b8d4d09 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -183,7 +183,7 @@ AC_SUBST(SOFTWARE_TYPE)dnl Type of operating system AC_SUBST(SOFTWARE_VERSION)dnl Version number of operating system AC_SUBST(MACHINE_VERSION)dnl Version of the machine -AC_SUBST(LDRPATH)dnl Sometimes the path for finding DLLs must be hardcoded. +AC_SUBST(ECL_LDRPATH)dnl Sometimes the path for finding DLLs must be hardcoded. AC_SUBST(LIBPREFIX)dnl Name components of a statically linked library AC_SUBST(LIBEXT) AC_SUBST(SHAREDEXT)dnl Name components of a dynamically linked library @@ -192,7 +192,7 @@ 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. AC_SUBST(thehost) -LDRPATH='~*' +ECL_LDRPATH='' SHAREDEXT='so' SHAREDPREFIX='lib' LIBPREFIX='lib' @@ -214,7 +214,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ??? CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ${CFLAGS}" @@ -227,7 +227,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" CFLAGS="-D_GNU_SOURCE ${CFLAGS}" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" @@ -239,7 +239,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" CFLAGS="-D_GNU_SOURCE ${CFLAGS}" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" @@ -250,7 +250,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -260,7 +260,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -271,7 +271,7 @@ case "${host_os}" in THREAD_LIBS='' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="-lpthread -lm" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -280,7 +280,7 @@ case "${host_os}" in thehost='sun4sol2' SHARED_LDFLAGS="-dy -G ${LDFLAGS}" BUNDLE_LDFLAGS="-dy -G ${LDFLAGS}" - LDRPATH='-Wl,-R,~A' + ECL_LDRPATH='-Wl,-R,~A' TCPLIBS='-lsocket -lnsl -lintl' clibs='-ldl' CFLAGS="${CFLAGS} -std=gnu99" @@ -317,7 +317,7 @@ case "${host_os}" in PICFLAG='-fPIC -fno-common' SHARED_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress ${LDFLAGS}" BUNDLE_LDFLAGS="-bundle ${LDFLAGS}" - LDRPATH='' + ECL_LDRPATH='' THREAD_CFLAGS='-D_THREAD_SAFE' THREAD_LIBS='-lpthread' # The GMP library has not yet been ported to Intel-OSX @@ -342,7 +342,7 @@ case "${host_os}" in THREAD_CFLAGS='-spthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wld=\"-rld_l ~A\"' + ECL_LDRPATH='-Wld=\"-rld_l ~A\"' clibs="-Wld=-lrld" ;; *) diff --git a/src/cmp/cmpdefs.lsp b/src/cmp/cmpdefs.lsp index a64f694b8..d55f94b8b 100644 --- a/src/cmp/cmpdefs.lsp +++ b/src/cmp/cmpdefs.lsp @@ -452,11 +452,11 @@ coprocessor).") (defvar *cc-optimize* #-msvc "-O" #+msvc "@CFLAGS_OPTIMIZE@") -(defvar *ld-format* #-msvc "~A -o ~S -L~S ~{~S ~} ~A" - #+msvc "~A -Fe~S~* ~{~S ~} ~A") +(defvar *ld-format* #-msvc "~A -o ~S -L~S ~{~S ~} ~@[~S~] ~A" + #+msvc "~A -Fe~S~* ~{~S ~} ~@[~S~] ~A") -(defvar *cc-format* #-msvc "~A ~A ~:[~*~;~A~] \"-I~A\" -w -c \"~A\" -o \"~A\"" - #+msvc "~A ~A ~:[~*~;~A~] -I\"~A\" -w -c \"~A\" -Fo\"~A\"") +(defvar *cc-format* #-msvc "~A \"-I~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -o \"~A\"" + #+msvc "~A -I\"~A\" ~A ~:[~*~;~A~] -w -c \"~A\" -Fo\"~A\"") #-dlopen (defvar *ld-flags* "@LDFLAGS@ -lecl @CORE_LIBS@ @FASL_LIBS@ @LIBS@") @@ -482,6 +482,11 @@ coprocessor).") (defvar *ecl-include-directory* @includedir\@) (defvar *ecl-library-directory* @libdir\@) +(defvar *ld-rpath* + (let ((x "@ECL_LDRPATH@")) + (and (plusp (length x)) + (format nil x *ecl-library-directory*)))) + ;;; ;;; Compiler program and flags. ;;; diff --git a/src/cmp/cmpmain.lsp b/src/cmp/cmpmain.lsp index d622e42af..df17dbdd6 100644 --- a/src/cmp/cmpmain.lsp +++ b/src/cmp/cmpmain.lsp @@ -90,6 +90,7 @@ (si::coerce-to-filename o-pathname) (fix-for-mingw (ecl-library-directory)) options + *ld-rpath* *ld-flags*))) #+dlopen @@ -102,15 +103,17 @@ (si::coerce-to-filename o-pathname) (fix-for-mingw (ecl-library-directory)) options + *ld-rpath* *ld-shared-flags*)) #+(or mingw32) (let ((lib-file (compile-file-pathname o-pathname :type :lib))) (safe-system (format nil - "gcc -shared -o ~S -L~S ~{~S ~} ~@?" + "gcc -shared -o ~S -L~S ~{~S ~} ~@[~S~] ~@?" (si::coerce-to-filename o-pathname) (fix-for-mingw (ecl-library-directory)) options + *ld-rpath* *ld-shared-flags*)))) #+dlopen @@ -123,6 +126,7 @@ (si::coerce-to-filename o-pathname) (fix-for-mingw (ecl-library-directory)) options + *ld-rpath* #-msvc *ld-bundle-flags* #+msvc (concatenate 'string *ld-bundle-flags* " /EXPORT:" init-name @@ -134,10 +138,11 @@ #+(or mingw32) (safe-system (format nil - "gcc -shared -o ~A -Wl,--export-all-symbols -L~S ~{~S ~} ~A" + "gcc -shared -o ~A -Wl,--export-all-symbols -L~S ~{~S ~} ~@[~S~] ~A" (si::coerce-to-filename o-pathname) (fix-for-mingw (ecl-library-directory)) options + *ld-rpath* *ld-bundle-flags*))) (defconstant +lisp-program-header+ " @@ -850,8 +855,9 @@ from the C language code. NIL means \"do not create the file\"." (safe-system (format nil *cc-format* - *cc* *cc-flags* (>= (cmp-env-optimization 'speed) 2) *cc-optimize* - (fix-for-mingw (ecl-include-directory)) + *cc* + (fix-for-mingw (ecl-include-directory)) + *cc-flags* (>= (cmp-env-optimization 'speed) 2) *cc-optimize* (si::coerce-to-filename c-pathname) (si::coerce-to-filename o-pathname)) ; Since the SUN4 assembler loops with big files, you might want to use this: diff --git a/src/configure b/src/configure index 85d4016c1..95b6ddb89 100755 --- a/src/configure +++ b/src/configure @@ -671,7 +671,7 @@ SHAREDPREFIX SHAREDEXT LIBEXT LIBPREFIX -LDRPATH +ECL_LDRPATH MACHINE_VERSION SOFTWARE_VERSION SOFTWARE_TYPE @@ -764,6 +764,7 @@ ac_user_opts=' enable_option_checking with_cross_config enable_shared +enable_rpath enable_threads enable_boehm enable_slow_config @@ -1446,6 +1447,8 @@ Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-shared enable loading compiled files (default=YES) + --enable-rpath hard-code the location of the ECL shared library. + (no|yes, default=NO) --enable-threads support for native threads (yes|no|auto, default=NO). --enable-boehm use the Boehm-Weiser garbage collector @@ -2031,6 +2034,14 @@ else fi +# Check whether --enable-rpath was given. +if test "${enable_rpath+set}" = set; then + enableval=$enable_rpath; +else + enable_rpath=no +fi + + # Check whether --enable-threads was given. if test "${enable_threads+set}" = set; then enableval=$enable_threads; @@ -4359,7 +4370,7 @@ MV="mv" -LDRPATH='~*' +ECL_LDRPATH='' SHAREDEXT='so' SHAREDPREFIX='lib' LIBPREFIX='lib' @@ -4381,7 +4392,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" # Maybe CFLAGS="-D_ISOC99_SOURCE ${CFLAGS}" ??? CFLAGS="-D_GNU_SOURCE -D_FILE_OFFSET_BITS=64 ${CFLAGS}" @@ -4394,7 +4405,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" CFLAGS="-D_GNU_SOURCE ${CFLAGS}" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" @@ -4406,7 +4417,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wl,--rpath,~A' + ECL_LDRPATH='-Wl,--rpath,~A' clibs="-ldl" CFLAGS="-D_GNU_SOURCE ${CFLAGS}" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" @@ -4417,7 +4428,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -4427,7 +4438,7 @@ case "${host_os}" in THREAD_LIBS='-lpthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -4438,7 +4449,7 @@ case "${host_os}" in THREAD_LIBS='' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH="-Wl,--rpath,~A" + ECL_LDRPATH="-Wl,--rpath,~A" clibs="-lpthread -lm" SONAME="${SHAREDPREFIX}ecl.${SHAREDEXT}.SOVERSION" SONAME_LDFLAGS="-Wl,-soname,SONAME" @@ -4447,7 +4458,7 @@ case "${host_os}" in thehost='sun4sol2' SHARED_LDFLAGS="-dy -G ${LDFLAGS}" BUNDLE_LDFLAGS="-dy -G ${LDFLAGS}" - LDRPATH='-Wl,-R,~A' + ECL_LDRPATH='-Wl,-R,~A' TCPLIBS='-lsocket -lnsl -lintl' clibs='-ldl' CFLAGS="${CFLAGS} -std=gnu99" @@ -4484,7 +4495,7 @@ case "${host_os}" in PICFLAG='-fPIC -fno-common' SHARED_LDFLAGS="-dynamiclib -flat_namespace -undefined suppress ${LDFLAGS}" BUNDLE_LDFLAGS="-bundle ${LDFLAGS}" - LDRPATH='' + ECL_LDRPATH='' THREAD_CFLAGS='-D_THREAD_SAFE' THREAD_LIBS='-lpthread' # The GMP library has not yet been ported to Intel-OSX @@ -4509,7 +4520,7 @@ case "${host_os}" in THREAD_CFLAGS='-spthread' SHARED_LDFLAGS="-shared ${LDFLAGS}" BUNDLE_LDFLAGS="-shared ${LDFLAGS}" - LDRPATH='-Wld=\"-rld_l ~A\"' + ECL_LDRPATH='-Wld=\"-rld_l ~A\"' clibs="-Wld=-lrld" ;; *) @@ -12972,7 +12983,11 @@ LSP_FEATURES="(cons :wants-dlopen ${LSP_FEATURES})" else enable_soname=no LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}" - LDRPATH='~*' + ECL_LDRPATH='' +fi + +if test "x${enable_rpath}" = "xno"; then + ECL_LDRPATH='' fi if test "${with_cmuformat}" = "yes"; then diff --git a/src/configure.in b/src/configure.in index 9c009cc2d..0d5438b9d 100644 --- a/src/configure.in +++ b/src/configure.in @@ -33,6 +33,12 @@ AC_ARG_ENABLE(shared, [enable loading compiled files (default=YES)]), [], [enable_shared=yes]) +AC_ARG_ENABLE(rpath, + AS_HELP_STRING( [--enable-rpath], + [hard-code the location of the ECL shared library.] + [(no|yes, default=NO)]), + [], [enable_rpath=no] ) + AC_ARG_ENABLE(threads, AS_HELP_STRING( [--enable-threads], [support for native threads (yes|no|auto, default=NO).]), @@ -634,7 +640,11 @@ if test ${enable_shared} = "yes"; then else enable_soname=no LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}" - LDRPATH='~*' + ECL_LDRPATH='' +fi + +if test "x${enable_rpath}" = "xno"; then + ECL_LDRPATH='' fi if test "${with_cmuformat}" = "yes"; then