X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=aclocal.m4;h=892e62827fc707ddbc4e79137e640fbc5036c6a6;hp=6bbb13254db4b56f04ab54a03186117e52bb1269;hb=a3754ea95eea6118bd49f0507f35a7ef15b41a6c;hpb=7ca9d1eb1a8a995514d4dee312bf136fba88ec62 diff --git a/aclocal.m4 b/aclocal.m4 index 6bbb1325..892e6282 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-2011,2012 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.581 2011/10/30 21:13:25 tom Exp $ +dnl $Id: aclocal.m4,v 1.622 2012/08/26 14:01:23 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -996,7 +996,40 @@ then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CPP_PARAM_INIT version: 4 updated: 2001/04/07 22:31:18 +dnl CF_CLANG_COMPILER version: 1 updated: 2012/06/16 14:55:39 +dnl ----------------- +dnl Check if the given compiler is really clang. clang's C driver defines +dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does +dnl not ignore some gcc options. +dnl +dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to +dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from +dnl the wrappers for gcc and g++ warnings. +dnl +dnl $1 = GCC (default) or GXX +dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS +dnl $3 = CFLAGS (default) or CXXFLAGS +AC_DEFUN([CF_CLANG_COMPILER],[ +ifelse([$2],,CLANG_COMPILER,[$2])=no + +if test "$ifelse([$1],,[$1],GCC)" = yes ; then + AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) + cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" + ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments" + AC_TRY_COMPILE([],[ +#ifdef __clang__ +#else +make an error +#endif +],[ifelse([$2],,CLANG_COMPILER,[$2])=yes +cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" +],[]) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_CPP_PARAM_INIT version: 5 updated: 2011/12/03 16:54:03 dnl ----------------- dnl Check if the C++ compiler accepts duplicate parameter initialization. This dnl is a late feature for the standard and is not in some recent compilers @@ -1020,7 +1053,7 @@ TEST::TEST(int x = 1) // some compilers do not like second initializer { value = x; } -void main() { } +int main() { } ], [cf_cv_cpp_param_init=yes], [cf_cv_cpp_param_init=no], @@ -1135,7 +1168,7 @@ cerr << "testing" << endl; fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41 +dnl CF_C_INLINE version: 4 updated: 2012/06/16 14:55:39 dnl ----------- dnl Check if the C compiler supports "inline". dnl $1 is the name of a shell variable to set if inline is supported @@ -1146,6 +1179,9 @@ $1= if test "$ac_cv_c_inline" != no ; then $1=inline if test "$INTEL_COMPILER" = yes + then + : + elif test "$CLANG_COMPILER" = yes then : elif test "$GCC" = yes @@ -1193,6 +1229,43 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57 +dnl --------------- +dnl You can always use "make -n" to see the actual options, but it's hard to +dnl pick out/analyze warning messages when the compile-line is long. +dnl +dnl Sets: +dnl ECHO_LT - symbol to control if libtool is verbose +dnl ECHO_LD - symbol to prefix "cc -o" lines +dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) +dnl SHOW_CC - symbol to put before explicit "cc -c" lines +dnl ECHO_CC - symbol to put before any "cc" line +dnl +AC_DEFUN([CF_DISABLE_ECHO],[ +AC_MSG_CHECKING(if you want to see long compiling messages) +CF_ARG_DISABLE(echo, + [ --disable-echo display "compiling" commands], + [ + ECHO_LT='--silent' + ECHO_LD='@echo linking [$]@;' + RULE_CC='@echo compiling [$]<' + SHOW_CC='@echo compiling [$]@' + ECHO_CC='@' +],[ + ECHO_LT='' + ECHO_LD='' + RULE_CC='' + SHOW_CC='' + ECHO_CC='' +]) +AC_MSG_RESULT($enableval) +AC_SUBST(ECHO_LT) +AC_SUBST(ECHO_LD) +AC_SUBST(RULE_CC) +AC_SUBST(SHOW_CC) +AC_SUBST(ECHO_CC) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the @@ -1259,7 +1332,7 @@ if test "$cf_disable_rpath_hack" = no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_ENABLE_PC_FILES version: 6 updated: 2011/09/10 16:31:04 +dnl CF_ENABLE_PC_FILES version: 9 updated: 2012/08/04 13:59:54 dnl ------------------ dnl This is the "--enable-pc-files" option, which is available if there is a dnl pkg-config configuration on the local machine. @@ -1267,17 +1340,16 @@ AC_DEFUN([CF_ENABLE_PC_FILES],[ AC_REQUIRE([CF_PKG_CONFIG]) AC_REQUIRE([CF_WITH_PKG_CONFIG_LIBDIR]) -if test "$PKG_CONFIG" != no ; then - if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then - AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) - AC_ARG_ENABLE(pc-files, - [ --enable-pc-files generate and install .pc files for pkg-config], - [enable_pc_files=$enableval], - [enable_pc_files=no]) - AC_MSG_RESULT($enable_pc_files) - elif test -z "$PKG_CONFIG_LIBDIR" || test "$PKG_CONFIG_LIBDIR" != no; then - enable_pc_files=no - AC_MSG_WARN(did not find $PKG_CONFIG library) +if test "$PKG_CONFIG" != none ; then + AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) + AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) + AC_MSG_RESULT($enable_pc_files) + if test "$enable_pc_files" != no + then + CF_PATH_SYNTAX(PKG_CONFIG_LIBDIR) fi else enable_pc_files=no @@ -1298,6 +1370,37 @@ AC_ARG_ENABLE(rpath, AC_MSG_RESULT($cf_cv_enable_rpath) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_STRING_HACKS version: 1 updated: 2012/02/25 06:33:21 +dnl ---------------------- +dnl On a few platforms, the compiler and/or loader nags with untruthful +dnl comments stating that "most" uses of strcat/strcpy/sprintf are incorrect, +dnl and implying that most uses of the recommended alternatives are correct. +dnl +dnl Factually speaking, no one has actually counted the number of uses of these +dnl functions versus the total of incorrect uses. Samples of a few thousand +dnl instances are meaningless compared to the hundreds of millions of lines of +dnl existing C code. +dnl +dnl strlcat/strlcpy are (as of 2012) non-standard, and are available on some +dnl platforms, in implementations of varying quality. Likewise, snprintf is +dnl standard - but evolved through phases, and older implementations are likely +dnl to yield surprising results, as documented in manpages on various systems. +AC_DEFUN([CF_ENABLE_STRING_HACKS], +[ +AC_MSG_CHECKING(if you want to work around bogus compiler/loader warnings) +AC_ARG_ENABLE(string-hacks, + [ --enable-string-hacks work around bogus compiler/loader warnings], + [with_string_hacks=$enableval], + [with_string_hacks=no]) +AC_MSG_RESULT($with_string_hacks) + +if test "x$with_string_hacks" = "xyes"; then + AC_DEFINE(USE_STRING_HACKS) + AC_MSG_WARN(enabling string-hacks to work around bogus compiler/loader warnings) + AC_CHECK_FUNCS( strlcat strlcpy snprintf ) +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 dnl -------- dnl Check if 'errno' is declared in @@ -1306,7 +1409,7 @@ AC_DEFUN([CF_ERRNO], CF_CHECK_ERRNO(errno) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ETIP_DEFINES version: 3 updated: 2003/03/22 19:13:43 +dnl CF_ETIP_DEFINES version: 5 updated: 2012/02/18 17:51:07 dnl --------------- dnl Test for conflicting definitions of exception in gcc 2.8.0, etc., between dnl math.h and builtin.h, only for ncurses @@ -1315,11 +1418,17 @@ AC_DEFUN([CF_ETIP_DEFINES], AC_MSG_CHECKING(for special defines needed for etip.h) cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" + +# etip.h includes ncurses.h which includes ncurses_dll.h +# But ncurses_dll.h is generated - fix here. +test -d include || mkdir include +test -f include/ncurses_dll.h || sed -e 's/@NCURSES_WRAP_PREFIX@/'$NCURSES_WRAP_PREFIX'/g' ${srcdir}/include/ncurses_dll.h.in >include/ncurses_dll.h + for cf_math in "" MATH_H do for cf_excp in "" MATH_EXCEPTION do - CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -I${srcdir}/include" + CXXFLAGS="$cf_save_CXXFLAGS -I${srcdir}/c++ -I${srcdir}/menu -Iinclude -I${srcdir}/include" test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" AC_TRY_COMPILE([ @@ -1328,7 +1437,7 @@ AC_TRY_COMPILE([ test -n "$cf_math" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_math}) test -n "$cf_excp" && AC_DEFINE_UNQUOTED(ETIP_NEEDS_${cf_excp}) cf_result="$cf_math $cf_excp" - break + break 2 ],[]) done done @@ -1466,6 +1575,25 @@ ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_FIXUP_ADAFLAGS version: 1 updated: 2012/03/31 18:48:10 +dnl ----------------- +dnl make ADAFLAGS consistent with CFLAGS +AC_DEFUN([CF_FIXUP_ADAFLAGS],[ + AC_MSG_CHECKING(optimization options for ADAFLAGS) + case "$CFLAGS" in + *-g*) + CF_ADD_ADAFLAGS(-g) + ;; + esac + case "$CFLAGS" in + *-O*) + cf_O_flag=`echo "$CFLAGS" |sed -e 's/^.*-O/-O/' -e 's/[[ ]].*//'` + CF_ADD_ADAFLAGS($cf_O_flag) + ;; + esac + AC_MSG_RESULT($ADAFLAGS) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02 dnl ------------- dnl Test for dlsym() and related functions, as well as libdl. @@ -1594,14 +1722,17 @@ AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[ ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_POLL version: 4 updated: 2006/12/16 12:33:30 +dnl CF_FUNC_POLL version: 7 updated: 2012/06/09 16:22:17 dnl ------------ dnl See if the poll function really works. Some platforms have poll(), but dnl it does not work for terminals or files. AC_DEFUN([CF_FUNC_POLL],[ AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ AC_TRY_RUN([ +#include #include +#include +#include #ifdef HAVE_POLL_H #include #else @@ -1611,11 +1742,34 @@ int main() { struct pollfd myfds; int ret; - myfds.fd = 0; + /* check for Darwin bug with respect to "devices" */ + myfds.fd = open("/dev/null", 1); /* O_WRONLY */ + if (myfds.fd < 0) + myfds.fd = 0; myfds.events = POLLIN; + myfds.revents = 0; ret = poll(&myfds, 1, 100); - ${cf_cv_main_return:-return}(ret != 0); + + if (ret < 0 || (myfds.revents & POLLNVAL)) { + ret = -1; + } else { + int fd = 0; + if (!isatty(fd)) { + fd = open("/dev/tty", 2); /* O_RDWR */ + } + + if (fd >= 0) { + /* also check with standard input */ + myfds.fd = fd; + myfds.events = POLLIN; + myfds.revents = 0; + ret = poll(&myfds, 1, 100); + } else { + ret = -1; + } + } + ${cf_cv_main_return:-return}(ret < 0); }], [cf_cv_working_poll=yes], [cf_cv_working_poll=no], @@ -1821,7 +1975,7 @@ if test "$GCC" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32 +dnl CF_GCC_WARNINGS version: 29 updated: 2012/06/16 14:55:39 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: @@ -1844,6 +1998,7 @@ AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) +CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) cat > conftest.$ac_ext <&1 | \ AC_MSG_RESULT($cf_gnat_version) case $cf_gnat_version in #(vi -3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi +3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|20[[0-9]][[0-9]]) #(vi cf_cv_prog_gnat_correct=yes ;; *) @@ -2320,21 +2482,21 @@ if test "$GXX" = yes; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18 +dnl CF_GXX_VERSION version: 7 updated: 2012/06/16 14:55:39 dnl -------------- dnl Check for version of g++ AC_DEFUN([CF_GXX_VERSION],[ AC_REQUIRE([AC_PROG_CPP]) GXX_VERSION=none if test "$GXX" = yes; then - AC_MSG_CHECKING(version of g++) + AC_MSG_CHECKING(version of ${CXX:-g++}) GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown AC_MSG_RESULT($GXX_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37 +dnl CF_GXX_WARNINGS version: 7 updated: 2012/06/16 14:55:39 dnl --------------- dnl Check if the compiler supports useful warning options. dnl @@ -2357,6 +2519,7 @@ AC_DEFUN([CF_GXX_WARNINGS], [ CF_INTEL_COMPILER(GXX,INTEL_CPLUSPLUS,CXXFLAGS) +CF_CLANG_COMPILER(GXX,CLANG_CPLUSPLUS,CXXFLAGS) AC_REQUIRE([CF_GXX_VERSION]) @@ -2950,11 +3113,11 @@ CF_SUBDIR_PATH($1,$2,lib) $1="$cf_library_path_list [$]$1" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 +dnl CF_LIB_PREFIX version: 9 updated: 2012/01/21 19:28:10 dnl ------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set -AC_DEFUN([CF_LIB_PREFIX], +define([CF_LIB_PREFIX], [ case $cf_cv_system_name in #(vi OS/2*|os2*) #(vi @@ -2967,7 +3130,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30 +dnl CF_LIB_RULES version: 65 updated: 2012/06/30 17:25:25 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2982,13 +3145,15 @@ dnl lib.so. -> dnl lib.so.. AC_DEFUN([CF_LIB_RULES], [ -CF_LIB_PREFIX(cf_prefix) +cf_prefix=$LIB_PREFIX AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) -if test $cf_cv_shlib_version = cygdll ; then +case $cf_cv_shlib_version in #(vi +cygdll|mingw) TINFO_NAME=$TINFO_ARG_SUFFIX TINFO_SUFFIX=.dll -fi + ;; +esac if test -n "$TINFO_SUFFIX" ; then case $TINFO_SUFFIX in @@ -3074,11 +3239,18 @@ do # cygwin needs import library, and has unique naming convention # use autodetected ${cf_prefix} for import lib and static lib, but # use 'cyg' prefix for shared lib. - if test $cf_cv_shlib_version = cygdll ; then + case $cf_cv_shlib_version in #(vi + cygdll) #(vi cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}${cf_cygsuf}" continue - fi + ;; + mingw) + cf_cygsuf=`echo "$cf_suffix" | sed -e 's/\.dll/\${ABI_VERSION}.dll/'` + LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/lib${cf_dir}${cf_cygsuf}" + continue + ;; + esac fi LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/${cf_prefix}${cf_dir}${cf_suffix}" done @@ -3122,7 +3294,7 @@ do mv $cf_dir/Makefile.out $cf_dir/Makefile $AWK -f $srcdir/mk-0th.awk \ - libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" \ + libname="${cf_dir}${LIB_SUFFIX}" subsets="$LIB_SUBSETS" ticlib="$TICS_LIB_SUFFIX" termlib="$TINFO_LIB_SUFFIX" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile for cf_subset in $cf_subsets @@ -3204,6 +3376,7 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + driver=$cf_cv_term_driver \ SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ @@ -3486,7 +3659,7 @@ fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 17 updated: 2011/07/02 15:36:04 +dnl CF_LIB_SUFFIX version: 18 updated: 2012/02/25 15:20:07 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name @@ -3519,7 +3692,7 @@ AC_DEFUN([CF_LIB_SUFFIX], $2='.a' $3=[$]$2 ;; - cygwin*) #(vi + cygwin*|mingw*) #(vi $2='.dll' $3='.dll.a' ;; @@ -3993,7 +4166,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 40 updated: 2011/09/10 16:20:21 +dnl CF_MAN_PAGES version: 41 updated: 2012/08/11 19:35:44 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -4050,6 +4223,7 @@ cat >$cf_edit_man <mk_shared_lib.sh <<-CF_EOF + #!/bin/sh + SHARED_LIB=\[$]1 + IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` + shift + cat <<-EOF + Linking shared library + ** SHARED_LIB \[$]SHARED_LIB + ** IMPORT_LIB \[$]IMPORT_LIB +EOF + exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} +CF_EOF + chmod +x mk_shared_lib.sh + ;; openbsd[[2-9]].*|mirbsd*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" @@ -5500,6 +5697,9 @@ CF_EOF test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}" test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}" + CF_VERBOSE(CC_SHARED_OPTS: $CC_SHARED_OPTS) + CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB) + AC_SUBST(CC_SHARED_OPTS) AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) @@ -5695,7 +5895,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 22 updated: 2011/10/22 14:58:07 +dnl CF_SRC_MODULES version: 26 updated: 2012/01/07 15:08:24 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -5718,6 +5918,7 @@ else TEST_ARG2="-l${LIB_NAME}${DFT_ARG_SUFFIX} $TEST_ARG2" fi +PC_MODULES_TO_MAKE="ncurses${DFT_ARG_SUFFIX}" cf_cv_src_modules= for cf_dir in $1 do @@ -5756,6 +5957,7 @@ do TEST_ARGS="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARGS" TEST_ARG2="-l${cf_dir}${DFT_ARG_SUFFIX} $TEST_ARG2" fi + PC_MODULES_TO_MAKE="${PC_MODULES_TO_MAKE} ${cf_dir}${DFT_ARG_SUFFIX}" fi fi done @@ -5783,7 +5985,15 @@ if test "x$cf_with_tests" != "xno" ; then SRC_SUBDIRS="$SRC_SUBDIRS test" fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" -test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" +if test "$cf_with_cxx_binding" != no; then + PC_MODULES_TO_MAKE="${PC_MODULES_TO_MAKE} ncurses++${DFT_ARG_SUFFIX}" + SRC_SUBDIRS="$SRC_SUBDIRS c++" +fi + +test "x$with_termlib" != xno && PC_MODULES_TO_MAKE="$PC_MODULES_TO_MAKE $TINFO_ARG_SUFFIX" +test "x$with_ticlib" != xno && PC_MODULES_TO_MAKE="$PC_MODULES_TO_MAKE $TICS_ARG_SUFFIX" + +AC_SUBST(PC_MODULES_TO_MAKE) ADA_SUBDIRS= if test "x$cf_with_ada" = "xyes" && test "x$cf_cv_prog_gnat_correct" = xyes && test -f $srcdir/Ada95/Makefile.in; then @@ -6583,6 +6793,32 @@ AC_SUBST(LIB_LINK) AC_SUBST(LIB_INSTALL) AC_SUBST(LIB_UNINSTALL) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_LIB_PREFIX version: 1 updated: 2012/01/21 19:28:10 +dnl ------------------ +dnl Allow the library-prefix to be overridden. OS/2 EMX originally had no +dnl "lib" prefix, e.g., because it used the dll naming convention. +dnl +dnl $1 = variable to set +AC_DEFUN([CF_WITH_LIB_PREFIX], +[ +AC_MSG_CHECKING(if you want to have a library-prefix) +AC_ARG_WITH(lib-prefix, + [ --with-lib-prefix override library-prefix], + [with_lib_prefix=$withval], + [with_lib_prefix=auto]) +AC_MSG_RESULT($with_lib_prefix) + +if test $with_lib_prefix = auto +then + CF_LIB_PREFIX($1) +elif test $with_lib_prefix = no +then + LIB_PREFIX= +else + LIB_PREFIX=$with_lib_prefix +fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 @@ -6602,7 +6838,7 @@ ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl if ifelse([$5],,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi -$3="$withval" +eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- @@ -6643,16 +6879,16 @@ esac cf_dst_path=`echo "$cf_dst_path" | sed -e 's/\\\\/\\\\\\\\/g'` ]) -eval '$3="$cf_dst_path"' +eval $3="$cf_dst_path" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 1 updated: 2011/09/10 16:20:21 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 2 updated: 2011/12/10 18:58:47 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ -if test "$PKG_CONFIG" != no ; then +if test "$PKG_CONFIG" != none ; then AC_MSG_CHECKING(for $PKG_CONFIG library directory) AC_ARG_WITH(pkg-config-libdir, [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], @@ -6691,7 +6927,7 @@ fi AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 +dnl CF_WITH_PTHREAD version: 5 updated: 2011/12/10 19:01:56 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -6707,23 +6943,28 @@ if test "$with_pthread" != no ; then AC_CHECK_HEADER(pthread.h,[ AC_DEFINE(HAVE_PTHREADS_H) - AC_MSG_CHECKING(if we can link with the pthread library) - cf_save_LIBS="$LIBS" - CF_ADD_LIB(pthread) - AC_TRY_LINK([ + for cf_lib_pthread in pthread c_r + do + AC_MSG_CHECKING(if we can link with the $cf_lib_pthread library) + cf_save_LIBS="$LIBS" + CF_ADD_LIB($cf_lib_pthread) + AC_TRY_LINK([ #include ],[ - int rc = pthread_create(0,0,0,0); + int rc = pthread_create(0,0,0,0); + int r2 = pthread_mutexattr_settype(0, 0); ],[with_pthread=yes],[with_pthread=no]) - LIBS="$cf_save_LIBS" - AC_MSG_RESULT($with_pthread) - - if test "$with_pthread" = yes ; then - CF_ADD_LIB(pthread) - AC_DEFINE(HAVE_LIBPTHREADS) - else - AC_MSG_ERROR(Cannot link with pthread library) - fi + LIBS="$cf_save_LIBS" + AC_MSG_RESULT($with_pthread) + test "$with_pthread" = yes && break + done + + if test "$with_pthread" = yes ; then + CF_ADD_LIB($cf_lib_pthread) + AC_DEFINE(HAVE_LIBPTHREADS) + else + AC_MSG_ERROR(Cannot link with pthread library) + fi ]) fi ]) @@ -6791,7 +7032,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 39 updated: 2011/10/30 17:09:50 +dnl CF_XOPEN_SOURCE version: 42 updated: 2012/01/07 08:26:49 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, @@ -6818,6 +7059,7 @@ darwin[[0-8]].*) #(vi ;; darwin*) #(vi cf_xopen_source="-D_DARWIN_C_SOURCE" + cf_XOPEN_SOURCE= ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6835,16 +7077,24 @@ hpux*) #(vi ;; irix[[56]].*) #(vi cf_xopen_source="-D_SGI_SOURCE" + cf_XOPEN_SOURCE= ;; linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi - # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks + # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types + cf_XOPEN_SOURCE= + CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; netbsd*) #(vi cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; +openbsd[[4-9]]*) #(vi + # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw + cf_xopen_source="-D_BSD_SOURCE" + cf_XOPEN_SOURCE=600 + ;; openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;;