]> mj.ucw.cz Git - libucw.git/commitdiff
Configure module to find the build system
authorMichal Vaner <vorner@ucw.cz>
Sun, 9 Nov 2008 18:05:42 +0000 (19:05 +0100)
committerMichal Vaner <vorner@ucw.cz>
Sun, 9 Nov 2008 18:05:42 +0000 (19:05 +0100)
ucw/perl/UCW/Configure/Build.pm [new file with mode: 0644]
ucw/perl/UCW/Configure/Makefile

diff --git a/ucw/perl/UCW/Configure/Build.pm b/ucw/perl/UCW/Configure/Build.pm
new file mode 100644 (file)
index 0000000..0d6f9d2
--- /dev/null
@@ -0,0 +1,26 @@
+# UCW Library configuration system: find UCW build system
+# (c) 2008 Michal Vaner <vorner@ucw.cz>
+
+# This module asks pkg-config for a path to UCW build system
+# and sets propper variables for it (or fails, as it is expected
+# the build system is crucial).
+
+package UCW::Configure::Build;
+use UCW::Configure;
+
+use strict;
+use warnings;
+
+if (!IsGiven("BUILDSYS_PATH")) {
+       Test("BUILDSYS_PATH", "Looking for UCW build system", sub {
+               my $path=`pkg-config libucw --variable=build_system`;
+               if($? || not defined $path) {
+                       Fail("Not found (is libUCW installed and PKG_CONFIG_PATH set?)");
+               }
+               chomp $path;
+               return $path;
+       });
+}
+
+# We succeeded
+1;
index 43ed4c3bcdbacee0881cc143089b0a8d23e25d61..49679d3d9dcc2ec99016efa726af1fabf064bdda 100644 (file)
@@ -2,7 +2,7 @@
 
 DIRS+=ucw/perl/UCW/Configure
 EXTRA_RUNDIRS+=lib/perl5/UCW/Configure
-UCW_CONFIGURE_PERL_MODULES=$(addsuffix .pm, C Doc Paths Pkg)
+UCW_CONFIGURE_PERL_MODULES=$(addsuffix .pm, C Doc Paths Pkg Build)
 CONFIGURE_MODULES=$(addprefix $(o)/ucw/perl/UCW/Configure/,$(UCW_CONFIGURE_PERL_MODULES))
 PROGS+=$(CONFIGURE_MODULES)