X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=3249c1a8b4aaa8dda11a1b6b020b2b218504609f;hp=f4864461ed46a005eddb3492f5c4c049f037aced;hb=bd75bb126bdbd8300fe73e8e8b2fe97bd07eef75;hpb=52aa842907b31bb56fb5133da3f023b45bd4355f diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index f4864461..3249c1a8 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2010 Free Software Foundation, Inc. * +dnl Copyright (c) 2010,2011 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 dnl -dnl $Id: aclocal.m4,v 1.18 2010/11/13 19:19:59 tom Exp $ +dnl $Id: aclocal.m4,v 1.29 2011/06/05 00:44:26 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -39,6 +39,31 @@ dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_CHECK version: 2 updated: 2011/05/08 11:22:03 +dnl ------------------ +dnl Conditionally generate script according to whether we're using a given autoconf. +dnl +dnl $1 = version to compare against +dnl $2 = code to use if AC_ACVERSION is at least as high as $1. +dnl $3 = code to use if AC_ACVERSION is older than $1. +define(CF_ACVERSION_CHECK, +[ +ifdef([m4_version_compare], +[m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], +[CF_ACVERSION_COMPARE( +AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), +AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ACVERSION_COMPARE version: 2 updated: 2011/04/14 20:56:50 +dnl -------------------- +dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, +dnl MAJOR2, MINOR2, TERNARY2, +dnl PRINTABLE2, not FOUND, FOUND) +define(CF_ACVERSION_COMPARE, +[ifelse(builtin([eval], [$2 < $5]), 1, +[ifelse([$8], , ,[$8])], +[ifelse([$9], , ,[$9])])])dnl +dnl --------------------------------------------------------------------------- dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 @@ -504,7 +529,7 @@ AC_SUBST(BUILD_EXEEXT) AC_SUBST(BUILD_OBJEXT) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CFG_DEFAULTS version: 7 updated: 2005/09/24 16:15:00 +dnl CF_CFG_DEFAULTS version: 8 updated: 2011/06/04 20:09:13 dnl --------------- dnl Determine the default configuration into which we'll install ncurses. This dnl can be overridden by the user's command-line options. There's two items to @@ -522,7 +547,7 @@ AC_MSG_CHECKING(for prefix) if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in # non-vendor systems don't have a conflict - openbsd*|freebsd*|linux*|cygwin*|k*bsd*-gnu) + openbsd*|freebsd*|mirbsd*|linux*|cygwin*|k*bsd*-gnu) prefix=/usr ;; *) prefix=$ac_default_prefix @@ -593,7 +618,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 +dnl CF_CURSES_HEADER version: 3 updated: 2011/05/01 19:47:45 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. @@ -603,10 +628,10 @@ AC_DEFUN([CF_CURSES_HEADER],[ AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ cf_cv_ncurses_header=none for cf_header in ifelse($1,,,[ \ - $1/curses.h \ - $1/ncurses.h]) \ - curses.h \ - ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) + $1/ncurses.h \ + $1/curses.h]) \ + ncurses.h \ + curses.h ifelse($1,,[ncurses/ncurses.h ncurses/curses.h]) do AC_TRY_COMPILE([#include <${cf_header}>], [initscr(); tgoto("?", 0,0)], @@ -1040,10 +1065,12 @@ rm -rf conftest* AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_GENERICS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_GENERICS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- AC_DEFUN([CF_GNAT_GENERICS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + AC_MSG_CHECKING(if GNAT supports generics) case $cf_gnat_version in #(vi 3.[[1-9]]*|[[4-9]].*) #(vi @@ -1097,28 +1124,92 @@ fi AC_SUBST(PRAGMA_UNREF) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_PROJECTS version: 1 updated: 2010/11/13 14:15:18 +dnl CF_GNAT_PROJECTS version: 2 updated: 2011/03/23 20:24:41 dnl ---------------- +dnl GNAT projects are configured with ".gpr" project files. +dnl GNAT libraries are a further development, using the project feature. AC_DEFUN([CF_GNAT_PROJECTS], [ +AC_REQUIRE([CF_GNAT_VERSION]) + +cf_gnat_libraries=no +cf_gnat_projects=no + AC_MSG_CHECKING(if GNAT supports project files) case $cf_gnat_version in #(vi 3.[[0-9]]*) #(vi - cf_gnat_projects=no ;; *) case $cf_cv_system_name in #(vi cygwin*) #(vi - cf_gnat_projects=no ;; *) - cf_gnat_projects=yes + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* ;; esac ;; esac AC_MSG_RESULT($cf_gnat_projects) +if test $cf_gnat_projects = yes +then + AC_MSG_CHECKING(if GNAT supports libraries) + AC_MSG_RESULT($cf_gnat_libraries) +fi + if test "$cf_gnat_projects" = yes then USE_OLD_MAKERULES="#" @@ -1128,11 +1219,66 @@ else USE_GNAT_PROJECTS="#" fi +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + AC_SUBST(USE_OLD_MAKERULES) AC_SUBST(USE_GNAT_PROJECTS) +AC_SUBST(USE_GNAT_LIBRARIES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37 +dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 +dnl -------------- +dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it +dnl is noted that gnat may compile a tasking unit even for configurations which +dnl fail at runtime. +AC_DEFUN([CF_GNAT_SIGINT],[ +AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ +CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; + +package ConfTest is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end ConfTest;], +[package body ConfTest is + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; +end ConfTest;], + [cf_cv_gnat_sigint=yes], + [cf_cv_gnat_sigint=no])]) + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi +AC_SUBST(USE_GNAT_SIGINT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1144,7 +1290,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -rf conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.ads </dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` @@ -1914,7 +2057,7 @@ AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 3 updated: 2010/10/23 15:54:49 +dnl CF_NCURSES_ADDON version: 4 updated: 2011/03/27 17:10:13 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ @@ -1939,8 +2082,8 @@ if test "$NCURSES_CONFIG" != none ; then cf_version=`$NCURSES_CONFIG --version` NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` -NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.//' -e 's/\..*//'` -NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]]\+\.[[0-9]]\+\.//'` +NCURSES_MINOR=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.//' -e 's/\..*//'` +NCURSES_PATCH=`echo "$cf_version" | sed -e 's/^[[0-9]][[0-9]]*\.[[0-9]][[0-9]]*\.//'` # ABI version is not available from headers cf_cv_abi_version=`$NCURSES_CONFIG --abi-version` @@ -1956,10 +2099,10 @@ CF_EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | fgrep AUTOCONF_$cf_name >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then - cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]]\+//"` - eval NCURSES_$cf_name=$cf_result - cat conftest.$ac_ext - cat conftest.out + cf_result=`cat conftest.out | sed -e "s/^.*AUTOCONF_$cf_name[[ ]][[ ]]*//"` + eval NCURSES_$cf_name=\"$cf_result\" + # cat conftest.$ac_ext + # cat conftest.out fi done @@ -2063,7 +2206,7 @@ CF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20 +dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38 dnl ------------------- dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting dnl the CPPFLAGS variable so we can include its header. @@ -2092,7 +2235,7 @@ cf_ncuhdr_root=ifelse($1,,ncurses,$1) test -n "$cf_cv_curses_dir" && \ test "$cf_cv_curses_dir" != "no" && { \ - CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root) + CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) } AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ @@ -2180,7 +2323,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_LIBS version: 15 updated: 2010/10/23 15:54:49 +dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. @@ -2220,7 +2363,6 @@ CF_ADD_LIBS($cf_ncurses_LIBS) if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) then - CF_ADD_LIBDIR($cf_cv_curses_dir/lib) CF_ADD_LIBS(-l$cf_nculib_root) else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, @@ -2429,7 +2571,7 @@ case ".[$]$1" in #(vi esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 3 updated: 2009/01/25 10:55:09 +dnl CF_PKG_CONFIG version: 7 updated: 2011/04/29 04:53:22 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. AC_DEFUN([CF_PKG_CONFIG], @@ -2446,7 +2588,9 @@ no) #(vi PKG_CONFIG=none ;; yes) #(vi - AC_PATH_PROG(PKG_CONFIG, pkg-config, none) + CF_ACVERSION_CHECK(2.52, + [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)], + [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)]) ;; *) PKG_CONFIG=$withval @@ -2714,7 +2858,7 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 +dnl CF_SHARED_OPTS version: 66 updated: 2011/06/04 20:09:13 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -2845,6 +2989,16 @@ CF_EOF # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; + interix*) + test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel + if test "$cf_cv_shlib_version" = rel; then + cf_shared_soname='`basename $@ .${REL_VERSION}`.${ABI_VERSION}' + else + cf_shared_soname='`basename $@`' + fi + CC_SHARED_OPTS= + MK_SHARED_LIB='${CC} -shared -Wl,-rpath,${libdir} -Wl,-h,'$cf_shared_soname' -o $@' + ;; irix*) #(vi if test "$cf_cv_enable_rpath" = yes ; then EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" @@ -2869,7 +3023,7 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - openbsd[[2-9]].*) #(vi + openbsd[[2-9]].*|mirbsd*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" @@ -3274,16 +3428,28 @@ AC_SUBST(ADA_SHAREDLIB) AC_SUBST(MAKE_ADA_SHAREDLIB) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59 +dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 dnl ------------------ dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses dnl libraries. AC_DEFUN([CF_WITH_CURSES_DIR],[ + +AC_MSG_CHECKING(for specific curses-directory) AC_ARG_WITH(curses-dir, [ --with-curses-dir=DIR directory in which (n)curses is installed], - [CF_PATH_SYNTAX(withval) - cf_cv_curses_dir=$withval], + [cf_cv_curses_dir=$withval], [cf_cv_curses_dir=no]) +AC_MSG_RESULT($cf_cv_curses_dir) + +if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) +then + CF_PATH_SYNTAX(withval) + if test -d "$cf_cv_curses_dir" + then + CF_ADD_INCDIR($cf_cv_curses_dir/include) + CF_ADD_LIBDIR($cf_cv_curses_dir/lib) + fi +fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 @@ -3344,7 +3510,7 @@ if test "$with_pthread" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 +dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 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, @@ -3363,6 +3529,9 @@ case $host_os in #(vi aix[[456]]*) #(vi cf_xopen_source="-D_ALL_SOURCE" ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; darwin[[0-8]].*) #(vi cf_xopen_source="-D_APPLE_C_SOURCE" ;;