X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=e96b6d16df243d082fa451e5b605283f3782585c;hp=2ca7a95f80eb473259c2f2149cc11fd361b123f5;hb=HEAD;hpb=235aa9c4f39efed13a7b9a40d191f3a591095f75 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 2ca7a95f..3d7c8056 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.209 2024/01/19 18:06:12 tom Exp $ +dnl $Id: aclocal.m4,v 1.212 2024/05/18 19:51:00 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 @@ -1395,19 +1395,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 @@ -3983,7 +4000,7 @@ do done ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 109 updated: 2023/12/03 09:21:34 +dnl CF_SHARED_OPTS version: 111 updated: 2024/03/29 20:08:49 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4443,11 +4460,11 @@ CF_EOF # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" + LOCAL_LDFLAGS="-R\$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi if test "$cf_cv_enable_rpath" = yes ; then - EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="-R\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then @@ -4459,9 +4476,9 @@ CF_EOF done CFLAGS="$cf_save_CFLAGS" CC_SHARED_OPTS=$cf_shared_opts - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $[@]' + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' + MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -Wl,-h,'$cf_cv_shared_soname' -o $[@]' fi ;; (sysv5uw7*|unix_sv*) @@ -4747,6 +4764,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.