configure.ac 13.9 KB
Newer Older
1
2
# configure.ac - Top-level configure.in for Sympa
# $Id$
3
4
#
# Sympa - SYsteme de Multi-Postage Automatique
5
6
7
8
#
# Copyright (c) 1997, 1998, 1999 Institut Pasteur & Christophe Wolfhugel
# Copyright (c) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005,
# 2006, 2007, 2008, 2009, 2010, 2011 Comite Reseau des Universites
9
# Copyright (c) 2011, 2012, 2013, 2014, 2015, 2016, 2017 GIP RENATER
10
11
12
13
14
15
16
17
18
19
20
21
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
22
# along with this program.  If not, see <http://www.gnu.org/licenses/>.
23

24
AC_PREREQ(2.60)
25
AC_INIT(sympa, 6.2.23b.1, sympa-developpers@listes.renater.fr)
26
AM_INIT_AUTOMAKE([foreign -Wall -Werror 1.9 tar-pax])
27
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
28
AM_PO_SUBDIRS
salaun's avatar
salaun committed
29
30
31

AC_PREFIX_DEFAULT(/home/sympa)

32
33
34
35
36
## first initialises parameters to the standard Sympa filesystem organization
# $prefix variable initialisation seems to be tricky
if test "$prefix" = "NONE"; then
   prefix=$ac_default_prefix
fi
37

38
## allow user to select FHS-compliant installation
39
40
41
42
43
44
AC_ARG_ENABLE(
	fhs,
	AS_HELP_STRING(
	[--enable-fhs],
	[use standard FHS files and directories locations and naming (default is no)]
	),
45
	[fhs=$enableval]
46
)
47

48
49
50
if test "$fhs" = "yes"; then
    # only define custom variables
    initdir=$sysconfdir/rc.d/init.d
51
    unitsdir=
52
    smrshdir=$sysconfdir/smrsh
53
54
55
56
57
58
    piddir=$localstatedir/run/sympa
    lockdir=$localstatedir/lock/subsys
    modulesdir=$datadir/sympa/lib
    scriptdir=$datadir/sympa/bin
    defaultdir=$datadir/sympa/default
    execcgidir=$libdir/sympa/cgi
59
    expldir=$localstatedir/lib/sympa/list_data
60
61
62
63
    staticdir=$localstatedir/lib/sympa/static_content
    spooldir=$localstatedir/spool/sympa
    arcdir=$localstatedir/lib/sympa/arc
    bouncedir=$localstatedir/lib/sympa/bounce
64
    confdir=$sysconfdir/sympa
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
else
    # redefine default values for some standard variables,
    # but only if no value was given
    if test "$sbindir" = '${exec_prefix}/sbin'; then
       sbindir=$prefix/bin
    fi
    if test "$libexecdir" = '${exec_prefix}/libexec'; then
	libexecdir=$prefix/bin
    fi
    if test "$localstatedir" = '${prefix}/var'; then
	localstatedir=/var
    fi
    if test "$localedir" = '${datarootdir}/locale'; then
	localedir=$prefix/locale
    fi

    # define custom variables
    initdir=/etc/rc.d/init.d
83
    unitsdir=
84
    smrshdir=/etc/smrsh
85
86
87
88
89
90
91
92
93
94
95
    piddir=$prefix
    lockdir=$localstatedir/lock/subsys
    modulesdir=$prefix/bin
    scriptdir=$prefix/bin
    defaultdir=$prefix/default
    execcgidir=$prefix/bin
    expldir=$prefix/list_data
    spooldir=$prefix/spool
    staticdir=$prefix/static_content
    arcdir=$prefix/arc
    bouncedir=$prefix/bounce
96
    confdir=/etc/sympa
97
98
fi
 
99
100
# substitute custom variables
AC_SUBST(initdir)
101
AC_SUBST(unitsdir)
102
AC_SUBST(smrshdir)
103
104
105
106
107
108
109
110
111
112
113
AC_SUBST(piddir)
AC_SUBST(lockdir)
AC_SUBST(modulesdir)
AC_SUBST(scriptdir)
AC_SUBST(defaultdir)
AC_SUBST(execcgidir)
AC_SUBST(expldir)
AC_SUBST(spooldir)
AC_SUBST(staticdir)
AC_SUBST(arcdir)
AC_SUBST(bouncedir)
114
AC_SUBST(localedir)
115
AC_SUBST(confdir)
116
AC_SUBST(docdir)
117

