X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=9db0a644bce932420c531a35b50f2da4f666c08f;hp=392f57bbfad032e6c1cbb265a9f0da13a817f721;hb=d49a800c7f54c8d9e77f745423c821a8535ada59;hpb=dfaa1a3001fd447819f5edc2e523acc1a04f1440 diff --git a/aclocal.m4 b/aclocal.m4 index 392f57bb..9db0a644 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.488 2009/07/17 09:14:49 tom Exp $ +dnl $Id: aclocal.m4,v 1.492 2010/03/06 18:47:56 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -62,13 +62,13 @@ AC_DEFUN([AM_LANGINFO_CODESET], fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -86,7 +86,7 @@ fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 8 updated: 2009/01/06 19:33:30 +dnl CF_ADD_CFLAGS version: 9 updated: 2010/01/09 11:05:50 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -112,8 +112,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -128,6 +128,12 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -143,8 +149,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -1397,7 +1403,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 +dnl CF_GCC_ATTRIBUTES version: 13 updated: 2009/08/11 20:19:56 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1443,26 +1449,61 @@ extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; extern void foo(void) GCC_NORETURN; int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; } EOF + cf_printf_attribute=no + cf_scanf_attribute=no for cf_attribute in scanf printf unused noreturn do CF_UPPER(cf_ATTRIBUTE,$cf_attribute) cf_directive="__attribute__(($cf_attribute))" echo "checking for $CC $cf_directive" 1>&AC_FD_CC - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < ], @@ -2031,7 +2072,7 @@ done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 9 updated: 2008/12/07 19:38:31 +dnl CF_HEADER_PATH version: 10 updated: 2010/01/17 20:36:17 dnl -------------- dnl Construct a search-list of directories for a nonstandard header-file dnl @@ -2040,6 +2081,7 @@ dnl $1 = the variable to return as result dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], [ +$1= cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS @@ -3582,7 +3624,7 @@ chmod 755 $cf_edit_man ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10 +dnl CF_MATH_LIB version: 6 updated: 2009/12/19 13:46:49 dnl ----------- dnl Checks for libraries. At least one UNIX system, Apple Macintosh dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler @@ -3601,7 +3643,7 @@ AC_CACHE_CHECK(if -lm needed for math functions, if test "$cf_cv_need_libm" = yes then ifelse($1,,[ - LIBS="$LIBS -lm" + LIBS="-lm $LIBS" ],[$1=-lm]) fi ]) @@ -3860,7 +3902,7 @@ fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10 +dnl CF_POSIX_C_SOURCE version: 7 updated: 2010/01/09 11:05:50 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3928,12 +3970,7 @@ make an error if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl @@ -4153,11 +4190,11 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59 +dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ -AC_CHECK_PROGS(LINT, tdlint lint alint) +AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- @@ -4195,7 +4232,7 @@ case $cf_cv_regex in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all @@ -4207,10 +4244,9 @@ dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ -# remove $3 symbol from $2 $1=`echo "$2" | \ - sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 @@ -4277,7 +4313,7 @@ AC_MSG_RESULT(no) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 57 updated: 2009/01/17 16:10:05 +dnl CF_SHARED_OPTS version: 58 updated: 2009/12/19 13:46:49 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4585,7 +4621,7 @@ CF_EOF if test -n "$LD_RPATH_OPT" ; then AC_MSG_CHECKING(if we need a space after rpath option) cf_save_LIBS="$LIBS" - LIBS="$LIBS ${LD_RPATH_OPT}$libdir" + LIBS="${LD_RPATH_OPT}$libdir $LIBS" AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) LIBS="$cf_save_LIBS" AC_MSG_RESULT($cf_rpath_space) @@ -4896,7 +4932,7 @@ if test -n "$ADA_SUBDIRS"; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 +dnl CF_STDCPP_LIBRARY version: 6 updated: 2009/12/19 13:46:49 dnl ----------------- dnl Check for -lstdc++, which is GNU's standard C++ library. AC_DEFUN([CF_STDCPP_LIBRARY], @@ -4912,7 +4948,7 @@ os2*) #(vi esac AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + LIBS="-l$cf_stdcpp_libname $LIBS" AC_TRY_LINK([ #include ],[ char buf[80]; @@ -5223,6 +5259,36 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29 +dnl ---------- +dnl check for va_copy, part of stdarg.h +dnl Also, workaround for glibc's __va_copy, by checking for both. +AC_DEFUN([CF_VA_COPY],[ +AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + va_copy(dst, src)], + cf_cv_have_va_copy=yes, + cf_cv_have_va_copy=no)]) + +test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY) + +AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + __va_copy(dst, src)], + cf_cv_have___va_copy=yes, + cf_cv_have___va_copy=no)]) + +test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY) +]) +dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings @@ -5693,7 +5759,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 29 updated: 2009/07/16 21:07:04 +dnl CF_XOPEN_SOURCE version: 32 updated: 2010/01/09 11:05:50 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -5704,14 +5770,19 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ -AC_REQUIRE([CF_PROG_CC_U_D]) - cf_XOPEN_SOURCE=ifelse($1,,500,$1) cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) +cf_xopen_source= case $host_os in #(vi aix[[456]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" + cf_xopen_source="-D_ALL_SOURCE" + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -5719,16 +5790,16 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; hpux11*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE -D_XOPEN_SOURCE=500" + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[[56]].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE @@ -5743,16 +5814,16 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" + cf_xopen_source="-D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ @@ -5775,11 +5846,14 @@ make an error if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi ])