1 # Automatic configuration, installation paths part
2 # (c) 2008 Michal Vaner <vorner@ucw.cz>
3 # Code taken from autoconf.cfg by:
4 # (c) 2005--2008 Martin Mares <mj@ucw.cz>
5 # (c) 2006 Robert Spalek <robert@ucw.cz>
7 package UCW::Configure::Paths;
10 Log "Determining installation prefix ... ";
11 if (IsSet("CONFIG_LOCAL")) {
13 Set("INSTALL_PREFIX", "");
14 Set("INSTALL_USR_PREFIX", "");
15 Set("INSTALL_VAR_PREFIX", "");
17 Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
18 my $ipx = Get("PREFIX");
20 Set("INSTALL_PREFIX", "$ipx/");
21 my $upx = ($ipx eq "" ? "/usr/" : "$ipx/");
22 Set("INSTALL_USR_PREFIX", $upx);
23 $upx =~ s{^/usr\b}{/var};
24 Set("INSTALL_VAR_PREFIX", $upx);
25 Log(Get("PREFIX") . "\n");
28 Set("INSTALL_CONFIG_DIR", '$(INSTALL_PREFIX)$(CONFIG_DIR)');
29 Set("INSTALL_BIN_DIR", '$(INSTALL_USR_PREFIX)bin');
30 Set("INSTALL_SBIN_DIR", '$(INSTALL_USR_PREFIX)sbin');
31 Set("INSTALL_LIB_DIR", '$(INSTALL_USR_PREFIX)lib');
32 Set("INSTALL_INCLUDE_DIR", '$(INSTALL_USR_PREFIX)include');
33 Set("INSTALL_PKGCONFIG_DIR", '$(INSTALL_USR_PREFIX)lib/pkgconfig');
34 Set("INSTALL_SHARE_DIR", '$(INSTALL_USR_PREFIX)share');
35 Set("INSTALL_MAN_DIR", '$(INSTALL_USR_PREFIX)share/man');
36 Set("INSTALL_LOG_DIR", '$(INSTALL_VAR_PREFIX)log');
37 Set("INSTALL_STATE_DIR", '$(INSTALL_VAR_PREFIX)lib');
38 Set("INSTALL_RUN_DIR", '$(INSTALL_VAR_PREFIX)run');