configure.ac 13 KB
Newer Older
1
# configure.in - Top-level configure.in for Sympa
2
3
4
# RCS Identication ; $Revision$ ; $Date$ 
#
# Sympa - SYsteme de Multi-Postage Automatique
5
6
7
8
9
#
# 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
# Copyright (c) 2011, 2012, 2013, 2014 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.2a.43, sympa-authors@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
    smrshdir=$sysconfdir/smrsh
52
53
54
55
56
57
    piddir=$localstatedir/run/sympa
    lockdir=$localstatedir/lock/subsys
    modulesdir=$datadir/sympa/lib
    scriptdir=$datadir/sympa/bin
    defaultdir=$datadir/sympa/default
    execcgidir=$libdir/sympa/cgi
58
    expldir=$localstatedir/lib/sympa/list_data
59
60
61
62
    staticdir=$localstatedir/lib/sympa/static_content
    spooldir=$localstatedir/spool/sympa
    arcdir=$localstatedir/lib/sympa/arc
    bouncedir=$localstatedir/lib/sympa/bounce
63
    confdir=$sysconfdir/sympa
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
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
82
    smrshdir=/etc/smrsh
83
84
85
86
87
88
89
90
91
92
93
    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
94
    confdir=/etc/sympa
95
96
fi
 
97
98
# substitute custom variables
AC_SUBST(initdir)
99
AC_SUBST(smrshdir)
100
101
102
103
104
105
106
107
108
109
110
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)
111
AC_SUBST(localedir)
112
AC_SUBST(confdir)
113
AC_SUBST(docdir)
114
115

# allow user to redefine some of them
116
117
118
119
AC_ARG_WITH(
    confdir,
    AS_HELP_STRING(
	[--with-confdir=DIR],
120
	[Directory of Sympa main configuration file (sympa.conf) @<:@SYSCONFDIR/sympa@:>@]
121
122
    ),
    [
123
	confdir="$withval"
124
125
    ]
)
salaun's avatar
salaun committed
126

127
AC_ARG_WITH(
128
    etcdir,
129
130
    [],
    [AC_MSG_ERROR([obsolete --with-etcdir option used. use --sysconfdir instead.])]
131
132
133
134
)

AC_ARG_WITH(
    bindir,
135
136
    [],
    [AC_MSG_ERROR([obsolete --with-bindir option used. those binaries are now installed in LIBEXECDIR.])]
137
138
139
140
)

AC_ARG_WITH(
    sbindir,
141
142
    [],
    [AC_MSG_ERROR([obsolete --with-sbindir option used. use --sbindir instead.])]
143
144
145
146
)

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

AC_ARG_WITH(
    cgidir,
    AS_HELP_STRING(
	[--with-cgidir=DIR],
sikeda's avatar
sikeda committed
155
	[CGI scripts @<:@PREFIX/bin@:>@]
156
157
158
159
160
161
    ),
    [execcgidir="$withval"]
)

AC_ARG_WITH(
    datadir,
162
163
    [],
    [AC_MSG_ERROR([obsolete --with-datadir option used. use --datadir instead.])]
164
165
166
167
)

AC_ARG_WITH(
    libdir,
168
169
    [],
    [AC_MSG_ERROR([obsolete --with-libdir option used. use --with-modulesdir instead.])]
170
171
172
173
174
175
)

AC_ARG_WITH(
    localedir,
    AS_HELP_STRING(
	[--with-localedir=DIR],
sikeda's avatar
sikeda committed
176
	[Internationalization catalogues directory @<:@PREFIX/locale@:>@]
177
178
179
180
181
182
183
184
    ),
    [
     localedir="$withval"
    ]
)

AC_ARG_WITH(
    mandir,
185
186
    [],
    [AC_MSG_ERROR([obsolete --with-mandir option used. use --mandir instead.])]
187
188
189
190
191
192
)

AC_ARG_WITH(
    docdir,
    AS_HELP_STRING(
	[--with-docdir=DIR],
sikeda's avatar
sikeda committed
193
	[Documentations]
194
195
196
197
198
199
200
201
    ),
    [
	docdir="$withval"
    ]
)

AC_ARG_WITH(
    sampledir,
202
203
    [],
    [AC_MSG_ERROR([obsolete --with-sampledir option used. samples are now installed with documentation.])]
204
205
206
207
208
209
)

