2 # Configure script for MO-Eval
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 MO-Eval ###\n\n";
29 Include Get("CONFIG");
30 require UCW::Configure::Paths;
31 require UCW::Configure::C;
32 require UCW::Configure::LibUCW;
34 if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) {
35 # Build libucw only if it is needed
36 Set("CONFIG_UCW_LIBS" => 1);
39 if (Get("CONFIG_SUBMIT")) {
40 # Submit server needs crypto libraries
41 if (!PkgConfig("gnutls") && !TrivConfig("libgnutls", script => "libgnutls-config") ||
42 !TrivConfig("libgcrypt", script => "libgcrypt-config")) {
43 Fail "The libgnutls and libgcrypt libraries are required to build the submit server.";
48 Log "\nConfigured, run `make' to build everything.\n";