2 # Configure script for the libucw example (inspired by ../external/configure)
3 # (c) 2008 Michal Vaner <vorner@ucw.cz>
11 my $pkgfile = "test.c";
12 if (!defined ($srcdir = $ENV{"SRCDIR"})) {
15 } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
18 die "Don't know how to find myself. Please set SRCDIR manually.\n";
21 # Ask pkg-config if libucw is installed and find its configure modules
22 `pkg-config libucw --atleast-version=3.13`;
23 !$? or die "Package `libucw' (version 3.13 or newer) not found. Is PKG_CONFIG_PATH set properly?\n";
24 $libdir=`pkg-config libucw --variable=perl_modules_dir`;
26 die "Unable to find the libucw configure system\n" if $? || not defined $libdir;
31 Init($srcdir, 'default.cfg');
32 Log "### Configuring TestApp ###\n\n";
33 Include Get("CONFIG");
34 # What should be detected?
35 require UCW::Configure::Build;
36 require UCW::Configure::Paths;
37 require UCW::Configure::C;
38 require UCW::Configure::Pkg;
39 # You could generate your own documentation, too
40 # require UCW::Configure::Doc;
43 UCW::Configure::Pkg::PkgConfig("libucw") or Fail("libUCW is required");
46 Log "\nConfigured, run `make' to build everything.\n";