AC_ARG_WITH(
    expldir,
    AS_HELP_STRING(
	[--with-expldir=DIR],
210
	[list data directory @<:@PREFIX/list_data@:>@]
211
212
    ),
    [expldir="$withval"]
213
)
salaun's avatar
salaun committed
214

215
216
217
218
AC_ARG_WITH(
    spooldir,
    AS_HELP_STRING(
	[--with-spooldir=DIR],
219
	[application spool directory @<:@PREFIX/spool@:>@]
220
221
222
    ),
    [spooldir="$withval"]
)
223

224
225
226
227
AC_ARG_WITH(
    initdir,
    AS_HELP_STRING(
	[--with-initdir=DIR],
228
	[install System V init script @<:@SYSCONFDIR/rc.d/init.d@:>@]
229
230
231
232
    )
AS_HELP_STRING(
        [--without-initdir],
        [do not install System V init script]
233
    ),
234
    [test "x$withval" = "xyes" || initdir="$withval"; test "x$withval" = "xno" && initdir=""]
235
)
sympa-authors's avatar
sympa-authors committed
236

237
238
239
240
241
AC_ARG_WITH(
    smrshdir,
    AS_HELP_STRING(
	[--with-smrshdir=DIR],
	[install symbolic links for Sendmail smrsh @<:@SYSCONFDIR/smrsh@:>@]
242
243
244
245
    )
AS_HELP_STRING(
        [--without-smrshdir],
        [do not install symbolic links for Sendmail smrsh]
246
    ),
247
    [test "x$withval" = "xyes" || smrshdir="$withval"; test "x$withval" = "xno" && smrshdir=""]
248
)
249
AM_CONDITIONAL(SMRSH, [test "x$smrshdir" != "x"])
250

251
AC_ARG_WITH(
252
    lockdir,
253
    AS_HELP_STRING(
254
	[--with-lockdir=DIR],
255
	[lock files @<:@LOCALSTATEDIR/lock/subsys@:>@]
256
    ),
257
    [lockdir="$withval"]
258
)
259

260
AC_ARG_WITH(
261
    piddir,
262
    AS_HELP_STRING(
263
	[--with-piddir=DIR],
264
	[.pid files @<:@LOCALSTATEDIR/run@:>@]
265
    ),
266
    [piddir="$withval"]
267
)
268
269
270
271
272

AC_ARG_WITH(
    modulesdir,
    AS_HELP_STRING(
	[--with-modulesdir=DIR],
273
	[Perl modules file installed with Sympa @<:@PREFIX/bin@:>@]
274
275
276
277
278
279
280
281
    ),
    [modulesdir="$withval"]
)

AC_ARG_WITH(
    defaultdir,
    AS_HELP_STRING(
	[--with-defaultdir=DIR],
282
	[default configuration files (scenarios and templates also) @<:@PREFIX/default@:>@]
283
284
285
286
287
288
289
290
    ),
    [defaultdir="$withval"]
)

AC_ARG_WITH(
    scriptdir,
    AS_HELP_STRING(
	[--with-scriptdir=DIR],
291
	[application scripts @<:@PREFIX/bin@:>@]
292
293
294
    ),
    [scriptdir="$withval"]
)
295

sikeda's avatar
sikeda committed
296
297
298
299
300
301
302
303
304
AC_ARG_WITH(
    staticdir,
    AS_HELP_STRING(
	[--with-staticdir=DIR],
	[static data @<:@PREFIX/static_content@:>@]
    ),
    [staticdir="$withval"]
)

305
CONFIG=$confdir/sympa.conf
306
AC_SUBST(CONFIG)
307
WWSCONFIG=$confdir/wwsympa.conf
308
309
310
311
312
AC_SUBST(WWSCONFIG)

AC_PROG_CC
# needed for using per-target flags
AM_PROG_CC_C_O
313
314
AC_PATH_PROGS([SED], [sed gsed])
#AC_PROG_SED
315
AC_PROG_LN_S
salaun's avatar
salaun committed
316

317
318
319
320
321
322
323
324
325
326
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
327
    AC_MSG_CHECKING([user-supplied Perl interpreter])
328
329
330
331
    if test -f "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-existing])
sikeda's avatar
sikeda committed
332
	AC_MSG_ERROR([invalid value $PERL for Perl interpreter])
333
334
335
336
337
    fi
    if test -x "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-executable])
