"Fossies" - the Fresh Open Source Software archive

Member "cftp-0.12/configure.in" of archive cftp-0.12.tar.gz:


dnl Process this file with autoconf to produce a configure script.

dnl init

AC_INIT(fn_bind.c)
AM_INIT_AUTOMAKE(cftp, 0.12)
AM_CONFIG_HEADER(config.h)

AC_ARG_ENABLE(sftp,
    [  --enable-sftp           enable support for sftp protocol],
    USE_SFTP=no, USE_SFTP=yes)

# We want these before the checks, so the checks can modify their values.
test -z "$CFLAGS" && CFLAGS='-g' auto_cflags=1

AC_PROG_CC

dnl # If we're using gcc and the user hasn't specified CFLAGS, add -O to CFLAGS.
dnl test -n "$GCC" && test -n "$auto_cflags" && CFLAGS="$CFLAGS -O"

if test "$USE_SFTP" = "yes"
then
    AC_DEFINE(USE_SFTP, 1, [Define if you want sftp support])
fi

dnl programs

dnl libraries

TERMCAP=none
AC_CHECK_FUNC(tgetent, [TERMCAP=""])
if test "$TERMCAP" = none
then
	AC_CHECK_LIB(termcap, tgetent, [TERMCAP=-ltermcap])
	AC_DEFINE(USE_TERMCAP, 1, [define if we're linking against -ltermcap])
fi
if test "$TERMCAP" = none
then
	AC_CHECK_LIB(curses, tgetent, [TERMCAP=-lcurses])
	AC_DEFINE(USE_CURSES, 1, [define if we're linking against -lcurses])
fi
if test "$TERMCAP" = none
then
	AC_CHECK_LIB(ncurses, tgetent, [TERMCAP=-lncurses])
	AC_DEFINE(USE_NCURSES, 1, [define if we're linking against -lncurses])
fi
if test "$TERMCAP" = none
then
	AC_MSG_ERROR([can't find termcap (emulation) library])
fi
LIBS="$LIBS $TERMCAP"

AC_CHECK_LIB(socket, main)
AC_CHECK_LIB(nsl, main)
AC_CHECK_LIB(resolv, main)


dnl header files

AC_CHECK_HEADERS(libgen.h sys/select.h termcap.h)

if test "$ac_cv_header_termcap_h" = yes; then
NIH_CHECK_DECL([#include "termcap.h"], ospeed)
fi

NIH_CHECK_DECL([#include "netdb.h"], h_errno)

dnl typedefs
dnl structures

NIH_CHECK_STRUCT([#include <sys/types.h>
#include <sys/socket.h>], sockaddr_storage)
NIH_CHECK_STRUCT_MEMBER([#include <sys/types.h>
#include <sys/socket.h>], sockaddr, sa_len)

dnl compiler characteristics

dnl library functions

AC_REPLACE_FUNCS(basename fnmatch fputchar getaddrinfo \
		 getcwd inet_aton strdup strerror)
AC_CHECK_FUNCS(getdomainname getnameinfo)

AC_CHECK_FUNCS(tparam, [tparam=1], [tparam=0])
if test "$tparam" -ne 1
then
	AC_CHECK_FUNCS(tparm, , [LIBOBJS="$LIBOBJS tparam.o"])
fi

AC_CHECK_FUNCS(getopt_long, , [LIBOBJS="$LIBOBJS getopt1.o getopt.o"])

dnl system services

dnl output
AC_OUTPUT(Makefile)