]> mj.ucw.cz Git - libucw.git/blob - free/libs/examples/external-ucw-build/configure
Build: Renamed BUILDSYS_PATH to BUILDSYS to make it consistent with the rest.
[libucw.git] / free / libs / examples / external-ucw-build / configure
1 #!/usr/bin/perl
2 # Configure script for the libucw example
3 # (c) 2008 Michal Vaner <vorner@ucw.cz>
4 # A lot copyed from ../external/configure
5 # (c) 2007 Martin Mares <mj@ucw.cz>
6
7 use warnings;
8 use strict;
9
10 our($srcdir, $libdir);
11 BEGIN {
12         # Find the sources
13         my $pkgfile = "test.c";
14         if (!defined ($srcdir = $ENV{"SRCDIR"})) {
15                 if (-f $pkgfile) {
16                         $srcdir=".";
17                 } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
18                         $srcdir=$1;
19                 } else {
20                         die "Don't know how to find myself. Please set SRCDIR manually.";
21                 }
22         }
23         # Ask pkg-config for the rest of configure
24         $libdir=`pkg-config libucw --variable=perl_modules_dir`;
25         chomp $libdir;
26         die "libUCW not found. Is PKG_CONFIG_PATH set properly?" if $? || not defined $libdir;
27 }
28 use lib $libdir;
29 use UCW::Configure;
30
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;
41
42 # Get some libraries
43 UCW::Configure::Pkg::PkgConfig("libucw") or Fail("libUCW is required");
44 Finish();
45
46 Log "\nConfigured, run `make' to build everything.\n";