Blame configure.in

Packit 15a96c
dnl $Id: configure.in,v 1.52 2009-11-16 21:06:05 al-guest Exp $
Packit 15a96c
dnl configure.in autoconf/automake input script
Packit 15a96c
dnl for minicom
Packit 15a96c
dnl
Packit 15a96c
Packit 15a96c
AC_INIT([minicom], [2.7.1], [minicom-devel@lists.alioth.debian.org])
Packit 15a96c
AC_CONFIG_SRCDIR([src/minicom.c])
Packit 15a96c
AM_CONFIG_HEADER([config.h])
Packit 15a96c
AC_PREREQ(2.59)
Packit 15a96c
Packit 15a96c
AM_INIT_AUTOMAKE([1.7])
Packit 15a96c
Packit 15a96c
dnl Checks for programs.
Packit 15a96c
AC_PROG_CC
Packit 15a96c
AM_PROG_AR
Packit 15a96c
Packit 15a96c
AC_AIX
Packit 15a96c
AC_MINIX
Packit 15a96c
Packit 15a96c
AC_PROG_INSTALL
Packit 15a96c
dnl AC_PROG_LIBTOOL
Packit 15a96c
AC_PROG_RANLIB
Packit 15a96c
Packit 15a96c
AC_ISC_POSIX
Packit 15a96c
AM_ICONV_LINK
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([music],
Packit 15a96c
	AS_HELP_STRING([--enable-music],
Packit 15a96c
	               [Enable music for certain events (def: DISABLED)]),
Packit 15a96c
	[], [enable_music="no"])
Packit 15a96c
if test "x$enable_music" = xyes; then
Packit 15a96c
	AC_DEFINE(VC_MUSIC, [1], [Music support is enabled])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([socket],
Packit 15a96c
	AS_HELP_STRING([--disable-socket],
Packit 15a96c
	               [Disable socket support (def: enabled)]),
Packit 15a96c
	[], [enable_socket="yes"])
Packit 15a96c
if test "x$enable_socket" = xyes; then
Packit 15a96c
	AC_DEFINE(USE_SOCKET, [1], [Socket support is enabled])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
PKG_PROG_PKG_CONFIG
Packit 15a96c
if test -n "$PKG_CONFIG"; then
Packit 15a96c
	PKG_CHECK_MODULES([LOCKDEV], [lockdev], AC_DEFINE([HAVE_LOCKDEV],[1],[Define if you have lockdev]),[:])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([lock-dir],
Packit 15a96c
	AS_HELP_STRING([--enable-lock-dir=DIR],
Packit 15a96c
	               [Set com line lock directory (def: try common locations)]),
Packit 15a96c
	[], [enable_lock_dir="yes"])
Packit 15a96c
if test "x$enable_lock_dir" = xyes; then
Packit 15a96c
	UUCPLOCK=""
Packit 15a96c
else
Packit 15a96c
	if test "x$enable_lock_dir" = xno; then
Packit 15a96c
		AC_MSG_ERROR(Lock directory required)
Packit 15a96c
	else
Packit 15a96c
		UUCPLOCK="$enable_lock_dir"
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([dfl-port],
Packit 15a96c
	AS_HELP_STRING([--enable-dfl-port=DEVFILE],
Packit 15a96c
	               [Set default /dev/.. modem device (def: try common locations)]),
Packit 15a96c
	[], [enable_dfl_port="yes"])
Packit 15a96c
if test "x$enable_dfl_port" = xyes; then
Packit 15a96c
	DFL_PORT=""
Packit 15a96c
else
Packit 15a96c
	if test "x$enable_dfl_port" = xno; then
Packit 15a96c
		AC_MSG_ERROR(Default port required)
Packit 15a96c
	else
Packit 15a96c
		DFL_PORT="$enable_dfl_port"
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([dfl-baud],
Packit 15a96c
	AS_HELP_STRING([--enable-dfl-baud=NNNNN],
Packit 15a96c
	               [Set default baud rate (def: 115200)]),
Packit 15a96c
	[], [enable_dfl_baud="yes"])
Packit 15a96c
if test "x$enable_dfl_baud" = xyes; then
Packit 15a96c
	DEF_BAUD="115200"
Packit 15a96c
else
Packit 15a96c
	if test "x$enable_dfl_baud" = xno; then
Packit 15a96c
		AC_MSG_ERROR(Default baud rate required)
Packit 15a96c
	else
Packit 15a96c
		DEF_BAUD="$enable_dfl_baud"
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([cfg-dir],
Packit 15a96c
	AS_HELP_STRING([--enable-cfg-dir=DIR],
Packit 15a96c
	               [Set minicom cfg file path (def: sysconfdir)]),
Packit 15a96c
	[], [enable_cfg_dir="yes"])
