This repository has been archived by the owner on Jul 20, 2022. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathconfigure.ac
590 lines (508 loc) · 16.8 KB
/
configure.ac
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
dnl Process this file with autoconf to produce a configure script.
AC_INIT(mailmunge, 3.09, , mailmunge, https://www.mailmunge.org/)
dnl UGLY hack... set the --sysconfdir to /etc UNLESS it was explicitly
dnl supplied on the command line. Autoconf has no other nice way to set
dnl the default to other than ${prefix}/etc
echo $* | fgrep -e '--sysconfdir' > /dev/null 2>&1 || sysconfdir='/etc'
AC_PROG_CC dnl Find C compiler
AC_CONFIG_HEADER(c/config.h)
dnl Add some common directories to PATH in case they are not there
PATH=$PATH:/usr/local/bin
AC_PROG_INSTALL
AC_TYPE_LONG_LONG_INT
AC_ARG_ENABLE(embedded-perl, [ --disable-embedded-perl Disable embedded Perl interpreter], ac_cv_embedded_perl=$enableval, ac_cv_embedded_perl=yes)
AC_PATH_PROG(PERL, perl)
if test -z "$PERL" ; then
AC_MSG_ERROR([*** Cannot continue without Perl. Sorry.])
exit 1
fi
dnl Check for -Wno-unused-result
AC_MSG_CHECKING(whether C compiler accepts -Wno-unused-result option)
OLD_CFLAGS="$CFLAGS"
CFLAGS="-Wno-unused-result"
AC_TRY_COMPILE([
#include <stdio.h>
], [int x;], ac_have_wno_unused_result=yes, ac_have_wno_unused_result=no);
AC_MSG_RESULT($ac_have_wno_unused_result)
if test "$ac_have_wno_unused_result" = "yes" ; then
CFLAGS="$OLD_CFLAGS -Wno-unused-result"
else
CFLAGS="$OLD_CFLAGS"
fi
dnl Check for socklen_t type
AC_MSG_CHECKING(whether socklen_t is defined)
AC_TRY_COMPILE([
#include <sys/types.h>
#include <sys/socket.h>
], [socklen_t x;], ac_have_socklen_t=yes, ac_have_socklen_t=no)
AC_MSG_RESULT($ac_have_socklen_t)
if test "$ac_have_socklen_t" = "yes" ; then
AC_DEFINE(HAVE_SOCKLEN_T,[],["Whether we have the variable type socklen_t"])
fi
dnl Check for -fPIE
AC_MSG_CHECKING(whether the -fPIE compiler option is accepted)
OLD_CFLAGS="$CFLAGS"
CFLAGS="-fPIE -Werror -pie"
AC_TRY_COMPILE([
#include <stdio.h>
], [int x;], ac_have_fpie=yes, ac_have_fpie=no)
AC_MSG_RESULT($ac_have_fpie)
if test "$ac_have_fpie" = "yes" ; then
CFLAGS="$OLD_CFLAGS -fPIE"
LDFLAGS="$LDFLAGS -pie"
else
CFLAGS="$OLD_CFLAGS"
fi
for thing in prefix siteprefix vendorprefix installarchlib installprivlib installbin installscript installman1dir installman3dir installsitearch installsitelib installsitebin installsitescript installsiteman1dir installsiteman3dir installvendorarch installvendorlib installvendorbin installvendorscript installvendorman1dir installvendorman3dir; do
AC_MSG_CHECKING([for Perl installation variable $thing])
val=`$PERL -V:$thing | sed -e "s/^.*='//" -e "s/';$//"`
AC_MSG_RESULT($val)
dnl Stupid m4....
up=`echo $thing | tr '[[a-z]]' '[[A-Z]]'`
eval "PERL$up=$val"
done
dnl wait3
dnl We know that wait3 works fine on Solaris 9, but autoconf
dnl sometimes misses it
un=`uname -s -r`
if test "$un" = "SunOS 5.9" ; then
ac_cv_func_wait3_rusage=yes
fi
AC_FUNC_WAIT3
AC_PATH_PROG(NM, nm)
dnl Allow user to tell us where Sendmail is (or will be)
SENDMAILPROG=no
AC_ARG_WITH(sendmail,
[ --with-sendmail=PATH specify location of Sendmail binary],
SENDMAILPROG=$with_sendmail, SENDMAILPROG=no)
MMUSER=""
AC_ARG_WITH(user,
[ --with-user=LOGIN use LOGIN (default mailmunge) as the mailmunge user],
MMUSER=$with_user, MMUSER=mailmunge)
AC_SUBST(MMUSER)
MMGROUP=""
AC_ARG_WITH(group,
[ --with-group=GROUP use GROUP (default mailmunge) as the mailmunge group],
MMGROUP=$with_group, MMGROUP=mailmunge)
AC_SUBST(MMGROUP)
dnl Allow user to tell us where milter includes are
MILTERINC=
AC_ARG_WITH(milterinc,
[ --with-milterinc=PATH specify alternative location of milter includes],
MILTERINC=$with_milterinc, MILTERINC=)
dnl Allow user to tell us where milter libraries are
MILTERLIB=
AC_ARG_WITH(milterlib,
[ --with-milterlib=PATH specify alternative location of milter libraries],
MILTERLIB=$with_milterlib, MILTERLIB=)
dnl Allow specification of config dir
AC_ARG_WITH(confsubdir,
[ --with-confsubdir=DIR specify configuration subdirectory
(mailmunge) ],
CONFSUBDIR="/$with_confsubdir", CONFSUBDIR=/mailmunge)
if test "$CONFSUBDIR" = "/" -o "$CONFSUBDIR" = "//" ; then
CONFSUBDIR=""
fi
AC_SUBST(CONFSUBDIR)
dnl Allow specification of spool dir
AC_ARG_WITH(spooldir,
[ --with-spooldir=DIR specify location of spool directory
(/var/spool/mailmunge)],
SPOOLDIR=$with_spooldir, SPOOLDIR=/var/spool/mailmunge)
dnl Allow specification of Perl installdirs
AC_ARG_WITH(perlinstalldirs,
[ --with-perlinstalldirs=CHOICE
specify choice for Perl INSTALLDIRS
(site; must be one of perl, site or vendor)],
PERLINSTALLDIRS=$with_perlinstalldirs, PERLINSTALLDIRS=site)
if test "$PERLINSTALLDIRS" != "site" -a "$PERLINSTALLDIRS" != "perl" -a "$PERLINSTALLDIRS" != "vendor" ; then
echo "*** --with-perlinstalldirs must be one of 'perl', 'site', or 'vendor'"
exit 1
fi
dnl Allow specification of quarantine dir
AC_ARG_WITH(quarantinedir,
[ --with-quarantinedir=DIR
specify location of quarantine directory
(/var/spool/mm-quarantine)],
QDIR=$with_quarantinedir, QDIR=/var/spool/mm-quarantine)
AC_ARG_ENABLE(pthread-flag,
[ --enable-pthread-flag Supply the -pthread flag to the C compiler], FORCE_PTHREAD_FLAG=-pthread, FORCE_PTHREAD_FLAG="")
AC_ARG_ENABLE(check-perl-modules,
[ --disable-check-perl-modules
Disable compile-time checks for Perl modules], ac_cv_perlmodcheck=$enableval, ac_cv_perlmodcheck=yes)
AC_ARG_ENABLE(perl-build-artifacts,
[ --disable-perl-build-artifacts
Disable perllocal.pod and .packlist generation], ac_cv_perlartifacts=$enableval, ac_cv_perlartifacts=yes)
dnl Check for Perl modules
if test "$ac_cv_perlmodcheck" = "no" ; then
AC_MSG_RESULT([Compile-time checking for Perl modules disabled])
else
for module in 'IO::Socket' 'IO::Socket::SSL' 'MIME::Tools 5.410 ()' 'MIME::WordDecoder' 'Sys::Syslog' 'FindBin'; do
AC_MSG_CHECKING([for Perl module $module])
(echo "use lib '$PERLINSTALLSITELIB'; use $module;" ; echo "exit(0);") | $PERL > /dev/null 2>&1
if test $? != 0 ; then
AC_MSG_WARN([*** Error trying to use Perl module $module])
AC_MSG_WARN([*** Make sure it is installed])
exit 1
fi
AC_MSG_RESULT(ok)
done
fi
dnl Check for ExtUtils::Embed
if test "$ac_cv_embedded_perl" = "no" ; then
echo "Check for embedded perl disabled by --disable-embedded-perl option"
HAVE_EXTUTILS_EMBED=no
else
AC_MSG_CHECKING([for Perl module ExtUtils::Embed])
(echo "use ExtUtils::Embed;" ; echo "exit(0);") | $PERL > /dev/null 2>&1
if test $? = 0 ; then
HAVE_EXTUTILS_EMBED=yes
AC_MSG_RESULT(ok)
else
HAVE_EXTUTILS_EMBED=no
AC_MSG_RESULT(no)
fi
fi
AC_CHECK_HEADERS(getopt.h unistd.h stdint.h poll.h stdint.h)
dnl Check if stdint.h defines uint32_t
AC_MSG_CHECKING(whether stdint.h defines uint32_t)
AC_TRY_COMPILE([
#include <stdint.h>
], [uint32_t foo;], ac_uint32_t_defined=yes, ac_uint32_t_defined=no)
AC_MSG_RESULT($ac_uint32_t_defined)
if test "$ac_uint32_t_defined" = "yes" ; then
AC_DEFINE(HAVE_UINT32_T,[],["whether uint32_t is defined"])
fi
dnl Check if sys/types.h defines uint32_t
AC_MSG_CHECKING(whether sys/types.h defines uint32_t)
AC_TRY_COMPILE([
#include <sys/types.h>
], [uint32_t foo;], ac_uint32_t_defined=yes, ac_uint32_t_defined=no)
AC_MSG_RESULT($ac_uint32_t_defined)
if test "$ac_uint32_t_defined" = "yes" ; then
AC_DEFINE(HAVE_UINT32_T,[],["whether uint32_t is defined"])
fi
dnl sig_atomic_t
AC_MSG_CHECKING(whether sig_atomic_t is defined)
AC_TRY_COMPILE([
#include <signal.h>
], [sig_atomic_t foo;], ac_have_sig_atomic_t=yes, ac_have_sig_atomic_t=no)
AC_MSG_RESULT($ac_have_sig_atomic_t)
if test "$ac_have_sig_atomic_t" = "yes" ; then
AC_DEFINE(HAVE_SIG_ATOMIC_T,[],["Whether we have the atomic_t variable type "])
fi
dnl Check if compiler allows "-pthread" option, but only if
dnl we are using GCC
if test "$FORCE_PTHREAD_FLAG" = "-pthread" ; then
AC_MSG_RESULT(Forcing use of -pthread C compiler flag)
PTHREAD_FLAG=-pthread
elif test "$GCC" = yes ; then
AC_MSG_CHECKING([whether ${CC-cc} accepts -pthread])
echo 'void f(){}' > conftest.c
if test -z "`${CC-cc} -pthread -c conftest.c 2>&1`"; then
ac_cv_prog_cc_pthread=yes
PTHREAD_FLAG="-pthread"
else
PTHREAD_FLAG=""
ac_cv_prog_cc_pthread=no
fi
AC_MSG_RESULT($ac_cv_prog_cc_pthread)
rm -f conftest*
else
PTHREAD_FLAG=""
fi
if test "$HAVE_EXTUTILS_EMBED" = "yes" ; then
AC_MSG_CHECKING([if we can embed a Perl interpreter in C])
OLDCFLAGS="$CFLAGS"
OLDLDFLAGS="$LDFLAGS"
OLDLIBS="$LIBS"
LIBS="-lperl $LIBS"
EMBPERLLDFLAGS="`$PERL -MExtUtils::Embed -e ldopts`"
EMBPERLCFLAGS="`$PERL -MExtUtils::Embed -e ccopts`"
LDFLAGS="$EMBPERLLDFLAGS $LDFLAGS"
CFLAGS="$EMBPERLCFLAGS $CFLAGS"
AC_TRY_RUN([
#include <EXTERN.h>
#include <perl.h>
#include <stdlib.h>
static PerlInterpreter *my_perl;
int main(int argc, char **argv, char **env) {
my_perl = perl_alloc();
if (!my_perl) exit(1);
exit(0);
}
], EMBED_PERL=yes, EMBED_PERL=no)
LIBS="$OLDLIBS"
CFLAGS="$OLDCFLAGS"
LDFLAGS="$OLDLDFLAGS"
AC_MSG_RESULT($EMBED_PERL)
else
EMBED_PERL=no
fi
if test "$EMBED_PERL" = "no" ; then
EMBPERLCFLAGS=""
EMBPERLLDFLAGS=""
EMBPERLLIBS=""
EMBPERLDEFS=""
EMBPERLOBJS=""
else
EMBPERLLIBS="-lperl"
EMBPERLDEFS="-DEMBED_PERL"
EMBPERLOBJS="embperl.o xs_init.o"
# Check for buggy perl interpreter
AC_MSG_CHECKING([if it is safe to destroy and recreate a Perl interpreter])
LIBS="-lperl $LIBS"
LDFLAGS="$EMBPERLLDFLAGS $LDFLAGS"
CFLAGS="$EMBPERLCFLAGS $CFLAGS $PTHREAD_FLAG"
AC_TRY_RUN([
#include <EXTERN.h>
#include <perl.h>
static PerlInterpreter *my_perl = NULL;
static char **argv = NULL;
int
make_embedded_interpreter(char **env)
{
int argc;
if (!argv) {
argv = (char **) malloc(6 * sizeof(char *));
}
if (my_perl != NULL) {
perl_destruct(my_perl);
perl_free(my_perl);
my_perl = NULL;
}
argv[0] = "";
argv[1] = "-e";
argv[2] = "print(\"\");";
argv[3] = NULL;
argc = 3;
#ifdef PERL_SYS_INIT3
PERL_SYS_INIT3(&argc, &argv, &env);
#endif
my_perl = perl_alloc();
if (!my_perl) {
return -1;
}
PERL_SET_CONTEXT(my_perl);
PL_perl_destruct_level = 1;
perl_construct(my_perl);
PL_perl_destruct_level = 1;
argv[0] = "";
argv[1] = "-e";
argv[2] = "print(\"\");";
argv[3] = NULL;
argc = 3;
perl_parse(my_perl, NULL, argc, argv, NULL);
perl_run(my_perl);
return 0;
}
int
main(int argc, char **argv, char **env)
{
make_embedded_interpreter(env);
make_embedded_interpreter(env);
return 0;
}
], SAFE_EMBED_PERL=yes, SAFE_EMBED_PERL=no)
LIBS="$OLDLIBS"
CFLAGS="$OLDCFLAGS"
LDFLAGS="$OLDLDFLAGS"
AC_MSG_RESULT($SAFE_EMBED_PERL)
if test "$SAFE_EMBED_PERL" = "yes" ; then
EMBPERLDEFS="$EMBPERLDEFS -DSAFE_EMBED_PERL"
fi
fi
AC_SUBST(EMBPERLCFLAGS)
AC_SUBST(EMBPERLLDFLAGS)
AC_SUBST(EMBPERLLIBS)
AC_SUBST(EMBPERLOBJS)
AC_SUBST(EMBPERLDEFS)
AC_CHECK_LIB(resolv, res_init)
AC_CHECK_LIB(socket, htons)
AC_CHECK_LIB(utils, setproctitle)
AC_CACHE_CHECK([for PS_STRINGS], [ac_cv_var_PS_STRINGS],
[AC_TRY_LINK(
[#include <machine/vmparam.h>
#include <sys/exec.h>
],
[PS_STRINGS->ps_nargvstr = 1;
PS_STRINGS->ps_argvstr = "foo";],
[ac_cv_var_PS_STRINGS=yes],
[ac_cv_var_PS_STRINGS=no])])
if test "$ac_cv_var_PS_STRINGS" = yes ; then
AC_DEFINE([HAVE_PS_STRINGS], [], [Define to 1 if the PS_STRINGS thing exists.\
])
fi
LIBS_WITHOUT_PTHREAD="$LIBS"
AC_CHECK_LIB(pthread, pthread_once)
AC_CHECK_FUNCS(initgroups)
AC_CHECK_FUNCS(setrlimit)
AC_CHECK_FUNCS(setproctitle)
AC_CHECK_FUNCS(setproctitle_init)
if test "$SPOOLDIR" = "no" -o "$SPOOLDIR" = "" ; then
SPOOLDIR=/var/spool/mailmunge
fi
if test "$QDIR" = "no" -o "$QDIR" = "" ; then
QDIR=/var/spool/mailmunge
fi
AC_SUBST(SPOOLDIR)
AC_SUBST(QDIR)
dnl debugging
AC_ARG_ENABLE(debugging, [ --enable-debugging Add debugging messages to syslog], ac_cv_debugging=$enableval, ac_cv_debugging=no)
if test "$ac_cv_debugging" = yes ; then
ENABLE_DEBUGGING=-DENABLE_DEBUGGING
else
ENABLE_DEBUGGING=
fi
dnl find Sendmail
if test "$SENDMAILPROG" = "no" ; then
AC_PATH_PROG(SENDMAILPROG, sendmail, no, $PATH:/sbin:/usr/sbin:/usr/lib:/usr/libexec)
fi
AC_DEFUN([MM_MILTER_SFIO],[
AC_MSG_CHECKING([whether libmilter requires -lsfio])
RESULT=`$NM $LIBMILTER 2>/dev/null | grep sfsprintf; $NM -D $LIBMILTERSO 2>/dev/null | grep sfsprintf`
if test -z "$RESULT" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
LIBS="$LIBS -lsfio"
fi
])
AC_DEFUN([MM_SM_LDAP],[
AC_MSG_CHECKING([whether libsm requires -lldap])
RESULT=`$NM $LIBSM | grep ldap_`
if test -z "$RESULT" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
LIBS="$LIBS -lldap -llber"
fi
])
AC_DEFUN([MM_MILTER_LDAP],[
AC_MSG_CHECKING([whether libmilter requires -lldap])
RESULT=`$NM $LIBMILTER 2>/dev/null | grep ldap_; $NM -D $LIBMILTERSO 2>/dev/null | grep ldap_`
if test -z "$RESULT" ; then
AC_MSG_RESULT(no)
else
AC_MSG_RESULT(yes)
LIBS="$LIBS -lldap -llber"
fi
])
AC_DEFUN([MM_MILTER_SM],[
OLD_LIBS="$LIBS"
LIBS="$LIBS -lmilter"
AC_MSG_CHECKING([whether libmilter requires -lsm])
AC_TRY_LINK(
[#include "libmilter/mfapi.h"
#include <string.h>],
[extern size_t sm_strlcpy(char *, char const *, ssize_t); char foo[10]; sm_strlcpy(foo, "", 0);],
NEED_LIBSM=no,
NEED_LIBSM=yes)
AC_MSG_RESULT($NEED_LIBSM)
LIBS="$OLD_LIBS"
if test "$NEED_LIBSM" = yes ; then
LIBS="$LIBS -lsm"
MM_SM_LDAP
else
MM_MILTER_LDAP
fi
])
if test "$SENDMAILPROG" = "no" ; then
AC_MSG_WARN([Oops.. I couldn't find the 'sendmail' program. Please install])
AC_MSG_WARN([either Sendmail or Postfix])
exit 1
fi
dnl GCC warning level
if test "$GCC" = yes; then
if test "`uname -s`" = Linux; then
CFLAGS="$CFLAGS -Wall -Wstrict-prototypes"
fi
fi
AC_SUBST(ENABLE_DEBUGGING)
AC_SUBST(PTHREAD_FLAG)
dnl Find sendmail include file. The nasty path is in case you're building
dnl Sendmail at the same level as mailmunge... we want to use that include
dnl file...
SMMILTER=`echo ../sendmail-*/include`
as_test_x='test -e'
as_executable_p='test -e'
# Redefine so AC_PATH_PROG works
as_fn_executable_p() {
test -e "$1"
}
AC_PATH_PROG(MINCLUDE, libmilter/mfapi.h, no, $MILTERINC:$SMMILTER:/usr/include:/usr/local/include:/usr/local/include/sendmail:/opt/local/include)
if test "$MINCLUDE" = "no" ; then
echo "*** mailmunge requires the Sendmail milter development headers to be installed."
exit 1
fi
dnl Fix up the include stuff
MINCLUDE=`dirname "$MINCLUDE"`
MINCLUDE=`dirname "$MINCLUDE"`
dnl If MINCLUDE is "/usr/include", do NOT add to include path, because
dnl this messes up compilation with gcc on Solaris.
if test "$MINCLUDE" = "/usr/include" ; then
MINCLUDE=""
else
MINCLUDE="-I${MINCLUDE}"
fi
AC_CHECK_LIB(milter, smfi_main, GOT_LIBMILTER=1, GOT_LIBMILTER=0)
if test "$GOT_LIBILTER" = "0" ; then
echo "*** mailmunge requires the Sendmail milter development library to be installed."
exit 1
fi
dnl Check if our libmilter is old and needs LIBSM. Also checks if it
dnl needs libldap
MM_MILTER_SM
if test "$ac_cv_perlartifacts" = "yes" ; then
PERLARTIFACTS=
else
PERLARTIFACTS='NO_PACKLIST=1 NO_PERLLOCAL=1'
fi
AC_SUBST(LIBS_WITHOUT_PTHREAD)
dnl evaluated versions of conf dir
CONFDIR_EVAL=`echo ${sysconfdir}${CONFSUBDIR}`
AC_SUBST(CONFDIR_EVAL)
AC_SUBST(LDFLAGS)
AC_SUBST(PERLPREFIX)
AC_SUBST(PERLARTIFACTS)
AC_SUBST(PERLSITEPREFIX)
AC_SUBST(PERLVENDORPREFIX)
AC_SUBST(PERLINSTALLARCHLIB)
AC_SUBST(PERLINSTALLPRIVLIB)
AC_SUBST(PERLINSTALLBIN)
AC_SUBST(PERLINSTALLMAN1DIR)
AC_SUBST(PERLINSTALLMAN3DIR)
AC_SUBST(PERLINSTALLSCRIPT)
AC_SUBST(PERLINSTALLSITEARCH)
AC_SUBST(PERLINSTALLSITELIB)
AC_SUBST(PERLINSTALLDATA)
AC_SUBST(PERLINSTALLSITEDATA)
AC_SUBST(PERLINSTALLVENDORDATA)
AC_SUBST(PERLINSTALLCONF)
AC_SUBST(PERLINSTALLSITECONF)
AC_SUBST(PERLINSTALLVENDORCONF)
AC_OUTPUT(Makefile c/Makefile script/mailmunge-util pod/mailmunge.pod pod/mailmunge-multiplexor.pod pod/mm-mx-ctrl.pod perl/lib/Mailmunge.pm perl/lib/Mailmunge/Constants.pm systemd-units/mailmunge.service systemd-units/mailmunge-multiplexor.service sysvinit/mailmunge etc/default/mailmunge.example spec/mailmunge.spec)
HERE=`pwd`
echo "*** Switching to perl/ directory and running $PERL Makefile.PL..."
cd perl && $PERL Makefile.PL INSTALLDIRS=${PERLINSTALLDIRS-site} $PERLARTIFACTS
if test "$?" != 0 ; then
echo "*** $PERL Makefile.PL failed!"
exit 0
fi
cd $HERE
chmod a+x script/mailmunge-util
if test "$MMUSER" != "" ; then
id $MMUSER > /dev/null 2>&1
if test "$?" != 0 ; then
echo ""
echo "Note: The mailmunge user '$MMUSER' does not seem to"
echo "exist. Please create this user before continuing."
fi
fi
if test "$ENABLE_DEBUGGING" != "" ; then
echo ""
echo "*** WARNING: You have configured with --enable-debugging."
echo "*** This will produce LARGE VOLUMES of syslog messages and"
echo "*** is NOT RECOMMENDED for a production system."
fi
chmod a+x sysvinit/mailmunge