-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
110 lines (96 loc) · 3.1 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
AC_INIT()
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
AC_AIX
AC_PROG_INSTALL
AC_PREFIX_DEFAULT(/usr)
LIBS=""
AC_CHECK_LIB(c, getusershell, result=yes, result=no)
if test "$result" = "yes"; then
AC_DEFINE(HAVE_GETUSERSHELL)
fi
AC_CHECK_LIB(c, inet_ntoa, result=yes, result=no)
if test "$result" = "no"; then
AC_CHECK_LIB(nsl, inet_ntoa, result=yes, result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lnsl"
fi
fi
AC_CHECK_LIB(socket, socket, result=yes, result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lsocket"
else
AC_CHECK_LIB(socket, connect, result=yes, result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lsocket"
fi
fi
AC_CHECK_LIB(crypt, crypt, result=yes, result=no)
if test "$result" = "yes"; then
LIBS="$LIBS -lcrypt"
fi
AC_HEADER_DIRENT
AC_CHECK_HEADERS(paths.h)
AC_CHECK_HEADERS(netinet/in.h)
AC_CHECK_HEADERS(sys/time.h)
AC_CHECK_HEADERS(time.h)
AC_CHECK_HEADERS(sys/types.h)
AC_CHECK_HEADERS(sys/stat.h)
AC_CHECK_HEADERS(sys/socket.h)
AC_CHECK_HEADERS(asm/socket.h)
AC_CHECK_HEADERS(wait.h)
AC_CHECK_HEADERS(sys/wait.h)
AC_CHECK_HEADERS(shadow.h)
AC_CHECK_HEADERS(arpa/inet.h)
AC_CHECK_HEADERS(syslog.h)
AC_CHECK_HEADERS(crypt.h)
AC_CHECK_HEADERS(utmp.h)
define(ARG_ENABLE_BFTPD, [
AC_MSG_CHECKING(whether to enable $1)
AC_ARG_ENABLE($1, [$2], result=yes, result=no)
if test "$result" = "yes"; then
$3
fi
AC_MSG_RESULT($result)
])
ARG_ENABLE_BFTPD(pam, [ --enable-pam Enable PAM (pluggable authentication modules) support], AC_DEFINE(WANT_PAM))
if test "$result" = "yes"; then
LIBS="$LIBS -lpam -ldl"
AC_CHECK_HEADERS(security/pam_appl.h, result=yes, result=no)
if test "$result" = "no"; then
echo "Error: PAM header files not found. Install PAM or don't compile"
echo " bftpd with PAM support."
exit 1
fi
fi
ARG_ENABLE_BFTPD(libz, [ --enable-libz Link against libz so that gzip on the fly is supported],true)
if test "$result" = "yes"; then
AC_CHECK_HEADERS(zlib.h, result=yes, result=no)
if test "$result" = "yes"; then
AC_DEFINE(WANT_GZIP)
LIBS="$LIBS -lz"
else
echo "Error: zlib header file not found. Install it or don't compile"
echo " bftpd with zlib support."
exit 1
fi
fi
AC_ARG_ENABLE(pax, [ --enable-pax Specify path to PAX sources], result=$enableval, result="")
if test ! "$result" = ""; then
if test -d $result; then
DIRPAX=$result
AC_SUBST(DIRPAX)
PAX='$(DIRPAX)/append.o $(DIRPAX)/buffer.o $(DIRPAX)/cpio.o $(DIRPAX)/create.o $(DIRPAX)/extract.o $(DIRPAX)/fileio.o $(DIRPAX)/link.o $(DIRPAX)/list.o $(DIRPAX)/mem.o $(DIRPAX)/namelist.o $(DIRPAX)/names.o $(DIRPAX)/pass.o $(DIRPAX)/pathname.o $(DIRPAX)/pax.o $(DIRPAX)/port.o $(DIRPAX)/regexp.o $(DIRPAX)/replace.o $(DIRPAX)/tar.o $(DIRPAX)/ttyio.o $(DIRPAX)/warn.o $(DIRPAX)/wildmat.o'
AC_SUBST(PAX)
AC_DEFINE(WANT_TAR)
else
echo "Error: The PAX path you specified was not found."
exit 1
fi
fi
ARG_ENABLE_BFTPD(debug, [ --enable-debug Enable debugging],true)
if test "$result" = "yes"; then
DEBUG="-DDEBUG=1"
AC_SUBST(DEBUG)
fi
AC_OUTPUT(Makefile)