X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=f4b17a29867013a188b2889ea8d5309aaaff05ef;hp=7438acc170daa1e4474240c0d01a299a9e439667;hb=18f51bcf99101e5bf4c737239c44064227f34db8;hpb=a90dd7b66fa711acd24d8181ea20e4f57d4b36cd diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 7438acc1..f4b17a29 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -29,7 +29,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey dnl -dnl $Id: aclocal.m4,v 1.153 2020/02/08 21:04:00 tom Exp $ +dnl $Id: aclocal.m4,v 1.154 2020/02/27 10:21:59 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -2576,7 +2576,7 @@ printf("old\n"); ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CONFIG version: 21 updated: 2018/06/20 20:23:13 +dnl CF_NCURSES_CONFIG version: 23 updated: 2020/02/27 05:21:59 dnl ----------------- dnl Tie together the configure-script macros for ncurses, preferring these in dnl order: @@ -2598,11 +2598,47 @@ if test "x${PKG_CONFIG:=none}" != xnone; then AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work) cf_have_ncuconfig=unknown + cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" - CF_ADD_CFLAGS(`$PKG_CONFIG --cflags $cf_ncuconfig_root`) - CF_ADD_LIBS(`$PKG_CONFIG --libs $cf_ncuconfig_root`) + cf_pkg_cflags=`$PKG_CONFIG --cflags $cf_ncuconfig_root` + cf_pkg_libs=`$PKG_CONFIG --libs $cf_ncuconfig_root` + + # while -W for passing linker flags is prevalent, it is not "standard". + # At least one wrapper for c89/c99 (in Apple's xcode) has its own + # incompatible _and_ non-standard -W option which gives an error. Work + # around that pitfall. + case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in + (x*c[[89]]9@@*-W*) + CF_ADD_CFLAGS($cf_pkg_cflags) + CF_ADD_LIBS($cf_pkg_libs) + + AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], + [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], + [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> + int main(void) + { char *xx = curses_version(); return (xx == 0); }], + [cf_test_ncuconfig=yes], + [cf_test_ncuconfig=no], + [cf_test_ncuconfig=maybe])], + [cf_test_ncuconfig=no]) + + CFLAGS="$cf_save_CFLAGS" + CPPFLAGS="$cf_save_CPPFLAGS" + LIBS="$cf_save_LIBS" + + if test "x$cf_test_ncuconfig" != xyes; then + cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[[^ ]]*//g'` + cf_pkg_cflags="$cf_temp" + cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[[^ ]]*//g'` + cf_pkg_libs="$cf_temp" + fi + ;; + esac + + CF_ADD_CFLAGS($cf_pkg_cflags) + CF_ADD_LIBS($cf_pkg_libs) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],