118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
## Disable smtpc command line utility
AC_ARG_ENABLE(
    smtpc,
    AS_HELP_STRING(
        [--disable-smtpc],
        [do not install smtpc command line utility (default is yes)]
    ),
    [case "$enableval" in
     yes) smtpc=true;;
     no) smtpc=false;;
     *) smtpc=true;;
     esac],
    [smtpc=true]
)
AM_CONDITIONAL([SMTPC], [test x$smtpc = xtrue])

134
# allow user to redefine some of them
135
136
137
138
AC_ARG_WITH(
    confdir,
    AS_HELP_STRING(
	[--with-confdir=DIR],
139
	[Directory of Sympa main configuration file (sympa.conf) @<:@SYSCONFDIR/sympa@:>@]
140
141
    ),
    [
142
	confdir="$withval"
143
144
    ]
)
salaun's avatar
salaun committed
145

146
AC_ARG_WITH(
147
    etcdir,
148
149
    [],
    [AC_MSG_ERROR([obsolete --with-etcdir option used. use --sysconfdir instead.])]
150
151
152
153
)

AC_ARG_WITH(
    bindir,
154
155
    [],
    [AC_MSG_ERROR([obsolete --with-bindir option used. those binaries are now installed in LIBEXECDIR.])]
156
157
158
159
)

AC_ARG_WITH(
    sbindir,
160
161
    [],
    [AC_MSG_ERROR([obsolete --with-sbindir option used. use --sbindir instead.])]
162
163
164
165
)

AC_ARG_WITH(
    libexecdir,
166
167
    [],
    [AC_MSG_ERROR([obsolete --with-libexecdir option used. use --libexecdir instead.])]
168
169
170
171
172
173
)

AC_ARG_WITH(
    cgidir,
    AS_HELP_STRING(
	[--with-cgidir=DIR],
sikeda's avatar
sikeda committed
174
	[CGI scripts @<:@PREFIX/bin@:>@]
175
176
177
178
179
180
    ),
    [execcgidir="$withval"]
)

AC_ARG_WITH(
    datadir,
181
182
    [],
    [AC_MSG_ERROR([obsolete --with-datadir option used. use --datadir instead.])]
183
184
185
186
)

AC_ARG_WITH(
    libdir,
187
188
    [],
    [AC_MSG_ERROR([obsolete --with-libdir option used. use --with-modulesdir instead.])]
189
190
191
192
193
194
)

AC_ARG_WITH(
    localedir,
    AS_HELP_STRING(
	[--with-localedir=DIR],
sikeda's avatar
sikeda committed
195
	[Internationalization catalogues directory @<:@PREFIX/locale@:>@]
196
197
198
199
200
201
202
203
    ),
    [
     localedir="$withval"
    ]
)

AC_ARG_WITH(
    mandir,
204
205
    [],
    [AC_MSG_ERROR([obsolete --with-mandir option used. use --mandir instead.])]
206
207
208
209
210
211
)

AC_ARG_WITH(
    docdir,
    AS_HELP_STRING(
	[--with-docdir=DIR],
sikeda's avatar
sikeda committed
212
	[Documentations]
213
214
215
216
217
218
219
220
    ),
    [
	docdir="$withval"
    ]
)

AC_ARG_WITH(
    sampledir,
221
222
    [],
    [AC_MSG_ERROR([obsolete --with-sampledir option used. samples are now installed with documentation.])]
223
224
225
226
227
228
)

AC_ARG_WITH(
    expldir,
    AS_HELP_STRING(
	[--with-expldir=DIR],
229
	[list data directory @<:@PREFIX/list_data@:>@]
230
231
    ),
    [expldir="$withval"]
232
)
salaun's avatar
salaun committed
233

234
235
236
237
AC_ARG_WITH(
    spooldir,
    AS_HELP_STRING(
	[--with-spooldir=DIR],
238
	[application spool directory @<:@PREFIX/spool@:>@]
239
240
241
    ),
    [spooldir="$withval"]
)
242

