From: Jordi Mallach Date: Sat, 23 Feb 2002 18:23:43 +0000 (+0000) Subject: Move to autoconf 2.5. X-Git-Tag: v1.1.7~22 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=3c5653d83e91d964b34f82821148981767edecd5;p=nano.git Move to autoconf 2.5. configure.in moved to configure.ac, to make things completely obvious. Removed m4/largefile.m4, which is provided by ac2.5, and add Makefile.am for that dir. Updated README.CVS to reflect this. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1082 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 9a154a8a..ed9edf48 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,11 @@ CVS code - - Makefile.am: - Add SYSCONFDIR to DEFS, so we can have an /etc/nanorc. - Change localedir line to 1.0's version. + - Moved m4/ stuff to its own m4/Makefile.am. +- configure.in: + - Renamed to configure.ac. +- configure.ac: + - Moved to autoconf 2.52 (Jeff Bailey). - files.c: read_byte() - Added check for conrol characters (indicative of a binary diff --git a/Makefile.am b/Makefile.am index d0a02b15..b759ffa9 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,10 +1,5 @@ ## $Id$ AUTOMAKE_OPTIONS = gnu no-dependencies -M4DIR = $(srcdir)/m4 -ACLOCAL_AMFLAGS = -I $(M4DIR) -ACINCLUDE_INPUTS = $(M4DIR)/gettext.m4 $(M4DIR)/largefile.m4 \ - $(M4DIR)/progtest.m4 $(M4DIR)/lcmessage.m4 $(M4DIR)/iconv.m4 \ - $(M4DIR)/codeset.m4 $(M4DIR)/glibc21.m4 DEFS= -DSYSCONFDIR=\"$(sysconfdir)\" @@ -30,12 +25,9 @@ MAKEINFO = makeinfo --no-split EXTRA_DIST = ABOUT-NLS AUTHORS BUGS COPYING ChangeLog INSTALL NEWS \ README THANKS TODO install-sh missing mkinstalldirs \ - nano.1 nano.1.html faq.html nanorc.sample $(ACINCLUDE_INPUTS) + nano.1 nano.1.html faq.html nanorc.sample SUBDIRS = po intl localedir = $(datadir)/locale INCLUDES = -Iintl -DLOCALEDIR=\"$(localedir)\" -I@includedir@ - -$(srcdir)/acinclude.m4: $(ACINCLUDE_INPUTS) - cat $(ACINCLUDE_INPUTS) > $@ diff --git a/README.CVS b/README.CVS index c98505a3..8a0563e1 100644 --- a/README.CVS +++ b/README.CVS @@ -7,7 +7,7 @@ more care than the official stable and unstable tarballs. To succesfully compile GNU nano from CVS, you'll need the following packages: -- autoconf (versions 2.13 or >= 2.50) +- autoconf (version >= 2.50) - automake (version 1.4-pl5 recommended) - autoheader - gettext (version 0.10.40) @@ -35,5 +35,4 @@ $ make install should put the required files in their respective directories. -Please submit any bugs in the CVS branch to nano-devel@lists.sourceforge.net. -[FIXME needs change for Savannah too] +Please submit any bugs in the CVS branch to nano-devel@gnu.org. diff --git a/configure.ac b/configure.ac new file mode 100644 index 00000000..6018bea5 --- /dev/null +++ b/configure.ac @@ -0,0 +1,312 @@ +# $Id$ +dnl Process this file with autoconf to produce a configure script. +AC_INIT +AC_CONFIG_SRCDIR([nano.c]) +AC_PREREQ(2.52) +AM_INIT_AUTOMAKE(nano, 1.1.6-cvs) +AM_CONFIG_HEADER(config.h:config.h.in) +ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv nn nl da pl nb" + +dnl Checks for programs. +AC_PROG_CC +AC_ISC_POSIX +AC_SYS_LARGEFILE + +dnl Checks for header files. +AC_HEADER_STDC +AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h) + +dnl options +AC_ARG_ENABLE(tiny, +[ --enable-tiny Disable 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 + AC_DEFINE(DISABLE_TABCOMP) + AC_DEFINE(DISABLE_SPELLER) + AC_DEFINE(DISABLE_HELP) + AC_DEFINE(DISABLE_JUSTIFY) + AC_DEFINE(DISABLE_BROWSER) + AC_DEFINE(DISABLE_MOUSE) + AC_DEFINE(DISABLE_OPERATINGDIR) + fi]) + +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 + AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes + 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 + fi]) + +AC_ARG_ENABLE(multibuffer, +[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used], +[if test x$enableval = xyes && test x$tiny_support != xyes; then + AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes + fi]) + +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]) + +AC_ARG_ENABLE(color, +[ --enable-color Enable color and syntax highlighting], +[if test x$enableval = xyes; then + AC_DEFINE(ENABLE_NANORC) nanorc_support=yes + AC_DEFINE(ENABLE_COLOR) color_support=yes + AC_MSG_WARN([ + +*********************************************************************** +*** WARNING: Color support is currently BROKEN. Don't expect it to *** +*** work AT ALL until more is implemented. *** +*********************************************************************** +]) +fi]) + +AC_ARG_ENABLE(tabcomp, +[ --disable-tabcomp Disable tab completion code for a smaller binary], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_TABCOMP) + fi]) + +AC_ARG_ENABLE(justify, +[ --disable-justify Disable justify/unjustify function], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_JUSTIFY) + fi]) + +AC_ARG_ENABLE(speller, +[ --disable-speller Disable spell checker function], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_SPELLER) + fi]) + +AC_ARG_ENABLE(help, +[ --disable-help Disable help function (^G)], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_HELP) + fi]) + +AC_ARG_ENABLE(browser, +[ --disable-browser Disable mini file browser], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_BROWSER) + fi]) + +AC_ARG_ENABLE(wrapping, +[ --disable-wrapping Disable all wrapping of text (and -w flag)], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_WRAPPING) + fi]) + +AC_ARG_ENABLE(mouse, +[ --disable-mouse Disable mouse support (and -m flag)], + [if test x$enableval != xyes; then + AC_DEFINE(DISABLE_MOUSE) + fi]) + +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]) + +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) + + if test "$with_slang" != "yes"; then + # Add additional search path + LDFLAGS="-L$with_slang/lib $LDFLAGS" + CPPFLAGS="-I$with_slang/include $CPPFLAGS" + fi + + AC_CHECK_HEADER(slcurses.h, + AC_MSG_CHECKING([for SLtt_initialize in -lslang]) + _libs=$LIBS + LIBS="$LIBS -lslang" + AC_TRY_RUN([ +#include +#include +int main () { SLtt_initialize (NULL); return 0; }], + [AC_MSG_RESULT(yes) + 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], [ + 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" + AC_TRY_RUN([ +#include +#include +int main () { SLtt_initialize (NULL); return 0; }], + [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" + AC_TRY_RUN([ +#include +#include +int main () { SLtt_initialize (NULL); return 0; }], + [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], + [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])), + 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 +])) + + test "${_libs+set}" = "set" && LIBS=$_libs + + if test "$with_slang" != "yes"; then + LDFLAGS=${_ldflags} + fi + ;; + esac], [AC_MSG_RESULT(no)]) + +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) + AC_CHECK_LIB(ncurses, tgetent, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses]) +fi + +if eval "test x$CURSES_LIB_NAME = x" +then + AC_CHECK_LIB(curses, tgetent, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) +fi + +# 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 + +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], use_default_colors, [AC_DEFINE(HAVE_USE_DEFAULT_COLORS)]) +if test x$slang_support != xyes; then + AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)]) + AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [AC_DEFINE(HAVE_RESIZETERM)]) + + # Taken from aumix (can't tell form the variable name?) + AC_CACHE_CHECK([for private member _use_keypad in WINDOW], + aumix_cv_struct_window_usekeypad, + [AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H +#include +#else +#include +#endif], [WINDOW w; w._use_keypad;], + aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)]) + + if test $aumix_cv_struct_window_usekeypad = yes; then + AC_DEFINE(HAVE_USEKEYPAD) + fi +fi + +dnl Parse any configure options + +LIBS="$LIBS $CURSES_LIB" + +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 +NANO_AM_GNU_GETTEXT + +AC_CONFIG_FILES([Makefile intl/Makefile m4/Makefile po/Makefile.in]) +AC_OUTPUT diff --git a/configure.in b/configure.in deleted file mode 100644 index db0e516d..00000000 --- a/configure.in +++ /dev/null @@ -1,309 +0,0 @@ -# $Id$ -dnl Process this file with autoconf to produce a configure script. -AC_INIT(nano.c) -AM_INIT_AUTOMAKE(nano, 1.1.6-cvs) -AM_CONFIG_HEADER(config.h:config.h.in) -ALL_LINGUAS="es de fr it id fi hu ca cs gl uk ru sv nn nl da pl nb" - -dnl Checks for programs. -AC_PROG_CC -AC_ISC_POSIX -NANO_AC_SYS_LARGEFILE - -dnl Checks for header files. -AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h unistd.h malloc.h termios.h termio.h limits.h getopt.h regex.h) - -dnl options -AC_ARG_ENABLE(tiny, -[ --enable-tiny Disable 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 - AC_DEFINE(DISABLE_TABCOMP) - AC_DEFINE(DISABLE_SPELLER) - AC_DEFINE(DISABLE_HELP) - AC_DEFINE(DISABLE_JUSTIFY) - AC_DEFINE(DISABLE_BROWSER) - AC_DEFINE(DISABLE_MOUSE) - AC_DEFINE(DISABLE_OPERATINGDIR) - fi]) - -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 - AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes - 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 - fi]) - -AC_ARG_ENABLE(multibuffer, -[ --enable-multibuffer Enable multiple file buffers; this is disabled if --enable-tiny is used], -[if test x$enableval = xyes && test x$tiny_support != xyes; then - AC_DEFINE(ENABLE_MULTIBUFFER) multibuffer_support=yes - fi]) - -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]) - -AC_ARG_ENABLE(color, -[ --enable-color Enable color and syntax highlighting], -[if test x$enableval = xyes; then - AC_DEFINE(ENABLE_NANORC) nanorc_support=yes - AC_DEFINE(ENABLE_COLOR) color_support=yes - AC_MSG_WARN([ - -*********************************************************************** -*** WARNING: Color support is currently BROKEN. Don't expect it to *** -*** work AT ALL until more is implemented. *** -*********************************************************************** -]) -fi]) - -AC_ARG_ENABLE(tabcomp, -[ --disable-tabcomp Disable tab completion code for a smaller binary], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_TABCOMP) - fi]) - -AC_ARG_ENABLE(justify, -[ --disable-justify Disable justify/unjustify function], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_JUSTIFY) - fi]) - -AC_ARG_ENABLE(speller, -[ --disable-speller Disable spell checker function], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_SPELLER) - fi]) - -AC_ARG_ENABLE(help, -[ --disable-help Disable help function (^G)], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_HELP) - fi]) - -AC_ARG_ENABLE(browser, -[ --disable-browser Disable mini file browser], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_BROWSER) - fi]) - -AC_ARG_ENABLE(wrapping, -[ --disable-wrapping Disable all wrapping of text (and -w flag)], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_WRAPPING) - fi]) - -AC_ARG_ENABLE(mouse, -[ --disable-mouse Disable mouse support (and -m flag)], - [if test x$enableval != xyes; then - AC_DEFINE(DISABLE_MOUSE) - fi]) - -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]) - -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) - - if test "$with_slang" != "yes"; then - # Add additional search path - LDFLAGS="-L$with_slang/lib $LDFLAGS" - CPPFLAGS="-I$with_slang/include $CPPFLAGS" - fi - - AC_CHECK_HEADER(slcurses.h, - AC_MSG_CHECKING([for SLtt_initialize in -lslang]) - _libs=$LIBS - LIBS="$LIBS -lslang" - AC_TRY_RUN([ -#include -#include -int main () { SLtt_initialize (NULL); return 0; }], - [AC_MSG_RESULT(yes) - 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], [ - 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" - AC_TRY_RUN([ -#include -#include -int main () { SLtt_initialize (NULL); return 0; }], - [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" - AC_TRY_RUN([ -#include -#include -int main () { SLtt_initialize (NULL); return 0; }], - [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], - [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])), - 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 -])) - - test "${_libs+set}" = "set" && LIBS=$_libs - - if test "$with_slang" != "yes"; then - LDFLAGS=${_ldflags} - fi - ;; - esac], [AC_MSG_RESULT(no)]) - -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) - AC_CHECK_LIB(ncurses, tgetent, [CURSES_LIB="-lncurses" CURSES_LIB_NAME=ncurses]) -fi - -if eval "test x$CURSES_LIB_NAME = x" -then - AC_CHECK_LIB(curses, tgetent, [CURSES_LIB="-lcurses" CURSES_LIB_NAME=curses]) -fi - -# 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 - -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], use_default_colors, [AC_DEFINE(HAVE_USE_DEFAULT_COLORS)]) -if test x$slang_support != xyes; then - AC_CHECK_LIB([$CURSES_LIB_NAME], wresize, [AC_DEFINE(HAVE_WRESIZE)]) - AC_CHECK_LIB([$CURSES_LIB_NAME], resizeterm, [AC_DEFINE(HAVE_RESIZETERM)]) - - # Taken from aumix (can't tell form the variable name?) - AC_CACHE_CHECK([for private member _use_keypad in WINDOW], - aumix_cv_struct_window_usekeypad, - [AC_TRY_COMPILE([#ifdef HAVE_NCURSES_H -#include -#else -#include -#endif], [WINDOW w; w._use_keypad;], - aumix_cv_struct_window_usekeypad=yes, aumix_cv_struct_window_usekeypad=no)]) - - if test $aumix_cv_struct_window_usekeypad = yes; then - AC_DEFINE(HAVE_USEKEYPAD) - fi -fi - -dnl Parse any configure options - -LIBS="$LIBS $CURSES_LIB" - -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 -NANO_AM_GNU_GETTEXT - -AC_OUTPUT([Makefile intl/Makefile po/Makefile.in]) diff --git a/m4/.cvsignore b/m4/.cvsignore new file mode 100644 index 00000000..3dda7298 --- /dev/null +++ b/m4/.cvsignore @@ -0,0 +1,2 @@ +Makefile.in +Makefile diff --git a/m4/Makefile.am b/m4/Makefile.am new file mode 100644 index 00000000..14cc8e39 --- /dev/null +++ b/m4/Makefile.am @@ -0,0 +1,2 @@ +EXTRA_DIST = codeset.m4 glibc21.m4 progtest.m4 gettext.m4iconv.m4 \ + lcmessage.m4 diff --git a/m4/largefile.m4 b/m4/largefile.m4 deleted file mode 100644 index c8d41e3e..00000000 --- a/m4/largefile.m4 +++ /dev/null @@ -1,92 +0,0 @@ -#serial 19 - -dnl By default, many hosts won't let programs access large files; -dnl one must use special compiler options to get large-file access to work. -dnl For more details about this brain damage please see: -dnl http://www.sas.com/standards/large.file/x_open.20Mar96.html - -dnl Written by Paul Eggert . - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_TEST_INCLUDES -AC_DEFUN(AC_SYS_LARGEFILE_TEST_INCLUDES, - [[#include - /* Check that off_t can represent 2**63 - 1 correctly. - We can't simply "#define LARGE_OFF_T 9223372036854775807", - since some C++ compilers masquerading as C compilers - incorrectly reject 9223372036854775807. */ -# define LARGE_OFF_T (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) - int off_t_is_large[(LARGE_OFF_T % 2147483629 == 721 - && LARGE_OFF_T % 2147483647 == 1) - ? 1 : -1]; - ]]) - -dnl Internal subroutine of AC_SYS_LARGEFILE. -dnl AC_SYS_LARGEFILE_MACRO_VALUE(C-MACRO, VALUE, CACHE-VAR, COMMENT, INCLUDES, FUNCTION-BODY) -AC_DEFUN(AC_SYS_LARGEFILE_MACRO_VALUE, - [AC_CACHE_CHECK([for $1 value needed for large files], $3, - [$3=no - AC_TRY_COMPILE([$5], - [$6], - , - [AC_TRY_COMPILE([#define $1 $2] -[$5] - , - [$6], - [$3=$2])])]) - if test "[$]$3" != no; then - AC_DEFINE_UNQUOTED([$1], [$]$3, [$4]) - fi]) - -AC_DEFUN(NANO_AC_SYS_LARGEFILE, - [AC_REQUIRE([AC_PROG_CC]) - AC_ARG_ENABLE(largefile, - [ --disable-largefile omit support for large files]) - if test "$enable_largefile" != no; then - - AC_CACHE_CHECK([for special C compiler options needed for large files], - ac_cv_sys_largefile_CC, - [ac_cv_sys_largefile_CC=no - if test "$GCC" != yes; then - # IRIX 6.2 and later do not support large files by default, - # so use the C compiler's -n32 option if that helps. - AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , , - [ac_save_CC="$CC" - CC="$CC -n32" - AC_TRY_COMPILE(AC_SYS_LARGEFILE_TEST_INCLUDES, , - ac_cv_sys_largefile_CC=' -n32') - CC="$ac_save_CC"]) - fi]) - if test "$ac_cv_sys_largefile_CC" != no; then - CC="$CC$ac_cv_sys_largefile_CC" - fi - - AC_SYS_LARGEFILE_MACRO_VALUE(_FILE_OFFSET_BITS, 64, - ac_cv_sys_file_offset_bits, - [Number of bits in a file offset, on hosts where this is settable.], - AC_SYS_LARGEFILE_TEST_INCLUDES) - AC_SYS_LARGEFILE_MACRO_VALUE(_LARGE_FILES, 1, - ac_cv_sys_large_files, - [Define for large files, on AIX-style hosts.], - AC_SYS_LARGEFILE_TEST_INCLUDES) - fi - ]) - -AC_DEFUN(AC_FUNC_FSEEKO, - [AC_SYS_LARGEFILE_MACRO_VALUE(_LARGEFILE_SOURCE, 1, - ac_cv_sys_largefile_source, - [Define to make fseeko visible on some hosts (e.g. glibc 2.2).], - [#include ], [return !fseeko;]) - # We used to try defining _XOPEN_SOURCE=500 too, to work around a bug - # in glibc 2.1.3, but that breaks too many other things. - # If you want fseeko and ftello with glibc, upgrade to a fixed glibc. - - AC_CACHE_CHECK([for fseeko], ac_cv_func_fseeko, - [ac_cv_func_fseeko=no - AC_TRY_LINK([#include ], - [return fseeko && fseeko (stdin, 0, 0);], - [ac_cv_func_fseeko=yes])]) - if test $ac_cv_func_fseeko != no; then - AC_DEFINE(HAVE_FSEEKO, 1, - [Define if fseeko (and presumably ftello) exists and is declared.]) - fi])