configure.ac 10.1 KB
Newer Older
1
# configure.in - Top-level configure.in for Sympa
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# RCS Identication ; $Revision$ ; $Date$ 
#
# Sympa - SYsteme de Multi-Postage Automatique
# Copyright (c) 1997, 1998, 1999, 2000, 2001 Comite Reseau des Universites
# Copyright (c) 1997,1998, 1999 Institut Pasteur & Christophe Wolfhugel
#
# 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
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

22
AC_PREREQ(2.59)
23
AC_INIT(sympa, 6.0b.2, sympa-authors@cru.fr)
24
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
25
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
26
AM_PO_SUBDIRS
salaun's avatar
salaun committed
27
28
29

AC_PREFIX_DEFAULT(/home/sympa)

30
31
32
33
34
35
36
37
38
39
40
41
42
## 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
# standard variables
# check current value before re-assigning
if test "$sbindir" = '${exec_prefix}/sbin'; then
   sbindir=$prefix/bin
fi
if test "$libexecdir" = '${exec_prefix}/libexec'; then
   libexecdir=$prefix/bin
fi
43

44
45
46
# custom variables
initdir=/etc/rc.d/init.d
piddir=$prefix
47
localstatedir=/var
48
49
50
lockdir=$localstatedir/lock/subsys
modulesdir=$prefix/bin
scriptdir=$prefix/bin
51
defaultdir=$prefix/default
52
53
54
55
56
57
58
59
60
mailtemplatedir=$defaultdir/mail_tt2
webtemplatedir=$defaultdir/web_tt2
execcgidir=$prefix/bin
expldir=$prefix/expl
spooldir=$prefix/spool
staticdir=$prefix/static_content
arcdir=$prefix/arc
bouncedir=$prefix/bounce
confdir=/etc
61

62
63
64
65
66
67
68
69
70
71
## If installer wants to use the FHS standard, change 
AC_ARG_ENABLE(
	fhs,
	AS_HELP_STRING(
	[--enable-fhs],
	[use standard FHS files and directories locations and naming (default is no)]
	),
	[
	if test $enableval = 'yes';then
		initdir=$sysconfdir/rc.d/init.d
72
		piddir=$localstatedir/run/sympa
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
		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
		expldir=$localstatedir/lib/sympa
		staticdir=$localstatedir/lib/sympa/static_content
		spooldir=$localstatedir/spool/sympa
		arcdir=$localstatedir/lib/sympa/arc
		bouncedir=$localstatedir/lib/sympa/bounce
		confdir=$sysconfdir
	fi
	],
)
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104

# 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)
105
AC_SUBST(localedir)
106
AC_SUBST(confdir)
107
108

# allow user to redefine some of them
109
110
111
112
AC_ARG_WITH(
    confdir,
    AS_HELP_STRING(
	[--with-confdir=DIR],
113
	[sympa main configuration files (sympa.conf and wwsympa.conf) @<:@SYSCONFDIR@:>@]
114
115
    ),
    [
116
	confdir="$withval"
117
118
    ]
)
salaun's avatar
salaun committed
119

120
AC_ARG_WITH(
121
    etcdir,
122
    AS_HELP_STRING(
123
124
	[--with-etcdir=DIR],
	[obsolete option, use --sysconfdir instead]
125
    ),
126
127
128
129
    [
	AC_MSG_WARN([obsolete --with-etcdir option used])
	sysconfdir="$withval"
    ]
130
131
132
133
134
135
136
137
)

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

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],
169
	[CGI scripts @<:@LIBDIR/sympa/cgi@:>@]
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
    ),
    [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],
	[obsolete option, use --localedir instead]
    ),
    [
     AC_MSG_WARN([obsolete --with-localedir option used])
     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],
	[obsolete option, use --docdir instead]
    ),
    [
	AC_MSG_WARN([obsolete --with-docdir option used])
	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],
248
	[list data directory @<:@LOCALSTATEDIR/list_data@:>@]
249
250
    ),
    [expldir="$withval"]
251
)
salaun's avatar
salaun committed
252

253
254
255
256
AC_ARG_WITH(
    spooldir,
    AS_HELP_STRING(
	[--with-spooldir=DIR],
257
	[application spool directory @<:@LOCALSTATEDIR/spool@:>@]
258
259
260
    ),
    [spooldir="$withval"]
)
261

262
263
264
265
AC_ARG_WITH(
    initdir,
    AS_HELP_STRING(
	[--with-initdir=DIR],
266
	[install System V init script @<:@SYSCONFDIR/rc.d/init.d@:>@]
267
268
269
    ),
    [initdir="$withval"]
)
sympa-authors's avatar
sympa-authors committed
270

271
AC_ARG_WITH(
272
    lockdir,
273
    AS_HELP_STRING(
274
	[--with-lockdir=DIR],
275
	[lock files @<:@LOCALSTATEDIR/lock/subsys@:>@]
276
    ),
277
    [lockdir="$withval"]
278
)
279

280
AC_ARG_WITH(
281
    piddir,
282
    AS_HELP_STRING(
283
	[--with-piddir=DIR],
284
	[.pid files @<:@LOCALSTATEDIR/run@:>@]
285
    ),
286
    [piddir="$withval"]
287
)
288
289
290
291
292