243
244
245
246
AC_ARG_WITH(
    initdir,
    AS_HELP_STRING(
	[--with-initdir=DIR],
247
	[install System V init script @<:@SYSCONFDIR/rc.d/init.d@:>@]
248
249
250
251
    )
AS_HELP_STRING(
        [--without-initdir],
        [do not install System V init script]
252
    ),
253
    [test "x$withval" = "xyes" || initdir="$withval"; test "x$withval" = "xno" && initdir=""]
254
)
255
AM_CONDITIONAL([SYSV_INIT], [test "x$initdir" != "x"])
sympa-authors's avatar
sympa-authors committed
256

257
258
259
260
261
262
263
264
AC_ARG_WITH(
    unitsdir,
    AS_HELP_STRING(
	[--with-unitsdir=DIR],
	[install Systemd unit files @<:@no@:>@]
    ),
    [test "x$withval" = "xyes" || unitsdir="$withval"; test "x$withval" = "xno" && unitsdir=""]
)
265
AM_CONDITIONAL([SYSTEMD_UNITS], [test "x$unitsdir" != "x"])
266

267
268
269
270
271
AC_ARG_WITH(
    smrshdir,
    AS_HELP_STRING(
	[--with-smrshdir=DIR],
	[install symbolic links for Sendmail smrsh @<:@SYSCONFDIR/smrsh@:>@]
272
273
274
275
    )
AS_HELP_STRING(
        [--without-smrshdir],
        [do not install symbolic links for Sendmail smrsh]
276
    ),
277
    [test "x$withval" = "xyes" || smrshdir="$withval"; test "x$withval" = "xno" && smrshdir=""]
278
)
279
AM_CONDITIONAL(SMRSH, [test "x$smrshdir" != "x"])
280

281
AC_ARG_WITH(
282
    lockdir,
283
    AS_HELP_STRING(
284
	[--with-lockdir=DIR],
285
	[lock files @<:@LOCALSTATEDIR/lock/subsys@:>@]
286
    ),
287
    [lockdir="$withval"]
288
)
289

290
AC_ARG_WITH(
291
    piddir,
292
    AS_HELP_STRING(
293
	[--with-piddir=DIR],
294
	[.pid files @<:@LOCALSTATEDIR/run@:>@]
295
    ),
296
    [piddir="$withval"]
297
)
298
299
300
301
302

AC_ARG_WITH(
    modulesdir,
    AS_HELP_STRING(
	[--with-modulesdir=DIR],
303
	[Perl modules file installed with Sympa @<:@PREFIX/bin@:>@]
304
305
306
307
308
309
310
311
    ),
    [modulesdir="$withval"]
)

AC_ARG_WITH(
    defaultdir,
    AS_HELP_STRING(
	[--with-defaultdir=DIR],
312
	[default configuration files (scenarios and templates also) @<:@PREFIX/default@:>@]
313
314
315
316
317
318
319
320
    ),
    [defaultdir="$withval"]
)

AC_ARG_WITH(
    scriptdir,
    AS_HELP_STRING(
	[--with-scriptdir=DIR],
321
	[application scripts @<:@PREFIX/bin@:>@]
322
323
324
    ),
    [scriptdir="$withval"]
)
325

sikeda's avatar
sikeda committed
326
327
328
329
330
331
332
333
334
AC_ARG_WITH(
    staticdir,
    AS_HELP_STRING(
	[--with-staticdir=DIR],
	[static data @<:@PREFIX/static_content@:>@]
    ),
    [staticdir="$withval"]
)

335
CONFIG=$confdir/sympa.conf
336
AC_SUBST(CONFIG)
337
WWSCONFIG=$confdir/wwsympa.conf
338
339
340
341
342
AC_SUBST(WWSCONFIG)

AC_PROG_CC
# needed for using per-target flags
AM_PROG_CC_C_O
343
344
AC_PATH_PROGS([SED], [sed gsed])
#AC_PROG_SED
345
AC_PROG_LN_S
salaun's avatar
salaun committed
346

347
348
349
350
351
352
353
354
355
356
AC_ARG_WITH(
    [perl],
    AS_HELP_STRING(
	[--with-perl=FULLPATH],
        [set full path to Perl interpreter]
    ),
    [PERL="$withval"]
)
if test -n "$PERL"; then
    # user-supplied value
