Include "ucw/default.cfg";
Log "### Configuring Sherlock Libraries " . Get("SHERLOCK_VERSION") . " with configuration " . Get("CONFIG") . "\n";
Include Get("CONFIG");
+Include "ucw/paths.cfg";
Include "ucw/autoconf.cfg";
+Include "ucw/ucw.cfg";
Finish();
Log "\nConfigured, run `make' to build everything.\n";
Include "ucw/default.cfg";
Log "### Configuring TestApp ###\n\n";
Include Get("CONFIG");
+Include "ucw/paths.cfg";
Include "ucw/autoconf.cfg";
+Include "ucw/ucw.cfg";
Finish();
Log "\nConfigured, run `make' to build everything.\n";
-# Automatic configuration of the UCW Library
+# Automatic configuration, OS & CPU detection part
# (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", "");
- Set("INSTALL_VAR_PREFIX", "");
-} else {
- Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
- my $ipx = Get("PREFIX");
- $ipx =~ s{/$}{};
- Set("INSTALL_PREFIX", "$ipx/");
- my $upx = ($ipx eq "" ? "/usr/" : "$ipx/");
- Set("INSTALL_USR_PREFIX", $upx);
- $upx =~ s{^/usr\b}{/var};
- Set("INSTALL_VAR_PREFIX", $upx);
- 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');
-Set("INSTALL_LOG_DIR", '$(INSTALL_VAR_PREFIX)log');
-Set("INSTALL_STATE_DIR", '$(INSTALL_VAR_PREFIX)lib');
-Set("INSTALL_RUN_DIR", '$(INSTALL_VAR_PREFIX)run');
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
### OS ###
Set("SOL_TCP" => 6); # missing in /usr/include/netinet/tcp.h
}
-# Determine page size
-Test("CPU_PAGE_SIZE", "Determining page size", sub {
- my $p;
- if (IsSet("CONFIG_DARWIN")) {
- $p = `sysctl -n hw.pagesize`;
- defined $p or Fail "sysctl hw.pagesize failed";
- } elsif (IsSet("CONFIG_LINUX")) {
- $p = `getconf PAGE_SIZE`;
- defined $p or Fail "getconf PAGE_SIZE failed";
- }
- chomp $p;
- return $p;
-});
-
-if (IsSet("CONFIG_LARGE_FILES") && IsSet("CONFIG_LINUX")) {
- # Use 64-bit versions of file functions
- Set("CONFIG_LFS");
-}
-
-# Decide how will ucw/partmap.c work
-Set("PARTMAP_IS_MMAP") if IsSet("CPU_64BIT_POINTERS");
-
-# Option for ucw/mempool.c
-Set("POOL_IS_MMAP");
-
-# Guess optimal bit width of the radix-sorter
-if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) {
- # This should be safe everywhere
- Set("CONFIG_UCW_RADIX_SORTER_BITS" => 10);
-} else {
- # Use this on modern CPU's
- Set("CONFIG_UCW_RADIX_SORTER_BITS" => 12);
-}
-
-# If debugging memory allocations:
-#LIBS+=-lefence
-
-# Remember PKG_CONFIG_PATH used for building, so that it will be propagated to
-# pkg-config's run locally in the makefiles.
-Set("PKG_CONFIG_PATH", $ENV{"PKG_CONFIG_PATH"}) if defined $ENV{"PKG_CONFIG_PATH"};
-
# Return success
1;
--- /dev/null
+# Automatic configuration, installation paths part
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+# Code taken from autoconf.cfg by:
+# (c) 2005--2008 Martin Mares <mj@ucw.cz>
+# (c) 2006 Robert Spalek <robert@ucw.cz>
+
+Log "Determining installation prefix ... ";
+if (IsSet("CONFIG_LOCAL")) {
+ Log "local build\n";
+ Set("INSTALL_PREFIX", "");
+ Set("INSTALL_USR_PREFIX", "");
+ Set("INSTALL_VAR_PREFIX", "");
+} else {
+ Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
+ my $ipx = Get("PREFIX");
+ $ipx =~ s{/$}{};
+ Set("INSTALL_PREFIX", "$ipx/");
+ my $upx = ($ipx eq "" ? "/usr/" : "$ipx/");
+ Set("INSTALL_USR_PREFIX", $upx);
+ $upx =~ s{^/usr\b}{/var};
+ Set("INSTALL_VAR_PREFIX", $upx);
+ 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');
+Set("INSTALL_LOG_DIR", '$(INSTALL_VAR_PREFIX)log');
+Set("INSTALL_STATE_DIR", '$(INSTALL_VAR_PREFIX)lib');
+Set("INSTALL_RUN_DIR", '$(INSTALL_VAR_PREFIX)run');
+
+# We succeeded
+1;
--- /dev/null
+# Automatic configuration, libucw specific part
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+# Code taken from autoconf.cfg by:
+# (c) 2005--2008 Martin Mares <mj@ucw.cz>
+# (c) 2006 Robert Spalek <robert@ucw.cz>
+
+# Determine page size
+Test("CPU_PAGE_SIZE", "Determining page size", sub {
+ my $p;
+ if (IsSet("CONFIG_DARWIN")) {
+ $p = `sysctl -n hw.pagesize`;
+ defined $p or Fail "sysctl hw.pagesize failed";
+ } elsif (IsSet("CONFIG_LINUX")) {
+ $p = `getconf PAGE_SIZE`;
+ defined $p or Fail "getconf PAGE_SIZE failed";
+ }
+ chomp $p;
+ return $p;
+});
+
+if (IsSet("CONFIG_LARGE_FILES") && IsSet("CONFIG_LINUX")) {
+ # Use 64-bit versions of file functions
+ Set("CONFIG_LFS");
+}
+
+# Decide how will ucw/partmap.c work
+Set("PARTMAP_IS_MMAP") if IsSet("CPU_64BIT_POINTERS");
+
+# Option for ucw/mempool.c
+Set("POOL_IS_MMAP");
+
+# Guess optimal bit width of the radix-sorter
+if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) {
+ # This should be safe everywhere
+ Set("CONFIG_UCW_RADIX_SORTER_BITS" => 10);
+} else {
+ # Use this on modern CPU's
+ Set("CONFIG_UCW_RADIX_SORTER_BITS" => 12);
+}
+
+# If debugging memory allocations:
+#LIBS+=-lefence
+
+# Remember PKG_CONFIG_PATH used for building, so that it will be propagated to
+# pkg-config's run locally in the makefiles.
+Set("PKG_CONFIG_PATH", $ENV{"PKG_CONFIG_PATH"}) if defined $ENV{"PKG_CONFIG_PATH"};