From: Martin Mares Date: Wed, 25 Jun 2008 13:57:32 +0000 (+0200) Subject: Configure: Partial support for CONFIG_LOCAL and PREFIX. X-Git-Tag: holmes-import~431 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=0e3637387073a8a6aa43e818980ea5618be12486;p=libucw.git Configure: Partial support for CONFIG_LOCAL and PREFIX. The configure script sets up INSTALL_PREFIX properly, but it is not used anywhere yet. Choose soname embedded in the shared libraries differently for a local and global installation. --- diff --git a/lib/autoconf.cfg b/lib/autoconf.cfg index 2bf1798b..8236265c 100644 --- a/lib/autoconf.cfg +++ b/lib/autoconf.cfg @@ -1,7 +1,21 @@ # Automatic configuration of the UCW Library -# (c) 2005--2007 Martin Mares +# (c) 2005--2008 Martin Mares # (c) 2006 Robert Spalek +### Installation prefix ### + +Log "Determining installation prefix ... "; +if (IsSet("CONFIG_LOCAL")) { + Log "local build\n"; + Set("INSTALL_PREFIX", ""); +} else { + Set("PREFIX", "/usr/local") unless IsSet("PREFIX"); + my $ipx = Get("PREFIX"); + $ipx =~ s{/$}{}; + Set("INSTALL_PREFIX", "$ipx/"); + Log Get("PREFIX") . "\n"; +} + ### OS ### Test("OS", "Checking on which OS we run", sub { @@ -186,10 +200,15 @@ Set("LIBS" => ""); # Extra flags for compiling and linking shared libraries Set("CSHARED" => '-fPIC'); +if (IsSet("CONFIG_LOCAL")) { + Set("SONAME_PREFIX" => "lib/"); +} else { + Set("SONAME_PREFIX" => ""); +} if (IsSet("CONFIG_DARWIN")) { - Set("LSHARED" => '-dynamiclib -install_name lib/$(@F) -undefined dynamic_lookup'); + Set("LSHARED" => '-dynamiclib -install_name $(SONAME_PREFIX)$(@F) -undefined dynamic_lookup'); } else { - Set("LSHARED" => '-shared -Wl,-soname,lib/$(@F)'); + Set("LSHARED" => '-shared -Wl,-soname,$(SONAME_PREFIX)$(@F)'); } # Extra switches depending on GCC version: