forked from bblackham/moe-cms
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure
executable file
·49 lines (42 loc) · 1.19 KB
/
configure
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#!/usr/bin/perl
# Configure script for Moe
# (c) 2008--2009 Martin Mares <[email protected]>
use warnings;
use strict;
our $srcdir;
BEGIN {
my $pkgfile = "judge/token.c";
if (!defined ($srcdir = $ENV{"SRCDIR"})) {
if (-f $pkgfile) {
$srcdir=".";
} elsif ($0 =~ m@^(.*)/configure$@ && -f "$1/$pkgfile") {
$srcdir=$1;
} else {
die "Don't know how to find myself. Please set SRCDIR manually.";
}
}
}
use lib "$srcdir/ucw/perl";
use UCW::Configure;
use UCW::Configure::Pkg;
Init($srcdir, "default.cfg");
Include "ucw/default.cfg";
Log "### Configuring Moe ###\n\n";
Include Get("CONFIG");
require UCW::Configure::Paths;
require UCW::Configure::C;
require UCW::Configure::LibUCW;
require UCW::Configure::Doc;
if (Get("CONFIG_SUBMIT") || Get("CONFIG_MOP")) {
# Build libucw only if it is needed
Set("CONFIG_UCW_LIBS" => 1);
}
if (Get("CONFIG_SUBMIT")) {
# Submit server needs crypto libraries
if (!PkgConfig("gnutls") && !TrivConfig("libgnutls", script => "libgnutls-config") ||
!TrivConfig("libgcrypt", script => "libgcrypt-config")) {
Fail "The libgnutls and libgcrypt libraries are required to build the submit server.";
}
}
Finish();
Log "\nConfigured, run `make' to build everything.\n";