]> mj.ucw.cz Git - eval.git/blob - configure
Judge: Added function get_nl() for checking of an expected end of line.
[eval.git] / configure
1 #!/usr/bin/perl
2 # Configure script for MO-Eval
3 # (c) 2008 Martin Mares <mj@ucw.cz>
4
5 use warnings;
6 use strict;
7
8 our $srcdir;
9 BEGIN {
10         my $pkgfile = "judge/token.c";
11         if (!defined ($srcdir = $ENV{"SRCDIR"})) {
12                 if (-f $pkgfile) {
13                         $srcdir=".";
14                 } elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
15                         $srcdir=$1;
16                 } else {
17                         die "Don't know how to find myself. Please set SRCDIR manually.";
18                 }
19         }
20         require "$srcdir/lib/perl/Configure.pm";
21         UCW::Configure::import UCW::Configure;
22 }
23
24 Init($srcdir, "default.cfg");
25 Include "lib/default.cfg";
26 Log "### Configuring MO-Eval ###\n\n";
27 Include Get("CONFIG");
28 Include "lib/autoconf.cfg";
29
30 if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) {
31         # Build libucw only if it is needed
32         Set("CONFIG_UCW_LIBS" => 1);
33 }
34
35 if (Get("CONFIG_SUBMIT")) {
36         # Submit server needs crypto libraries
37         if (!TrivConfig("libgnutls", script => "libgnutls-config") ||
38             !TrivConfig("libgcrypt", script => "libgcrypt-config")) {
39                 Fail "The libgnutls and libgcrypt libraries are required to build the submit server.";
40         }
41 }
42
43 Finish();
44 Log "\nConfigured, run `make' to build everything.\n";