2002-06-15 09:40:37 +00:00
|
|
|
dnl $Id: configure.in,v 1.37 2002/06/10 08:08:53 lukem Exp $
|
2001-07-19 16:26:14 +00:00
|
|
|
dnl
|
|
|
|
dnl configure.in --
|
|
|
|
dnl process this file with autoconf to produce a configure script.
|
|
|
|
dnl
|
|
|
|
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_REVISION($Revision: 1.37 $)dnl
|
2001-07-19 16:26:14 +00:00
|
|
|
|
|
|
|
AC_INIT(lukemftp.h)
|
|
|
|
|
|
|
|
dnl Arguments for which features are included
|
|
|
|
dnl
|
|
|
|
AC_ARG_PROGRAM
|
|
|
|
AC_ARG_ENABLE(editcomplete, [\
|
|
|
|
--enable-editcomplete Turn on command line editing and completion.
|
|
|
|
--disable-editcomplete Turn off command line editing and completion
|
|
|
|
[default: enabled].],
|
|
|
|
opt_editcomplete=$enableval,
|
|
|
|
opt_editcomplete=yes)
|
|
|
|
AC_ARG_ENABLE(ipv6, [\
|
|
|
|
--enable-ipv6 Enable IPv6 support (if your OS supports it).
|
|
|
|
--disable-ipv6 Disable IPv6 support (even if your OS supports it)
|
|
|
|
[default: enabled].],
|
|
|
|
opt_ipv6=$enableval,
|
|
|
|
opt_ipv6=yes)
|
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
dnl
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_AWK
|
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
AC_CHECK_PROGS(AR, ar)
|
|
|
|
AC_AIX
|
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
dnl
|
|
|
|
AC_CHECK_LIB(util, fparseln)
|
|
|
|
if test $opt_editcomplete = yes; then
|
|
|
|
AC_CHECK_LIB(tinfo, tgetent, ,
|
|
|
|
AC_CHECK_LIB(termcap, tgetent, ,
|
|
|
|
AC_CHECK_LIB(curses, tgetent, ,
|
|
|
|
AC_CHECK_LIB(ncurses, tgetent))))
|
|
|
|
AC_SEARCH_LIBS(el_init, edit, have_libedit=yes, have_libedit=no)
|
|
|
|
fi
|
|
|
|
AC_LIBRARY_NET
|
|
|
|
AC_LIBRARY_SOCKS
|
2002-06-15 09:40:37 +00:00
|
|
|
if test -n "$socks"; then
|
|
|
|
if test $opt_ipv6 = yes; then
|
|
|
|
echo "IPv6 is incompatible with socks, disabling IPv6 support"
|
|
|
|
opt_ipv6=no
|
|
|
|
fi
|
|
|
|
fi
|
2001-07-19 16:26:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
dnl
|
|
|
|
AC_CONFIG_HEADER(config.h)
|
|
|
|
AC_HEADER_DIRENT
|
|
|
|
AC_HEADER_STDC
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_CHECK_HEADERS(arpa/nameser.h err.h regex.h paths.h poll.h sys/poll.h \
|
|
|
|
termcap.h util.h libutil.h vis.h)
|
2001-07-19 16:26:14 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
dnl
|
|
|
|
AC_HEADER_TIME
|
|
|
|
AC_TYPE_OFF_T
|
|
|
|
AC_CHECK_SIZEOF(off_t, 0)
|
|
|
|
AC_MSG_TRY_LINK(for long long, ftp_cv_HAVE_LONG_LONG, [
|
|
|
|
#include <sys/types.h>] , [
|
|
|
|
long long X = 2, Y = 1, Z;
|
|
|
|
Z = X / Y; ], [
|
|
|
|
AC_DEFINE(HAVE_LONG_LONG, 1)
|
|
|
|
have_long_long=yes], [have_long_long=no])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for in_port_t, ftp_cv_HAVE_IN_PORT_T, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netinet/in.h> ], [ in_port_t X ], [AC_DEFINE(HAVE_IN_PORT_T, 1)])
|
|
|
|
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_TRY_COMPILE(for sa_family_t, ftp_cv_HAVE_SA_FAMILY_T, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h> ], [ sa_family_t X ], [AC_DEFINE(HAVE_SA_FAMILY_T, 1)])
|
|
|
|
|
2001-07-19 16:26:14 +00:00
|
|
|
AC_MSG_TRY_COMPILE(for sockaddr_in.sin_len, ftp_cv_HAVE_SOCKADDR_SA_LEN, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netinet/in.h> ], [
|
|
|
|
struct sockaddr_in sin;
|
|
|
|
int X = sin.sin_len ], [AC_DEFINE(HAVE_SOCKADDR_SA_LEN, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for socklen_t, ftp_cv_HAVE_SOCKLEN_T, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h> ], [ socklen_t X ], [AC_DEFINE(HAVE_SOCKLEN_T, 1)])
|
|
|
|
|
|
|
|
if test $opt_ipv6 = yes; then
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for AF_INET6, ftp_cv_HAVE_AF_INET6, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h> ],
|
|
|
|
[ int X = AF_INET6 ], [AC_DEFINE(HAVE_AF_INET6, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for struct sockaddr_in6, ftp_cv_HAVE_SOCKADDR_IN6, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <netinet/in.h> ],
|
|
|
|
[ struct sockaddr_in6 X ], [AC_DEFINE(HAVE_SOCKADDR_IN6, 1)])
|
|
|
|
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for struct addrinfo, ftp_cv_HAVE_ADDRINFO, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netdb.h> ],
|
|
|
|
[ struct addrinfo X ], [AC_DEFINE(HAVE_ADDRINFO, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for d_namlen in struct dirent, ftp_cv_HAVE_D_NAMLEN, [
|
|
|
|
#if HAVE_DIRENT_H
|
|
|
|
# include <dirent.h>
|
|
|
|
#else
|
|
|
|
# define dirent direct
|
|
|
|
# if HAVE_SYS_NDIR_H
|
|
|
|
# include <sys/ndir.h>
|
|
|
|
# endif
|
|
|
|
# if HAVE_SYS_DIR_H
|
|
|
|
# include <sys/dir.h>
|
|
|
|
# endif
|
|
|
|
# if HAVE_NDIR_H
|
|
|
|
# include <ndir.h>
|
|
|
|
# endif
|
|
|
|
#endif ], [
|
|
|
|
struct dirent dp;
|
|
|
|
int X = dp.d_namlen; ], [AC_DEFINE(HAVE_D_NAMLEN, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for h_errno declaration, ftp_cv_HAVE_H_ERRNO_D, [
|
|
|
|
#include <netdb.h> ], [ int X = h_errno ], [AC_DEFINE(HAVE_H_ERRNO_D, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for fclose() declaration, ftp_cv_HAVE_FCLOSE_D, [
|
|
|
|
#include <stdio.h> ], [ int (*X)() = fclose ], [AC_DEFINE(HAVE_FCLOSE_D, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for getpass() declaration, ftp_cv_HAVE_GETPASS_D, [
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h> ], [ char *(*X)() = getpass ], [
|
|
|
|
AC_DEFINE(HAVE_GETPASS_D, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for optarg declaration, ftp_cv_HAVE_OPTARG_D, [
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h> ], [ char *X = optarg ], [AC_DEFINE(HAVE_OPTARG_D, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for optind declaration, ftp_cv_HAVE_OPTIND_D, [
|
|
|
|
#include <stdlib.h>
|
|
|
|
#include <unistd.h> ], [ int X = optind ], [AC_DEFINE(HAVE_OPTIND_D, 1)])
|
|
|
|
|
|
|
|
AC_MSG_TRY_COMPILE(for pclose() declaration, ftp_cv_HAVE_PCLOSE_D, [
|
|
|
|
#include <stdio.h> ], [ int (*X)() = pclose ], [AC_DEFINE(HAVE_PCLOSE_D, 1)])
|
|
|
|
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
dnl
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_REPLACE_FUNCS(err fgetln fseeko getaddrinfo getnameinfo inet_ntop inet_pton \
|
|
|
|
mkstemp setprogname sl_init snprintf strdup strerror strlcat \
|
2001-07-19 16:26:14 +00:00
|
|
|
strlcpy strptime strsep strunvis strvis timegm usleep)
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_CHECK_FUNCS(gethostbyname2 getpassphrase getpgrp memmove poll select)
|
2001-07-19 16:26:14 +00:00
|
|
|
if test $ac_cv_func_getpgrp = yes; then
|
|
|
|
AC_FUNC_GETPGRP
|
|
|
|
fi
|
2002-06-15 09:40:37 +00:00
|
|
|
if test $ac_cv_lib_util_fparseln != yes; then
|
|
|
|
AC_REPLACE_FUNCS(fparseln)
|
|
|
|
fi
|
|
|
|
|
|
|
|
LIBOBJS="$LIBOBJS glob.o"
|
2001-07-19 16:26:14 +00:00
|
|
|
|
|
|
|
if test $ac_cv_func_strptime = yes; then
|
|
|
|
AC_MSG_TRY_COMPILE(for strptime() declaration, ftp_cv_HAVE_STRPTIME_D, [
|
|
|
|
#include <time.h> ], [ char *X = strptime("", "", NULL) ],
|
|
|
|
[AC_DEFINE(HAVE_STRPTIME_D, 1)])
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $have_long_long = yes -a $ac_cv_sizeof_off_t -ge 8; then
|
2002-06-15 09:40:37 +00:00
|
|
|
|
|
|
|
dnl We assume that if sprintf() supports %lld or %qd,
|
|
|
|
dnl then all of *printf() does. If not, disable long long
|
|
|
|
dnl support because we don't know how to display it.
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(*printf() support for %lld)
|
|
|
|
can_printf_longlong=no
|
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
|
|
char buf[100];
|
|
|
|
sprintf(buf, "%lld", 4294967300LL);
|
|
|
|
return (strcmp(buf, "4294967300"));
|
|
|
|
}
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
can_printf_longlong=yes
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
], [ : ])
|
|
|
|
|
|
|
|
if test $can_printf_longlong != yes; then
|
|
|
|
AC_MSG_CHECKING(*printf() support for %qd)
|
2001-07-19 16:26:14 +00:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
int main() {
|
|
|
|
char buf[100];
|
2002-06-15 09:40:37 +00:00
|
|
|
sprintf(buf, "%qd", 4294967300LL);
|
2001-07-19 16:26:14 +00:00
|
|
|
return (strcmp(buf, "4294967300"));
|
|
|
|
}
|
|
|
|
], [
|
|
|
|
AC_MSG_RESULT(yes)
|
2002-06-15 09:40:37 +00:00
|
|
|
can_printf_longlong=yes
|
|
|
|
AC_DEFINE(HAVE_PRINTF_QD, 1)
|
2001-07-19 16:26:14 +00:00
|
|
|
], [
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
], [ : ])
|
2001-07-19 16:26:14 +00:00
|
|
|
fi
|
2002-06-15 09:40:37 +00:00
|
|
|
|
|
|
|
if test $can_printf_longlong = yes; then
|
|
|
|
AC_DEFINE(HAVE_QUAD_SUPPORT, 1)
|
|
|
|
AC_REPLACE_FUNCS(strtoll)
|
|
|
|
fi
|
|
|
|
|
2001-07-19 16:26:14 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test $opt_editcomplete = yes; then
|
|
|
|
if test $have_libedit = yes; then
|
|
|
|
AC_MSG_TRY_COMPILE(for EL_RPROMPT in libedit,
|
|
|
|
ftp_cv_have_libedit, [
|
|
|
|
#include <histedit.h> ], [ int X = EL_RPROMPT ], [:],
|
|
|
|
have_libedit=no )
|
|
|
|
fi
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for working libedit)
|
|
|
|
if test $have_libedit = no; then
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_RESULT(no - using my own)
|
2001-07-19 16:26:14 +00:00
|
|
|
INCLUDES="-I\${srcdir}/../libedit $INCLUDES"
|
|
|
|
LDFLAGS="-L../libedit $LDFLAGS"
|
|
|
|
LIBS="-ledit $LIBS"
|
|
|
|
LIBEDIT=libedit.a
|
|
|
|
LIBDEPENDS="$LIBDEPENDS ../libedit/libedit.a"
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
CFLAGS="-DNO_EDITCOMPLETE $CFLAGS"
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test $ac_cv_func_sl_init = yes; then
|
|
|
|
AC_MSG_TRY_COMPILE(if sl_add() returns int, ftp_cv_INT_SL_ADD, [
|
|
|
|
#include <stringlist.h> ], [ int f = sl_add((StringList *)0, "foo") ],
|
|
|
|
[:] , [LIBOBJS="$LIBOBJS sl_init.o"])
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
have_rfc2553_netdb=no
|
2002-06-15 09:40:37 +00:00
|
|
|
if test $ac_cv_func_getaddrinfo = yes -a ! -n "$socks"; then
|
|
|
|
AC_MSG_TRY_COMPILE(for AI_NUMERICHOST,
|
|
|
|
ftp_cv_have_ai_numerichost, [
|
2001-07-19 16:26:14 +00:00
|
|
|
#include <sys/types.h>
|
|
|
|
#include <sys/socket.h>
|
|
|
|
#include <netdb.h> ],
|
|
|
|
[ int X = AI_NUMERICHOST ], [ have_rfc2553_netdb=yes ])
|
|
|
|
fi
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_CHECKING(for working getaddrinfo())
|
2001-07-19 16:26:14 +00:00
|
|
|
if test $have_rfc2553_netdb = yes; then
|
|
|
|
AC_DEFINE(HAVE_RFC2553_NETDB, 1)
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_RESULT(yes)
|
2001-07-19 16:26:14 +00:00
|
|
|
else
|
|
|
|
if test $ac_cv_func_getaddrinfo = yes; then
|
|
|
|
LIBOBJS="$LIBOBJS getaddrinfo.o"
|
2002-06-15 09:40:37 +00:00
|
|
|
AC_MSG_RESULT(no - using local version)
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT(using local version)
|
2001-07-19 16:26:14 +00:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test $ac_cv_header_vis_h = yes; then
|
|
|
|
AC_MSG_TRY_COMPILE(for VIS_WHITE in vis.h,
|
|
|
|
ftp_cv_have_vis_white, [
|
|
|
|
#include <sys/types.h>
|
|
|
|
#include <vis.h> ], [ int X = VIS_WHITE ], [:],
|
|
|
|
ac_cv_header_vis_h=no )
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
if test -n "$LIBOBJS"; then
|
|
|
|
INCLUDES="$INCLUDES -I\${srcdir}/../libukem"
|
|
|
|
LDFLAGS="$LDFLAGS -L../libukem"
|
|
|
|
LIBS="$LIBS -lukem"
|
|
|
|
LIBUKEM=libukem.a
|
|
|
|
LIBDEPENDS="$LIBDEPENDS ../libukem/libukem.a"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Create the Makefiles
|
|
|
|
dnl
|
|
|
|
|
|
|
|
AC_SUBST(INCLUDES)
|
|
|
|
AC_SUBST(LIBEDIT)
|
|
|
|
AC_SUBST(LIBUKEM)
|
|
|
|
AC_SUBST(LIBDEPENDS)
|
|
|
|
|
|
|
|
AC_OUTPUT(Makefile libedit/Makefile libedit/makelist libukem/Makefile \
|
|
|
|
src/Makefile)
|