]> mj.ucw.cz Git - libucw.git/commitdiff
Merge branch 'dev-uint'
authorTomas Valla <tom@ucw.cz>
Tue, 3 Jun 2014 22:12:56 +0000 (00:12 +0200)
committerTomas Valla <tom@ucw.cz>
Tue, 3 Jun 2014 22:12:56 +0000 (00:12 +0200)
ucw/doc/configure.txt
ucw/doc/install.txt
ucw/perl/UCW/Configure/C.pm
ucw/perl/UCW/Configure/Paths.pm

index 35784a25177a936fe202b86159f707c33d698b69..6bd328bc30ca5eb523d4729ef6bfcf9961d42434 100644 (file)
@@ -1,10 +1,10 @@
-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:>>)
 
@@ -56,19 +56,23 @@ set the `PREFIX` option:
 
 [[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.
index aef870c56f3d6e169eafbb9e8627f6b8f7a9a0cf..d3bce644b0a332d069620403e03d53a8c6e0f2fb 100644 (file)
@@ -13,7 +13,7 @@ To build and run, you need:
   -  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
 ---------
index 8af97830b4209b2095880b7aec93d0b6521d7693..e961ca009f9c07ad34a3447759313afae3357b4f 100644 (file)
@@ -119,28 +119,24 @@ Set("LIBS" => "");
 
 # 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,run/lib");
+if (Get("INSTALL_LIB_DIR") eq "/usr/lib") {
+       Set("SO_LINK_PATH" => '');
+}
+else {
+       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:
index f28ccb129cc2597d3f82d9a3e0e4a0fe446535ab..d03c90d6b3b08a3d2ad9538256e1b09c4eed332d 100644 (file)
@@ -11,10 +11,18 @@ use warnings;
 
 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");