X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=e96b6d16df243d082fa451e5b605283f3782585c;hb=HEAD;hp=6fe1f946e7e6a9ee195ff4f25ca0eb4387ed29db;hpb=382c1d0c3c8959d2e5ffb69e86469d00937aa4ae;p=ncurses.git diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 6fe1f946..b6d9f27c 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.210 2024/03/30 22:17:13 tom Exp $ +dnl $Id: aclocal.m4,v 1.216 2024/06/01 21:38:29 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -477,7 +477,7 @@ fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- -dnl CF_BUILD_CC version: 11 updated: 2022/12/04 15:40:08 +dnl CF_BUILD_CC version: 12 updated: 2024/03/17 09:17:26 dnl ----------- dnl If we're cross-compiling, allow the user to override the tools and their dnl options. The configure script is oriented toward identifying the host @@ -577,9 +577,9 @@ else : ${BUILD_CC:='${CC}'} : ${BUILD_CPP:='${CPP}'} : ${BUILD_CFLAGS:='${CFLAGS}'} - : ${BUILD_CPPFLAGS:='${CPPFLAGS}'} + : ${BUILD_CPPFLAGS:='ifelse([$1],,'${CPPFLAGS}',[$1])'} : ${BUILD_LDFLAGS:='${LDFLAGS}'} - : ${BUILD_LIBS:='${LIBS}'} + : ${BUILD_LIBS:='ifelse([$2],,'${LIBS}',[$2])'} : ${BUILD_EXEEXT:='$x'} : ${BUILD_OBJEXT:='o'} fi @@ -959,67 +959,6 @@ case "$cf_cv_const_x_string" in ;; esac -]) -])dnl -dnl --------------------------------------------------------------------------- -dnl CF_CONST_X_STRING version: 8 updated: 2023/12/01 17:22:50 -dnl ----------------- -dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most -dnl character-strings. -dnl -dnl It is ambiguous because the specification accommodated the pre-ANSI -dnl compilers bundled by more than one vendor in lieu of providing a standard C -dnl compiler other than by costly add-ons. Because of this, the specification -dnl did not take into account the use of const for telling the compiler that -dnl string literals would be in readonly memory. -dnl -dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to -dnl let the compiler decide how to represent Xt's strings which were #define'd. -dnl That does not solve the problem of using the block of Xt's strings which -dnl are compiled into the library (and is less efficient than one might want). -dnl -dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both -dnl when compiling the library and compiling using the library, to tell the -dnl compiler that String is const. -AC_DEFUN([CF_CONST_X_STRING], -[ -AC_REQUIRE([AC_PATH_XTRA]) - -CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) - -AC_TRY_COMPILE( -[ -#include -#include -], -[String foo = malloc(1); free((void*)foo)],[ - -AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ - AC_TRY_COMPILE( - [ -#undef _CONST_X_STRING -#define _CONST_X_STRING /* X11R7.8 (perhaps) */ -#undef XTSTRINGDEFINES /* X11R5 and later */ -#include -#include - ],[String foo = malloc(1); *foo = 0],[ - cf_cv_const_x_string=no - ],[ - cf_cv_const_x_string=yes - ]) -]) - -CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) - -case "$cf_cv_const_x_string" in -(no) - CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) - ;; -(*) - CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) - ;; -esac - ]) ])dnl dnl --------------------------------------------------------------------------- @@ -1395,19 +1334,36 @@ fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_GETTIME version: 2 updated: 2023/02/25 08:45:56 +dnl CF_FUNC_GETTIME version: 3 updated: 2024/05/11 13:40:02 dnl --------------- dnl Check for gettimeofday or clock_gettime. In 2023, the former is still more dnl widely supported, but "deprecated" (2008), so we will use the latter if it dnl is available, to reduce compiler warnings. AC_DEFUN([CF_FUNC_GETTIME],[ -AC_CACHE_CHECK(for clock_gettime,cf_cv_func_clock_gettime,[ - AC_TRY_LINK([#include ], +cf_save_libs="$LIBS" +AC_CHECK_FUNC(clock_gettime, + cf_cv_test_clock_gettime=yes, + AC_CHECK_LIB(rt, clock_gettime, + [LIBS="-lrt $LIBS" + cf_cv_test_clock_gettime=yes], + cf_cv_test_clock_gettime=no)) + +if test "$cf_cv_test_clock_gettime" = yes ; then +AC_CACHE_CHECK(if clock_gettime links,cf_cv_func_clock_gettime,[ + AC_TRY_LINK([ +$ac_includes_default +#include + ], [struct timespec ts; - int rc = clock_gettime(CLOCK_REALTIME, &ts); (void) rc; (void)ts], + int rc = clock_gettime(CLOCK_REALTIME, &ts) + + clock_gettime(CLOCK_MONOTONIC, &ts); + (void) rc; (void)ts], [cf_cv_func_clock_gettime=yes], [cf_cv_func_clock_gettime=no]) ]) +else + cf_cv_func_clock_gettime=no +fi if test "$cf_cv_func_clock_gettime" = yes then @@ -2921,7 +2877,7 @@ AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 6 updated: 2021/01/04 19:33:05 +dnl CF_NCURSES_ADDON version: 7 updated: 2024/06/01 17:37:13 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ @@ -2929,18 +2885,29 @@ AC_REQUIRE([CF_NCURSES_CONFIG]) AC_PROVIDE([CF_SUBST_NCURSES_VERSION]) -AC_MSG_CHECKING(if you want wide-character code) -AC_ARG_ENABLE(widec, - [ --enable-widec compile with wide-char/UTF-8 code], - [with_widec=$enableval], - [with_widec=no]) -AC_MSG_RESULT($with_widec) -if test "$with_widec" = yes ; then +AC_MSG_CHECKING(for specified curses library type) +AC_ARG_WITH(screen, + [ --with-screen=XXX use specified curses-libraries], + [cf_cv_screen=$withval], + [cf_cv_screen=ncurses]) + +case $cf_cv_screen in +(curses|curses_*) + CF_CURSES_CONFIG + ;; +(ncursesw*) CF_UTF8_LIB - CF_NCURSES_CONFIG(ncursesw) -else - CF_NCURSES_CONFIG(ncurses) -fi + CF_NCURSES_CONFIG($cf_cv_screen) + ;; +(ncurses*) + CF_NCURSES_CONFIG($cf_cv_screen) + ;; +(*) + AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen) + ;; +esac + +AC_SUBST(cf_cv_screen) if test "$NCURSES_CONFIG_PKG" != none ; then cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null` @@ -3009,6 +2976,14 @@ AC_SUBST(cf_cv_builtin_bool) AC_SUBST(cf_cv_header_stdbool_h) AC_SUBST(cf_cv_type_of_bool)dnl +AC_CACHE_CHECK(if KEY_RESIZE is supported,cf_cv_curses_resizes,[ + AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>], + [int key = KEY_RESIZE; (void)key], + cf_cv_curses_resizes=yes, + cf_cv_curses_resizes=no)]) +cf_cv_enable_sigwinch=0 +test "$cf_cv_curses_resizes" = yes && cf_cv_enable_sigwinch=1 +AC_SUBST(cf_cv_enable_sigwinch) ]) dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CC_CHECK version: 6 updated: 2023/02/18 17:47:58 @@ -4747,6 +4722,56 @@ weak_symbol(fopen); ]) ])dnl dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA version: 1 updated: 2024/05/18 13:55:23 +dnl ----------- +dnl Check for the Ada compiler (unless requested to not do this), which causes +dnl a further check for a C compiler which can work with the Ada compiler. +AC_DEFUN([CF_WITH_ADA],[ +AC_ARG_WITH(ada, + [ --without-ada suppress check for Ada compiler], + [cf_with_ada=$withval], + [cf_with_ada=yes]) + +cf_prog_cc="gcc cc" +if test "x$cf_with_ada" = xyes +then + CF_PROG_GNAT + if test "x$cf_cv_prog_gnat_correct" = xyes; then + # gcc's developers chose to deprecate gnatgcc before making gprconfig + # work. They replaced gnatgcc in gcc 13 with a script which spits out + # a warning offering advice which could never work. + # + # Here is a workaround. + AC_PATH_PROG(cf_cv_path_gnatgcc,gnatgcc,no) + if test "$cf_cv_path_gnatgcc" != no + then + AC_MSG_CHECKING(for improvement) + cf_file_gnatgcc=`file -L "$cf_cv_path_gnatgcc" 2>/dev/null` + case "x$cf_file_gnatgcc" in + (*script*) + cf_cv_path_gnatgcc=`sh -x "$cf_cv_path_gnatgcc" --version 2>&1 | grep -w exec | sed -e 's/^[[ ]]*+[[ ]]*//' -e 's/exec[[ ]]//' -e 's/ .*//'` + ;; + (*) + cf_cv_path_gnatgcc=no + ;; + esac + AC_MSG_RESULT($cf_cv_path_gnatgcc) + test "$cf_cv_path_gnatgcc" = no && cf_cv_path_gnatgcc=gnatgcc + cf_prog_cc="$cf_cv_path_gnatgcc $cf_prog_cc" + fi + fi +fi +case "$cf_prog_cc" in +(*/*) + CC="$cf_prog_cc" + AC_SUBST(CC) + ;; +(*) + CF_PROG_CC($cf_prog_cc) + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- dnl CF_WITH_ADA_COMPILER version: 3 updated: 2023/10/28 11:59:01 dnl -------------------- dnl Command-line option to specify the Ada95 compiler.