AC_ARG_WITH(
    modulesdir,
    AS_HELP_STRING(
	[--with-modulesdir=DIR],
293
	[Perl modules file installed with Sympa @<:@DATADIR/default@:>@]
294
295
296
297
298
299
300
301
    ),
    [modulesdir="$withval"]
)

AC_ARG_WITH(
    defaultdir,
    AS_HELP_STRING(
	[--with-defaultdir=DIR],
302
	[default configuration files (scenarios and templates also) @<:@DATADIR/sympa/default@:>@]
303
304
305
306
307
308
309
310
    ),
    [defaultdir="$withval"]
)

AC_ARG_WITH(
    scriptdir,
    AS_HELP_STRING(
	[--with-scriptdir=DIR],
311
	[application scripts @<:@DATADIR/sympa/bin@:>@]
312
313
314
    ),
    [scriptdir="$withval"]
)
315

316
CONFIG=$confdir/sympa.conf
317
AC_SUBST(CONFIG)
318
WWSCONFIG=$confdir/wwsympa.conf
319
320
321
322
323
AC_SUBST(WWSCONFIG)

AC_PROG_CC
# needed for using per-target flags
AM_PROG_CC_C_O
324
325
AC_PROG_SED
AC_PROG_LN_S
salaun's avatar
salaun committed
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
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
358

359
360
361
362
363
AC_PATH_PROG(POD2MAN, pod2man)
if test -z "$POD2MAN"; then
    AC_MSG_ERROR([pod2man required])
fi

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

GROUP=sympa
376
377
AC_ARG_WITH(
    [group],
378
    AS_HELP_STRING(
379
	[--with-group=LOGIN],
380
	[set sympa group name @<:@sympa@:>@]
381
    ),
382
383
    [GROUP="$withval"]
)
salaun's avatar
salaun committed
384
385
AC_SUBST(GROUP)

386
SENDMAIL_ALIASES=/etc/mail/sympa_aliases
387
388
AC_ARG_WITH(
    [sendmail_aliases],
389
    AS_HELP_STRING(
390
	[--with-sendmail_aliases=ALIASFILE],
391
	[aliases file to store Sympa mail aliases @<:@/etc/mail/sympa_aliases@:>@]
392
    ),
393
394
    [SENDMAIL_ALIASES="$withval"]
)
395
396
AC_SUBST(SENDMAIL_ALIASES)

397
398
399
400
## The postfix virtual file we use. Better use a seperate one for sympa.
## Of course an extra alias file must be generated with proper permissions
## (owner sympa, write access for sympa, no write access for anyone else)
## and declared in main.cf!
401
VIRTUAL_ALIASES=/etc/mail/sympa_virtual
402
403
AC_ARG_WITH(
    [virtual_aliases],
404
    AS_HELP_STRING(
405
	[--with-virtual_aliases=ALIASFILE],
406
	[postfix virtual file to be used by Sympa @<:@/etc/mail/sympa_virtual@:>@]
407
    ),
408
409
    [VIRTUAL_ALIASES="$withval"]
)
410
411
AC_SUBST(VIRTUAL_ALIASES)

412
NEWALIASES=/usr/bin/newaliases
413
414
AC_ARG_WITH(
    [newaliases],
415
    AS_HELP_STRING(
416
	[--with-newaliases=FULLPATH],
417
	[path to newaliases command @<:@/usr/bin/newaliases@:>@]
418
    ),
419
420
    [NEWALIASES="$withval"]
)
421
422
423
AC_SUBST(NEWALIASES)

NEWALIASES_ARG=
424
425
AC_ARG_WITH(
    [newaliases_arg],
426
    AS_HELP_STRING(
427
	[--with-newaliases_arg=ARGS],
428
	[arguments to newaliases command @<:@NONE@:>@]
429
    ),
430
431
    [NEWALIASES_ARG="$withval"]
)
432
433
AC_SUBST(NEWALIASES_ARG)

434
POSTMAP=/usr/sbin/postmap
435
436
AC_ARG_WITH(
    [postmap],
437
    AS_HELP_STRING(
438
	[--with-postmap=FULLPATH],
439
	[path to postfix postmap command @<:@/usr/sbin/postmap@:>@]
440
    ),
441
442
    [POSTMAP="$withval"]
)
443
444
AC_SUBST(POSTMAP)

445
POSTMAP_ARG=${VIRTUAL_ALIASES}
446
447
AC_ARG_WITH(
    [postmap_arg],
448
    AS_HELP_STRING(
449
	[--with-postmap_arg=ARGS],
450
	[set arguments to postfix postmap command @<:@VIRTUAL_ALIASES@:>@]
451
    ),
452
453
    [POSTMAP_ARG="$withval"]
)
454
455
AC_SUBST(POSTMAP_ARG)

456
457
458
AC_CONFIG_FILES([
    Makefile
    src/Makefile
459
460
    src/etc/Makefile
    src/etc/script/Makefile
461
    src/lib/Makefile
462
463
    soap/Makefile
    doc/Makefile
464
465
    doc/man8/Makefile
    doc/sample/Makefile
466
467
    web_tt2/Makefile
    wwsympa/Makefile
468
    wwsympa/icons/Makefile
469
    mail_tt2/Makefile
470
471
    po/Makefile.in
    po-wwsympa/Makefile.in
472
    sympa.spec
473
])
474
AC_OUTPUT