sikeda's avatar
sikeda committed
357
    AC_MSG_CHECKING([user-supplied Perl interpreter])
358
359
360
361
    if test -f "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-existing])
sikeda's avatar
sikeda committed
362
	AC_MSG_ERROR([invalid value $PERL for Perl interpreter])
363
364
365
366
367
    fi
    if test -x "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-executable])
sikeda's avatar
sikeda committed
368
	AC_MSG_ERROR([invalid value $PERL for Perl interpreter])
369
370
371
372
373
374
375
376
377
    fi
    AC_MSG_RESULT([$PERL])
else
    # check in PATH
    AC_PATH_PROG(PERL, perl)
    if test -z "$PERL"; then
	AC_MSG_ERROR([perl required])
    fi
fi
sympa-authors's avatar
sympa-authors committed
378

379
380
381
382
383
AC_PATH_PROG(POD2MAN, pod2man)
if test -z "$POD2MAN"; then
    AC_MSG_ERROR([pod2man required])
fi

salaun's avatar
salaun committed
384
USER=sympa
385
386
AC_ARG_WITH(
    [user],
387
    AS_HELP_STRING(
388
	[--with-user=LOGIN],
389
	[set Sympa user name @<:@sympa@:>@]
390
    ),
391
392
    [USER="$withval"]
)
salaun's avatar
salaun committed
393
394
395
AC_SUBST(USER)

GROUP=sympa
396
397
AC_ARG_WITH(
    [group],
398
    AS_HELP_STRING(
399
	[--with-group=LOGIN],
400
	[set Sympa group name @<:@sympa@:>@]
401
    ),
402
403
    [GROUP="$withval"]
)
salaun's avatar
salaun committed
404
405
AC_SUBST(GROUP)

406
SENDMAIL_ALIASES=/etc/mail/sympa_aliases
407
AC_ARG_WITH(
408
    [aliases_file],
409
    AS_HELP_STRING(
410
	[--with-aliases_file=ALIASFILE],
411
	[aliases file to store Sympa mail aliases @<:@/etc/mail/sympa_aliases@:>@]
412
    ),
413
414
    [SENDMAIL_ALIASES="$withval"]
)
415
416
AC_SUBST(SENDMAIL_ALIASES)

417
AC_ARG_WITH(
418
419
420
421
422
423
424
425
426
427
428
429
430
431
    [sendmail_aliases], ,
    AC_MSG_ERROR([--with-sendmail_aliases was deprecated.  Use --with-aliases_file.])
)

VIRTUAL_ALIASES=
AC_ARG_WITH(
    [virtual_aliases], ,
    AC_MSG_ERROR([--with-virtual_aliases was deprecated.  Use --with-aliases_file.])
)
AC_SUBST(VIRTUAL_ALIASES)

MAKEMAP=
AC_ARG_WITH(
    [makemap],
432
    AS_HELP_STRING(
433
434
	[--with-makemap=FULLPATH],
	[path to Sendmail makemap command @<:@AUTO-DETECT@:>@]
435
    ),
436
    [MAKEMAP="$withval"]
437
)
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
if test -n "$MAKEMAP"; then
    # user-supplied value
    AC_MSG_CHECKING([user-supplied makemap command])
    if test -f "$MAKEMAP"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $MAKEMAP for makemap command])
    fi
    if test -x "$MAKEMAP"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $MAKEMAP for makemap command])
    fi
    AC_MSG_RESULT([$MAKEMAP])
else
    # default value
    AC_PATH_PROG([MAKEMAP], [makemap], [/usr/bin/makemap])
fi
AC_SUBST(MAKEMAP)
459

460
NEWALIASES=
461
462
AC_ARG_WITH(
    [newaliases],
463
    AS_HELP_STRING(
464
	[--with-newaliases=FULLPATH],
465
	[path to newaliases command @<:@AUTO-DETECT@:>@]
466
    ),
467
468
    [NEWALIASES="$withval"]
)
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
if test -n "$NEWALIASES"; then
    # user-supplied value
    AC_MSG_CHECKING([user-supplied newaliases command])
    if test -f "$NEWALIASES"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $NEWALIASES for newaliases command])
    fi
    if test -x "$NEWALIASES"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $NEWALIASES for newaliases command])
    fi
    AC_MSG_RESULT([$NEWALIASES])
