# Automatic configuration of the UCW Library
-# (c) 2005--2007 Martin Mares <mj@ucw.cz>
+# (c) 2005--2008 Martin Mares <mj@ucw.cz>
# (c) 2006 Robert Spalek <robert@ucw.cz>
+### 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 {
# 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: