From cf0748d1d97029eff90780790e444c5eee19f49f Mon Sep 17 00:00:00 2001 From: apo Date: Tue, 4 Apr 2006 15:07:48 +0000 Subject: [PATCH] Porting on Mandriva 64 (use libtool way as much as possible) --- adm_local/unix/make_conclude.in | 91 ++++++++++++++------------------- 1 file changed, 38 insertions(+), 53 deletions(-) diff --git a/adm_local/unix/make_conclude.in b/adm_local/unix/make_conclude.in index 58b0b8f39..9458d908d 100644 --- a/adm_local/unix/make_conclude.in +++ b/adm_local/unix/make_conclude.in @@ -48,11 +48,6 @@ LIB_OBJ_F = $(patsubst %.f, %.lo, $(filter %.f, $(LIB_SRC))) # all libtool obj file in library LIB_OBJ = $(LIB_OBJ_CXX) $(LIB_OBJ_CC) $(LIB_OBJ_C) $(LIB_CLIENT_OBJ:%.o=%.lo) $(LIB_SERVER_OBJ:%.o=%.lo) $(LIB_SWIG_OBJ) $(LIB_OBJ_F) -# LIB_BUILD = $(LIB:%.la=$(top_builddir)/lib/salome/%.la) -LIB_BUILD = $(patsubst %.la, $(top_builddir)/lib/salome/%.la, $(filter %.la, $(LIB))) -LIB_BUILD_A = $(patsubst %.a, $(top_builddir)/lib/salome/%.a, $(filter %.a, $(LIB))) -LIB_BUILD_SO = $(patsubst %.so, $(top_builddir)/lib/salome/%.so, $(filter %.so, $(LIB))) - ifneq ($(findstring cmodule.la,$(filter %.la, $(LIB))),) ifneq ($(GUI_DISABLE_CORBA),yes) LIB_SWIG = $(patsubst %cmodule.la,%.so, $(filter %.la, $(LIB))) @@ -63,33 +58,14 @@ else LIB_SWIG = endif -lib: $(LIB_BUILD) $(LIB_BUILD_SO) $(LIB_CLIENT_PY) -# we don't build static library ! - -$(LIB_BUILD): $(top_builddir)/lib/salome/%.la: %.la - -$(RM) $@ - -$(RM) $(patsubst %.la, %.so, $@) - -$(RM) $(patsubst %.la, %.a, $@) - ln -sf $(CURDIR)/$< $@ || true - ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<) \ - $(patsubst %.la, %.so, $@) || true - ln -sf $(patsubst %.la, %.so, $(CURDIR)/.libs/$<).0 \ - $(patsubst %.la, %.so, $@).0 || true - - if ! test -z $(LIB_SWIG) ; then \ - ln -sf $(patsubst %.la,%.so, $(CURDIR)/.libs/$<) $(top_builddir)/lib/salome/_$(LIB_SWIG) || true;\ - fi; - -$(LIB_BUILD_A): $(top_builddir)/lib/salome/%.a: %.a - -$(RM) $@ - ln -sf $(CURDIR)/$< $@ || true +lib: $(LIB) -$(LIB_BUILD_SO): $(top_builddir)/lib/salome/%.so: %.so - -$(RM) $@ - ln -sf $(CURDIR)/$< $@ || true +LIB_BUILDDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/lib/salome $(LIB): $(LIB_OBJ) - $(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + $(LT) --mode=uninstall $(RM) $(LIB_BUILDDIR)/$@ + $(LT) --mode=link $(CXX) -shared -rpath $(LIB_BUILDDIR) -o $@ $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) + $(LT_INSTALL_LIB) $@ $(LIB_BUILDDIR)/$@ # transform idl reference in appropriate obj file ifneq ($(GUI_DISABLE_CORBA),yes) @@ -118,16 +94,16 @@ BIN_OBJ_CXX = $(patsubst %.cxx, %.lo, $(filter %.cxx, $(BIN_SRC))) # all obj file in bin target BIN_OBJ = $(BIN_OBJ_CC) $(BIN_OBJ_CXX) $(BIN_OBJ_C) $(BIN_CLIENT_OBJ) $(BIN_SERVER_OBJ) -bin: $(BIN:%=$(top_builddir)/bin/salome/%) $(BIN) $(LIB) pyscripts sharedpyscripts +bin: $(BIN) pyscripts sharedpyscripts BIN_LIB=$(LIB:lib%.la=-l%) -$(BIN:%=$(top_builddir)/bin/salome/%) $(TEST_PROGS:%=$(top_builddir)/bin/salome/%): $(top_builddir)/bin/salome/%: % - -$(RM) $@ - ln -sf $(CURDIR)/$< $@ +BIN_BUILDDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/bin/salome -$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) - $(LT) --mode=link $(CXX) -rpath $(libdir) -o $@ $^ $(CXXFLAGS) $(CPPFLAGS) $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) +$(BIN) $(TEST_PROGS): %: %.lo $(BIN_OBJ) $(LIB) + $(LT) --mode=uninstall $(RM) $(BIN_BUILDDIR)/$@ + $(LT) --mode=link $(CXX) -rpath $(BIN_BUILDDIR) -o $@ $^ $(CXXFLAGS) $(CPPFLAGS) $(BIN_LIB) $(LDFLAGSFORBIN) $(LIBSFORBIN) + $(LT_INSTALL_PROG) $@ $(BIN_BUILDDIR)/$@ # copy python scripts in $(top_builddir)/bin/salome # @@ -201,31 +177,40 @@ $(RESOURCES_FILES:%=$(top_builddir)/share/salome/resources/%): $(top_builddir)/s $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) $(sharedpydir): $(INSTALL) -d $@ && chmod 755 $@ +LIB_INSTALLDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/lib +BIN_INSTALLDIR=$(shell cd $(CURDIR)/$(top_builddir); pwd)/bin + # Install the library, the public header files, and programs. install: $(LIB) $(BIN) $(TEST_PROGS) $(libdir) $(includedir) $(bindir) $(datadir) $(idldir) install-python install-sharedpyqt install-qm install-res - @for f in X $(LIB); do \ - if test $$f != X; then \ - echo "($(LT_INSTALL_LIB) '$$f' '$(libdir)/$$f' || exit 1)"; \ - ($(LT_INSTALL_LIB) "$$f" "$(libdir)/$$f" || exit 1); \ - fi; \ + @for f in X $(LIB); do \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $(LIB_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath $(libdir) -o $(LIB_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_LIB) '$(LIB_INSTALLDIR)/$$f' '$(libdir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_LIB) "$(LIB_INSTALLDIR)/$$f" "$(libdir)/$$f" || exit 1); \ + fi; \ done - @if ! test -z $(LIB_SWIG) ; then \ + @if ! test -z $(LIB_SWIG) ; then \ (cd $(libdir); ln -sf $(patsubst %.so, %cmodule.so, $(LIB_SWIG)) _$(LIB_SWIG) || true); \ fi; - @for f in X $(BIN); do \ - if test $$f != X; then \ - echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$f' || exit 1)"; \ - ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$f" || exit 1); \ - fi; \ + @for f in X $(BIN); \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath $(bindir) -o $(BIN_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath $(bindir) -o $(BIN_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_PROG) '$(BIN_INSTALLDIR)/$$f' '$(bindir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$(BIN_INSTALLDIR)/$$f" "$(bindir)/$$f" || exit 1); \ + fi; \ done -# Install tests programmes in bindir - @for f in X $(TEST_PROGS); do \ - if test $$f != X; then \ - echo "($(LT_INSTALL_PROG) '$$f' '$(bindir)/$$f' || exit 1)"; \ - ($(LT_INSTALL_PROG) "$$f" "$(bindir)/$$f" || exit 1); \ - fi; \ + # Install tests programmes in bindir + @for f in X $(TEST_PROGS); \ + if test $$f != X; then \ + echo "($(LT) --mode=link $(CXX) -shared -rpath $(bindir) -o $(BIN_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1)"; \ + ($(LT) --mode=link $(CXX) -shared -rpath $(bindir) -o $(BIN_INSTALLDIR)/$$f $(CXXFLAGS) $(LIB_OBJ) $(LDFLAGS) $(LIBS) || exit 1); \ + echo "($(LT_INSTALL_PROG) '$(BIN_INSTALLDIR)/$$f' '$(bindir)/$$f' || exit 1)"; \ + ($(LT_INSTALL_PROG) "$(BIN_INSTALLDIR)/$$f" "$(bindir)/$$f" || exit 1); \ + fi; \ done -# Install exported includes in includedir + # Install exported includes in includedir @for f in X $(EXPORT_HEADERS:%=$(srcdir)/%); do \ if test $$f != X; then \ (cp -p -f $$f $(includedir) || exit 1); \ -- 2.39.2