2000-08-08 22:00:30 +00:00
|
|
|
# $Id$
|
2000-06-06 05:53:49 +00:00
|
|
|
dnl Process this file with autoconf to produce a configure script.
|
|
|
|
AC_INIT(nano.c)
|
2001-10-04 01:24:07 +00:00
|
|
|
AM_INIT_AUTOMAKE(nano, 1.1.2)
|
2000-06-06 05:53:49 +00:00
|
|
|
AM_CONFIG_HEADER(config.h:config.h.in)
|
2001-09-12 19:06:59 +00:00
|
|
|
ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv no nl da"
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
dnl Checks for programs.
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_ISC_POSIX
|
2001-07-19 12:24:17 +00:00
|
|
|
NANO_AC_SYS_LARGEFILE
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
dnl Checks for header files.
|
|
|
|
AC_HEADER_STDC
|
2001-03-18 18:55:06 +00:00
|
|
|
AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h)
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
dnl options
|
|
|
|
AC_ARG_ENABLE(tiny,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --enable-tiny Disable features for the sake of size
|
2000-06-06 05:53:49 +00:00
|
|
|
(currently disables detailed help and i18n)],
|
|
|
|
[if test x$enableval = xyes; then
|
|
|
|
AC_DEFINE(NANO_SMALL) tiny_support=yes
|
2001-01-11 15:08:06 +00:00
|
|
|
AC_DEFINE(DISABLE_TABCOMP)
|
|
|
|
AC_DEFINE(DISABLE_SPELLER)
|
|
|
|
AC_DEFINE(DISABLE_HELP)
|
|
|
|
AC_DEFINE(DISABLE_JUSTIFY)
|
|
|
|
AC_DEFINE(DISABLE_BROWSER)
|
2001-04-12 14:51:48 +00:00
|
|
|
AC_DEFINE(DISABLE_MOUSE)
|
2001-09-19 03:19:43 +00:00
|
|
|
AC_DEFINE(DISABLE_OPERATINGDIR)
|
2000-06-06 05:53:49 +00:00
|
|
|
fi])
|
|
|
|
|
2000-11-24 20:45:14 +00:00
|
|
|
AC_ARG_ENABLE(extra,
|
|
|
|
[ --enable-extra Enable extra (optional) functions, including easter eggs],
|
|
|
|
[if test x$enableval = xyes; then
|
|
|
|
AC_DEFINE(NANO_EXTRA) extra_support=yes
|
2001-07-14 19:32:47 +00:00
|
|
|
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
|
2001-09-05 13:23:53 +00:00
|
|
|
AC_DEFINE(ENABLE_UNDO) undo_support=yes
|
|
|
|
fi])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE(undo,
|
|
|
|
[ --enable-undo Enable undo support],
|
|
|
|
[if test x$enableval = xyes && test x$tiny_support != xyes; then
|
|
|
|
AC_DEFINE(ENABLE_UNDO) undo_support=yes
|
2000-11-24 20:45:14 +00:00
|
|
|
fi])
|
|
|
|
|
2001-07-14 19:32:47 +00:00
|
|
|
AC_ARG_ENABLE(multibuffer,
|
2001-09-19 03:19:43 +00:00
|
|
|
[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used],
|
2001-07-11 02:08:33 +00:00
|
|
|
[if test x$enableval = xyes && test x$tiny_support != xyes; then
|
2001-07-14 19:32:47 +00:00
|
|
|
AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes
|
2001-07-11 02:08:33 +00:00
|
|
|
fi])
|
|
|
|
|
2001-04-13 02:32:06 +00:00
|
|
|
AC_ARG_ENABLE(nanorc,
|
|
|
|
[ --enable-nanorc Enable use of .nanorc file],
|
|
|
|
[if test x$enableval = xyes; then
|
|
|
|
AC_DEFINE(ENABLE_NANORC) nanorc_support=yes
|
|
|
|
fi])
|
|
|
|
|
2001-04-28 15:53:28 +00:00
|
|
|
AC_ARG_ENABLE(color,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --enable-color Enable color and syntax highlighting],
|
2001-04-28 15:53:28 +00:00
|
|
|
[if test x$enableval = xyes; then
|
|
|
|
AC_DEFINE(ENABLE_NANORC) nanorc_support=yes
|
|
|
|
AC_DEFINE(ENABLE_COLOR) color_support=yes
|
2001-06-11 02:49:50 +00:00
|
|
|
AC_MSG_WARN([
|
|
|
|
|
|
|
|
***********************************************************************
|
|
|
|
*** WARNING: Color support is currently BROKEN. Don't expect it to ***
|
|
|
|
*** work AT ALL until more is implemented. ***
|
|
|
|
***********************************************************************
|
|
|
|
])
|
|
|
|
fi])
|
2001-04-28 15:53:28 +00:00
|
|
|
|
2000-11-24 14:00:16 +00:00
|
|
|
AC_ARG_ENABLE(tabcomp,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-tabcomp Disable tab completion code for a smaller binary],
|
2000-11-24 14:00:16 +00:00
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_TABCOMP)
|
|
|
|
fi])
|
|
|
|
|
2000-12-01 18:46:01 +00:00
|
|
|
AC_ARG_ENABLE(justify,
|
|
|
|
[ --disable-justify Disable justify/unjustify function],
|
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_JUSTIFY)
|
|
|
|
fi])
|
|
|
|
|
2000-12-06 01:08:10 +00:00
|
|
|
AC_ARG_ENABLE(speller,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-speller Disable spell checker function],
|
2000-12-01 18:46:01 +00:00
|
|
|
[if test x$enableval != xyes; then
|
2000-12-06 01:08:10 +00:00
|
|
|
AC_DEFINE(DISABLE_SPELLER)
|
2000-12-01 18:46:01 +00:00
|
|
|
fi])
|
|
|
|
|
2000-12-10 17:03:25 +00:00
|
|
|
AC_ARG_ENABLE(help,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-help Disable help function (^G)],
|
2000-12-10 17:03:25 +00:00
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_HELP)
|
|
|
|
fi])
|
|
|
|
|
2001-01-03 07:11:47 +00:00
|
|
|
AC_ARG_ENABLE(browser,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-browser Disable mini file browser],
|
2001-01-05 05:41:07 +00:00
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_BROWSER)
|
2001-01-03 07:11:47 +00:00
|
|
|
fi])
|
|
|
|
|
2001-04-02 05:36:08 +00:00
|
|
|
AC_ARG_ENABLE(wrapping,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-wrapping Disable all wrapping of text (and -w flag)],
|
2001-04-02 05:36:08 +00:00
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_WRAPPING)
|
|
|
|
fi])
|
|
|
|
|
2001-04-12 14:51:48 +00:00
|
|
|
AC_ARG_ENABLE(mouse,
|
2001-05-02 17:18:17 +00:00
|
|
|
[ --disable-mouse Disable mouse support (and -m flag)],
|
2001-04-12 14:51:48 +00:00
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_MOUSE)
|
|
|
|
fi])
|
|
|
|
|
2001-09-19 03:19:43 +00:00
|
|
|
AC_ARG_ENABLE(operatingdir,
|
|
|
|
[ --disable-operatingdir Disable setting of operating directory (chroot of sorts)],
|
|
|
|
[if test x$enableval != xyes; then
|
|
|
|
AC_DEFINE(DISABLE_OPERATINGDIR)
|
|
|
|
fi])
|
|
|
|
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_MSG_CHECKING([whether to use slang])
|
2000-06-06 05:53:49 +00:00
|
|
|
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-05 22:49:30 +00: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 05:53:49 +00:00
|
|
|
|
|
|
|
AC_CHECK_HEADER(slcurses.h,
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_MSG_CHECKING([for SLtt_initialize in -lslang])
|
2000-08-08 22:00:30 +00:00
|
|
|
_libs=$LIBS
|
|
|
|
LIBS="$LIBS -lslang"
|
2000-08-09 03:26:33 +00:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-08 22:00:30 +00:00
|
|
|
[AC_MSG_RESULT(yes)
|
2000-08-05 22:49:30 +00: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-08 22:00:30 +00:00
|
|
|
AC_MSG_RESULT(no)
|
|
|
|
# We might need the term library
|
|
|
|
for termlib in ncurses curses termcap terminfo termlib; do
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB([${termlib}], tputs, [tcap="-l$termlib"])
|
2000-08-08 22:00:30 +00:00
|
|
|
test -n "$tcap" && break
|
|
|
|
done
|
|
|
|
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap])
|
2000-08-08 22:00:30 +00:00
|
|
|
LIBS="$LIBS $tcap"
|
2000-08-09 03:26:33 +00:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-08 22:00:30 +00: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
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_MSG_CHECKING([for SLtt_initialize in -lslang $tcap -lm])
|
2000-08-08 22:00:30 +00:00
|
|
|
LIBS="$LIBS -lm"
|
2000-08-09 03:26:33 +00:00
|
|
|
AC_TRY_RUN([
|
|
|
|
#include <stdio.h>
|
|
|
|
#include <slcurses.h>
|
|
|
|
int main () { SLtt_initialize (NULL); return 0; }],
|
2000-08-08 22:00:30 +00: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 18:12:05 +00: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 05:53:49 +00: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-08 22:00:30 +00:00
|
|
|
test "${_libs+set}" = "set" && LIBS=$_libs
|
|
|
|
|
2000-08-05 22:49:30 +00:00
|
|
|
if test "$with_slang" != "yes"; then
|
|
|
|
LDFLAGS=${_ldflags}
|
|
|
|
fi
|
2000-06-06 05:53:49 +00:00
|
|
|
;;
|
2001-02-01 22:56:44 +00:00
|
|
|
esac], [AC_MSG_RESULT(no)])
|
2000-06-06 05:53:49 +00: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,,
|
2001-02-01 22:56:44 +00:00
|
|
|
[AC_MSG_ERROR([
|
2000-06-06 05:53:49 +00:00
|
|
|
*** snprintf() and/or vsnprintf() not found. GLIB not found either.
|
|
|
|
*** You need both snprintf() and vsnprintf(). Alternatively you can
|
2001-02-01 22:56:44 +00:00
|
|
|
*** install the GLIB library which can be found at ftp://ftp.gtk.org/.])],
|
2000-06-06 05:53:49 +00:00
|
|
|
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)
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB(ncurses, tgetent, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses])
|
2000-06-06 05:53:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB(curses, tgetent, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
2000-06-06 05:53:49 +00:00
|
|
|
fi
|
|
|
|
|
2000-09-21 04:25:45 +00:00
|
|
|
# Fallback for PDCurses and less useful curses libs...
|
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB(curses, initscr, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses])
|
2000-09-21 04:25:45 +00:00
|
|
|
fi
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
if eval "test x$CURSES_LIB_NAME = x"
|
|
|
|
then
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB(termcap, tgetent, [CURSES_LIB="-ltermcap" CURSES_LIB_NAME=termcap])
|
2000-06-06 05:53:49 +00:00
|
|
|
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
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_MSG_RESULT([Using $CURSES_LIB_NAME as the termcap library])
|
2000-06-06 05:53:49 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
|
2001-04-30 11:28:46 +00:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], use_default_colors, [AC_DEFINE(HAVE_USE_DEFAULT_COLORS)])
|
2001-01-09 00:37:32 +00:00
|
|
|
if test x$slang_support != xyes; then
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)])
|
2001-02-16 04:48:30 +00:00
|
|
|
AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [AC_DEFINE(HAVE_RESIZETERM)])
|
2000-06-06 05:53:49 +00:00
|
|
|
|
2001-01-09 00:37:32 +00:00
|
|
|
# Taken from aumix (can't tell form the variable name?)
|
2001-02-01 22:56:44 +00:00
|
|
|
AC_CACHE_CHECK([for private member _use_keypad in WINDOW],
|
2001-01-09 00:37:32 +00:00
|
|
|
aumix_cv_struct_window_usekeypad,
|
|
|
|
[AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H
|
2001-01-06 18:12:43 +00:00
|
|
|
#include <ncurses.h>
|
|
|
|
#else
|
|
|
|
#include <curses.h>
|
|
|
|
#endif], [WINDOW w; w._use_keypad;],
|
2001-01-09 00:37:32 +00:00
|
|
|
aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)])
|
2001-01-06 18:12:43 +00:00
|
|
|
|
2001-01-09 00:37:32 +00:00
|
|
|
if test $aumix_cv_struct_window_usekeypad = yes; then
|
|
|
|
AC_DEFINE(HAVE_USEKEYPAD)
|
|
|
|
fi
|
2001-01-06 18:12:43 +00:00
|
|
|
fi
|
|
|
|
|
2000-06-06 05:53:49 +00:00
|
|
|
dnl Parse any configure options
|
|
|
|
|
|
|
|
LIBS="$LIBS $CURSES_LIB"
|
2000-06-19 23:19:07 +00:00
|
|
|
|
2000-06-06 05:53:49 +00: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
|
2001-07-19 12:24:17 +00:00
|
|
|
NANO_AM_GNU_GETTEXT
|
2000-06-06 05:53:49 +00:00
|
|
|
|
|
|
|
AC_OUTPUT([Makefile intl/Makefile po/Makefile.in])
|