configure.ac 13.3 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.32, 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
51
52
53
54
55
56
57
58
if test "$fhs" = "yes"; then
    # only define custom variables
    initdir=$sysconfdir/rc.d/init.d
    piddir=$localstatedir/run/sympa
    lockdir=$localstatedir/lock/subsys
    modulesdir=$datadir/sympa/lib
    scriptdir=$datadir/sympa/bin
    defaultdir=$datadir/sympa/default
    mailtemplatedir=$defaultdir/mail_tt2
    webtemplatedir=$defaultdir/web_tt2
    execcgidir=$libdir/sympa/cgi
59
    expldir=$localstatedir/lib/sympa/list_data
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
    staticdir=$localstatedir/lib/sympa/static_content
    spooldir=$localstatedir/spool/sympa
    arcdir=$localstatedir/lib/sympa/arc
    bouncedir=$localstatedir/lib/sympa/bounce
    confdir=$sysconfdir
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
    piddir=$prefix
    lockdir=$localstatedir/lock/subsys
    modulesdir=$prefix/bin
    scriptdir=$prefix/bin
    defaultdir=$prefix/default
    mailtemplatedir=$defaultdir/mail_tt2
    webtemplatedir=$defaultdir/web_tt2
    execcgidir=$prefix/bin
    expldir=$prefix/list_data
    spooldir=$prefix/spool
    staticdir=$prefix/static_content
    arcdir=$prefix/arc
    bouncedir=$prefix/bounce
    confdir=/etc
fi
 
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# substitute custom variables
AC_SUBST(initdir)
AC_SUBST(piddir)
AC_SUBST(lockdir)
AC_SUBST(modulesdir)
AC_SUBST(scriptdir)
AC_SUBST(defaultdir)
AC_SUBST(mailtemplatedir)
AC_SUBST(webtemplatedir)
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

# allow user to redefine some of them
119
120
121
122
AC_ARG_WITH(
    confdir,
    AS_HELP_STRING(
	[--with-confdir=DIR],
123
	[sympa main configuration files (sympa.conf and wwsympa.conf) @<:@SYSCONFDIR@:>@]
124
125
    ),
    [
126
	confdir="$withval"
127
128
    ]
)
salaun's avatar
salaun committed
129

130
AC_ARG_WITH(
131
    etcdir,
132
    AS_HELP_STRING(
133
134
	[--with-etcdir=DIR],
	[obsolete option, use --sysconfdir instead]
135
    ),
136
137
138
139
    [
	AC_MSG_WARN([obsolete --with-etcdir option used])
	sysconfdir="$withval"
    ]
140
141
142
143
144
145
146
147
)

AC_ARG_WITH(
    bindir,
    AS_HELP_STRING(
	[--with-bindir=DIR],
	[obsolete option, those binaries are now installed in libexecdir]
    ),
148
    [AC_MSG_WARN([obsolete --with-bindir option used])]
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
)

AC_ARG_WITH(
    sbindir,
    AS_HELP_STRING(
	[--with-sbindir=DIR],
	[obsolete option, use --sbindir instead]
    ),
    [
	AC_MSG_WARN([obsolete --with-sbindir option used])
	sbindir="$withval"
    ]
)

AC_ARG_WITH(
    libexecdir,
    AS_HELP_STRING(
	[--with-libexecdir=DIR],
	[obsolete option, use --libexecdir instead]
    ),
    [
	AC_MSG_WARN([obsolete --with-libexecdir option used])
	libexecdir="$withval"
    ]
)

AC_ARG_WITH(
    cgidir,
    AS_HELP_STRING(
	[--with-cgidir=DIR],
179
	[CGI scripts @<:@LIBDIR/sympa/cgi@:>@]
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
    ),
    [execcgidir="$withval"]
)

AC_ARG_WITH(
    datadir,
    AS_HELP_STRING(
	[--with-datadir=DIR]
	[obsolete option, use --datadir instead]
    ),
    [
	AC_MSG_WARN([obsolete --with-datadir option used])
	datadir="$withval"
    ]
)

AC_ARG_WITH(
    libdir,
    AS_HELP_STRING(
	[--with-libdir=DIR]
	[obsolete option, perl modules are now installed with data]
    ),
    [
	AC_MSG_WARN([obsolete --with-libdir option used])
    ]
)

AC_ARG_WITH(
    localedir,
    AS_HELP_STRING(
	[--with-localedir=DIR],
211
	[Internationalization catalogues directory @<:@LOCALSTATEDIR/locale@:>@]
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
    ),
    [
     localedir="$withval"
    ]
)

AC_ARG_WITH(
    mandir,
    AS_HELP_STRING(
	[--with-mandir=DIR],
	[obsolete option, use --mandir instead]
    ),
    [
     AC_MSG_WARN([obsolete --with-mandir option used])
     mandir="$withval"
     ]
)

