From feb88db403b0c109fe6fbbbb7fc712d7afa0208d Mon Sep 17 00:00:00 2001 From: Morgan Deters Date: Wed, 6 Aug 2014 17:52:30 -0400 Subject: [PATCH] Fix double-linking issue (I think) by simplifying builds/ structure. --- Makefile.builds.in | 164 ++++++++++----------------------------------- 1 file changed, 35 insertions(+), 129 deletions(-) diff --git a/Makefile.builds.in b/Makefile.builds.in index 296e5a974..e52feea7b 100644 --- a/Makefile.builds.in +++ b/Makefile.builds.in @@ -6,14 +6,8 @@ # # Its main purposes are to: # 1. build the current build profile -# 2. install into "builds/$(CURRENT_BUILD)/$(prefix)" -# 3. set up "builds/$(CURRENT_BUILD)/{bin,lib}" symlinks -# 4. install into "builds/$(prefix)" -# 5. set up "builds/bin" and "builds/lib" -# -# Steps 2 and 4 require libtool-relinking for dynamically-linked -# executables and libraries, since build/bin is not the final -# installation path. +# 2. set up builds/$(CURRENT_BUILD)/{bin,lib} symlinks +# 3. set up builds/bin and builds/lib symlinks # Include the "current" build profile. include current @@ -40,12 +34,6 @@ LIBTOOL = $(CURRENT_BUILD)/libtool # Are we building the libcvc4compat library ? CVC4_BUILD_LIBCOMPAT = @CVC4_BUILD_LIBCOMPAT@ -# Are we building static/dynamic libraries/binaries? One or the other can be -# on, or both. -BUILDING_STATIC = @BUILDING_STATIC@ -BUILDING_SHARED = @BUILDING_SHARED@ -STATIC_BINARY = @STATIC_BINARY@ - # @ AM_V_at = $(am__v_at_$(V)) am__v_at_ = $(am__v_at_$(AM_DEFAULT_VERBOSITY)) @@ -61,21 +49,6 @@ AM_V_mkdir = $(am__v_mkdir_$(V)) am__v_mkdir_ = $(am__v_mkdir_$(AM_DEFAULT_VERBOSITY)) am__v_mkdir_0 = @$(am__v_mkdir_noat_0) am__v_mkdir_1 = $(am__v_mkdir_noat_1) -# libtool --mode=install $(install_sh) -AM_V_ltinstall = $(am__v_ltinstall_$(V)) -am__v_ltinstall_ = $(am__v_ltinstall_$(AM_DEFAULT_VERBOSITY)) -am__v_ltinstall_0 = @$(SHELL) -c 'echo " LTINS $$1"; $(LIBTOOL) --silent --mode=install $(install_sh) "$$@"' bash -am__v_ltinstall_1 = $(LIBTOOL) --mode=install $(install_sh) -# install_sh (never prefix with @) -AM_V_install_sh_noat = $(am__v_install_sh_noat_$(V)) -am__v_install_sh_noat_ = $(am__v_install_sh_noat_$(AM_DEFAULT_VERBOSITY)) -am__v_install_sh_noat_0 = $(SHELL) -c 'echo " INSTL $$1"; $(install_sh) "$$@"' bash -am__v_install_sh_noat_1 = $(install_sh) -# relinking -AM_V_relink = $(am__v_relink_$(V)) -am__v_relink_ = $(am__v_relink_$(AM_DEFAULT_VERBOSITY)) -am__v_relink_0 = echo " RELNK" -am__v_relink_1 = : # all the binaries that might need to be installed # (it's not a fatal error for one/some don't exist in a given build @@ -87,108 +60,41 @@ _default_build_: all all: # build the current build profile $(AM_V_at)(cd $(CURRENT_BUILD) && $(MAKE) $@) -# set up builds/$(CURRENT_BUILD)/...prefix.../bin -# and builds/$(CURRENT_BUILD)/...prefix.../lib - $(AM_V_mkdir) "$(CURRENT_BUILD)$(bindir)" - $(AM_V_mkdir) "$(CURRENT_BUILD)$(libdir)" -# install libcvc4 - $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la \ - "$(abs_builddir)$(libdir)" -# install libcvc4parser - $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la \ - "$(abs_builddir)$(libdir)" -ifeq ($(CVC4_BUILD_LIBCOMPAT),yes) -# install libcvc4compat - $(CURRENT_BUILD)/libtool --mode=install $(install_sh) \ - $(CURRENT_BUILD)/src/compat/libcvc4compat.la \ - "$(abs_builddir)$(libdir)" -endif -ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10) -# if we're building shared libs and the binary is not static, relink -# the handling with empty $relink_command is a hack for Mac OS - $(AM_V_at)thelibdir="$(abs_builddir)$(libdir)"; \ - progdir="$(abs_builddir)$(bindir)"; for file in $(CVC4_BINARIES); do \ - if test -r $(CURRENT_BUILD)/src/main/$$file; then \ - eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \ - if test -z "$$relink_command"; then \ - $(AM_V_mkdir_noat) "$(CURRENT_BUILD)$(bindir)/.libs"; \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/.libs/$$file \ - "$(abs_builddir)$(bindir)/.libs"; \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/$$file \ - "$(abs_builddir)$(bindir)"; \ - else \ - $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \ - fi; \ - else \ - rm -f "$(abs_builddir)$(bindir)/$$file"; \ - fi; \ - done -else -# if we're building static libs only, just install the driver binary directly - $(AM_V_at)for file in $(CVC4_BINARIES); do \ - if test -r $(CURRENT_BUILD)/src/main/$$file; then \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/$$file \ - "$(abs_builddir)$(bindir)"; \ - else \ - rm -f "$(abs_builddir)$(bindir)/$$file"; \ - fi; \ - done -endif -# set up builds/$(CURRENT_BUILD)/bin and builds/$(CURRENT_BUILD)/lib - rm -f $(CURRENT_BUILD)/lib; ln -sf "$(abs_builddir)$(libdir)" $(CURRENT_BUILD)/lib - rm -f $(CURRENT_BUILD)/bin; ln -sf "$(abs_builddir)$(bindir)" $(CURRENT_BUILD)/bin -# set up builds/...prefix.../bin and builds/...prefix.../lib - $(AM_V_mkdir) ".$(bindir)" - $(AM_V_mkdir) ".$(libdir)" -# install libcvc4 - $(AM_V_ltinstall) $(CURRENT_BUILD)/src/libcvc4.la "`pwd`$(libdir)" -# install libcvc4parser - $(AM_V_ltinstall) $(CURRENT_BUILD)/src/parser/libcvc4parser.la "`pwd`$(libdir)" +# set up builds/$(CURRENT_BUILD)/{bin,lib} + $(AM_V_mkdir) $(CURRENT_BUILD)/bin + $(AM_V_mkdir) $(CURRENT_BUILD)/lib +# symlink libcvc4, libcvc4parser + cd $(CURRENT_BUILD)/lib && \ + ln -sf ../src/libcvc4.* \ + ../src/parser/libcvc4parser.* \ + . + cd $(CURRENT_BUILD)/lib && \ + test -d ../src/.libs && \ + ln -sf ../src/.libs/libcvc4.* \ + . + cd $(CURRENT_BUILD)/lib && \ + test -d ../src/parser/.libs && \ + ln -sf ../src/parser/.libs/libcvc4parser.* \ + . ifeq ($(CVC4_BUILD_LIBCOMPAT),yes) -# install libcvc4compat - $(CURRENT_BUILD)/libtool --mode=install $(install_sh) $(CURRENT_BUILD)/src/compat/libcvc4compat.la "`pwd`$(libdir)" -endif -ifeq ($(BUILDING_SHARED)$(STATIC_BINARY),10) -# if we're building shared libs and the binary is not static, relink -# the handling with empty $relink_command is a hack for Mac OS - $(AM_V_at)thelibdir="`pwd`$(libdir)"; progdir="`pwd`$(bindir)"; for file in $(CVC4_BINARIES); do \ - if test -r $(CURRENT_BUILD)/src/main/$$file; then \ - eval `grep '^relink_command=' $(CURRENT_BUILD)/src/main/$$file | sed 's:-Wl,-rpath:-Wl,-rpath -Wl,\\\\$$thelibdir -Wl,-rpath:'`; \ - if test -z "$$relink_command"; then \ - $(AM_V_mkdir_noat) ".$(bindir)/.libs"; \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/.libs/$$file \ - "`pwd`$(bindir)/.libs"; \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/$$file \ - "`pwd`$(bindir)"; \ - else \ - $(AM_V_relink) "$$file"; eval "(cd $(CURRENT_BUILD)/src/main && $$relink_command)"; \ - fi; \ - else \ - rm -f "`pwd`$(bindir)/$$file"; \ - fi; \ - done -else -# if we're building static libs only, just install the driver binary directly - $(AM_V_at)for file in $(CVC4_BINARIES); do \ - if test -r $(CURRENT_BUILD)/src/main/$$file; then \ - $(AM_V_install_sh_noat) \ - $(CURRENT_BUILD)/src/main/$$file \ - "`pwd`$(bindir)"; \ - else \ - rm -f "`pwd`$(bindir)/$$file"; \ - fi; \ - done +# symlink libcvc4compat + cd $(CURRENT_BUILD)/lib && \ + ln -sf ../src/compat/libcvc4compat.* \ + . + cd $(CURRENT_BUILD)/lib && \ + test -d ../src/compat/.libs && \ + ln -sf ../src/compat/.libs/libcvc4compat.* \ + . endif -# set up builds/bin and builds/lib - rm -f lib; ln -sf ".$(libdir)" lib - rm -f bin; ln -sf ".$(bindir)" bin - rm -f doc; ln -sf "$(CURRENT_BUILD)/doc" doc - rm -f examples; ln -sf "$(CURRENT_BUILD)/examples" examples +# symlink the binary + cd $(CURRENT_BUILD)/bin && \ + ln -sf ../src/main/cvc4 \ + . +# set up builds/doc and builds/examples + rm -f bin; ln -sf $(CURRENT_BUILD)/bin bin + rm -f lib; ln -sf $(CURRENT_BUILD)/lib lib + rm -f doc; ln -sf $(CURRENT_BUILD)/doc doc + rm -f examples; ln -sf $(CURRENT_BUILD)/examples examples # The descent into "src" with target "check" is to build check # prerequisites (e.g. CHECK_PROGRAMS, CHECK_LTLIBRARIES, ...). -- 2.30.2