dnl***************************************************************************
-dnl Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. *
+dnl Copyright (c) 1998-2006,2007 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 *
dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: aclocal.m4,v 1.407 2006/12/17 16:12:38 tom Exp $
+dnl $Id: aclocal.m4,v 1.428 2007/03/31 15:53:01 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_CPP_VSCAN_FUNC version: 5 updated: 2001/12/02 01:39:28
-dnl -----------------
-dnl Check if the g++ compiler supports vscan function (not a standard feature).
-AC_DEFUN([CF_CPP_VSCAN_FUNC],
-[
-if test -n "$CXX"; then
-
-AC_LANG_SAVE
-AC_LANG_CPLUSPLUS
-AC_CHECK_HEADERS(strstream.h)
-
-AC_CACHE_CHECK(if $CXX supports vscan function,cf_cv_cpp_vscan_func,[
- for cf_vscan_func in strstream strstream_cast stdio
- do
- case $cf_vscan_func in #(vi
- stdio) cf_vscan_defs=USE_STDIO_VSCAN ;; #(vi
- strstream) cf_vscan_defs=USE_STRSTREAM_VSCAN ;;
- strstream_cast) cf_vscan_defs=USE_STRSTREAM_VSCAN_CAST ;;
- esac
- AC_TRY_LINK([
-#include <stdio.h>
-#include <stdarg.h>
-#define $cf_vscan_defs 1
-#if defined(USE_STDIO_VSCAN)
-#elif defined(HAVE_STRSTREAM_H) && defined(USE_STRSTREAM_VSCAN)
-#include <strstream.h>
-#endif
-
-int scanw(const char* fmt, ...)
-{
- int result = -1;
- char buf[BUFSIZ];
-
- va_list args;
- va_start(args, fmt);
-#if defined(USE_STDIO_VSCAN)
- if (::vsscanf(buf, fmt, args) != -1)
- result = 0;
-#elif defined(USE_STRSTREAM_VSCAN)
- strstreambuf ss(buf, sizeof(buf));
- if (ss.vscan(fmt, args) != -1)
- result = 0;
-#elif defined(USE_STRSTREAM_VSCAN_CAST)
- strstreambuf ss(buf, sizeof(buf));
- if (ss.vscan(fmt, (_IO_va_list)args) != -1)
- result = 0;
-#else
-#error case $cf_vscan_func failed
-#endif
- va_end(args);
- return result;
-}
-],[int tmp, foo = scanw("%d", &tmp)],
- [cf_cv_cpp_vscan_func=$cf_vscan_func; break],
- [cf_cv_cpp_vscan_func=no])
- test "$cf_cv_cpp_vscan_func" != no && break
- done
-])
-
-AC_LANG_RESTORE
-fi
-
-case $cf_cv_cpp_vscan_func in #(vi
-stdio) #(vi
- AC_DEFINE(CPP_HAS_VSCAN_FUNC)
- AC_DEFINE(USE_STDIO_VSCAN)
- ;;
-strstream)
- AC_DEFINE(CPP_HAS_VSCAN_FUNC)
- AC_DEFINE(USE_STRSTREAM_VSCAN)
- ;;
-strstream_cast)
- AC_DEFINE(CPP_HAS_VSCAN_FUNC)
- AC_DEFINE(USE_STRSTREAM_VSCAN_CAST)
- ;;
-esac
-])dnl
-dnl ---------------------------------------------------------------------------
dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
dnl ----------
dnl "dirname" is not portable, so we fake it with a shell script.
AC_SUBST(LIB_PREFIX)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_LIB_RULES version: 40 updated: 2006/10/14 15:23:15
+dnl CF_LIB_RULES version: 50 updated: 2007/03/24 18:26:59
dnl ------------
dnl Append definitions and rules for the given models to the subdirectory
dnl Makefiles, and the recursion rule for the top-level Makefile. If the
-dnl subdirectory is a library-source directory, modify the LIBRARIES list in
+dnl subdirectory is a library-source directory, modify the LIBS_TO_MAKE list in
dnl the corresponding makefile to list the models that we'll generate.
dnl
dnl For shared libraries, make a list of symbolic links to construct when
continue
elif test -f $srcdir/$cf_dir/modules; then
- IMPORT_LIB=
SHARED_LIB=
LIBS_TO_MAKE=
for cf_item in $cf_LIST_MODELS
# use autodetected ${cf_prefix} for import lib and static lib, but
# use 'cyg' prefix for shared lib.
if test $cf_cv_shlib_version = cygdll ; then
- SHARED_LIB="cyg${cf_dir}\${ABI_VERSION}.dll"
- IMPORT_LIB="${cf_prefix}${cf_dir}.dll.a"
- LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/\${SHARED_LIB} ../lib/\${IMPORT_LIB}"
+ LIBS_TO_MAKE="$LIBS_TO_MAKE ../lib/cyg${cf_dir}\${ABI_VERSION}.dll"
continue
fi
fi
if test $cf_dir = ncurses ; then
cf_subsets="$LIB_SUBSETS"
- cf_termlib=`echo "$cf_subsets" |sed -e 's/ .*$//'`
- if test "$cf_termlib" != "$cf_subsets" ; then
- cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
- LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
- fi
+ cf_r_parts="$cf_subsets"
+
+ while test -n "$cf_r_parts"
+ do
+ cf_l_parts=`echo "$cf_r_parts" |sed -e 's/ .*$//'`
+ cf_r_parts=`echo "$cf_r_parts" |sed -e 's/^[[^ ]]* //'`
+ if test "$cf_l_parts" != "$cf_r_parts" ; then
+ case $cf_l_parts in #(vi
+ *termlib*) #(vi
+ cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TINFO_LIB_SUFFIX}%g`
+ ;;
+ *ticlib*)
+ cf_item=`echo $LIBS_TO_MAKE |sed -e s%${LIB_NAME}${LIB_SUFFIX}%${TICS_LIB_SUFFIX}%g`
+ ;;
+ *)
+ break
+ ;;
+ esac
+ LIBS_TO_MAKE="$cf_item $LIBS_TO_MAKE"
+ else
+ break
+ fi
+ done
else
cf_subsets=`echo "$LIB_SUBSETS" | sed -e 's/^termlib.* //'`
fi
sed -e "s%@LIBS_TO_MAKE@%$LIBS_TO_MAKE%" \
- -e "s%@IMPORT_LIB@%$IMPORT_LIB%" \
-e "s%@SHARED_LIB@%$SHARED_LIB%" \
$cf_dir/Makefile >$cf_dir/Makefile.out
mv $cf_dir/Makefile.out $cf_dir/Makefile
case $cf_subset in
*base*)
;;
- termlib*)
+ *termlib*)
cf_libname=$TINFO_LIB_SUFFIX
if test -n "${DFT_ARG_SUFFIX}" ; then
# undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
fi
- ;;
+ ;;
+ ticlib*)
+ cf_libname=$TICS_LIB_SUFFIX
+ if test -n "${DFT_ARG_SUFFIX}" ; then
+ # undo $LIB_SUFFIX add-on in CF_LIB_SUFFIX
+ cf_suffix=`echo $cf_suffix |sed -e "s%^${LIB_SUFFIX}%%"`
+ fi
+ ;;
esac
fi
prefix=$cf_prefix \
suffix=$cf_suffix \
subset=$cf_subset \
+ TermlibRoot=$TINFO_NAME \
+ TermlibSuffix=$TINFO_SUFFIX \
ShlibVer=$cf_cv_shlib_version \
ShlibVerInfix=$cf_cv_shlib_version_infix \
+ ReLink=${cf_cv_do_relink-no} \
DoLinks=$cf_cv_do_symlinks \
rmSoLocs=$cf_cv_rm_so_locs \
ldconfig="$LDCONFIG" \
cat >> Makefile <<CF_EOF
-install.data \\
-uninstall.data ::
+install.libs uninstall.libs \\
+install.data uninstall.data ::
$MAKE_TERMINFO cd misc && \${MAKE} \${CF_MFLAGS} \[$]@
install.man \\
distclean ::
rm -f config.cache config.log config.status Makefile include/ncurses_cfg.h
- rm -f headers.sh headers.sed
+ rm -f headers.sh headers.sed mk_shared_lib.sh
rm -rf \${DIRS_TO_MAKE}
CF_EOF
fi
if test -f $srcdir/$cf_dir/headers; then
- cat >>$cf_dir/Makefile <<CF_EOF
-\${DESTDIR}\${includedir} :
- sh \${srcdir}/../mkinstalldirs \[$]@
-
-install \\
-install.libs \\
-install.includes :: \${AUTO_SRC} \${DESTDIR}\${includedir} \\
-CF_EOF
- j=""
- for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
- do
- test -n "$j" && echo " $j \\" >>$cf_dir/Makefile
- j=$i
- done
-
- echo " $j" >>$cf_dir/Makefile
-
- for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
- do
- echo " @ (cd \${DESTDIR}\${includedir} && rm -f `basename $i`) ; ../headers.sh \${INSTALL_DATA} \${DESTDIR}\${includedir} \${srcdir} $i" >>$cf_dir/Makefile
- test $i = curses.h && test $WITH_CURSES_H = yes && echo " @ (cd \${DESTDIR}\${includedir} && rm -f ncurses.h && \${LN_S} curses.h ncurses.h)" >>$cf_dir/Makefile
- done
-
- cat >>$cf_dir/Makefile <<CF_EOF
-
-uninstall \\
-uninstall.libs \\
-uninstall.includes ::
-CF_EOF
- for i in `cat $srcdir/$cf_dir/headers |fgrep -v "#"`
- do
- i=`basename $i`
- echo " -@ (cd \${DESTDIR}\${includedir} && rm -f $i)" >>$cf_dir/Makefile
- test $i = curses.h && echo " -@ (cd \${DESTDIR}\${includedir} && rm -f ncurses.h)" >>$cf_dir/Makefile
- done
+ $AWK -f $srcdir/mk-hdr.awk \
+ subset="$LIB_SUBSETS" \
+ compat="$WITH_CURSES_H" \
+ $srcdir/$cf_dir/headers >>$cf_dir/Makefile
fi
if test -f $srcdir/$cf_dir/modules; then
AC_MSG_RESULT($MANPAGE_TBL)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_MAN_PAGES version: 31 updated: 2006/12/09 12:27:08
+dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29
dnl ------------
dnl Try to determine if the man-pages on the system are compressed, and if
dnl so, what format is used. Use this information to construct a script that
esac
cf_edit_man=./edit_man.sh
+cf_man_alias=`pwd`/man_alias.sed
cat >$cf_edit_man <<CF_EOF
#! /bin/sh
NCURSES_OSPEED="$NCURSES_OSPEED"
TERMINFO="$TERMINFO"
-MKDIRS="sh `cd $srcdir && pwd`/mkinstalldirs"
+MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh"
INSTALL="$INSTALL"
INSTALL_DATA="$INSTALL_DATA"
\$MKDIRS \$cf_subdir\$section
fi
fi
+
+ # replace variables in man page
+ if test ! -f $cf_man_alias ; then
+cat >>$cf_man_alias <<-CF_EOF2
+ s,@DATADIR@,\$datadir,g
+ s,@TERMINFO@,\$TERMINFO,g
+ s,@NCURSES_MAJOR@,\$NCURSES_MAJOR,g
+ s,@NCURSES_MINOR@,\$NCURSES_MINOR,g
+ s,@NCURSES_PATCH@,\$NCURSES_PATCH,g
+ s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g
+CF_EOF
+ ifelse($1,,,[
+ for cf_name in $1
+ do
+ cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
+ cf_name=`echo $cf_name|sed "$program_transform_name"`
+cat >>$cf_edit_man <<-CF_EOF
+ s,@$cf_NAME@,$cf_name,
+CF_EOF
+ done
+ ])
+cat >>$cf_edit_man <<CF_EOF
+CF_EOF2
+ echo "...made $cf_man_alias"
+ fi
+
aliases=
cf_source=\`basename \$i\`
inalias=\$cf_source
if test "$MANPAGE_ALIASES" != no ; then
cat >>$cf_edit_man <<CF_EOF
- aliases=\`sed -f \$top_srcdir/man/manlinks.sed \$inalias | sort -u\`
+ aliases=\`sed -f \$top_srcdir/man/manlinks.sed \$inalias |sed -f $cf_man_alias | sort -u\`
CF_EOF
fi
cf_target="\$cf_source"
fi
cf_target="\$cf_subdir\${section}/\${cf_target}"
-CF_EOF
-fi
- # replace variables in man page
- ifelse($1,,,[
- for cf_name in $1
- do
-cat >>$cf_edit_man <<CF_EOF
- prog_$cf_name=\`echo $cf_name|sed "\${transform}"\`
-CF_EOF
- done
- ])
-cat >>$cf_edit_man <<CF_EOF
- sed -e "s,@DATADIR@,\$datadir," \\
- -e "s,@TERMINFO@,\$TERMINFO," \\
- -e "s,@NCURSES_MAJOR@,\$NCURSES_MAJOR," \\
- -e "s,@NCURSES_MINOR@,\$NCURSES_MINOR," \\
- -e "s,@NCURSES_PATCH@,\$NCURSES_PATCH," \\
- -e "s,@NCURSES_OSPEED@,\$NCURSES_OSPEED," \\
CF_EOF
+fi
- ifelse($1,,,[
- for cf_name in $1
- do
- cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
cat >>$cf_edit_man <<CF_EOF
- -e "s,@$cf_NAME@,\$prog_$cf_name," \\
+ sed -f $cf_man_alias \\
CF_EOF
- done
- ])
if test -f $MANPAGE_RENAMES ; then
cat >>$cf_edit_man <<CF_EOF
if test \$verb = installing ; then
echo \$verb \$cf_target
\$INSTALL_DATA \$TMP \$cf_target
+ test -d \$cf_subdir\${section} &&
test -n "\$aliases" && (
cd \$cf_subdir\${section} && (
cf_source=\`echo \$cf_target |sed -e 's%^.*/\([[^/]][[^/]]*/[[^/]][[^/]]*$\)%\1%'\`
)
)
elif test \$verb = removing ; then
- echo \$verb \$cf_target
- rm -f \$cf_target
+ test -f \$cf_target && (
+ echo \$verb \$cf_target
+ rm -f \$cf_target
+ )
+ test -d \$cf_subdir\${section} &&
test -n "\$aliases" && (
cd \$cf_subdir\${section} && (
for cf_alias in \$aliases
-e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 41 updated: 2006/12/09 12:32:00
+dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52
+dnl -------------
+dnl Remove the given library from the symbol
+dnl
+dnl $1 = target (which could be the same as the source variable)
+dnl $2 = source (including '$')
+dnl $3 = library to remove
+define([CF_REMOVE_LIB],
+[
+# remove $3 library from $2
+$1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'`
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_SHARED_OPTS version: 46 updated: 2007/02/24 18:58:09
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
;;
cygwin*)
CC_SHARED_OPTS=
- MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,--out-implib=../lib/${IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/${SHARED_LIB}'
+ MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
cf_cv_shlib_version=cygdll
cf_cv_shlib_version_infix=cygdll
+ cat >mk_shared_lib.sh <<-CF_EOF
+ #!/bin/sh
+ SHARED_LIB=\[$]1
+ IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
+ shift
+ cat <<-EOF
+ Linking shared library
+ ** SHARED_LIB \[$]SHARED_LIB
+ ** IMPORT_LIB \[$]IMPORT_LIB
+EOF
+ exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB}
+CF_EOF
+ chmod +x mk_shared_lib.sh
;;
darwin*)
EXTRA_CFLAGS="-no-cpp-precomp"
CC_SHARED_OPTS="-dynamic"
- MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${DESTDIR}${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
+ MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
cf_cv_shlib_version_infix=yes
AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [
CF_SHARED_SONAME
MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_shared_soname',-stats,-lc -o $[@]'
;;
- openbsd2*)
+ openbsd[[2-9]].*)
CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
MK_SHARED_LIB='${LD} -Bshareable -soname,`basename $[@].${ABI_VERSION}` -o $[@]'
;;
- openbsd*|freebsd[[23]]*)
+ openbsd*|freebsd[[12]].*)
CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
MK_SHARED_LIB='${LD} -Bshareable -o $[@]'
test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
fi
])
dnl ---------------------------------------------------------------------------
-dnl CF_WITH_LIBTOOL version: 10 updated: 2006/10/14 15:23:15
+dnl CF_WITH_LIBTOOL version: 16 updated: 2007/03/25 18:05:48
dnl ---------------
dnl Provide a configure option to incorporate libtool. Define several useful
dnl symbols for the makefile rules.
fi
])dnl
LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` -o'
- LIB_OBJECT='${OBJECTS}.o=.lo)'
+ LIB_OBJECT='${OBJECTS:.o=.lo}'
LIB_SUFFIX=.la
LIB_CLEAN='${LIBTOOL} --mode=clean'
LIB_COMPILE='${LIBTOOL} --mode=compile'
# Save the version in a cache variable - this is not entirely a good
# thing, but the version string from libtool is very ugly, and for
# bug reports it might be useful to have the original string.
- cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
+ cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'`
AC_MSG_RESULT($cf_cv_libtool_version)
if test -z "$cf_cv_libtool_version" ; then
- AC_MSG_ERROR(This is not libtool)
+ AC_MSG_ERROR(This is not GNU libtool)
fi
# special hack to add --tag option for C++ compiler
[USE_VALGRIND])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 24 updated: 2006/04/02 16:41:09
+dnl CF_XOPEN_SOURCE version: 25 updated: 2007/01/29 18:36:38
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,
irix[[56]].*) #(vi
CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE"
;;
-linux*|gnu*) #(vi
+linux*|gnu*|k*bsd*-gnu) #(vi
CF_GNU_SOURCE
;;
mirbsd*) #(vi