AC_ARG_WITH(
    docdir,
    AS_HELP_STRING(
	[--with-docdir=DIR],
234
	[documentations]
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
    ),
    [
	docdir="$withval"
    ]
)

AC_ARG_WITH(
    sampledir,
    AS_HELP_STRING(
	[--with-sampledir=DIR],
	[obsolete option, samples are now installed with documentation]
    ),
    [
	AC_MSG_WARN([obsolete --with-sampledir option used])
    ]
)

AC_ARG_WITH(
    expldir,
    AS_HELP_STRING(
	[--with-expldir=DIR],
256
	[list data directory @<:@PREFIX/list_data@:>@]
257
258
    ),
    [expldir="$withval"]
259
)
salaun's avatar
salaun committed
260

261
262
263
264
AC_ARG_WITH(
    spooldir,
    AS_HELP_STRING(
	[--with-spooldir=DIR],
265
	[application spool directory @<:@PREFIX/spool@:>@]
266
267
268
    ),
    [spooldir="$withval"]
)
269

270
271
272
273
AC_ARG_WITH(
    initdir,
    AS_HELP_STRING(
	[--with-initdir=DIR],
274
	[install System V init script @<:@SYSCONFDIR/rc.d/init.d@:>@]
275
276
277
    ),
    [initdir="$withval"]
)
sympa-authors's avatar
sympa-authors committed
278

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

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

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

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

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

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

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

AC_PROG_CC
# needed for using per-target flags
AM_PROG_CC_C_O
341
342
AC_PATH_PROGS([SED], [sed gsed])
#AC_PROG_SED
343
AC_PROG_LN_S
salaun's avatar
salaun committed
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
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
    AC_MSG_CHECKING([user-supplied perl interpreter])
    if test -f "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-existing])
	AC_MSG_ERROR([invalid value $PERL for perl interpreter])
    fi
    if test -x "$PERL"; then
	:
    else
	AC_MSG_RESULT([non-executable])
	AC_MSG_ERROR([invalid value $PERL for perl interpreter])
    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
376

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

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

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

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

415
AC_ARG_WITH(
416
417
418
419
420
421
422
423
424
425
426
427
428
429
    [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],
430
    AS_HELP_STRING(
431
432
	[--with-makemap=FULLPATH],
	[path to Sendmail makemap command @<:@AUTO-DETECT@:>@]
433
    ),
434
    [MAKEMAP="$withval"]
435
)
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
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)
457

458
NEWALIASES=
459
460
AC_ARG_WITH(
    [newaliases],
461
    AS_HELP_STRING(
462
	[--with-newaliases=FULLPATH],
463
	[path to newaliases command @<:@AUTO-DETECT@:>@]
464
    ),
465
466
    [NEWALIASES="$withval"]
)
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
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
485
    AC_PATH_PROG([NEWALIASES], [newaliases], [/usr/bin/newaliases])
486
fi
487
488
AC_SUBST(NEWALIASES)

489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
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)

511
AC_MSG_CHECKING([argument to newaliases command])
512
NEWALIASES_ARG=
513
514
AC_ARG_WITH(
    [newaliases_arg],
515
    AS_HELP_STRING(
516
	[--with-newaliases_arg=ARGS],
517
	[arguments to newaliases command @<:@NONE@:>@]
518
    ),
519
520
    [NEWALIASES_ARG="$withval"]
)
521
AC_SUBST(NEWALIASES_ARG)
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
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)
558

559
POSTMAP=
560
561
AC_ARG_WITH(
    [postmap],
562
    AS_HELP_STRING(
563
	[--with-postmap=FULLPATH],
564
	[path to Postfix postmap command @<:@AUTO-DETECT@:>@]
565
    ),
566
567
    [POSTMAP="$withval"]
)
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
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
586
    AC_PATH_PROG([POSTMAP], [postmap], [/usr/sbin/postmap])
587
fi
588
589
AC_SUBST(POSTMAP)

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

597
598
599
AC_CONFIG_FILES([
    Makefile
    src/Makefile
600
601
    src/etc/Makefile
    src/etc/script/Makefile
602
    src/etc/script/js/Makefile
603
    src/lib/Makefile
604
605
    soap/Makefile
    doc/Makefile
606
607
    doc/man8/Makefile
    doc/sample/Makefile
608
609
    web_tt2/Makefile
    wwsympa/Makefile
610
    wwsympa/icons/Makefile
611
    mail_tt2/Makefile
612
613
    po/Makefile.in
    po-wwsympa/Makefile.in
614
    sympa.spec
615
])
616
AC_OUTPUT