Packit 15a96c
if test "x$enable_cfg_dir" = xyes; then
Packit 15a96c
	MINICOM_CONFDIR="$sysconfdir"
Packit 15a96c
else
Packit 15a96c
	if test "x$enable_cfg_dir" = xno; then
Packit 15a96c
		AC_MSG_ERROR(Config directory required)
Packit 15a96c
	else
Packit 15a96c
		MINICOM_CONFDIR="$enable_cfg_dir"
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
AC_SUBST([MINICOM_CONFDIR])
Packit 15a96c
Packit 15a96c
AC_ARG_ENABLE([kermit],
Packit 15a96c
	AS_HELP_STRING([--enable-kermit=FILE],
Packit 15a96c
	               [Set default path to kermit (def: search PATH)]),
Packit 15a96c
	[], [enable_kermit="yes"])
Packit 15a96c
if test "x$enable_kermit" = xyes; then
Packit 15a96c
	PATH_KERMIT=""
Packit 15a96c
else
Packit 15a96c
	if test "x$enable_kermit" = xno; then
Packit 15a96c
		PATH_KERMIT=""
Packit 15a96c
	else
Packit 15a96c
		PATH_KERMIT="$enable_kermit"
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
dnl Set of available languages.
Packit 15a96c
ALL_LINGUAS="cs da de es fr fi hu id ja nb pl pt_BR ro ru rw sv vi zh_TW"
Packit 15a96c
Packit 15a96c
dnl Checks for programs.
Packit 15a96c
AM_GNU_GETTEXT([external])
Packit 15a96c
AM_GNU_GETTEXT_VERSION([0.16.1])
Packit 15a96c
Packit 15a96c
dnl This is a hacky workaround as the m4 scripts for iconv seem to set
Packit 15a96c
dnl LIBICONV to '-liconv' despite that this lib is not available if iconv
Packit 15a96c
dnl functionality is coming out of libc. But we need -liconv for other
Packit 15a96c
dnl systems, such as Mac OS. Other projects I looked seem to have their own
Packit 15a96c
dnl set of iconv m4 macros... why?
Packit 15a96c
dnl if test "x$gt_use_preinstalled_gnugettext" = "xyes" -o "x$USE_NLS" = "no"
Packit 15a96c
dnl then
Packit 15a96c
dnl    LIBICONV=''
Packit 15a96c
dnl    LTLIBICONV=''
Packit 15a96c
dnl fi
Packit 15a96c
Packit 15a96c
if test "x$enable_kermit" != xno && test "x$PATH_KERMIT" = x
Packit 15a96c
then
Packit 15a96c
AC_PATH_PROG(PATH_KERMIT, kermit, no, $PATH:/bin:/usr/bin:/usr/local/bin:/opt/gnu/bin)
Packit 15a96c
else
Packit 15a96c
	AC_MSG_CHECKING(manual Kermit setting)
Packit 15a96c
	AC_MSG_RESULT($PATH_KERMIT)
Packit 15a96c
fi
Packit 15a96c
if test "x$PATH_KERMIT" = x -o "x$PATH_KERMIT" = xno
Packit 15a96c
then
Packit 15a96c
	AC_DEFINE(KERMIT, "", [Path to kermit])
Packit 15a96c
else
Packit 15a96c
	AC_DEFINE_UNQUOTED(KERMIT, "$PATH_KERMIT -l %l -b %b", [Kermit command])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
Packit 15a96c
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
Packit 15a96c
# rather ncurses.  So we check for it.
Packit 15a96c
TERMLIBS=
Packit 15a96c
for termlib in tinfo ncurses curses termcap terminfo termlib ; do
Packit 15a96c
   AC_CHECK_LIB(${termlib}, tputs,
Packit 15a96c
     [TERMLIBS="${TERMLIBS} -l${termlib}"; break])
Packit 15a96c
done
Packit 15a96c
Packit 15a96c
LIBS="$LIBS $TERMLIBS"
Packit 15a96c
Packit 15a96c
dnl Checks for header files.
Packit 15a96c
dnl Do not use <ncurses/termcap.h> unless we're linking with ncurses.
Packit 15a96c
if test "x$termlib" = xncurses; then
Packit 15a96c
  dnl Use AC_CHECK_HEADERS so the HAVE_*_H symbol gets defined.
Packit 15a96c
  AC_CHECK_HEADERS(ncurses/termcap.h, [found_termcap_h=1])
