From cc7bcb81fc74a6cdfa334287a488ac15901c0af3 Mon Sep 17 00:00:00 2001 From: jjgarcia Date: Mon, 6 Oct 2003 12:46:09 +0000 Subject: [PATCH] Fixes on the build sequence, to avoid duplicate mentions of libgmp and not required uses of -rpath --- src/aclocal.m4 | 4 ++-- src/compile.lsp.in | 18 +++++++++++------- src/configure | 8 +++++--- src/configure.in | 4 +++- 4 files changed, 21 insertions(+), 13 deletions(-) diff --git a/src/aclocal.m4 b/src/aclocal.m4 index 12687f881..be8fd93ca 100644 --- a/src/aclocal.m4 +++ b/src/aclocal.m4 @@ -132,15 +132,15 @@ case "${host_os}" in ;; freebsd*) thehost="freebsd" - CLIBS="-lcompat" SHARED_LDFLAGS="-shared" LDRPATH="-Wl,--rpath,~A" + CLIBS="" ;; netbsd*) thehost="netbsd" SHARED_LDFLAGS="-shared" LDRPATH="-Wl,--rpath,~A" - CLIBS="-lcompat" + CLIBS="" ;; solaris*) thehost="sun4sol2" diff --git a/src/compile.lsp.in b/src/compile.lsp.in index f7ac08742..0132e3777 100644 --- a/src/compile.lsp.in +++ b/src/compile.lsp.in @@ -52,15 +52,19 @@ (si::system (format nil " mkdir tmp; ~ cd tmp; ~ -ar -x ../liblsp.a; for i in *.o; do mv $i lsp_$i; done; ar -r ../libecl.a *o; rm *.o; ~ -ar -x ../libclos.a; for i in *.o; do mv $i lsp_$i; done; ar -r ../libecl.a *o; rm *.o; ~ -ranlib ../libecl.a; ~ -cd ..; rm -rf tmp/* liblsp* libclos* ")) +ar -x ../@LIBPREFIX@lsp.@LIBEXT@; for i in *.@OBJEXT@; do mv $i lsp_$i; done; ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@; rm *.@OBJEXT@; ~ +ar -x ../@LIBPREFIX@clos.@LIBEXT@; for i in *.@OBJEXT@; do mv $i lsp_$i; done; ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@; rm *.@OBJEXT@; ~ +@RANLIB@ ../@LIBPREFIX@ecl.@LIBEXT@; ~ +cd ..; rm -rf tmp/* @LIBPREFIX@{lsp,clos} ")) #+dlopen -(progn - (c::shared-cc "./tmp/libecl.so" "c/main.o" "./libecl.a" #+boehm-gc "-lgc") - (si::system "mv ./tmp/libecl.so .")) +;; We do not need the -rpath flag for the library, nor -lecl. +(let ((c::*ld-flags* "@CLIBS@")) + (c::shared-cc (compile-file-pathname "ecl" :type :dll) + "c/main.@OBJEXT@" + (compile-file-pathname "ecl" :type :lib) + #+boehm-gc "-lgc" + "-lgmp")) ;;; ;;; * Compile, load and link Common-Lisp to C compiler diff --git a/src/configure b/src/configure index 4368638fb..c7075e88c 100755 --- a/src/configure +++ b/src/configure @@ -3847,15 +3847,15 @@ case "${host_os}" in ;; freebsd*) thehost="freebsd" - CLIBS="-lcompat" SHARED_LDFLAGS="-shared" LDRPATH="-Wl,--rpath,~A" + CLIBS="" ;; netbsd*) thehost="netbsd" SHARED_LDFLAGS="-shared" LDRPATH="-Wl,--rpath,~A" - CLIBS="-lcompat" + CLIBS="" ;; solaris*) thehost="sun4sol2" @@ -4083,7 +4083,7 @@ TARGETS="ecl${EXEEXT}" LIBRARIES="" LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}" SUBDIR=c -CLIBS="${CLIBS} -lgmp -lm" +CLIBS="${CLIBS} -lm" if test ${boehm} = "no" ; then EXTRA_OBJS="${EXTRA_OBJS} alloc.${OBJEXT} gbc.${OBJEXT}" else @@ -4112,6 +4112,8 @@ fi if test ${local_gmp} = "no" ; then LIBRARIES="${LIBRARIES} ${LIBPREFIX}gmp.${LIBEXT}" SUBDIR="${SUBDIR} gmp" +else + CLIBS="-lgmp ${CLIBS}" fi if test ${runtime} ; then cat >>confdefs.h <<\_ACEOF diff --git a/src/configure.in b/src/configure.in index 5f1fbda68..597b9c560 100644 --- a/src/configure.in +++ b/src/configure.in @@ -163,7 +163,7 @@ TARGETS="ecl${EXEEXT}" LIBRARIES="" LSP_LIBRARIES="${LIBPREFIX}ecl.${LIBEXT}" SUBDIR=c -CLIBS="${CLIBS} -lgmp -lm" +CLIBS="${CLIBS} -lm" if test ${boehm} = "no" ; then EXTRA_OBJS="${EXTRA_OBJS} alloc.${OBJEXT} gbc.${OBJEXT}" else @@ -186,6 +186,8 @@ fi if test ${local_gmp} = "no" ; then LIBRARIES="${LIBRARIES} ${LIBPREFIX}gmp.${LIBEXT}" SUBDIR="${SUBDIR} gmp" +else + CLIBS="-lgmp ${CLIBS}" fi if test ${runtime} ; then AC_DEFINE(RUNTIME)