forked from proftpd/proftpd
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
4298 lines (3823 loc) · 119 KB
/
configure.in
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
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
dnl ProFTPD - FTP server daemon
dnl Copyright (c) 1997, 1998 Public Flood Software
dnl Copyright (c) 1999, 2000 MacGyver aka Habeeb J. Dihu <[email protected]>
dnl Copyright (c) 2001-2021 The ProFTPD Project team
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software
dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
dnl
dnl Process this file with autoconf to produce a configure script.
AC_INIT(include/conf.h)
ac_core_modules="mod_core.o mod_xfer.o mod_rlimit.o mod_auth_unix.o mod_auth_file.o mod_auth.o mod_ls.o mod_log.o mod_site.o mod_delay.o mod_facts.o"
ac_build_core_modules="modules/mod_core.o modules/mod_xfer.o modules/mod_rlimit.o modules/mod_auth_unix.o modules/mod_auth_file.o modules/mod_auth.o modules/mod_ls.o modules/mod_log.o modules/mod_site.o modules/mod_delay.o modules/mod_facts.o"
dnl Get the OS type
AC_CONFIG_AUX_DIR(./)
AC_CANONICAL_SYSTEM
ostype=`echo $build_os | sed 's/\..*$//g' | sed 's/-.*//g' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
osrel=`echo $build_os | sed 's/-.*//g' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ | tr '.' '_'`
OSTYPE="-D$ostype"
OSREL="-D$osrel"
platform="\"$ostype ($osrel)\""
if test "$OSTYPE" = "$OSREL" ; then
OSTYPE=""
platform="\"$ostype\""
fi
BUILD_OPTS=`echo "$ac_configure_args"`
AC_DEFINE_UNQUOTED(PR_BUILD_OPTS, "$BUILD_OPTS", [Define the build options])
AC_DEFINE_UNQUOTED(PR_PLATFORM, $platform, [Define the build platform])
AC_SUBST(BUILD_OPTS)
AC_SUBST(OSREL)
AC_SUBST(OSTYPE)
dnl MacOSX requires -traditional-cpp; autodetecting it isn't impossible
dnl AFAIK, since assuming the need for -traditional-cpp breaks the build
dnl on other OSes. -jwm, 30 Jan 2001
if test "$OSTYPE" = "-DRHAPSODY5"; then
CFLAGS="$CFLAGS -traditional-cpp -D__OT__"
fi
dnl This needs to happen here, prior to the creation of the libtool script,
dnl so that that script uses the correct shell-isms
AC_SUBST(CONFIG_SHELL)
dnl AC_PROG_LIBTOOL relies on the top_builddir variable
top_builddir=.
LT_INIT([dlopen])
dnl If LT_INIT provides an empty value for CONFIG_SHELL for some reason (it
dnl happens on my MacOSX 10.5 machine, for example), have a fallback.
if test x"$CONFIG_SHELL" = x; then
CONFIG_SHELL="$SHELL"
fi
dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_MAKE_SET
AC_PROG_INSTALL
AC_PROG_LIBTOOL
dnl This test must come as early as possible after the compiler
dnl configuration tests, because the choice of the file model can (in
dnl principle) affect whether functions and headers are available,
dnl whether they work, etc.
AC_SYS_LARGEFILE
# The native HP-UX 10 compiler needs -Ae to enable Extended ANSI compliance
# (-Ae is the default in the native compiler under HP-UX 11).
if test $ac_cv_prog_gcc = no -a "$OSTYPE" = "-DHPUX10"; then
CFLAGS="$CFLAGS -Ae"
fi
LDFLAGS="-Wl,-L\$(top_srcdir)/lib,-L\$(top_builddir)/lib $LDFLAGS"
# AIX has issues with the -rdynamic linker flag. How many different AIX
# versions should we support here?
if test $ac_cv_prog_gcc = yes && test "$OSTYPE" != "-DAIX7"; then
dnl Make sure to use the -rdynamic linker flag, for stacktraces
LDFLAGS="$LDFLAGS -rdynamic"
fi
# Record the current CPPFLAGS, LDFLAGS, and LIBS here
ac_orig_cppflags="$CPPFLAGS"
ac_orig_ldflags="$LDFLAGS"
ac_orig_libs="$LIBS"
if test $ac_cv_prog_gcc = yes; then
if test x"$CFLAGS" = "x-g -O2"; then
fullCFLAGS="-O2"
else
fullCFLAGS="$CFLAGS"
fi
dnl Compilation tests
dnl test for -malign-jumps=2 -malign-loops=2 -malign-functions=2
if echo $ac_cv_build_cpu | egrep "^i[[34567]]86$" > /dev/null 2>&1; then
AC_MSG_CHECKING([whether the C compiler accepts -malign-jumps -malign-loops -malign-functions])
CFLAGS="-malign-jumps=2 -malign-loops=2 -malign-functions=2"
AC_TRY_COMPILE(,,
AC_MSG_RESULT(yes); fullCFLAGS="$fullCFLAGS $CFLAGS",
AC_MSG_RESULT(no))
fi
dnl test for -Wall
AC_MSG_CHECKING([whether the C compiler accepts -Wall])
CFLAGS="-Wall"
AC_TRY_COMPILE(,,
AC_MSG_RESULT(yes); fullCFLAGS="$fullCFLAGS $CFLAGS",
AC_MSG_RESULT(no))
dnl test for -fno-omit-frame-pointer
AC_MSG_CHECKING([whether the C compiler accepts -fno-omit-frame-pointer])
CFLAGS="-fno-omit-frame-pointer"
AC_TRY_COMPILE(,,
AC_MSG_RESULT(yes); fullCFLAGS="$fullCFLAGS $CFLAGS",
AC_MSG_RESULT(no))
dnl test for -fno-strict-aliasing
AC_MSG_CHECKING([whether the C compiler accepts -fno-strict-aliasing])
CFLAGS="-fno-strict-aliasing"
AC_TRY_COMPILE(,,
AC_MSG_RESULT(yes); fullCFLAGS="$fullCFLAGS $CFLAGS",
AC_MSG_RESULT(no))
CFLAGS="-g2 $fullCFLAGS"
fi
dnl We substitute these in the man page templates.
if test x$exec_prefix = xNONE ; then
exec_prefix=$prefix
fi
if test x$prefix = xNONE ; then
prefix=/usr/local
bindir=/usr/local/bin
datadir=/usr/local/share
libexecdir=/usr/local/libexec
sbindir=/usr/local/sbin
fi
BINDIR=`eval echo $bindir`
AC_SUBST(BINDIR)
DATADIR=`eval echo $datadir`
AC_SUBST(DATADIR)
INCLUDEDIR=`eval echo $includedir`
AC_SUBST(INCLUDEDIR)
LIBEXECDIR=`eval echo $libexecdir`
AC_SUBST(LIBEXECDIR)
LOCALSTATEDIR=`eval echo $localstatedir`
AC_SUBST(LOCALSTATEDIR)
RUNSTATEDIR=`eval echo $runstatedir`
AC_SUBST(RUNSTATEDIR)
PREFIX=`eval echo $prefix`
AC_SUBST(PREFIX)
SBINDIR=`eval echo $sbindir`
AC_SUBST(SBINDIR)
SYSCONFDIR=`eval echo $sysconfdir`
AC_SUBST(SYSCONFDIR)
LIB_DEPS="\"\""
AC_ARG_VAR(LIBS, [linker flags, e.g. -l<lib>.{a,so} if you have nonstandard libraries to link])
dnl configure command line options...
dnl --with options.
dnl ProFTPD comes bundled with GNU's implementation of getopt, to be used
dnl in case the host system doesn't have getopt. However, this causes
dnl problems for certain builds of proftpd, e.g. ProFTPD and MySQL (which
dnl itself similarly bundles a getopt implementation). Thus, we need to
dnl support/handle --without-getopt, to disable use of ProFTPD's getopt.
dnl I don't know if MySQL supports any similar option.
LIB_OBJS="pr_fnmatch.o sstrncpy.o strsep.o vsnprintf.o glibc-glob.o glibc-hstrerror.o glibc-mkstemp.o pr-syslog.o pwgrent.o hanson-tpl.o ccan-json.o openbsd-blowfish.o openbsd-bcrypt.o"
AC_ARG_WITH(getopt,
[AC_HELP_STRING(
[--without-getopt],
[prevent proftpd from using its bundled getopt implementation. This is done automatically if the host supports getopt, but may need to be explicitly used when combining proftpd with other applications, such as MySQL])
],
[
if test "$withval" != "no" ; then
AC_CHECK_FUNCS(getopt,
[AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(getopt_long)
AC_DEFINE(PR_USE_SYSTEM_GETOPT, 1,
[Define if using system getopt support])],
[LIB_OBJS="$LIB_OBJS getopt.o getopt1.o"]
)
fi
],
[
AC_CHECK_FUNCS(getopt,
[AC_CHECK_HEADERS(getopt.h)
AC_CHECK_FUNCS(getopt_long)
AC_DEFINE(PR_USE_SYSTEM_GETOPT, 1,
[Define if using system getopt support])],
[LIB_OBJS="$LIB_OBJS getopt.o getopt1.o"]
)
])
dnl Lastlog support
AC_ARG_WITH(lastlog,
[AC_HELP_STRING(
[--with-lastlog=PATH],
[specify lastlog location (Default: /var/adm/lastlog)],
)],
[
if test "x$withval" = "xno" ; then
# nothing to do
foo=bar
elif test -n "$withval" ; then
AC_DEFINE(PR_USE_LASTLOG, 1, [Define if enabling lastlog support.])
AC_CHECK_HEADERS(lastlog.h paths.h)
if test "x${withval}" != "xyes" ; then
pr_lastlog_path="$withval"
else
dnl Try to determine the correct lastlog location (be it file or
dnl directory) automagically.
AC_MSG_CHECKING([for LASTLOG_FILE])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <utmp.h>
#ifdef HAVE_LASTLOG_H
# include <lastlog.h>
#endif
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
#ifdef HAVE_LOGIN_H
# include <login.h>
#endif
],
[
char *lastlog = LASTLOG_FILE;
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
AC_MSG_CHECKING([for _PATH_LASTLOG])
AC_TRY_COMPILE([
#include <sys/types.h>
#include <utmp.h>
#ifdef HAVE_LASTLOG_H
# include <lastlog.h>
#endif
#ifdef HAVE_PATHS_H
# include <paths.h>
#endif
],
[
char *lastlog = _PATH_LASTLOG;
],
[
AC_MSG_RESULT(yes)
],
[
AC_MSG_RESULT(no)
found_lastlog_path=no
])
])
if test -z "$pr_lastlog_path" ; then
if test x"$found_lastlog_path" = x"no" ; then
for f in /var/log/lastlog /var/adm/lastlog /usr/adm/lastlog /etc/security/lastlog ; do
AC_MSG_CHECKING([for $f])
if (test -d "$f" || test -f "$f") ; then
pr_lastlog_path=$f
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
fi
done
if test -z "$pr_lastlog_path" ; then
AC_MSG_WARN([** Cannot find lastlog **])
fi
fi
fi
fi
if test -n "$pr_lastlog_path" ; then
AC_DEFINE_UNQUOTED(PR_LASTLOG_PATH, "`eval echo "$pr_lastlog_path"`", [Define the lastlog path])
fi
fi
])
dnl Modules...'nuff said.
AC_ARG_WITH(includes,
[AC_HELP_STRING(
[--with-includes=LIST],
[add additional include paths to proftpd. LIST is a colon-separated list of include paths to add e.g. --with-includes=/some/mysql/include:/my/include])
],
[
if test x"$withval" != x; then
if test x"$withval" = xyes; then
AC_MSG_ERROR([--with-includes parameter missing required colon-separated list of include paths])
fi
if test x"$withval" != xno; then
ac_addl_includes=`echo "$withval" | sed -e 's/:/ /g'` ;
for ainclude in $ac_addl_includes; do
if test x"$ac_build_addl_includes" = x ; then
ac_build_addl_includes="-I$ainclude"
else
ac_build_addl_includes="-I$ainclude $ac_build_addl_includes"
fi
done
CPPFLAGS="$CPPFLAGS $ac_build_addl_includes"
fi
fi
])
AC_ARG_WITH(libraries,
[AC_HELP_STRING(
[--with-libraries=LIST],
[add additional library paths to proftpd. LIST is a colon-separated list of library paths to add e.g. --with-libraries=/some/mysql/libdir:/my/libs])
],
[
if test x"$withval" != x; then
if test x"$withval" = xyes; then
AC_MSG_ERROR([--with-libraries parameter missing required colon-separated list of library paths])
fi
if test x"$withval" != xno; then
ac_addl_libdirs=`echo "$withval" | sed -e 's/:/ /g'` ;
for alibdir in $ac_addl_libdirs; do
if test x"$ac_build_addl_libdirs" = x ; then
ac_build_addl_libdirs="-L$alibdir"
else
ac_build_addl_libdirs="-L$alibdir $ac_build_addl_libdirs"
fi
done
LDFLAGS="$LDFLAGS $ac_build_addl_libdirs"
fi
fi
])
dnl This variable is used to impose a certain ordering between mod_ifsession
dnl and mod_cap, per Bug#3576
ifsession_requested="false"
AC_ARG_WITH(modules,
[AC_HELP_STRING(
[--with-modules=LIST],
[add additional modules to proftpd. LIST is a colon-separated list of modules to add e.g. --with-modules=mod_readme:mod_ifsession])
],
[
if test x"$withval" != x; then
if test x"$withval" = xyes; then
AC_MSG_ERROR([--with-modules parameter missing required colon-separated list of modules])
fi
if test x"$withval" != xno; then
modules_list=`echo "$withval" | sed -e 's/:/ /g'`;
for amodule in $modules_list; do
if test x"$amodule" = xmod_dso ; then
AC_MSG_ERROR([use --enable-dso instead of --with-modules=mod_dso for DSO support])
fi
if test x"$amodule" = xmod_ifsession ; then
ifsession_requested="true"
fi
if test x"$amodule" = xmod_lang ; then
AC_MSG_ERROR([use --enable-nls instead of --with-modules=mod_lang for NLS/UTF8 support])
fi
if test x"$amodule" = xmod_memcache ; then
AC_MSG_ERROR([use --enable-memcache instead of --with-modules=mod_memcache for Memcache support])
fi
if test x"$amodule" = xmod_redis ; then
AC_MSG_ERROR([use --enable-redis instead of --with-modules=mod_redis for Redis support])
fi
done
# Trim off any leading/trailing colons, and collapse double-colons
# into single colons; these are common typos.
ac_static_modules=`echo "$withval" | sed 's/::/:/g' | sed 's/^://' | sed 's/:$//' | sed -e 's/:/.o /g'`.o ;
for amodule in $ac_static_modules; do
ac_build_static_modules="modules/$amodule $ac_build_static_modules"
done
dnl Make sure that mod_ifsession, if present in the list, appears at
dnl the end.
if test x"$ifsession_requested" = xtrue; then
ac_static_modules=`echo "$ac_static_modules" | sed -e 's/mod_ifsession\.o//g'`
ac_static_modules="$ac_static_modules mod_ifsession.o"
ac_build_static_modules=`echo "$ac_build_static_modules" | sed -e 's/modules\/mod_ifsession\.o//g'`
ac_build_static_modules="$ac_build_static_modules modules/mod_ifsession.o";
fi
fi
fi
])
dnl Memcache
if test x"$enable_memcache" = xyes; then
AC_CHECK_LIB(memcached, memcached_create)
AC_CHECK_LIB(memcachedutil, libmemcached_util_ping)
# Yes, we DO want mod_memcache AFTER the other modules in the static
# module list. Otherwise, the module load ordering will be such that
# memcache support will not work as expected
ac_static_modules="$ac_static_modules mod_memcache.o"
ac_build_static_modules="$ac_build_static_modules modules/mod_memcache.o"
fi
dnl Redis
if test x"$enable_redis" = xyes; then
AC_CHECK_LIB(hiredis, redisConnect)
# Yes, we DO want mod_redis AFTER the other modules in the static
# module list. Otherwise, the module load ordering will be such that
# Redis support will not work as expected.
ac_static_modules="$ac_static_modules mod_redis.o"
ac_build_static_modules="$ac_build_static_modules modules/mod_redis.o"
fi
dnl List of modules which are not allowed to be built as DSOs
ac_unshareable_modules="mod_auth mod_rlimit mod_auth_unix mod_core mod_dso mod_ls mod_xfer mod_log mod_site mod_cap mod_ctrls mod_memcache mod_redis"
AC_ARG_WITH(shared,
[AC_HELP_STRING(
[--with-shared=LIST],
[build DSO modules for proftpd. LIST is a colon-separated list of modules to build as DSOs e.g. --with-shared=mod_rewrite:mod_ifsession])
],
[
if test x"$withval" != x; then
if test x"$withval" = xyes; then
AC_MSG_ERROR([--with-shared parameter missing required colon-separated list of modules])
fi
if test x"$withval" != xno; then
# Trim off any leading/trailing colons, and collapse double-colons
# into single colons; these are common typos.
shared_modules=`echo "$withval" | sed 's/::/:/g'| sed 's/^://' | sed 's/:$//' | sed -e 's/:/ /g'`;
ac_shared_modules=`echo "$withval" | sed 's/::/:/g'| sed 's/^://' | sed 's/:$//' | sed -e 's/:/.la /g'`.la;
# First double-check that the given list does not contain any
# unshareable modules
for amodule in $pr_shared_modules; do
for smodule in $ac_unshareable_modules; do
if test x"$amodule" = x"$smodule"; then
AC_MSG_ERROR([cannot build $amodule as a shared module])
fi
done
done
for amodule in $ac_shared_modules; do
ac_build_shared_modules="modules/$amodule $ac_build_shared_modules"
done
PR_CHECK_CC_OPT(Werror=implicit-function-declaration)
fi
fi
])
dnl Configuration location of mysql_config
my_config="mysql_config"
AC_ARG_WITH(mysql-config,
[AC_HELP_STRING(
[--with-mysql-config=PATH],
[configure location of the MySQL mysql_config script (default=mysql_config)])
],
[
if test x"$withval" != x; then
my_config=`echo "$withval"`
if test -z "$my_config"; then
my_config="no"
elif test x"$my_config" = xno; then
# do nothing
foo=bar
elif test x"$my_config" = xyes; then
# Use the default
my_config="mysql_config"
elif test -x "$my_config"; then
# do nothing
foo=bar
else
AC_MSG_ERROR([mysql_config path $my_config is not executable])
fi
else
my_config="no"
fi
])
dnl Configuration location of openssl cmdline
openssl_cmdline="openssl"
AC_ARG_WITH(openssl-cmdline,
[AC_HELP_STRING(
[--with-openssl-cmdline=PATH],
[configure location of the openssl(1) command-line tool (default=openssl)])
],
[
if test x"$withval" != x; then
openssl_cmdline=`echo "$withval"`
if test -z "$openssl_cmdline"; then
openssl_cmdline="no"
elif test x"$openssl_cmdline" = xno; then
# do nothing
foo=bar
elif test x"$openssl_cmdline" = xyes; then
# Use the default
openssl_cmdline="openssl"
elif test -x "$openssl_cmdline"; then
# do nothing
foo=bar
else
AC_MSG_ERROR([openssl path $openssl_cmdline is not executable])
fi
else
openssl_cmdline="no"
fi
])
dnl Configuration location of pg_config
pg_config="pg_config"
AC_ARG_WITH(postgres-config,
[AC_HELP_STRING(
[--with-postgres-config=PATH],
[configure location of the Postgres pg_config script (default=pg_config)])
],
[
if test x"$withval" != x; then
pg_config=`echo "$withval"`
if test -z "$pg_config"; then
pg_config="no"
elif test x"$pg_config" = xno; then
# do nothing
foo=bar
elif test x"$pg_config" = xyes; then
# Use the default
pg_config="pg_config"
elif test -x "$pg_config"; then
# do nothing
foo=bar
else
AC_MSG_ERROR([pg_config path $pg_config is not executable])
fi
else
pg_config="no"
fi
])
dnl Configurable location of the pkgconfig file
pkgconfigdir=NONE
AC_ARG_WITH(pkgconfig,
[AC_HELP_STRING(
[--with-pkgconfig=PATH],
[configure directory that will contain the proftpd.pc pkgconfig file (default=lib/pkgconfig)])
],
[
if test x"$withval" != x; then
if test x"$withval" = xyes; then
AC_MSG_ERROR([--with-pkgconfig parameter missing required directory path])
fi
if test x"$withval" != xno; then
pkgconfigdir=`echo "$withval"`
fi
fi
])
dnl --enable/--disable options.
AC_ARG_ENABLE(auth-file,
[AC_HELP_STRING(
[--disable-auth-file],
[omit mod_auth_file from core modules])
],
[
if test "$enableval" = "no"; then
ac_core_modules=`echo "$ac_core_modules" | sed -e 's/mod_auth_file\.o//'`
ac_build_core_modules=`echo "$ac_build_core_modules" | sed -e 's/modules\/mod_auth_file\.o//'`
fi
])
dnl Auto-detection of shadow passwords.
AC_ARG_ENABLE(autoshadow,
[AC_HELP_STRING(
[--enable-autoshadow],
[enable run-time auto-detection of shadowed passwords (requires shadow)])
],
[
dnl AIX does not have shadow file/library support. Try to prevent a
dnl bad build if the admin, configuring on an AIX box, uses this option.
if test "$enableval" = "yes" && test "$OSTYPE" = "-DAIX4"; then
AC_MSG_WARN(AIX does not support traditional shadowed passwords)
enableval="no"
fi
if test "$enableval" != "no" ; then
AC_DEFINE(PR_USE_SHADOW, 1, [Define if using /etc/shadow files.])
AC_DEFINE(PR_USE_AUTO_SHADOW, 1,
[Define if auto-detection of shadow passwords is wanted.])
force_shadow="yes"
fi ])
dnl PAM support.
AC_ARG_ENABLE(auth-pam,
[AC_HELP_STRING(
[--enable-auth-pam],
[enable PAM support (default=auto)])
],
[
if test "$enableval" = "no"; then
if test `echo $ac_static_modules | grep -c mod_auth_pam` != "0"; then
AC_MSG_ERROR([You cannot run configure with --disable-auth-pam and include mod_auth_pam in --with-modules at the same time])
fi
if test `echo $ac_shared_modules | grep -c mod_auth_pam` != "0"; then
AC_MSG_ERROR([You cannot run configure with --disable-auth-pam and include mod_auth_pam in --with-shared at the same time])
fi
fi
])
dnl Optional workaround for broken getaddrinfo on some systems (e.g. HP-UX 11.x)
AC_ARG_ENABLE(builtin-getaddrinfo,
[AC_HELP_STRING(
[--enable-builtin-getaddrinfo],
[force use of builtin getaddrinfo (default=no)])
],
[
if test x"$enableval" = xyes; then
AC_DEFINE(PR_USE_GETADDRINFO, 1, [Define if using builtin getaddrinfo()])
fi
])
dnl Since getaddrinfo() is broken on HP-UX 11.x, we automatically use the
dnl builtin version.
if test "$OSTYPE" = "-DHPUX11"; then
AC_MSG_WARN([HP-UX 11 has broken getaddrinfo(), using builtin version])
AC_DEFINE(PR_USE_GETADDRINFO, 1, [Define if using builtin getaddrinfo()])
fi
dnl Workaround for broken getnameinfo on some systems
AC_ARG_ENABLE(builtin-getnameinfo,
[AC_HELP_STRING(
[--enable-builtin-getnameinfo],
[force use of builtin getnameinfo (default=no)])
],
[
if test x"$enableval" = xyes; then
AC_DEFINE(PR_USE_GETNAMEINFO, 1, [Define if using builtin getnameinfo()])
fi
])
dnl Capabilities support
AC_ARG_ENABLE(cap,
[AC_HELP_STRING(
[--enable-cap],
[enable POSIX.1e capabilities (default=yes on Linux)])
])
dnl Controls support
AC_ARG_ENABLE(ctrls,
[AC_HELP_STRING(
[--enable-ctrls],
[enable proftpd controls via ftpdctl (default=no)])
],
[ if test x"$enableval" = xyes ; then
AC_DEFINE(PR_USE_CTRLS, 1, [Define if using controls support.])
fi
])
dnl POSIX ACL support
AC_ARG_ENABLE(facl,
[AC_HELP_STRING(
[--enable-facl],
[enable support for POSIX ACLs])
])
dnl Curses/ncurses support
AC_ARG_ENABLE(curses,
[AC_HELP_STRING(
[--disable-curses],
[disable use of curses (default=no)])
])
dnl DSO support
AC_ARG_ENABLE(dso,
[AC_HELP_STRING(
[--enable-dso],
[add mod_dso to core modules])
],
[
if test x"$enableval" = x"yes"; then
ac_core_modules="$ac_core_modules mod_dso.o"
ac_build_core_modules="$ac_build_core_modules modules/mod_dso.o"
MAIN_LDFLAGS="-L\$(top_srcdir)/lib/libltdl -dlopen self -export-dynamic"
MAIN_LIBS="$MAIN_LIBS \$(LIBLTDL)"
MODULE_LDFLAGS="-avoid-version -export-dynamic -module"
INSTALL_DEPS="install-libltdl"
LIB_DEPS="libltdl"
MODULE_DEPS="libltdl"
AC_DEFINE(PR_USE_DSO, 1, [Define if using DSO support.])
dnl Run configure scripts in subdirectories
LT_CONFIG_LTDL_DIR([lib/libltdl])
LTDL_INIT([convenience])
dnl Even though this macro is deprecated, we need to use it to
dnl specifically tell ltdl that it is NOT to use any system directories,
dnl and ONLY to use this bundled location.
LTDL_CONVENIENCE([lib/libltdl])
fi
])
dnl ident (RFC1413) support
AC_ARG_ENABLE(ident,
[AC_HELP_STRING(
[--enable-ident],
[enable use of ident (RFC1413) lookups (default=no)])
])
dnl Memcache support
AC_ARG_ENABLE(memcache,
[AC_HELP_STRING(
[--enable-memcache],
[enable support for memcache (default=no)])
],
[ if test x"$enableval" = xyes ; then
AC_DEFINE(PR_USE_MEMCACHE, 1, [Define if using Memcache support.])
fi
])
dnl NLS support
ENABLE_NLS="\"\""
AC_ARG_ENABLE(nls,
[AC_HELP_STRING(
[--enable-nls],
[enable Native Language Support (NLS) (default=no)])
],
[ if test x"$enableval" = x"yes" ; then
dnl The libintl library is only needed on non-GNU systems. If it
dnl is not installed, and the admin enables NLS support, then we
dnl should abort.
AC_CHECK_LIB(intl, bindtextdomain,
[ac_build_addl_libs="-lintl $ac_build_addl_libs" UTILS_LIBS="-lintl"
AC_DEFINE(HAVE_LIBINTL, 1, [Define if libintl is present.])
AC_DEFINE(PR_USE_NLS, 1, [Define if using NLS support.])
ENABLE_NLS="1"
],
[AC_CHECK_LIB(c, bindtextdomain,
[AC_DEFINE(PR_USE_NLS, 1, [Define if using NLS support.])
ENABLE_NLS="1"
],
[AC_MSG_ERROR([libintl support, required for NLS, not present -- aborting])]
])
)
dnl Similarly, the libiconv library is only needed on some non-GNU
dnl systems. Note that some systems redefine the iconv_open function
dnl to something else (Bug#3682), e.g. libiconv_open.
AC_CHECK_LIB(iconv, iconv_open,
[LIBS="$LIBS -liconv"
AC_DEFINE(HAVE_LIBICONV, 1, [Define if libiconv is present.])
AC_DEFINE(PR_USE_NLS, 1, [Define if using NLS support.])
ENABLE_NLS="1"
],
[AC_CHECK_LIB(iconv, libiconv_open,
[LIBS="$LIBS -liconv"
AC_DEFINE(HAVE_LIBICONV, 1, [Define if libiconv is present.])
AC_DEFINE(PR_USE_NLS, 1, [Define if using NLS support.])
ENABLE_NLS="1"
],
[AC_CHECK_LIB(c, iconv_open,
[AC_DEFINE(PR_USE_NLS, 1, [Define if using NLS support.])
ENABLE_NLS="1"
],
[AC_MSG_ERROR([libiconv support, required for NLS, not present -- aborting])]
])
])
)
fi
])
AC_ARG_ENABLE(nonblocking-log-open,
[AC_HELP_STRING(
[--disable-nonblocking-log-open],
[disable use of nonblocking open of log files (default=no)])
])
AC_ARG_ENABLE(ncurses,
[AC_HELP_STRING(
[--disable-ncurses],
[disable use of ncurses (default=no)])
])
AC_ARG_ENABLE(openssl-api-compat,
[AC_HELP_STRING(
[--disable-openssl-api-compat],
[disable defining OpenSSL API compatibility (default=no)])
])
AC_ARG_ENABLE(pcre,
[AC_HELP_STRING(
[--enable-pcre],
[enable use of PCRE for POSIX regular expressions rather than the system library (default=no)],
)],
[
if test x"$enableval" = xyes ; then
AC_DEFINE(PR_USE_PCRE, 1, [Define if using PCRE support.])
ac_build_addl_libs="$ac_build_addl_libs -lpcreposix -lpcre"
# Check for other PCRE-specific functionality here
saved_ldflags="$LDFLAGS"
saved_libs="$LIBS"
saved_cppflags="$CPPFLAGS"
# fiddle with CPPFLAGS, LDFLAGS
CPPFLAGS="$CPPFLAGS $ac_build_addl_includes"
LDFLAGS="$LDFLAGS $ac_build_addl_libdirs"
LIBS="$LIBS -lpcre -lpcreposix"
AC_MSG_CHECKING([for PCRE's pcre_free_study])
AC_TRY_LINK(
[ #ifdef HAVE_STDDEF_H
# include <stddef.h>
#endif
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <pcre.h>
],
[
pcre_extra *extra = NULL;
pcre_free_study(extra);
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_PCRE_PCRE_FREE_STUDY, 1, [Define if you have PCRE's pcre_free_study])
],
[
AC_MSG_RESULT(no)
]
)
# restore CPPFLAGS, LDFLAGS, LIBS
CPPFLAGS="$saved_cppflags"
LDFLAGS="$saved_ldflags"
LIBS="$saved_libs"
fi
])
dnl Redis support
AC_ARG_ENABLE(redis,
[AC_HELP_STRING(
[--enable-redis],
[enable support for Redis (default=no)])
],
[ if test x"$enableval" = xyes ; then
AC_CHECK_HEADER(hiredis/hiredis.h,
[AC_DEFINE(HAVE_HIREDIS_HIREDIS_H, 1, [Define if hiredis.h is present.])
AC_DEFINE(PR_USE_REDIS, 1, [Define if using Redis support.])
])
# Check for the redisReconnect() function in Hiredis; earlier versions
# did not have this.
saved_ldflags="$LDFLAGS"
saved_libs="$LIBS"
saved_cppflags="$CPPFLAGS"
# fiddle with CPPFLAGS, LDFLAGS
CPPFLAGS="$CPPFLAGS $ac_build_addl_includes"
LDFLAGS="$LDFLAGS $ac_build_addl_libdirs"
LIBS="$LIBS -lhiredis"
AC_MSG_CHECKING([for Hiredis' redisReconnect])
AC_TRY_LINK(
[
#ifdef HAVE_STDLIB_H
# include <stdlib.h>
#endif
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
#include <hiredis/hiredis.h>
],
[
(void) redisReconnect(NULL);
],
[
AC_MSG_RESULT(yes)
AC_DEFINE(HAVE_HIREDIS_REDISRECONNECT, 1, [Define if you have Hiredis' redisReconnect])
],
[
AC_MSG_RESULT(no)
]
)
# restore CPPFLAGS, LDFLAGS, LIBS
CPPFLAGS="$saved_cppflags"
LDFLAGS="$saved_ldflags"
LIBS="$saved_libs"
fi
])
dnl Workaround for broken setpassent on FreeBSD.
AC_ARG_ENABLE(force-setpassent,
[AC_HELP_STRING(
[--enable-force-setpassent],
[force use of setpassent (default=no on FreeBSD)])
])
dnl IPv6 support.
AC_ARG_ENABLE(ipv6,
[AC_HELP_STRING(
[--disable-ipv6],
[disable IPv6 support (default=no)])
])
dnl OpenSSL support
pr_use_openssl=""
AC_ARG_ENABLE(openssl,
[AC_HELP_STRING(
[--enable-openssl],
[enable OpenSSL support (default=no)])
],
[ if test x"$enableval" = xno ; then
pr_use_openssl="no"
elif test x"$enableval" = xyes ; then
pr_use_openssl="yes"
fi
])
dnl Sodium support
pr_use_sodium=""
AC_ARG_ENABLE(sodium,
[AC_HELP_STRING(
[--enable-sodium],
[enable Sodium support (default=auto)])
],
[ if test x"$enableval" = xno ; then
pr_use_sodium="no"
fi
])
dnl Sendfile support.
AC_ARG_ENABLE(sendfile,
[AC_HELP_STRING(
[--disable-sendfile],
[disable sendfile support (default=no)])
])