Packit 15a96c
fi
Packit 15a96c
if test "x$found_termcap_h" != "x1"; then
Packit 15a96c
  AC_CHECK_HEADERS(termcap.h)
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_CHECK_LIB(socket, socket)
Packit 15a96c
Packit 15a96c
dnl Checks for header files.
Packit 15a96c
AC_HEADER_DIRENT
Packit 15a96c
AC_HEADER_STDC
Packit 15a96c
AC_HEADER_SYS_WAIT
Packit 15a96c
AC_HEADER_STAT
Packit 15a96c
AC_HEADER_TIME
Packit 15a96c
Packit 15a96c
AC_SYS_POSIX_TERMIOS
Packit 15a96c
AC_HEADER_TIOCGWINSZ
Packit 15a96c
if test $ac_cv_sys_posix_termios = yes; then
Packit 15a96c
  AC_DEFINE(POSIX_TERMIOS, [1], [Define if your system supports POSIX termios])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
AC_CHECK_HEADERS(stdarg.h varargs.h termio.h termios.h \
Packit 15a96c
	setjmp.h errno.h pwd.h signal.h fcntl.h sgtty.h locale.h \
Packit 15a96c
	sys/stat.h sys/file.h sys/ioctl.h sys/time.h \
Packit 15a96c
	sys/ttold.h sys/param.h unistd.h posix1_lim.h sgtty.h features.h)
Packit 15a96c
Packit 15a96c
dnl Checks for typedefs, structures, and compiler characteristics.
Packit 15a96c
AC_C_CONST
Packit 15a96c
AC_TYPE_UID_T
Packit 15a96c
AC_TYPE_MODE_T
Packit 15a96c
AC_TYPE_PID_T
Packit 15a96c
AC_TYPE_SIZE_T
Packit 15a96c
AC_STRUCT_TM
Packit 15a96c
Packit 15a96c
dnl Checks for library functions.
Packit 15a96c
AC_TYPE_SIGNAL
Packit 15a96c
AC_FUNC_ERROR_AT_LINE
Packit 15a96c
AC_FUNC_CLOSEDIR_VOID
Packit 15a96c
AM_WITH_DMALLOC
Packit 15a96c
AC_CHECK_FUNCS(getcwd getwd memmove strerror strstr vsnprintf vprintf select)
Packit 15a96c
#KEYSERV="minicom.keyserv"
Packit 15a96c
KEYSERV=""
Packit 15a96c
AC_SUBST(KEYSERV)
Packit 15a96c
AC_REPLACE_FUNCS(snprintf usleep getopt getopt_long)
Packit 15a96c
Packit 15a96c
dnl system capabilities
Packit 15a96c
AC_SYS_LONG_FILE_NAMES
Packit 15a96c
Packit 15a96c
dnl ---------------------------------------------------------------
Packit 15a96c
Packit 15a96c
AC_MSG_CHECKING(for com line lock directory)
Packit 15a96c
Packit 15a96c
if test "x$UUCPLOCK" != x
Packit 15a96c
then
Packit 15a96c
	if test -d $UUCPLOCK
Packit 15a96c
	then
Packit 15a96c
		AC_MSG_RESULT($UUCPLOCK)
Packit 15a96c
		AC_DEFINE_UNQUOTED(UUCPLOCK, "$UUCPLOCK", [Lock directory])
Packit 15a96c
	else
Packit 15a96c
		UUCPLOCK=""
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$UUCPLOCK" = x
Packit 15a96c
then
Packit 15a96c
	for ac_uucplock in /etc/locks /var/lock /usr/spool/locks /var/spool/locks /var/spool/lock /usr/spool/uucp /var/spool/uucp /var/run; do
Packit 15a96c
		UUCPLOCK=$ac_uucplock
Packit 15a96c
		if test -d $UUCPLOCK; then
Packit 15a96c
			AC_MSG_RESULT($UUCPLOCK)
Packit 15a96c
			AC_DEFINE_UNQUOTED(UUCPLOCK, "$UUCPLOCK")
Packit 15a96c
			break
Packit 15a96c
		else
Packit 15a96c
			UUCPLOCK=""
Packit 15a96c
		fi
Packit 15a96c
	done
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$UUCPLOCK" = x
Packit 15a96c
then
Packit 15a96c
	AC_MSG_ERROR(No suitable lock directory)
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
dnl ---------------------------------------------------------------
Packit 15a96c
Packit 15a96c
AC_MSG_CHECKING(for default serial port device)
Packit 15a96c
Packit 15a96c
if test "x$DFL_PORT" != x
Packit 15a96c
then
Packit 15a96c
	if test -c $DFL_PORT
Packit 15a96c
	then
Packit 15a96c
		AC_MSG_RESULT($DFL_PORT)
Packit 15a96c
		AC_DEFINE_UNQUOTED(DFL_PORT, "$DFL_PORT",
Packit 15a96c
		                   [Default /dev/... device])
Packit 15a96c
	else
Packit 15a96c
		DFL_PORT=""
Packit 15a96c
	fi
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$DFL_PORT" = x
Packit 15a96c
then
Packit 15a96c
	for ac_port in /dev/modem /dev/cua/b /dev/cua2p0 /dev/ttyS1 /dev/com0 /dev/tty01 /dev/tty8; do
