1 | dnl Process this file with autoconf to produce a configure script.
2 | AC_INIT("njudge", 1.7.4)
3 | AM_CONFIG_HEADER(config.h)
4 | AC_CANONICAL_SYSTEM
5 | AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
6 | AC_EXEEXT
7 |
8 | dnl set install options
9 | ac_user=""
10 | AC_ARG_WITH(user,
11 | [ --with-user=NAME Name of user judge should run as [[judge]] ],
12 | [ ac_user="$withval"],
13 | [ ac_user="judge" ]
14 | )
15 | USER="$ac_user"
16 | AC_SUBST(USER)
17 |
18 | ac_dir=""
19 | AC_ARG_WITH(dir,
20 | [ --with-dir=DIR Directory to install judge in [[/home/judge]] ],
21 | [ ac_dir="$withval"],
22 | [ ac_dir="/home/judge" ]
23 | )
24 | DIR="$ac_dir"
25 | AC_SUBST(DIR)
26 |
27 | AC_ARG_WITH(domain,
28 | [ --with-domain=DOMAIN Domain name judge email comes from [[localhost]] ],
29 | [ ac_domain="$withval"],
30 | [ ac_domain="localhost" ]
31 | )
32 | DOMAIN="$ac_domain"
33 | AC_SUBST(DOMAIN)
34 |
35 | AC_ARG_WITH(sendmail,
36 | [ --with-sendmail=SENDMAIL Location of sendmail [[/usr/sbin]] ],
37 | [ ac_sendmail="$withval"],
38 | [ ac_sendmail="/usr/sbin" ]
39 | )
40 |
41 | dnl Checks for programs.
42 | AC_PROG_CC
43 | AC_PROG_AWK
44 | AC_PROG_LN_S
45 | AC_PATH_PROG(HEAD, head)
46 | AC_PATH_PROG(_MAIL_, mail) # MAIL often is already set
47 | AC_PATH_PROG(PERL, perl)
48 | # Sendmail is not always easy to find on some systems
49 | AC_PATH_PROG(sendmail, sendmail, "no", $ac_sendmail:/usr/sbin:/usr/lib:$PATH)
50 | if test "$sendmail" = "no"; then
51 | AC_MSG_ERROR(Cannot find sendmail)
52 | else
53 | SENDMAIL="$sendmail"
54 | AC_SUBST(SENDMAIL)
55 | fi
56 |
57 | dnl Checks for functions
58 | AC_CHECK_FUNCS(strdup)
59 | AC_CHECK_FUNCS(flock)
60 | AC_CHECK_FUNCS(mrand48)
61 |
62 | AC_OUTPUT(Makefile smail dipclean dip.conf)
63 |