dnl
dnl Author: Thomas E. Dickey 1995-on
dnl
-dnl $Id: aclocal.m4,v 1.499 2010/03/28 00:14:25 tom Exp $
+dnl $Id: aclocal.m4,v 1.514 2010/04/24 15:44:15 tom Exp $
dnl Macros used in NCURSES auto-configuration script.
dnl
dnl These macros are maintained separately from NCURSES. The copyright on
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
+dnl --------------
+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: 3 updated: 1997/10/18 14:42:41
+dnl -------------
+dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
+dnl values.
+dnl
+dnl Parameters:
+dnl $1 = option name
+dnl $2 = help-string
+dnl $3 = action to perform if option is not default
+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
+ifelse($3,,[ :]dnl
+,[ $3]) ifelse($4,,,[
+ else
+ $4])
+ fi],[enableval=$5 ifelse($4,,,[
+ $4
+])dnl
+ ])])dnl
+dnl ---------------------------------------------------------------------------
dnl CF_AR_FLAGS version: 4 updated: 2009/02/07 13:42:23
dnl -----------
dnl Check for suitable "ar" (archiver) options for updating an archive.
fi
])dnl
dnl ---------------------------------------------------------------------------
+dnl CF_DISABLE_RPATH_HACK version: 1 updated: 2010/04/11 10:54:00
+dnl ---------------------
+dnl The rpath-hack makes it simpler to build programs, particularly with the
+dnl *BSD ports which may have essential libraries in unusual places. But it
+dnl can interfere with building an executable for the base system. Use this
+dnl option in that case.
+AC_DEFUN([CF_DISABLE_RPATH_HACK],
+[
+AC_MSG_CHECKING(if rpath should be not be set)
+CF_ARG_DISABLE(rpath-hack,
+ [ --disable-rpath-hack don't add rpath options for additional libraries],
+ [cf_disable_rpath_hack=yes],
+ [cf_disable_rpath_hack=no])
+AC_MSG_RESULT($cf_disable_rpath_hack)
+if test "$cf_disable_rpath_hack" = no ; then
+ CF_RPATH_HACK
+fi
+])
+dnl ---------------------------------------------------------------------------
dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42
dnl ---------------
dnl Check if the rpath option should be used, setting cache variable
CXXFLAGS="$cf_save_CXXFLAGS"
])
dnl ---------------------------------------------------------------------------
-dnl CF_FIND_LINKAGE version: 14 updated: 2010/03/21 14:34:38
+dnl CF_FIND_LINKAGE version: 16 updated: 2010/04/21 06:20:50
dnl ---------------
dnl Find a library (specifically the linkage used in the code fragment),
dnl searching for it if it is not already in the library path.
AC_TRY_LINK([$1],[$2],[
cf_cv_find_linkage_$3=yes
+ cf_cv_library_file_$3="-l$3"
],[
cf_cv_find_linkage_$3=no
LIBS="$cf_save_LIBS"
if test "$cf_cv_find_linkage_$3" = yes ; then
ifelse([$4],,[
- CF_ADD_INCDIR($cf_cv_header_path_$3)
- CF_ADD_LIBDIR($cf_cv_library_path_$3)
- LIBS="-l$3 $LIBS"
+ CF_ADD_INCDIR($cf_cv_header_path_$3)
+ CF_ADD_LIBDIR($cf_cv_library_path_$3)
+ LIBS="-l$3 $LIBS"
],[$4])
else
ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_VERSION version: 4 updated: 2005/08/27 09:53:42
+dnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31
dnl --------------
dnl Find version of gcc
AC_DEFUN([CF_GCC_VERSION],[
GCC_VERSION=none
if test "$GCC" = yes ; then
AC_MSG_CHECKING(version of $CC)
- GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
+ GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
test -z "$GCC_VERSION" && GCC_VERSION=unknown
AC_MSG_RESULT($GCC_VERSION)
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_GCC_WARNINGS version: 24 updated: 2009/02/01 15:21:00
+dnl CF_GCC_WARNINGS version: 25 updated: 2010/04/24 11:03:31
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:
then
AC_CHECKING([for $CC warning options])
cf_save_CFLAGS="$CFLAGS"
- EXTRA_CFLAGS="-W -Wall"
+ EXTRA_CFLAGS=
cf_warn_CONST=""
test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
- for cf_opt in \
+ for cf_opt in W Wall \
Wbad-function-cast \
Wcast-align \
Wcast-qual \
])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_HEADER_PATH version: 10 updated: 2010/01/17 20:36:17
+dnl CF_HEADER_PATH version: 11 updated: 2010/04/21 06:20:50
dnl --------------
dnl Construct a search-list of directories for a nonstandard header-file
dnl
AC_DEFUN([CF_HEADER_PATH],
[
$1=
+
+# collect the current set of include-directories from compiler flags
cf_header_path_list=""
if test -n "${CFLAGS}${CPPFLAGS}" ; then
for cf_header_path in $CPPFLAGS $CFLAGS
case $cf_header_path in #(vi
-I*)
cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
- CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
- cf_header_path_list="$cf_header_path_list [$]$1"
+ cf_header_path_list="$cf_header_path_list $cf_header_path"
;;
esac
done
fi
+# add the variations for the package we are looking for
CF_SUBDIR_PATH($1,$2,include)
test "$includedir" != NONE && \
test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
}
-$1="$cf_header_path_list [$]$1"
+$1="[$]$1 $cf_header_path_list"
])dnl
dnl ---------------------------------------------------------------------------
dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23
esac
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_LIBRARY_PATH version: 8 updated: 2008/12/07 19:38:31
+dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50
dnl ---------------
dnl Construct a search-list of directories for a nonstandard library-file
dnl
dnl $2 = the package name
AC_DEFUN([CF_LIBRARY_PATH],
[
+$1=
cf_library_path_list=""
if test -n "${LDFLAGS}${LIBS}" ; then
for cf_library_path in $LDFLAGS $LIBS
AC_SUBST(cf_cv_makeflags)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40
+dnl CF_MAKE_TAGS version: 5 updated: 2010/04/03 20:07:32
dnl ------------
dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have
dnl a monocase filesystem.
AC_DEFUN([CF_MAKE_TAGS],[
AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
-AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no)
+
+AC_CHECK_PROGS(CTAGS, exctags ctags)
+AC_CHECK_PROGS(ETAGS, exetags etags)
+
+AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS-ctags}, yes, no)
if test "$cf_cv_mixedcase" = yes ; then
- AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no)
+ AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS-etags}, yes, no)
else
MAKE_UPPER_TAGS=no
fi
else
MAKE_UPPER_TAGS="#"
fi
-AC_SUBST(MAKE_UPPER_TAGS)
if test "$MAKE_LOWER_TAGS" = yes ; then
MAKE_LOWER_TAGS=
else
MAKE_LOWER_TAGS="#"
fi
+
+AC_SUBST(CTAGS)
+AC_SUBST(ETAGS)
+
+AC_SUBST(MAKE_UPPER_TAGS)
AC_SUBST(MAKE_LOWER_TAGS)
])dnl
dnl ---------------------------------------------------------------------------
$1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK version: 5 updated: 2010/03/27 18:39:42
+dnl CF_RPATH_HACK version: 8 updated: 2010/04/17 15:38:58
dnl -------------
AC_DEFUN([CF_RPATH_HACK],
[
AC_REQUIRE([CF_LD_RPATH_OPT])
-AC_REQUIRE([CF_SHARED_OPTS])
AC_MSG_CHECKING(for updated LDFLAGS)
if test -n "$LD_RPATH_OPT" ; then
AC_MSG_RESULT(maybe)
+ AC_CHECK_PROGS(cf_ldd_prog,ldd,no)
+ cf_rpath_list="/usr/lib /lib"
+ if test "$cf_ldd_prog" != no
+ then
+AC_TRY_LINK([#include <stdio.h>],
+ [printf("Hello");],
+ [cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`])
+ fi
+
CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
CF_RPATH_HACK_2(LDFLAGS)
CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
fi
+AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_RPATH_HACK_2 version: 1 updated: 2010/03/27 18:39:42
+dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24
dnl ---------------
dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
dnl EXTRA_LDFLAGS for each -L option found.
dnl
+dnl $cf_rpath_list contains a list of directories to ignore.
+dnl
dnl $1 = variable name to update. The LDFLAGS variable should be the only one,
dnl but LIBS often has misplaced -L options.
AC_DEFUN([CF_RPATH_HACK_2],
cf_rpath_dst=
for cf_rpath_src in [$]$1
do
- CF_VERBOSE(Filtering $cf_rpath_src)
case $cf_rpath_src in #(vi
-L*) #(vi
- if test "$LD_RPATH_OPT" = "-R " ; then
- cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'`
- else
- cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$LD_RPATH_OPT%`
+
+ # check if this refers to a directory which we will ignore
+ cf_rpath_skip=no
+ if test -n "$cf_rpath_list"
+ then
+ for cf_rpath_item in $cf_rpath_list
+ do
+ if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
+ then
+ cf_rpath_skip=yes
+ break
+ fi
+ done
+ fi
+
+ if test "$cf_rpath_skip" = no
+ then
+ # transform the option
+ if test "$LD_RPATH_OPT" = "-R " ; then
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
+ else
+ cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
+ fi
+
+ # if we have not already added this, add it now
+ cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
+ if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
+ then
+ CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp)
+ EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
+ fi
fi
- CF_VERBOSE(...Filter $cf_rpath_tmp)
- EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
;;
esac
cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
$1=$cf_rpath_dst
CF_VERBOSE(...checked $1 [$]$1)
+AC_SUBST(EXTRA_LDFLAGS)
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 61 updated: 2010/03/27 20:13:59
+dnl CF_SHARED_OPTS version: 62 updated: 2010/03/28 16:12:30
dnl --------------
dnl --------------
dnl Attempt to determine the appropriate CC/LD options for creating a shared
LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
fi
if test "$cf_cv_enable_rpath" = yes ; then
- EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS"
+ EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
fi
CF_SHARED_SONAME
if test "$GCC" != yes; then
fi
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12
+dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50
dnl --------------
dnl Construct a search-list for a nonstandard header/lib-file
dnl $1 = the variable to return as result
dnl $2 = the package name
dnl $3 = the subdirectory, e.g., bin, include or lib
AC_DEFUN([CF_SUBDIR_PATH],
-[$1=""
+[
+$1=
CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix)
CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52
+dnl CF_UTF8_LIB version: 6 updated: 2010/04/21 06:20:50
dnl -----------
dnl Check for multibyte support, and if not found, utf8 compatibility library
AC_DEFUN([CF_UTF8_LIB],
AC_DEFINE(HAVE_LIBUTF8_H)
CF_ADD_INCDIR($cf_cv_header_path_utf8)
CF_ADD_LIBDIR($cf_cv_library_path_utf8)
- LIBS="-lutf8 $LIBS"
+ LIBS="$cf_cv_library_file_utf8 $LIBS"
fi
])dnl
dnl ---------------------------------------------------------------------------
[USE_VALGRIND])
])dnl
dnl ---------------------------------------------------------------------------
-dnl CF_XOPEN_SOURCE version: 32 updated: 2010/01/09 11:05:50
+dnl CF_XOPEN_SOURCE version: 33 updated: 2010/03/28 15:35:52
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,
sco*) #(vi
# setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
;;
-solaris*) #(vi
+solaris2.1[[0-9]]) #(vi
+ cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
+ ;;
+solaris2.[[1-9]]) #(vi
cf_xopen_source="-D__EXTENSIONS__"
;;
*)