]> mj.ucw.cz Git - libucw.git/blob - ucw/ucw.cfg
Split autoconf.cfg
[libucw.git] / ucw / ucw.cfg
1 # Automatic configuration, libucw specific 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>
6
7 # Determine page size
8 Test("CPU_PAGE_SIZE", "Determining page size", sub {
9         my $p;
10         if (IsSet("CONFIG_DARWIN")) {
11                 $p = `sysctl -n hw.pagesize`;
12                 defined $p or Fail "sysctl hw.pagesize failed";
13         } elsif (IsSet("CONFIG_LINUX")) {
14                 $p = `getconf PAGE_SIZE`;
15                 defined $p or Fail "getconf PAGE_SIZE failed";
16         }
17         chomp $p;
18         return $p;
19 });
20
21 if (IsSet("CONFIG_LARGE_FILES") && IsSet("CONFIG_LINUX")) {
22         # Use 64-bit versions of file functions
23         Set("CONFIG_LFS");
24 }
25
26 # Decide how will ucw/partmap.c work
27 Set("PARTMAP_IS_MMAP") if IsSet("CPU_64BIT_POINTERS");
28
29 # Option for ucw/mempool.c
30 Set("POOL_IS_MMAP");
31
32 # Guess optimal bit width of the radix-sorter
33 if (Get("CPU_ARCH") eq "default" || Get("CPU_ARCH") =~ /^i[345]86$/) {
34         # This should be safe everywhere
35         Set("CONFIG_UCW_RADIX_SORTER_BITS" => 10);
36 } else {
37         # Use this on modern CPU's
38         Set("CONFIG_UCW_RADIX_SORTER_BITS" => 12);
39 }
40
41 # If debugging memory allocations:
42 #LIBS+=-lefence
43
44 # Remember PKG_CONFIG_PATH used for building, so that it will be propagated to
45 # pkg-config's run locally in the makefiles.
46 Set("PKG_CONFIG_PATH", $ENV{"PKG_CONFIG_PATH"}) if defined $ENV{"PKG_CONFIG_PATH"};