-How to Configure Sherlock libraries
-===================================
+How to Configure libucw libraries
+=================================
What can be configured
----------------------
-There are two different levels of configuring/customizing program
-based on sherlock libraries:
+There are two different levels of configuring program
+based on the libucw libraries:
- runtime configuration in configuration files (see <<config:>>)
[[local_build]]
You can create a local compilation, which does not need to be
-installed. All paths are set relative to a `run` directory and
-programs expect to have current working directory set to it. However,
-you can move the `run` directory around your filesystem as you like.
-To compile it that way, turn on the `CONFIG_LOCAL` option (and do not
-set `PREFIX`):
+installed. To compile it that way, turn on the `CONFIG_LOCAL` option
+(and do not set `PREFIX`):
./configure CONFIG_LOCAL
+Alternatively you can add the `CONFIG_RELATIVE_PATHS` option.
+All paths are then set relative to a `run` directory and
+programs expect to have current working directory set to it. However,
+you can move the `run` directory around your filesystem as you like:
+
+ ./configure CONFIG_LOCAL CONFIG_RELATIVE_PATHS
+
Examples
--------
- `./configure -CONFIG_SHARED` will build the libraries statically.
- `./configure -CONFIG_IMAGES` avoids building the image library.
- `./configure CONFIG_UCW_ONLY -CONFIG_UCW_UTILS` compiles only the
libucw library without its util programs.
- - `./configure CONFIG_XML PREFIX=$HOME/sherlock` includes a xml
+ - `./configure CONFIG_XML PREFIX=$HOME/libucw` includes a xml
library and installs into your home directory.
- Libjpeg, libpng and libungif to support all image formats
(jpeg, png and gif). These libraries can be replaced by libgif (gif)
and GraphicsMagick >= 1.1 (jpeg, png, gif and possible more formats).
- See sherlock/default.cfg for related configuration switches.
+ See default.cfg for related configuration switches.
Compiling
---------
# Extra flags for compiling and linking shared libraries
Set("CSHARED" => '-fPIC');
-Set("SO_LINK_PATH" => '');
-if (IsSet("CONFIG_LOCAL")) {
- Set("SONAME_PREFIX" => "lib/");
- Append("LOPT" => "-Wl,--rpath-link -Wl,run");
-} else {
- Set("SONAME_PREFIX" => "");
- Append("LOPT" => "-Wl,--rpath-link -Wl,run/lib");
- if (IsSet("CONFIG_SHARED") && !(Get("INSTALL_LIB_DIR") eq "/usr/lib")) {
- Set("SO_LINK_PATH" => "-Wl,--rpath " . Get("INSTALL_LIB_DIR"));
- AtWrite {
- # FIXME: This is a hack. GCC would otherwise fail to link binaries.
- my $libdir = Get("INSTALL_LIB_DIR");
- if (!(-d $libdir)) {
- `install -d -m 755 $libdir`; Fail("Cannot create $libdir") if $?;
- }
- };
- }
+Append("LOPT" => "-Wl,--rpath-link -Wl,run/lib");
+if (!(Get("INSTALL_LIB_DIR") eq "/usr/lib")) {
+ Set("SO_LINK_PATH" => "-Wl,--rpath " . Get("INSTALL_LIB_DIR"));
+ AtWrite {
+ # FIXME: This is a hack. GCC would otherwise fail to link binaries.
+ my $libdir = Get("INSTALL_LIB_DIR");
+ if (IsSet("CONFIG_SHARED") && !(-d $libdir)) {
+ `install -d -m 755 $libdir`; Fail("Cannot create $libdir") if $?;
+ }
+ };
}
if (IsSet("CONFIG_DARWIN")) {
- Set("LSHARED" => '-dynamiclib -install_name $(SONAME_PREFIX)$(@F)$(SONAME_SUFFIX) -undefined dynamic_lookup');
+ Set("LSHARED" => '-dynamiclib -install_name $(@F)$(SONAME_SUFFIX) -undefined dynamic_lookup');
} else {
- Set("LSHARED" => '-shared -Wl,-soname,$(SONAME_PREFIX)$(@F)$(SONAME_SUFFIX)');
+ Set("LSHARED" => '-shared -Wl,-soname,$(@F)$(SONAME_SUFFIX)');
}
# Extra switches depending on GCC version:
Log "Determining installation prefix ... ";
if (IsSet("CONFIG_LOCAL")) {
- Log("local build\n");
- Set("INSTALL_PREFIX", "");
- Set("INSTALL_USR_PREFIX", "");
- Set("INSTALL_VAR_PREFIX", "");
+ if (IsSet("CONFIG_RELATIVE_PATHS")) {
+ Log("local build with relative paths\n");
+ Set("INSTALL_PREFIX", "");
+ }
+ else {
+ Log("local build with absolute paths\n");
+ my $cwd = `pwd`; Fail("Cannot get current working directory") if $?;
+ chomp $cwd;
+ Set("INSTALL_PREFIX", "$cwd/run/");
+ }
+ Set("INSTALL_USR_PREFIX", Get("INSTALL_PREFIX"));
+ Set("INSTALL_VAR_PREFIX", Get("INSTALL_PREFIX"));
} else {
Set("PREFIX", "/usr/local") unless IsSet("PREFIX");
my $ipx = Get("PREFIX");