1dnl Process this file with autoconf to produce a configure script. 2 3# 4# Copyright 2002-2004, Double Precision Inc. 5# 6# See COPYING for distribution information. 7# 8AC_PREREQ(2.59) 9AC_INIT(curses, 0.11, courier-cone@lists.sourceforge.net) 10AC_CONFIG_SRCDIR(mycurses.H) 11AC_CONFIG_AUX_DIR(..) 12AC_CONFIG_HEADERS(curses_config.h) 13AM_INIT_AUTOMAKE 14>confdefs.h 15 16dnl Checks for programs. 17AC_USE_SYSTEM_EXTENSIONS 18AC_PROG_CXX 19AC_PROG_AWK 20AC_PROG_CC 21AC_PROG_CC_C99 22AC_PROG_RANLIB 23AC_PROG_INSTALL 24AC_PROG_LN_S 25 26AX_COURIER_UNICODE_CXXFLAGS 27AC_SUBST(COURIER_UNICODE_CXXFLAGS) 28 29dnl Checks for libraries. 30 31CURSESLIBRARY="" 32 33for f in ncursesw cursesw ncurses curses 34do 35 AC_CHECK_LIB($f, wgetch, 36 [if test "$CURSESLIBRARY" = "" 37 then 38 CURSESLIBRARY="$f" 39 fi 40 ]) 41done 42 43if test "$CURSESLIBRARY" = "" 44then 45 AC_MSG_ERROR([curses library not found.]) 46fi 47 48CURSESLIB="-l$CURSESLIBRARY" 49AC_SUBST(CURSESLIB) 50 51dnl Checks for header files. 52AC_CHECK_HEADERS(sys/time.h unistd.h sys/wait.h glob.h) 53AC_CHECK_HEADERS(ncursesw/curses.h) 54 55AC_HEADER_TIME 56AC_HEADER_DIRENT 57AC_HEADER_SYS_WAIT 58 59save_LIBS="$LIBS" 60LIBS="$CURSESLIB $LIBS" 61 62AC_MSG_CHECKING(for use_default_colors()) 63 64AC_TRY_LINK([ 65#include <curses.h> 66],[ 67 use_default_colors(); 68], [AC_MSG_RESULT(yes) 69 70AC_DEFINE_UNQUOTED(HAS_USE_DEFAULT_COLORS,1,[Whether we have use_default_colors()]) 71], AC_MSG_RESULT(no)) 72 73AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 74#if HAVE_NCURSESW_CURSES_H 75#include <ncursesw/curses.h> 76#else 77#include <curses.h> 78#endif 79 80#ifdef KEY_F 81#if KEY_F(0)+63 == KEY_F(63) 82#define SANEFKEY 83#endif 84#endif 85 86#ifndef SANEFKEY 87#error Not a sane FKEY 88#endif 89]])], 90AC_DEFINE_UNQUOTED(HAS_FUNCTIONKEYS,1,[Whether curses implements function keys with known semantics])) 91 92LIBS="$save_LIBS" 93 94dnl Checks for typedefs, structures, and compiler characteristics. 95AC_C_CONST 96 97dnl Checks for library functions. 98AC_TYPE_SIGNAL 99AC_SYS_LARGEFILE 100 101AC_CHECK_FUNCS(glob) 102if test "$GXX" = "yes" 103then 104 CPPFLAGS="-Wall $CPPFLAGS" 105fi 106CFLAGS="-I../libs -I${srcdir}/../libs $CFLAGS" 107CXXFLAGS="-I../libs -I${srcdir}/../libs $CXXFLAGS" 108 109AC_OUTPUT(Makefile) 110