]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - Ada95/aclocal.m4
ncurses 5.7 - patch 20100918
[ncurses.git] / Ada95 / aclocal.m4
index ad44f8a2c5ff1e1fdf719df5ceed58e2afebcba7..3128844138e33cb1bbb17f298772378457f28850 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey
 dnl
-dnl $Id: aclocal.m4,v 1.11 2010/06/19 20:18:12 tom Exp $
+dnl $Id: aclocal.m4,v 1.16 2010/09/04 21:41:53 tom Exp $
 dnl Macros used in NCURSES Ada95 auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -268,7 +268,7 @@ dnl $1 = libraries to add, with the "-l", etc.
 dnl $2 = variable to update (default $LIBS)
 AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59
+dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
 dnl ------------------
 dnl Append to a search-list for a nonstandard header/lib-file
 dnl    $1 = the variable to return as result
@@ -280,7 +280,7 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH],
 [
 test "$4" != "$5" && \
 test -d "$4" && \
-ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) {
+ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) {
        test -n "$verbose" && echo "    ... testing for $3-directories under $4"
        test -d $4/$3 &&          $1="[$]$1 $4/$3"
        test -d $4/$3/$2 &&       $1="[$]$1 $4/$3/$2"
@@ -931,7 +931,7 @@ if test "$GCC" = yes ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 25 updated: 2010/04/24 11:03:31
+dnl CF_GCC_WARNINGS version: 26 updated: 2010/08/14 18:25:37
 dnl ---------------
 dnl Check if the compiler supports useful warning options.  There's a few that
 dnl we don't use, simply because they're too noisy:
@@ -1035,7 +1035,7 @@ then
        done
        CFLAGS="$cf_save_CFLAGS"
 fi
-rm -f conftest*
+rm -rf conftest*
 
 AC_SUBST(EXTRA_CFLAGS)
 ])dnl
@@ -1069,7 +1069,7 @@ fi
 AC_SUBST(PRAGMA_UNREF)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_LINK version: 1 updated: 2004/08/21 19:02:08
+dnl CF_GNAT_TRY_LINK version: 2 updated: 2010/08/14 18:25:37
 dnl ----------------
 dnl Verify that a test program compiles/links with GNAT.
 dnl $cf_ada_make is set to the program that compiles/links
@@ -1081,7 +1081,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 -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 $1
 CF_EOF
@@ -1093,10 +1093,10 @@ ifelse($3,,      :,[      $3])
 ifelse($4,,,[else
    $4])
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_TRY_RUN version: 3 updated: 2004/08/21 19:02:08
+dnl CF_GNAT_TRY_RUN version: 4 updated: 2010/08/14 18:25:37
 dnl ---------------
 dnl Verify that a test program compiles and runs with GNAT
 dnl $cf_ada_make is set to the program that compiles/links
@@ -1108,7 +1108,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_RUN],
 [
-rm -f conftest*
+rm -rf conftest*
 cat >>conftest.ads <<CF_EOF
 $1
 CF_EOF
@@ -1124,10 +1124,10 @@ ifelse($4,,,[   else
 ifelse($4,,,[else
    $4])
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_GNAT_VERSION version: 13 updated: 2010/06/19 15:22:18
+dnl CF_GNAT_VERSION version: 14 updated: 2010/07/03 17:45:09
 dnl ---------------
 dnl Verify version of GNAT.
 AC_DEFUN([CF_GNAT_VERSION],
@@ -1145,6 +1145,7 @@ case $cf_gnat_version in
      cf_cv_prog_gnat_correct=no
      ;;
 esac
+
 case $cf_gnat_version in
   3.[[1-9]]*|[[4-9]].*)
       cf_compile_generics=generics
@@ -1155,8 +1156,22 @@ case $cf_gnat_version in
       ;;
 esac
 
+case $cf_gnat_version in
+  3.[[0-9]]*)
+    USE_OLD_MAKERULES=""
+    USE_GNAT_PROJECTS="#"
+    ;;
+  *)
+    USE_OLD_MAKERULES="#"
+    USE_GNAT_PROJECTS=""
+    ;;
+esac
+
 AC_SUBST(cf_compile_generics)
 AC_SUBST(cf_generic_objects)
+
+AC_SUBST(USE_OLD_MAKERULES)
+AC_SUBST(USE_GNAT_PROJECTS)
 ])
 dnl ---------------------------------------------------------------------------
 dnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07
@@ -1444,7 +1459,7 @@ ifelse($1,,,[$1=$LIB_PREFIX])
        AC_SUBST(LIB_PREFIX)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_LIB_SONAME version: 4 updated: 2010/05/29 16:31:02
+dnl CF_LIB_SONAME version: 5 updated: 2010/08/14 18:25:37
 dnl -------------
 dnl Find the and soname for the given shared library.  Set the cache variable
 dnl cf_cv_$3_soname to this, unless it is not found.  Then set the cache
@@ -1475,7 +1490,7 @@ cf_save_LIBS="$LIBS"
                        test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown
                fi
        fi
-rm -f conftest*
+rm -rf conftest*
 LIBS="$cf_save_LIBS"
 fi
 ])
@@ -1800,13 +1815,13 @@ fi
 test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_MKSTEMP version: 6 updated: 2010/05/22 14:44:30
+dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37
 dnl ----------
 dnl Check for a working mkstemp.  This creates two files, checks that they are
 dnl successfully created and distinct (AmigaOS apparently fails on the last).
 AC_DEFUN([CF_MKSTEMP],[
 AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
-rm -f conftest*
+rm -rf conftest*
 AC_TRY_RUN([
 #include <sys/types.h>
 #include <stdlib.h>
@@ -1967,10 +1982,10 @@ printf("old\n");
        ,[$1=no])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CONFIG version: 6 updated: 2010/04/28 06:02:16
+dnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30
 dnl -----------------
 dnl Tie together the configure-script macros for ncurses.
-dnl Prefer the "-config" script from ncurses 5.6, to simplify analysis.
+dnl Prefer the "-config" script from ncurses 6.x, to simplify analysis.
 dnl Allow that to be overridden using the $NCURSES_CONFIG environment variable.
 dnl
 dnl $1 is the root library name (default: "ncurses")
@@ -1984,7 +1999,7 @@ AC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-
 if test "$NCURSES_CONFIG" != none ; then
 
 CPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`"
-LIBS="`$NCURSES_CONFIG --libs` $LIBS"
+CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
 
 # even with config script, some packages use no-override for curses.h
 CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
@@ -2124,7 +2139,7 @@ esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 13 updated: 2007/07/29 10:29:20
+dnl CF_NCURSES_LIBS version: 14 updated: 2010/06/20 09:24:28
 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.
@@ -2160,12 +2175,12 @@ freebsd*)
        ;;
 esac
 
-LIBS="$cf_ncurses_LIBS $LIBS"
+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)
-       LIBS="-l$cf_nculib_root $LIBS"
+       CF_ADD_LIBS(-l$cf_nculib_root)
 else
        CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
                [#include <${cf_cv_ncurses_header-curses.h}>],
@@ -2494,7 +2509,7 @@ AC_PROG_AWK
 test -z "$AWK" && AC_MSG_ERROR(No awk program found)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46
+dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37
 dnl --------------
 dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that
 dnl the output file can be renamed, and allows for a shell variable that can
@@ -2524,7 +2539,7 @@ then
 else
   eval cf_cv_prog_$1_c_o=no
 fi
-rm -f conftest*
+rm -rf conftest*
 ])dnl
 if test $cf_cv_prog_$1_c_o = yes; then
   AC_MSG_RESULT([yes])
@@ -2606,6 +2621,28 @@ fi
 AC_SUBST(cf_ada_make)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
+dnl ------------
+dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
+dnl option if it is supported.
+AC_DEFUN([CF_PROG_LN_S],[
+AC_PROG_LN_S
+AC_MSG_CHECKING(if $LN_S -f options work)
+
+rm -f conf$$.src conf$$dst
+echo >conf$$.dst
+echo first >conf$$.src
+if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
+       cf_prog_ln_sf=yes
+else
+       cf_prog_ln_sf=no
+fi
+rm -f conf$$.dst conf$$src
+AC_MSG_RESULT($cf_prog_ln_sf)
+
+test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
 dnl ----------------
 dnl Remove all -U and -D options that refer to the given symbol from a list
@@ -3067,7 +3104,7 @@ AC_DEFUN([CF_UPPER],
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 6 updated: 2010/04/21 06:20:50
+dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28
 dnl -----------
 dnl Check for multibyte support, and if not found, utf8 compatibility library
 AC_DEFUN([CF_UTF8_LIB],
@@ -3089,7 +3126,7 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then
        AC_DEFINE(HAVE_LIBUTF8_H)
        CF_ADD_INCDIR($cf_cv_header_path_utf8)
        CF_ADD_LIBDIR($cf_cv_library_path_utf8)
-       LIBS="$cf_cv_library_file_utf8 $LIBS"
+       CF_ADD_LIBS($cf_cv_library_file_utf8)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
@@ -3127,63 +3164,69 @@ weak_symbol(fopen);
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_COMPILER version: 1 updated: 2010/06/19 15:22:18
+dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58
 dnl --------------------
 dnl Command-line option to specify the Ada95 compiler.
 AC_DEFUN([CF_WITH_ADA_COMPILER],[
+AC_MSG_CHECKING(for ada-compiler)
 AC_ARG_WITH(ada-compiler,
        [  --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)],
        [cf_ada_compiler=$withval],
        [cf_ada_compiler=gnatmake])
 AC_SUBST(cf_ada_compiler)
+AC_MSG_RESULT($cf_ada_compiler)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_INCLUDE version: 1 updated: 2010/06/19 15:22:18
+dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58
 dnl -------------------
 dnl Command-line option to specify where Ada includes will install.
 AC_DEFUN([CF_WITH_ADA_INCLUDE],[
+AC_MSG_CHECKING(for ada-include)
 CF_WITH_PATH(ada-include,
    [  --with-ada-include=DIR  Ada includes are in DIR],
    ADA_INCLUDE,
    PREFIX/share/ada/adainclude,
    [$]prefix/share/ada/adainclude)
 AC_SUBST(ADA_INCLUDE)
+AC_MSG_RESULT($ADA_INCLUDE)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_OBJECTS version: 1 updated: 2010/06/19 15:22:18
+dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58
 dnl -------------------
 dnl Command-line option to specify where Ada objects will install.
 AC_DEFUN([CF_WITH_ADA_OBJECTS],[
+AC_MSG_CHECKING(for ada-objects)
 CF_WITH_PATH(ada-objects,
    [  --with-ada-objects=DIR  Ada objects are in DIR],
    ADA_OBJECTS,
    PREFIX/lib/ada/adalib,
    [$]prefix/lib/ada/adalib)
 AC_SUBST(ADA_OBJECTS)
+AC_MSG_RESULT($ADA_OBJECTS)
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_ADA_SHAREDLIB version: 1 updated: 2010/06/19 16:12:21
+dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58
 dnl ---------------------
 dnl Command-line option to specify if an Ada95 shared-library should be built,
 dnl and optionally what its soname should be.
 AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[
+AC_MSG_CHECKING(if an Ada95 shared-library should be built)
 AC_ARG_WITH(ada-sharedlib,
        [  --with-ada-sharedlib=XX build Ada95 shared-library],
        [with_ada_sharedlib=$withval],
        [with_ada_sharedlib=no])
 AC_MSG_RESULT($with_ada_sharedlib)
 
+ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
+MAKE_ADA_SHAREDLIB="#"
+
 if test "x$with_ada_sharedlib" != xno
 then
        MAKE_ADA_SHAREDLIB=
        if test "x$with_ada_sharedlib" != xyes
        then
                ADA_SHAREDLIB="$with_ada_sharedlib"
-       else
-               ADA_SHAREDLIB='lib$(LIB_NAME).so.1'
        fi
-else
-       MAKE_ADA_SHAREDLIB="#"
 fi
 
 AC_SUBST(ADA_SHAREDLIB)