2 # Configure script for Moe
3 # (c) 2008--2009 Martin Mares <mj@ucw.cz>
10 my $pkgfile = "judge/token.c";
11 if (!defined ($srcdir = $ENV{"SRCDIR"})) {
14 } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
17 die "Don't know how to find myself. Please set SRCDIR manually.";
22 use lib "$srcdir/ucw/perl";
24 use UCW::Configure::Pkg;
26 Init($srcdir, "default.cfg");
27 Include "ucw/default.cfg";
28 Log "### Configuring Moe ###\n\n";
29 Include Get("CONFIG");
30 require UCW::Configure::Paths;
31 require UCW::Configure::C;
32 require UCW::Configure::LibUCW;
33 require UCW::Configure::Doc;
35 if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) {
36 # Build libucw only if it is needed
37 Set("CONFIG_UCW_LIBS" => 1);
40 if (Get("CONFIG_SUBMIT")) {
41 # Submit server needs crypto libraries
42 if (!PkgConfig("gnutls") && !TrivConfig("libgnutls", script => "libgnutls-config") ||
43 !TrivConfig("libgcrypt", script => "libgcrypt-config")) {
44 Fail "The libgnutls and libgcrypt libraries are required to build the submit server.";
49 Log "\nConfigured, run `make' to build everything.\n";