X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=Ada95%2Faclocal.m4;h=c83f6acb92d336142c5fcb2929e9c632a0f66666;hp=74c7f0f351e93ae0e791ef838cf4ff10a2578486;hb=ed3eb506e9a8e6ea871a2eb5818e19ba36f3f277;hpb=ee1bcda2cbb28cd84f136d8343cf83b7e576bd79 diff --git a/Ada95/aclocal.m4 b/Ada95/aclocal.m4 index 74c7f0f3..c83f6acb 100644 --- a/Ada95/aclocal.m4 +++ b/Ada95/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 2010-2013,2014 Free Software Foundation, Inc. * +dnl Copyright (c) 2010-2014,2015 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.98 2015/04/25 09:52:32 tom Exp $ +dnl $Id: aclocal.m4,v 1.105 2015/08/08 14:25:40 tom Exp $ dnl Macros used in NCURSES Ada95 auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -185,7 +185,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 +dnl CF_ADD_INCDIR version: 14 updated: 2015/05/25 20:53:04 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -236,6 +236,8 @@ if test -n "$1" ; then else break fi + else + break fi done done @@ -340,7 +342,7 @@ 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_OPTION version: 4 updated: 2010/05/26 05:38:42 +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 dnl values. @@ -353,15 +355,15 @@ dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) - if test "$enableval" != "$5" ; then + if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ - else - $4]) - fi],[enableval=$5 ifelse([$4],,,[ - $4 + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 ])dnl - ])])dnl +])])dnl dnl --------------------------------------------------------------------------- dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 dnl ----------- @@ -1913,7 +1915,7 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 16 updated: 2015/04/15 19:08:48 +dnl CF_MAKEFLAGS version: 17 updated: 2015/08/05 20:44:28 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. @@ -1926,7 +1928,7 @@ AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp <&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_ADDON version: 4 updated: 2011/03/27 17:10:13 +dnl CF_NCURSES_ADDON version: 5 updated: 2015/04/26 18:06:58 dnl ---------------- dnl Configure an ncurses add-on, built outside the ncurses tree. AC_DEFUN([CF_NCURSES_ADDON],[ +AC_REQUIRE([CF_NCURSES_CONFIG]) AC_PROVIDE([CF_SUBST_NCURSES_VERSION]) @@ -2094,42 +2097,55 @@ AC_ARG_ENABLE(widec, [with_widec=no]) AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then - CF_UTF8_LIB + CF_UTF8_LIB CF_NCURSES_CONFIG(ncursesw) else CF_NCURSES_CONFIG(ncurses) fi -if test "$NCURSES_CONFIG" != none ; then +if test "$NCURSES_CONFIG_PKG" != none ; then + cf_version=`$PKG_CONFIG --modversion $NCURSES_CONFIG_PKG 2>/dev/null` + + NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` + 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]]*\.//'` + + cf_cv_abi_version=`$PKG_CONFIG --variable=abi_version $NCURSES_CONFIG_PKG 2>/dev/null` + if test -z "$cf_cv_abi_version" + then + cf_cv_abi_version=`$PKG_CONFIG --variable=major_version $NCURSES_CONFIG_PKG 2>/dev/null` + fi + +elif test "$NCURSES_CONFIG" != none ; then -cf_version=`$NCURSES_CONFIG --version` + cf_version=`$NCURSES_CONFIG --version 2>/dev/null` -NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` -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]]*\.//'` + NCURSES_MAJOR=`echo "$cf_version" | sed -e 's/\..*//'` + 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` + # ABI version is not available from headers + cf_cv_abi_version=`$NCURSES_CONFIG --abi-version 2>/dev/null` else -for cf_name in MAJOR MINOR PATCH -do -cat >conftest.$ac_ext < -AUTOCONF_$cf_name NCURSES_VERSION_$cf_name + for cf_name in MAJOR MINOR PATCH + do + cat >conftest.$ac_ext < + AUTOCONF_$cf_name NCURSES_VERSION_$cf_name 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 - fi -done + 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 + fi + done -cf_cv_abi_version=${NCURSES_MAJOR} + cf_cv_abi_version=${NCURSES_MAJOR} fi @@ -2189,11 +2205,13 @@ printf("old\n"); ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_NCURSES_CONFIG version: 12 updated: 2015/04/24 20:52:45 +dnl CF_NCURSES_CONFIG version: 17 updated: 2015/07/07 04:22:07 dnl ----------------- -dnl Tie together the configure-script macros for ncurses. -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 Tie together the configure-script macros for ncurses, preferring these in +dnl order: +dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG +dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG +dnl c) just plain libraries dnl dnl $1 is the root library name (default: "ncurses") AC_DEFUN([CF_NCURSES_CONFIG],[ @@ -2201,7 +2219,7 @@ AC_REQUIRE([CF_PKG_CONFIG]) cf_ncuconfig_root=ifelse($1,,ncurses,$1) cf_have_ncuconfig=no -if test "x$PKG_CONFIG" != xnone; then +if test "x${PKG_CONFIG:=none}" != xnone; then AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root) if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then AC_MSG_RESULT(yes) @@ -2221,21 +2239,27 @@ if test "x$PKG_CONFIG" != xnone; then int main(void) { char *xx = curses_version(); return (xx == 0); }], [cf_have_ncuconfig=yes], - [cf_have_ncuconfig=no])], + [cf_have_ncuconfig=no], + [cf_have_ncuconfig=maybe])], [cf_have_ncuconfig=no]) - AC_MSG_RESULT($cf_have_ncuconfig) + test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" + NCURSES_CONFIG_PKG=none else AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) + NCURSES_CONFIG_PKG=$cf_ncuconfig_root fi else AC_MSG_RESULT(no) + NCURSES_CONFIG_PKG=none fi +else + NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then @@ -2269,6 +2293,8 @@ if test "x$cf_have_ncuconfig" = "xno"; then CF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) fi +else + NCURSES_CONFIG=none fi ])dnl dnl --------------------------------------------------------------------------- @@ -2592,7 +2618,7 @@ case ".[$]$1" in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PKG_CONFIG version: 9 updated: 2015/04/12 15:39:00 +dnl CF_PKG_CONFIG version: 10 updated: 2015/04/26 18:06:58 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. AC_DEFUN([CF_PKG_CONFIG], @@ -2621,7 +2647,7 @@ esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then CF_PATH_SYNTAX(PKG_CONFIG) -else +elif test "x$cf_pkg_config" != xno ; then AC_MSG_WARN(pkg-config is not installed) fi @@ -2895,7 +2921,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: 87 updated: 2015/04/17 21:13:04 +dnl CF_SHARED_OPTS version: 88 updated: 2015/08/05 20:44:28 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -2994,14 +3020,14 @@ AC_DEFUN([CF_SHARED_OPTS], ;; (cygwin*) CC_SHARED_OPTS= - MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' + MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=cygdll cf_cv_shlib_version_infix=cygdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF - #!/bin/sh + #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift @@ -3016,14 +3042,14 @@ CF_EOF ;; (msys*) CC_SHARED_OPTS= - MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' + MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cf_cv_shlib_version=msysdll cf_cv_shlib_version_infix=msysdll shlibdir=$bindir MAKE_DLLS= cat >mk_shared_lib.sh <<-CF_EOF - #!/bin/sh + #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/msys-/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift @@ -3117,10 +3143,10 @@ CF_EOF EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS" fi CC_SHARED_OPTS= - MK_SHARED_LIB='sh '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' + MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a" cat >mk_shared_lib.sh <<-CF_EOF - #!/bin/sh + #!$SHELL SHARED_LIB=\[$]1 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.a/'\` shift @@ -3675,15 +3701,19 @@ eval $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PKG_CONFIG_LIBDIR version: 6 updated: 2015/04/17 21:13:04 +dnl CF_WITH_PKG_CONFIG_LIBDIR version: 9 updated: 2015/06/06 19:26:44 dnl ------------------------- dnl Allow the choice of the pkg-config library directory to be overridden. AC_DEFUN([CF_WITH_PKG_CONFIG_LIBDIR],[ -AC_MSG_CHECKING(for $PKG_CONFIG library directory) -AC_ARG_WITH(pkg-config-libdir, - [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], - [PKG_CONFIG_LIBDIR=$withval], - [PKG_CONFIG_LIBDIR=yes]) +if test "x$PKG_CONFIG" = xnone ; then + PKG_CONFIG_LIBDIR=no +else + AC_MSG_CHECKING(for $PKG_CONFIG library directory) + AC_ARG_WITH(pkg-config-libdir, + [ --with-pkg-config-libdir=XXX use given directory for installing pc-files], + [PKG_CONFIG_LIBDIR=$withval], + [PKG_CONFIG_LIBDIR=yes]) +fi case x$PKG_CONFIG_LIBDIR in (x/*) @@ -3739,7 +3769,9 @@ case x$PKG_CONFIG_LIBDIR in ;; esac -AC_MSG_RESULT($PKG_CONFIG_LIBDIR) +if test "x$PKG_CONFIG" != xnone ; then + AC_MSG_RESULT($PKG_CONFIG_LIBDIR) +fi AC_SUBST(PKG_CONFIG_LIBDIR) ])dnl