aclocal.m4 revision 220749
1217309Snwhitehorndnl macros used for DIALOG configure script 2220749Snwhitehorndnl $Id: aclocal.m4,v 1.80 2011/01/18 23:17:01 tom Exp $ 3220749Snwhitehorndnl --------------------------------------------------------------------------- 4220749Snwhitehorndnl Copyright 1999-2010,2011 -- Thomas E. Dickey 5217309Snwhitehorndnl 6220749Snwhitehorndnl Permission is hereby granted, free of charge, to any person obtaining a 7220749Snwhitehorndnl copy of this software and associated documentation files (the 8220749Snwhitehorndnl "Software"), to deal in the Software without restriction, including 9220749Snwhitehorndnl without limitation the rights to use, copy, modify, merge, publish, 10220749Snwhitehorndnl distribute, distribute with modifications, sublicense, and/or sell 11220749Snwhitehorndnl copies of the Software, and to permit persons to whom the Software is 12220749Snwhitehorndnl furnished to do so, subject to the following conditions: 13220749Snwhitehorndnl 14220749Snwhitehorndnl The above copyright notice and this permission notice shall be included 15220749Snwhitehorndnl in all copies or portions of the Software. 16220749Snwhitehorndnl 17220749Snwhitehorndnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 18220749Snwhitehorndnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 19220749Snwhitehorndnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 20220749Snwhitehorndnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 21220749Snwhitehorndnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 22220749Snwhitehorndnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR 23220749Snwhitehorndnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. 24220749Snwhitehorndnl 25220749Snwhitehorndnl Except as contained in this notice, the name(s) of the above copyright 26220749Snwhitehorndnl holders shall not be used in advertising or otherwise to promote the 27220749Snwhitehorndnl sale, use or other dealings in this Software without prior written 28220749Snwhitehorndnl authorization. 29220749Snwhitehorndnl 30217309Snwhitehorndnl see 31217309Snwhitehorndnl http://invisible-island.net/autoconf/ 32217309Snwhitehorndnl --------------------------------------------------------------------------- 33217309Snwhitehorndnl --------------------------------------------------------------------------- 34220749Snwhitehorndnl AM_GNU_GETTEXT version: 12 updated: 2010/06/19 07:02:11 35217309Snwhitehorndnl -------------- 36217309Snwhitehorndnl Usage: Just like AM_WITH_NLS, which see. 37217309SnwhitehornAC_DEFUN([AM_GNU_GETTEXT], 38217309Snwhitehorn [AC_REQUIRE([AC_PROG_MAKE_SET])dnl 39217309Snwhitehorn AC_REQUIRE([AC_PROG_CC])dnl 40217309Snwhitehorn AC_REQUIRE([AC_CANONICAL_HOST])dnl 41217309Snwhitehorn AC_REQUIRE([AC_PROG_RANLIB])dnl 42217309Snwhitehorn AC_REQUIRE([AC_ISC_POSIX])dnl 43217309Snwhitehorn AC_REQUIRE([AC_HEADER_STDC])dnl 44217309Snwhitehorn AC_REQUIRE([AC_C_CONST])dnl 45217309Snwhitehorn AC_REQUIRE([AC_C_INLINE])dnl 46217309Snwhitehorn AC_REQUIRE([AC_TYPE_OFF_T])dnl 47217309Snwhitehorn AC_REQUIRE([AC_TYPE_SIZE_T])dnl 48217309Snwhitehorn AC_REQUIRE([AC_FUNC_ALLOCA])dnl 49217309Snwhitehorn AC_REQUIRE([AC_FUNC_MMAP])dnl 50217309Snwhitehorn AC_REQUIRE([jm_GLIBC21])dnl 51217309Snwhitehorn 52217309Snwhitehorn AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \ 53217309Snwhitehornstdlib.h string.h unistd.h sys/param.h]) 54217309Snwhitehorn AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \ 55217309Snwhitehorngetgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \ 56217309Snwhitehornstrdup strtoul tsearch __argz_count __argz_stringify __argz_next]) 57217309Snwhitehorn 58217309Snwhitehorn AM_ICONV 59217309Snwhitehorn AM_LANGINFO_CODESET 60217309Snwhitehorn AM_LC_MESSAGES 61217309Snwhitehorn AM_WITH_NLS([$1],[$2],[$3],[$4]) 62217309Snwhitehorn 63217309Snwhitehorn if test "x$CATOBJEXT" != "x"; then 64217309Snwhitehorn if test "x$ALL_LINGUAS" = "x"; then 65217309Snwhitehorn LINGUAS= 66217309Snwhitehorn else 67217309Snwhitehorn AC_MSG_CHECKING(for catalogs to be installed) 68217309Snwhitehorn NEW_LINGUAS= 69217309Snwhitehorn for presentlang in $ALL_LINGUAS; do 70217309Snwhitehorn useit=no 71217309Snwhitehorn for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do 72217309Snwhitehorn # Use the presentlang catalog if desiredlang is 73217309Snwhitehorn # a. equal to presentlang, or 74217309Snwhitehorn # b. a variant of presentlang (because in this case, 75217309Snwhitehorn # presentlang can be used as a fallback for messages 76217309Snwhitehorn # which are not translated in the desiredlang catalog). 77217309Snwhitehorn case "$desiredlang" in 78217309Snwhitehorn "$presentlang"*) useit=yes;; 79217309Snwhitehorn esac 80217309Snwhitehorn done 81217309Snwhitehorn if test $useit = yes; then 82217309Snwhitehorn NEW_LINGUAS="$NEW_LINGUAS $presentlang" 83217309Snwhitehorn fi 84217309Snwhitehorn done 85217309Snwhitehorn LINGUAS=$NEW_LINGUAS 86217309Snwhitehorn AC_MSG_RESULT($LINGUAS) 87217309Snwhitehorn fi 88217309Snwhitehorn 89217309Snwhitehorn dnl Construct list of names of catalog files to be constructed. 90217309Snwhitehorn if test -n "$LINGUAS"; then 91217309Snwhitehorn for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done 92217309Snwhitehorn fi 93217309Snwhitehorn fi 94217309Snwhitehorn 95217309Snwhitehorn dnl Enable libtool support if the surrounding package wishes it. 96217309Snwhitehorn INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], []) 97217309Snwhitehorn AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) 98217309Snwhitehorn])dnl 99217309Snwhitehorndnl --------------------------------------------------------------------------- 100217309Snwhitehorndnl AM_ICONV version: 12 updated: 2007/07/30 19:12:03 101217309Snwhitehorndnl -------- 102217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 103217309Snwhitehorndnl File from /usr/share/aclocal 104217309Snwhitehorndnl iconv.m4 105217309Snwhitehorndnl ==================== 106217309Snwhitehorndnl serial AM2 107217309Snwhitehorndnl 108217309Snwhitehorndnl From Bruno Haible. 109217309Snwhitehorndnl 110217309Snwhitehorndnl ==================== 111217309Snwhitehorndnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the 112217309Snwhitehorndnl range of locations searched. Retain the same cache-variable naming to 113217309Snwhitehorndnl allow reuse with the other gettext macros -Thomas E Dickey 114217309SnwhitehornAC_DEFUN([AM_ICONV], 115217309Snwhitehorn[ 116217309Snwhitehorn dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and 117217309Snwhitehorn dnl those with the standalone portable GNU libiconv installed). 118217309Snwhitehorn 119217309Snwhitehorn AC_ARG_WITH([libiconv-prefix], 120217309Snwhitehorn[ --with-libiconv-prefix=DIR 121217309Snwhitehorn search for libiconv in DIR/include and DIR/lib], [ 122217309Snwhitehorn CF_ADD_OPTIONAL_PATH($withval, libiconv) 123217309Snwhitehorn ]) 124217309Snwhitehorn 125217309Snwhitehorn AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ 126217309Snwhitehorn CF_FIND_LINKAGE(CF__ICONV_HEAD, 127217309Snwhitehorn CF__ICONV_BODY, 128217309Snwhitehorn iconv, 129217309Snwhitehorn am_cv_func_iconv=yes, 130217309Snwhitehorn am_cv_func_iconv=["no, consider installing GNU libiconv"])]) 131217309Snwhitehorn 132217309Snwhitehorn if test "$am_cv_func_iconv" = yes; then 133217309Snwhitehorn AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) 134217309Snwhitehorn 135217309Snwhitehorn AC_CACHE_CHECK([if the declaration of iconv() needs const.], 136217309Snwhitehorn am_cv_proto_iconv_const,[ 137217309Snwhitehorn AC_TRY_COMPILE(CF__ICONV_HEAD [ 138217309Snwhitehornextern 139217309Snwhitehorn#ifdef __cplusplus 140217309Snwhitehorn"C" 141217309Snwhitehorn#endif 142217309Snwhitehorn#if defined(__STDC__) || defined(__cplusplus) 143217309Snwhitehornsize_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); 144217309Snwhitehorn#else 145217309Snwhitehornsize_t iconv(); 146217309Snwhitehorn#endif 147217309Snwhitehorn],[], am_cv_proto_iconv_const=no, 148217309Snwhitehorn am_cv_proto_iconv_const=yes)]) 149217309Snwhitehorn 150217309Snwhitehorn if test "$am_cv_proto_iconv_const" = yes ; then 151217309Snwhitehorn am_cv_proto_iconv_arg1="const" 152217309Snwhitehorn else 153217309Snwhitehorn am_cv_proto_iconv_arg1="" 154217309Snwhitehorn fi 155217309Snwhitehorn 156217309Snwhitehorn AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, 157217309Snwhitehorn [Define as const if the declaration of iconv() needs const.]) 158217309Snwhitehorn fi 159217309Snwhitehorn 160217309Snwhitehorn LIBICONV= 161217309Snwhitehorn if test "$cf_cv_find_linkage_iconv" = yes; then 162217309Snwhitehorn CF_ADD_INCDIR($cf_cv_header_path_iconv) 163217309Snwhitehorn if test -n "$cf_cv_library_file_iconv" ; then 164217309Snwhitehorn LIBICONV="-liconv" 165217309Snwhitehorn CF_ADD_LIBDIR($cf_cv_library_path_iconv) 166217309Snwhitehorn fi 167217309Snwhitehorn fi 168217309Snwhitehorn 169217309Snwhitehorn AC_SUBST(LIBICONV) 170217309Snwhitehorn])dnl 171217309Snwhitehorndnl --------------------------------------------------------------------------- 172217309Snwhitehorndnl AM_LANGINFO_CODESET version: 3 updated: 2002/10/27 23:21:42 173217309Snwhitehorndnl ------------------- 174217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 175217309Snwhitehorndnl File from /usr/share/aclocal 176217309Snwhitehorndnl codeset.m4 177217309Snwhitehorndnl ==================== 178217309Snwhitehorndnl serial AM1 179217309Snwhitehorndnl 180217309Snwhitehorndnl From Bruno Haible. 181217309SnwhitehornAC_DEFUN([AM_LANGINFO_CODESET], 182217309Snwhitehorn[ 183217309Snwhitehorn AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, 184217309Snwhitehorn [AC_TRY_LINK([#include <langinfo.h>], 185217309Snwhitehorn [char* cs = nl_langinfo(CODESET);], 186217309Snwhitehorn am_cv_langinfo_codeset=yes, 187217309Snwhitehorn am_cv_langinfo_codeset=no) 188217309Snwhitehorn ]) 189217309Snwhitehorn if test $am_cv_langinfo_codeset = yes; then 190217309Snwhitehorn AC_DEFINE(HAVE_LANGINFO_CODESET, 1, 191217309Snwhitehorn [Define if you have <langinfo.h> and nl_langinfo(CODESET).]) 192217309Snwhitehorn fi 193217309Snwhitehorn])dnl 194217309Snwhitehorndnl --------------------------------------------------------------------------- 195217309Snwhitehorndnl AM_LC_MESSAGES version: 4 updated: 2002/10/27 23:21:42 196217309Snwhitehorndnl -------------- 197217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 198217309Snwhitehorndnl File from /usr/share/aclocal 199217309Snwhitehorndnl lcmessage.m4 200217309Snwhitehorndnl ==================== 201217309Snwhitehorndnl Check whether LC_MESSAGES is available in <locale.h>. 202217309Snwhitehorndnl Ulrich Drepper <drepper@cygnus.com>, 1995. 203217309Snwhitehorndnl 204217309Snwhitehorndnl This file can be copied and used freely without restrictions. It can 205217309Snwhitehorndnl be used in projects which are not available under the GNU General Public 206217309Snwhitehorndnl License or the GNU Library General Public License but which still want 207217309Snwhitehorndnl to provide support for the GNU gettext functionality. 208217309Snwhitehorndnl Please note that the actual code of the GNU gettext library is covered 209217309Snwhitehorndnl by the GNU Library General Public License, and the rest of the GNU 210217309Snwhitehorndnl gettext package package is covered by the GNU General Public License. 211217309Snwhitehorndnl They are *not* in the public domain. 212217309Snwhitehorndnl 213217309Snwhitehorndnl serial 2 214217309Snwhitehorndnl 215217309SnwhitehornAC_DEFUN([AM_LC_MESSAGES], 216217309Snwhitehorn [if test $ac_cv_header_locale_h = yes; then 217217309Snwhitehorn AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES, 218217309Snwhitehorn [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES], 219217309Snwhitehorn am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)]) 220217309Snwhitehorn if test $am_cv_val_LC_MESSAGES = yes; then 221217309Snwhitehorn AC_DEFINE(HAVE_LC_MESSAGES, 1, 222217309Snwhitehorn [Define if your <locale.h> file defines LC_MESSAGES.]) 223217309Snwhitehorn fi 224217309Snwhitehorn fi])dnl 225217309Snwhitehorndnl --------------------------------------------------------------------------- 226217309Snwhitehorndnl AM_PATH_PROG_WITH_TEST version: 8 updated: 2009/01/11 20:31:12 227217309Snwhitehorndnl ---------------------- 228217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 229217309Snwhitehorndnl File from /usr/share/aclocal 230217309Snwhitehorndnl progtest.m4 231217309Snwhitehorndnl ==================== 232217309Snwhitehorndnl Search path for a program which passes the given test. 233217309Snwhitehorndnl Ulrich Drepper <drepper@cygnus.com>, 1996. 234217309Snwhitehorndnl 235217309Snwhitehorndnl This file can be copied and used freely without restrictions. It can 236217309Snwhitehorndnl be used in projects which are not available under the GNU General Public 237217309Snwhitehorndnl License or the GNU Library General Public License but which still want 238217309Snwhitehorndnl to provide support for the GNU gettext functionality. 239217309Snwhitehorndnl Please note that the actual code of the GNU gettext library is covered 240217309Snwhitehorndnl by the GNU Library General Public License, and the rest of the GNU 241217309Snwhitehorndnl gettext package package is covered by the GNU General Public License. 242217309Snwhitehorndnl They are *not* in the public domain. 243217309Snwhitehorndnl 244217309Snwhitehorndnl serial 2 245217309Snwhitehorndnl 246217309Snwhitehorndnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR, 247217309Snwhitehorndnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]]) 248217309SnwhitehornAC_DEFUN([AM_PATH_PROG_WITH_TEST], 249217309Snwhitehorn[# Extract the first word of "$2", so it can be a program name with args. 250217309SnwhitehornAC_REQUIRE([CF_PATHSEP]) 251217309Snwhitehornset dummy $2; ac_word=[$]2 252217309SnwhitehornAC_MSG_CHECKING([for $ac_word]) 253217309SnwhitehornAC_CACHE_VAL(ac_cv_path_$1, 254217309Snwhitehorn[case "[$]$1" in 255217309Snwhitehorn [[\\/]*|?:[\\/]]*) 256217309Snwhitehorn ac_cv_path_$1="[$]$1" # Let the user override the test with a path. 257217309Snwhitehorn ;; 258217309Snwhitehorn *) 259217309Snwhitehorn IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" 260217309Snwhitehorn for ac_dir in ifelse([$5], , $PATH, [$5]); do 261217309Snwhitehorn test -z "$ac_dir" && ac_dir=. 262217309Snwhitehorn if test -f $ac_dir/$ac_word$ac_exeext; then 263217309Snwhitehorn if [$3]; then 264217309Snwhitehorn ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext" 265217309Snwhitehorn break 266217309Snwhitehorn fi 267217309Snwhitehorn fi 268217309Snwhitehorn done 269217309Snwhitehorn IFS="$ac_save_ifs" 270217309Snwhitehorndnl If no 4th arg is given, leave the cache variable unset, 271217309Snwhitehorndnl so AC_PATH_PROGS will keep looking. 272217309Snwhitehornifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4" 273217309Snwhitehorn])dnl 274217309Snwhitehorn ;; 275217309Snwhitehornesac])dnl 276217309Snwhitehorn$1="$ac_cv_path_$1" 277217309Snwhitehornif test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then 278217309Snwhitehorn AC_MSG_RESULT([$]$1) 279217309Snwhitehornelse 280217309Snwhitehorn AC_MSG_RESULT(no) 281217309Snwhitehornfi 282217309SnwhitehornAC_SUBST($1)dnl 283217309Snwhitehorn])dnl 284217309Snwhitehorndnl --------------------------------------------------------------------------- 285220749Snwhitehorndnl AM_WITH_NLS version: 24 updated: 2010/06/20 09:24:28 286217309Snwhitehorndnl ----------- 287217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 288217309Snwhitehorndnl File from /usr/share/aclocal 289217309Snwhitehorndnl gettext.m4 290217309Snwhitehorndnl ==================== 291217309Snwhitehorndnl Macro to add for using GNU gettext. 292217309Snwhitehorndnl Ulrich Drepper <drepper@cygnus.com>, 1995. 293217309Snwhitehorndnl ==================== 294217309Snwhitehorndnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the 295217309Snwhitehorndnl range of locations searched. Retain the same cache-variable naming to 296217309Snwhitehorndnl allow reuse with the other gettext macros -Thomas E Dickey 297217309Snwhitehorndnl ==================== 298217309Snwhitehorndnl 299217309Snwhitehorndnl This file can be copied and used freely without restrictions. It can 300217309Snwhitehorndnl be used in projects which are not available under the GNU General Public 301217309Snwhitehorndnl License or the GNU Library General Public License but which still want 302217309Snwhitehorndnl to provide support for the GNU gettext functionality. 303217309Snwhitehorndnl Please note that the actual code of the GNU gettext library is covered 304217309Snwhitehorndnl by the GNU Library General Public License, and the rest of the GNU 305217309Snwhitehorndnl gettext package package is covered by the GNU General Public License. 306217309Snwhitehorndnl They are *not* in the public domain. 307217309Snwhitehorndnl 308217309Snwhitehorndnl serial 10 309217309Snwhitehorndnl 310217309Snwhitehorndnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR], [ENABLED]). 311217309Snwhitehorndnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library 312217309Snwhitehorndnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, 313217309Snwhitehorndnl depending on --{enable,disable}-{shared,static} and on the presence of 314217309Snwhitehorndnl AM-DISABLE-SHARED). Otherwise, a static library 315217309Snwhitehorndnl $(top_builddir)/intl/libintl.a will be created. 316217309Snwhitehorndnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext 317217309Snwhitehorndnl implementations (in libc or libintl) without the ngettext() function 318217309Snwhitehorndnl will be ignored. 319217309Snwhitehorndnl LIBDIR is used to find the intl libraries. If empty, 320217309Snwhitehorndnl the value `$(top_builddir)/intl/' is used. 321217309Snwhitehorndnl ENABLED is used to control the default for the related --enable-nls, since 322217309Snwhitehorndnl not all application developers want this feature by default, e.g., lynx. 323217309Snwhitehorndnl 324217309Snwhitehorndnl The result of the configuration is one of three cases: 325217309Snwhitehorndnl 1) GNU gettext, as included in the intl subdirectory, will be compiled 326217309Snwhitehorndnl and used. 327217309Snwhitehorndnl Catalog format: GNU --> install in $(datadir) 328217309Snwhitehorndnl Catalog extension: .mo after installation, .gmo in source tree 329217309Snwhitehorndnl 2) GNU gettext has been found in the system's C library. 330217309Snwhitehorndnl Catalog format: GNU --> install in $(datadir) 331217309Snwhitehorndnl Catalog extension: .mo after installation, .gmo in source tree 332217309Snwhitehorndnl 3) No internationalization, always use English msgid. 333217309Snwhitehorndnl Catalog format: none 334217309Snwhitehorndnl Catalog extension: none 335217309Snwhitehorndnl The use of .gmo is historical (it was needed to avoid overwriting the 336217309Snwhitehorndnl GNU format catalogs when building on a platform with an X/Open gettext), 337217309Snwhitehorndnl but we keep it in order not to force irrelevant filename changes on the 338217309Snwhitehorndnl maintainers. 339217309Snwhitehorndnl 340217309SnwhitehornAC_DEFUN([AM_WITH_NLS], 341217309Snwhitehorn[AC_MSG_CHECKING([whether NLS is requested]) 342217309Snwhitehorn dnl Default is enabled NLS 343217309Snwhitehorn ifelse([$4],,[ 344217309Snwhitehorn AC_ARG_ENABLE(nls, 345217309Snwhitehorn [ --disable-nls do not use Native Language Support], 346217309Snwhitehorn USE_NLS=$enableval, USE_NLS=yes)],[ 347217309Snwhitehorn AC_ARG_ENABLE(nls, 348217309Snwhitehorn [ --enable-nls use Native Language Support], 349217309Snwhitehorn USE_NLS=$enableval, USE_NLS=no)]) 350217309Snwhitehorn AC_MSG_RESULT($USE_NLS) 351217309Snwhitehorn AC_SUBST(USE_NLS) 352217309Snwhitehorn 353217309Snwhitehorn BUILD_INCLUDED_LIBINTL=no 354217309Snwhitehorn USE_INCLUDED_LIBINTL=no 355217309Snwhitehorn INTLLIBS= 356217309Snwhitehorn 357217309Snwhitehorn dnl If we use NLS figure out what method 358217309Snwhitehorn if test "$USE_NLS" = "yes"; then 359217309Snwhitehorn AC_DEFINE(ENABLE_NLS, 1, 360217309Snwhitehorn [Define to 1 if translation of program messages to the user's native language 361217309Snwhitehorn is requested.]) 362217309Snwhitehorn AC_MSG_CHECKING([whether included gettext is requested]) 363217309Snwhitehorn AC_ARG_WITH(included-gettext, 364217309Snwhitehorn [ --with-included-gettext use the GNU gettext library included here], 365217309Snwhitehorn nls_cv_force_use_gnu_gettext=$withval, 366217309Snwhitehorn nls_cv_force_use_gnu_gettext=no) 367217309Snwhitehorn AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) 368217309Snwhitehorn 369217309Snwhitehorn nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" 370217309Snwhitehorn if test "$nls_cv_force_use_gnu_gettext" != "yes"; then 371217309Snwhitehorn dnl User does not insist on using GNU NLS library. Figure out what 372217309Snwhitehorn dnl to use. If GNU gettext is available we use this. Else we have 373217309Snwhitehorn dnl to fall back to GNU NLS library. 374217309Snwhitehorn CATOBJEXT=NONE 375217309Snwhitehorn 376217309Snwhitehorn cf_save_LIBS_1="$LIBS" 377220749Snwhitehorn CF_ADD_LIBS($LIBICONV) 378217309Snwhitehorn AC_CACHE_CHECK([for libintl.h and gettext()], cf_cv_func_gettext,[ 379217309Snwhitehorn CF_FIND_LINKAGE(CF__INTL_HEAD, 380217309Snwhitehorn CF__INTL_BODY, 381217309Snwhitehorn intl, 382217309Snwhitehorn cf_cv_func_gettext=yes, 383217309Snwhitehorn cf_cv_func_gettext=no) 384217309Snwhitehorn ]) 385217309Snwhitehorn LIBS="$cf_save_LIBS_1" 386217309Snwhitehorn 387217309Snwhitehorn if test "$cf_cv_func_gettext" = yes ; then 388217309Snwhitehorn AC_DEFINE(HAVE_LIBINTL_H) 389217309Snwhitehorn 390217309Snwhitehorn dnl If an already present or preinstalled GNU gettext() is found, 391217309Snwhitehorn dnl use it. But if this macro is used in GNU gettext, and GNU 392217309Snwhitehorn dnl gettext is already preinstalled in libintl, we update this 393217309Snwhitehorn dnl libintl. (Cf. the install rule in intl/Makefile.in.) 394217309Snwhitehorn if test "$PACKAGE" != gettext; then 395217309Snwhitehorn AC_DEFINE(HAVE_GETTEXT, 1, 396217309Snwhitehorn [Define if the GNU gettext() function is already present or preinstalled.]) 397217309Snwhitehorn 398217309Snwhitehorn CF_ADD_INCDIR($cf_cv_header_path_intl) 399217309Snwhitehorn 400217309Snwhitehorn if test -n "$cf_cv_library_file_intl" ; then 401217309Snwhitehorn dnl If iconv() is in a separate libiconv library, then anyone 402217309Snwhitehorn dnl linking with libintl{.a,.so} also needs to link with 403217309Snwhitehorn dnl libiconv. 404217309Snwhitehorn INTLLIBS="$cf_cv_library_file_intl $LIBICONV" 405217309Snwhitehorn CF_ADD_LIBDIR($cf_cv_library_path_intl,INTLLIBS) 406217309Snwhitehorn fi 407217309Snwhitehorn 408217309Snwhitehorn gt_save_LIBS="$LIBS" 409217309Snwhitehorn LIBS="$LIBS $INTLLIBS" 410217309Snwhitehorn AC_CHECK_FUNCS(dcgettext) 411217309Snwhitehorn LIBS="$gt_save_LIBS" 412217309Snwhitehorn 413217309Snwhitehorn dnl Search for GNU msgfmt in the PATH. 414217309Snwhitehorn AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, 415217309Snwhitehorn [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) 416217309Snwhitehorn AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) 417217309Snwhitehorn 418217309Snwhitehorn dnl Search for GNU xgettext in the PATH. 419217309Snwhitehorn AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, 420217309Snwhitehorn [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) 421217309Snwhitehorn 422217309Snwhitehorn CATOBJEXT=.gmo 423217309Snwhitehorn fi 424217309Snwhitehorn fi 425217309Snwhitehorn 426217309Snwhitehorn if test "$CATOBJEXT" = "NONE"; then 427217309Snwhitehorn dnl GNU gettext is not found in the C library. 428217309Snwhitehorn dnl Fall back on GNU gettext library. 429217309Snwhitehorn nls_cv_use_gnu_gettext=yes 430217309Snwhitehorn fi 431217309Snwhitehorn fi 432217309Snwhitehorn 433217309Snwhitehorn if test "$nls_cv_use_gnu_gettext" = "yes"; then 434217309Snwhitehorn if test ! -d $srcdir/intl ; then 435217309Snwhitehorn AC_MSG_ERROR(no NLS library is packaged with this application) 436217309Snwhitehorn fi 437217309Snwhitehorn dnl Mark actions used to generate GNU NLS library. 438217309Snwhitehorn INTLOBJS="\$(GETTOBJS)" 439217309Snwhitehorn AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt, 440217309Snwhitehorn [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :) 441217309Snwhitehorn AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT) 442217309Snwhitehorn AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext, 443217309Snwhitehorn [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :) 444217309Snwhitehorn AC_SUBST(MSGFMT) 445217309Snwhitehorn BUILD_INCLUDED_LIBINTL=yes 446217309Snwhitehorn USE_INCLUDED_LIBINTL=yes 447217309Snwhitehorn CATOBJEXT=.gmo 448217309Snwhitehorn INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV" 449217309Snwhitehorn LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` 450217309Snwhitehorn fi 451217309Snwhitehorn 452217309Snwhitehorn dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. 453217309Snwhitehorn dnl Test whether we really found GNU msgfmt. 454217309Snwhitehorn if test "$GMSGFMT" != ":"; then 455217309Snwhitehorn dnl If it is no GNU msgfmt we define it as : so that the 456217309Snwhitehorn dnl Makefiles still can work. 457217309Snwhitehorn if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then 458217309Snwhitehorn : ; 459217309Snwhitehorn else 460217309Snwhitehorn AC_MSG_RESULT( 461217309Snwhitehorn [found msgfmt program is not GNU msgfmt; ignore it]) 462217309Snwhitehorn GMSGFMT=":" 463217309Snwhitehorn fi 464217309Snwhitehorn fi 465217309Snwhitehorn 466217309Snwhitehorn dnl This could go away some day; the PATH_PROG_WITH_TEST already does it. 467217309Snwhitehorn dnl Test whether we really found GNU xgettext. 468217309Snwhitehorn if test "$XGETTEXT" != ":"; then 469217309Snwhitehorn dnl If it is no GNU xgettext we define it as : so that the 470217309Snwhitehorn dnl Makefiles still can work. 471217309Snwhitehorn if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then 472217309Snwhitehorn : ; 473217309Snwhitehorn else 474217309Snwhitehorn AC_MSG_RESULT( 475217309Snwhitehorn [found xgettext program is not GNU xgettext; ignore it]) 476217309Snwhitehorn XGETTEXT=":" 477217309Snwhitehorn fi 478217309Snwhitehorn fi 479217309Snwhitehorn 480217309Snwhitehorn dnl We need to process the po/ directory. 481217309Snwhitehorn POSUB=po 482217309Snwhitehorn fi 483217309Snwhitehorn 484217309Snwhitehorn AC_OUTPUT_COMMANDS( 485217309Snwhitehorn [for ac_file in $CONFIG_FILES; do 486217309Snwhitehorn 487217309Snwhitehorn # Support "outfile[:infile[:infile...]]" 488217309Snwhitehorn case "$ac_file" in 489217309Snwhitehorn *:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; 490217309Snwhitehorn esac 491217309Snwhitehorn 492217309Snwhitehorn # PO directories have a Makefile.in generated from Makefile.inn. 493217309Snwhitehorn case "$ac_file" in */[Mm]akefile.in) 494217309Snwhitehorn # Adjust a relative srcdir. 495217309Snwhitehorn ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'` 496217309Snwhitehorn ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`" 497217309Snwhitehorn ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'` 498217309Snwhitehorn ac_base=`basename $ac_file .in` 499217309Snwhitehorn # In autoconf-2.13 it is called $ac_given_srcdir. 500217309Snwhitehorn # In autoconf-2.50 it is called $srcdir. 501217309Snwhitehorn test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir" 502217309Snwhitehorn 503217309Snwhitehorn case "$ac_given_srcdir" in 504217309Snwhitehorn .) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;; 505217309Snwhitehorn /*) top_srcdir="$ac_given_srcdir" ;; 506217309Snwhitehorn *) top_srcdir="$ac_dots$ac_given_srcdir" ;; 507217309Snwhitehorn esac 508217309Snwhitehorn 509217309Snwhitehorn if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then 510217309Snwhitehorn rm -f "$ac_dir/POTFILES" 511217309Snwhitehorn test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES" 512217309Snwhitehorn sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES" 513217309Snwhitehorn test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base" 514217309Snwhitehorn sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base" 515217309Snwhitehorn fi 516217309Snwhitehorn ;; 517217309Snwhitehorn esac 518217309Snwhitehorn done]) 519217309Snwhitehorn 520217309Snwhitehorn dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL 521217309Snwhitehorn dnl to 'yes' because some of the testsuite requires it. 522217309Snwhitehorn if test "$PACKAGE" = gettext; then 523217309Snwhitehorn BUILD_INCLUDED_LIBINTL=yes 524217309Snwhitehorn fi 525217309Snwhitehorn 526217309Snwhitehorn dnl intl/plural.c is generated from intl/plural.y. It requires bison, 527217309Snwhitehorn dnl because plural.y uses bison specific features. It requires at least 528217309Snwhitehorn dnl bison-1.26 because earlier versions generate a plural.c that doesn't 529217309Snwhitehorn dnl compile. 530217309Snwhitehorn dnl bison is only needed for the maintainer (who touches plural.y). But in 531217309Snwhitehorn dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put 532217309Snwhitehorn dnl the rule in general Makefile. Now, some people carelessly touch the 533217309Snwhitehorn dnl files or have a broken "make" program, hence the plural.c rule will 534217309Snwhitehorn dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not 535217309Snwhitehorn dnl present or too old. 536217309Snwhitehorn if test "$nls_cv_use_gnu_gettext" = "yes"; then 537217309Snwhitehorn AC_CHECK_PROGS([INTLBISON], [bison]) 538217309Snwhitehorn if test -z "$INTLBISON"; then 539217309Snwhitehorn ac_verc_fail=yes 540217309Snwhitehorn else 541217309Snwhitehorn dnl Found it, now check the version. 542217309Snwhitehorn AC_MSG_CHECKING([version of bison]) 543217309Snwhitehornchangequote(<<,>>)dnl 544217309Snwhitehorn ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'` 545217309Snwhitehorn case $ac_prog_version in 546217309Snwhitehorn '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; 547217309Snwhitehorn 1.2[6-9]* | 1.[3-9][0-9]* | [2-9].*) 548217309Snwhitehornchangequote([,])dnl 549217309Snwhitehorn ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;; 550217309Snwhitehorn *) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;; 551217309Snwhitehorn esac 552217309Snwhitehorn AC_MSG_RESULT([$ac_prog_version]) 553217309Snwhitehorn fi 554217309Snwhitehorn if test $ac_verc_fail = yes; then 555217309Snwhitehorn INTLBISON=: 556217309Snwhitehorn fi 557217309Snwhitehorn fi 558217309Snwhitehorn 559217309Snwhitehorn dnl These rules are solely for the distribution goal. While doing this 560217309Snwhitehorn dnl we only have to keep exactly one list of the available catalogs 561217309Snwhitehorn dnl in configure.in. 562217309Snwhitehorn for lang in $ALL_LINGUAS; do 563217309Snwhitehorn GMOFILES="$GMOFILES $lang.gmo" 564217309Snwhitehorn POFILES="$POFILES $lang.po" 565217309Snwhitehorn done 566217309Snwhitehorn 567217309Snwhitehorn dnl Make all variables we use known to autoconf. 568217309Snwhitehorn AC_SUBST(BUILD_INCLUDED_LIBINTL) 569217309Snwhitehorn AC_SUBST(USE_INCLUDED_LIBINTL) 570217309Snwhitehorn AC_SUBST(CATALOGS) 571217309Snwhitehorn AC_SUBST(CATOBJEXT) 572217309Snwhitehorn AC_SUBST(GMOFILES) 573217309Snwhitehorn AC_SUBST(INTLLIBS) 574217309Snwhitehorn AC_SUBST(INTLOBJS) 575217309Snwhitehorn AC_SUBST(POFILES) 576217309Snwhitehorn AC_SUBST(POSUB) 577217309Snwhitehorn 578217309Snwhitehorn dnl For backward compatibility. Some configure.ins may be using this. 579217309Snwhitehorn nls_cv_header_intl= 580217309Snwhitehorn nls_cv_header_libgt= 581217309Snwhitehorn 582217309Snwhitehorn dnl For backward compatibility. Some Makefiles may be using this. 583217309Snwhitehorn DATADIRNAME=share 584217309Snwhitehorn AC_SUBST(DATADIRNAME) 585217309Snwhitehorn 586217309Snwhitehorn dnl For backward compatibility. Some Makefiles may be using this. 587217309Snwhitehorn INSTOBJEXT=.mo 588217309Snwhitehorn AC_SUBST(INSTOBJEXT) 589217309Snwhitehorn 590217309Snwhitehorn dnl For backward compatibility. Some Makefiles may be using this. 591217309Snwhitehorn GENCAT=gencat 592217309Snwhitehorn AC_SUBST(GENCAT) 593217309Snwhitehorn])dnl 594217309Snwhitehorndnl --------------------------------------------------------------------------- 595217309Snwhitehorndnl CF_AC_PREREQ version: 2 updated: 1997/09/06 13:24:56 596217309Snwhitehorndnl ------------ 597217309Snwhitehorndnl Conditionally generate script according to whether we're using the release 598217309Snwhitehorndnl version of autoconf, or a patched version (using the ternary component as 599217309Snwhitehorndnl the patch-version). 600217309Snwhitehorndefine(CF_AC_PREREQ, 601217309Snwhitehorn[CF_PREREQ_COMPARE( 602217309SnwhitehornAC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), 603217309SnwhitehornAC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), [$1], [$2], [$3])])dnl 604217309Snwhitehorndnl --------------------------------------------------------------------------- 605220749Snwhitehorndnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 606217309Snwhitehorndnl ------------- 607217309Snwhitehorndnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS 608217309Snwhitehorndnl The second parameter if given makes this macro verbose. 609217309Snwhitehorndnl 610217309Snwhitehorndnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, 611217309Snwhitehorndnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily 612217309Snwhitehorndnl confused by the quotes (which require backslashes to keep them usable). 613217309SnwhitehornAC_DEFUN([CF_ADD_CFLAGS], 614217309Snwhitehorn[ 615217309Snwhitehorncf_fix_cppflags=no 616217309Snwhitehorncf_new_cflags= 617217309Snwhitehorncf_new_cppflags= 618217309Snwhitehorncf_new_extra_cppflags= 619217309Snwhitehorn 620217309Snwhitehornfor cf_add_cflags in $1 621217309Snwhitehorndo 622217309Snwhitehorncase $cf_fix_cppflags in 623217309Snwhitehornno) 624217309Snwhitehorn case $cf_add_cflags in #(vi 625217309Snwhitehorn -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi 626217309Snwhitehorn case $cf_add_cflags in 627217309Snwhitehorn -D*) 628217309Snwhitehorn cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` 629217309Snwhitehorn 630217309Snwhitehorn test "${cf_add_cflags}" != "${cf_tst_cflags}" \ 631217309Snwhitehorn && test -z "${cf_tst_cflags}" \ 632217309Snwhitehorn && cf_fix_cppflags=yes 633217309Snwhitehorn 634217309Snwhitehorn if test $cf_fix_cppflags = yes ; then 635217309Snwhitehorn cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" 636217309Snwhitehorn continue 637217309Snwhitehorn elif test "${cf_tst_cflags}" = "\"'" ; then 638217309Snwhitehorn cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" 639217309Snwhitehorn continue 640217309Snwhitehorn fi 641217309Snwhitehorn ;; 642217309Snwhitehorn esac 643217309Snwhitehorn case "$CPPFLAGS" in 644217309Snwhitehorn *$cf_add_cflags) #(vi 645217309Snwhitehorn ;; 646217309Snwhitehorn *) #(vi 647217309Snwhitehorn case $cf_add_cflags in #(vi 648217309Snwhitehorn -D*) 649217309Snwhitehorn cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` 650217309Snwhitehorn CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) 651217309Snwhitehorn ;; 652217309Snwhitehorn esac 653217309Snwhitehorn cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" 654217309Snwhitehorn ;; 655217309Snwhitehorn esac 656217309Snwhitehorn ;; 657217309Snwhitehorn *) 658217309Snwhitehorn cf_new_cflags="$cf_new_cflags $cf_add_cflags" 659217309Snwhitehorn ;; 660217309Snwhitehorn esac 661217309Snwhitehorn ;; 662217309Snwhitehornyes) 663217309Snwhitehorn cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" 664217309Snwhitehorn 665217309Snwhitehorn cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` 666217309Snwhitehorn 667217309Snwhitehorn test "${cf_add_cflags}" != "${cf_tst_cflags}" \ 668217309Snwhitehorn && test -z "${cf_tst_cflags}" \ 669217309Snwhitehorn && cf_fix_cppflags=no 670217309Snwhitehorn ;; 671217309Snwhitehornesac 672217309Snwhitehorndone 673217309Snwhitehorn 674217309Snwhitehornif test -n "$cf_new_cflags" ; then 675220749Snwhitehorn ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) 676217309Snwhitehorn CFLAGS="$CFLAGS $cf_new_cflags" 677217309Snwhitehornfi 678217309Snwhitehorn 679217309Snwhitehornif test -n "$cf_new_cppflags" ; then 680220749Snwhitehorn ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) 681217309Snwhitehorn CPPFLAGS="$CPPFLAGS $cf_new_cppflags" 682217309Snwhitehornfi 683217309Snwhitehorn 684217309Snwhitehornif test -n "$cf_new_extra_cppflags" ; then 685220749Snwhitehorn ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) 686217309Snwhitehorn EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" 687217309Snwhitehornfi 688217309Snwhitehorn 689217309SnwhitehornAC_SUBST(EXTRA_CPPFLAGS) 690217309Snwhitehorn 691217309Snwhitehorn])dnl 692217309Snwhitehorndnl --------------------------------------------------------------------------- 693220749Snwhitehorndnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 694217309Snwhitehorndnl ------------- 695217309Snwhitehorndnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's 696217309Snwhitehorndnl redundant. We don't normally need to add -I/usr/local/include for gcc, 697217309Snwhitehorndnl but old versions (and some misinstalled ones) need that. To make things 698217309Snwhitehorndnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to 699217309Snwhitehorndnl the include-path). 700217309SnwhitehornAC_DEFUN([CF_ADD_INCDIR], 701217309Snwhitehorn[ 702217309Snwhitehornif test -n "$1" ; then 703217309Snwhitehorn for cf_add_incdir in $1 704217309Snwhitehorn do 705217309Snwhitehorn while test $cf_add_incdir != /usr/include 706217309Snwhitehorn do 707217309Snwhitehorn if test -d $cf_add_incdir 708217309Snwhitehorn then 709217309Snwhitehorn cf_have_incdir=no 710217309Snwhitehorn if test -n "$CFLAGS$CPPFLAGS" ; then 711217309Snwhitehorn # a loop is needed to ensure we can add subdirs of existing dirs 712217309Snwhitehorn for cf_test_incdir in $CFLAGS $CPPFLAGS ; do 713217309Snwhitehorn if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then 714217309Snwhitehorn cf_have_incdir=yes; break 715217309Snwhitehorn fi 716217309Snwhitehorn done 717217309Snwhitehorn fi 718217309Snwhitehorn 719217309Snwhitehorn if test "$cf_have_incdir" = no ; then 720217309Snwhitehorn if test "$cf_add_incdir" = /usr/local/include ; then 721217309Snwhitehorn if test "$GCC" = yes 722217309Snwhitehorn then 723217309Snwhitehorn cf_save_CPPFLAGS=$CPPFLAGS 724217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" 725217309Snwhitehorn AC_TRY_COMPILE([#include <stdio.h>], 726217309Snwhitehorn [printf("Hello")], 727217309Snwhitehorn [], 728217309Snwhitehorn [cf_have_incdir=yes]) 729217309Snwhitehorn CPPFLAGS=$cf_save_CPPFLAGS 730217309Snwhitehorn fi 731217309Snwhitehorn fi 732217309Snwhitehorn fi 733217309Snwhitehorn 734217309Snwhitehorn if test "$cf_have_incdir" = no ; then 735217309Snwhitehorn CF_VERBOSE(adding $cf_add_incdir to include-path) 736220749Snwhitehorn ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" 737217309Snwhitehorn 738217309Snwhitehorn cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` 739217309Snwhitehorn test "$cf_top_incdir" = "$cf_add_incdir" && break 740217309Snwhitehorn cf_add_incdir="$cf_top_incdir" 741217309Snwhitehorn else 742217309Snwhitehorn break 743217309Snwhitehorn fi 744217309Snwhitehorn fi 745217309Snwhitehorn done 746217309Snwhitehorn done 747217309Snwhitehornfi 748217309Snwhitehorn])dnl 749217309Snwhitehorndnl --------------------------------------------------------------------------- 750220749Snwhitehorndnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 751220749Snwhitehorndnl ---------- 752220749Snwhitehorndnl Add a library, used to enforce consistency. 753220749Snwhitehorndnl 754220749Snwhitehorndnl $1 = library to add, without the "-l" 755220749Snwhitehorndnl $2 = variable to update (default $LIBS) 756220749SnwhitehornAC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl 757220749Snwhitehorndnl --------------------------------------------------------------------------- 758220749Snwhitehorndnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57 759217309Snwhitehorndnl ------------- 760217309Snwhitehorndnl Adds to the library-path 761217309Snwhitehorndnl 762217309Snwhitehorndnl Some machines have trouble with multiple -L options. 763217309Snwhitehorndnl 764217309Snwhitehorndnl $1 is the (list of) directory(s) to add 765217309Snwhitehorndnl $2 is the optional name of the variable to update (default LDFLAGS) 766217309Snwhitehorndnl 767217309SnwhitehornAC_DEFUN([CF_ADD_LIBDIR], 768217309Snwhitehorn[ 769217309Snwhitehornif test -n "$1" ; then 770217309Snwhitehorn for cf_add_libdir in $1 771217309Snwhitehorn do 772217309Snwhitehorn if test $cf_add_libdir = /usr/lib ; then 773217309Snwhitehorn : 774217309Snwhitehorn elif test -d $cf_add_libdir 775217309Snwhitehorn then 776217309Snwhitehorn cf_have_libdir=no 777217309Snwhitehorn if test -n "$LDFLAGS$LIBS" ; then 778217309Snwhitehorn # a loop is needed to ensure we can add subdirs of existing dirs 779217309Snwhitehorn for cf_test_libdir in $LDFLAGS $LIBS ; do 780217309Snwhitehorn if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then 781217309Snwhitehorn cf_have_libdir=yes; break 782217309Snwhitehorn fi 783217309Snwhitehorn done 784217309Snwhitehorn fi 785217309Snwhitehorn if test "$cf_have_libdir" = no ; then 786217309Snwhitehorn CF_VERBOSE(adding $cf_add_libdir to library-path) 787220749Snwhitehorn ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" 788217309Snwhitehorn fi 789217309Snwhitehorn fi 790217309Snwhitehorn done 791217309Snwhitehornfi 792217309Snwhitehorn])dnl 793217309Snwhitehorndnl --------------------------------------------------------------------------- 794220749Snwhitehorndnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 795220749Snwhitehorndnl ----------- 796220749Snwhitehorndnl Add one or more libraries, used to enforce consistency. 797220749Snwhitehorndnl 798220749Snwhitehorndnl $1 = libraries to add, with the "-l", etc. 799220749Snwhitehorndnl $2 = variable to update (default $LIBS) 800220749SnwhitehornAC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl 801220749Snwhitehorndnl --------------------------------------------------------------------------- 802217309Snwhitehorndnl CF_ADD_OPTIONAL_PATH version: 1 updated: 2007/07/29 12:33:33 803217309Snwhitehorndnl -------------------- 804217309Snwhitehorndnl Add an optional search-path to the compile/link variables. 805217309Snwhitehorndnl See CF_WITH_PATH 806217309Snwhitehorndnl 807217309Snwhitehorndnl $1 = shell variable containing the result of --with-XXX=[DIR] 808217309Snwhitehorndnl $2 = module to look for. 809217309SnwhitehornAC_DEFUN([CF_ADD_OPTIONAL_PATH],[ 810217309Snwhitehorn case "$1" in #(vi 811217309Snwhitehorn no) #(vi 812217309Snwhitehorn ;; 813217309Snwhitehorn yes) #(vi 814217309Snwhitehorn ;; 815217309Snwhitehorn *) 816217309Snwhitehorn CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)]) 817217309Snwhitehorn ;; 818217309Snwhitehorn esac 819217309Snwhitehorn])dnl 820217309Snwhitehorndnl --------------------------------------------------------------------------- 821217309Snwhitehorndnl CF_ADD_SEARCHPATH version: 5 updated: 2009/01/11 20:40:21 822217309Snwhitehorndnl ----------------- 823217309Snwhitehorndnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter. 824217309Snwhitehorndnl They can be either the common root of include- and lib-directories, or the 825217309Snwhitehorndnl lib-directory (to allow for things like lib64 directories). 826217309Snwhitehorndnl See also CF_FIND_LINKAGE. 827217309Snwhitehorndnl 828217309Snwhitehorndnl $1 is the list of colon-separated directory names to search. 829217309Snwhitehorndnl $2 is the action to take if a parameter does not yield a directory. 830217309SnwhitehornAC_DEFUN([CF_ADD_SEARCHPATH], 831217309Snwhitehorn[ 832217309SnwhitehornAC_REQUIRE([CF_PATHSEP]) 833217309Snwhitehornfor cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do 834217309Snwhitehorn if test -d $cf_searchpath/include; then 835217309Snwhitehorn CF_ADD_INCDIR($cf_searchpath/include) 836217309Snwhitehorn elif test -d $cf_searchpath/../include ; then 837217309Snwhitehorn CF_ADD_INCDIR($cf_searchpath/../include) 838217309Snwhitehorn ifelse([$2],,,[else 839217309Snwhitehorn$2]) 840217309Snwhitehorn fi 841217309Snwhitehorn if test -d $cf_searchpath/lib; then 842217309Snwhitehorn CF_ADD_LIBDIR($cf_searchpath/lib) 843217309Snwhitehorn elif test -d $cf_searchpath ; then 844217309Snwhitehorn CF_ADD_LIBDIR($cf_searchpath) 845217309Snwhitehorn ifelse([$2],,,[else 846217309Snwhitehorn$2]) 847217309Snwhitehorn fi 848217309Snwhitehorndone 849217309Snwhitehorn]) 850217309Snwhitehorndnl --------------------------------------------------------------------------- 851220749Snwhitehorndnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 852217309Snwhitehorndnl ------------------ 853217309Snwhitehorndnl Append to a search-list for a nonstandard header/lib-file 854217309Snwhitehorndnl $1 = the variable to return as result 855217309Snwhitehorndnl $2 = the package name 856217309Snwhitehorndnl $3 = the subdirectory, e.g., bin, include or lib 857217309Snwhitehorndnl $4 = the directory under which we will test for subdirectories 858217309Snwhitehorndnl $5 = a directory that we do not want $4 to match 859217309SnwhitehornAC_DEFUN([CF_ADD_SUBDIR_PATH], 860217309Snwhitehorn[ 861217309Snwhitehorntest "$4" != "$5" && \ 862217309Snwhitehorntest -d "$4" && \ 863220749Snwhitehornifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { 864217309Snwhitehorn test -n "$verbose" && echo " ... testing for $3-directories under $4" 865217309Snwhitehorn test -d $4/$3 && $1="[$]$1 $4/$3" 866217309Snwhitehorn test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" 867217309Snwhitehorn test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3" 868217309Snwhitehorn test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3" 869217309Snwhitehorn test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2" 870217309Snwhitehorn} 871217309Snwhitehorn])dnl 872217309Snwhitehorndnl --------------------------------------------------------------------------- 873217309Snwhitehorndnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 874217309Snwhitehorndnl -------------- 875217309Snwhitehorndnl Allow user to disable a normally-on option. 876217309SnwhitehornAC_DEFUN([CF_ARG_DISABLE], 877217309Snwhitehorn[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl 878217309Snwhitehorndnl --------------------------------------------------------------------------- 879217309Snwhitehorndnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 880217309Snwhitehorndnl ------------- 881217309Snwhitehorndnl Allow user to enable a normally-off option. 882217309SnwhitehornAC_DEFUN([CF_ARG_ENABLE], 883217309Snwhitehorn[CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl 884217309Snwhitehorndnl --------------------------------------------------------------------------- 885217309Snwhitehorndnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03 886217309Snwhitehorndnl ----------------- 887217309Snwhitehorndnl Verbose form of AC_ARG_ENABLE: 888217309Snwhitehorndnl 889217309Snwhitehorndnl Parameters: 890217309Snwhitehorndnl $1 = message 891217309Snwhitehorndnl $2 = option name 892217309Snwhitehorndnl $3 = help-string 893217309Snwhitehorndnl $4 = action to perform if option is enabled 894217309Snwhitehorndnl $5 = action if perform if option is disabled 895217309Snwhitehorndnl $6 = default option value (either 'yes' or 'no') 896217309SnwhitehornAC_DEFUN([CF_ARG_MSG_ENABLE],[ 897217309SnwhitehornAC_MSG_CHECKING($1) 898217309SnwhitehornAC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6)) 899217309SnwhitehornAC_MSG_RESULT($enableval) 900217309Snwhitehornif test "$enableval" != no ; then 901217309Snwhitehornifelse($4,,[ :],$4) 902217309Snwhitehornelse 903217309Snwhitehornifelse($5,,[ :],$5) 904217309Snwhitehornfi 905217309Snwhitehorn])dnl 906217309Snwhitehorndnl --------------------------------------------------------------------------- 907220749Snwhitehorndnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 908217309Snwhitehorndnl ------------- 909217309Snwhitehorndnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus 910217309Snwhitehorndnl values. 911217309Snwhitehorndnl 912217309Snwhitehorndnl Parameters: 913217309Snwhitehorndnl $1 = option name 914217309Snwhitehorndnl $2 = help-string 915217309Snwhitehorndnl $3 = action to perform if option is not default 916217309Snwhitehorndnl $4 = action if perform if option is default 917217309Snwhitehorndnl $5 = default option value (either 'yes' or 'no') 918217309SnwhitehornAC_DEFUN([CF_ARG_OPTION], 919220749Snwhitehorn[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) 920217309Snwhitehorn if test "$enableval" != "$5" ; then 921220749Snwhitehornifelse([$3],,[ :]dnl 922220749Snwhitehorn,[ $3]) ifelse([$4],,,[ 923217309Snwhitehorn else 924217309Snwhitehorn $4]) 925220749Snwhitehorn fi],[enableval=$5 ifelse([$4],,,[ 926217309Snwhitehorn $4 927217309Snwhitehorn])dnl 928217309Snwhitehorn ])])dnl 929217309Snwhitehorndnl --------------------------------------------------------------------------- 930220749Snwhitehorndnl CF_BUNDLED_INTL version: 16 updated: 2010/10/23 15:55:05 931217309Snwhitehorndnl --------------- 932217309Snwhitehorndnl Top-level macro for configuring an application with a bundled copy of 933217309Snwhitehorndnl the intl and po directories for gettext. 934217309Snwhitehorndnl 935217309Snwhitehorndnl $1 specifies either Makefile or makefile, defaulting to the former. 936217309Snwhitehorndnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls 937217309Snwhitehorndnl 938217309Snwhitehorndnl Sets variables which can be used to substitute in makefiles: 939217309Snwhitehorndnl GT_YES - "#" comment unless building intl library, otherwise empty 940217309Snwhitehorndnl GT_NO - "#" comment if building intl library, otherwise empty 941217309Snwhitehorndnl INTLDIR_MAKE - to make ./intl directory 942217309Snwhitehorndnl MSG_DIR_MAKE - to make ./po directory 943217309Snwhitehorndnl SUB_MAKEFILE - list of makefiles in ./intl, ./po directories 944220749Snwhitehorndnl 945220749Snwhitehorndnl Defines: 946217309Snwhitehorndnl HAVE_LIBGETTEXT_H if we're using ./intl 947220749Snwhitehorndnl NLS_TEXTDOMAIN 948217309Snwhitehorndnl 949217309Snwhitehorndnl Environment: 950217309Snwhitehorndnl ALL_LINGUAS if set, lists the root names of the ".po" files. 951217309Snwhitehorndnl CONFIG_H assumed to be "config.h" 952220749Snwhitehorndnl PACKAGE must be set, used as default for textdomain 953217309Snwhitehorndnl VERSION may be set, otherwise extract from "VERSION" file. 954217309Snwhitehorndnl 955217309SnwhitehornAC_DEFUN([CF_BUNDLED_INTL],[ 956217309Snwhitehorncf_makefile=ifelse($1,,Makefile,$1) 957217309Snwhitehorn 958217309Snwhitehorndnl Set of available languages (based on source distribution). Note that 959217309Snwhitehorndnl setting $LINGUAS overrides $ALL_LINGUAS. Some environments set $LINGUAS 960217309Snwhitehorndnl rather than $LC_ALL 961217309Snwhitehorntest -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'` 962217309Snwhitehorn 963217309Snwhitehorn# Allow override of "config.h" definition: 964220749Snwhitehorn: ${CONFIG_H:=config.h} 965217309SnwhitehornAC_SUBST(CONFIG_H) 966217309Snwhitehorn 967220749Snwhitehornif test -z "$PACKAGE" ; then 968220749Snwhitehorn AC_MSG_ERROR([[CF_BUNDLED_INTL] used without setting [PACKAGE] variable]) 969220749Snwhitehornfi 970220749Snwhitehorn 971217309Snwhitehornif test -z "$VERSION" ; then 972217309Snwhitehornif test -f $srcdir/VERSION ; then 973217309Snwhitehorn VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1` 974217309Snwhitehornelse 975217309Snwhitehorn VERSION=unknown 976217309Snwhitehornfi 977217309Snwhitehornfi 978217309SnwhitehornAC_SUBST(VERSION) 979217309Snwhitehorn 980217309SnwhitehornAM_GNU_GETTEXT(,,,[$2]) 981217309Snwhitehorn 982220749Snwhitehornif test "$USE_NLS" = yes ; then 983220749Snwhitehorn AC_ARG_WITH(textdomain, 984220749Snwhitehorn [ --with-textdomain=PKG NLS text-domain (default is package name)], 985220749Snwhitehorn [NLS_TEXTDOMAIN=$withval], 986220749Snwhitehorn [NLS_TEXTDOMAIN=$PACKAGE]) 987220749Snwhitehorn AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN") 988220749Snwhitehorn AC_SUBST(NLS_TEXTDOMAIN) 989220749Snwhitehornfi 990220749Snwhitehorn 991217309SnwhitehornINTLDIR_MAKE= 992217309SnwhitehornMSG_DIR_MAKE= 993217309SnwhitehornSUB_MAKEFILE= 994217309Snwhitehorn 995217309Snwhitehorndnl this updates SUB_MAKEFILE and MSG_DIR_MAKE: 996217309SnwhitehornCF_OUR_MESSAGES($1) 997217309Snwhitehorn 998217309Snwhitehornif test "$USE_INCLUDED_LIBINTL" = yes ; then 999217309Snwhitehorn if test "$nls_cv_force_use_gnu_gettext" = yes ; then 1000217309Snwhitehorn : 1001217309Snwhitehorn elif test "$nls_cv_use_gnu_gettext" = yes ; then 1002217309Snwhitehorn : 1003217309Snwhitehorn else 1004217309Snwhitehorn INTLDIR_MAKE="#" 1005217309Snwhitehorn fi 1006217309Snwhitehorn if test -z "$INTLDIR_MAKE"; then 1007217309Snwhitehorn AC_DEFINE(HAVE_LIBGETTEXT_H) 1008217309Snwhitehorn for cf_makefile in \ 1009217309Snwhitehorn $srcdir/intl/Makefile.in \ 1010217309Snwhitehorn $srcdir/intl/makefile.in 1011217309Snwhitehorn do 1012217309Snwhitehorn if test -f "$cf_makefile" ; then 1013217309Snwhitehorn SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}" 1014217309Snwhitehorn break 1015217309Snwhitehorn fi 1016217309Snwhitehorn done 1017217309Snwhitehorn fi 1018217309Snwhitehornelse 1019217309Snwhitehorn INTLDIR_MAKE="#" 1020217309Snwhitehorn if test "$USE_NLS" = yes ; then 1021217309Snwhitehorn AC_CHECK_HEADERS(libintl.h) 1022217309Snwhitehorn fi 1023217309Snwhitehornfi 1024217309Snwhitehorn 1025217309Snwhitehornif test -z "$INTLDIR_MAKE" ; then 1026217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I../intl" 1027217309Snwhitehornfi 1028217309Snwhitehorn 1029217309Snwhitehorndnl FIXME: we use this in lynx (the alternative is a spurious dependency upon 1030217309Snwhitehorndnl GNU make) 1031217309Snwhitehornif test "$BUILD_INCLUDED_LIBINTL" = yes ; then 1032217309Snwhitehorn GT_YES="#" 1033217309Snwhitehorn GT_NO= 1034217309Snwhitehornelse 1035217309Snwhitehorn GT_YES= 1036217309Snwhitehorn GT_NO="#" 1037217309Snwhitehornfi 1038217309Snwhitehorn 1039217309SnwhitehornAC_SUBST(INTLDIR_MAKE) 1040217309SnwhitehornAC_SUBST(MSG_DIR_MAKE) 1041217309SnwhitehornAC_SUBST(GT_YES) 1042217309SnwhitehornAC_SUBST(GT_NO) 1043217309Snwhitehorn 1044217309Snwhitehorndnl FIXME: the underlying AM_GNU_GETTEXT macro either needs some fixes or a 1045217309Snwhitehorndnl little documentation. It doesn't define anything so that we can ifdef our 1046217309Snwhitehorndnl own code, except ENABLE_NLS, which is too vague to be of any use. 1047217309Snwhitehorn 1048217309Snwhitehornif test "$USE_INCLUDED_LIBINTL" = yes ; then 1049217309Snwhitehorn if test "$nls_cv_force_use_gnu_gettext" = yes ; then 1050217309Snwhitehorn AC_DEFINE(HAVE_GETTEXT) 1051217309Snwhitehorn elif test "$nls_cv_use_gnu_gettext" = yes ; then 1052217309Snwhitehorn AC_DEFINE(HAVE_GETTEXT) 1053217309Snwhitehorn fi 1054217309Snwhitehorn if test -n "$nls_cv_header_intl" ; then 1055217309Snwhitehorn AC_DEFINE(HAVE_LIBINTL_H) 1056217309Snwhitehorn fi 1057217309Snwhitehornfi 1058217309Snwhitehorn])dnl 1059217309Snwhitehorndnl --------------------------------------------------------------------------- 1060217309Snwhitehorndnl CF_CHECK_CACHE version: 11 updated: 2008/03/23 14:45:59 1061217309Snwhitehorndnl -------------- 1062217309Snwhitehorndnl Check if we're accidentally using a cache from a different machine. 1063217309Snwhitehorndnl Derive the system name, as a check for reusing the autoconf cache. 1064217309Snwhitehorndnl 1065217309Snwhitehorndnl If we've packaged config.guess and config.sub, run that (since it does a 1066217309Snwhitehorndnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow 1067217309Snwhitehorndnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM 1068217309Snwhitehorndnl which is useful in cross-compiles. 1069217309Snwhitehorndnl 1070217309Snwhitehorndnl Note: we would use $ac_config_sub, but that is one of the places where 1071217309Snwhitehorndnl autoconf 2.5x broke compatibility with autoconf 2.13 1072217309SnwhitehornAC_DEFUN([CF_CHECK_CACHE], 1073217309Snwhitehorn[ 1074217309Snwhitehornif test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then 1075217309Snwhitehorn ifelse([$1],,[AC_CANONICAL_HOST],[$1]) 1076217309Snwhitehorn system_name="$host_os" 1077217309Snwhitehornelse 1078217309Snwhitehorn system_name="`(uname -s -r) 2>/dev/null`" 1079217309Snwhitehorn if test -z "$system_name" ; then 1080217309Snwhitehorn system_name="`(hostname) 2>/dev/null`" 1081217309Snwhitehorn fi 1082217309Snwhitehornfi 1083217309Snwhitehorntest -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name") 1084217309SnwhitehornAC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) 1085217309Snwhitehorn 1086217309Snwhitehorntest -z "$system_name" && system_name="$cf_cv_system_name" 1087217309Snwhitehorntest -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) 1088217309Snwhitehorn 1089217309Snwhitehornif test ".$system_name" != ".$cf_cv_system_name" ; then 1090217309Snwhitehorn AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) 1091217309Snwhitehorn AC_MSG_ERROR("Please remove config.cache and try again.") 1092217309Snwhitehornfi 1093217309Snwhitehorn])dnl 1094217309Snwhitehorndnl --------------------------------------------------------------------------- 1095220749Snwhitehorndnl CF_CURSES_CHTYPE version: 7 updated: 2010/10/23 15:54:49 1096217309Snwhitehorndnl ---------------- 1097217309Snwhitehorndnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses). 1098217309SnwhitehornAC_DEFUN([CF_CURSES_CHTYPE], 1099217309Snwhitehorn[ 1100217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 1101217309SnwhitehornAC_CACHE_CHECK(for chtype typedef,cf_cv_chtype_decl,[ 1102220749Snwhitehorn AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>], 1103217309Snwhitehorn [chtype foo], 1104217309Snwhitehorn [cf_cv_chtype_decl=yes], 1105217309Snwhitehorn [cf_cv_chtype_decl=no])]) 1106217309Snwhitehornif test $cf_cv_chtype_decl = yes ; then 1107217309Snwhitehorn AC_DEFINE(HAVE_TYPE_CHTYPE) 1108217309Snwhitehorn AC_CACHE_CHECK(if chtype is scalar or struct,cf_cv_chtype_type,[ 1109220749Snwhitehorn AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>], 1110217309Snwhitehorn [chtype foo; long x = foo], 1111217309Snwhitehorn [cf_cv_chtype_type=scalar], 1112217309Snwhitehorn [cf_cv_chtype_type=struct])]) 1113217309Snwhitehorn if test $cf_cv_chtype_type = scalar ; then 1114217309Snwhitehorn AC_DEFINE(TYPE_CHTYPE_IS_SCALAR) 1115217309Snwhitehorn fi 1116217309Snwhitehornfi 1117217309Snwhitehorn])dnl 1118217309Snwhitehorndnl --------------------------------------------------------------------------- 1119217309Snwhitehorndnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 1120217309Snwhitehorndnl ---------------- 1121217309Snwhitehorndnl Tie together the configure-script macros for curses. It may be ncurses, 1122217309Snwhitehorndnl but unless asked, we do not make a special search for ncurses. However, 1123217309Snwhitehorndnl still check for the ncurses version number, for use in other macros. 1124217309SnwhitehornAC_DEFUN([CF_CURSES_CONFIG], 1125217309Snwhitehorn[ 1126217309SnwhitehornCF_CURSES_CPPFLAGS 1127217309SnwhitehornCF_NCURSES_VERSION 1128217309SnwhitehornCF_CURSES_LIBS 1129217309Snwhitehorn])dnl 1130217309Snwhitehorndnl --------------------------------------------------------------------------- 1131217309Snwhitehorndnl CF_CURSES_CPPFLAGS version: 10 updated: 2009/01/06 19:34:11 1132217309Snwhitehorndnl ------------------ 1133217309Snwhitehorndnl Look for the curses headers. 1134217309SnwhitehornAC_DEFUN([CF_CURSES_CPPFLAGS],[ 1135217309Snwhitehorn 1136217309SnwhitehornAC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[ 1137217309Snwhitehorncf_cv_curses_incdir=no 1138217309Snwhitehorncase $host_os in #(vi 1139217309Snwhitehornhpux10.*) #(vi 1140217309Snwhitehorn test -d /usr/include/curses_colr && \ 1141217309Snwhitehorn cf_cv_curses_incdir="-I/usr/include/curses_colr" 1142217309Snwhitehorn ;; 1143217309Snwhitehornsunos3*|sunos4*) 1144217309Snwhitehorn test -d /usr/5lib && \ 1145217309Snwhitehorn test -d /usr/5include && \ 1146217309Snwhitehorn cf_cv_curses_incdir="-I/usr/5include" 1147217309Snwhitehorn ;; 1148217309Snwhitehornesac 1149217309Snwhitehorn]) 1150217309Snwhitehorntest "$cf_cv_curses_incdir" != no && CPPFLAGS="$CPPFLAGS $cf_cv_curses_incdir" 1151217309Snwhitehorn 1152217309SnwhitehornCF_CURSES_HEADER 1153217309SnwhitehornCF_TERM_HEADER 1154217309Snwhitehorn])dnl 1155217309Snwhitehorndnl --------------------------------------------------------------------------- 1156220749Snwhitehorndnl CF_CURSES_FUNCS version: 15 updated: 2010/10/23 15:52:32 1157217309Snwhitehorndnl --------------- 1158217309Snwhitehorndnl Curses-functions are a little complicated, since a lot of them are macros. 1159217309SnwhitehornAC_DEFUN([CF_CURSES_FUNCS], 1160217309Snwhitehorn[ 1161217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 1162217309SnwhitehornAC_REQUIRE([CF_XOPEN_CURSES]) 1163217309SnwhitehornAC_REQUIRE([CF_CURSES_TERM_H]) 1164217309Snwhitehornfor cf_func in $1 1165217309Snwhitehorndo 1166217309Snwhitehorn CF_UPPER(cf_tr_func,$cf_func) 1167217309Snwhitehorn AC_MSG_CHECKING(for ${cf_func}) 1168217309Snwhitehorn CF_MSG_LOG(${cf_func}) 1169217309Snwhitehorn AC_CACHE_VAL(cf_cv_func_$cf_func,[ 1170217309Snwhitehorn eval cf_result='$ac_cv_func_'$cf_func 1171217309Snwhitehorn if test ".$cf_result" != ".no"; then 1172217309Snwhitehorn AC_TRY_LINK(CF__CURSES_HEAD, 1173217309Snwhitehorn [ 1174217309Snwhitehorn#ifndef ${cf_func} 1175217309Snwhitehornlong foo = (long)(&${cf_func}); 1176220749Snwhitehorn${cf_cv_main_return:-return}(foo == 0); 1177217309Snwhitehorn#endif 1178217309Snwhitehorn ], 1179217309Snwhitehorn [cf_result=yes], 1180217309Snwhitehorn [cf_result=no]) 1181217309Snwhitehorn fi 1182217309Snwhitehorn eval 'cf_cv_func_'$cf_func'=$cf_result' 1183217309Snwhitehorn ]) 1184217309Snwhitehorn # use the computed/retrieved cache-value: 1185217309Snwhitehorn eval 'cf_result=$cf_cv_func_'$cf_func 1186217309Snwhitehorn AC_MSG_RESULT($cf_result) 1187217309Snwhitehorn if test $cf_result != no; then 1188217309Snwhitehorn AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func}) 1189217309Snwhitehorn fi 1190217309Snwhitehorndone 1191217309Snwhitehorn])dnl 1192217309Snwhitehorndnl --------------------------------------------------------------------------- 1193217309Snwhitehorndnl CF_CURSES_HEADER version: 2 updated: 2010/04/28 06:02:16 1194217309Snwhitehorndnl ---------------- 1195217309Snwhitehorndnl Find a "curses" header file, e.g,. "curses.h", or one of the more common 1196217309Snwhitehorndnl variations of ncurses' installs. 1197217309Snwhitehorndnl 1198217309Snwhitehorndnl $1 = ncurses when looking for ncurses, or is empty 1199217309SnwhitehornAC_DEFUN([CF_CURSES_HEADER],[ 1200217309SnwhitehornAC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ 1201217309Snwhitehorncf_cv_ncurses_header=none 1202217309Snwhitehornfor cf_header in ifelse($1,,,[ \ 1203217309Snwhitehorn $1/curses.h \ 1204217309Snwhitehorn $1/ncurses.h]) \ 1205217309Snwhitehorn curses.h \ 1206217309Snwhitehorn ncurses.h ifelse($1,,[ncurses/curses.h ncurses/ncurses.h]) 1207217309Snwhitehorndo 1208217309SnwhitehornAC_TRY_COMPILE([#include <${cf_header}>], 1209217309Snwhitehorn [initscr(); tgoto("?", 0,0)], 1210217309Snwhitehorn [cf_cv_ncurses_header=$cf_header; break],[]) 1211217309Snwhitehorndone 1212217309Snwhitehorn]) 1213217309Snwhitehorn 1214217309Snwhitehornif test "$cf_cv_ncurses_header" = none ; then 1215217309Snwhitehorn AC_MSG_ERROR(No curses header-files found) 1216217309Snwhitehornfi 1217217309Snwhitehorn 1218217309Snwhitehorn# cheat, to get the right #define's for HAVE_NCURSES_H, etc. 1219217309SnwhitehornAC_CHECK_HEADERS($cf_cv_ncurses_header) 1220217309Snwhitehorn])dnl 1221217309Snwhitehorndnl --------------------------------------------------------------------------- 1222220749Snwhitehorndnl CF_CURSES_LIBS version: 32 updated: 2011/01/16 17:43:15 1223217309Snwhitehorndnl -------------- 1224217309Snwhitehorndnl Look for the curses libraries. Older curses implementations may require 1225217309Snwhitehorndnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. 1226217309SnwhitehornAC_DEFUN([CF_CURSES_LIBS],[ 1227217309Snwhitehorn 1228217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 1229217309SnwhitehornAC_MSG_CHECKING(if we have identified curses libraries) 1230220749SnwhitehornAC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], 1231217309Snwhitehorn [initscr(); tgoto("?", 0,0)], 1232217309Snwhitehorn cf_result=yes, 1233217309Snwhitehorn cf_result=no) 1234217309SnwhitehornAC_MSG_RESULT($cf_result) 1235217309Snwhitehorn 1236217309Snwhitehornif test "$cf_result" = no ; then 1237217309Snwhitehorncase $host_os in #(vi 1238217309Snwhitehornfreebsd*) #(vi 1239220749Snwhitehorn AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)]) 1240217309Snwhitehorn ;; 1241217309Snwhitehornhpux10.*) #(vi 1242217309Snwhitehorn AC_CHECK_LIB(cur_colr,initscr,[ 1243220749Snwhitehorn CF_ADD_LIBS(-lcur_colr) 1244217309Snwhitehorn ac_cv_func_initscr=yes 1245217309Snwhitehorn ],[ 1246217309Snwhitehorn AC_CHECK_LIB(Hcurses,initscr,[ 1247217309Snwhitehorn # HP's header uses __HP_CURSES, but user claims _HP_CURSES. 1248220749Snwhitehorn CF_ADD_LIBS(-lHcurses) 1249217309Snwhitehorn CPPFLAGS="$CPPFLAGS -D__HP_CURSES -D_HP_CURSES" 1250217309Snwhitehorn ac_cv_func_initscr=yes 1251217309Snwhitehorn ])]) 1252217309Snwhitehorn ;; 1253220749Snwhitehornlinux*) 1254220749Snwhitehorn case `arch` in 1255220749Snwhitehorn x86_64) 1256220749Snwhitehorn if test -d /lib64 1257220749Snwhitehorn then 1258220749Snwhitehorn CF_ADD_LIBDIR(/lib64) 1259220749Snwhitehorn else 1260220749Snwhitehorn CF_ADD_LIBDIR(/lib) 1261220749Snwhitehorn fi 1262220749Snwhitehorn ;; 1263220749Snwhitehorn *) 1264220749Snwhitehorn CF_ADD_LIBDIR(/lib) 1265220749Snwhitehorn ;; 1266220749Snwhitehorn esac 1267217309Snwhitehorn ;; 1268217309Snwhitehornsunos3*|sunos4*) 1269217309Snwhitehorn if test -d /usr/5lib ; then 1270217309Snwhitehorn CF_ADD_LIBDIR(/usr/5lib) 1271220749Snwhitehorn CF_ADD_LIBS(-lcurses -ltermcap) 1272217309Snwhitehorn fi 1273217309Snwhitehorn ac_cv_func_initscr=yes 1274217309Snwhitehorn ;; 1275217309Snwhitehornesac 1276217309Snwhitehorn 1277217309Snwhitehornif test ".$ac_cv_func_initscr" != .yes ; then 1278217309Snwhitehorn cf_save_LIBS="$LIBS" 1279217309Snwhitehorn cf_term_lib="" 1280217309Snwhitehorn cf_curs_lib="" 1281217309Snwhitehorn 1282220749Snwhitehorn if test ".${cf_cv_ncurses_version:-no}" != .no 1283217309Snwhitehorn then 1284217309Snwhitehorn cf_check_list="ncurses curses cursesX" 1285217309Snwhitehorn else 1286217309Snwhitehorn cf_check_list="cursesX curses ncurses" 1287217309Snwhitehorn fi 1288217309Snwhitehorn 1289217309Snwhitehorn # Check for library containing tgoto. Do this before curses library 1290217309Snwhitehorn # because it may be needed to link the test-case for initscr. 1291217309Snwhitehorn AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ 1292217309Snwhitehorn for cf_term_lib in $cf_check_list termcap termlib unknown 1293217309Snwhitehorn do 1294217309Snwhitehorn AC_CHECK_LIB($cf_term_lib,tgoto,[break]) 1295217309Snwhitehorn done 1296217309Snwhitehorn ]) 1297217309Snwhitehorn 1298217309Snwhitehorn # Check for library containing initscr 1299217309Snwhitehorn test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" 1300217309Snwhitehorn for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown 1301217309Snwhitehorn do 1302217309Snwhitehorn AC_CHECK_LIB($cf_curs_lib,initscr,[break]) 1303217309Snwhitehorn done 1304217309Snwhitehorn test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found) 1305217309Snwhitehorn 1306217309Snwhitehorn LIBS="-l$cf_curs_lib $cf_save_LIBS" 1307217309Snwhitehorn if test "$cf_term_lib" = unknown ; then 1308217309Snwhitehorn AC_MSG_CHECKING(if we can link with $cf_curs_lib library) 1309220749Snwhitehorn AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], 1310217309Snwhitehorn [initscr()], 1311217309Snwhitehorn [cf_result=yes], 1312217309Snwhitehorn [cf_result=no]) 1313217309Snwhitehorn AC_MSG_RESULT($cf_result) 1314217309Snwhitehorn test $cf_result = no && AC_MSG_ERROR(Cannot link curses library) 1315217309Snwhitehorn elif test "$cf_curs_lib" = "$cf_term_lib" ; then 1316217309Snwhitehorn : 1317217309Snwhitehorn elif test "$cf_term_lib" != predefined ; then 1318217309Snwhitehorn AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) 1319220749Snwhitehorn AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], 1320217309Snwhitehorn [initscr(); tgoto((char *)0, 0, 0);], 1321217309Snwhitehorn [cf_result=no], 1322217309Snwhitehorn [ 1323217309Snwhitehorn LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" 1324220749Snwhitehorn AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], 1325217309Snwhitehorn [initscr()], 1326217309Snwhitehorn [cf_result=yes], 1327217309Snwhitehorn [cf_result=error]) 1328217309Snwhitehorn ]) 1329217309Snwhitehorn AC_MSG_RESULT($cf_result) 1330217309Snwhitehorn fi 1331217309Snwhitehornfi 1332217309Snwhitehornfi 1333217309Snwhitehorn 1334217309Snwhitehorn])dnl 1335217309Snwhitehorndnl --------------------------------------------------------------------------- 1336220749Snwhitehorndnl CF_CURSES_TERM_H version: 8 updated: 2010/10/23 15:54:49 1337217309Snwhitehorndnl ---------------- 1338217309Snwhitehorndnl SVr4 curses should have term.h as well (where it puts the definitions of 1339217309Snwhitehorndnl the low-level interface). This may not be true in old/broken implementations, 1340217309Snwhitehorndnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 1341217309Snwhitehorndnl running with Solaris 2.5.1). 1342217309SnwhitehornAC_DEFUN([CF_CURSES_TERM_H], 1343217309Snwhitehorn[ 1344217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 1345217309Snwhitehorn 1346217309SnwhitehornAC_CACHE_CHECK(for term.h, cf_cv_term_header,[ 1347217309Snwhitehorn 1348217309Snwhitehorn# If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look 1349217309Snwhitehorn# for <term.h> if we do not find the variant. 1350217309Snwhitehornfor cf_header in \ 1351220749Snwhitehorn `echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%/.*%/%'`term.h \ 1352217309Snwhitehorn term.h 1353217309Snwhitehorndo 1354217309Snwhitehorn AC_TRY_COMPILE([ 1355220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 1356217309Snwhitehorn#include <${cf_header}>], 1357217309Snwhitehorn [WINDOW *x], 1358217309Snwhitehorn [cf_cv_term_header=$cf_header 1359217309Snwhitehorn break], 1360217309Snwhitehorn [cf_cv_term_header=no]) 1361217309Snwhitehorndone 1362217309Snwhitehorn 1363217309Snwhitehorncase $cf_cv_term_header in #(vi 1364217309Snwhitehornno) 1365217309Snwhitehorn # If curses is ncurses, some packagers still mess it up by trying to make 1366217309Snwhitehorn # us use GNU termcap. This handles the most common case. 1367217309Snwhitehorn for cf_header in ncurses/term.h ncursesw/term.h 1368217309Snwhitehorn do 1369217309Snwhitehorn AC_TRY_COMPILE([ 1370220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 1371217309Snwhitehorn#ifdef NCURSES_VERSION 1372217309Snwhitehorn#include <${cf_header}> 1373217309Snwhitehorn#else 1374217309Snwhitehornmake an error 1375217309Snwhitehorn#endif], 1376217309Snwhitehorn [WINDOW *x], 1377217309Snwhitehorn [cf_cv_term_header=$cf_header 1378217309Snwhitehorn break], 1379217309Snwhitehorn [cf_cv_term_header=no]) 1380217309Snwhitehorn done 1381217309Snwhitehorn ;; 1382217309Snwhitehornesac 1383217309Snwhitehorn]) 1384217309Snwhitehorn 1385217309Snwhitehorncase $cf_cv_term_header in #(vi 1386217309Snwhitehornterm.h) #(vi 1387217309Snwhitehorn AC_DEFINE(HAVE_TERM_H) 1388217309Snwhitehorn ;; 1389217309Snwhitehornncurses/term.h) #(vi 1390217309Snwhitehorn AC_DEFINE(HAVE_NCURSES_TERM_H) 1391217309Snwhitehorn ;; 1392217309Snwhitehornncursesw/term.h) 1393217309Snwhitehorn AC_DEFINE(HAVE_NCURSESW_TERM_H) 1394217309Snwhitehorn ;; 1395217309Snwhitehornesac 1396217309Snwhitehorn])dnl 1397217309Snwhitehorndnl --------------------------------------------------------------------------- 1398220749Snwhitehorndnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59 1399220749Snwhitehorndnl ------------------ 1400220749Snwhitehorndnl Check for likely values of wacs_map[]. 1401220749SnwhitehornAC_DEFUN([CF_CURSES_WACS_MAP], 1402220749Snwhitehorn[ 1403220749SnwhitehornAC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[ 1404220749Snwhitehorn cf_cv_curses_wacs_map=unknown 1405220749Snwhitehorn for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char 1406220749Snwhitehorn do 1407220749Snwhitehorn AC_TRY_LINK([ 1408220749Snwhitehorn#ifndef _XOPEN_SOURCE_EXTENDED 1409220749Snwhitehorn#define _XOPEN_SOURCE_EXTENDED 1410220749Snwhitehorn#endif 1411220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}>], 1412220749Snwhitehorn [void *foo = &($name['k'])], 1413220749Snwhitehorn [cf_cv_curses_wacs_map=$name 1414220749Snwhitehorn break]) 1415220749Snwhitehorn done]) 1416220749Snwhitehorn 1417220749Snwhitehorntest "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map) 1418220749Snwhitehorn])dnl 1419220749Snwhitehorndnl --------------------------------------------------------------------------- 1420220749Snwhitehorndnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59 1421220749Snwhitehorndnl ---------------------- 1422220749Snwhitehorndnl Do a check to see if the WACS_xxx constants are defined compatibly with 1423220749Snwhitehorndnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx 1424220749Snwhitehorndnl constants is broken since those constants do not point to cchar_t's. 1425220749SnwhitehornAC_DEFUN([CF_CURSES_WACS_SYMBOLS], 1426220749Snwhitehorn[ 1427220749SnwhitehornAC_REQUIRE([CF_CURSES_WACS_MAP]) 1428220749Snwhitehorn 1429220749SnwhitehornAC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[ 1430220749Snwhitehorncf_cv_curses_wacs_symbols=no 1431220749Snwhitehornif test "$cf_cv_curses_wacs_map" != unknown 1432220749Snwhitehornthen 1433220749Snwhitehorn AC_TRY_LINK([ 1434220749Snwhitehorn#ifndef _XOPEN_SOURCE_EXTENDED 1435220749Snwhitehorn#define _XOPEN_SOURCE_EXTENDED 1436220749Snwhitehorn#endif 1437220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}>], 1438220749Snwhitehorn [cchar_t *foo = WACS_PLUS; 1439220749Snwhitehorn $cf_cv_curses_wacs_map['k'] = *WACS_PLUS], 1440220749Snwhitehorn [cf_cv_curses_wacs_symbols=yes]) 1441220749Snwhitehornelse 1442220749Snwhitehorn AC_TRY_LINK([ 1443220749Snwhitehorn#ifndef _XOPEN_SOURCE_EXTENDED 1444220749Snwhitehorn#define _XOPEN_SOURCE_EXTENDED 1445220749Snwhitehorn#endif 1446220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}>], 1447220749Snwhitehorn [cchar_t *foo = WACS_PLUS], 1448220749Snwhitehorn [cf_cv_curses_wacs_symbols=yes]) 1449220749Snwhitehornfi 1450220749Snwhitehorn]) 1451220749Snwhitehorn 1452220749Snwhitehorntest "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS) 1453220749Snwhitehorn])dnl 1454220749Snwhitehorndnl --------------------------------------------------------------------------- 1455217309Snwhitehorndnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52 1456217309Snwhitehorndnl ---------- 1457217309Snwhitehorndnl "dirname" is not portable, so we fake it with a shell script. 1458217309SnwhitehornAC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl 1459217309Snwhitehorndnl --------------------------------------------------------------------------- 1460217309Snwhitehorndnl CF_DISABLE_ECHO version: 11 updated: 2009/12/13 13:16:57 1461217309Snwhitehorndnl --------------- 1462217309Snwhitehorndnl You can always use "make -n" to see the actual options, but it's hard to 1463217309Snwhitehorndnl pick out/analyze warning messages when the compile-line is long. 1464217309Snwhitehorndnl 1465217309Snwhitehorndnl Sets: 1466217309Snwhitehorndnl ECHO_LT - symbol to control if libtool is verbose 1467217309Snwhitehorndnl ECHO_LD - symbol to prefix "cc -o" lines 1468217309Snwhitehorndnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) 1469217309Snwhitehorndnl SHOW_CC - symbol to put before explicit "cc -c" lines 1470217309Snwhitehorndnl ECHO_CC - symbol to put before any "cc" line 1471217309Snwhitehorndnl 1472217309SnwhitehornAC_DEFUN([CF_DISABLE_ECHO],[ 1473217309SnwhitehornAC_MSG_CHECKING(if you want to see long compiling messages) 1474217309SnwhitehornCF_ARG_DISABLE(echo, 1475217309Snwhitehorn [ --disable-echo display "compiling" commands], 1476217309Snwhitehorn [ 1477217309Snwhitehorn ECHO_LT='--silent' 1478217309Snwhitehorn ECHO_LD='@echo linking [$]@;' 1479217309Snwhitehorn RULE_CC='@echo compiling [$]<' 1480217309Snwhitehorn SHOW_CC='@echo compiling [$]@' 1481217309Snwhitehorn ECHO_CC='@' 1482217309Snwhitehorn],[ 1483217309Snwhitehorn ECHO_LT='' 1484217309Snwhitehorn ECHO_LD='' 1485217309Snwhitehorn RULE_CC='' 1486217309Snwhitehorn SHOW_CC='' 1487217309Snwhitehorn ECHO_CC='' 1488217309Snwhitehorn]) 1489217309SnwhitehornAC_MSG_RESULT($enableval) 1490217309SnwhitehornAC_SUBST(ECHO_LT) 1491217309SnwhitehornAC_SUBST(ECHO_LD) 1492217309SnwhitehornAC_SUBST(RULE_CC) 1493217309SnwhitehornAC_SUBST(SHOW_CC) 1494217309SnwhitehornAC_SUBST(ECHO_CC) 1495217309Snwhitehorn])dnl 1496217309Snwhitehorndnl --------------------------------------------------------------------------- 1497220749Snwhitehorndnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59 1498220749Snwhitehorndnl -------------------------- 1499220749Snwhitehorndnl Check if we should use the libtool 1.5 feature "-version-number" instead of 1500220749Snwhitehorndnl the older "-version-info" feature. The newer feature allows us to use 1501220749Snwhitehorndnl version numbering on shared libraries which make them compatible with 1502220749Snwhitehorndnl various systems. 1503220749SnwhitehornAC_DEFUN([CF_DISABLE_LIBTOOL_VERSION], 1504220749Snwhitehorn[ 1505220749SnwhitehornAC_MSG_CHECKING(if libtool -version-number should be used) 1506220749SnwhitehornCF_ARG_DISABLE(libtool-version, 1507220749Snwhitehorn [ --disable-libtool-version enable to use libtool's incompatible naming scheme], 1508220749Snwhitehorn [cf_libtool_version=no], 1509220749Snwhitehorn [cf_libtool_version=yes]) 1510220749SnwhitehornAC_MSG_RESULT($cf_libtool_version) 1511220749Snwhitehorn 1512220749Snwhitehornif test "$cf_libtool_version" = yes ; then 1513220749Snwhitehorn LIBTOOL_VERSION="-version-number" 1514220749Snwhitehornelse 1515220749Snwhitehorn LIBTOOL_VERSION="-version-info" 1516220749Snwhitehornfi 1517220749Snwhitehorn 1518220749SnwhitehornAC_SUBST(LIBTOOL_VERSION) 1519220749Snwhitehorn])dnl 1520220749Snwhitehorndnl --------------------------------------------------------------------------- 1521217309Snwhitehorndnl CF_DISABLE_RPATH_HACK version: 1 updated: 2010/04/11 10:54:00 1522217309Snwhitehorndnl --------------------- 1523217309Snwhitehorndnl The rpath-hack makes it simpler to build programs, particularly with the 1524217309Snwhitehorndnl *BSD ports which may have essential libraries in unusual places. But it 1525217309Snwhitehorndnl can interfere with building an executable for the base system. Use this 1526217309Snwhitehorndnl option in that case. 1527217309SnwhitehornAC_DEFUN([CF_DISABLE_RPATH_HACK], 1528217309Snwhitehorn[ 1529217309SnwhitehornAC_MSG_CHECKING(if rpath should be not be set) 1530217309SnwhitehornCF_ARG_DISABLE(rpath-hack, 1531217309Snwhitehorn [ --disable-rpath-hack don't add rpath options for additional libraries], 1532217309Snwhitehorn [cf_disable_rpath_hack=yes], 1533217309Snwhitehorn [cf_disable_rpath_hack=no]) 1534217309SnwhitehornAC_MSG_RESULT($cf_disable_rpath_hack) 1535217309Snwhitehornif test "$cf_disable_rpath_hack" = no ; then 1536217309Snwhitehorn CF_RPATH_HACK 1537217309Snwhitehornfi 1538217309Snwhitehorn]) 1539217309Snwhitehorndnl --------------------------------------------------------------------------- 1540217309Snwhitehorndnl CF_FIND_HEADER version: 2 updated: 2007/07/29 11:32:00 1541217309Snwhitehorndnl -------------- 1542217309Snwhitehorndnl Find a header file, searching for it if it is not already in the include 1543217309Snwhitehorndnl path. 1544217309Snwhitehorndnl 1545217309Snwhitehorndnl $1 = the header filename 1546217309Snwhitehorndnl $2 = the package name 1547217309Snwhitehorndnl $3 = action to perform if successful 1548217309Snwhitehorndnl $4 = action to perform if not successful 1549217309SnwhitehornAC_DEFUN([CF_FIND_HEADER],[ 1550217309SnwhitehornAC_CHECK_HEADER([$1], 1551217309Snwhitehorn cf_find_header=yes,[ 1552217309Snwhitehorn cf_find_header=no 1553217309SnwhitehornCF_HEADER_PATH(cf_search,$2) 1554217309Snwhitehornfor cf_incdir in $cf_search 1555217309Snwhitehorndo 1556217309Snwhitehorn if test -f $cf_incdir/$1 ; then 1557217309Snwhitehorn CF_ADD_INCDIR($cf_incdir) 1558217309Snwhitehorn CF_VERBOSE(... found in $cf_incdir) 1559217309Snwhitehorn cf_find_header=yes 1560217309Snwhitehorn break 1561217309Snwhitehorn fi 1562217309Snwhitehorn CF_VERBOSE(... tested $cf_incdir) 1563217309Snwhitehorndone 1564217309Snwhitehorn]) 1565217309Snwhitehornif test "$cf_find_header" = yes ; then 1566217309Snwhitehornifelse([$3],,:,[$3]) 1567217309Snwhitehornifelse([$4],,,[else 1568217309Snwhitehorn$4]) 1569217309Snwhitehornfi 1570217309Snwhitehorn])dnl 1571217309Snwhitehorndnl --------------------------------------------------------------------------- 1572217309Snwhitehorndnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54 1573217309Snwhitehorndnl --------------- 1574217309Snwhitehorndnl Look for a non-standard library, given parameters for AC_TRY_LINK. We 1575217309Snwhitehorndnl prefer a standard location, and use -L options only if we do not find the 1576217309Snwhitehorndnl library in the standard library location(s). 1577217309Snwhitehorndnl $1 = library name 1578217309Snwhitehorndnl $2 = library class, usually the same as library name 1579217309Snwhitehorndnl $3 = includes 1580217309Snwhitehorndnl $4 = code fragment to compile/link 1581217309Snwhitehorndnl $5 = corresponding function-name 1582217309Snwhitehorndnl $6 = flag, nonnull if failure should not cause an error-exit 1583217309Snwhitehorndnl 1584217309Snwhitehorndnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had 1585217309Snwhitehorndnl to use a -L option. 1586217309SnwhitehornAC_DEFUN([CF_FIND_LIBRARY], 1587217309Snwhitehorn[ 1588217309Snwhitehorn eval 'cf_cv_have_lib_'$1'=no' 1589217309Snwhitehorn cf_libdir="" 1590217309Snwhitehorn AC_CHECK_FUNC($5, 1591217309Snwhitehorn eval 'cf_cv_have_lib_'$1'=yes',[ 1592217309Snwhitehorn cf_save_LIBS="$LIBS" 1593217309Snwhitehorn AC_MSG_CHECKING(for $5 in -l$1) 1594217309Snwhitehorn LIBS="-l$1 $LIBS" 1595217309Snwhitehorn AC_TRY_LINK([$3],[$4], 1596217309Snwhitehorn [AC_MSG_RESULT(yes) 1597217309Snwhitehorn eval 'cf_cv_have_lib_'$1'=yes' 1598217309Snwhitehorn ], 1599217309Snwhitehorn [AC_MSG_RESULT(no) 1600217309Snwhitehorn CF_LIBRARY_PATH(cf_search,$2) 1601217309Snwhitehorn for cf_libdir in $cf_search 1602217309Snwhitehorn do 1603217309Snwhitehorn AC_MSG_CHECKING(for -l$1 in $cf_libdir) 1604217309Snwhitehorn LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" 1605217309Snwhitehorn AC_TRY_LINK([$3],[$4], 1606217309Snwhitehorn [AC_MSG_RESULT(yes) 1607217309Snwhitehorn eval 'cf_cv_have_lib_'$1'=yes' 1608217309Snwhitehorn break], 1609217309Snwhitehorn [AC_MSG_RESULT(no) 1610217309Snwhitehorn LIBS="$cf_save_LIBS"]) 1611217309Snwhitehorn done 1612217309Snwhitehorn ]) 1613217309Snwhitehorn ]) 1614217309Snwhitehorneval 'cf_found_library=[$]cf_cv_have_lib_'$1 1615217309Snwhitehornifelse($6,,[ 1616217309Snwhitehornif test $cf_found_library = no ; then 1617217309Snwhitehorn AC_MSG_ERROR(Cannot link $1 library) 1618217309Snwhitehornfi 1619217309Snwhitehorn]) 1620217309Snwhitehorn])dnl 1621217309Snwhitehorndnl --------------------------------------------------------------------------- 1622220749Snwhitehorndnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 1623217309Snwhitehorndnl --------------- 1624217309Snwhitehorndnl Find a library (specifically the linkage used in the code fragment), 1625217309Snwhitehorndnl searching for it if it is not already in the library path. 1626217309Snwhitehorndnl See also CF_ADD_SEARCHPATH. 1627217309Snwhitehorndnl 1628217309Snwhitehorndnl Parameters (4-on are optional): 1629217309Snwhitehorndnl $1 = headers for library entrypoint 1630217309Snwhitehorndnl $2 = code fragment for library entrypoint 1631217309Snwhitehorndnl $3 = the library name without the "-l" option or ".so" suffix. 1632217309Snwhitehorndnl $4 = action to perform if successful (default: update CPPFLAGS, etc) 1633217309Snwhitehorndnl $5 = action to perform if not successful 1634217309Snwhitehorndnl $6 = module name, if not the same as the library name 1635217309Snwhitehorndnl $7 = extra libraries 1636217309Snwhitehorndnl 1637217309Snwhitehorndnl Sets these variables: 1638217309Snwhitehorndnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found 1639217309Snwhitehorndnl $cf_cv_header_path_$3 - include-directory if needed 1640217309Snwhitehorndnl $cf_cv_library_path_$3 - library-directory if needed 1641217309Snwhitehorndnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 1642217309SnwhitehornAC_DEFUN([CF_FIND_LINKAGE],[ 1643217309Snwhitehorn 1644217309Snwhitehorn# If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these 1645217309Snwhitehorn# will be set on completion of the AC_TRY_LINK below. 1646217309Snwhitehorncf_cv_header_path_$3= 1647217309Snwhitehorncf_cv_library_path_$3= 1648217309Snwhitehorn 1649217309SnwhitehornCF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) 1650217309Snwhitehorn 1651220749Snwhitehorncf_save_LIBS="$LIBS" 1652220749Snwhitehorn 1653217309SnwhitehornAC_TRY_LINK([$1],[$2],[ 1654217309Snwhitehorn cf_cv_find_linkage_$3=yes 1655220749Snwhitehorn cf_cv_header_path_$3=/usr/include 1656220749Snwhitehorn cf_cv_library_path_$3=/usr/lib 1657217309Snwhitehorn],[ 1658217309Snwhitehorn 1659217309SnwhitehornLIBS="-l$3 $7 $cf_save_LIBS" 1660217309Snwhitehorn 1661217309SnwhitehornAC_TRY_LINK([$1],[$2],[ 1662217309Snwhitehorn cf_cv_find_linkage_$3=yes 1663220749Snwhitehorn cf_cv_header_path_$3=/usr/include 1664220749Snwhitehorn cf_cv_library_path_$3=/usr/lib 1665217309Snwhitehorn cf_cv_library_file_$3="-l$3" 1666217309Snwhitehorn],[ 1667220749Snwhitehorn cf_cv_find_linkage_$3=no 1668217309Snwhitehorn LIBS="$cf_save_LIBS" 1669217309Snwhitehorn 1670217309Snwhitehorn CF_VERBOSE(find linkage for $3 library) 1671217309Snwhitehorn CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)]) 1672217309Snwhitehorn 1673217309Snwhitehorn cf_save_CPPFLAGS="$CPPFLAGS" 1674217309Snwhitehorn cf_test_CPPFLAGS="$CPPFLAGS" 1675217309Snwhitehorn 1676217309Snwhitehorn CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6])) 1677217309Snwhitehorn for cf_cv_header_path_$3 in $cf_search 1678217309Snwhitehorn do 1679217309Snwhitehorn if test -d $cf_cv_header_path_$3 ; then 1680217309Snwhitehorn CF_VERBOSE(... testing $cf_cv_header_path_$3) 1681217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_$3" 1682217309Snwhitehorn AC_TRY_COMPILE([$1],[$2],[ 1683217309Snwhitehorn CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3) 1684217309Snwhitehorn cf_cv_find_linkage_$3=maybe 1685217309Snwhitehorn cf_test_CPPFLAGS="$CPPFLAGS" 1686217309Snwhitehorn break],[ 1687217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 1688217309Snwhitehorn ]) 1689217309Snwhitehorn fi 1690217309Snwhitehorn done 1691217309Snwhitehorn 1692217309Snwhitehorn if test "$cf_cv_find_linkage_$3" = maybe ; then 1693217309Snwhitehorn 1694217309Snwhitehorn CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)]) 1695217309Snwhitehorn 1696217309Snwhitehorn cf_save_LIBS="$LIBS" 1697217309Snwhitehorn cf_save_LDFLAGS="$LDFLAGS" 1698217309Snwhitehorn 1699217309Snwhitehorn ifelse([$6],,,[ 1700217309Snwhitehorn CPPFLAGS="$cf_test_CPPFLAGS" 1701217309Snwhitehorn LIBS="-l$3 $7 $cf_save_LIBS" 1702217309Snwhitehorn AC_TRY_LINK([$1],[$2],[ 1703217309Snwhitehorn CF_VERBOSE(... found $3 library in system) 1704217309Snwhitehorn cf_cv_find_linkage_$3=yes]) 1705217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 1706217309Snwhitehorn LIBS="$cf_save_LIBS" 1707217309Snwhitehorn ]) 1708217309Snwhitehorn 1709217309Snwhitehorn if test "$cf_cv_find_linkage_$3" != yes ; then 1710217309Snwhitehorn CF_LIBRARY_PATH(cf_search,$3) 1711217309Snwhitehorn for cf_cv_library_path_$3 in $cf_search 1712217309Snwhitehorn do 1713217309Snwhitehorn if test -d $cf_cv_library_path_$3 ; then 1714217309Snwhitehorn CF_VERBOSE(... testing $cf_cv_library_path_$3) 1715217309Snwhitehorn CPPFLAGS="$cf_test_CPPFLAGS" 1716217309Snwhitehorn LIBS="-l$3 $7 $cf_save_LIBS" 1717217309Snwhitehorn LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3" 1718217309Snwhitehorn AC_TRY_LINK([$1],[$2],[ 1719217309Snwhitehorn CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3) 1720217309Snwhitehorn cf_cv_find_linkage_$3=yes 1721217309Snwhitehorn cf_cv_library_file_$3="-l$3" 1722217309Snwhitehorn break],[ 1723217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 1724217309Snwhitehorn LIBS="$cf_save_LIBS" 1725217309Snwhitehorn LDFLAGS="$cf_save_LDFLAGS" 1726217309Snwhitehorn ]) 1727217309Snwhitehorn fi 1728217309Snwhitehorn done 1729217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 1730217309Snwhitehorn LDFLAGS="$cf_save_LDFLAGS" 1731217309Snwhitehorn fi 1732217309Snwhitehorn 1733217309Snwhitehorn else 1734217309Snwhitehorn cf_cv_find_linkage_$3=no 1735217309Snwhitehorn fi 1736217309Snwhitehorn ],$7) 1737217309Snwhitehorn]) 1738217309Snwhitehorn 1739220749SnwhitehornLIBS="$cf_save_LIBS" 1740220749Snwhitehorn 1741217309Snwhitehornif test "$cf_cv_find_linkage_$3" = yes ; then 1742217309Snwhitehornifelse([$4],,[ 1743217309Snwhitehorn CF_ADD_INCDIR($cf_cv_header_path_$3) 1744217309Snwhitehorn CF_ADD_LIBDIR($cf_cv_library_path_$3) 1745220749Snwhitehorn CF_ADD_LIB($3) 1746217309Snwhitehorn],[$4]) 1747217309Snwhitehornelse 1748217309Snwhitehornifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) 1749217309Snwhitehornfi 1750217309Snwhitehorn])dnl 1751217309Snwhitehorndnl --------------------------------------------------------------------------- 1752217309Snwhitehorndnl CF_FUNC_WAIT version: 2 updated: 1997/10/21 19:45:33 1753217309Snwhitehorndnl ------------ 1754217309Snwhitehorndnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()' 1755217309Snwhitehorndnl and/or 'waitpid()'. 1756217309Snwhitehorndnl 1757217309Snwhitehorndnl Note that we cannot simply grep for 'union wait' in the wait.h file, 1758217309Snwhitehorndnl because some Posix systems turn this on only when a BSD variable is 1759217309Snwhitehorndnl defined. 1760217309Snwhitehorndnl 1761217309Snwhitehorndnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which 1762217309Snwhitehorndnl would conflict with an attempt to test that header directly. 1763217309Snwhitehorndnl 1764217309SnwhitehornAC_DEFUN([CF_FUNC_WAIT], 1765217309Snwhitehorn[ 1766217309SnwhitehornAC_REQUIRE([CF_UNION_WAIT]) 1767217309Snwhitehornif test $cf_cv_type_unionwait = yes; then 1768217309Snwhitehorn 1769217309Snwhitehorn AC_MSG_CHECKING(if union wait can be used as wait-arg) 1770217309Snwhitehorn AC_CACHE_VAL(cf_cv_arg_union_wait,[ 1771217309Snwhitehorn AC_TRY_COMPILE($cf_wait_headers, 1772217309Snwhitehorn [union wait x; wait(&x)], 1773217309Snwhitehorn [cf_cv_arg_union_wait=yes], 1774217309Snwhitehorn [cf_cv_arg_union_wait=no]) 1775217309Snwhitehorn ]) 1776217309Snwhitehorn AC_MSG_RESULT($cf_cv_arg_union_wait) 1777217309Snwhitehorn test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION) 1778217309Snwhitehorn 1779217309Snwhitehorn AC_MSG_CHECKING(if union wait can be used as waitpid-arg) 1780217309Snwhitehorn AC_CACHE_VAL(cf_cv_arg_union_waitpid,[ 1781217309Snwhitehorn AC_TRY_COMPILE($cf_wait_headers, 1782217309Snwhitehorn [union wait x; waitpid(0, &x, 0)], 1783217309Snwhitehorn [cf_cv_arg_union_waitpid=yes], 1784217309Snwhitehorn [cf_cv_arg_union_waitpid=no]) 1785217309Snwhitehorn ]) 1786217309Snwhitehorn AC_MSG_RESULT($cf_cv_arg_union_waitpid) 1787217309Snwhitehorn test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION) 1788217309Snwhitehorn 1789217309Snwhitehornfi 1790217309Snwhitehorn])dnl 1791217309Snwhitehorndnl --------------------------------------------------------------------------- 1792220749Snwhitehorndnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 1793217309Snwhitehorndnl ----------------- 1794217309Snwhitehorndnl Test for availability of useful gcc __attribute__ directives to quiet 1795217309Snwhitehorndnl compiler warnings. Though useful, not all are supported -- and contrary 1796217309Snwhitehorndnl to documentation, unrecognized directives cause older compilers to barf. 1797217309SnwhitehornAC_DEFUN([CF_GCC_ATTRIBUTES], 1798217309Snwhitehorn[ 1799217309Snwhitehornif test "$GCC" = yes 1800217309Snwhitehornthen 1801217309Snwhitehorncat > conftest.i <<EOF 1802217309Snwhitehorn#ifndef GCC_PRINTF 1803217309Snwhitehorn#define GCC_PRINTF 0 1804217309Snwhitehorn#endif 1805217309Snwhitehorn#ifndef GCC_SCANF 1806217309Snwhitehorn#define GCC_SCANF 0 1807217309Snwhitehorn#endif 1808217309Snwhitehorn#ifndef GCC_NORETURN 1809217309Snwhitehorn#define GCC_NORETURN /* nothing */ 1810217309Snwhitehorn#endif 1811217309Snwhitehorn#ifndef GCC_UNUSED 1812217309Snwhitehorn#define GCC_UNUSED /* nothing */ 1813217309Snwhitehorn#endif 1814217309SnwhitehornEOF 1815217309Snwhitehornif test "$GCC" = yes 1816217309Snwhitehornthen 1817217309Snwhitehorn AC_CHECKING([for $CC __attribute__ directives]) 1818217309Snwhitehorncat > conftest.$ac_ext <<EOF 1819220749Snwhitehorn#line __oline__ "${as_me:-configure}" 1820217309Snwhitehorn#include "confdefs.h" 1821217309Snwhitehorn#include "conftest.h" 1822217309Snwhitehorn#include "conftest.i" 1823217309Snwhitehorn#if GCC_PRINTF 1824217309Snwhitehorn#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) 1825217309Snwhitehorn#else 1826217309Snwhitehorn#define GCC_PRINTFLIKE(fmt,var) /*nothing*/ 1827217309Snwhitehorn#endif 1828217309Snwhitehorn#if GCC_SCANF 1829217309Snwhitehorn#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) 1830217309Snwhitehorn#else 1831217309Snwhitehorn#define GCC_SCANFLIKE(fmt,var) /*nothing*/ 1832217309Snwhitehorn#endif 1833217309Snwhitehornextern void wow(char *,...) GCC_SCANFLIKE(1,2); 1834217309Snwhitehornextern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; 1835217309Snwhitehornextern void foo(void) GCC_NORETURN; 1836217309Snwhitehornint main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; } 1837217309SnwhitehornEOF 1838217309Snwhitehorn cf_printf_attribute=no 1839217309Snwhitehorn cf_scanf_attribute=no 1840217309Snwhitehorn for cf_attribute in scanf printf unused noreturn 1841217309Snwhitehorn do 1842217309Snwhitehorn CF_UPPER(cf_ATTRIBUTE,$cf_attribute) 1843217309Snwhitehorn cf_directive="__attribute__(($cf_attribute))" 1844217309Snwhitehorn echo "checking for $CC $cf_directive" 1>&AC_FD_CC 1845217309Snwhitehorn 1846217309Snwhitehorn case $cf_attribute in #(vi 1847217309Snwhitehorn printf) #(vi 1848217309Snwhitehorn cf_printf_attribute=yes 1849217309Snwhitehorn cat >conftest.h <<EOF 1850217309Snwhitehorn#define GCC_$cf_ATTRIBUTE 1 1851217309SnwhitehornEOF 1852217309Snwhitehorn ;; 1853217309Snwhitehorn scanf) #(vi 1854217309Snwhitehorn cf_scanf_attribute=yes 1855217309Snwhitehorn cat >conftest.h <<EOF 1856217309Snwhitehorn#define GCC_$cf_ATTRIBUTE 1 1857217309SnwhitehornEOF 1858217309Snwhitehorn ;; 1859217309Snwhitehorn *) #(vi 1860217309Snwhitehorn cat >conftest.h <<EOF 1861217309Snwhitehorn#define GCC_$cf_ATTRIBUTE $cf_directive 1862217309SnwhitehornEOF 1863217309Snwhitehorn ;; 1864217309Snwhitehorn esac 1865217309Snwhitehorn 1866217309Snwhitehorn if AC_TRY_EVAL(ac_compile); then 1867217309Snwhitehorn test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute) 1868217309Snwhitehorn cat conftest.h >>confdefs.h 1869217309Snwhitehorn case $cf_attribute in #(vi 1870217309Snwhitehorn printf) #(vi 1871217309Snwhitehorn if test "$cf_printf_attribute" = no ; then 1872217309Snwhitehorn cat >>confdefs.h <<EOF 1873217309Snwhitehorn#define GCC_PRINTFLIKE(fmt,var) /* nothing */ 1874217309SnwhitehornEOF 1875217309Snwhitehorn else 1876217309Snwhitehorn cat >>confdefs.h <<EOF 1877217309Snwhitehorn#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) 1878217309SnwhitehornEOF 1879217309Snwhitehorn fi 1880217309Snwhitehorn ;; 1881217309Snwhitehorn scanf) #(vi 1882217309Snwhitehorn if test "$cf_scanf_attribute" = no ; then 1883217309Snwhitehorn cat >>confdefs.h <<EOF 1884217309Snwhitehorn#define GCC_SCANFLIKE(fmt,var) /* nothing */ 1885217309SnwhitehornEOF 1886217309Snwhitehorn else 1887217309Snwhitehorn cat >>confdefs.h <<EOF 1888217309Snwhitehorn#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) 1889217309SnwhitehornEOF 1890217309Snwhitehorn fi 1891217309Snwhitehorn ;; 1892217309Snwhitehorn esac 1893217309Snwhitehorn fi 1894217309Snwhitehorn done 1895217309Snwhitehornelse 1896217309Snwhitehorn fgrep define conftest.i >>confdefs.h 1897217309Snwhitehornfi 1898217309Snwhitehornrm -rf conftest* 1899217309Snwhitehornfi 1900217309Snwhitehorn])dnl 1901217309Snwhitehorndnl --------------------------------------------------------------------------- 1902217309Snwhitehorndnl CF_GCC_VERSION version: 5 updated: 2010/04/24 11:02:31 1903217309Snwhitehorndnl -------------- 1904217309Snwhitehorndnl Find version of gcc 1905217309SnwhitehornAC_DEFUN([CF_GCC_VERSION],[ 1906217309SnwhitehornAC_REQUIRE([AC_PROG_CC]) 1907217309SnwhitehornGCC_VERSION=none 1908217309Snwhitehornif test "$GCC" = yes ; then 1909217309Snwhitehorn AC_MSG_CHECKING(version of $CC) 1910217309Snwhitehorn GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" 1911217309Snwhitehorn test -z "$GCC_VERSION" && GCC_VERSION=unknown 1912217309Snwhitehorn AC_MSG_RESULT($GCC_VERSION) 1913217309Snwhitehornfi 1914217309Snwhitehorn])dnl 1915217309Snwhitehorndnl --------------------------------------------------------------------------- 1916220749Snwhitehorndnl CF_GCC_WARNINGS version: 27 updated: 2010/10/23 15:52:32 1917217309Snwhitehorndnl --------------- 1918217309Snwhitehorndnl Check if the compiler supports useful warning options. There's a few that 1919217309Snwhitehorndnl we don't use, simply because they're too noisy: 1920217309Snwhitehorndnl 1921217309Snwhitehorndnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) 1922217309Snwhitehorndnl -Wredundant-decls (system headers make this too noisy) 1923217309Snwhitehorndnl -Wtraditional (combines too many unrelated messages, only a few useful) 1924217309Snwhitehorndnl -Wwrite-strings (too noisy, but should review occasionally). This 1925217309Snwhitehorndnl is enabled for ncurses using "--enable-const". 1926217309Snwhitehorndnl -pedantic 1927217309Snwhitehorndnl 1928217309Snwhitehorndnl Parameter: 1929217309Snwhitehorndnl $1 is an optional list of gcc warning flags that a particular 1930217309Snwhitehorndnl application might want to use, e.g., "no-unused" for 1931217309Snwhitehorndnl -Wno-unused 1932217309Snwhitehorndnl Special: 1933217309Snwhitehorndnl If $with_ext_const is "yes", add a check for -Wwrite-strings 1934217309Snwhitehorndnl 1935217309SnwhitehornAC_DEFUN([CF_GCC_WARNINGS], 1936217309Snwhitehorn[ 1937217309SnwhitehornAC_REQUIRE([CF_GCC_VERSION]) 1938217309SnwhitehornCF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) 1939217309Snwhitehorn 1940217309Snwhitehorncat > conftest.$ac_ext <<EOF 1941220749Snwhitehorn#line __oline__ "${as_me:-configure}" 1942217309Snwhitehornint main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; } 1943217309SnwhitehornEOF 1944217309Snwhitehorn 1945217309Snwhitehornif test "$INTEL_COMPILER" = yes 1946217309Snwhitehornthen 1947217309Snwhitehorn# The "-wdXXX" options suppress warnings: 1948217309Snwhitehorn# remark #1419: external declaration in primary source file 1949217309Snwhitehorn# remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem) 1950217309Snwhitehorn# remark #1684: conversion from pointer to same-sized integral type (potential portability problem) 1951217309Snwhitehorn# remark #193: zero used for undefined preprocessing identifier 1952217309Snwhitehorn# remark #593: variable "curs_sb_left_arrow" was set but never used 1953217309Snwhitehorn# remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits 1954217309Snwhitehorn# remark #869: parameter "tw" was never referenced 1955217309Snwhitehorn# remark #981: operands are evaluated in unspecified order 1956217309Snwhitehorn# warning #279: controlling expression is constant 1957217309Snwhitehorn 1958217309Snwhitehorn AC_CHECKING([for $CC warning options]) 1959217309Snwhitehorn cf_save_CFLAGS="$CFLAGS" 1960217309Snwhitehorn EXTRA_CFLAGS="-Wall" 1961217309Snwhitehorn for cf_opt in \ 1962217309Snwhitehorn wd1419 \ 1963217309Snwhitehorn wd1683 \ 1964217309Snwhitehorn wd1684 \ 1965217309Snwhitehorn wd193 \ 1966217309Snwhitehorn wd593 \ 1967217309Snwhitehorn wd279 \ 1968217309Snwhitehorn wd810 \ 1969217309Snwhitehorn wd869 \ 1970217309Snwhitehorn wd981 1971217309Snwhitehorn do 1972217309Snwhitehorn CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" 1973217309Snwhitehorn if AC_TRY_EVAL(ac_compile); then 1974217309Snwhitehorn test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt) 1975217309Snwhitehorn EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" 1976217309Snwhitehorn fi 1977217309Snwhitehorn done 1978217309Snwhitehorn CFLAGS="$cf_save_CFLAGS" 1979217309Snwhitehorn 1980217309Snwhitehornelif test "$GCC" = yes 1981217309Snwhitehornthen 1982217309Snwhitehorn AC_CHECKING([for $CC warning options]) 1983217309Snwhitehorn cf_save_CFLAGS="$CFLAGS" 1984217309Snwhitehorn EXTRA_CFLAGS= 1985217309Snwhitehorn cf_warn_CONST="" 1986217309Snwhitehorn test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" 1987217309Snwhitehorn for cf_opt in W Wall \ 1988217309Snwhitehorn Wbad-function-cast \ 1989217309Snwhitehorn Wcast-align \ 1990217309Snwhitehorn Wcast-qual \ 1991217309Snwhitehorn Winline \ 1992217309Snwhitehorn Wmissing-declarations \ 1993217309Snwhitehorn Wmissing-prototypes \ 1994217309Snwhitehorn Wnested-externs \ 1995217309Snwhitehorn Wpointer-arith \ 1996217309Snwhitehorn Wshadow \ 1997217309Snwhitehorn Wstrict-prototypes \ 1998217309Snwhitehorn Wundef $cf_warn_CONST $1 1999217309Snwhitehorn do 2000217309Snwhitehorn CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" 2001217309Snwhitehorn if AC_TRY_EVAL(ac_compile); then 2002217309Snwhitehorn test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt) 2003217309Snwhitehorn case $cf_opt in #(vi 2004217309Snwhitehorn Wcast-qual) #(vi 2005217309Snwhitehorn CPPFLAGS="$CPPFLAGS -DXTSTRINGDEFINES" 2006217309Snwhitehorn ;; 2007217309Snwhitehorn Winline) #(vi 2008217309Snwhitehorn case $GCC_VERSION in 2009217309Snwhitehorn [[34]].*) 2010217309Snwhitehorn CF_VERBOSE(feature is broken in gcc $GCC_VERSION) 2011217309Snwhitehorn continue;; 2012217309Snwhitehorn esac 2013217309Snwhitehorn ;; 2014217309Snwhitehorn esac 2015217309Snwhitehorn EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" 2016217309Snwhitehorn fi 2017217309Snwhitehorn done 2018217309Snwhitehorn CFLAGS="$cf_save_CFLAGS" 2019217309Snwhitehornfi 2020220749Snwhitehornrm -rf conftest* 2021217309Snwhitehorn 2022217309SnwhitehornAC_SUBST(EXTRA_CFLAGS) 2023217309Snwhitehorn])dnl 2024217309Snwhitehorndnl --------------------------------------------------------------------------- 2025217309Snwhitehorndnl CF_GNU_SOURCE version: 6 updated: 2005/07/09 13:23:07 2026217309Snwhitehorndnl ------------- 2027217309Snwhitehorndnl Check if we must define _GNU_SOURCE to get a reasonable value for 2028217309Snwhitehorndnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect 2029217309Snwhitehorndnl (or misfeature) of glibc2, which breaks portability of many applications, 2030217309Snwhitehorndnl since it is interwoven with GNU extensions. 2031217309Snwhitehorndnl 2032217309Snwhitehorndnl Well, yes we could work around it... 2033217309SnwhitehornAC_DEFUN([CF_GNU_SOURCE], 2034217309Snwhitehorn[ 2035217309SnwhitehornAC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ 2036217309SnwhitehornAC_TRY_COMPILE([#include <sys/types.h>],[ 2037217309Snwhitehorn#ifndef _XOPEN_SOURCE 2038217309Snwhitehornmake an error 2039217309Snwhitehorn#endif], 2040217309Snwhitehorn [cf_cv_gnu_source=no], 2041217309Snwhitehorn [cf_save="$CPPFLAGS" 2042217309Snwhitehorn CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" 2043217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 2044217309Snwhitehorn#ifdef _XOPEN_SOURCE 2045217309Snwhitehornmake an error 2046217309Snwhitehorn#endif], 2047217309Snwhitehorn [cf_cv_gnu_source=no], 2048217309Snwhitehorn [cf_cv_gnu_source=yes]) 2049217309Snwhitehorn CPPFLAGS="$cf_save" 2050217309Snwhitehorn ]) 2051217309Snwhitehorn]) 2052217309Snwhitehorntest "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" 2053217309Snwhitehorn])dnl 2054217309Snwhitehorndnl --------------------------------------------------------------------------- 2055217309Snwhitehorndnl CF_HEADERS_SH version: 1 updated: 2007/07/04 15:37:05 2056217309Snwhitehorndnl ------------- 2057217309Snwhitehorndnl Setup variables needed to construct headers-sh 2058217309SnwhitehornAC_DEFUN([CF_HEADERS_SH],[ 2059217309SnwhitehornPACKAGE_PREFIX=$1 2060217309SnwhitehornPACKAGE_CONFIG=$2 2061217309SnwhitehornAC_SUBST(PACKAGE_PREFIX) 2062217309SnwhitehornAC_SUBST(PACKAGE_CONFIG) 2063217309SnwhitehornEXTRA_OUTPUT="$EXTRA_OUTPUT headers-sh:$srcdir/headers-sh.in" 2064217309Snwhitehorn]) 2065217309Snwhitehorndnl --------------------------------------------------------------------------- 2066220749Snwhitehorndnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 2067217309Snwhitehorndnl -------------- 2068217309Snwhitehorndnl Construct a search-list of directories for a nonstandard header-file 2069217309Snwhitehorndnl 2070217309Snwhitehorndnl Parameters 2071217309Snwhitehorndnl $1 = the variable to return as result 2072217309Snwhitehorndnl $2 = the package name 2073217309SnwhitehornAC_DEFUN([CF_HEADER_PATH], 2074217309Snwhitehorn[ 2075217309Snwhitehorn$1= 2076217309Snwhitehorn 2077217309Snwhitehorn# collect the current set of include-directories from compiler flags 2078217309Snwhitehorncf_header_path_list="" 2079217309Snwhitehornif test -n "${CFLAGS}${CPPFLAGS}" ; then 2080217309Snwhitehorn for cf_header_path in $CPPFLAGS $CFLAGS 2081217309Snwhitehorn do 2082217309Snwhitehorn case $cf_header_path in #(vi 2083217309Snwhitehorn -I*) 2084217309Snwhitehorn cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` 2085220749Snwhitehorn CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) 2086220749Snwhitehorn cf_header_path_list="$cf_header_path_list [$]$1" 2087217309Snwhitehorn ;; 2088217309Snwhitehorn esac 2089217309Snwhitehorn done 2090217309Snwhitehornfi 2091217309Snwhitehorn 2092217309Snwhitehorn# add the variations for the package we are looking for 2093217309SnwhitehornCF_SUBDIR_PATH($1,$2,include) 2094217309Snwhitehorn 2095217309Snwhitehorntest "$includedir" != NONE && \ 2096217309Snwhitehorntest "$includedir" != "/usr/include" && \ 2097217309Snwhitehorntest -d "$includedir" && { 2098217309Snwhitehorn test -d $includedir && $1="[$]$1 $includedir" 2099217309Snwhitehorn test -d $includedir/$2 && $1="[$]$1 $includedir/$2" 2100217309Snwhitehorn} 2101217309Snwhitehorn 2102217309Snwhitehorntest "$oldincludedir" != NONE && \ 2103217309Snwhitehorntest "$oldincludedir" != "/usr/include" && \ 2104217309Snwhitehorntest -d "$oldincludedir" && { 2105217309Snwhitehorn test -d $oldincludedir && $1="[$]$1 $oldincludedir" 2106217309Snwhitehorn test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" 2107217309Snwhitehorn} 2108217309Snwhitehorn 2109217309Snwhitehorn$1="[$]$1 $cf_header_path_list" 2110217309Snwhitehorn])dnl 2111217309Snwhitehorndnl --------------------------------------------------------------------------- 2112217309Snwhitehorndnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 2113217309Snwhitehorndnl --------------- 2114217309Snwhitehorndnl Insert text into the help-message, for readability, from AC_ARG_WITH. 2115217309SnwhitehornAC_DEFUN([CF_HELP_MESSAGE], 2116217309Snwhitehorn[AC_DIVERT_HELP([$1])dnl 2117217309Snwhitehorn])dnl 2118217309Snwhitehorndnl --------------------------------------------------------------------------- 2119217309Snwhitehorndnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 2120217309Snwhitehorndnl --------------- 2121217309Snwhitehorndnl Construct the list of include-options according to whether we're building 2122217309Snwhitehorndnl in the source directory or using '--srcdir=DIR' option. If we're building 2123217309Snwhitehorndnl with gcc, don't append the includedir if it happens to be /usr/include, 2124217309Snwhitehorndnl since that usually breaks gcc's shadow-includes. 2125217309SnwhitehornAC_DEFUN([CF_INCLUDE_DIRS], 2126217309Snwhitehorn[ 2127217309SnwhitehornCPPFLAGS="$CPPFLAGS -I. -I../include" 2128217309Snwhitehornif test "$srcdir" != "."; then 2129217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" 2130217309Snwhitehornfi 2131217309Snwhitehornif test "$GCC" != yes; then 2132217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I\${includedir}" 2133217309Snwhitehornelif test "$includedir" != "/usr/include"; then 2134217309Snwhitehorn if test "$includedir" = '${prefix}/include' ; then 2135217309Snwhitehorn if test $prefix != /usr ; then 2136217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I\${includedir}" 2137217309Snwhitehorn fi 2138217309Snwhitehorn else 2139217309Snwhitehorn CPPFLAGS="$CPPFLAGS -I\${includedir}" 2140217309Snwhitehorn fi 2141217309Snwhitehornfi 2142217309SnwhitehornAC_SUBST(CPPFLAGS) 2143217309Snwhitehorn])dnl 2144217309Snwhitehorndnl --------------------------------------------------------------------------- 2145217309Snwhitehorndnl CF_INCLUDE_PATH version: 5 updated: 2010/01/17 20:36:17 2146217309Snwhitehorndnl --------------- 2147217309Snwhitehorndnl Adds to the include-path 2148217309Snwhitehorndnl 2149217309Snwhitehorndnl Autoconf 1.11 should have provided a way to add include path options to 2150217309Snwhitehorndnl the cpp-tests. 2151217309Snwhitehorndnl 2152217309SnwhitehornAC_DEFUN([CF_INCLUDE_PATH], 2153217309Snwhitehorn[ 2154217309Snwhitehorn$1= 2155217309Snwhitehornfor cf_path in $1 2156217309Snwhitehorndo 2157217309Snwhitehorn cf_result="no" 2158217309Snwhitehorn AC_MSG_CHECKING(for directory $cf_path) 2159217309Snwhitehorn if test -d $cf_path 2160217309Snwhitehorn then 2161217309Snwhitehorn INCLUDES="$INCLUDES -I$cf_path" 2162217309Snwhitehorn ac_cpp="${ac_cpp} -I$cf_path" 2163217309Snwhitehorn CFLAGS="$CFLAGS -I$cf_path" 2164217309Snwhitehorn cf_result="yes" 2165217309Snwhitehorn case $cf_path in 2166217309Snwhitehorn /usr/include|/usr/include/*) 2167217309Snwhitehorn ;; 2168217309Snwhitehorn *) 2169217309Snwhitehorn CF_DIRNAME(cf_temp,$cf_path) 2170217309Snwhitehorn case $cf_temp in 2171217309Snwhitehorn */include) 2172217309Snwhitehorn INCLUDES="$INCLUDES -I$cf_temp" 2173217309Snwhitehorn ac_cpp="${ac_cpp} -I$cf_temp" 2174217309Snwhitehorn CFLAGS="$CFLAGS -I$cf_temp" 2175217309Snwhitehorn ;; 2176217309Snwhitehorn esac 2177217309Snwhitehorn esac 2178217309Snwhitehorn fi 2179217309Snwhitehorn AC_MSG_RESULT($cf_result) 2180217309Snwhitehorndone 2181217309Snwhitehorn])dnl 2182217309Snwhitehorndnl --------------------------------------------------------------------------- 2183220749Snwhitehorndnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 2184217309Snwhitehorndnl ----------------- 2185217309Snwhitehorndnl Check if the given compiler is really the Intel compiler for Linux. It 2186217309Snwhitehorndnl tries to imitate gcc, but does not return an error when it finds a mismatch 2187217309Snwhitehorndnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. 2188217309Snwhitehorndnl 2189217309Snwhitehorndnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to 2190217309Snwhitehorndnl ensure that it is not mistaken for gcc/g++. It is normally invoked from 2191217309Snwhitehorndnl the wrappers for gcc and g++ warnings. 2192217309Snwhitehorndnl 2193217309Snwhitehorndnl $1 = GCC (default) or GXX 2194217309Snwhitehorndnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS 2195217309Snwhitehorndnl $3 = CFLAGS (default) or CXXFLAGS 2196217309SnwhitehornAC_DEFUN([CF_INTEL_COMPILER],[ 2197220749Snwhitehornifelse([$2],,INTEL_COMPILER,[$2])=no 2198217309Snwhitehorn 2199220749Snwhitehornif test "$ifelse([$1],,[$1],GCC)" = yes ; then 2200217309Snwhitehorn case $host_os in 2201217309Snwhitehorn linux*|gnu*) 2202220749Snwhitehorn AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) 2203220749Snwhitehorn cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" 2204220749Snwhitehorn ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" 2205217309Snwhitehorn AC_TRY_COMPILE([],[ 2206217309Snwhitehorn#ifdef __INTEL_COMPILER 2207217309Snwhitehorn#else 2208217309Snwhitehornmake an error 2209217309Snwhitehorn#endif 2210220749Snwhitehorn],[ifelse([$2],,INTEL_COMPILER,[$2])=yes 2211217309Snwhitehorncf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" 2212217309Snwhitehorn],[]) 2213220749Snwhitehorn ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" 2214220749Snwhitehorn AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) 2215217309Snwhitehorn ;; 2216217309Snwhitehorn esac 2217217309Snwhitehornfi 2218217309Snwhitehorn])dnl 2219217309Snwhitehorndnl --------------------------------------------------------------------------- 2220217309Snwhitehorndnl CF_LARGEFILE version: 7 updated: 2007/06/02 11:58:50 2221217309Snwhitehorndnl ------------ 2222217309Snwhitehorndnl Add checks for large file support. 2223217309SnwhitehornAC_DEFUN([CF_LARGEFILE],[ 2224217309Snwhitehornifdef([AC_FUNC_FSEEKO],[ 2225217309Snwhitehorn AC_SYS_LARGEFILE 2226217309Snwhitehorn if test "$enable_largefile" != no ; then 2227217309Snwhitehorn AC_FUNC_FSEEKO 2228217309Snwhitehorn 2229217309Snwhitehorn # Normally we would collect these definitions in the config.h, 2230217309Snwhitehorn # but (like _XOPEN_SOURCE), some environments rely on having these 2231217309Snwhitehorn # defined before any of the system headers are included. Another 2232217309Snwhitehorn # case comes up with C++, e.g., on AIX the compiler compiles the 2233217309Snwhitehorn # header files by themselves before looking at the body files it is 2234217309Snwhitehorn # told to compile. For ncurses, those header files do not include 2235217309Snwhitehorn # the config.h 2236217309Snwhitehorn test "$ac_cv_sys_large_files" != no && CPPFLAGS="$CPPFLAGS -D_LARGE_FILES " 2237217309Snwhitehorn test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " 2238217309Snwhitehorn test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " 2239217309Snwhitehorn 2240217309Snwhitehorn AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[ 2241217309Snwhitehorn AC_TRY_COMPILE([ 2242217309Snwhitehorn#include <sys/types.h> 2243217309Snwhitehorn#include <dirent.h> 2244217309Snwhitehorn ],[ 2245217309Snwhitehorn /* if transitional largefile support is setup, this is true */ 2246217309Snwhitehorn extern struct dirent64 * readdir(DIR *); 2247217309Snwhitehorn struct dirent64 *x = readdir((DIR *)0); 2248217309Snwhitehorn struct dirent *y = readdir((DIR *)0); 2249217309Snwhitehorn int z = x - y; 2250217309Snwhitehorn ], 2251217309Snwhitehorn [cf_cv_struct_dirent64=yes], 2252217309Snwhitehorn [cf_cv_struct_dirent64=no]) 2253217309Snwhitehorn ]) 2254217309Snwhitehorn test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64) 2255217309Snwhitehorn fi 2256217309Snwhitehorn]) 2257217309Snwhitehorn]) 2258217309Snwhitehorndnl --------------------------------------------------------------------------- 2259220749Snwhitehorndnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 2260217309Snwhitehorndnl --------------- 2261217309Snwhitehorndnl For the given system and compiler, find the compiler flags to pass to the 2262217309Snwhitehorndnl loader to use the "rpath" feature. 2263217309SnwhitehornAC_DEFUN([CF_LD_RPATH_OPT], 2264217309Snwhitehorn[ 2265217309SnwhitehornAC_REQUIRE([CF_CHECK_CACHE]) 2266217309Snwhitehorn 2267217309SnwhitehornLD_RPATH_OPT= 2268217309SnwhitehornAC_MSG_CHECKING(for an rpath option) 2269217309Snwhitehorncase $cf_cv_system_name in #(vi 2270217309Snwhitehornirix*) #(vi 2271217309Snwhitehorn if test "$GCC" = yes; then 2272217309Snwhitehorn LD_RPATH_OPT="-Wl,-rpath," 2273217309Snwhitehorn else 2274217309Snwhitehorn LD_RPATH_OPT="-rpath " 2275217309Snwhitehorn fi 2276217309Snwhitehorn ;; 2277217309Snwhitehornlinux*|gnu*|k*bsd*-gnu) #(vi 2278217309Snwhitehorn LD_RPATH_OPT="-Wl,-rpath," 2279217309Snwhitehorn ;; 2280217309Snwhitehornopenbsd[[2-9]].*) #(vi 2281217309Snwhitehorn LD_RPATH_OPT="-Wl,-rpath," 2282217309Snwhitehorn ;; 2283217309Snwhitehornfreebsd*) #(vi 2284217309Snwhitehorn LD_RPATH_OPT="-rpath " 2285217309Snwhitehorn ;; 2286217309Snwhitehornnetbsd*) #(vi 2287217309Snwhitehorn LD_RPATH_OPT="-Wl,-rpath," 2288217309Snwhitehorn ;; 2289217309Snwhitehornosf*|mls+*) #(vi 2290217309Snwhitehorn LD_RPATH_OPT="-rpath " 2291217309Snwhitehorn ;; 2292217309Snwhitehornsolaris2*) #(vi 2293217309Snwhitehorn LD_RPATH_OPT="-R" 2294217309Snwhitehorn ;; 2295217309Snwhitehorn*) 2296217309Snwhitehorn ;; 2297217309Snwhitehornesac 2298217309SnwhitehornAC_MSG_RESULT($LD_RPATH_OPT) 2299217309Snwhitehorn 2300217309Snwhitehorncase "x$LD_RPATH_OPT" in #(vi 2301217309Snwhitehornx-R*) 2302217309Snwhitehorn AC_MSG_CHECKING(if we need a space after rpath option) 2303217309Snwhitehorn cf_save_LIBS="$LIBS" 2304220749Snwhitehorn CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) 2305217309Snwhitehorn AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) 2306217309Snwhitehorn LIBS="$cf_save_LIBS" 2307217309Snwhitehorn AC_MSG_RESULT($cf_rpath_space) 2308217309Snwhitehorn test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " 2309217309Snwhitehorn ;; 2310217309Snwhitehornesac 2311217309Snwhitehorn])dnl 2312217309Snwhitehorndnl --------------------------------------------------------------------------- 2313217309Snwhitehorndnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 2314217309Snwhitehorndnl --------------- 2315217309Snwhitehorndnl Construct a search-list of directories for a nonstandard library-file 2316217309Snwhitehorndnl 2317217309Snwhitehorndnl Parameters 2318217309Snwhitehorndnl $1 = the variable to return as result 2319217309Snwhitehorndnl $2 = the package name 2320217309SnwhitehornAC_DEFUN([CF_LIBRARY_PATH], 2321217309Snwhitehorn[ 2322217309Snwhitehorn$1= 2323217309Snwhitehorncf_library_path_list="" 2324217309Snwhitehornif test -n "${LDFLAGS}${LIBS}" ; then 2325217309Snwhitehorn for cf_library_path in $LDFLAGS $LIBS 2326217309Snwhitehorn do 2327217309Snwhitehorn case $cf_library_path in #(vi 2328217309Snwhitehorn -L*) 2329217309Snwhitehorn cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` 2330217309Snwhitehorn CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) 2331217309Snwhitehorn cf_library_path_list="$cf_library_path_list [$]$1" 2332217309Snwhitehorn ;; 2333217309Snwhitehorn esac 2334217309Snwhitehorn done 2335217309Snwhitehornfi 2336217309Snwhitehorn 2337217309SnwhitehornCF_SUBDIR_PATH($1,$2,lib) 2338217309Snwhitehorn 2339217309Snwhitehorn$1="$cf_library_path_list [$]$1" 2340217309Snwhitehorn])dnl 2341217309Snwhitehorndnl --------------------------------------------------------------------------- 2342217309Snwhitehorndnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 2343217309Snwhitehorndnl ------------- 2344217309Snwhitehorndnl Compute the library-prefix for the given host system 2345217309Snwhitehorndnl $1 = variable to set 2346217309SnwhitehornAC_DEFUN([CF_LIB_PREFIX], 2347217309Snwhitehorn[ 2348217309Snwhitehorn case $cf_cv_system_name in #(vi 2349217309Snwhitehorn OS/2*|os2*) #(vi 2350217309Snwhitehorn LIB_PREFIX='' 2351217309Snwhitehorn ;; 2352217309Snwhitehorn *) LIB_PREFIX='lib' 2353217309Snwhitehorn ;; 2354217309Snwhitehorn esac 2355217309Snwhitehornifelse($1,,,[$1=$LIB_PREFIX]) 2356217309Snwhitehorn AC_SUBST(LIB_PREFIX) 2357217309Snwhitehorn])dnl 2358217309Snwhitehorndnl --------------------------------------------------------------------------- 2359220749Snwhitehorndnl CF_MAKEFLAGS version: 13 updated: 2010/10/23 15:52:32 2360217309Snwhitehorndnl ------------ 2361217309Snwhitehorndnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' 2362217309Snwhitehorndnl options to lower-levels. It's very useful for "make -n" -- if we have it. 2363217309Snwhitehorndnl (GNU 'make' does both, something POSIX 'make', which happens to make the 2364217309Snwhitehorndnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) 2365217309SnwhitehornAC_DEFUN([CF_MAKEFLAGS], 2366217309Snwhitehorn[ 2367217309SnwhitehornAC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ 2368217309Snwhitehorn cf_cv_makeflags='' 2369217309Snwhitehorn for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' 2370217309Snwhitehorn do 2371217309Snwhitehorn cat >cf_makeflags.tmp <<CF_EOF 2372217309SnwhitehornSHELL = /bin/sh 2373217309Snwhitehornall : 2374217309Snwhitehorn @ echo '.$cf_option' 2375217309SnwhitehornCF_EOF 2376220749Snwhitehorn cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` 2377217309Snwhitehorn case "$cf_result" in 2378217309Snwhitehorn .*k) 2379220749Snwhitehorn cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` 2380217309Snwhitehorn case "$cf_result" in 2381217309Snwhitehorn .*CC=*) cf_cv_makeflags= 2382217309Snwhitehorn ;; 2383217309Snwhitehorn *) cf_cv_makeflags=$cf_option 2384217309Snwhitehorn ;; 2385217309Snwhitehorn esac 2386217309Snwhitehorn break 2387217309Snwhitehorn ;; 2388217309Snwhitehorn .-) ;; 2389217309Snwhitehorn *) echo "given option \"$cf_option\", no match \"$cf_result\"" 2390217309Snwhitehorn ;; 2391217309Snwhitehorn esac 2392217309Snwhitehorn done 2393217309Snwhitehorn rm -f cf_makeflags.tmp 2394217309Snwhitehorn]) 2395217309Snwhitehorn 2396217309SnwhitehornAC_SUBST(cf_cv_makeflags) 2397217309Snwhitehorn])dnl 2398217309Snwhitehorndnl --------------------------------------------------------------------------- 2399220749Snwhitehorndnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 2400217309Snwhitehorndnl ------------ 2401217309Snwhitehorndnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have 2402217309Snwhitehorndnl a monocase filesystem. 2403217309SnwhitehornAC_DEFUN([CF_MAKE_TAGS],[ 2404217309SnwhitehornAC_REQUIRE([CF_MIXEDCASE_FILENAMES]) 2405217309Snwhitehorn 2406217309SnwhitehornAC_CHECK_PROGS(CTAGS, exctags ctags) 2407217309SnwhitehornAC_CHECK_PROGS(ETAGS, exetags etags) 2408217309Snwhitehorn 2409220749SnwhitehornAC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) 2410217309Snwhitehorn 2411217309Snwhitehornif test "$cf_cv_mixedcase" = yes ; then 2412220749Snwhitehorn AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) 2413217309Snwhitehornelse 2414217309Snwhitehorn MAKE_UPPER_TAGS=no 2415217309Snwhitehornfi 2416217309Snwhitehorn 2417217309Snwhitehornif test "$MAKE_UPPER_TAGS" = yes ; then 2418217309Snwhitehorn MAKE_UPPER_TAGS= 2419217309Snwhitehornelse 2420217309Snwhitehorn MAKE_UPPER_TAGS="#" 2421217309Snwhitehornfi 2422217309Snwhitehorn 2423217309Snwhitehornif test "$MAKE_LOWER_TAGS" = yes ; then 2424217309Snwhitehorn MAKE_LOWER_TAGS= 2425217309Snwhitehornelse 2426217309Snwhitehorn MAKE_LOWER_TAGS="#" 2427217309Snwhitehornfi 2428217309Snwhitehorn 2429217309SnwhitehornAC_SUBST(CTAGS) 2430217309SnwhitehornAC_SUBST(ETAGS) 2431217309Snwhitehorn 2432217309SnwhitehornAC_SUBST(MAKE_UPPER_TAGS) 2433217309SnwhitehornAC_SUBST(MAKE_LOWER_TAGS) 2434217309Snwhitehorn])dnl 2435217309Snwhitehorndnl --------------------------------------------------------------------------- 2436220749Snwhitehorndnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 2437217309Snwhitehorndnl ----------- 2438217309Snwhitehorndnl Checks for libraries. At least one UNIX system, Apple Macintosh 2439217309Snwhitehorndnl Rhapsody 5.5, does not have -lm. We cannot use the simpler 2440217309Snwhitehorndnl AC_CHECK_LIB(m,sin), because that fails for C++. 2441217309SnwhitehornAC_DEFUN([CF_MATH_LIB], 2442217309Snwhitehorn[ 2443217309SnwhitehornAC_CACHE_CHECK(if -lm needed for math functions, 2444217309Snwhitehorn cf_cv_need_libm,[ 2445217309Snwhitehorn AC_TRY_LINK([ 2446217309Snwhitehorn #include <stdio.h> 2447217309Snwhitehorn #include <math.h> 2448217309Snwhitehorn ], 2449220749Snwhitehorn [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], 2450217309Snwhitehorn [cf_cv_need_libm=no], 2451217309Snwhitehorn [cf_cv_need_libm=yes])]) 2452217309Snwhitehornif test "$cf_cv_need_libm" = yes 2453217309Snwhitehornthen 2454217309Snwhitehornifelse($1,,[ 2455220749Snwhitehorn CF_ADD_LIB(m) 2456217309Snwhitehorn],[$1=-lm]) 2457217309Snwhitehornfi 2458217309Snwhitehorn]) 2459217309Snwhitehorndnl --------------------------------------------------------------------------- 2460217309Snwhitehorndnl CF_MBSTATE_T version: 3 updated: 2007/03/25 15:55:36 2461217309Snwhitehorndnl ------------ 2462217309Snwhitehorndnl Check if mbstate_t is declared, and if so, which header file. 2463217309Snwhitehorndnl This (including wchar.h) is needed on Tru64 5.0 to declare mbstate_t, 2464217309Snwhitehorndnl as well as include stdio.h to work around a misuse of varargs in wchar.h 2465217309SnwhitehornAC_DEFUN([CF_MBSTATE_T], 2466217309Snwhitehorn[ 2467217309SnwhitehornAC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_mbstate_t,[ 2468217309SnwhitehornAC_TRY_COMPILE([ 2469217309Snwhitehorn#include <stdlib.h> 2470217309Snwhitehorn#include <stdio.h> 2471217309Snwhitehorn#ifdef HAVE_LIBUTF8_H 2472217309Snwhitehorn#include <libutf8.h> 2473217309Snwhitehorn#endif], 2474217309Snwhitehorn [mbstate_t state], 2475217309Snwhitehorn [cf_cv_mbstate_t=no], 2476217309Snwhitehorn [AC_TRY_COMPILE([ 2477217309Snwhitehorn#include <stdlib.h> 2478217309Snwhitehorn#include <stdio.h> 2479217309Snwhitehorn#include <wchar.h> 2480217309Snwhitehorn#ifdef HAVE_LIBUTF8_H 2481217309Snwhitehorn#include <libutf8.h> 2482217309Snwhitehorn#endif], 2483217309Snwhitehorn [mbstate_t value], 2484217309Snwhitehorn [cf_cv_mbstate_t=yes], 2485217309Snwhitehorn [cf_cv_mbstate_t=unknown])])]) 2486217309Snwhitehorn 2487217309Snwhitehornif test "$cf_cv_mbstate_t" = yes ; then 2488217309Snwhitehorn AC_DEFINE(NEED_WCHAR_H) 2489217309Snwhitehornfi 2490217309Snwhitehorn 2491217309Snwhitehornif test "$cf_cv_mbstate_t" != unknown ; then 2492217309Snwhitehorn AC_DEFINE(HAVE_MBSTATE_T) 2493217309Snwhitehornfi 2494217309Snwhitehorn])dnl 2495217309Snwhitehorndnl --------------------------------------------------------------------------- 2496217309Snwhitehorndnl CF_MIXEDCASE_FILENAMES version: 3 updated: 2003/09/20 17:07:55 2497217309Snwhitehorndnl ---------------------- 2498217309Snwhitehorndnl Check if the file-system supports mixed-case filenames. If we're able to 2499217309Snwhitehorndnl create a lowercase name and see it as uppercase, it doesn't support that. 2500217309SnwhitehornAC_DEFUN([CF_MIXEDCASE_FILENAMES], 2501217309Snwhitehorn[ 2502217309SnwhitehornAC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[ 2503217309Snwhitehornif test "$cross_compiling" = yes ; then 2504217309Snwhitehorn case $target_alias in #(vi 2505217309Snwhitehorn *-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-mingw32*|*-uwin*) #(vi 2506217309Snwhitehorn cf_cv_mixedcase=no 2507217309Snwhitehorn ;; 2508217309Snwhitehorn *) 2509217309Snwhitehorn cf_cv_mixedcase=yes 2510217309Snwhitehorn ;; 2511217309Snwhitehorn esac 2512217309Snwhitehornelse 2513217309Snwhitehorn rm -f conftest CONFTEST 2514217309Snwhitehorn echo test >conftest 2515217309Snwhitehorn if test -f CONFTEST ; then 2516217309Snwhitehorn cf_cv_mixedcase=no 2517217309Snwhitehorn else 2518217309Snwhitehorn cf_cv_mixedcase=yes 2519217309Snwhitehorn fi 2520217309Snwhitehorn rm -f conftest CONFTEST 2521217309Snwhitehornfi 2522217309Snwhitehorn]) 2523217309Snwhitehorntest "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) 2524217309Snwhitehorn])dnl 2525217309Snwhitehorndnl --------------------------------------------------------------------------- 2526220749Snwhitehorndnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 2527217309Snwhitehorndnl ---------- 2528217309Snwhitehorndnl Write a debug message to config.log, along with the line number in the 2529217309Snwhitehorndnl configure script. 2530217309SnwhitehornAC_DEFUN([CF_MSG_LOG],[ 2531220749Snwhitehornecho "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC 2532217309Snwhitehorn])dnl 2533217309Snwhitehorndnl --------------------------------------------------------------------------- 2534217309Snwhitehorndnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05 2535217309Snwhitehorndnl ------------------- 2536217309Snwhitehorndnl Check if we can compile with ncurses' header file 2537217309Snwhitehorndnl $1 is the cache variable to set 2538217309Snwhitehorndnl $2 is the header-file to include 2539217309Snwhitehorndnl $3 is the root name (ncurses or ncursesw) 2540217309SnwhitehornAC_DEFUN([CF_NCURSES_CC_CHECK],[ 2541217309Snwhitehorn AC_TRY_COMPILE([ 2542217309Snwhitehorn]ifelse($3,ncursesw,[ 2543217309Snwhitehorn#define _XOPEN_SOURCE_EXTENDED 2544217309Snwhitehorn#undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ 2545217309Snwhitehorn#define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ 2546217309Snwhitehorn])[ 2547217309Snwhitehorn#include <$2>],[ 2548217309Snwhitehorn#ifdef NCURSES_VERSION 2549217309Snwhitehorn]ifelse($3,ncursesw,[ 2550217309Snwhitehorn#ifndef WACS_BSSB 2551217309Snwhitehorn make an error 2552217309Snwhitehorn#endif 2553217309Snwhitehorn])[ 2554217309Snwhitehornprintf("%s\n", NCURSES_VERSION); 2555217309Snwhitehorn#else 2556217309Snwhitehorn#ifdef __NCURSES_H 2557217309Snwhitehornprintf("old\n"); 2558217309Snwhitehorn#else 2559217309Snwhitehorn make an error 2560217309Snwhitehorn#endif 2561217309Snwhitehorn#endif 2562217309Snwhitehorn ] 2563217309Snwhitehorn ,[$1=$2] 2564217309Snwhitehorn ,[$1=no]) 2565217309Snwhitehorn])dnl 2566217309Snwhitehorndnl --------------------------------------------------------------------------- 2567220749Snwhitehorndnl CF_NCURSES_CONFIG version: 8 updated: 2010/07/08 05:17:30 2568217309Snwhitehorndnl ----------------- 2569217309Snwhitehorndnl Tie together the configure-script macros for ncurses. 2570220749Snwhitehorndnl Prefer the "-config" script from ncurses 6.x, to simplify analysis. 2571217309Snwhitehorndnl Allow that to be overridden using the $NCURSES_CONFIG environment variable. 2572217309Snwhitehorndnl 2573217309Snwhitehorndnl $1 is the root library name (default: "ncurses") 2574217309SnwhitehornAC_DEFUN([CF_NCURSES_CONFIG], 2575217309Snwhitehorn[ 2576217309Snwhitehorncf_ncuconfig_root=ifelse($1,,ncurses,$1) 2577217309Snwhitehorn 2578217309Snwhitehornecho "Looking for ${cf_ncuconfig_root}-config" 2579217309SnwhitehornAC_PATH_PROGS(NCURSES_CONFIG,${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config,none) 2580217309Snwhitehorn 2581217309Snwhitehornif test "$NCURSES_CONFIG" != none ; then 2582217309Snwhitehorn 2583217309SnwhitehornCPPFLAGS="$CPPFLAGS `$NCURSES_CONFIG --cflags`" 2584220749SnwhitehornCF_ADD_LIBS(`$NCURSES_CONFIG --libs`) 2585217309Snwhitehorn 2586217309Snwhitehorn# even with config script, some packages use no-override for curses.h 2587217309SnwhitehornCF_CURSES_HEADER(ifelse($1,,ncurses,$1)) 2588217309Snwhitehorn 2589217309Snwhitehorndnl like CF_NCURSES_CPPFLAGS 2590217309SnwhitehornAC_DEFINE(NCURSES) 2591217309Snwhitehorn 2592217309Snwhitehorndnl like CF_NCURSES_LIBS 2593217309SnwhitehornCF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root) 2594217309SnwhitehornAC_DEFINE_UNQUOTED($cf_nculib_ROOT) 2595217309Snwhitehorn 2596217309Snwhitehorndnl like CF_NCURSES_VERSION 2597217309Snwhitehorncf_cv_ncurses_version=`$NCURSES_CONFIG --version` 2598217309Snwhitehorn 2599217309Snwhitehornelse 2600217309Snwhitehorn 2601217309SnwhitehornCF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1)) 2602217309SnwhitehornCF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) 2603217309Snwhitehorn 2604217309Snwhitehornfi 2605217309Snwhitehorn])dnl 2606217309Snwhitehorndnl --------------------------------------------------------------------------- 2607220749Snwhitehorndnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38 2608217309Snwhitehorndnl ------------------- 2609217309Snwhitehorndnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting 2610217309Snwhitehorndnl the CPPFLAGS variable so we can include its header. 2611217309Snwhitehorndnl 2612217309Snwhitehorndnl The header files may be installed as either curses.h, or ncurses.h (would 2613217309Snwhitehorndnl be obsolete, except that some packagers prefer this name to distinguish it 2614217309Snwhitehorndnl from a "native" curses implementation). If not installed for overwrite, 2615217309Snwhitehorndnl the curses.h file would be in an ncurses subdirectory (e.g., 2616217309Snwhitehorndnl /usr/include/ncurses), but someone may have installed overwriting the 2617217309Snwhitehorndnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd 2618217309Snwhitehorndnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in 2619217309Snwhitehorndnl the header. 2620217309Snwhitehorndnl 2621217309Snwhitehorndnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header 2622217309Snwhitehorndnl is already in the include-path, don't even bother with this, since we cannot 2623217309Snwhitehorndnl easily determine which file it is. In this case, it has to be <curses.h>. 2624217309Snwhitehorndnl 2625217309Snwhitehorndnl The optional parameter gives the root name of the library, in case it is 2626217309Snwhitehorndnl not installed as the default curses library. That is how the 2627217309Snwhitehorndnl wide-character version of ncurses is installed. 2628217309SnwhitehornAC_DEFUN([CF_NCURSES_CPPFLAGS], 2629217309Snwhitehorn[AC_REQUIRE([CF_WITH_CURSES_DIR]) 2630217309Snwhitehorn 2631217309SnwhitehornAC_PROVIDE([CF_CURSES_CPPFLAGS])dnl 2632217309Snwhitehorncf_ncuhdr_root=ifelse($1,,ncurses,$1) 2633217309Snwhitehorn 2634217309Snwhitehorntest -n "$cf_cv_curses_dir" && \ 2635217309Snwhitehorntest "$cf_cv_curses_dir" != "no" && { \ 2636220749Snwhitehorn CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) 2637217309Snwhitehorn} 2638217309Snwhitehorn 2639217309SnwhitehornAC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ 2640217309Snwhitehorn cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" 2641217309Snwhitehorn ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h" 2642217309Snwhitehorn for cf_header in $cf_header_list 2643217309Snwhitehorn do 2644217309Snwhitehorn CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) 2645217309Snwhitehorn test "$cf_cv_ncurses_h" != no && break 2646217309Snwhitehorn done 2647217309Snwhitehorn]) 2648217309Snwhitehorn 2649217309SnwhitehornCF_NCURSES_HEADER 2650217309SnwhitehornCF_TERM_HEADER 2651217309Snwhitehorn 2652217309Snwhitehorn# some applications need this, but should check for NCURSES_VERSION 2653217309SnwhitehornAC_DEFINE(NCURSES) 2654217309Snwhitehorn 2655217309SnwhitehornCF_NCURSES_VERSION 2656217309Snwhitehorn])dnl 2657217309Snwhitehorndnl --------------------------------------------------------------------------- 2658217309Snwhitehorndnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54 2659217309Snwhitehorndnl ----------------- 2660217309Snwhitehorndnl Find a "curses" header file, e.g,. "curses.h", or one of the more common 2661217309Snwhitehorndnl variations of ncurses' installs. 2662217309Snwhitehorndnl 2663217309Snwhitehorndnl See also CF_CURSES_HEADER, which sets the same cache variable. 2664217309SnwhitehornAC_DEFUN([CF_NCURSES_HEADER],[ 2665217309Snwhitehorn 2666217309Snwhitehornif test "$cf_cv_ncurses_h" != no ; then 2667217309Snwhitehorn cf_cv_ncurses_header=$cf_cv_ncurses_h 2668217309Snwhitehornelse 2669217309Snwhitehorn 2670217309SnwhitehornAC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ 2671217309Snwhitehorn test -n "$verbose" && echo 2672217309Snwhitehorn CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) 2673217309Snwhitehorn test -n "$verbose" && echo search path $cf_search 2674217309Snwhitehorn cf_save2_CPPFLAGS="$CPPFLAGS" 2675217309Snwhitehorn for cf_incdir in $cf_search 2676217309Snwhitehorn do 2677217309Snwhitehorn CF_ADD_INCDIR($cf_incdir) 2678217309Snwhitehorn for cf_header in \ 2679217309Snwhitehorn ncurses.h \ 2680217309Snwhitehorn curses.h 2681217309Snwhitehorn do 2682217309Snwhitehorn CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) 2683217309Snwhitehorn if test "$cf_cv_ncurses_h2" != no ; then 2684217309Snwhitehorn cf_cv_ncurses_h2=$cf_incdir/$cf_header 2685217309Snwhitehorn test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG 2686217309Snwhitehorn break 2687217309Snwhitehorn fi 2688217309Snwhitehorn test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG 2689217309Snwhitehorn done 2690217309Snwhitehorn CPPFLAGS="$cf_save2_CPPFLAGS" 2691217309Snwhitehorn test "$cf_cv_ncurses_h2" != no && break 2692217309Snwhitehorn done 2693217309Snwhitehorn test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) 2694217309Snwhitehorn ]) 2695217309Snwhitehorn 2696217309Snwhitehorn CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) 2697217309Snwhitehorn cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2` 2698217309Snwhitehorn if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then 2699217309Snwhitehorn cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header 2700217309Snwhitehorn fi 2701217309Snwhitehorn CF_ADD_INCDIR($cf_1st_incdir) 2702217309Snwhitehorn 2703217309Snwhitehornfi 2704217309Snwhitehorn 2705217309Snwhitehorn# Set definitions to allow ifdef'ing for ncurses.h 2706217309Snwhitehorn 2707217309Snwhitehorncase $cf_cv_ncurses_header in # (vi 2708217309Snwhitehorn*ncurses.h) 2709217309Snwhitehorn AC_DEFINE(HAVE_NCURSES_H) 2710217309Snwhitehorn ;; 2711217309Snwhitehornesac 2712217309Snwhitehorn 2713217309Snwhitehorncase $cf_cv_ncurses_header in # (vi 2714217309Snwhitehornncurses/curses.h|ncurses/ncurses.h) 2715217309Snwhitehorn AC_DEFINE(HAVE_NCURSES_NCURSES_H) 2716217309Snwhitehorn ;; 2717217309Snwhitehornncursesw/curses.h|ncursesw/ncurses.h) 2718217309Snwhitehorn AC_DEFINE(HAVE_NCURSESW_NCURSES_H) 2719217309Snwhitehorn ;; 2720217309Snwhitehornesac 2721217309Snwhitehorn 2722217309Snwhitehorn])dnl 2723217309Snwhitehorndnl --------------------------------------------------------------------------- 2724220749Snwhitehorndnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38 2725217309Snwhitehorndnl --------------- 2726217309Snwhitehorndnl Look for the ncurses library. This is a little complicated on Linux, 2727217309Snwhitehorndnl because it may be linked with the gpm (general purpose mouse) library. 2728217309Snwhitehorndnl Some distributions have gpm linked with (bsd) curses, which makes it 2729217309Snwhitehorndnl unusable with ncurses. However, we don't want to link with gpm unless 2730217309Snwhitehorndnl ncurses has a dependency, since gpm is normally set up as a shared library, 2731217309Snwhitehorndnl and the linker will record a dependency. 2732217309Snwhitehorndnl 2733217309Snwhitehorndnl The optional parameter gives the root name of the library, in case it is 2734217309Snwhitehorndnl not installed as the default curses library. That is how the 2735217309Snwhitehorndnl wide-character version of ncurses is installed. 2736217309SnwhitehornAC_DEFUN([CF_NCURSES_LIBS], 2737217309Snwhitehorn[AC_REQUIRE([CF_NCURSES_CPPFLAGS]) 2738217309Snwhitehorn 2739217309Snwhitehorncf_nculib_root=ifelse($1,,ncurses,$1) 2740217309Snwhitehorn # This works, except for the special case where we find gpm, but 2741217309Snwhitehorn # ncurses is in a nonstandard location via $LIBS, and we really want 2742217309Snwhitehorn # to link gpm. 2743217309Snwhitehorncf_ncurses_LIBS="" 2744217309Snwhitehorncf_ncurses_SAVE="$LIBS" 2745217309SnwhitehornAC_CHECK_LIB(gpm,Gpm_Open, 2746217309Snwhitehorn [AC_CHECK_LIB(gpm,initscr, 2747217309Snwhitehorn [LIBS="$cf_ncurses_SAVE"], 2748217309Snwhitehorn [cf_ncurses_LIBS="-lgpm"])]) 2749217309Snwhitehorn 2750217309Snwhitehorncase $host_os in #(vi 2751217309Snwhitehornfreebsd*) 2752217309Snwhitehorn # This is only necessary if you are linking against an obsolete 2753217309Snwhitehorn # version of ncurses (but it should do no harm, since it's static). 2754217309Snwhitehorn if test "$cf_nculib_root" = ncurses ; then 2755217309Snwhitehorn AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) 2756217309Snwhitehorn fi 2757217309Snwhitehorn ;; 2758217309Snwhitehornesac 2759217309Snwhitehorn 2760220749SnwhitehornCF_ADD_LIBS($cf_ncurses_LIBS) 2761217309Snwhitehorn 2762217309Snwhitehornif ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) 2763217309Snwhitehornthen 2764220749Snwhitehorn CF_ADD_LIBS(-l$cf_nculib_root) 2765217309Snwhitehornelse 2766217309Snwhitehorn CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, 2767220749Snwhitehorn [#include <${cf_cv_ncurses_header:-curses.h}>], 2768217309Snwhitehorn [initscr()], 2769217309Snwhitehorn initscr) 2770217309Snwhitehornfi 2771217309Snwhitehorn 2772217309Snwhitehornif test -n "$cf_ncurses_LIBS" ; then 2773217309Snwhitehorn AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) 2774217309Snwhitehorn cf_ncurses_SAVE="$LIBS" 2775217309Snwhitehorn for p in $cf_ncurses_LIBS ; do 2776217309Snwhitehorn q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"` 2777217309Snwhitehorn if test "$q" != "$LIBS" ; then 2778217309Snwhitehorn LIBS="$q" 2779217309Snwhitehorn fi 2780217309Snwhitehorn done 2781220749Snwhitehorn AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], 2782217309Snwhitehorn [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);], 2783217309Snwhitehorn [AC_MSG_RESULT(yes)], 2784217309Snwhitehorn [AC_MSG_RESULT(no) 2785217309Snwhitehorn LIBS="$cf_ncurses_SAVE"]) 2786217309Snwhitehornfi 2787217309Snwhitehorn 2788217309SnwhitehornCF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) 2789217309SnwhitehornAC_DEFINE_UNQUOTED($cf_nculib_ROOT) 2790217309Snwhitehorn])dnl 2791217309Snwhitehorndnl --------------------------------------------------------------------------- 2792220749Snwhitehorndnl CF_NCURSES_VERSION version: 13 updated: 2010/10/23 15:54:49 2793217309Snwhitehorndnl ------------------ 2794217309Snwhitehorndnl Check for the version of ncurses, to aid in reporting bugs, etc. 2795217309Snwhitehorndnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use 2796217309Snwhitehorndnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. 2797217309SnwhitehornAC_DEFUN([CF_NCURSES_VERSION], 2798217309Snwhitehorn[ 2799217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 2800217309SnwhitehornAC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ 2801217309Snwhitehorn cf_cv_ncurses_version=no 2802217309Snwhitehorn cf_tempfile=out$$ 2803217309Snwhitehorn rm -f $cf_tempfile 2804217309Snwhitehorn AC_TRY_RUN([ 2805220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 2806217309Snwhitehorn#include <stdio.h> 2807217309Snwhitehornint main() 2808217309Snwhitehorn{ 2809217309Snwhitehorn FILE *fp = fopen("$cf_tempfile", "w"); 2810217309Snwhitehorn#ifdef NCURSES_VERSION 2811217309Snwhitehorn# ifdef NCURSES_VERSION_PATCH 2812217309Snwhitehorn fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); 2813217309Snwhitehorn# else 2814217309Snwhitehorn fprintf(fp, "%s\n", NCURSES_VERSION); 2815217309Snwhitehorn# endif 2816217309Snwhitehorn#else 2817217309Snwhitehorn# ifdef __NCURSES_H 2818217309Snwhitehorn fprintf(fp, "old\n"); 2819217309Snwhitehorn# else 2820217309Snwhitehorn make an error 2821217309Snwhitehorn# endif 2822217309Snwhitehorn#endif 2823220749Snwhitehorn ${cf_cv_main_return:-return}(0); 2824217309Snwhitehorn}],[ 2825217309Snwhitehorn cf_cv_ncurses_version=`cat $cf_tempfile`],,[ 2826217309Snwhitehorn 2827217309Snwhitehorn # This will not work if the preprocessor splits the line after the 2828217309Snwhitehorn # Autoconf token. The 'unproto' program does that. 2829217309Snwhitehorn cat > conftest.$ac_ext <<EOF 2830220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 2831217309Snwhitehorn#undef Autoconf 2832217309Snwhitehorn#ifdef NCURSES_VERSION 2833217309SnwhitehornAutoconf NCURSES_VERSION 2834217309Snwhitehorn#else 2835217309Snwhitehorn#ifdef __NCURSES_H 2836217309SnwhitehornAutoconf "old" 2837217309Snwhitehorn#endif 2838217309Snwhitehorn; 2839217309Snwhitehorn#endif 2840217309SnwhitehornEOF 2841217309Snwhitehorn cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" 2842217309Snwhitehorn AC_TRY_EVAL(cf_try) 2843217309Snwhitehorn if test -f conftest.out ; then 2844217309Snwhitehorn cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'` 2845217309Snwhitehorn test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" 2846217309Snwhitehorn rm -f conftest.out 2847217309Snwhitehorn fi 2848217309Snwhitehorn]) 2849217309Snwhitehorn rm -f $cf_tempfile 2850217309Snwhitehorn]) 2851217309Snwhitehorntest "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES) 2852217309Snwhitehorn])dnl 2853217309Snwhitehorndnl --------------------------------------------------------------------------- 2854217309Snwhitehorndnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05 2855217309Snwhitehorndnl ------------------ 2856217309Snwhitehorndnl see CF_WITH_NO_LEAKS 2857217309SnwhitehornAC_DEFUN([CF_NO_LEAKS_OPTION],[ 2858217309SnwhitehornAC_MSG_CHECKING(if you want to use $1 for testing) 2859217309SnwhitehornAC_ARG_WITH($1, 2860217309Snwhitehorn [$2], 2861217309Snwhitehorn [AC_DEFINE($3)ifelse([$4],,[ 2862217309Snwhitehorn $4 2863217309Snwhitehorn]) 2864217309Snwhitehorn : ${with_cflags:=-g} 2865217309Snwhitehorn : ${with_no_leaks:=yes} 2866217309Snwhitehorn with_$1=yes], 2867217309Snwhitehorn [with_$1=]) 2868217309SnwhitehornAC_MSG_RESULT(${with_$1:-no}) 2869217309Snwhitehorn 2870217309Snwhitehorncase .$with_cflags in #(vi 2871217309Snwhitehorn.*-g*) 2872217309Snwhitehorn case .$CFLAGS in #(vi 2873217309Snwhitehorn .*-g*) #(vi 2874217309Snwhitehorn ;; 2875217309Snwhitehorn *) 2876217309Snwhitehorn CF_ADD_CFLAGS([-g]) 2877217309Snwhitehorn ;; 2878217309Snwhitehorn esac 2879217309Snwhitehorn ;; 2880217309Snwhitehornesac 2881217309Snwhitehorn])dnl 2882217309Snwhitehorndnl --------------------------------------------------------------------------- 2883217309Snwhitehorndnl CF_OUR_MESSAGES version: 7 updated: 2004/09/12 19:45:55 2884217309Snwhitehorndnl --------------- 2885217309Snwhitehorndnl Check if we use the messages included with this program 2886217309Snwhitehorndnl 2887217309Snwhitehorndnl $1 specifies either Makefile or makefile, defaulting to the former. 2888217309Snwhitehorndnl 2889217309Snwhitehorndnl Sets variables which can be used to substitute in makefiles: 2890217309Snwhitehorndnl MSG_DIR_MAKE - to make ./po directory 2891217309Snwhitehorndnl SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL) 2892217309Snwhitehorndnl 2893217309SnwhitehornAC_DEFUN([CF_OUR_MESSAGES], 2894217309Snwhitehorn[ 2895217309Snwhitehorncf_makefile=ifelse($1,,Makefile,$1) 2896217309Snwhitehorn 2897217309Snwhitehornuse_our_messages=no 2898217309Snwhitehornif test "$USE_NLS" = yes ; then 2899217309Snwhitehornif test -d $srcdir/po ; then 2900217309SnwhitehornAC_MSG_CHECKING(if we should use included message-library) 2901217309Snwhitehorn AC_ARG_ENABLE(included-msgs, 2902217309Snwhitehorn [ --disable-included-msgs use included messages, for i18n support], 2903217309Snwhitehorn [use_our_messages=$enableval], 2904217309Snwhitehorn [use_our_messages=yes]) 2905217309Snwhitehornfi 2906217309SnwhitehornAC_MSG_RESULT($use_our_messages) 2907217309Snwhitehornfi 2908217309Snwhitehorn 2909217309SnwhitehornMSG_DIR_MAKE="#" 2910217309Snwhitehornif test "$use_our_messages" = yes 2911217309Snwhitehornthen 2912217309Snwhitehorn SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn" 2913217309Snwhitehorn MSG_DIR_MAKE= 2914217309Snwhitehornfi 2915217309Snwhitehorn 2916217309SnwhitehornAC_SUBST(MSG_DIR_MAKE) 2917217309SnwhitehornAC_SUBST(SUB_MAKEFILE) 2918217309Snwhitehorn])dnl 2919217309Snwhitehorndnl --------------------------------------------------------------------------- 2920220749Snwhitehorndnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 2921217309Snwhitehorndnl ---------- 2922217309Snwhitehorndnl Provide a value for the $PATH and similar separator 2923217309SnwhitehornAC_DEFUN([CF_PATHSEP], 2924217309Snwhitehorn[ 2925217309Snwhitehorn case $cf_cv_system_name in 2926217309Snwhitehorn os2*) PATH_SEPARATOR=';' ;; 2927217309Snwhitehorn *) PATH_SEPARATOR=':' ;; 2928217309Snwhitehorn esac 2929220749Snwhitehornifelse([$1],,,[$1=$PATH_SEPARATOR]) 2930217309Snwhitehorn AC_SUBST(PATH_SEPARATOR) 2931217309Snwhitehorn])dnl 2932217309Snwhitehorndnl --------------------------------------------------------------------------- 2933220749Snwhitehorndnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42 2934217309Snwhitehorndnl -------------- 2935217309Snwhitehorndnl Check the argument to see that it looks like a pathname. Rewrite it if it 2936217309Snwhitehorndnl begins with one of the prefix/exec_prefix variables, and then again if the 2937217309Snwhitehorndnl result begins with 'NONE'. This is necessary to work around autoconf's 2938217309Snwhitehorndnl delayed evaluation of those symbols. 2939217309SnwhitehornAC_DEFUN([CF_PATH_SYNTAX],[ 2940217309Snwhitehornif test "x$prefix" != xNONE; then 2941217309Snwhitehorn cf_path_syntax="$prefix" 2942217309Snwhitehornelse 2943217309Snwhitehorn cf_path_syntax="$ac_default_prefix" 2944217309Snwhitehornfi 2945217309Snwhitehorn 2946217309Snwhitehorncase ".[$]$1" in #(vi 2947217309Snwhitehorn.\[$]\(*\)*|.\'*\'*) #(vi 2948217309Snwhitehorn ;; 2949217309Snwhitehorn..|./*|.\\*) #(vi 2950217309Snwhitehorn ;; 2951217309Snwhitehorn.[[a-zA-Z]]:[[\\/]]*) #(vi OS/2 EMX 2952217309Snwhitehorn ;; 2953217309Snwhitehorn.\[$]{*prefix}*) #(vi 2954217309Snwhitehorn eval $1="[$]$1" 2955217309Snwhitehorn case ".[$]$1" in #(vi 2956217309Snwhitehorn .NONE/*) 2957217309Snwhitehorn $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` 2958217309Snwhitehorn ;; 2959217309Snwhitehorn esac 2960217309Snwhitehorn ;; #(vi 2961217309Snwhitehorn.no|.NONE/*) 2962217309Snwhitehorn $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` 2963217309Snwhitehorn ;; 2964217309Snwhitehorn*) 2965220749Snwhitehorn ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) 2966217309Snwhitehorn ;; 2967217309Snwhitehornesac 2968217309Snwhitehorn])dnl 2969217309Snwhitehorndnl --------------------------------------------------------------------------- 2970220749Snwhitehorndnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 2971217309Snwhitehorndnl ----------------- 2972217309Snwhitehorndnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. 2973217309Snwhitehorndnl 2974217309Snwhitehorndnl POSIX.1-1990 _POSIX_SOURCE 2975217309Snwhitehorndnl POSIX.1-1990 and _POSIX_SOURCE and 2976217309Snwhitehorndnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 2977217309Snwhitehorndnl Bindings Option 2978217309Snwhitehorndnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L 2979217309Snwhitehorndnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L 2980217309Snwhitehorndnl X/Open 2000 _POSIX_C_SOURCE=200112L 2981217309Snwhitehorndnl 2982217309Snwhitehorndnl Parameters: 2983217309Snwhitehorndnl $1 is the nominal value for _POSIX_C_SOURCE 2984217309SnwhitehornAC_DEFUN([CF_POSIX_C_SOURCE], 2985217309Snwhitehorn[ 2986220749Snwhitehorncf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) 2987217309Snwhitehorn 2988217309Snwhitehorncf_save_CFLAGS="$CFLAGS" 2989217309Snwhitehorncf_save_CPPFLAGS="$CPPFLAGS" 2990217309Snwhitehorn 2991217309SnwhitehornCF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) 2992217309SnwhitehornCF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) 2993217309Snwhitehorn 2994217309SnwhitehornAC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ 2995217309Snwhitehorn CF_MSG_LOG(if the symbol is already defined go no further) 2996217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 2997217309Snwhitehorn#ifndef _POSIX_C_SOURCE 2998217309Snwhitehornmake an error 2999217309Snwhitehorn#endif], 3000217309Snwhitehorn [cf_cv_posix_c_source=no], 3001217309Snwhitehorn [cf_want_posix_source=no 3002217309Snwhitehorn case .$cf_POSIX_C_SOURCE in #(vi 3003217309Snwhitehorn .[[12]]??*) #(vi 3004217309Snwhitehorn cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" 3005217309Snwhitehorn ;; 3006217309Snwhitehorn .2) #(vi 3007217309Snwhitehorn cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" 3008217309Snwhitehorn cf_want_posix_source=yes 3009217309Snwhitehorn ;; 3010217309Snwhitehorn .*) 3011217309Snwhitehorn cf_want_posix_source=yes 3012217309Snwhitehorn ;; 3013217309Snwhitehorn esac 3014217309Snwhitehorn if test "$cf_want_posix_source" = yes ; then 3015217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 3016217309Snwhitehorn#ifdef _POSIX_SOURCE 3017217309Snwhitehornmake an error 3018217309Snwhitehorn#endif],[], 3019217309Snwhitehorn cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") 3020217309Snwhitehorn fi 3021217309Snwhitehorn CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) 3022217309Snwhitehorn CFLAGS="$cf_trim_CFLAGS" 3023217309Snwhitehorn CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" 3024217309Snwhitehorn CF_MSG_LOG(if the second compile does not leave our definition intact error) 3025217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 3026217309Snwhitehorn#ifndef _POSIX_C_SOURCE 3027217309Snwhitehornmake an error 3028217309Snwhitehorn#endif],, 3029217309Snwhitehorn [cf_cv_posix_c_source=no]) 3030217309Snwhitehorn CFLAGS="$cf_save_CFLAGS" 3031217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 3032217309Snwhitehorn ]) 3033217309Snwhitehorn]) 3034217309Snwhitehorn 3035217309Snwhitehornif test "$cf_cv_posix_c_source" != no ; then 3036217309Snwhitehorn CFLAGS="$cf_trim_CFLAGS" 3037217309Snwhitehorn CPPFLAGS="$cf_trim_CPPFLAGS" 3038217309Snwhitehorn CF_ADD_CFLAGS($cf_cv_posix_c_source) 3039217309Snwhitehornfi 3040217309Snwhitehorn 3041217309Snwhitehorn])dnl 3042217309Snwhitehorndnl --------------------------------------------------------------------------- 3043217309Snwhitehorndnl CF_PROG_CC_U_D version: 1 updated: 2005/07/14 16:59:30 3044217309Snwhitehorndnl -------------- 3045217309Snwhitehorndnl Check if C (preprocessor) -U and -D options are processed in the order 3046217309Snwhitehorndnl given rather than by type of option. Some compilers insist on apply all 3047217309Snwhitehorndnl of the -U options after all of the -D options. Others allow mixing them, 3048217309Snwhitehorndnl and may predefine symbols that conflict with those we define. 3049217309SnwhitehornAC_DEFUN([CF_PROG_CC_U_D], 3050217309Snwhitehorn[ 3051217309SnwhitehornAC_CACHE_CHECK(if $CC -U and -D options work together,cf_cv_cc_u_d_options,[ 3052217309Snwhitehorn cf_save_CPPFLAGS="$CPPFLAGS" 3053217309Snwhitehorn CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" 3054217309Snwhitehorn AC_TRY_COMPILE([],[ 3055217309Snwhitehorn#ifndef U_D_OPTIONS 3056217309Snwhitehornmake an undefined-error 3057217309Snwhitehorn#endif 3058217309Snwhitehorn#ifdef D_U_OPTIONS 3059217309Snwhitehornmake a defined-error 3060217309Snwhitehorn#endif 3061217309Snwhitehorn ],[ 3062217309Snwhitehorn cf_cv_cc_u_d_options=yes],[ 3063217309Snwhitehorn cf_cv_cc_u_d_options=no]) 3064217309Snwhitehorn CPPFLAGS="$cf_save_CPPFLAGS" 3065217309Snwhitehorn]) 3066217309Snwhitehorn])dnl 3067217309Snwhitehorndnl --------------------------------------------------------------------------- 3068217309Snwhitehorndnl CF_PROG_EXT version: 10 updated: 2004/01/03 19:28:18 3069217309Snwhitehorndnl ----------- 3070217309Snwhitehorndnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX. 3071217309SnwhitehornAC_DEFUN([CF_PROG_EXT], 3072217309Snwhitehorn[ 3073217309SnwhitehornAC_REQUIRE([CF_CHECK_CACHE]) 3074217309Snwhitehorncase $cf_cv_system_name in 3075217309Snwhitehornos2*) 3076217309Snwhitehorn CFLAGS="$CFLAGS -Zmt" 3077217309Snwhitehorn CPPFLAGS="$CPPFLAGS -D__ST_MT_ERRNO__" 3078217309Snwhitehorn CXXFLAGS="$CXXFLAGS -Zmt" 3079217309Snwhitehorn # autoconf's macro sets -Zexe and suffix both, which conflict:w 3080217309Snwhitehorn LDFLAGS="$LDFLAGS -Zmt -Zcrtdll" 3081217309Snwhitehorn ac_cv_exeext=.exe 3082217309Snwhitehorn ;; 3083217309Snwhitehornesac 3084217309Snwhitehorn 3085217309SnwhitehornAC_EXEEXT 3086217309SnwhitehornAC_OBJEXT 3087217309Snwhitehorn 3088217309SnwhitehornPROG_EXT="$EXEEXT" 3089217309SnwhitehornAC_SUBST(PROG_EXT) 3090217309Snwhitehorntest -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") 3091217309Snwhitehorn])dnl 3092217309Snwhitehorndnl --------------------------------------------------------------------------- 3093217309Snwhitehorndnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 3094217309Snwhitehorndnl ---------------- 3095217309Snwhitehorndnl Remove all -U and -D options that refer to the given symbol from a list 3096217309Snwhitehorndnl of C compiler options. This works around the problem that not all 3097217309Snwhitehorndnl compilers process -U and -D options from left-to-right, so a -U option 3098217309Snwhitehorndnl cannot be used to cancel the effect of a preceding -D option. 3099217309Snwhitehorndnl 3100217309Snwhitehorndnl $1 = target (which could be the same as the source variable) 3101217309Snwhitehorndnl $2 = source (including '$') 3102217309Snwhitehorndnl $3 = symbol to remove 3103217309Snwhitehorndefine([CF_REMOVE_DEFINE], 3104217309Snwhitehorn[ 3105217309Snwhitehorn$1=`echo "$2" | \ 3106217309Snwhitehorn sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ 3107217309Snwhitehorn -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` 3108217309Snwhitehorn])dnl 3109217309Snwhitehorndnl --------------------------------------------------------------------------- 3110217309Snwhitehorndnl CF_RPATH_HACK version: 8 updated: 2010/04/17 15:38:58 3111217309Snwhitehorndnl ------------- 3112217309SnwhitehornAC_DEFUN([CF_RPATH_HACK], 3113217309Snwhitehorn[ 3114217309SnwhitehornAC_REQUIRE([CF_LD_RPATH_OPT]) 3115217309SnwhitehornAC_MSG_CHECKING(for updated LDFLAGS) 3116217309Snwhitehornif test -n "$LD_RPATH_OPT" ; then 3117217309Snwhitehorn AC_MSG_RESULT(maybe) 3118217309Snwhitehorn 3119217309Snwhitehorn AC_CHECK_PROGS(cf_ldd_prog,ldd,no) 3120217309Snwhitehorn cf_rpath_list="/usr/lib /lib" 3121217309Snwhitehorn if test "$cf_ldd_prog" != no 3122217309Snwhitehorn then 3123217309SnwhitehornAC_TRY_LINK([#include <stdio.h>], 3124217309Snwhitehorn [printf("Hello");], 3125217309Snwhitehorn [cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) 3126217309Snwhitehorn fi 3127217309Snwhitehorn 3128217309Snwhitehorn CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) 3129217309Snwhitehorn 3130217309Snwhitehorn CF_RPATH_HACK_2(LDFLAGS) 3131217309Snwhitehorn CF_RPATH_HACK_2(LIBS) 3132217309Snwhitehorn 3133217309Snwhitehorn CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) 3134217309Snwhitehornfi 3135217309SnwhitehornAC_SUBST(EXTRA_LDFLAGS) 3136217309Snwhitehorn])dnl 3137217309Snwhitehorndnl --------------------------------------------------------------------------- 3138217309Snwhitehorndnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24 3139217309Snwhitehorndnl --------------- 3140217309Snwhitehorndnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to 3141217309Snwhitehorndnl EXTRA_LDFLAGS for each -L option found. 3142217309Snwhitehorndnl 3143217309Snwhitehorndnl $cf_rpath_list contains a list of directories to ignore. 3144217309Snwhitehorndnl 3145217309Snwhitehorndnl $1 = variable name to update. The LDFLAGS variable should be the only one, 3146217309Snwhitehorndnl but LIBS often has misplaced -L options. 3147217309SnwhitehornAC_DEFUN([CF_RPATH_HACK_2], 3148217309Snwhitehorn[ 3149217309SnwhitehornCF_VERBOSE(...checking $1 [$]$1) 3150217309Snwhitehorn 3151217309Snwhitehorncf_rpath_dst= 3152217309Snwhitehornfor cf_rpath_src in [$]$1 3153217309Snwhitehorndo 3154217309Snwhitehorn case $cf_rpath_src in #(vi 3155217309Snwhitehorn -L*) #(vi 3156217309Snwhitehorn 3157217309Snwhitehorn # check if this refers to a directory which we will ignore 3158217309Snwhitehorn cf_rpath_skip=no 3159217309Snwhitehorn if test -n "$cf_rpath_list" 3160217309Snwhitehorn then 3161217309Snwhitehorn for cf_rpath_item in $cf_rpath_list 3162217309Snwhitehorn do 3163217309Snwhitehorn if test "x$cf_rpath_src" = "x-L$cf_rpath_item" 3164217309Snwhitehorn then 3165217309Snwhitehorn cf_rpath_skip=yes 3166217309Snwhitehorn break 3167217309Snwhitehorn fi 3168217309Snwhitehorn done 3169217309Snwhitehorn fi 3170217309Snwhitehorn 3171217309Snwhitehorn if test "$cf_rpath_skip" = no 3172217309Snwhitehorn then 3173217309Snwhitehorn # transform the option 3174217309Snwhitehorn if test "$LD_RPATH_OPT" = "-R " ; then 3175217309Snwhitehorn cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` 3176217309Snwhitehorn else 3177217309Snwhitehorn cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` 3178217309Snwhitehorn fi 3179217309Snwhitehorn 3180217309Snwhitehorn # if we have not already added this, add it now 3181217309Snwhitehorn cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` 3182217309Snwhitehorn if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" 3183217309Snwhitehorn then 3184217309Snwhitehorn CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) 3185217309Snwhitehorn EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" 3186217309Snwhitehorn fi 3187217309Snwhitehorn fi 3188217309Snwhitehorn ;; 3189217309Snwhitehorn esac 3190217309Snwhitehorn cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" 3191217309Snwhitehorndone 3192217309Snwhitehorn$1=$cf_rpath_dst 3193217309Snwhitehorn 3194217309SnwhitehornCF_VERBOSE(...checked $1 [$]$1) 3195217309SnwhitehornAC_SUBST(EXTRA_LDFLAGS) 3196217309Snwhitehorn])dnl 3197217309Snwhitehorndnl --------------------------------------------------------------------------- 3198217309Snwhitehorndnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 3199217309Snwhitehorndnl -------------- 3200217309Snwhitehorndnl Construct a search-list for a nonstandard header/lib-file 3201217309Snwhitehorndnl $1 = the variable to return as result 3202217309Snwhitehorndnl $2 = the package name 3203217309Snwhitehorndnl $3 = the subdirectory, e.g., bin, include or lib 3204217309SnwhitehornAC_DEFUN([CF_SUBDIR_PATH], 3205217309Snwhitehorn[ 3206217309Snwhitehorn$1= 3207217309Snwhitehorn 3208217309SnwhitehornCF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) 3209217309SnwhitehornCF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) 3210217309SnwhitehornCF_ADD_SUBDIR_PATH($1,$2,$3,/usr/local,$prefix) 3211217309SnwhitehornCF_ADD_SUBDIR_PATH($1,$2,$3,/opt,$prefix) 3212217309SnwhitehornCF_ADD_SUBDIR_PATH($1,$2,$3,[$]HOME,$prefix) 3213217309Snwhitehorn])dnl 3214217309Snwhitehorndnl --------------------------------------------------------------------------- 3215217309Snwhitehorndnl CF_SUBST version: 4 updated: 2006/06/17 12:33:03 3216217309Snwhitehorndnl -------- 3217217309Snwhitehorndnl Shorthand macro for substituting things that the user may override 3218217309Snwhitehorndnl with an environment variable. 3219217309Snwhitehorndnl 3220217309Snwhitehorndnl $1 = long/descriptive name 3221217309Snwhitehorndnl $2 = environment variable 3222217309Snwhitehorndnl $3 = default value 3223217309SnwhitehornAC_DEFUN([CF_SUBST], 3224217309Snwhitehorn[AC_CACHE_VAL(cf_cv_subst_$2,[ 3225217309SnwhitehornAC_MSG_CHECKING(for $1 (symbol $2)) 3226217309SnwhitehornCF_SUBST_IF([-z "[$]$2"], [$2], [$3]) 3227217309Snwhitehorncf_cv_subst_$2=[$]$2 3228217309SnwhitehornAC_MSG_RESULT([$]$2) 3229217309Snwhitehorn]) 3230217309Snwhitehorn])dnl 3231217309Snwhitehorndnl --------------------------------------------------------------------------- 3232217309Snwhitehorndnl CF_SYSTYPE version: 3 updated: 2001/02/03 00:14:59 3233217309Snwhitehorndnl ---------- 3234217309Snwhitehorndnl Derive the system-type (our main clue to the method of building shared 3235217309Snwhitehorndnl libraries). 3236217309SnwhitehornAC_DEFUN([CF_SYSTYPE], 3237217309Snwhitehorn[ 3238217309SnwhitehornAC_MSG_CHECKING(for system type) 3239217309SnwhitehornAC_CACHE_VAL(cf_cv_systype,[ 3240217309SnwhitehornAC_ARG_WITH(system-type, 3241217309Snwhitehorn[ --with-system-type=XXX test: override derived host system-type], 3242217309Snwhitehorn[cf_cv_systype=$withval], 3243217309Snwhitehorn[ 3244217309Snwhitehorncf_cv_systype="`(uname -s || hostname || echo unknown) 2>/dev/null |sed -e s'/[[:\/.-]]/_/'g | sed 1q`" 3245217309Snwhitehornif test -z "$cf_cv_systype"; then cf_cv_systype=unknown;fi 3246217309Snwhitehorn])]) 3247217309SnwhitehornAC_MSG_RESULT($cf_cv_systype) 3248217309Snwhitehorn])dnl 3249217309Snwhitehorndnl --------------------------------------------------------------------------- 3250217309Snwhitehorndnl CF_SYS_NAME version: 3 updated: 2008/03/23 14:48:54 3251217309Snwhitehorndnl ----------- 3252217309Snwhitehorndnl Derive the system name, as a check for reusing the autoconf cache 3253217309SnwhitehornAC_DEFUN([CF_SYS_NAME], 3254217309Snwhitehorn[ 3255217309SnwhitehornSYS_NAME=`(uname -s -r || uname -a || hostname) 2>/dev/null | sed 1q` 3256217309Snwhitehorntest -z "$SYS_NAME" && SYS_NAME=unknown 3257217309SnwhitehornAC_DEFINE_UNQUOTED(SYS_NAME,"$SYS_NAME") 3258217309Snwhitehorn 3259217309SnwhitehornAC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$SYS_NAME"]) 3260217309Snwhitehorn 3261217309Snwhitehornif test ".$SYS_NAME" != ".$cf_cv_system_name" ; then 3262217309Snwhitehorn AC_MSG_RESULT("Cached system name does not agree with actual") 3263217309Snwhitehorn AC_MSG_ERROR("Please remove config.cache and try again.") 3264217309Snwhitehornfi]) 3265217309Snwhitehorndnl --------------------------------------------------------------------------- 3266220749Snwhitehorndnl CF_TERM_HEADER version: 2 updated: 2010/10/23 15:54:49 3267217309Snwhitehorndnl -------------- 3268217309Snwhitehorndnl Look for term.h, which is part of X/Open curses. It defines the interface 3269217309Snwhitehorndnl to terminfo database. Usually it is in the same include-path as curses.h, 3270217309Snwhitehorndnl but some packagers change this, breaking various applications. 3271217309SnwhitehornAC_DEFUN([CF_TERM_HEADER],[ 3272217309SnwhitehornAC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[ 3273217309Snwhitehorncase ${cf_cv_ncurses_header} in #(vi 3274217309Snwhitehorn*/ncurses.h|*/ncursesw.h) #(vi 3275217309Snwhitehorn cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'` 3276217309Snwhitehorn ;; 3277217309Snwhitehorn*) 3278217309Snwhitehorn cf_term_header=term.h 3279217309Snwhitehorn ;; 3280217309Snwhitehornesac 3281217309Snwhitehorn 3282217309Snwhitehornfor cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" 3283217309Snwhitehorndo 3284217309SnwhitehornAC_TRY_COMPILE([#include <stdio.h> 3285220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 3286217309Snwhitehorn#include <$cf_test> 3287217309Snwhitehorn],[int x = auto_left_margin],[ 3288217309Snwhitehorn cf_cv_term_header="$cf_test"],[ 3289217309Snwhitehorn cf_cv_term_header=unknown 3290217309Snwhitehorn ]) 3291217309Snwhitehorn test "$cf_cv_term_header" != unknown && break 3292217309Snwhitehorndone 3293217309Snwhitehorn]) 3294217309Snwhitehorn 3295217309Snwhitehorn# Set definitions to allow ifdef'ing to accommodate subdirectories 3296217309Snwhitehorn 3297217309Snwhitehorncase $cf_cv_term_header in # (vi 3298217309Snwhitehorn*term.h) 3299217309Snwhitehorn AC_DEFINE(HAVE_TERM_H) 3300217309Snwhitehorn ;; 3301217309Snwhitehornesac 3302217309Snwhitehorn 3303217309Snwhitehorncase $cf_cv_term_header in # (vi 3304217309Snwhitehornncurses/term.h) #(vi 3305217309Snwhitehorn AC_DEFINE(HAVE_NCURSES_TERM_H) 3306217309Snwhitehorn ;; 3307217309Snwhitehornncursesw/term.h) 3308217309Snwhitehorn AC_DEFINE(HAVE_NCURSESW_TERM_H) 3309217309Snwhitehorn ;; 3310217309Snwhitehornesac 3311217309Snwhitehorn])dnl 3312217309Snwhitehorndnl --------------------------------------------------------------------------- 3313217309Snwhitehorndnl CF_UNION_WAIT version: 5 updated: 1997/11/23 14:49:44 3314217309Snwhitehorndnl ------------- 3315217309Snwhitehorndnl Check to see if the BSD-style union wait is declared. Some platforms may 3316217309Snwhitehorndnl use this, though it is deprecated in favor of the 'int' type in Posix. 3317217309Snwhitehorndnl Some vendors provide a bogus implementation that declares union wait, but 3318217309Snwhitehorndnl uses the 'int' type instead; we try to spot these by checking for the 3319217309Snwhitehorndnl associated macros. 3320217309Snwhitehorndnl 3321217309Snwhitehorndnl Ahem. Some implementers cast the status value to an int*, as an attempt to 3322217309Snwhitehorndnl use the macros for either union wait or int. So we do a check compile to 3323217309Snwhitehorndnl see if the macros are defined and apply to an int. 3324217309Snwhitehorndnl 3325217309Snwhitehorndnl Sets: $cf_cv_type_unionwait 3326217309Snwhitehorndnl Defines: HAVE_TYPE_UNIONWAIT 3327217309SnwhitehornAC_DEFUN([CF_UNION_WAIT], 3328217309Snwhitehorn[ 3329217309SnwhitehornAC_REQUIRE([CF_WAIT_HEADERS]) 3330217309SnwhitehornAC_MSG_CHECKING([for union wait]) 3331217309SnwhitehornAC_CACHE_VAL(cf_cv_type_unionwait,[ 3332217309Snwhitehorn AC_TRY_LINK($cf_wait_headers, 3333217309Snwhitehorn [int x; 3334217309Snwhitehorn int y = WEXITSTATUS(x); 3335217309Snwhitehorn int z = WTERMSIG(x); 3336217309Snwhitehorn wait(&x); 3337217309Snwhitehorn ], 3338217309Snwhitehorn [cf_cv_type_unionwait=no 3339217309Snwhitehorn echo compiles ok w/o union wait 1>&AC_FD_CC 3340217309Snwhitehorn ],[ 3341217309Snwhitehorn AC_TRY_LINK($cf_wait_headers, 3342217309Snwhitehorn [union wait x; 3343217309Snwhitehorn#ifdef WEXITSTATUS 3344217309Snwhitehorn int y = WEXITSTATUS(x); 3345217309Snwhitehorn#endif 3346217309Snwhitehorn#ifdef WTERMSIG 3347217309Snwhitehorn int z = WTERMSIG(x); 3348217309Snwhitehorn#endif 3349217309Snwhitehorn wait(&x); 3350217309Snwhitehorn ], 3351217309Snwhitehorn [cf_cv_type_unionwait=yes 3352217309Snwhitehorn echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC 3353217309Snwhitehorn ], 3354217309Snwhitehorn [cf_cv_type_unionwait=no])])]) 3355217309SnwhitehornAC_MSG_RESULT($cf_cv_type_unionwait) 3356217309Snwhitehorntest $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT) 3357217309Snwhitehorn])dnl 3358217309Snwhitehorndnl --------------------------------------------------------------------------- 3359217309Snwhitehorndnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 3360217309Snwhitehorndnl -------- 3361217309Snwhitehorndnl Make an uppercase version of a variable 3362217309Snwhitehorndnl $1=uppercase($2) 3363217309SnwhitehornAC_DEFUN([CF_UPPER], 3364217309Snwhitehorn[ 3365217309Snwhitehorn$1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` 3366217309Snwhitehorn])dnl 3367217309Snwhitehorndnl --------------------------------------------------------------------------- 3368220749Snwhitehorndnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 3369217309Snwhitehorndnl ----------- 3370217309Snwhitehorndnl Check for multibyte support, and if not found, utf8 compatibility library 3371217309SnwhitehornAC_DEFUN([CF_UTF8_LIB], 3372217309Snwhitehorn[ 3373217309SnwhitehornAC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ 3374217309Snwhitehorn cf_save_LIBS="$LIBS" 3375217309Snwhitehorn AC_TRY_LINK([ 3376217309Snwhitehorn#include <stdlib.h>],[putwc(0,0);], 3377217309Snwhitehorn [cf_cv_utf8_lib=yes], 3378217309Snwhitehorn [CF_FIND_LINKAGE([ 3379217309Snwhitehorn#include <libutf8.h>],[putwc(0,0);],utf8, 3380217309Snwhitehorn [cf_cv_utf8_lib=add-on], 3381217309Snwhitehorn [cf_cv_utf8_lib=no]) 3382217309Snwhitehorn])]) 3383217309Snwhitehorn 3384217309Snwhitehorn# HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between 3385217309Snwhitehorn# ncurses/ncursesw: 3386217309Snwhitehornif test "$cf_cv_utf8_lib" = "add-on" ; then 3387217309Snwhitehorn AC_DEFINE(HAVE_LIBUTF8_H) 3388217309Snwhitehorn CF_ADD_INCDIR($cf_cv_header_path_utf8) 3389217309Snwhitehorn CF_ADD_LIBDIR($cf_cv_library_path_utf8) 3390220749Snwhitehorn CF_ADD_LIBS($cf_cv_library_file_utf8) 3391217309Snwhitehornfi 3392217309Snwhitehorn])dnl 3393217309Snwhitehorndnl --------------------------------------------------------------------------- 3394217309Snwhitehorndnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 3395217309Snwhitehorndnl ---------- 3396217309Snwhitehorndnl Use AC_VERBOSE w/o the warnings 3397217309SnwhitehornAC_DEFUN([CF_VERBOSE], 3398217309Snwhitehorn[test -n "$verbose" && echo " $1" 1>&AC_FD_MSG 3399217309SnwhitehornCF_MSG_LOG([$1]) 3400217309Snwhitehorn])dnl 3401217309Snwhitehorndnl --------------------------------------------------------------------------- 3402220749Snwhitehorndnl CF_VERSION_INFO version: 4 updated: 2011/01/02 19:09:47 3403217309Snwhitehorndnl --------------- 3404217309Snwhitehorndnl Define several useful symbols derived from the VERSION file. A separate 3405217309Snwhitehorndnl file is preferred to embedding the version numbers in various scripts. 3406217309Snwhitehorndnl (automake is a textbook-example of why the latter is a bad idea, but there 3407217309Snwhitehorndnl are others). 3408217309Snwhitehorndnl 3409217309Snwhitehorndnl The file contents are: 3410217309Snwhitehorndnl libtool-version release-version patch-version 3411217309Snwhitehorndnl or 3412217309Snwhitehorndnl release-version 3413217309Snwhitehorndnl where 3414217309Snwhitehorndnl libtool-version (see ?) consists of 3 integers separated by '.' 3415217309Snwhitehorndnl release-version consists of a major version and minor version 3416217309Snwhitehorndnl separated by '.', optionally followed by a patch-version 3417217309Snwhitehorndnl separated by '-'. The minor version need not be an 3418217309Snwhitehorndnl integer (but it is preferred). 3419217309Snwhitehorndnl patch-version is an integer in the form yyyymmdd, so ifdef's and 3420217309Snwhitehorndnl scripts can easily compare versions. 3421217309Snwhitehorndnl 3422217309Snwhitehorndnl If libtool is used, the first form is required, since CF_WITH_LIBTOOL 3423217309Snwhitehorndnl simply extracts the first field using 'cut -f1'. 3424220749Snwhitehorndnl 3425220749Snwhitehorndnl Optional parameters: 3426220749Snwhitehorndnl $1 = internal name for package 3427220749Snwhitehorndnl $2 = external name for package 3428217309SnwhitehornAC_DEFUN([CF_VERSION_INFO], 3429217309Snwhitehorn[ 3430217309Snwhitehornif test -f $srcdir/VERSION ; then 3431217309Snwhitehorn AC_MSG_CHECKING(for package version) 3432217309Snwhitehorn 3433217309Snwhitehorn # if there are not enough fields, cut returns the last one... 3434217309Snwhitehorn cf_field1=`sed -e '2,$d' $srcdir/VERSION|cut -f1` 3435217309Snwhitehorn cf_field2=`sed -e '2,$d' $srcdir/VERSION|cut -f2` 3436217309Snwhitehorn cf_field3=`sed -e '2,$d' $srcdir/VERSION|cut -f3` 3437217309Snwhitehorn 3438217309Snwhitehorn # this is how CF_BUNDLED_INTL uses $VERSION: 3439217309Snwhitehorn VERSION="$cf_field1" 3440217309Snwhitehorn 3441217309Snwhitehorn VERSION_MAJOR=`echo "$cf_field2" | sed -e 's/\..*//'` 3442217309Snwhitehorn test -z "$VERSION_MAJOR" && AC_MSG_ERROR(missing major-version) 3443217309Snwhitehorn 3444217309Snwhitehorn VERSION_MINOR=`echo "$cf_field2" | sed -e 's/^[[^.]]*\.//' -e 's/-.*//'` 3445217309Snwhitehorn test -z "$VERSION_MINOR" && AC_MSG_ERROR(missing minor-version) 3446217309Snwhitehorn 3447217309Snwhitehorn AC_MSG_RESULT(${VERSION_MAJOR}.${VERSION_MINOR}) 3448217309Snwhitehorn 3449217309Snwhitehorn AC_MSG_CHECKING(for package patch date) 3450217309Snwhitehorn VERSION_PATCH=`echo "$cf_field3" | sed -e 's/^[[^-]]*-//'` 3451217309Snwhitehorn case .$VERSION_PATCH in 3452217309Snwhitehorn .) 3453217309Snwhitehorn AC_MSG_ERROR(missing patch-date $VERSION_PATCH) 3454217309Snwhitehorn ;; 3455217309Snwhitehorn .[[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]]) 3456217309Snwhitehorn ;; 3457217309Snwhitehorn *) 3458217309Snwhitehorn AC_MSG_ERROR(illegal patch-date $VERSION_PATCH) 3459217309Snwhitehorn ;; 3460217309Snwhitehorn esac 3461217309Snwhitehorn AC_MSG_RESULT($VERSION_PATCH) 3462217309Snwhitehornelse 3463217309Snwhitehorn AC_MSG_ERROR(did not find $srcdir/VERSION) 3464217309Snwhitehornfi 3465217309Snwhitehorn 3466217309Snwhitehorn# show the actual data that we have for versions: 3467217309SnwhitehornCF_VERBOSE(VERSION $VERSION) 3468217309SnwhitehornCF_VERBOSE(VERSION_MAJOR $VERSION_MAJOR) 3469217309SnwhitehornCF_VERBOSE(VERSION_MINOR $VERSION_MINOR) 3470217309SnwhitehornCF_VERBOSE(VERSION_PATCH $VERSION_PATCH) 3471217309Snwhitehorn 3472217309SnwhitehornAC_SUBST(VERSION) 3473217309SnwhitehornAC_SUBST(VERSION_MAJOR) 3474217309SnwhitehornAC_SUBST(VERSION_MINOR) 3475217309SnwhitehornAC_SUBST(VERSION_PATCH) 3476217309Snwhitehorn 3477217309Snwhitehorndnl if a package name is given, define its corresponding version info. We 3478217309Snwhitehorndnl need the package name to ensure that the defined symbols are unique. 3479217309Snwhitehornifelse($1,,,[ 3480220749Snwhitehorn cf_PACKAGE=$1 3481220749Snwhitehorn PACKAGE=ifelse($2,,$1,$2) 3482217309Snwhitehorn AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") 3483217309Snwhitehorn AC_SUBST(PACKAGE) 3484220749Snwhitehorn CF_UPPER(cf_PACKAGE,$cf_PACKAGE) 3485217309Snwhitehorn AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}") 3486217309Snwhitehorn AC_DEFINE_UNQUOTED(${cf_PACKAGE}_PATCHDATE,${VERSION_PATCH}) 3487217309Snwhitehorn]) 3488217309Snwhitehorn])dnl 3489217309Snwhitehorndnl --------------------------------------------------------------------------- 3490217309Snwhitehorndnl CF_WAIT_HEADERS version: 2 updated: 1997/10/21 19:45:33 3491217309Snwhitehorndnl --------------- 3492217309Snwhitehorndnl Build up an expression $cf_wait_headers with the header files needed to 3493217309Snwhitehorndnl compile against the prototypes for 'wait()', 'waitpid()', etc. Assume it's 3494217309Snwhitehorndnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation 3495217309Snwhitehorndnl with <wait.h>. 3496217309SnwhitehornAC_DEFUN([CF_WAIT_HEADERS], 3497217309Snwhitehorn[ 3498217309SnwhitehornAC_HAVE_HEADERS(sys/wait.h) 3499217309Snwhitehorncf_wait_headers="#include <sys/types.h> 3500217309Snwhitehorn" 3501217309Snwhitehornif test $ac_cv_header_sys_wait_h = yes; then 3502217309Snwhitehorncf_wait_headers="$cf_wait_headers 3503217309Snwhitehorn#include <sys/wait.h> 3504217309Snwhitehorn" 3505217309Snwhitehornelse 3506217309SnwhitehornAC_HAVE_HEADERS(wait.h) 3507217309SnwhitehornAC_HAVE_HEADERS(waitstatus.h) 3508217309Snwhitehornif test $ac_cv_header_wait_h = yes; then 3509217309Snwhitehorncf_wait_headers="$cf_wait_headers 3510217309Snwhitehorn#include <wait.h> 3511217309Snwhitehorn" 3512217309Snwhitehornfi 3513217309Snwhitehornif test $ac_cv_header_waitstatus_h = yes; then 3514217309Snwhitehorncf_wait_headers="$cf_wait_headers 3515217309Snwhitehorn#include <waitstatus.h> 3516217309Snwhitehorn" 3517217309Snwhitehornfi 3518217309Snwhitehornfi 3519217309Snwhitehorn])dnl 3520217309Snwhitehorndnl --------------------------------------------------------------------------- 3521220749Snwhitehorndnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38 3522217309Snwhitehorndnl ------------------ 3523217309Snwhitehorndnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses 3524217309Snwhitehorndnl libraries. 3525217309SnwhitehornAC_DEFUN([CF_WITH_CURSES_DIR],[ 3526220749Snwhitehorn 3527220749SnwhitehornAC_MSG_CHECKING(for specific curses-directory) 3528217309SnwhitehornAC_ARG_WITH(curses-dir, 3529217309Snwhitehorn [ --with-curses-dir=DIR directory in which (n)curses is installed], 3530220749Snwhitehorn [cf_cv_curses_dir=$withval], 3531217309Snwhitehorn [cf_cv_curses_dir=no]) 3532220749SnwhitehornAC_MSG_RESULT($cf_cv_curses_dir) 3533220749Snwhitehorn 3534220749Snwhitehornif ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" ) 3535220749Snwhitehornthen 3536220749Snwhitehorn CF_PATH_SYNTAX(withval) 3537220749Snwhitehorn if test -d "$cf_cv_curses_dir" 3538220749Snwhitehorn then 3539220749Snwhitehorn CF_ADD_INCDIR($cf_cv_curses_dir/include) 3540220749Snwhitehorn CF_ADD_LIBDIR($cf_cv_curses_dir/lib) 3541220749Snwhitehorn fi 3542220749Snwhitehornfi 3543217309Snwhitehorn])dnl 3544217309Snwhitehorndnl --------------------------------------------------------------------------- 3545220749Snwhitehorndnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 3546217309Snwhitehorndnl ---------------- 3547217309Snwhitehorndnl Configure-option for dbmalloc. The optional parameter is used to override 3548217309Snwhitehorndnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. 3549217309SnwhitehornAC_DEFUN([CF_WITH_DBMALLOC],[ 3550217309SnwhitehornCF_NO_LEAKS_OPTION(dbmalloc, 3551217309Snwhitehorn [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], 3552217309Snwhitehorn [USE_DBMALLOC]) 3553217309Snwhitehorn 3554217309Snwhitehornif test "$with_dbmalloc" = yes ; then 3555217309Snwhitehorn AC_CHECK_HEADER(dbmalloc.h, 3556220749Snwhitehorn [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) 3557217309Snwhitehornfi 3558217309Snwhitehorn])dnl 3559217309Snwhitehorndnl --------------------------------------------------------------------------- 3560220749Snwhitehorndnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 3561217309Snwhitehorndnl --------------- 3562217309Snwhitehorndnl Configure-option for dmalloc. The optional parameter is used to override 3563217309Snwhitehorndnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. 3564217309SnwhitehornAC_DEFUN([CF_WITH_DMALLOC],[ 3565217309SnwhitehornCF_NO_LEAKS_OPTION(dmalloc, 3566217309Snwhitehorn [ --with-dmalloc test: use Gray Watson's dmalloc library], 3567217309Snwhitehorn [USE_DMALLOC]) 3568217309Snwhitehorn 3569217309Snwhitehornif test "$with_dmalloc" = yes ; then 3570217309Snwhitehorn AC_CHECK_HEADER(dmalloc.h, 3571220749Snwhitehorn [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) 3572217309Snwhitehornfi 3573217309Snwhitehorn])dnl 3574217309Snwhitehorndnl --------------------------------------------------------------------------- 3575220749Snwhitehorndnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 3576217309Snwhitehorndnl --------------- 3577217309Snwhitehorndnl Provide a configure option to incorporate libtool. Define several useful 3578217309Snwhitehorndnl symbols for the makefile rules. 3579217309Snwhitehorndnl 3580217309Snwhitehorndnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses 3581217309Snwhitehorndnl macros from libtool.m4 which is in the aclocal directory of automake. 3582217309Snwhitehorndnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro. 3583217309Snwhitehorndnl But that still does not work properly since the macro is expanded outside 3584217309Snwhitehorndnl the CF_WITH_LIBTOOL macro: 3585217309Snwhitehorndnl 3586217309Snwhitehorndnl #!/bin/sh 3587217309Snwhitehorndnl ACLOCAL=`aclocal --print-ac-dir` 3588217309Snwhitehorndnl if test -z "$ACLOCAL" ; then 3589217309Snwhitehorndnl echo cannot find aclocal directory 3590217309Snwhitehorndnl exit 1 3591217309Snwhitehorndnl elif test ! -f $ACLOCAL/libtool.m4 ; then 3592217309Snwhitehorndnl echo cannot find libtool.m4 file 3593217309Snwhitehorndnl exit 1 3594217309Snwhitehorndnl fi 3595217309Snwhitehorndnl 3596217309Snwhitehorndnl LOCAL=aclocal.m4 3597217309Snwhitehorndnl ORIG=aclocal.m4.orig 3598217309Snwhitehorndnl 3599217309Snwhitehorndnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 3600217309Snwhitehorndnl rm -f $ORIG 3601217309Snwhitehorndnl mv $LOCAL $ORIG 3602217309Snwhitehorndnl 3603217309Snwhitehorndnl # sed the LIBTOOL= assignment to omit the current directory? 3604220749Snwhitehorndnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL 3605217309Snwhitehorndnl cat $ORIG >>$LOCAL 3606217309Snwhitehorndnl 3607217309Snwhitehorndnl autoconf-257 $* 3608217309Snwhitehorndnl 3609217309SnwhitehornAC_DEFUN([CF_WITH_LIBTOOL], 3610217309Snwhitehorn[ 3611220749SnwhitehornAC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION]) 3612217309Snwhitehornifdef([AC_PROG_LIBTOOL],,[ 3613217309SnwhitehornLIBTOOL= 3614217309Snwhitehorn]) 3615217309Snwhitehorn# common library maintenance symbols that are convenient for libtool scripts: 3616217309SnwhitehornLIB_CREATE='${AR} -cr' 3617217309SnwhitehornLIB_OBJECT='${OBJECTS}' 3618217309SnwhitehornLIB_SUFFIX=.a 3619217309SnwhitehornLIB_PREP="$RANLIB" 3620217309Snwhitehorn 3621217309Snwhitehorn# symbols used to prop libtool up to enable it to determine what it should be 3622217309Snwhitehorn# doing: 3623217309SnwhitehornLIB_CLEAN= 3624217309SnwhitehornLIB_COMPILE= 3625217309SnwhitehornLIB_LINK='${CC}' 3626217309SnwhitehornLIB_INSTALL= 3627217309SnwhitehornLIB_UNINSTALL= 3628217309Snwhitehorn 3629217309SnwhitehornAC_MSG_CHECKING(if you want to build libraries with libtool) 3630217309SnwhitehornAC_ARG_WITH(libtool, 3631217309Snwhitehorn [ --with-libtool generate libraries with libtool], 3632217309Snwhitehorn [with_libtool=$withval], 3633217309Snwhitehorn [with_libtool=no]) 3634217309SnwhitehornAC_MSG_RESULT($with_libtool) 3635217309Snwhitehornif test "$with_libtool" != "no"; then 3636217309Snwhitehornifdef([AC_PROG_LIBTOOL],[ 3637217309Snwhitehorn # missing_content_AC_PROG_LIBTOOL{{ 3638217309Snwhitehorn AC_PROG_LIBTOOL 3639217309Snwhitehorn # missing_content_AC_PROG_LIBTOOL}} 3640217309Snwhitehorn],[ 3641217309Snwhitehorn if test "$with_libtool" != "yes" ; then 3642217309Snwhitehorn CF_PATH_SYNTAX(with_libtool) 3643217309Snwhitehorn LIBTOOL=$with_libtool 3644217309Snwhitehorn else 3645217309Snwhitehorn AC_PATH_PROG(LIBTOOL,libtool) 3646217309Snwhitehorn fi 3647217309Snwhitehorn if test -z "$LIBTOOL" ; then 3648217309Snwhitehorn AC_MSG_ERROR(Cannot find libtool) 3649217309Snwhitehorn fi 3650217309Snwhitehorn])dnl 3651220749Snwhitehorn LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' 3652217309Snwhitehorn LIB_OBJECT='${OBJECTS:.o=.lo}' 3653217309Snwhitehorn LIB_SUFFIX=.la 3654217309Snwhitehorn LIB_CLEAN='${LIBTOOL} --mode=clean' 3655217309Snwhitehorn LIB_COMPILE='${LIBTOOL} --mode=compile' 3656217309Snwhitehorn LIB_LINK='${LIBTOOL} --mode=link ${CC} ${LIBTOOL_OPTS}' 3657217309Snwhitehorn LIB_INSTALL='${LIBTOOL} --mode=install' 3658217309Snwhitehorn LIB_UNINSTALL='${LIBTOOL} --mode=uninstall' 3659217309Snwhitehorn LIB_PREP=: 3660217309Snwhitehorn 3661217309Snwhitehorn # Show the version of libtool 3662217309Snwhitehorn AC_MSG_CHECKING(version of libtool) 3663217309Snwhitehorn 3664217309Snwhitehorn # Save the version in a cache variable - this is not entirely a good 3665217309Snwhitehorn # thing, but the version string from libtool is very ugly, and for 3666217309Snwhitehorn # bug reports it might be useful to have the original string. "(" 3667217309Snwhitehorn 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.]].*//'` 3668217309Snwhitehorn AC_MSG_RESULT($cf_cv_libtool_version) 3669217309Snwhitehorn if test -z "$cf_cv_libtool_version" ; then 3670217309Snwhitehorn AC_MSG_ERROR(This is not GNU libtool) 3671217309Snwhitehorn fi 3672217309Snwhitehorn 3673217309Snwhitehorn # special hack to add -no-undefined (which libtool should do for itself) 3674217309Snwhitehorn LT_UNDEF= 3675217309Snwhitehorn case "$cf_cv_system_name" in #(vi 3676217309Snwhitehorn cygwin*|mingw32*|uwin*|aix[[456]]) #(vi 3677217309Snwhitehorn LT_UNDEF=-no-undefined 3678217309Snwhitehorn ;; 3679217309Snwhitehorn esac 3680217309Snwhitehorn AC_SUBST([LT_UNDEF]) 3681217309Snwhitehorn 3682217309Snwhitehorn # special hack to add --tag option for C++ compiler 3683217309Snwhitehorn case $cf_cv_libtool_version in #(vi 3684217309Snwhitehorn 1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi 3685217309Snwhitehorn LIBTOOL_CXX="$LIBTOOL --tag=CXX" 3686217309Snwhitehorn LIBTOOL="$LIBTOOL --tag=CC" 3687217309Snwhitehorn ;; 3688217309Snwhitehorn *) 3689217309Snwhitehorn LIBTOOL_CXX="$LIBTOOL" 3690217309Snwhitehorn ;; 3691217309Snwhitehorn esac 3692217309Snwhitehornelse 3693217309Snwhitehorn LIBTOOL="" 3694217309Snwhitehorn LIBTOOL_CXX="" 3695217309Snwhitehornfi 3696217309Snwhitehorn 3697217309Snwhitehorntest -z "$LIBTOOL" && ECHO_LT= 3698217309Snwhitehorn 3699217309SnwhitehornAC_SUBST(LIBTOOL) 3700217309SnwhitehornAC_SUBST(LIBTOOL_CXX) 3701217309SnwhitehornAC_SUBST(LIBTOOL_OPTS) 3702217309Snwhitehorn 3703217309SnwhitehornAC_SUBST(LIB_CREATE) 3704217309SnwhitehornAC_SUBST(LIB_OBJECT) 3705217309SnwhitehornAC_SUBST(LIB_SUFFIX) 3706217309SnwhitehornAC_SUBST(LIB_PREP) 3707217309Snwhitehorn 3708217309SnwhitehornAC_SUBST(LIB_CLEAN) 3709217309SnwhitehornAC_SUBST(LIB_COMPILE) 3710217309SnwhitehornAC_SUBST(LIB_LINK) 3711217309SnwhitehornAC_SUBST(LIB_INSTALL) 3712217309SnwhitehornAC_SUBST(LIB_UNINSTALL) 3713217309Snwhitehorn 3714217309Snwhitehorn])dnl 3715217309Snwhitehorndnl --------------------------------------------------------------------------- 3716217309Snwhitehorndnl CF_WITH_LIBTOOL_OPTS version: 2 updated: 2007/04/08 18:14:54 3717217309Snwhitehorndnl -------------------- 3718217309Snwhitehorndnl Allow user to pass additional libtool options into the library creation 3719217309Snwhitehorndnl and link steps. The main use for this is to do something like 3720217309Snwhitehorndnl ./configure --with-libtool-opts=-static 3721217309Snwhitehorndnl to get the same behavior as automake-flavored 3722217309Snwhitehorndnl ./configure --enable-static 3723217309SnwhitehornAC_DEFUN([CF_WITH_LIBTOOL_OPTS],[ 3724217309SnwhitehornAC_MSG_CHECKING(for additional libtool options) 3725217309SnwhitehornAC_ARG_WITH(libtool-opts, 3726217309Snwhitehorn [ --with-libtool-opts=XXX specify additional libtool options], 3727217309Snwhitehorn [with_libtool_opts=$withval], 3728217309Snwhitehorn [with_libtool_opts=no]) 3729217309SnwhitehornAC_MSG_RESULT($with_libtool_opts) 3730217309Snwhitehorn 3731217309Snwhitehorncase .$with_libtool_opts in 3732217309Snwhitehorn.yes|.no|.) 3733217309Snwhitehorn ;; 3734217309Snwhitehorn*) 3735217309Snwhitehorn LIBTOOL_OPTS=$with_libtool_opts 3736217309Snwhitehorn ;; 3737217309Snwhitehornesac 3738217309Snwhitehorn 3739217309SnwhitehornAC_SUBST(LIBTOOL_OPTS) 3740217309Snwhitehorn])dnl 3741217309Snwhitehorndnl --------------------------------------------------------------------------- 3742217309Snwhitehorndnl CF_WITH_NO_LEAKS version: 1 updated: 2006/12/14 18:00:21 3743217309Snwhitehorndnl ---------------- 3744217309SnwhitehornAC_DEFUN([CF_WITH_NO_LEAKS],[ 3745217309Snwhitehorn 3746217309SnwhitehornAC_REQUIRE([CF_WITH_DMALLOC]) 3747217309SnwhitehornAC_REQUIRE([CF_WITH_DBMALLOC]) 3748217309SnwhitehornAC_REQUIRE([CF_WITH_PURIFY]) 3749217309SnwhitehornAC_REQUIRE([CF_WITH_VALGRIND]) 3750217309Snwhitehorn 3751217309SnwhitehornAC_MSG_CHECKING(if you want to perform memory-leak testing) 3752217309SnwhitehornAC_ARG_WITH(no-leaks, 3753217309Snwhitehorn [ --with-no-leaks test: free permanent memory, analyze leaks], 3754217309Snwhitehorn [AC_DEFINE(NO_LEAKS) 3755217309Snwhitehorn cf_doalloc=".${with_dmalloc}${with_dbmalloc}${with_purify}${with_valgrind}" 3756217309Snwhitehorn case ${cf_doalloc} in #(vi 3757217309Snwhitehorn *yes*) ;; 3758217309Snwhitehorn *) AC_DEFINE(DOALLOC,10000) ;; 3759217309Snwhitehorn esac 3760217309Snwhitehorn with_no_leaks=yes], 3761217309Snwhitehorn [with_no_leaks=]) 3762217309SnwhitehornAC_MSG_RESULT($with_no_leaks) 3763217309Snwhitehorn])dnl 3764217309Snwhitehorndnl --------------------------------------------------------------------------- 3765217309Snwhitehorndnl CF_WITH_PURIFY version: 2 updated: 2006/12/14 18:43:43 3766217309Snwhitehorndnl -------------- 3767217309SnwhitehornAC_DEFUN([CF_WITH_PURIFY],[ 3768217309SnwhitehornCF_NO_LEAKS_OPTION(purify, 3769217309Snwhitehorn [ --with-purify test: use Purify], 3770217309Snwhitehorn [USE_PURIFY], 3771217309Snwhitehorn [LINK_PREFIX="$LINK_PREFIX purify"]) 3772217309SnwhitehornAC_SUBST(LINK_PREFIX) 3773217309Snwhitehorn])dnl 3774217309Snwhitehorndnl --------------------------------------------------------------------------- 3775217309Snwhitehorndnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21 3776217309Snwhitehorndnl ---------------- 3777217309SnwhitehornAC_DEFUN([CF_WITH_VALGRIND],[ 3778217309SnwhitehornCF_NO_LEAKS_OPTION(valgrind, 3779217309Snwhitehorn [ --with-valgrind test: use valgrind], 3780217309Snwhitehorn [USE_VALGRIND]) 3781217309Snwhitehorn])dnl 3782217309Snwhitehorndnl --------------------------------------------------------------------------- 3783217309Snwhitehorndnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34 3784217309Snwhitehorndnl ---------------- 3785217309Snwhitehorndnl Combine the checks for gcc features into a configure-script option 3786217309Snwhitehorndnl 3787217309Snwhitehorndnl Parameters: 3788217309Snwhitehorndnl $1 - see CF_GCC_WARNINGS 3789217309SnwhitehornAC_DEFUN([CF_WITH_WARNINGS], 3790217309Snwhitehorn[ 3791217309Snwhitehornif ( test "$GCC" = yes || test "$GXX" = yes ) 3792217309Snwhitehornthen 3793217309SnwhitehornAC_MSG_CHECKING(if you want to check for gcc warnings) 3794217309SnwhitehornAC_ARG_WITH(warnings, 3795217309Snwhitehorn [ --with-warnings test: turn on gcc warnings], 3796217309Snwhitehorn [cf_opt_with_warnings=$withval], 3797217309Snwhitehorn [cf_opt_with_warnings=no]) 3798217309SnwhitehornAC_MSG_RESULT($cf_opt_with_warnings) 3799217309Snwhitehornif test "$cf_opt_with_warnings" != no ; then 3800217309Snwhitehorn CF_GCC_ATTRIBUTES 3801217309Snwhitehorn CF_GCC_WARNINGS([$1]) 3802217309Snwhitehornfi 3803217309Snwhitehornfi 3804217309Snwhitehorn])dnl 3805217309Snwhitehorndnl --------------------------------------------------------------------------- 3806220749Snwhitehorndnl CF_XOPEN_CURSES version: 11 updated: 2011/01/18 18:15:30 3807217309Snwhitehorndnl --------------- 3808217309Snwhitehorndnl Test if we should define X/Open source for curses, needed on Digital Unix 3809217309Snwhitehorndnl 4.x, to see the extended functions, but breaks on IRIX 6.x. 3810217309Snwhitehorndnl 3811217309Snwhitehorndnl The getbegyx() check is needed for HPUX, which omits legacy macros such 3812217309Snwhitehorndnl as getbegy(). The latter is better design, but the former is standard. 3813217309SnwhitehornAC_DEFUN([CF_XOPEN_CURSES], 3814217309Snwhitehorn[ 3815217309SnwhitehornAC_REQUIRE([CF_CURSES_CPPFLAGS])dnl 3816217309SnwhitehornAC_CACHE_CHECK(if we must define _XOPEN_SOURCE_EXTENDED,cf_cv_need_xopen_extension,[ 3817217309SnwhitehornAC_TRY_LINK([ 3818217309Snwhitehorn#include <stdlib.h> 3819220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}>],[ 3820217309Snwhitehorn#if defined(NCURSES_VERSION_PATCH) 3821220749Snwhitehorn#if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403) 3822217309Snwhitehorn make an error 3823217309Snwhitehorn#endif 3824217309Snwhitehorn#endif 3825217309Snwhitehorn long x = winnstr(stdscr, "", 0); 3826217309Snwhitehorn int x1, y1; 3827217309Snwhitehorn getbegyx(stdscr, y1, x1)], 3828217309Snwhitehorn [cf_cv_need_xopen_extension=no], 3829217309Snwhitehorn [AC_TRY_LINK([ 3830217309Snwhitehorn#define _XOPEN_SOURCE_EXTENDED 3831217309Snwhitehorn#include <stdlib.h> 3832220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}>],[ 3833217309Snwhitehorn#ifdef NCURSES_VERSION 3834217309Snwhitehorn cchar_t check; 3835217309Snwhitehorn int check2 = curs_set((int)sizeof(check)); 3836217309Snwhitehorn#endif 3837217309Snwhitehorn long x = winnstr(stdscr, "", 0); 3838217309Snwhitehorn int x1, y1; 3839217309Snwhitehorn getbegyx(stdscr, y1, x1)], 3840217309Snwhitehorn [cf_cv_need_xopen_extension=yes], 3841217309Snwhitehorn [cf_cv_need_xopen_extension=unknown])])]) 3842217309Snwhitehorntest $cf_cv_need_xopen_extension = yes && CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" 3843217309Snwhitehorn])dnl 3844217309Snwhitehorndnl --------------------------------------------------------------------------- 3845220749Snwhitehorndnl CF_XOPEN_SOURCE version: 34 updated: 2010/05/26 05:38:42 3846217309Snwhitehorndnl --------------- 3847217309Snwhitehorndnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, 3848217309Snwhitehorndnl or adapt to the vendor's definitions to get equivalent functionality, 3849217309Snwhitehorndnl without losing the common non-POSIX features. 3850217309Snwhitehorndnl 3851217309Snwhitehorndnl Parameters: 3852217309Snwhitehorndnl $1 is the nominal value for _XOPEN_SOURCE 3853217309Snwhitehorndnl $2 is the nominal value for _POSIX_C_SOURCE 3854217309SnwhitehornAC_DEFUN([CF_XOPEN_SOURCE],[ 3855217309Snwhitehorn 3856220749Snwhitehorncf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) 3857220749Snwhitehorncf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) 3858217309Snwhitehorncf_xopen_source= 3859217309Snwhitehorn 3860217309Snwhitehorncase $host_os in #(vi 3861217309Snwhitehornaix[[456]]*) #(vi 3862217309Snwhitehorn cf_xopen_source="-D_ALL_SOURCE" 3863217309Snwhitehorn ;; 3864217309Snwhitehorndarwin[[0-8]].*) #(vi 3865217309Snwhitehorn cf_xopen_source="-D_APPLE_C_SOURCE" 3866217309Snwhitehorn ;; 3867217309Snwhitehorndarwin*) #(vi 3868217309Snwhitehorn cf_xopen_source="-D_DARWIN_C_SOURCE" 3869217309Snwhitehorn ;; 3870217309Snwhitehornfreebsd*|dragonfly*) #(vi 3871217309Snwhitehorn # 5.x headers associate 3872217309Snwhitehorn # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L 3873217309Snwhitehorn # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L 3874217309Snwhitehorn cf_POSIX_C_SOURCE=200112L 3875217309Snwhitehorn cf_XOPEN_SOURCE=600 3876217309Snwhitehorn cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" 3877217309Snwhitehorn ;; 3878217309Snwhitehornhpux11*) #(vi 3879217309Snwhitehorn cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" 3880217309Snwhitehorn ;; 3881217309Snwhitehornhpux*) #(vi 3882217309Snwhitehorn cf_xopen_source="-D_HPUX_SOURCE" 3883217309Snwhitehorn ;; 3884217309Snwhitehornirix[[56]].*) #(vi 3885217309Snwhitehorn cf_xopen_source="-D_SGI_SOURCE" 3886217309Snwhitehorn ;; 3887217309Snwhitehornlinux*|gnu*|mint*|k*bsd*-gnu) #(vi 3888217309Snwhitehorn CF_GNU_SOURCE 3889217309Snwhitehorn ;; 3890217309Snwhitehornmirbsd*) #(vi 3891217309Snwhitehorn # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <arpa/inet.h> 3892217309Snwhitehorn ;; 3893217309Snwhitehornnetbsd*) #(vi 3894217309Snwhitehorn # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw 3895217309Snwhitehorn ;; 3896217309Snwhitehornopenbsd*) #(vi 3897217309Snwhitehorn # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw 3898217309Snwhitehorn ;; 3899217309Snwhitehornosf[[45]]*) #(vi 3900217309Snwhitehorn cf_xopen_source="-D_OSF_SOURCE" 3901217309Snwhitehorn ;; 3902217309Snwhitehornnto-qnx*) #(vi 3903217309Snwhitehorn cf_xopen_source="-D_QNX_SOURCE" 3904217309Snwhitehorn ;; 3905217309Snwhitehornsco*) #(vi 3906217309Snwhitehorn # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer 3907217309Snwhitehorn ;; 3908217309Snwhitehornsolaris2.1[[0-9]]) #(vi 3909217309Snwhitehorn cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" 3910217309Snwhitehorn ;; 3911217309Snwhitehornsolaris2.[[1-9]]) #(vi 3912217309Snwhitehorn cf_xopen_source="-D__EXTENSIONS__" 3913217309Snwhitehorn ;; 3914217309Snwhitehorn*) 3915217309Snwhitehorn AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ 3916217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 3917217309Snwhitehorn#ifndef _XOPEN_SOURCE 3918217309Snwhitehornmake an error 3919217309Snwhitehorn#endif], 3920217309Snwhitehorn [cf_cv_xopen_source=no], 3921217309Snwhitehorn [cf_save="$CPPFLAGS" 3922217309Snwhitehorn CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" 3923217309Snwhitehorn AC_TRY_COMPILE([#include <sys/types.h>],[ 3924217309Snwhitehorn#ifdef _XOPEN_SOURCE 3925217309Snwhitehornmake an error 3926217309Snwhitehorn#endif], 3927217309Snwhitehorn [cf_cv_xopen_source=no], 3928217309Snwhitehorn [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) 3929217309Snwhitehorn CPPFLAGS="$cf_save" 3930217309Snwhitehorn ]) 3931217309Snwhitehorn]) 3932217309Snwhitehorn if test "$cf_cv_xopen_source" != no ; then 3933217309Snwhitehorn CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) 3934217309Snwhitehorn CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) 3935217309Snwhitehorn cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" 3936217309Snwhitehorn CF_ADD_CFLAGS($cf_temp_xopen_source) 3937217309Snwhitehorn fi 3938217309Snwhitehorn CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) 3939217309Snwhitehorn ;; 3940217309Snwhitehornesac 3941217309Snwhitehorn 3942217309Snwhitehornif test -n "$cf_xopen_source" ; then 3943217309Snwhitehorn CF_ADD_CFLAGS($cf_xopen_source) 3944217309Snwhitehornfi 3945217309Snwhitehorn]) 3946217309Snwhitehorndnl --------------------------------------------------------------------------- 3947220749Snwhitehorndnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49 3948217309Snwhitehorndnl --------------- 3949217309Snwhitehorndnl Define a reusable chunk which includes <curses.h> and <term.h> when they 3950217309Snwhitehorndnl are both available. 3951217309Snwhitehorndefine([CF__CURSES_HEAD],[ 3952217309Snwhitehorn#ifdef HAVE_XCURSES 3953217309Snwhitehorn#include <xcurses.h> 3954217309Snwhitehornchar * XCursesProgramName = "test"; 3955217309Snwhitehorn#else 3956220749Snwhitehorn#include <${cf_cv_ncurses_header:-curses.h}> 3957217309Snwhitehorn#if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) 3958217309Snwhitehorn#include <ncursesw/term.h> 3959217309Snwhitehorn#elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) 3960217309Snwhitehorn#include <ncurses/term.h> 3961217309Snwhitehorn#elif defined(HAVE_TERM_H) 3962217309Snwhitehorn#include <term.h> 3963217309Snwhitehorn#endif 3964217309Snwhitehorn#endif 3965217309Snwhitehorn]) 3966217309Snwhitehorndnl --------------------------------------------------------------------------- 3967217309Snwhitehorndnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47 3968217309Snwhitehorndnl -------------- 3969217309Snwhitehorndnl Test-code needed for iconv compile-checks 3970217309Snwhitehorndefine([CF__ICONV_BODY],[ 3971217309Snwhitehorn iconv_t cd = iconv_open("",""); 3972217309Snwhitehorn iconv(cd,NULL,NULL,NULL,NULL); 3973217309Snwhitehorn iconv_close(cd);] 3974217309Snwhitehorn)dnl 3975217309Snwhitehorndnl --------------------------------------------------------------------------- 3976217309Snwhitehorndnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03 3977217309Snwhitehorndnl -------------- 3978217309Snwhitehorndnl Header-files needed for iconv compile-checks 3979217309Snwhitehorndefine([CF__ICONV_HEAD],[ 3980217309Snwhitehorn#include <stdlib.h> 3981217309Snwhitehorn#include <iconv.h>] 3982217309Snwhitehorn)dnl 3983217309Snwhitehorndnl --------------------------------------------------------------------------- 3984217309Snwhitehorndnl CF__INTL_BODY version: 1 updated: 2007/07/26 17:35:47 3985217309Snwhitehorndnl ------------- 3986217309Snwhitehorndnl Test-code needed for libintl compile-checks 3987217309Snwhitehorndnl $1 = parameter 2 from AM_WITH_NLS 3988217309Snwhitehorndefine([CF__INTL_BODY],[ 3989217309Snwhitehorn bindtextdomain ("", ""); 3990217309Snwhitehorn return (int) gettext ("") 3991217309Snwhitehorn ifelse([$1], need-ngettext, [ + (int) ngettext ("", "", 0)], []) 3992217309Snwhitehorn [ + _nl_msg_cat_cntr] 3993217309Snwhitehorn]) 3994217309Snwhitehorndnl --------------------------------------------------------------------------- 3995217309Snwhitehorndnl CF__INTL_HEAD version: 1 updated: 2007/07/26 17:35:47 3996217309Snwhitehorndnl ------------- 3997217309Snwhitehorndnl Header-files needed for libintl compile-checks 3998217309Snwhitehorndefine([CF__INTL_HEAD],[ 3999217309Snwhitehorn#include <libintl.h> 4000217309Snwhitehornextern int _nl_msg_cat_cntr; 4001217309Snwhitehorn])dnl 4002217309Snwhitehorndnl --------------------------------------------------------------------------- 4003217309Snwhitehorndnl jm_GLIBC21 version: 3 updated: 2002/10/27 23:21:42 4004217309Snwhitehorndnl ---------- 4005217309Snwhitehorndnl Inserted as requested by gettext 0.10.40 4006217309Snwhitehorndnl File from /usr/share/aclocal 4007217309Snwhitehorndnl glibc21.m4 4008217309Snwhitehorndnl ==================== 4009217309Snwhitehorndnl serial 2 4010217309Snwhitehorndnl 4011217309Snwhitehorndnl Test for the GNU C Library, version 2.1 or newer. 4012217309Snwhitehorndnl From Bruno Haible. 4013217309SnwhitehornAC_DEFUN([jm_GLIBC21], 4014217309Snwhitehorn [ 4015217309Snwhitehorn AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer, 4016217309Snwhitehorn ac_cv_gnu_library_2_1, 4017217309Snwhitehorn [AC_EGREP_CPP([Lucky GNU user], 4018217309Snwhitehorn [ 4019217309Snwhitehorn#include <features.h> 4020217309Snwhitehorn#ifdef __GNU_LIBRARY__ 4021217309Snwhitehorn #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2) 4022217309Snwhitehorn Lucky GNU user 4023217309Snwhitehorn #endif 4024217309Snwhitehorn#endif 4025217309Snwhitehorn ], 4026217309Snwhitehorn ac_cv_gnu_library_2_1=yes, 4027217309Snwhitehorn ac_cv_gnu_library_2_1=no) 4028217309Snwhitehorn ] 4029217309Snwhitehorn ) 4030217309Snwhitehorn AC_SUBST(GLIBC21) 4031217309Snwhitehorn GLIBC21="$ac_cv_gnu_library_2_1" 4032217309Snwhitehorn ] 4033217309Snwhitehorn) 4034