else
    # default value
487
    AC_PATH_PROG([NEWALIASES], [newaliases], [/usr/bin/newaliases])
488
fi
489
490
AC_SUBST(NEWALIASES)

491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
if test -n "$CAT"; then
    # user-supplied value
    AC_MSG_CHECKING([user-supplied cat command])
    if test -f "$CAT"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $CAT for cat command])
    fi
    if test -x "$CAT"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $CAT for cat command])
    fi
    AC_MSG_RESULT([$CAT])
else
    # default value
    AC_PATH_PROG([CAT], [cat], [/bin/cat])
fi
AC_SUBST(CAT)

513
AC_MSG_CHECKING([argument to newaliases command])
514
NEWALIASES_ARG=
515
516
AC_ARG_WITH(
    [newaliases_arg],
517
    AS_HELP_STRING(
518
	[--with-newaliases_arg=ARGS],
519
	[arguments to newaliases command @<:@NONE@:>@]
520
    ),
521
522
    [NEWALIASES_ARG="$withval"]
)
523
AC_SUBST(NEWALIASES_ARG)
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
if test -z "$NEWALIASES_ARG"; then
    AC_MSG_RESULT([none])
else
    AC_MSG_RESULT([$NEWALIASES_ARG])
fi

POSTALIAS=
AC_ARG_WITH(
    [postalias],
    AS_HELP_STRING(
	[--with-postalias=FULLPATH],
	[path to Postfix postalias command @<:@AUTO-DETECT@:>@]
    ),
    [POSTALIAS="$withval"]
)
if test -n "$POSTALIAS"; then
    # user-supplied value
    AC_MSG_CHECKING([user-supplied postalias command])
    if test -f "$POSTALIAS"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $POSTALIAS for postalias command])
    fi
    if test -x "$POSTALIAS"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $POSTALIAS for postalias command])
    fi
    AC_MSG_RESULT([$POSTALIAS])
else
    # default value
    AC_PATH_PROG([POSTALIAS], [postalias], [/usr/sbin/postalias])
fi
AC_SUBST(POSTALIAS)
560

561
POSTMAP=
562
563
AC_ARG_WITH(
    [postmap],
564
    AS_HELP_STRING(
565
	[--with-postmap=FULLPATH],
566
	[path to Postfix postmap command @<:@AUTO-DETECT@:>@]
567
    ),
568
569
    [POSTMAP="$withval"]
)
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
if test -n "$POSTMAP"; then
    # user-supplied value
    AC_MSG_CHECKING([user-supplied postmap command])
    if test -f "$POSTMAP"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $POSTMAP for postmap command])
    fi
    if test -x "$POSTMAP"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $POSTMAP for postmap command])
    fi
    AC_MSG_RESULT([$POSTMAP])
else
    # default value
588
    AC_PATH_PROG([POSTMAP], [postmap], [/usr/sbin/postmap])
589
fi
590
591
AC_SUBST(POSTMAP)

592
POSTMAP_ARG=
593
AC_ARG_WITH(
594
595
    [postmap_arg], ,
    AC_MSG_ERROR([--with-postmap_arg was deprecated.  Use --with-newaliases_arg.])
596
)
597
598
AC_SUBST(POSTMAP_ARG)

599
600
AC_CONFIG_FILES([
    Makefile
601
602
603
604
605
    default/Makefile
    doc/Makefile
    po/Makefile
    po/sympa/Makefile.in
    po/web_help/Makefile.in
606
    src/Makefile
607
608
    src/bin/Makefile
    src/cgi/Makefile
609
610
    src/etc/Makefile
    src/etc/script/Makefile
611
    src/lib/Makefile
612
613
614
    src/libexec/Makefile
    src/sbin/Makefile
    www/Makefile
615
])
616

617
AC_CONFIG_SUBDIRS([src/smtpc])
618
SMTPC_CONFIGURE_OPTIONS="--program-prefix=sympa_"
619
620
export SMTPC_CONFIGURE_OPTIONS

621
AC_OUTPUT