1 # UCW Library configuration system: installation paths
2 # (c) 2005--2008 Martin Mares <mj@ucw.cz>
3 # (c) 2006 Robert Spalek <robert@ucw.cz>
4 # (c) 2008 Michal Vaner <vorner@ucw.cz>
6 package UCW::Configure::Paths;
12 Log "Determining installation prefix ... ";
13 if (IsSet("CONFIG_LOCAL")) {
15 Set("INSTALL_PREFIX", "");
16 Set("INSTALL_USR_PREFIX", "");
17 Set("INSTALL_VAR_PREFIX", "");
19 Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
20 my $ipx = Get("PREFIX");
22 Set("INSTALL_PREFIX", "$ipx/");
23 my $upx = ($ipx eq "" ? "/usr/" : "$ipx/");
24 Set("INSTALL_USR_PREFIX", $upx);
25 $upx =~ s{^/usr\b}{/var};
26 Set("INSTALL_VAR_PREFIX", $upx);
27 Log(Get("PREFIX") . "\n");
30 Set("INSTALL_CONFIG_DIR", '$(INSTALL_PREFIX)$(CONFIG_DIR)');
31 Set("INSTALL_BIN_DIR", '$(INSTALL_USR_PREFIX)bin');
32 Set("INSTALL_SBIN_DIR", '$(INSTALL_USR_PREFIX)sbin');
33 Set("INSTALL_LIB_DIR", '$(INSTALL_USR_PREFIX)lib');
34 Set("INSTALL_INCLUDE_DIR", '$(INSTALL_USR_PREFIX)include');
35 Set("INSTALL_PKGCONFIG_DIR", '$(INSTALL_USR_PREFIX)lib/pkgconfig');
36 Set("INSTALL_SHARE_DIR", '$(INSTALL_USR_PREFIX)share');
37 Set("INSTALL_MAN_DIR", '$(INSTALL_USR_PREFIX)share/man');
38 Set("INSTALL_LOG_DIR", '$(INSTALL_VAR_PREFIX)log');
39 Set("INSTALL_STATE_DIR", '$(INSTALL_VAR_PREFIX)lib');
40 Set("INSTALL_RUN_DIR", '$(INSTALL_VAR_PREFIX)run');
42 # Remember PKG_CONFIG_PATH used for building, so that it will be propagated to
43 # pkg-config's run locally in the makefiles.
44 Set("PKG_CONFIG_PATH", $ENV{"PKG_CONFIG_PATH"}) if defined $ENV{"PKG_CONFIG_PATH"};