From: Pavel Charvat Date: Thu, 15 Jan 2015 19:44:24 +0000 (+0000) Subject: Build: Attempt to fix problems with access rights to custom INSTALL_LIB_DIR. X-Git-Tag: v6.2~7 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=779005ff12504833af03a9ec5323c6092ff46e5d;p=libucw.git Build: Attempt to fix problems with access rights to custom INSTALL_LIB_DIR. --- diff --git a/ucw/perl/UCW/Configure/C.pm b/ucw/perl/UCW/Configure/C.pm index 537955f8..95644b45 100644 --- a/ucw/perl/UCW/Configure/C.pm +++ b/ucw/perl/UCW/Configure/C.pm @@ -120,16 +120,19 @@ Set("LIBS" => ""); # Extra flags for compiling and linking shared libraries Set("CSHARED" => '-fPIC'); Append("LOPT" => "-Wl,--rpath-link,run/lib -Lrun/lib"); -if (Get("INSTALL_LIB_DIR") eq "/usr/lib") { +if (!IsSet("CONFIG_LOCAL")) { + # Beware that in non-local builds the INSTALL_LIB_DIR must exist in + # standard search paths for shared libraries. Set("SO_LINK_PATH" => ''); } else { + # In local builds, we need to link binaries with custom --rpath. + # GCC seems to fail when this directory does not exist. Set("SO_LINK_PATH" => "-Wl,--rpath," . Get("INSTALL_LIB_DIR")); AtWrite { - # FIXME: This is a hack. GCC would otherwise fail to link binaries. my $libdir = Get("INSTALL_LIB_DIR"); - if (IsSet("CONFIG_SHARED") && !(-d $libdir)) { - `install -d -m 755 $libdir`; Fail("Cannot create $libdir") if $?; + if (IsSet("CONFIG_SHARED")) { + `mkdir -p $libdir`; Fail("Cannot create $libdir") if $?; } }; }