]> mj.ucw.cz Git - eval.git/blob - configure
Added unfix(), corrected fix()
[eval.git] / configure
1 #!/usr/bin/perl
2 # Configure script for MO-Eval
3 # (c) 2008--2009 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 }
21
22 use lib "$srcdir/ucw/perl";
23 use UCW::Configure;
24 use UCW::Configure::Pkg;
25
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;
33
34 if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) {
35         # Build libucw only if it is needed
36         Set("CONFIG_UCW_LIBS" => 1);
37 }
38
39 if (Get("CONFIG_SUBMIT")) {
40         # Submit server needs crypto libraries
41         if (!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.";
44         }
45 }
46
47 Finish();
48 Log "\nConfigured, run `make' to build everything.\n";