]> mj.ucw.cz Git - libucw.git/commitdiff
Configure: Set installation paths based on PREFIX.
authorMartin Mares <mj@ucw.cz>
Wed, 25 Jun 2008 14:55:10 +0000 (16:55 +0200)
committerMartin Mares <mj@ucw.cz>
Wed, 25 Jun 2008 14:55:10 +0000 (16:55 +0200)
lib/autoconf.cfg

index 28f1184322bde1eb97805cee54f73df6ff33ac0c..9bb30219cb576e306dc3d56f31e0bc210faa4f7e 100644 (file)
@@ -1,7 +1,32 @@
 # 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 paths ###
+
+Log "Determining installation prefix ... ";
+if (IsSet("CONFIG_LOCAL")) {
+       Log "local build\n";
+       Set("INSTALL_PREFIX", "");
+       Set("INSTALL_USR_PREFIX", "");
+} else {
+       Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
+       my $ipx = Get("PREFIX");
+       $ipx =~ s{/$}{};
+       Set("INSTALL_PREFIX", "$ipx/");
+       Set("INSTALL_USR_PREFIX", ($ipx eq "" ? "/usr/" : "$ipx/"));
+       Log Get("PREFIX") . "\n";
+}
+
+Set("INSTALL_CONFIG_DIR", '$(INSTALL_PREFIX)$(CONFIG_DIR)');
+Set("INSTALL_BIN_DIR", '$(INSTALL_USR_PREFIX)bin');
+Set("INSTALL_SBIN_DIR", '$(INSTALL_USR_PREFIX)sbin');
+Set("INSTALL_LIB_DIR", '$(INSTALL_USR_PREFIX)lib');
+Set("INSTALL_INCLUDE_DIR", '$(INSTALL_USR_PREFIX)include');
+Set("INSTALL_PKGCONFIG_DIR", '$(INSTALL_USR_PREFIX)lib/pkgconfig');
+Set("INSTALL_SHARE_DIR", '$(INSTALL_USR_PREFIX)share');
+Set("INSTALL_MAN_DIR", '$(INSTALL_USR_PREFIX)share/man');
+
 ### OS ###
 
 Test("OS", "Checking on which OS we run", sub {