X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=b9982e77a6d65ffcef193705c9c369a1b060878a;hp=f4b17a29867013a188b2889ea8d5309aaaff05ef;hb=1f7a36fe16b11bb4aab51be89bbc1b0f75936b78;hpb=18f51bcf99101e5bf4c737239c44064227f34db8 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index f4b17a29..b9982e77 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.154 2020/02/27 10:21:59 tom Exp $ +dnl $Id: aclocal.m4,v 1.161 2020/08/29 13:18:29 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -100,10 +100,11 @@ AC_DEFUN([CF_ADD_ADAFLAGS],[ AC_SUBST(ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40 +dnl CF_ADD_CFLAGS version: 14 updated: 2020/04/04 16:16:13 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS -dnl The second parameter if given makes this macro verbose. +dnl $1 = flags to add +dnl $2 = if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily @@ -355,6 +356,12 @@ dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- +dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 +dnl ------------- +dnl Allow user to enable a normally-off option. +AC_DEFUN([CF_ARG_ENABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl +dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus @@ -378,7 +385,7 @@ ifelse([$3],,[ :]dnl ])dnl ])])dnl dnl --------------------------------------------------------------------------- -dnl CF_AR_FLAGS version: 6 updated: 2015/10/10 15:25:05 +dnl CF_AR_FLAGS version: 7 updated: 2020/04/04 11:37:29 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl @@ -389,39 +396,55 @@ AC_DEFUN([CF_AR_FLAGS],[ AC_REQUIRE([CF_PROG_AR]) AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ - cf_cv_ar_flags=unknown - for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv - do + case $cf_cv_system_name in + (*-msvc*) + cf_cv_ar_flags='' + cat >mk_static_lib.sh <<-EOF + #!$SHELL + MSVC_BIN="[$]AR" + out="\[$]1" + shift + exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ + EOF + chmod +x mk_static_lib.sh + AR=`pwd`/mk_static_lib.sh + ;; + (*) + cf_cv_ar_flags=unknown + for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv + do - # check if $ARFLAGS already contains this choice - if test "x$ARFLAGS" != "x" ; then - cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` - if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then - cf_cv_ar_flags= - break + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi fi - fi - rm -f conftest.$ac_cv_objext - rm -f conftest.a + rm -f conftest.$ac_cv_objext + rm -f conftest.a - cat >conftest.$ac_ext <conftest.$ac_ext <&AC_FD_CC - $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null - if test -f conftest.a ; then - cf_cv_ar_flags=$cf_ar_flags + if AC_TRY_EVAL(ac_compile) ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + CF_VERBOSE(cannot compile test-program) break fi - else - CF_VERBOSE(cannot compile test-program) - break - fi - done - rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext + ;; + esac ]) if test -n "$ARFLAGS" ; then @@ -680,13 +703,13 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GNAT_VERSION version: 2 updated: 2019/12/31 08:53:54 +dnl CF_CHECK_GNAT_VERSION version: 3 updated: 2020/05/23 19:39:36 dnl --------------------- AC_DEFUN([CF_CHECK_GNAT_VERSION], [ AC_REQUIRE([CF_GNAT_VERSION]) case $cf_cv_gnat_version in -(3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|20[[0-9]][[0-9]]) +(3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*|[[1-9]][[0-9]].[[0-9]]*|20[[0-9]][[0-9]]) cf_cv_prog_gnat_correct=yes ;; (*) @@ -696,7 +719,7 @@ case $cf_cv_gnat_version in esac ]) dnl --------------------------------------------------------------------------- -dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35 +dnl CF_CLANG_COMPILER version: 3 updated: 2020/08/28 04:10:22 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 @@ -727,9 +750,13 @@ cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments" ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi + +if test "x$CLANG_COMPILER" = "xyes" ; then + CF_APPEND_TEXT(CFLAGS,-Wno-error=implicit-function-declaration) +fi ]) dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 3 updated: 2020/01/11 18:39:22 +dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. @@ -759,7 +786,7 @@ AC_TRY_COMPILE( #include #include ], -[String foo = malloc(1)],[ +[String foo = malloc(1); (void)foo],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ AC_TRY_COMPILE( @@ -789,7 +816,7 @@ esac ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 3 updated: 2020/01/11 18:39:22 +dnl CF_CONST_X_STRING version: 4 updated: 2020/03/10 18:53:47 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. @@ -819,7 +846,7 @@ AC_TRY_COMPILE( #include #include ], -[String foo = malloc(1)],[ +[String foo = malloc(1); (void)foo],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ AC_TRY_COMPILE( @@ -951,6 +978,29 @@ fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_WARNINGS version: 6 updated: 2020/08/28 04:10:22 +dnl ------------------ +dnl Configure-option to enable gcc warnings +AC_DEFUN([CF_ENABLE_WARNINGS],[ +if ( test "$GCC" = yes || test "$GXX" = yes ) +then +CF_FIX_WARNINGS(CFLAGS) +CF_FIX_WARNINGS(CPPFLAGS) +CF_FIX_WARNINGS(LDFLAGS) +AC_MSG_CHECKING(if you want to turn on gcc warnings) +CF_ARG_ENABLE(warnings, + [ --enable-warnings test: turn on gcc compiler warnings], + [with_warnings=yes], + [with_warnings=no]) +AC_MSG_RESULT($with_warnings) +if test "$with_warnings" = "yes" +then + CF_GCC_ATTRIBUTES + CF_GCC_WARNINGS($1) +fi +fi +])dnl +dnl --------------------------------------------------------------------------- dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 dnl --------------- dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We @@ -1151,7 +1201,41 @@ AC_DEFUN([CF_FIXUP_ADAFLAGS],[ AC_MSG_RESULT($ADAFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00 +dnl CF_FIX_WARNINGS version: 2 updated: 2020/08/28 15:08:28 +dnl --------------- +dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's +dnl "-Werror" flags can interfere with configure-checks. Those go into +dnl EXTRA_CFLAGS. +dnl +dnl $1 = variable name to repair +define([CF_FIX_WARNINGS],[ +if ( test "$GCC" = yes || test "$GXX" = yes ) +then + case [$]$1 in + (*-Werror=*) + CF_VERBOSE(repairing $1: [$]$1) + cf_temp_flags= + for cf_temp_scan in [$]$1 + do + case "x$cf_temp_scan" in + (x-Werror=*) + CF_APPEND_TEXT(EXTRA_CFLAGS,"$cf_temp_scan") + ;; + (*) + CF_APPEND_TEXT(cf_temp_flags,"$cf_temp_scan") + ;; + esac + done + $1="$cf_temp_flags" + CF_VERBOSE(... fixed [$]$1) + CF_VERBOSE(... extra $EXTRA_CFLAGS) + ;; + esac +fi +AC_SUBST(EXTRA_CFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GCC_ATTRIBUTES version: 18 updated: 2020/03/10 18:53:47 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1195,7 +1279,7 @@ cat > conftest.$ac_ext <mk_shared_lib.sh <<-CF_EOF + #!$SHELL + SHARED_LIB=\[$]1 + IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.lib/'\` + shift + my_ld=\[$]1 + shift + cat <<-EOF + Linking shared library + ** SHARED LIB \$SHARED_LIB + ** IMPORT_LIB \$IMPORT_LIB +EOF + args=\$(echo \[$]* | sed -E "s#-l(\w*)#\1.dll.lib#g" | sed -E "s#-L(\w*)#-LIBPATH:\1#g") + exec \$my_ld -DLL -IMPLIB:"\${IMPORT_LIB}" -OUT:"\${SHARED_LIB}" ${LDFLAGS} \$args + mv "\${IMPORT_LIB}" "\${IMPORT_LIB}" +CF_EOF + chmod +x mk_shared_lib.sh + cat >mk_prog.sh <<-CF_EOF + #!$SHELL + shift + # Ignore first argument (compiler) and use LD (link.exe) unconditionally + LD="[$]LD" + clopts=() + ldopts=("/subsystem:console") + libs=() + isdll=0 + while test \[$]# -gt 0; do + case "\[$]1" in + -link) + # ignore -link argument + ;; + -M[[TD]] | -M[[TD]]d) + # ignore runtime-library option + ;; + -dll) + isdll=1 + ;; + -W* | -w*) + # ignore warnings + ;; + -D*) + clopts+=("\[$]1") + ;; + -I*) + clopts+=("\[$]1") + ;; + -l*) + libs+=("\`echo \"\[$]1\" | sed \"s/^-l//\"\`") + ;; + -L*) + ldopts+=("\`echo \"\[$]1\" | sed \"s/^-L/-LIBPATH:/\"\`") + ;; + *.obj | *.o) + ldopts+=("\[$]1") + ;; + -Wl,*) + for linkarg in \`echo '\[$]1' | sed -e 's/-Wl,//' -e 's/,/ /'\`; do + ldopts+=("\[$]{linkarg}") + done + ;; + *.lib) + ldopts+=("\[$]1") + ;; + -o) + shift + ldopts+=("-out:\[$]1") + ;; + *) + clopts+=("\[$]1") + ldopts+=("\[$]1") + ;; + esac + shift + done + if [[ "\$isdll" -ne 0 ]]; then + for lib in \[$]{libs[[*]]}; do + ldopts+=("\[$]lib.dll.lib") + done + else + for lib in \[$]{libs[[*]]}; do + ldopts+=("\[$]lib.lib") + done + fi + cat <<-EOF + Creating program + ** ld options: "\[$]{ldopts[[@]]}" +EOF + exec \[$]LD \[$]{ldopts[[@]]} +CF_EOF + chmod +x mk_prog.sh + LINK_PROGS="$SHELL ${rel_builddir}/mk_prog.sh" + LINK_TESTS="$SHELL ${rel_builddir}/mk_prog.sh" + ;; (mingw*) cf_cv_shlib_version=mingw cf_cv_shlib_version_infix=mingw @@ -3758,6 +3976,14 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; + (nskJ*) + CC_SHARED_OPTS= + MK_SHARED_LIB='${LD} -Wshared -Weld=-export_all -o $[@]' + ;; + (nskL*) + CC_SHARED_OPTS= + MK_SHARED_LIB='${LD} -Wshared -Wxld=-export_all -o $[@]' + ;; (nto-qnx*|openbsd*|freebsd[[12]].*) CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $[@]' @@ -3789,7 +4015,7 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $[@]' + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -o $[@]' fi ;; (osf*|mls+*) @@ -3984,7 +4210,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_TERM_HEADER version: 4 updated: 2015/04/15 19:08:48 +dnl CF_TERM_HEADER version: 5 updated: 2020/03/19 20:23:48 dnl -------------- dnl Look for term.h, which is part of X/Open curses. It defines the interface dnl to terminfo database. Usually it is in the same include-path as curses.h, @@ -4005,7 +4231,7 @@ do AC_TRY_COMPILE([#include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> -],[int x = auto_left_margin],[ +],[int x = auto_left_margin; (void)x],[ cf_cv_term_header="$cf_test"],[ cf_cv_term_header=unknown ])