2000-08-09 02:00:30 +04:00
|
|
|
# $Id$
|
2000-06-06 09:53:49 +04:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(nano.c)
|
2000-11-24 04:37:14 +03:00
|
|
|
AM_INIT_AUTOMAKE(nano, 0.9.21-cvs)
|
2000-06-06 09:53:49 +04:00
|
|
|
AM_CONFIG_HEADER(config.h:config.h.in)
|
2000-06-24 05:33:27 +04:00
|
|
|
ALL_LINGUAS="es de fr it id fi"
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_ISC_POSIX
|
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2000-09-06 17:39:17 +04:00
|
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
dnl options
|
|
|
|
AC_ARG_ENABLE(tiny,
|
|
|
|
[ --enable-tiny Disables features for the sake of size
|
|
|
|
(currently disables detailed help and i18n)],
|
|
|
|
[if test x$enableval = xyes; then
|
|
|
|
AC_DEFINE(NANO_SMALL) tiny_support=yes
|
|
|
|
fi])
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(whether to use slang)
|
|
|
|
CURSES_LIB_NAME=""
|
|
|
|
AC_ARG_WITH(slang,
|
|
|
|
[ --with-slang[=DIR] Use the slang library instead of curses],
|
|
|
|
[ case "$with_slang" in
|
|
|
|
no)
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_RESULT(yes)
|
|
|
|
|
2000-08-06 02:49:30 +04:00
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
# Add additional search path
|
|
|
|
LDFLAGS="-L$with_slang/lib $LDFLAGS"
|
|
|
|
CPPFLAGS="-I$with_slang/include $CPPFLAGS"
|
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
AC_CHECK_HEADER(slcurses.h,
|
2000-08-09 02:00:30 +04:00
|
|
|
AC_MSG_CHECKING(for SLtt_initialize in -lslang)
|
|
|
|
_libs=$LIBS
|
|
|
|
LIBS="$LIBS -lslang"
|
2000-08-09 07:26:33 +04:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-09 02:00:30 +04:00
|
|
|
[AC_MSG_RESULT(yes)
|
2000-08-06 02:49:30 +04:00
|
|
|
AC_DEFINE(USE_SLANG)
|
|
|
|
slang_support=yes
|
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
CURSES_LIB="-L${with_slang}/lib -lslang"
|
|
|
|
else
|
|
|
|
CURSES_LIB="-lslang"
|
|
|
|
fi
|
|
|
|
CURSES_LIB_NAME=slang], [
|
2000-08-09 02:00:30 +04:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
# We might need the term library
|
|
|
|
for termlib in ncurses curses termcap terminfo termlib; do
|
|
|
|
AC_CHECK_LIB(${termlib}, tputs, [tcap="-l$termlib"])
|
|
|
|
test -n "$tcap" && break
|
|
|
|
done
|
|
|
|
|
|
|
|
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap)
|
|
|
|
LIBS="$LIBS $tcap"
|
2000-08-09 07:26:33 +04:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-09 02:00:30 +04:00
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(USE_SLANG)
|
|
|
|
slang_support=yes
|
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
CURSES_LIB="-L${with_slang}/lib -lslang $tcap"
|
|
|
|
else
|
|
|
|
CURSES_LIB="-lslang $tcap"
|
|
|
|
fi
|
|
|
|
CURSES_LIB_NAME=slang], [
|
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
# We might need the math library
|
|
|
|
AC_MSG_CHECKING(for SLtt_initialize in -lslang $tcap -lm)
|
|
|
|
LIBS="$LIBS -lm"
|
2000-08-09 07:26:33 +04:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-09 02:00:30 +04:00
|
|
|
[AC_MSG_RESULT(yes)
|
|
|
|
AC_DEFINE(USE_SLANG)
|
|
|
|
slang_support=yes
|
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
CURSES_LIB="-L${with_slang}/lib -lslang $tcap -lm"
|
|
|
|
else
|
|
|
|
CURSES_LIB="-lslang $tcap -lm"
|
|
|
|
fi
|
|
|
|
CURSES_LIB_NAME=slang],
|
2000-09-13 22:12:05 +04:00
|
|
|
[AC_MSG_RESULT(no)],
|
|
|
|
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
|
|
|
AC_MSG_WARN([*** Can not use slang when cross-compiling]))],
|
|
|
|
AC_MSG_WARN([*** Can not use slang when cross-compiling])),
|
2000-06-06 09:53:49 +04:00
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** The header file slcurses.h was not found. If you wish to use
|
|
|
|
*** slang support this header file is required. Please either
|
|
|
|
*** install a version of slang that includes the slcurses.h file or
|
|
|
|
*** do not call the configure script with --with-slang
|
|
|
|
]))
|
|
|
|
|
2000-08-09 02:00:30 +04:00
|
|
|
test "${_libs+set}" = "set" && LIBS=$_libs
|
|
|
|
|
2000-08-06 02:49:30 +04:00
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
LDFLAGS=${_ldflags}
|
|
|
|
fi
|
2000-06-06 09:53:49 +04:00
|
|
|
;;
|
2000-07-31 17:00:24 +04:00
|
|
|
esac], AC_MSG_RESULT(no))
|
2000-06-06 09:53:49 +04:00
|
|
|
|
|
|
|
dnl Checks for functions
|
|
|
|
AC_CHECK_FUNCS(snprintf vsnprintf)
|
|
|
|
if test "x$ac_cv_func_snprintf" = "xno" -o "xac_cv_func_vsnprintf" = "xno"
|
|
|
|
then
|
|
|
|
AM_PATH_GLIB(1.2.4,,
|
|
|
|
AC_MSG_ERROR([
|
|
|
|
*** snprintf() and/or vsnprintf() not found. GLIB not found either.
|
|
|
|
*** You need both snprintf() and vsnprintf(). Alternatively you can
|
|
|
|
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.]),
|
|
|
|
glib)
|
|
|
|
glib_cflags=`$GLIB_CONFIG --cflags glib`
|
|
|
|
glib_libs=`$GLIB_CONFIG --libs glib`
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
|
|
|
|
|
|
|
dnl Checks for library functions.
|
|
|
|
AC_TYPE_SIGNAL
|
|
|
|
AC_FUNC_VPRINTF
|
|
|
|
AC_CHECK_FUNCS(getopt_long)
|
|
|
|
|
|
|
|
dnl Checks for libraries.
|
|
|
|
|
|
|
|
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
|
|
|
AC_CHECK_HEADERS(curses.h ncurses.h)
|
2000-08-04 02:51:21 +04:00
|
|
|
AC_CHECK_LIB(ncurses, tgetent,CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses)
|
2000-06-06 09:53:49 +04:00
|
|
|
fi
|
|
|
|
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB(curses, tgetent, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
|
|
|
|
fi
|
|
|
|
|
2000-09-21 08:25:45 +04:00
|
|
|
# Fallback for PDCurses and less useful curses libs...
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB(curses, initscr, CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses)
|
|
|
|
fi
|
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
|
|
|
AC_CHECK_LIB(termcap, tgetent, CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap)
|
|
|
|
fi
|
|
|
|
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
|
|
|
AC_MSG_WARN([
|
|
|
|
*** No termcap lib available, consider getting the official ncurses
|
|
|
|
*** distribution from ftp://ftp.gnu.org/pub/gnu/ncurses if you get
|
|
|
|
*** errors compiling nano.])
|
|
|
|
else
|
|
|
|
AC_MSG_RESULT("Using $CURSES_LIB_NAME as the termcap library")
|
|
|
|
fi
|
|
|
|
|
|
|
|
|
|
|
|
AC_CHECK_LIB($CURSES_LIB_NAME, wresize, AC_DEFINE(HAVE_WRESIZE))
|
|
|
|
|
|
|
|
dnl Parse any configure options
|
|
|
|
|
|
|
|
LIBS="$LIBS $CURSES_LIB"
|
2000-06-20 03:19:07 +04:00
|
|
|
|
2000-06-06 09:53:49 +04:00
|
|
|
AC_ARG_ENABLE(debug, [ --enable-debug Enable debugging (def disabled)],)
|
|
|
|
|
|
|
|
AC_SUBST(CURSES_LIB)
|
|
|
|
|
|
|
|
if test "x$glib_cflags" != "x"
|
|
|
|
then
|
|
|
|
CFLAGS="$CFLAGS $glib_cflags"
|
|
|
|
fi
|
|
|
|
if test "x$glib_libs" != "x"
|
|
|
|
then
|
|
|
|
LDFLAGS="$LDFLAGS $glib_libs"
|
|
|
|
fi
|
|
|
|
|
|
|
|
dnl i18n stuff - pretty incomplete for now
|
|
|
|
AM_GNU_GETTEXT
|
|
|
|
|
|
|
|
AC_OUTPUT([Makefile intl/Makefile po/Makefile.in])
|