From ce170cf1f264c69e91cde268ee490584c8fbcd04 Mon Sep 17 00:00:00 2001 From: Stephan Bergmann Date: Fri, 2 Oct 2015 11:04:40 +0200 Subject: Allow external/firebird to be built with a custom SHELL under Mac OS X 10.11 ...which broke all the stock /bin shells to no longer pass through any DYLD_* environment variables, so the DYLD_LIBRARY_PATH passed into the firebird Make would not be passed to all the places that need it (to find the external/icu libraries that some executables link against which are built and run as part of building firebird). What works with two little tweaks is to build your own bash and pass it to make with SHELL=...: * For one, there is an empbuild executable that uses system(...) to call another isql executable, where the latter needs DYLD_LIBRARY_PATH set, but which would not pass through the system(...) call (which implicityl uses /bin/sh). * For another, it is still necessary to invoke Firebird's make with an explicit SHELL=$(SHELL), for reasons that are not entirely clear to me. (There are some Makefile.in in Firebird's extern/ sub-tree that set "SHELL = @SHELL@" to configure's CONFIG_SHELL, unless overriden via an explicit command line arguemnt, but I don't think those are relevant here.) Change-Id: I1e68faa898e758f09efb602d96fd6b35657e0480 --- external/firebird/ExternalProject_firebird.mk | 2 +- external/firebird/UnpackedTarball_firebird.mk | 1 + external/firebird/macosx-elcapitan-dyld.patch | 39 +++++++++++++++++++++++++++ 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 external/firebird/macosx-elcapitan-dyld.patch (limited to 'external/firebird') diff --git a/external/firebird/ExternalProject_firebird.mk b/external/firebird/ExternalProject_firebird.mk index f24d0f75dedc..35e63ab8ba70 100644 --- a/external/firebird/ExternalProject_firebird.mk +++ b/external/firebird/ExternalProject_firebird.mk @@ -60,7 +60,7 @@ $(call gb_ExternalProject_get_state_target,firebird,build): && $(if $(filter WNT,$(OS)),\ PATH="$(shell cygpath -u $(call gb_UnpackedTarball_get_dir,icu)/source/lib):$$PATH",\ $(gb_Helper_set_ld_path)) \ - $(MAKE) firebird_embedded \ + $(MAKE) SHELL=$(SHELL) firebird_embedded \ $(if $(filter MACOSX,$(OS)),&& $(PERL) \ $(SRCDIR)/solenv/bin/macosx-change-install-names.pl shl OOO \ $(gb_Package_SOURCEDIR_firebird)/gen/firebird/lib/libfbembed.dylib.2.5.4) \ diff --git a/external/firebird/UnpackedTarball_firebird.mk b/external/firebird/UnpackedTarball_firebird.mk index c42cbd5f1201..9701fc2f0108 100644 --- a/external/firebird/UnpackedTarball_firebird.mk +++ b/external/firebird/UnpackedTarball_firebird.mk @@ -31,6 +31,7 @@ ifeq ($(OS),MACOSX) $(eval $(call gb_UnpackedTarball_add_patches,firebird,\ external/firebird/firebird-macosx.patch.1 \ external/firebird/firebird-configure-x86-64-macosx.patch.1 \ + external/firebird/macosx-elcapitan-dyld.patch \ )) endif # vim: set noet sw=4 ts=4: diff --git a/external/firebird/macosx-elcapitan-dyld.patch b/external/firebird/macosx-elcapitan-dyld.patch new file mode 100644 index 000000000000..b8c4c1cdf419 --- /dev/null +++ b/external/firebird/macosx-elcapitan-dyld.patch @@ -0,0 +1,39 @@ +--- examples/empbuild/empbuild.e ++++ examples/empbuild/empbuild.e +@@ -64,7 +64,7 @@ + * Functional description + * + **************************************/ +-TEXT cmd [140]; ++TEXT cmd [8000]; + + if (argc > 1) + strcpy (Db_name, argv[1]); +@@ -94,21 +94,23 @@ + } + + printf ("Creating tables\n"); ++char const * lp = getenv("DYLD_LIBRARY_PATH"); ++if (!lp) lp = ""; +-sprintf (cmd, "isql %s -q -i empddl.sql", Db_name); ++sprintf (cmd, "DYLD_LIBRARY_PATH=%s isql %s -q -i empddl.sql", lp, Db_name); + if (system (cmd)) + { + printf ("Couldn't create tables \n"); + exit (FINI_ERROR); + } + + printf ("Turning off indices and triggers \n"); +-sprintf (cmd, "isql %s -i indexoff.sql", Db_name); ++sprintf (cmd, "DYLD_LIBRARY_PATH=%s isql %s -i indexoff.sql", lp, Db_name); + system (cmd); + printf ("Loading column data\n"); +-sprintf (cmd, "isql %s -i empdml.sql", Db_name); ++sprintf (cmd, "DYLD_LIBRARY_PATH=%s isql %s -i empdml.sql", lp, Db_name); + system (cmd); + printf ("Turning on indices and triggers \n"); +-sprintf (cmd, "isql %s -i indexon.sql", Db_name); ++sprintf (cmd, "DYLD_LIBRARY_PATH=%s isql %s -i indexon.sql", lp, Db_name); + system (cmd); + + EXEC SQL CONNECT DB; -- cgit v1.2.3