# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / ftpd / configure.in
1 AC_INIT()
2 AC_CONFIG_HEADER(config.h)
3 AC_PROG_CC
4 AC_AIX
5 AC_PROG_INSTALL
6 AC_PREFIX_DEFAULT(/usr)
7
8 LIBS=""
9
10 AC_CHECK_LIB(c, getusershell, result=yes, result=no)
11 if test "$result" = "yes"; then
12   AC_DEFINE(HAVE_GETUSERSHELL)
13 fi
14
15 AC_CHECK_LIB(c, inet_ntoa, result=yes, result=no)
16 if test "$result" = "no"; then
17 AC_CHECK_LIB(nsl, inet_ntoa, result=yes, result=no)
18 if test "$result" = "yes"; then
19   LIBS="$LIBS -lnsl"
20 fi
21 fi
22 AC_CHECK_LIB(socket, socket, result=yes, result=no)
23 if test "$result" = "yes"; then
24   LIBS="$LIBS -lsocket"
25 else
26   AC_CHECK_LIB(socket, connect, result=yes, result=no)
27   if test "$result" = "yes"; then
28     LIBS="$LIBS -lsocket"
29   fi
30 fi
31
32 AC_CHECK_LIB(crypt, crypt, result=yes, result=no)
33 if test "$result" = "yes"; then
34   LIBS="$LIBS -lcrypt"
35 fi
36
37 AC_HEADER_DIRENT
38 AC_CHECK_HEADERS(paths.h)
39 AC_CHECK_HEADERS(netinet/in.h)
40 AC_CHECK_HEADERS(sys/time.h)
41 AC_CHECK_HEADERS(time.h)
42 AC_CHECK_HEADERS(sys/types.h)
43 AC_CHECK_HEADERS(sys/stat.h)
44 AC_CHECK_HEADERS(sys/socket.h)
45 AC_CHECK_HEADERS(asm/socket.h)
46 AC_CHECK_HEADERS(wait.h)
47 AC_CHECK_HEADERS(sys/wait.h)
48 AC_CHECK_HEADERS(shadow.h)
49 AC_CHECK_HEADERS(arpa/inet.h)
50 AC_CHECK_HEADERS(syslog.h)
51 AC_CHECK_HEADERS(crypt.h)
52 AC_CHECK_HEADERS(utmp.h)
53 AC_CHECK_HEADERS(sys/sendfile.h)
54
55
56
57 define(ARG_ENABLE_BFTPD, [
58 AC_MSG_CHECKING(whether to enable $1)
59 AC_ARG_ENABLE($1, [$2], result=yes, result=no)
60 if test "$result" = "yes"; then
61   $3
62 fi
63 AC_MSG_RESULT($result)
64 ])
65
66 ARG_ENABLE_BFTPD(pam, [  --enable-pam            Enable PAM (pluggable authentication modules) support], AC_DEFINE(WANT_PAM))
67 if test "$result" = "yes"; then
68   LIBS="$LIBS -lpam -ldl"
69   AC_CHECK_HEADERS(security/pam_appl.h, result=yes, result=no)
70   if test "$result" = "no"; then
71     echo "Error: PAM header files not found. Install PAM or don't compile"
72     echo "       bftpd with PAM support."
73     exit 1
74   fi
75 fi
76
77 ARG_ENABLE_BFTPD(libz, [  --enable-libz           Link against libz so that gzip on the fly is supported],true)
78 if test "$result" = "yes"; then
79     AC_CHECK_HEADERS(zlib.h, result=yes, result=no)
80     if test "$result" = "yes"; then
81         AC_DEFINE(WANT_GZIP)
82         LIBS="$LIBS -lz"
83     else
84         echo "Error: zlib header file not found. Install it or don't compile"
85         echo "       bftpd with zlib support."
86         exit 1
87     fi
88 fi
89
90 AC_ARG_ENABLE(pax, [  --enable-pax            Specify path to PAX sources], result=$enableval, result="")
91 if test ! "$result" = ""; then
92     if test -d $result; then
93         DIRPAX=$result
94         AC_SUBST(DIRPAX)
95         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'
96         AC_SUBST(PAX)
97         AC_DEFINE(WANT_TAR)
98     else
99         echo "Error: The PAX path you specified was not found."
100         exit 1
101     fi
102 fi
103
104 ARG_ENABLE_BFTPD(debug, [  --enable-debug          Enable debugging],true)
105 if test "$result" = "yes"; then
106         DEBUG="-DDEBUG=1"
107         AC_SUBST(DEBUG)
108 fi
109
110 AC_OUTPUT(Makefile)