sikeda's avatar
sikeda committed
338
	AC_MSG_ERROR([invalid value $PERL for Perl interpreter])
339
340
341
342
343
344
345
346
347
    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
348

349
350
351
352
353
AC_PATH_PROG(POD2MAN, pod2man)
if test -z "$POD2MAN"; then
    AC_MSG_ERROR([pod2man required])
fi

salaun's avatar
salaun committed
354
USER=sympa
355
356
AC_ARG_WITH(
    [user],
357
    AS_HELP_STRING(
358
	[--with-user=LOGIN],
359
	[set Sympa user name @<:@sympa@:>@]
360
    ),
361
362
    [USER="$withval"]
)
salaun's avatar
salaun committed
363
364
365
AC_SUBST(USER)

GROUP=sympa
366
367
AC_ARG_WITH(
    [group],
368
    AS_HELP_STRING(
369
	[--with-group=LOGIN],
370
	[set Sympa group name @<:@sympa@:>@]
371
    ),
372
373
    [GROUP="$withval"]
)
salaun's avatar
salaun committed
374
375
AC_SUBST(GROUP)

376
SENDMAIL_ALIASES=/etc/mail/sympa_aliases
377
AC_ARG_WITH(
378
    [aliases_file],
379
    AS_HELP_STRING(
380
	[--with-aliases_file=ALIASFILE],
381
	[aliases file to store Sympa mail aliases @<:@/etc/mail/sympa_aliases@:>@]
382
    ),
383
384
    [SENDMAIL_ALIASES="$withval"]
)
385
386
AC_SUBST(SENDMAIL_ALIASES)

387
AC_ARG_WITH(
388
389
390
391
392
393
394
395
396
397
398
399
400
401
    [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],
402
    AS_HELP_STRING(
403
404
	[--with-makemap=FULLPATH],
	[path to Sendmail makemap command @<:@AUTO-DETECT@:>@]
405
    ),
406
    [MAKEMAP="$withval"]
407
)
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
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)
429

430
NEWALIASES=
431
432
AC_ARG_WITH(
    [newaliases],
433
    AS_HELP_STRING(
434
	[--with-newaliases=FULLPATH],
435
	[path to newaliases command @<:@AUTO-DETECT@:>@]
436
    ),
437
438
    [NEWALIASES="$withval"]
)
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
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
457
    AC_PATH_PROG([NEWALIASES], [newaliases], [/usr/bin/newaliases])
458
fi
459
460
AC_SUBST(NEWALIASES)

461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
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)

483
AC_MSG_CHECKING([argument to newaliases command])
484
NEWALIASES_ARG=
485
486
AC_ARG_WITH(
    [newaliases_arg],
487
    AS_HELP_STRING(
488
	[--with-newaliases_arg=ARGS],
489
	[arguments to newaliases command @<:@NONE@:>@]
490
    ),
491
492
    [NEWALIASES_ARG="$withval"]
)
493
AC_SUBST(NEWALIASES_ARG)
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
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)
530

531
POSTMAP=
532
533
AC_ARG_WITH(
    [postmap],
534
    AS_HELP_STRING(
535
	[--with-postmap=FULLPATH],
536
	[path to Postfix postmap command @<:@AUTO-DETECT@:>@]
537
    ),
538
539
    [POSTMAP="$withval"]
)
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
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
558
    AC_PATH_PROG([POSTMAP], [postmap], [/usr/sbin/postmap])
559
fi
560
561
AC_SUBST(POSTMAP)

562
POSTMAP_ARG=
563
AC_ARG_WITH(
564
565
    [postmap_arg], ,
    AC_MSG_ERROR([--with-postmap_arg was deprecated.  Use --with-newaliases_arg.])
566
)
567
568
AC_SUBST(POSTMAP_ARG)

569
570
AC_CONFIG_FILES([
    Makefile
571
572
573
574
575
    default/Makefile
    doc/Makefile
    po/Makefile
    po/sympa/Makefile.in
    po/web_help/Makefile.in
576
    src/Makefile
577
578
    src/bin/Makefile
    src/cgi/Makefile
579
580
    src/etc/Makefile
    src/etc/script/Makefile
581
    src/lib/Makefile
582
583
584
    src/libexec/Makefile
    src/sbin/Makefile
    www/Makefile
585
])
586
AC_OUTPUT