Packit 15a96c
		DFL_PORT=$ac_port
Packit 15a96c
		if test -c $DFL_PORT; then
Packit 15a96c
			AC_MSG_RESULT($DFL_PORT)
Packit 15a96c
			AC_DEFINE_UNQUOTED(DFL_PORT, "$DFL_PORT")
Packit 15a96c
			break
Packit 15a96c
		else
Packit 15a96c
			DFL_PORT=""
Packit 15a96c
		fi
Packit 15a96c
	done
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$DFL_PORT" = x
Packit 15a96c
then
Packit 15a96c
	DFL_PORT=/dev/modem
Packit 15a96c
	AC_MSG_RESULT($DFL_PORT)
Packit 15a96c
	AC_DEFINE_UNQUOTED(DFL_PORT, "$DFL_PORT", [Default device])
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
dnl ---------------------------------------------------------------
Packit 15a96c
Packit 15a96c
AC_MSG_CHECKING(for default baud rate)
Packit 15a96c
Packit 15a96c
tmp_match=no
Packit 15a96c
for tmp_baud_rate in 300 1200 2400 4800 9600 19200 38400 57600 115200 230400
Packit 15a96c
do
Packit 15a96c
	if test "x$DEF_BAUD" = "x$tmp_baud_rate"
Packit 15a96c
	then
Packit 15a96c
		tmp_match=yes
Packit 15a96c
		AC_DEFINE_UNQUOTED(DEF_BAUD, "$DEF_BAUD", [Default baud rate])
Packit 15a96c
		AC_MSG_RESULT($DEF_BAUD)
Packit 15a96c
	fi
Packit 15a96c
done
Packit 15a96c
Packit 15a96c
if test "x$tmp_match" != xyes
Packit 15a96c
then
Packit 15a96c
	AC_MSG_ERROR(No suitable default baud rate)
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$ac_cv_header_getopt_h" = xno
Packit 15a96c
then
Packit 15a96c
	CFLAGS="$CFLAGS -I\$(top_srcdir)/lib"
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
if test "x$ac_cv_prog_gcc" = xyes
Packit 15a96c
then
Packit 15a96c
	CFLAGS="$CFLAGS -W -Wall -Wextra -std=gnu99"
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
# this is a hack, if we need getopt_long we also need getopt
Packit 15a96c
# but I don't know how to express that dependency in lib/Makefile.am
Packit 15a96c
AC_SUBST(LIBPORT_GETOPT_LONG_DEP)
Packit 15a96c
if test "x$ac_cv_func_getopt_long" = xno
Packit 15a96c
then
Packit 15a96c
	LIBPORT_GETOPT_LONG_DEP="getopt.o"
Packit 15a96c
fi
Packit 15a96c
Packit 15a96c
dnl ---------------------------------------------------------------
Packit 15a96c
Packit 15a96c
AH_BOTTOM([
Packit 15a96c
/* Defines from old config.h */
Packit 15a96c
#define LOGFILE "minicom.log"        /* Not defined = not used */
Packit 15a96c
#define CALLOUT ""                   /* Gets run to get into dialut mode */
Packit 15a96c
#define CALLIN  ""                   /* Gets run to get into dial in mode */
Packit 15a96c
Packit 15a96c
/* This defines a special mode in the wwxgetch() routine. The
Packit 15a96c
 * basic idea behind this probably works on the consoles of
Packit 15a96c
 * most PC-based unices, but it's only implemented for Linux.
Packit 15a96c
 */
Packit 15a96c
#if defined (__linux__)
Packit 15a96c
#  define KEY_KLUDGE 1
Packit 15a96c
#endif
Packit 15a96c
Packit 15a96c
/* And this for the translation tables (vt100 -> ASCII) */
Packit 15a96c
#if __STDC__
Packit 15a96c
#  define TRANSLATE 1
Packit 15a96c
#else
Packit 15a96c
#  define TRANSLATE 0
Packit 15a96c
#endif
Packit 15a96c
])
Packit 15a96c
Packit 15a96c
dnl --------------------------------------------------------------
Packit 15a96c
Packit 15a96c
AC_CONFIG_FILES([Makefile
Packit 15a96c
                 doc/Makefile \
Packit 15a96c
                 extras/Makefile \
Packit 15a96c
		 extras/linux/Makefile \
Packit 15a96c
		 extras/tables/Makefile \
Packit 15a96c
		 extras/termcap/Makefile \
Packit 15a96c
		 extras/terminfo/Makefile \
Packit 15a96c
		 man/Makefile \
Packit 15a96c
		 lib/Makefile \
Packit 15a96c
		 src/Makefile \
Packit 15a96c
		 po/Makefile.in \
Packit 15a96c
		 minicom.spec])
Packit 15a96c
AC_OUTPUT