1 dnl macros used for DIALOG configure script
2 dnl $Id: aclocal.m4,v 1.120 2018/06/21 00:30:26 tom Exp $
3 dnl ---------------------------------------------------------------------------
4 dnl Copyright 1999-2017,2018 -- Thomas E. Dickey
6 dnl Permission is hereby granted, free of charge, to any person obtaining a
7 dnl copy of this software and associated documentation files (the
8 dnl "Software"), to deal in the Software without restriction, including
9 dnl without limitation the rights to use, copy, modify, merge, publish,
10 dnl distribute, distribute with modifications, sublicense, and/or sell
11 dnl copies of the Software, and to permit persons to whom the Software is
12 dnl furnished to do so, subject to the following conditions:
14 dnl The above copyright notice and this permission notice shall be included
15 dnl in all copies or portions of the Software.
17 dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
21 dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
22 dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
23 dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 dnl Except as contained in this notice, the name(s) of the above copyright
26 dnl holders shall not be used in advertising or otherwise to promote the
27 dnl sale, use or other dealings in this Software without prior written
31 dnl http://invisible-island.net/autoconf/
32 dnl ---------------------------------------------------------------------------
33 dnl ---------------------------------------------------------------------------
34 dnl AM_GNU_GETTEXT version: 14 updated: 2015/04/15 19:08:48
36 dnl Usage: Just like AM_WITH_NLS, which see.
37 AC_DEFUN([AM_GNU_GETTEXT],
38 [AC_REQUIRE([AC_PROG_MAKE_SET])dnl
39 AC_REQUIRE([AC_CANONICAL_HOST])dnl
40 AC_REQUIRE([AC_PROG_RANLIB])dnl
41 AC_REQUIRE([AC_HEADER_STDC])dnl
42 AC_REQUIRE([AC_C_INLINE])dnl
43 AC_REQUIRE([AC_TYPE_OFF_T])dnl
44 AC_REQUIRE([AC_TYPE_SIZE_T])dnl
45 AC_REQUIRE([AC_FUNC_ALLOCA])dnl
46 AC_REQUIRE([AC_FUNC_MMAP])dnl
47 AC_REQUIRE([jm_GLIBC21])dnl
48 AC_REQUIRE([CF_PROG_CC])dnl
50 AC_CHECK_HEADERS([argz.h limits.h locale.h nl_types.h malloc.h stddef.h \
51 stdlib.h string.h unistd.h sys/param.h])
52 AC_CHECK_FUNCS([feof_unlocked fgets_unlocked getcwd getegid geteuid \
53 getgid getuid mempcpy munmap putenv setenv setlocale stpcpy strchr strcasecmp \
54 strdup strtoul tsearch __argz_count __argz_stringify __argz_next])
59 AM_WITH_NLS([$1],[$2],[$3],[$4])
61 if test "x$CATOBJEXT" != "x"; then
62 if test "x$ALL_LINGUAS" = "x"; then
65 AC_MSG_CHECKING(for catalogs to be installed)
67 for presentlang in $ALL_LINGUAS; do
69 for desiredlang in ${LINGUAS-$ALL_LINGUAS}; do
70 # Use the presentlang catalog if desiredlang is
71 # a. equal to presentlang, or
72 # b. a variant of presentlang (because in this case,
73 # presentlang can be used as a fallback for messages
74 # which are not translated in the desiredlang catalog).
75 case "$desiredlang" in
76 ("$presentlang"*) useit=yes;;
79 if test $useit = yes; then
80 NEW_LINGUAS="$NEW_LINGUAS $presentlang"
84 AC_MSG_RESULT($LINGUAS)
87 dnl Construct list of names of catalog files to be constructed.
88 if test -n "$LINGUAS"; then
89 for lang in $LINGUAS; do CATALOGS="$CATALOGS $lang$CATOBJEXT"; done
93 dnl Enable libtool support if the surrounding package wishes it.
94 INTL_LIBTOOL_SUFFIX_PREFIX=ifelse([$1], use-libtool, [l], [])
95 AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX)
97 dnl ---------------------------------------------------------------------------
98 dnl AM_ICONV version: 12 updated: 2007/07/30 19:12:03
100 dnl Inserted as requested by gettext 0.10.40
101 dnl File from /usr/share/aclocal
103 dnl ====================
106 dnl From Bruno Haible.
108 dnl ====================
109 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
110 dnl range of locations searched. Retain the same cache-variable naming to
111 dnl allow reuse with the other gettext macros -Thomas E Dickey
114 dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and
115 dnl those with the standalone portable GNU libiconv installed).
117 AC_ARG_WITH([libiconv-prefix],
118 [ --with-libiconv-prefix=DIR
119 search for libiconv in DIR/include and DIR/lib], [
120 CF_ADD_OPTIONAL_PATH($withval, libiconv)
123 AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [
124 CF_FIND_LINKAGE(CF__ICONV_HEAD,
127 am_cv_func_iconv=yes,
128 am_cv_func_iconv=["no, consider installing GNU libiconv"])])
130 if test "$am_cv_func_iconv" = yes; then
131 AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.])
133 AC_CACHE_CHECK([if the declaration of iconv() needs const.],
134 am_cv_proto_iconv_const,[
135 AC_TRY_COMPILE(CF__ICONV_HEAD [
140 #if defined(__STDC__) || defined(__cplusplus)
141 size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
145 ],[], am_cv_proto_iconv_const=no,
146 am_cv_proto_iconv_const=yes)])
148 if test "$am_cv_proto_iconv_const" = yes ; then
149 am_cv_proto_iconv_arg1="const"
151 am_cv_proto_iconv_arg1=""
154 AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1,
155 [Define as const if the declaration of iconv() needs const.])
159 if test "$cf_cv_find_linkage_iconv" = yes; then
160 CF_ADD_INCDIR($cf_cv_header_path_iconv)
161 if test -n "$cf_cv_library_file_iconv" ; then
163 CF_ADD_LIBDIR($cf_cv_library_path_iconv)
169 dnl ---------------------------------------------------------------------------
170 dnl AM_LANGINFO_CODESET version: 4 updated: 2015/04/18 08:56:57
171 dnl -------------------
172 dnl Inserted as requested by gettext 0.10.40
173 dnl File from /usr/share/aclocal
175 dnl ====================
178 dnl From Bruno Haible.
179 AC_DEFUN([AM_LANGINFO_CODESET],
181 AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset,
182 [AC_TRY_LINK([#include <langinfo.h>],
183 [char* cs = nl_langinfo(CODESET);],
184 am_cv_langinfo_codeset=yes,
185 am_cv_langinfo_codeset=no)
187 if test $am_cv_langinfo_codeset = yes; then
188 AC_DEFINE(HAVE_LANGINFO_CODESET, 1,
189 [Define if you have <langinfo.h> and nl_langinfo(CODESET).])
192 dnl ---------------------------------------------------------------------------
193 dnl AM_LC_MESSAGES version: 5 updated: 2015/05/10 19:52:14
195 dnl Inserted as requested by gettext 0.10.40
196 dnl File from /usr/share/aclocal
198 dnl ====================
199 dnl Check whether LC_MESSAGES is available in <locale.h>.
200 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
202 dnl This file can be copied and used freely without restrictions. It can
203 dnl be used in projects which are not available under the GNU General Public
204 dnl License or the GNU Library General Public License but which still want
205 dnl to provide support for the GNU gettext functionality.
206 dnl Please note that the actual code of the GNU gettext library is covered
207 dnl by the GNU Library General Public License, and the rest of the GNU
208 dnl gettext package package is covered by the GNU General Public License.
209 dnl They are *not* in the public domain.
213 AC_DEFUN([AM_LC_MESSAGES],
214 [if test $ac_cv_header_locale_h = yes; then
215 AC_CACHE_CHECK([for LC_MESSAGES], am_cv_val_LC_MESSAGES,
216 [AC_TRY_LINK([#include <locale.h>], [return LC_MESSAGES],
217 am_cv_val_LC_MESSAGES=yes, am_cv_val_LC_MESSAGES=no)])
218 if test $am_cv_val_LC_MESSAGES = yes; then
219 AC_DEFINE(HAVE_LC_MESSAGES, 1,
220 [Define if your <locale.h> file defines LC_MESSAGES.])
223 dnl ---------------------------------------------------------------------------
224 dnl AM_PATH_PROG_WITH_TEST version: 9 updated: 2015/04/15 19:08:48
225 dnl ----------------------
226 dnl Inserted as requested by gettext 0.10.40
227 dnl File from /usr/share/aclocal
229 dnl ====================
230 dnl Search path for a program which passes the given test.
231 dnl Ulrich Drepper <drepper@cygnus.com>, 1996.
233 dnl This file can be copied and used freely without restrictions. It can
234 dnl be used in projects which are not available under the GNU General Public
235 dnl License or the GNU Library General Public License but which still want
236 dnl to provide support for the GNU gettext functionality.
237 dnl Please note that the actual code of the GNU gettext library is covered
238 dnl by the GNU Library General Public License, and the rest of the GNU
239 dnl gettext package package is covered by the GNU General Public License.
240 dnl They are *not* in the public domain.
244 dnl AM_PATH_PROG_WITH_TEST(VARIABLE, PROG-TO-CHECK-FOR,
245 dnl TEST-PERFORMED-ON-FOUND_PROGRAM [, VALUE-IF-NOT-FOUND [, PATH]])
246 AC_DEFUN([AM_PATH_PROG_WITH_TEST],
247 [# Extract the first word of "$2", so it can be a program name with args.
248 AC_REQUIRE([CF_PATHSEP])
249 set dummy $2; ac_word=[$]2
250 AC_MSG_CHECKING([for $ac_word])
251 AC_CACHE_VAL(ac_cv_path_$1,
254 ac_cv_path_$1="[$]$1" # Let the user override the test with a path.
257 IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}"
258 for ac_dir in ifelse([$5], , $PATH, [$5]); do
259 test -z "$ac_dir" && ac_dir=.
260 if test -f $ac_dir/$ac_word$ac_exeext; then
262 ac_cv_path_$1="$ac_dir/$ac_word$ac_exeext"
268 dnl If no 4th arg is given, leave the cache variable unset,
269 dnl so AC_PATH_PROGS will keep looking.
270 ifelse([$4], , , [ test -z "[$]ac_cv_path_$1" && ac_cv_path_$1="$4"
275 if test ifelse([$4], , [-n "[$]$1"], ["[$]$1" != "$4"]); then
282 dnl ---------------------------------------------------------------------------
283 dnl AM_WITH_NLS version: 29 updated: 2018/02/21 21:26:03
285 dnl Inserted as requested by gettext 0.10.40
286 dnl File from /usr/share/aclocal
288 dnl ====================
289 dnl Macro to add for using GNU gettext.
290 dnl Ulrich Drepper <drepper@cygnus.com>, 1995.
291 dnl ====================
292 dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the
293 dnl range of locations searched. Retain the same cache-variable naming to
294 dnl allow reuse with the other gettext macros -Thomas E Dickey
295 dnl ====================
297 dnl This file can be copied and used freely without restrictions. It can
298 dnl be used in projects which are not available under the GNU General Public
299 dnl License or the GNU Library General Public License but which still want
300 dnl to provide support for the GNU gettext functionality.
301 dnl Please note that the actual code of the GNU gettext library is covered
302 dnl by the GNU Library General Public License, and the rest of the GNU
303 dnl gettext package package is covered by the GNU General Public License.
304 dnl They are *not* in the public domain.
308 dnl Usage: AM_WITH_NLS([TOOLSYMBOL], [NEEDSYMBOL], [LIBDIR], [ENABLED]).
309 dnl If TOOLSYMBOL is specified and is 'use-libtool', then a libtool library
310 dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static,
311 dnl depending on --{enable,disable}-{shared,static} and on the presence of
312 dnl AM-DISABLE-SHARED). Otherwise, a static library
313 dnl $(top_builddir)/intl/libintl.a will be created.
314 dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext
315 dnl implementations (in libc or libintl) without the ngettext() function
317 dnl LIBDIR is used to find the intl libraries. If empty,
318 dnl the value `$(top_builddir)/intl/' is used.
319 dnl ENABLED is used to control the default for the related --enable-nls, since
320 dnl not all application developers want this feature by default, e.g., lynx.
322 dnl The result of the configuration is one of three cases:
323 dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled
325 dnl Catalog format: GNU --> install in $(datadir)
326 dnl Catalog extension: .mo after installation, .gmo in source tree
327 dnl 2) GNU gettext has been found in the system's C library.
328 dnl Catalog format: GNU --> install in $(datadir)
329 dnl Catalog extension: .mo after installation, .gmo in source tree
330 dnl 3) No internationalization, always use English msgid.
331 dnl Catalog format: none
332 dnl Catalog extension: none
333 dnl The use of .gmo is historical (it was needed to avoid overwriting the
334 dnl GNU format catalogs when building on a platform with an X/Open gettext),
335 dnl but we keep it in order not to force irrelevant filename changes on the
338 AC_DEFUN([AM_WITH_NLS],
339 [AC_MSG_CHECKING([whether NLS is requested])
340 dnl Default is enabled NLS
343 [ --disable-nls do not use Native Language Support],
344 USE_NLS=$enableval, USE_NLS=yes)],[
346 [ --enable-nls use Native Language Support],
347 USE_NLS=$enableval, USE_NLS=no)])
348 AC_MSG_RESULT($USE_NLS)
351 BUILD_INCLUDED_LIBINTL=no
352 USE_INCLUDED_LIBINTL=no
355 dnl If we use NLS figure out what method
356 if test "$USE_NLS" = "yes"; then
357 dnl We need to process the po/ directory.
359 AC_DEFINE(ENABLE_NLS, 1,
360 [Define to 1 if translation of program messages to the user's native language
362 AC_MSG_CHECKING([whether included gettext is requested])
363 AC_ARG_WITH(included-gettext,
364 [ --with-included-gettext use the GNU gettext library included here],
365 nls_cv_force_use_gnu_gettext=$withval,
366 nls_cv_force_use_gnu_gettext=no)
367 AC_MSG_RESULT($nls_cv_force_use_gnu_gettext)
369 nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext"
370 if test "$nls_cv_force_use_gnu_gettext" != "yes"; then
371 dnl User does not insist on using GNU NLS library. Figure out what
372 dnl to use. If GNU gettext is available we use this. Else we may have
373 dnl to fall back to GNU NLS library.
376 dnl Save these (possibly-set) variables for reference. If the user
377 dnl overrode these to provide full pathnames, then warn if not actually
378 dnl GNU gettext, but do not override their values. Also, if they were
379 dnl overridden, suppress the part of the library test which prevents it
380 dnl from finding anything other than GNU gettext. Doing this also
381 dnl suppresses a bogus search for the intl library.
382 cf_save_msgfmt_path="$MSGFMT"
383 cf_save_xgettext_path="$XGETTEXT"
385 dnl Search for GNU msgfmt in the PATH.
386 AM_PATH_PROG_WITH_TEST(MSGFMT, msgfmt,
387 [$ac_dir/$ac_word --statistics /dev/null >/dev/null 2>&1], :)
388 AC_PATH_PROG(GMSGFMT, gmsgfmt, $MSGFMT)
391 dnl Search for GNU xgettext in the PATH.
392 AM_PATH_PROG_WITH_TEST(XGETTEXT, xgettext,
393 [$ac_dir/$ac_word --omit-header /dev/null >/dev/null 2>&1], :)
395 cf_save_OPTS_1="$CPPFLAGS"
396 if test "x$cf_save_msgfmt_path" = "x$MSGFMT" && \
397 test "x$cf_save_xgettext_path" = "x$XGETTEXT" ; then
398 CF_ADD_CFLAGS(-DIGNORE_MSGFMT_HACK)
401 cf_save_LIBS_1="$LIBS"
402 CF_ADD_LIBS($LIBICONV)
404 CF_FIND_LINKAGE(CF__INTL_HEAD,
407 cf_cv_func_gettext=yes,
408 cf_cv_func_gettext=no)
410 AC_MSG_CHECKING([for libintl.h and gettext()])
411 AC_MSG_RESULT($cf_cv_func_gettext)
413 LIBS="$cf_save_LIBS_1"
414 CPPFLAGS="$cf_save_OPTS_1"
416 if test "$cf_cv_func_gettext" = yes ; then
417 AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have libintl.h])
419 dnl If an already present or preinstalled GNU gettext() is found,
420 dnl use it. But if this macro is used in GNU gettext, and GNU
421 dnl gettext is already preinstalled in libintl, we update this
422 dnl libintl. (Cf. the install rule in intl/Makefile.in.)
423 if test "$PACKAGE" != gettext; then
424 AC_DEFINE(HAVE_GETTEXT, 1,
425 [Define if the GNU gettext() function is already present or preinstalled.])
427 CF_ADD_INCDIR($cf_cv_header_path_intl)
429 if test -n "$cf_cv_library_file_intl" ; then
430 dnl If iconv() is in a separate libiconv library, then anyone
431 dnl linking with libintl{.a,.so} also needs to link with
433 INTLLIBS="$cf_cv_library_file_intl $LIBICONV"
434 CF_ADD_LIBDIR($cf_cv_library_path_intl,INTLLIBS)
438 LIBS="$LIBS $INTLLIBS"
439 AC_CHECK_FUNCS(dcgettext)
444 elif test -z "$MSGFMT" || test -z "$XGETTEXT" ; then
445 AC_MSG_WARN(disabling NLS feature)
446 sed -e /ENABLE_NLS/d confdefs.h >confdefs.tmp
447 mv confdefs.tmp confdefs.h
454 BUILD_INCLUDED_LIBINTL=no
455 USE_INCLUDED_LIBINTL=no
457 nls_cv_use_gnu_gettext=no
460 if test "$CATOBJEXT" = "NONE"; then
461 dnl GNU gettext is not found in the C library.
462 dnl Fall back on GNU gettext library.
463 nls_cv_use_gnu_gettext=maybe
467 if test "$nls_cv_use_gnu_gettext" != "no"; then
469 if test -f $srcdir/intl/libintl.h ; then
470 dnl Mark actions used to generate GNU NLS library.
471 INTLOBJS="\$(GETTOBJS)"
472 BUILD_INCLUDED_LIBINTL=yes
473 USE_INCLUDED_LIBINTL=yes
474 INTLLIBS="ifelse([$3],[],\$(top_builddir)/intl,[$3])/libintl.ifelse([$1], use-libtool, [l], [])a $LIBICONV"
475 LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'`
476 elif test "$nls_cv_use_gnu_gettext" = "yes"; then
477 nls_cv_use_gnu_gettext=no
478 AC_MSG_WARN(no NLS library is packaged with this application)
482 dnl Test whether we really found GNU msgfmt.
483 if test "$GMSGFMT" != ":"; then
484 if $GMSGFMT --statistics /dev/null >/dev/null 2>&1; then
487 AC_MSG_WARN([found msgfmt program is not GNU msgfmt])
491 dnl Test whether we really found GNU xgettext.
492 if test "$XGETTEXT" != ":"; then
493 if $XGETTEXT --omit-header /dev/null >/dev/null 2>&1; then
496 AC_MSG_WARN([found xgettext program is not GNU xgettext])
501 if test "$XGETTEXT" != ":"; then
503 [for ac_file in $CONFIG_FILES; do
505 # Support "outfile[:infile[:infile...]]"
507 (*:*) ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;;
510 # PO directories have a Makefile.in generated from Makefile.inn.
513 # Adjust a relative srcdir.
514 ac_dir=`echo "$ac_file"|sed 's%/[^/][^/]*$%%'`
515 ac_dir_suffix="/`echo "$ac_dir"|sed 's%^\./%%'`"
516 ac_dots=`echo "$ac_dir_suffix"|sed 's%/[^/]*%../%g'`
517 ac_base=`basename $ac_file .in`
518 # In autoconf-2.13 it is called $ac_given_srcdir.
519 # In autoconf-2.50 it is called $srcdir.
520 test -n "$ac_given_srcdir" || ac_given_srcdir="$srcdir"
522 case "$ac_given_srcdir" in
523 (.) top_srcdir=`echo $ac_dots|sed 's%/$%%'` ;;
524 (/*) top_srcdir="$ac_given_srcdir" ;;
525 (*) top_srcdir="$ac_dots$ac_given_srcdir" ;;
528 if test -f "$ac_given_srcdir/$ac_dir/POTFILES.in"; then
529 rm -f "$ac_dir/POTFILES"
530 test -n "$as_me" && echo "$as_me: creating $ac_dir/POTFILES" || echo "creating $ac_dir/POTFILES"
531 sed -e "/^#/d" -e "/^[ ]*\$/d" -e "s,.*, $top_srcdir/& \\\\," -e "\$s/\(.*\) \\\\/\1/" < "$ac_given_srcdir/$ac_dir/POTFILES.in" > "$ac_dir/POTFILES"
532 test -n "$as_me" && echo "$as_me: creating $ac_dir/$ac_base" || echo "creating $ac_dir/$ac_base"
533 sed -e "/POTFILES =/r $ac_dir/POTFILES" "$ac_dir/$ac_base.in" > "$ac_dir/$ac_base"
539 dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL
540 dnl to 'yes' because some of the testsuite requires it.
541 if test "$PACKAGE" = gettext; then
542 BUILD_INCLUDED_LIBINTL=yes
545 dnl intl/plural.c is generated from intl/plural.y. It requires bison,
546 dnl because plural.y uses bison specific features. It requires at least
547 dnl bison-1.26 because earlier versions generate a plural.c that doesn't
549 dnl bison is only needed for the maintainer (who touches plural.y). But in
550 dnl order to avoid separate Makefiles or --enable-maintainer-mode, we put
551 dnl the rule in general Makefile. Now, some people carelessly touch the
552 dnl files or have a broken "make" program, hence the plural.c rule will
553 dnl sometimes fire. To avoid an error, defines BISON to ":" if it is not
554 dnl present or too old.
555 if test "$nls_cv_use_gnu_gettext" = "yes"; then
556 AC_CHECK_PROGS([INTLBISON], [bison])
557 if test -z "$INTLBISON"; then
560 dnl Found it, now check the version.
561 AC_MSG_CHECKING([version of bison])
562 changequote(<<,>>)dnl
563 ac_prog_version=`$INTLBISON --version 2>&1 | sed -n 's/^.*GNU Bison.* \([0-9]*\.[0-9.]*\).*$/\1/p'`
564 case $ac_prog_version in
565 ('') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;;
566 (1.2[6-9]*|1.[3-9][0-9]*|[2-9].*)
568 ac_prog_version="$ac_prog_version, ok"; ac_verc_fail=no;;
569 (*) ac_prog_version="$ac_prog_version, bad"; ac_verc_fail=yes;;
571 AC_MSG_RESULT([$ac_prog_version])
573 if test $ac_verc_fail = yes; then
578 dnl These rules are solely for the distribution goal. While doing this
579 dnl we only have to keep exactly one list of the available catalogs
581 for lang in $ALL_LINGUAS; do
582 GMOFILES="$GMOFILES $lang.gmo"
583 POFILES="$POFILES $lang.po"
587 dnl Make all variables we use known to autoconf.
588 AC_SUBST(BUILD_INCLUDED_LIBINTL)
589 AC_SUBST(USE_INCLUDED_LIBINTL)
598 dnl For backward compatibility. Some configure.ins may be using this.
602 dnl For backward compatibility. Some Makefiles may be using this.
604 AC_SUBST(DATADIRNAME)
606 dnl For backward compatibility. Some Makefiles may be using this.
610 dnl For backward compatibility. Some Makefiles may be using this.
614 dnl ---------------------------------------------------------------------------
615 dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49
616 dnl ------------------
617 dnl Conditionally generate script according to whether we're using a given autoconf.
619 dnl $1 = version to compare against
620 dnl $2 = code to use if AC_ACVERSION is at least as high as $1.
621 dnl $3 = code to use if AC_ACVERSION is older than $1.
622 define([CF_ACVERSION_CHECK],
624 ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl
625 ifdef([m4_version_compare],
626 [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])],
627 [CF_ACVERSION_COMPARE(
628 AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])),
629 AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl
630 dnl ---------------------------------------------------------------------------
631 dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53
632 dnl --------------------
633 dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1,
634 dnl MAJOR2, MINOR2, TERNARY2,
635 dnl PRINTABLE2, not FOUND, FOUND)
636 define([CF_ACVERSION_COMPARE],
637 [ifelse(builtin([eval], [$2 < $5]), 1,
638 [ifelse([$8], , ,[$8])],
639 [ifelse([$9], , ,[$9])])])dnl
640 dnl ---------------------------------------------------------------------------
641 dnl CF_ADD_CFLAGS version: 13 updated: 2017/02/25 18:57:40
643 dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS
644 dnl The second parameter if given makes this macro verbose.
646 dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS,
647 dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily
648 dnl confused by the quotes (which require backslashes to keep them usable).
649 AC_DEFUN([CF_ADD_CFLAGS],
654 cf_new_extra_cppflags=
656 for cf_add_cflags in $1
658 case $cf_fix_cppflags in
660 case $cf_add_cflags in
661 (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C)
662 case $cf_add_cflags in
664 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'`
666 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
667 && test -z "${cf_tst_cflags}" \
668 && cf_fix_cppflags=yes
670 if test $cf_fix_cppflags = yes ; then
671 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
673 elif test "${cf_tst_cflags}" = "\"'" ; then
674 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
683 case $cf_add_cflags in
685 cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'`
686 CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags)
689 CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags)
694 CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags)
699 CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags)
701 cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'`
703 test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \
704 && test -z "${cf_tst_cflags}" \
705 && cf_fix_cppflags=no
710 if test -n "$cf_new_cflags" ; then
711 ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)])
712 CF_APPEND_TEXT(CFLAGS,$cf_new_cflags)
715 if test -n "$cf_new_cppflags" ; then
716 ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)])
717 CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags)
720 if test -n "$cf_new_extra_cppflags" ; then
721 ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)])
722 CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags)
725 AC_SUBST(EXTRA_CPPFLAGS)
728 dnl ---------------------------------------------------------------------------
729 dnl CF_ADD_INCDIR version: 15 updated: 2018/06/20 20:23:13
731 dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's
732 dnl redundant. We don't normally need to add -I/usr/local/include for gcc,
733 dnl but old versions (and some misinstalled ones) need that. To make things
734 dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to
735 dnl the include-path).
736 AC_DEFUN([CF_ADD_INCDIR],
738 if test -n "$1" ; then
739 for cf_add_incdir in $1
741 while test $cf_add_incdir != /usr/include
743 if test -d $cf_add_incdir
746 if test -n "$CFLAGS$CPPFLAGS" ; then
747 # a loop is needed to ensure we can add subdirs of existing dirs
748 for cf_test_incdir in $CFLAGS $CPPFLAGS ; do
749 if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then
750 cf_have_incdir=yes; break
755 if test "$cf_have_incdir" = no ; then
756 if test "$cf_add_incdir" = /usr/local/include ; then
759 cf_save_CPPFLAGS=$CPPFLAGS
760 CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir)
761 AC_TRY_COMPILE([#include <stdio.h>],
764 [cf_have_incdir=yes])
765 CPPFLAGS=$cf_save_CPPFLAGS
770 if test "$cf_have_incdir" = no ; then
771 CF_VERBOSE(adding $cf_add_incdir to include-path)
772 ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir"
774 cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'`
775 test "$cf_top_incdir" = "$cf_add_incdir" && break
776 cf_add_incdir="$cf_top_incdir"
787 dnl ---------------------------------------------------------------------------
788 dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05
790 dnl Add a library, used to enforce consistency.
792 dnl $1 = library to add, without the "-l"
793 dnl $2 = variable to update (default $LIBS)
794 AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl
795 dnl ---------------------------------------------------------------------------
796 dnl CF_ADD_LIBDIR version: 10 updated: 2015/04/18 08:56:57
798 dnl Adds to the library-path
800 dnl Some machines have trouble with multiple -L options.
802 dnl $1 is the (list of) directory(s) to add
803 dnl $2 is the optional name of the variable to update (default LDFLAGS)
805 AC_DEFUN([CF_ADD_LIBDIR],
807 if test -n "$1" ; then
808 for cf_add_libdir in $1
810 if test $cf_add_libdir = /usr/lib ; then
812 elif test -d $cf_add_libdir
815 if test -n "$LDFLAGS$LIBS" ; then
816 # a loop is needed to ensure we can add subdirs of existing dirs
817 for cf_test_libdir in $LDFLAGS $LIBS ; do
818 if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then
819 cf_have_libdir=yes; break
823 if test "$cf_have_libdir" = no ; then
824 CF_VERBOSE(adding $cf_add_libdir to library-path)
825 ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])"
831 dnl ---------------------------------------------------------------------------
832 dnl CF_ADD_LIBS version: 2 updated: 2014/07/13 14:33:27
834 dnl Add one or more libraries, used to enforce consistency. Libraries are
835 dnl prepended to an existing list, since their dependencies are assumed to
836 dnl already exist in the list.
838 dnl $1 = libraries to add, with the "-l", etc.
839 dnl $2 = variable to update (default $LIBS)
840 AC_DEFUN([CF_ADD_LIBS],[
842 # Filter out duplicates - this happens with badly-designed ".pc" files...
843 for cf_add_1lib in [$]ifelse($2,,LIBS,[$2])
845 for cf_add_2lib in $cf_add_libs
847 if test "x$cf_add_1lib" = "x$cf_add_2lib"
853 test -n "$cf_add_1lib" && cf_add_libs="$cf_add_libs $cf_add_1lib"
855 ifelse($2,,LIBS,[$2])="$cf_add_libs"
857 dnl ---------------------------------------------------------------------------
858 dnl CF_ADD_LIB_AFTER version: 3 updated: 2013/07/09 21:27:22
860 dnl Add a given library after another, e.g., following the one it satisfies a
863 dnl $1 = the first library
864 dnl $2 = its dependency
865 AC_DEFUN([CF_ADD_LIB_AFTER],[
866 CF_VERBOSE(...before $LIBS)
867 LIBS=`echo "$LIBS" | sed -e "s/[[ ]][[ ]]*/ /g" -e "s%$1 %$1 $2 %" -e 's% % %g'`
868 CF_VERBOSE(...after $LIBS)
870 dnl ---------------------------------------------------------------------------
871 dnl CF_ADD_OPTIONAL_PATH version: 3 updated: 2015/05/10 19:52:14
872 dnl --------------------
873 dnl Add an optional search-path to the compile/link variables.
876 dnl $1 = shell variable containing the result of --with-XXX=[DIR]
877 dnl $2 = module to look for.
878 AC_DEFUN([CF_ADD_OPTIONAL_PATH],[
885 CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)])
889 dnl ---------------------------------------------------------------------------
890 dnl CF_ADD_SEARCHPATH version: 5 updated: 2009/01/11 20:40:21
891 dnl -----------------
892 dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter.
893 dnl They can be either the common root of include- and lib-directories, or the
894 dnl lib-directory (to allow for things like lib64 directories).
895 dnl See also CF_FIND_LINKAGE.
897 dnl $1 is the list of colon-separated directory names to search.
898 dnl $2 is the action to take if a parameter does not yield a directory.
899 AC_DEFUN([CF_ADD_SEARCHPATH],
901 AC_REQUIRE([CF_PATHSEP])
902 for cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do
903 if test -d $cf_searchpath/include; then
904 CF_ADD_INCDIR($cf_searchpath/include)
905 elif test -d $cf_searchpath/../include ; then
906 CF_ADD_INCDIR($cf_searchpath/../include)
910 if test -d $cf_searchpath/lib; then
911 CF_ADD_LIBDIR($cf_searchpath/lib)
912 elif test -d $cf_searchpath ; then
913 CF_ADD_LIBDIR($cf_searchpath)
919 dnl ---------------------------------------------------------------------------
920 dnl CF_ADD_SUBDIR_PATH version: 4 updated: 2013/10/08 17:47:05
921 dnl ------------------
922 dnl Append to a search-list for a nonstandard header/lib-file
923 dnl $1 = the variable to return as result
924 dnl $2 = the package name
925 dnl $3 = the subdirectory, e.g., bin, include or lib
926 dnl $4 = the directory under which we will test for subdirectories
927 dnl $5 = a directory that we do not want $4 to match
928 AC_DEFUN([CF_ADD_SUBDIR_PATH],
930 test "x$4" != "x$5" && \
932 ifelse([$5],NONE,,[(test -z "$5" || test x$5 = xNONE || test "x$4" != "x$5") &&]) {
933 test -n "$verbose" && echo " ... testing for $3-directories under $4"
934 test -d $4/$3 && $1="[$]$1 $4/$3"
935 test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2"
936 test -d $4/$3/$2/$3 && $1="[$]$1 $4/$3/$2/$3"
937 test -d $4/$2/$3 && $1="[$]$1 $4/$2/$3"
938 test -d $4/$2/$3/$2 && $1="[$]$1 $4/$2/$3/$2"
941 dnl ---------------------------------------------------------------------------
942 dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55
944 dnl use this macro for appending text without introducing an extra blank at
946 define([CF_APPEND_TEXT],
948 test -n "[$]$1" && $1="[$]$1 "
951 dnl ---------------------------------------------------------------------------
952 dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31
954 dnl Allow user to disable a normally-on option.
955 AC_DEFUN([CF_ARG_DISABLE],
956 [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl
957 dnl ---------------------------------------------------------------------------
958 dnl CF_ARG_MSG_ENABLE version: 2 updated: 2000/07/29 19:32:03
959 dnl -----------------
960 dnl Verbose form of AC_ARG_ENABLE:
966 dnl $4 = action to perform if option is enabled
967 dnl $5 = action if perform if option is disabled
968 dnl $6 = default option value (either 'yes' or 'no')
969 AC_DEFUN([CF_ARG_MSG_ENABLE],[
971 AC_ARG_ENABLE($2,[$3],,enableval=ifelse($6,,no,$6))
972 AC_MSG_RESULT($enableval)
973 if test "$enableval" != no ; then
979 dnl ---------------------------------------------------------------------------
980 dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14
982 dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus
988 dnl $3 = action to perform if option is not default
989 dnl $4 = action if perform if option is default
990 dnl $5 = default option value (either 'yes' or 'no')
991 AC_DEFUN([CF_ARG_OPTION],
992 [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes)
993 if test "$enableval" != "$5" ; then
995 ,[ $3]) ifelse([$4],,,[
998 fi],[enableval=$5 ifelse([$4],,,[
1002 dnl ---------------------------------------------------------------------------
1003 dnl CF_AR_FLAGS version: 6 updated: 2015/10/10 15:25:05
1005 dnl Check for suitable "ar" (archiver) options for updating an archive.
1007 dnl In particular, handle some obsolete cases where the "-" might be omitted,
1008 dnl as well as a workaround for breakage of make's archive rules by the GNU
1009 dnl binutils "ar" program.
1010 AC_DEFUN([CF_AR_FLAGS],[
1011 AC_REQUIRE([CF_PROG_AR])
1013 AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[
1014 cf_cv_ar_flags=unknown
1015 for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv
1018 # check if $ARFLAGS already contains this choice
1019 if test "x$ARFLAGS" != "x" ; then
1020 cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"`
1021 if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then
1027 rm -f conftest.$ac_cv_objext
1030 cat >conftest.$ac_ext <<EOF
1031 #line __oline__ "configure"
1032 int testdata[[3]] = { 123, 456, 789 };
1034 if AC_TRY_EVAL(ac_compile) ; then
1035 echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&AC_FD_CC
1036 $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null
1037 if test -f conftest.a ; then
1038 cf_cv_ar_flags=$cf_ar_flags
1042 CF_VERBOSE(cannot compile test-program)
1046 rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext
1049 if test -n "$ARFLAGS" ; then
1050 if test -n "$cf_cv_ar_flags" ; then
1051 ARFLAGS="$ARFLAGS $cf_cv_ar_flags"
1054 ARFLAGS=$cf_cv_ar_flags
1059 dnl ---------------------------------------------------------------------------
1060 dnl CF_BUNDLED_INTL version: 19 updated: 2018/06/20 20:23:13
1062 dnl Top-level macro for configuring an application with a bundled copy of
1063 dnl the intl and po directories for gettext.
1065 dnl $1 specifies either Makefile or makefile, defaulting to the former.
1066 dnl $2 if nonempty sets the option to --enable-nls rather than to --disable-nls
1068 dnl Sets variables which can be used to substitute in makefiles:
1069 dnl GT_YES - "#" comment unless building intl library, otherwise empty
1070 dnl GT_NO - "#" comment if building intl library, otherwise empty
1071 dnl INTLDIR_MAKE - to make ./intl directory
1072 dnl MSG_DIR_MAKE - to make ./po directory
1073 dnl SUB_MAKEFILE - list of makefiles in ./intl, ./po directories
1076 dnl HAVE_LIBGETTEXT_H if we're using ./intl
1080 dnl ALL_LINGUAS if set, lists the root names of the ".po" files.
1081 dnl CONFIG_H assumed to be "config.h"
1082 dnl PACKAGE must be set, used as default for textdomain
1083 dnl VERSION may be set, otherwise extract from "VERSION" file.
1085 AC_DEFUN([CF_BUNDLED_INTL],[
1086 cf_makefile=ifelse($1,,Makefile,$1)
1088 dnl Set of available languages (based on source distribution). Note that
1089 dnl setting $LINGUAS overrides $ALL_LINGUAS. Some environments set $LINGUAS
1090 dnl rather than $LC_ALL
1091 test -z "$ALL_LINGUAS" && ALL_LINGUAS=`test -d $srcdir/po && cd $srcdir/po && echo *.po|sed -e 's/\.po//g' -e 's/*//'`
1093 # Allow override of "config.h" definition:
1094 : ${CONFIG_H:=config.h}
1097 if test -z "$PACKAGE" ; then
1098 AC_MSG_ERROR([[CF_BUNDLED_INTL] used without setting [PACKAGE] variable])
1101 if test -z "$VERSION" ; then
1102 if test -f $srcdir/VERSION ; then
1103 VERSION=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
1110 AM_GNU_GETTEXT(,,,[$2])
1112 if test "$USE_NLS" = yes ; then
1113 AC_ARG_WITH(textdomain,
1114 [ --with-textdomain=PKG NLS text-domain (default is package name)],
1115 [NLS_TEXTDOMAIN=$withval],
1116 [NLS_TEXTDOMAIN=$PACKAGE])
1117 AC_DEFINE_UNQUOTED(NLS_TEXTDOMAIN,"$NLS_TEXTDOMAIN",[Define to the nls textdomain value])
1118 AC_SUBST(NLS_TEXTDOMAIN)
1125 dnl this updates SUB_MAKEFILE and MSG_DIR_MAKE:
1128 if test "$USE_INCLUDED_LIBINTL" = yes ; then
1129 if test "$nls_cv_force_use_gnu_gettext" = yes ; then
1131 elif test "$nls_cv_use_gnu_gettext" = yes ; then
1136 if test -z "$INTLDIR_MAKE"; then
1137 AC_DEFINE(HAVE_LIBGETTEXT_H,1,[Define to 1 if we have libgettext.h])
1138 for cf_makefile in \
1139 $srcdir/intl/Makefile.in \
1140 $srcdir/intl/makefile.in
1142 if test -f "$cf_makefile" ; then
1143 SUB_MAKEFILE="$SUB_MAKEFILE `echo \"${cf_makefile}\"|sed -e 's,^'$srcdir/',,' -e 's/\.in$//'`:${cf_makefile}"
1150 if test "$USE_NLS" = yes ; then
1151 AC_CHECK_HEADERS(libintl.h)
1155 if test -z "$INTLDIR_MAKE" ; then
1156 CF_APPEND_TEXT(CPPFLAGS,-I../intl)
1159 dnl FIXME: we use this in lynx (the alternative is a spurious dependency upon
1161 if test "$BUILD_INCLUDED_LIBINTL" = yes ; then
1169 AC_SUBST(INTLDIR_MAKE)
1170 AC_SUBST(MSG_DIR_MAKE)
1174 dnl FIXME: the underlying AM_GNU_GETTEXT macro either needs some fixes or a
1175 dnl little documentation. It doesn't define anything so that we can ifdef our
1176 dnl own code, except ENABLE_NLS, which is too vague to be of any use.
1178 if test "$USE_INCLUDED_LIBINTL" = yes ; then
1179 if test "$nls_cv_force_use_gnu_gettext" = yes ; then
1180 AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
1181 elif test "$nls_cv_use_gnu_gettext" = yes ; then
1182 AC_DEFINE(HAVE_GETTEXT,1,[Define to 1 if we have gettext function])
1184 if test -n "$nls_cv_header_intl" ; then
1185 AC_DEFINE(HAVE_LIBINTL_H,1,[Define to 1 if we have header-file for libintl])
1189 dnl ---------------------------------------------------------------------------
1190 dnl CF_CC_ENV_FLAGS version: 8 updated: 2017/09/23 08:50:24
1192 dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content
1193 dnl into CC. This will not help with broken scripts that wrap the compiler
1194 dnl with options, but eliminates a more common category of user confusion.
1196 dnl In particular, it addresses the problem of being able to run the C
1197 dnl preprocessor in a consistent manner.
1199 dnl Caveat: this also disallows blanks in the pathname for the compiler, but
1200 dnl the nuisance of having inconsistent settings for compiler and preprocessor
1201 dnl outweighs that limitation.
1202 AC_DEFUN([CF_CC_ENV_FLAGS],
1204 # This should have been defined by AC_PROG_CC
1207 AC_MSG_CHECKING(\$CC variable)
1210 AC_MSG_RESULT(broken)
1211 AC_MSG_WARN(your environment misuses the CC variable to hold CFLAGS/CPPFLAGS options)
1213 cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'`
1214 cf_flags=`echo "$CC" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(prog))); }'`
1216 for cf_arg in $cf_flags
1220 CF_ADD_CFLAGS($cf_arg)
1227 CF_VERBOSE(resulting CC: '$CC')
1228 CF_VERBOSE(resulting CFLAGS: '$CFLAGS')
1229 CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS')
1236 dnl ---------------------------------------------------------------------------
1237 dnl CF_CHECK_CACHE version: 12 updated: 2012/10/02 20:55:03
1239 dnl Check if we're accidentally using a cache from a different machine.
1240 dnl Derive the system name, as a check for reusing the autoconf cache.
1242 dnl If we've packaged config.guess and config.sub, run that (since it does a
1243 dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow
1244 dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM
1245 dnl which is useful in cross-compiles.
1247 dnl Note: we would use $ac_config_sub, but that is one of the places where
1248 dnl autoconf 2.5x broke compatibility with autoconf 2.13
1249 AC_DEFUN([CF_CHECK_CACHE],
1251 if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then
1252 ifelse([$1],,[AC_CANONICAL_HOST],[$1])
1253 system_name="$host_os"
1255 system_name="`(uname -s -r) 2>/dev/null`"
1256 if test -z "$system_name" ; then
1257 system_name="`(hostname) 2>/dev/null`"
1260 test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.])
1261 AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"])
1263 test -z "$system_name" && system_name="$cf_cv_system_name"
1264 test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name)
1266 if test ".$system_name" != ".$cf_cv_system_name" ; then
1267 AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name))
1268 AC_MSG_ERROR("Please remove config.cache and try again.")
1271 dnl ---------------------------------------------------------------------------
1272 dnl CF_CHECK_CFLAGS version: 3 updated: 2014/07/22 05:32:57
1274 dnl Conditionally add to $CFLAGS and $CPPFLAGS values which are derived from
1275 dnl a build-configuration such as imake. These have the pitfall that they
1276 dnl often contain compiler-specific options which we cannot use, mixed with
1277 dnl preprocessor options that we usually can.
1278 AC_DEFUN([CF_CHECK_CFLAGS],
1280 CF_VERBOSE(checking additions to CFLAGS)
1281 cf_check_cflags="$CFLAGS"
1282 cf_check_cppflags="$CPPFLAGS"
1283 CF_ADD_CFLAGS($1,yes)
1284 if test "x$cf_check_cflags" != "x$CFLAGS" ; then
1285 AC_TRY_LINK([#include <stdio.h>],[printf("Hello world");],,
1286 [CF_VERBOSE(test-compile failed. Undoing change to \$CFLAGS)
1287 if test "x$cf_check_cppflags" != "x$CPPFLAGS" ; then
1288 CF_VERBOSE(but keeping change to \$CPPFLAGS)
1290 CFLAGS="$cf_check_flags"])
1293 dnl ---------------------------------------------------------------------------
1294 dnl CF_CHECK_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
1295 dnl ------------------------
1296 dnl Show the version of libtool
1298 dnl Save the version in a cache variable - this is not entirely a good thing,
1299 dnl but the version string from libtool is very ugly, and for bug reports it
1300 dnl might be useful to have the original string.
1301 AC_DEFUN([CF_CHECK_LIBTOOL_VERSION],[
1302 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
1304 AC_MSG_CHECKING(version of $LIBTOOL)
1306 AC_MSG_RESULT($cf_cv_libtool_version)
1307 if test -z "$cf_cv_libtool_version" ; then
1308 AC_MSG_ERROR(This is not GNU libtool)
1311 AC_MSG_ERROR(GNU libtool has not been found)
1314 dnl ---------------------------------------------------------------------------
1315 dnl CF_CLANG_COMPILER version: 2 updated: 2013/11/19 19:23:35
1316 dnl -----------------
1317 dnl Check if the given compiler is really clang. clang's C driver defines
1318 dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does
1319 dnl not ignore some gcc options.
1321 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
1322 dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
1323 dnl the wrappers for gcc and g++ warnings.
1325 dnl $1 = GCC (default) or GXX
1326 dnl $2 = CLANG_COMPILER (default)
1327 dnl $3 = CFLAGS (default) or CXXFLAGS
1328 AC_DEFUN([CF_CLANG_COMPILER],[
1329 ifelse([$2],,CLANG_COMPILER,[$2])=no
1331 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
1332 AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler)
1333 cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
1334 ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -Qunused-arguments"
1340 ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes
1341 cf_save_CFLAGS="$cf_save_CFLAGS -Qunused-arguments"
1343 ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
1344 AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2]))
1347 dnl ---------------------------------------------------------------------------
1348 dnl CF_CURSES_CHTYPE version: 8 updated: 2012/10/06 08:57:51
1349 dnl ----------------
1350 dnl Test if curses defines 'chtype' (usually a 'long' type for SysV curses).
1351 AC_DEFUN([CF_CURSES_CHTYPE],
1353 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1354 AC_CACHE_CHECK(for chtype typedef,cf_cv_chtype_decl,[
1355 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1357 [cf_cv_chtype_decl=yes],
1358 [cf_cv_chtype_decl=no])])
1359 if test $cf_cv_chtype_decl = yes ; then
1360 AC_DEFINE(HAVE_TYPE_CHTYPE,1,[Define to 1 if chtype is declared])
1361 AC_CACHE_CHECK(if chtype is scalar or struct,cf_cv_chtype_type,[
1362 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1363 [chtype foo; long x = foo],
1364 [cf_cv_chtype_type=scalar],
1365 [cf_cv_chtype_type=struct])])
1366 if test $cf_cv_chtype_type = scalar ; then
1367 AC_DEFINE(TYPE_CHTYPE_IS_SCALAR,1,[Define to 1 if chtype is a scaler/integer])
1371 dnl ---------------------------------------------------------------------------
1372 dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27
1373 dnl ----------------
1374 dnl Tie together the configure-script macros for curses. It may be ncurses,
1375 dnl but unless asked, we do not make a special search for ncurses. However,
1376 dnl still check for the ncurses version number, for use in other macros.
1377 AC_DEFUN([CF_CURSES_CONFIG],
1383 dnl ---------------------------------------------------------------------------
1384 dnl CF_CURSES_CPPFLAGS version: 13 updated: 2018/06/20 20:23:13
1385 dnl ------------------
1386 dnl Look for the curses headers.
1387 AC_DEFUN([CF_CURSES_CPPFLAGS],[
1389 AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[
1390 cf_cv_curses_incdir=no
1393 if test "x$cf_cv_screen" = "xcurses_colr"
1395 test -d /usr/include/curses_colr && \
1396 cf_cv_curses_incdir="-I/usr/include/curses_colr"
1400 if test "x$cf_cv_screen" = "xcurses_5lib"
1402 test -d /usr/5lib && \
1403 test -d /usr/5include && \
1404 cf_cv_curses_incdir="-I/usr/5include"
1409 if test "$cf_cv_curses_incdir" != no
1411 CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir)
1417 dnl ---------------------------------------------------------------------------
1418 dnl CF_CURSES_FUNCS version: 19 updated: 2018/01/03 04:47:33
1420 dnl Curses-functions are a little complicated, since a lot of them are macros.
1421 AC_DEFUN([CF_CURSES_FUNCS],
1423 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1424 AC_REQUIRE([CF_XOPEN_CURSES])
1425 AC_REQUIRE([CF_CURSES_TERM_H])
1426 AC_REQUIRE([CF_CURSES_UNCTRL_H])
1429 CF_UPPER(cf_tr_func,$cf_func)
1430 AC_MSG_CHECKING(for ${cf_func})
1431 CF_MSG_LOG(${cf_func})
1432 AC_CACHE_VAL(cf_cv_func_$cf_func,[
1433 eval cf_result='$ac_cv_func_'$cf_func
1434 if test ".$cf_result" != ".no"; then
1435 AC_TRY_LINK(CF__CURSES_HEAD,
1438 long foo = (long)(&${cf_func});
1439 fprintf(stderr, "testing linkage of $cf_func:%p\n", (void *)foo);
1440 if (foo + 1234L > 5678L)
1441 ${cf_cv_main_return:-return}(foo != 0);
1447 eval 'cf_cv_func_'$cf_func'=$cf_result'
1449 # use the computed/retrieved cache-value:
1450 eval 'cf_result=$cf_cv_func_'$cf_func
1451 AC_MSG_RESULT($cf_result)
1452 if test $cf_result != no; then
1453 AC_DEFINE_UNQUOTED(HAVE_${cf_tr_func})
1457 dnl ---------------------------------------------------------------------------
1458 dnl CF_CURSES_HEADER version: 5 updated: 2015/04/23 20:35:30
1459 dnl ----------------
1460 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
1461 dnl variations of ncurses' installs.
1463 dnl $1 = ncurses when looking for ncurses, or is empty
1464 AC_DEFUN([CF_CURSES_HEADER],[
1465 AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[
1466 cf_cv_ncurses_header=none
1468 ncurses.h ifelse($1,,,[$1/ncurses.h]) \
1469 curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h])
1471 AC_TRY_COMPILE([#include <${cf_header}>],
1472 [initscr(); tgoto("?", 0,0)],
1473 [cf_cv_ncurses_header=$cf_header; break],[])
1477 if test "$cf_cv_ncurses_header" = none ; then
1478 AC_MSG_ERROR(No curses header-files found)
1481 # cheat, to get the right #define's for HAVE_NCURSES_H, etc.
1482 AC_CHECK_HEADERS($cf_cv_ncurses_header)
1484 dnl ---------------------------------------------------------------------------
1485 dnl CF_CURSES_LIBS version: 42 updated: 2018/06/20 20:23:13
1487 dnl Look for the curses libraries. Older curses implementations may require
1488 dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first.
1489 AC_DEFUN([CF_CURSES_LIBS],[
1491 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1492 AC_MSG_CHECKING(if we have identified curses libraries)
1493 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1494 [initscr(); tgoto("?", 0,0)],
1497 AC_MSG_RESULT($cf_result)
1499 if test "$cf_result" = no ; then
1502 AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)])
1505 # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr
1506 # next (1998), and xcurses "newer" (2000). There is no header file for
1507 # Hcurses; the subdirectory curses_colr has the headers (curses.h and
1508 # term.h) for cur_colr
1509 if test "x$cf_cv_screen" = "xcurses_colr"
1511 AC_CHECK_LIB(cur_colr,initscr,[
1512 CF_ADD_LIBS(-lcur_colr)
1513 ac_cv_func_initscr=yes
1515 AC_CHECK_LIB(Hcurses,initscr,[
1516 # HP's header uses __HP_CURSES, but user claims _HP_CURSES.
1517 CF_ADD_LIBS(-lHcurses)
1518 CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES)
1519 ac_cv_func_initscr=yes
1524 case `arch 2>/dev/null` in
1528 CF_ADD_LIBDIR(/lib64)
1539 if test "x$cf_cv_screen" = "xcurses_5lib"
1541 if test -d /usr/5lib ; then
1542 CF_ADD_LIBDIR(/usr/5lib)
1543 CF_ADD_LIBS(-lcurses -ltermcap)
1546 ac_cv_func_initscr=yes
1550 if test ".$ac_cv_func_initscr" != .yes ; then
1551 cf_save_LIBS="$LIBS"
1553 if test ".${cf_cv_ncurses_version:-no}" != .no
1555 cf_check_list="ncurses curses cursesX"
1557 cf_check_list="cursesX curses ncurses"
1560 # Check for library containing tgoto. Do this before curses library
1561 # because it may be needed to link the test-case for initscr.
1562 if test "x$cf_term_lib" = x
1564 AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[
1565 for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown
1567 AC_CHECK_LIB($cf_term_lib,tgoto,[
1568 : ${cf_nculib_root:=$cf_term_lib}
1575 # Check for library containing initscr
1576 test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS"
1577 if test "x$cf_curs_lib" = x
1579 for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown
1581 LIBS="-l$cf_curs_lib $cf_save_LIBS"
1582 if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then
1583 AC_MSG_CHECKING(if we can link with $cf_curs_lib library)
1584 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1588 AC_MSG_RESULT($cf_result)
1589 test $cf_result = yes && break
1590 elif test "$cf_curs_lib" = "$cf_term_lib" ; then
1592 elif test "$cf_term_lib" != predefined ; then
1593 AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries)
1594 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1595 [initscr(); tgoto((char *)0, 0, 0);],
1598 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS"
1599 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
1604 AC_MSG_RESULT($cf_result)
1605 test $cf_result != error && break
1609 test $cf_curs_lib = unknown && AC_MSG_ERROR(no curses library found)
1614 dnl ---------------------------------------------------------------------------
1615 dnl CF_CURSES_TERM_H version: 11 updated: 2015/04/15 19:08:48
1616 dnl ----------------
1617 dnl SVr4 curses should have term.h as well (where it puts the definitions of
1618 dnl the low-level interface). This may not be true in old/broken implementations,
1619 dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4
1620 dnl running with Solaris 2.5.1).
1621 AC_DEFUN([CF_CURSES_TERM_H],
1623 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1625 AC_CACHE_CHECK(for term.h, cf_cv_term_header,[
1627 # If we found <ncurses/curses.h>, look for <ncurses/term.h>, but always look
1628 # for <term.h> if we do not find the variant.
1630 cf_header_list="term.h ncurses/term.h ncursesw/term.h"
1632 case ${cf_cv_ncurses_header:-curses.h} in
1634 cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h
1635 cf_header_list="$cf_header_item $cf_header_list"
1639 for cf_header in $cf_header_list
1642 #include <${cf_cv_ncurses_header:-curses.h}>
1643 #include <${cf_header}>],
1645 [cf_cv_term_header=$cf_header
1647 [cf_cv_term_header=no])
1650 case $cf_cv_term_header in
1652 # If curses is ncurses, some packagers still mess it up by trying to make
1653 # us use GNU termcap. This handles the most common case.
1654 for cf_header in ncurses/term.h ncursesw/term.h
1657 #include <${cf_cv_ncurses_header:-curses.h}>
1658 #ifdef NCURSES_VERSION
1659 #include <${cf_header}>
1664 [cf_cv_term_header=$cf_header
1666 [cf_cv_term_header=no])
1672 case $cf_cv_term_header in
1674 AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
1677 AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
1680 AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
1684 dnl ---------------------------------------------------------------------------
1685 dnl CF_CURSES_UNCTRL_H version: 4 updated: 2015/04/15 19:08:48
1686 dnl ------------------
1687 dnl Any X/Open curses implementation must have unctrl.h, but ncurses packages
1688 dnl may put it in a subdirectory (along with ncurses' other headers, of
1689 dnl course). Packages which put the headers in inconsistent locations are
1691 AC_DEFUN([CF_CURSES_UNCTRL_H],
1693 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
1695 AC_CACHE_CHECK(for unctrl.h, cf_cv_unctrl_header,[
1697 # If we found <ncurses/curses.h>, look for <ncurses/unctrl.h>, but always look
1698 # for <unctrl.h> if we do not find the variant.
1700 cf_header_list="unctrl.h ncurses/unctrl.h ncursesw/unctrl.h"
1702 case ${cf_cv_ncurses_header:-curses.h} in
1704 cf_header_item=`echo ${cf_cv_ncurses_header:-curses.h} | sed -e 's%\..*%%' -e 's%/.*%/%'`unctrl.h
1705 cf_header_list="$cf_header_item $cf_header_list"
1709 for cf_header in $cf_header_list
1712 #include <${cf_cv_ncurses_header:-curses.h}>
1713 #include <${cf_header}>],
1715 [cf_cv_unctrl_header=$cf_header
1717 [cf_cv_unctrl_header=no])
1721 case $cf_cv_unctrl_header in
1723 AC_MSG_WARN(unctrl.h header not found)
1727 case $cf_cv_unctrl_header in
1729 AC_DEFINE(HAVE_UNCTRL_H,1,[Define to 1 if we have unctrl.h])
1732 AC_DEFINE(HAVE_NCURSES_UNCTRL_H,1,[Define to 1 if we have ncurses/unctrl.h])
1735 AC_DEFINE(HAVE_NCURSESW_UNCTRL_H,1,[Define to 1 if we have ncursesw/unctrl.h])
1739 dnl ---------------------------------------------------------------------------
1740 dnl CF_CURSES_WACS_MAP version: 6 updated: 2012/10/06 08:57:51
1741 dnl ------------------
1742 dnl Check for likely values of wacs_map[].
1743 AC_DEFUN([CF_CURSES_WACS_MAP],
1745 AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
1746 cf_cv_curses_wacs_map=unknown
1747 for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
1750 #ifndef _XOPEN_SOURCE_EXTENDED
1751 #define _XOPEN_SOURCE_EXTENDED
1753 #include <${cf_cv_ncurses_header:-curses.h}>],
1754 [void *foo = &($name['k'])],
1755 [cf_cv_curses_wacs_map=$name
1759 test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map,[Define to name of (n)curses wide-character array])
1761 dnl ---------------------------------------------------------------------------
1762 dnl CF_CURSES_WACS_SYMBOLS version: 2 updated: 2012/10/06 08:57:51
1763 dnl ----------------------
1764 dnl Do a check to see if the WACS_xxx constants are defined compatibly with
1765 dnl X/Open Curses. In particular, NetBSD's implementation of the WACS_xxx
1766 dnl constants is broken since those constants do not point to cchar_t's.
1767 AC_DEFUN([CF_CURSES_WACS_SYMBOLS],
1769 AC_REQUIRE([CF_CURSES_WACS_MAP])
1771 AC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[
1772 cf_cv_curses_wacs_symbols=no
1773 if test "$cf_cv_curses_wacs_map" != unknown
1776 #ifndef _XOPEN_SOURCE_EXTENDED
1777 #define _XOPEN_SOURCE_EXTENDED
1779 #include <${cf_cv_ncurses_header:-curses.h}>],
1780 [cchar_t *foo = WACS_PLUS;
1781 $cf_cv_curses_wacs_map['k'] = *WACS_PLUS],
1782 [cf_cv_curses_wacs_symbols=yes])
1785 #ifndef _XOPEN_SOURCE_EXTENDED
1786 #define _XOPEN_SOURCE_EXTENDED
1788 #include <${cf_cv_ncurses_header:-curses.h}>],
1789 [cchar_t *foo = WACS_PLUS],
1790 [cf_cv_curses_wacs_symbols=yes])
1794 test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS,1,[Define to 1 if (n)curses supports wide-character WACS_ symbols])
1796 dnl ---------------------------------------------------------------------------
1797 dnl CF_CURSES_WGETPARENT version: 3 updated: 2012/10/06 08:57:51
1798 dnl --------------------
1799 dnl Check for curses support for directly determining the parent of a given
1800 dnl window. Some implementations make this difficult, so we provide for
1801 dnl defining an application-specific function that gives this functionality.
1803 dnl $1 = name of function to use if the feature is missing
1804 AC_DEFUN([CF_CURSES_WGETPARENT],[
1805 CF_CURSES_FUNCS(wgetparent)
1806 if test "x$cf_cv_func_wgetparent" != xyes
1808 AC_MSG_CHECKING(if WINDOW has _parent member)
1809 AC_TRY_COMPILE([#include <${cf_cv_ncurses_header:-curses.h}>],
1810 [WINDOW *p = stdscr->_parent],
1811 [cf_window__parent=yes],
1812 [cf_window__parent=no])
1813 AC_MSG_RESULT($cf_window__parent)
1814 if test "$cf_window__parent" = yes
1816 AC_DEFINE(HAVE_WINDOW__PARENT,1,[Define to 1 if WINDOW struct has _parent member])
1820 dnl ---------------------------------------------------------------------------
1821 dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
1823 dnl "dirname" is not portable, so we fake it with a shell script.
1824 AC_DEFUN([CF_DIRNAME],[$1=`echo $2 | sed -e 's%/[[^/]]*$%%'`])dnl
1825 dnl ---------------------------------------------------------------------------
1826 dnl CF_DISABLE_ECHO version: 13 updated: 2015/04/18 08:56:57
1828 dnl You can always use "make -n" to see the actual options, but it's hard to
1829 dnl pick out/analyze warning messages when the compile-line is long.
1832 dnl ECHO_LT - symbol to control if libtool is verbose
1833 dnl ECHO_LD - symbol to prefix "cc -o" lines
1834 dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o)
1835 dnl SHOW_CC - symbol to put before explicit "cc -c" lines
1836 dnl ECHO_CC - symbol to put before any "cc" line
1838 AC_DEFUN([CF_DISABLE_ECHO],[
1839 AC_MSG_CHECKING(if you want to see long compiling messages)
1840 CF_ARG_DISABLE(echo,
1841 [ --disable-echo do not display "compiling" commands],
1844 ECHO_LD='@echo linking [$]@;'
1845 RULE_CC='@echo compiling [$]<'
1846 SHOW_CC='@echo compiling [$]@'
1855 AC_MSG_RESULT($enableval)
1862 dnl ---------------------------------------------------------------------------
1863 dnl CF_DISABLE_LIBTOOL_VERSION version: 3 updated: 2015/04/17 21:13:04
1864 dnl --------------------------
1865 dnl Check if we should use the libtool 1.5 feature "-version-number" instead of
1866 dnl the older "-version-info" feature. The newer feature allows us to use
1867 dnl version numbering on shared libraries which make them compatible with
1868 dnl various systems.
1869 AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION],
1871 AC_MSG_CHECKING(if libtool -version-number should be used)
1872 CF_ARG_DISABLE(libtool-version,
1873 [ --disable-libtool-version enable to use libtool's incompatible naming scheme],
1874 [cf_libtool_version=no],
1875 [cf_libtool_version=yes])
1876 AC_MSG_RESULT($cf_libtool_version)
1878 if test "$cf_libtool_version" = yes ; then
1879 LIBTOOL_VERSION="-version-number"
1881 LIBTOOL_VERSION="-version-info"
1884 AC_MSG_WARN(VERSION was not set)
1887 ABI_VERSION="$VERSION"
1888 CF_VERBOSE(ABI_VERSION: $ABI_VERSION)
1891 ABI_VERSION=`echo "$VERSION" | sed -e 's/:/./g'`
1892 CF_VERBOSE(ABI_VERSION: $ABI_VERSION)
1895 AC_MSG_WARN(unexpected VERSION value: $VERSION)
1900 AC_SUBST(ABI_VERSION)
1901 AC_SUBST(LIBTOOL_VERSION)
1903 dnl ---------------------------------------------------------------------------
1904 dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33
1905 dnl ---------------------
1906 dnl The rpath-hack makes it simpler to build programs, particularly with the
1907 dnl *BSD ports which may have essential libraries in unusual places. But it
1908 dnl can interfere with building an executable for the base system. Use this
1909 dnl option in that case.
1910 AC_DEFUN([CF_DISABLE_RPATH_HACK],
1912 AC_MSG_CHECKING(if rpath-hack should be disabled)
1913 CF_ARG_DISABLE(rpath-hack,
1914 [ --disable-rpath-hack don't add rpath options for additional libraries],
1915 [cf_disable_rpath_hack=yes],
1916 [cf_disable_rpath_hack=no])
1917 AC_MSG_RESULT($cf_disable_rpath_hack)
1918 if test "$cf_disable_rpath_hack" = no ; then
1922 dnl ---------------------------------------------------------------------------
1923 dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42
1925 dnl Check if the rpath option should be used, setting cache variable
1926 dnl cf_cv_enable_rpath if so.
1927 AC_DEFUN([CF_ENABLE_RPATH],
1929 AC_MSG_CHECKING(if rpath option should be used)
1930 AC_ARG_ENABLE(rpath,
1931 [ --enable-rpath use rpath option when generating shared libraries],
1932 [cf_cv_enable_rpath=$enableval],
1933 [cf_cv_enable_rpath=no])
1934 AC_MSG_RESULT($cf_cv_enable_rpath)
1936 dnl ---------------------------------------------------------------------------
1937 dnl CF_FIND_LIBRARY version: 9 updated: 2008/03/23 14:48:54
1939 dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We
1940 dnl prefer a standard location, and use -L options only if we do not find the
1941 dnl library in the standard library location(s).
1942 dnl $1 = library name
1943 dnl $2 = library class, usually the same as library name
1945 dnl $4 = code fragment to compile/link
1946 dnl $5 = corresponding function-name
1947 dnl $6 = flag, nonnull if failure should not cause an error-exit
1949 dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had
1950 dnl to use a -L option.
1951 AC_DEFUN([CF_FIND_LIBRARY],
1953 eval 'cf_cv_have_lib_'$1'=no'
1956 eval 'cf_cv_have_lib_'$1'=yes',[
1957 cf_save_LIBS="$LIBS"
1958 AC_MSG_CHECKING(for $5 in -l$1)
1960 AC_TRY_LINK([$3],[$4],
1962 eval 'cf_cv_have_lib_'$1'=yes'
1965 CF_LIBRARY_PATH(cf_search,$2)
1966 for cf_libdir in $cf_search
1968 AC_MSG_CHECKING(for -l$1 in $cf_libdir)
1969 LIBS="-L$cf_libdir -l$1 $cf_save_LIBS"
1970 AC_TRY_LINK([$3],[$4],
1972 eval 'cf_cv_have_lib_'$1'=yes'
1975 LIBS="$cf_save_LIBS"])
1979 eval 'cf_found_library=[$]cf_cv_have_lib_'$1
1981 if test $cf_found_library = no ; then
1982 AC_MSG_ERROR(Cannot link $1 library)
1986 dnl ---------------------------------------------------------------------------
1987 dnl CF_FIND_LINKAGE version: 21 updated: 2018/06/20 20:23:13
1989 dnl Find a library (specifically the linkage used in the code fragment),
1990 dnl searching for it if it is not already in the library path.
1991 dnl See also CF_ADD_SEARCHPATH.
1993 dnl Parameters (4-on are optional):
1994 dnl $1 = headers for library entrypoint
1995 dnl $2 = code fragment for library entrypoint
1996 dnl $3 = the library name without the "-l" option or ".so" suffix.
1997 dnl $4 = action to perform if successful (default: update CPPFLAGS, etc)
1998 dnl $5 = action to perform if not successful
1999 dnl $6 = module name, if not the same as the library name
2000 dnl $7 = extra libraries
2002 dnl Sets these variables:
2003 dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found
2004 dnl $cf_cv_header_path_$3 - include-directory if needed
2005 dnl $cf_cv_library_path_$3 - library-directory if needed
2006 dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3
2007 AC_DEFUN([CF_FIND_LINKAGE],[
2009 # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these
2010 # will be set on completion of the AC_TRY_LINK below.
2011 cf_cv_header_path_$3=
2012 cf_cv_library_path_$3=
2014 CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)])
2016 cf_save_LIBS="$LIBS"
2018 AC_TRY_LINK([$1],[$2],[
2019 cf_cv_find_linkage_$3=yes
2020 cf_cv_header_path_$3=/usr/include
2021 cf_cv_library_path_$3=/usr/lib
2024 LIBS="-l$3 $7 $cf_save_LIBS"
2026 AC_TRY_LINK([$1],[$2],[
2027 cf_cv_find_linkage_$3=yes
2028 cf_cv_header_path_$3=/usr/include
2029 cf_cv_library_path_$3=/usr/lib
2030 cf_cv_library_file_$3="-l$3"
2032 cf_cv_find_linkage_$3=no
2033 LIBS="$cf_save_LIBS"
2035 CF_VERBOSE(find linkage for $3 library)
2036 CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)])
2038 cf_save_CPPFLAGS="$CPPFLAGS"
2039 cf_test_CPPFLAGS="$CPPFLAGS"
2041 CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6]))
2042 for cf_cv_header_path_$3 in $cf_search
2044 if test -d $cf_cv_header_path_$3 ; then
2045 CF_VERBOSE(... testing $cf_cv_header_path_$3)
2046 CPPFLAGS="$cf_save_CPPFLAGS"
2047 CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3)
2048 AC_TRY_COMPILE([$1],[$2],[
2049 CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3)
2050 cf_cv_find_linkage_$3=maybe
2051 cf_test_CPPFLAGS="$CPPFLAGS"
2053 CPPFLAGS="$cf_save_CPPFLAGS"
2058 if test "$cf_cv_find_linkage_$3" = maybe ; then
2060 CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)])
2062 cf_save_LIBS="$LIBS"
2063 cf_save_LDFLAGS="$LDFLAGS"
2066 CPPFLAGS="$cf_test_CPPFLAGS"
2067 LIBS="-l$3 $7 $cf_save_LIBS"
2068 AC_TRY_LINK([$1],[$2],[
2069 CF_VERBOSE(... found $3 library in system)
2070 cf_cv_find_linkage_$3=yes])
2071 CPPFLAGS="$cf_save_CPPFLAGS"
2072 LIBS="$cf_save_LIBS"
2075 if test "$cf_cv_find_linkage_$3" != yes ; then
2076 CF_LIBRARY_PATH(cf_search,$3)
2077 for cf_cv_library_path_$3 in $cf_search
2079 if test -d $cf_cv_library_path_$3 ; then
2080 CF_VERBOSE(... testing $cf_cv_library_path_$3)
2081 CPPFLAGS="$cf_test_CPPFLAGS"
2082 LIBS="-l$3 $7 $cf_save_LIBS"
2083 LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3"
2084 AC_TRY_LINK([$1],[$2],[
2085 CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3)
2086 cf_cv_find_linkage_$3=yes
2087 cf_cv_library_file_$3="-l$3"
2089 CPPFLAGS="$cf_save_CPPFLAGS"
2090 LIBS="$cf_save_LIBS"
2091 LDFLAGS="$cf_save_LDFLAGS"
2095 CPPFLAGS="$cf_save_CPPFLAGS"
2096 LDFLAGS="$cf_save_LDFLAGS"
2100 cf_cv_find_linkage_$3=no
2105 LIBS="$cf_save_LIBS"
2107 if test "$cf_cv_find_linkage_$3" = yes ; then
2109 CF_ADD_INCDIR($cf_cv_header_path_$3)
2110 CF_ADD_LIBDIR($cf_cv_library_path_$3)
2114 ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5])
2117 dnl ---------------------------------------------------------------------------
2118 dnl CF_FORGET_TOOL version: 1 updated: 2013/04/06 18:03:09
2120 dnl Forget that we saw the given tool.
2121 AC_DEFUN([CF_FORGET_TOOL],[
2122 unset ac_cv_prog_ac_ct_$1
2126 dnl ---------------------------------------------------------------------------
2127 dnl CF_FUNC_WAIT version: 3 updated: 2012/10/06 08:57:51
2129 dnl Test for the presence of <sys/wait.h>, 'union wait', arg-type of 'wait()'
2130 dnl and/or 'waitpid()'.
2132 dnl Note that we cannot simply grep for 'union wait' in the wait.h file,
2133 dnl because some Posix systems turn this on only when a BSD variable is
2136 dnl I don't use AC_HEADER_SYS_WAIT, because it defines HAVE_SYS_WAIT_H, which
2137 dnl would conflict with an attempt to test that header directly.
2139 AC_DEFUN([CF_FUNC_WAIT],
2141 AC_REQUIRE([CF_UNION_WAIT])
2142 if test $cf_cv_type_unionwait = yes; then
2144 AC_MSG_CHECKING(if union wait can be used as wait-arg)
2145 AC_CACHE_VAL(cf_cv_arg_union_wait,[
2146 AC_TRY_COMPILE($cf_wait_headers,
2147 [union wait x; wait(&x)],
2148 [cf_cv_arg_union_wait=yes],
2149 [cf_cv_arg_union_wait=no])
2151 AC_MSG_RESULT($cf_cv_arg_union_wait)
2152 test $cf_cv_arg_union_wait = yes && AC_DEFINE(WAIT_USES_UNION,1,[Define to 1 if wait() uses a union parameter])
2154 AC_MSG_CHECKING(if union wait can be used as waitpid-arg)
2155 AC_CACHE_VAL(cf_cv_arg_union_waitpid,[
2156 AC_TRY_COMPILE($cf_wait_headers,
2157 [union wait x; waitpid(0, &x, 0)],
2158 [cf_cv_arg_union_waitpid=yes],
2159 [cf_cv_arg_union_waitpid=no])
2161 AC_MSG_RESULT($cf_cv_arg_union_waitpid)
2162 test $cf_cv_arg_union_waitpid = yes && AC_DEFINE(WAITPID_USES_UNION,1,[Define to 1 if waitpid() uses a union parameter])
2166 dnl ---------------------------------------------------------------------------
2167 dnl CF_GCC_ATTRIBUTES version: 17 updated: 2015/04/12 15:39:00
2168 dnl -----------------
2169 dnl Test for availability of useful gcc __attribute__ directives to quiet
2170 dnl compiler warnings. Though useful, not all are supported -- and contrary
2171 dnl to documentation, unrecognized directives cause older compilers to barf.
2172 AC_DEFUN([CF_GCC_ATTRIBUTES],
2174 if test "$GCC" = yes
2176 cat > conftest.i <<EOF
2178 #define GCC_PRINTF 0
2183 #ifndef GCC_NORETURN
2184 #define GCC_NORETURN /* nothing */
2187 #define GCC_UNUSED /* nothing */
2190 if test "$GCC" = yes
2192 AC_CHECKING([for $CC __attribute__ directives])
2193 cat > conftest.$ac_ext <<EOF
2194 #line __oline__ "${as_me:-configure}"
2195 #include "confdefs.h"
2196 #include "conftest.h"
2197 #include "conftest.i"
2199 #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var)))
2201 #define GCC_PRINTFLIKE(fmt,var) /*nothing*/
2204 #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var)))
2206 #define GCC_SCANFLIKE(fmt,var) /*nothing*/
2208 extern void wow(char *,...) GCC_SCANFLIKE(1,2);
2209 extern void oops(char *,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN;
2210 extern void foo(void) GCC_NORETURN;
2211 int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { return 0; }
2213 cf_printf_attribute=no
2214 cf_scanf_attribute=no
2215 for cf_attribute in scanf printf unused noreturn
2217 CF_UPPER(cf_ATTRIBUTE,$cf_attribute)
2218 cf_directive="__attribute__(($cf_attribute))"
2219 echo "checking for $CC $cf_directive" 1>&AC_FD_CC
2221 case $cf_attribute in
2223 cf_printf_attribute=yes
2224 cat >conftest.h <<EOF
2225 #define GCC_$cf_ATTRIBUTE 1
2229 cf_scanf_attribute=yes
2230 cat >conftest.h <<EOF
2231 #define GCC_$cf_ATTRIBUTE 1
2235 cat >conftest.h <<EOF
2236 #define GCC_$cf_ATTRIBUTE $cf_directive
2241 if AC_TRY_EVAL(ac_compile); then
2242 test -n "$verbose" && AC_MSG_RESULT(... $cf_attribute)
2243 cat conftest.h >>confdefs.h
2244 case $cf_attribute in
2246 AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc])
2249 cf_value='/* nothing */'
2250 if test "$cf_printf_attribute" != no ; then
2251 cf_value='__attribute__((format(printf,fmt,var)))'
2252 AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.])
2254 AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc])
2257 cf_value='/* nothing */'
2258 if test "$cf_scanf_attribute" != no ; then
2259 cf_value='__attribute__((format(scanf,fmt,var)))'
2260 AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.])
2262 AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc])
2265 AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc])
2271 fgrep define conftest.i >>confdefs.h
2276 dnl ---------------------------------------------------------------------------
2277 dnl CF_GCC_VERSION version: 7 updated: 2012/10/18 06:46:33
2279 dnl Find version of gcc
2280 AC_DEFUN([CF_GCC_VERSION],[
2281 AC_REQUIRE([AC_PROG_CC])
2283 if test "$GCC" = yes ; then
2284 AC_MSG_CHECKING(version of $CC)
2285 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`"
2286 test -z "$GCC_VERSION" && GCC_VERSION=unknown
2287 AC_MSG_RESULT($GCC_VERSION)
2290 dnl ---------------------------------------------------------------------------
2291 dnl CF_GCC_WARNINGS version: 33 updated: 2018/06/20 20:23:13
2293 dnl Check if the compiler supports useful warning options. There's a few that
2294 dnl we don't use, simply because they're too noisy:
2296 dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x)
2297 dnl -Wredundant-decls (system headers make this too noisy)
2298 dnl -Wtraditional (combines too many unrelated messages, only a few useful)
2299 dnl -Wwrite-strings (too noisy, but should review occasionally). This
2300 dnl is enabled for ncurses using "--enable-const".
2304 dnl $1 is an optional list of gcc warning flags that a particular
2305 dnl application might want to use, e.g., "no-unused" for
2308 dnl If $with_ext_const is "yes", add a check for -Wwrite-strings
2310 AC_DEFUN([CF_GCC_WARNINGS],
2312 AC_REQUIRE([CF_GCC_VERSION])
2313 CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS)
2314 CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS)
2316 cat > conftest.$ac_ext <<EOF
2317 #line __oline__ "${as_me:-configure}"
2318 int main(int argc, char *argv[[]]) { return (argv[[argc-1]] == 0) ; }
2321 if test "$INTEL_COMPILER" = yes
2323 # The "-wdXXX" options suppress warnings:
2324 # remark #1419: external declaration in primary source file
2325 # remark #1683: explicit conversion of a 64-bit integral type to a smaller integral type (potential portability problem)
2326 # remark #1684: conversion from pointer to same-sized integral type (potential portability problem)
2327 # remark #193: zero used for undefined preprocessing identifier
2328 # remark #593: variable "curs_sb_left_arrow" was set but never used
2329 # remark #810: conversion from "int" to "Dimension={unsigned short}" may lose significant bits
2330 # remark #869: parameter "tw" was never referenced
2331 # remark #981: operands are evaluated in unspecified order
2332 # warning #279: controlling expression is constant
2334 AC_CHECKING([for $CC warning options])
2335 cf_save_CFLAGS="$CFLAGS"
2336 EXTRA_CFLAGS="-Wall"
2348 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2349 if AC_TRY_EVAL(ac_compile); then
2350 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
2351 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2354 CFLAGS="$cf_save_CFLAGS"
2356 elif test "$GCC" = yes
2358 AC_CHECKING([for $CC warning options])
2359 cf_save_CFLAGS="$CFLAGS"
2362 test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings"
2363 cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs"
2364 test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings=
2365 for cf_opt in W Wall \
2366 Wbad-function-cast \
2369 Wdeclaration-after-statement \
2372 Wmissing-declarations \
2373 Wmissing-prototypes \
2377 Wstrict-prototypes \
2378 Wundef $cf_gcc_warnings $cf_warn_CONST $1
2380 CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt"
2381 if AC_TRY_EVAL(ac_compile); then
2382 test -n "$verbose" && AC_MSG_RESULT(... -$cf_opt)
2385 CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES)
2388 case $GCC_VERSION in
2390 CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
2395 case $GCC_VERSION in
2397 CF_VERBOSE(feature is broken in gcc $GCC_VERSION)
2402 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt"
2405 CFLAGS="$cf_save_CFLAGS"
2409 AC_SUBST(EXTRA_CFLAGS)
2411 dnl ---------------------------------------------------------------------------
2412 dnl CF_GNU_SOURCE version: 9 updated: 2018/06/20 20:23:13
2414 dnl Check if we must define _GNU_SOURCE to get a reasonable value for
2415 dnl _XOPEN_SOURCE, upon which many POSIX definitions depend. This is a defect
2416 dnl (or misfeature) of glibc2, which breaks portability of many applications,
2417 dnl since it is interwoven with GNU extensions.
2419 dnl Well, yes we could work around it...
2422 dnl $1 is the nominal value for _XOPEN_SOURCE
2423 AC_DEFUN([CF_GNU_SOURCE],
2425 cf_gnu_xopen_source=ifelse($1,,500,$1)
2427 AC_CACHE_CHECK(if this is the GNU C library,cf_cv_gnu_library,[
2428 AC_TRY_COMPILE([#include <sys/types.h>],[
2429 #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0
2432 # error not GNU C library
2434 [cf_cv_gnu_library=yes],
2435 [cf_cv_gnu_library=no])
2438 if test x$cf_cv_gnu_library = xyes; then
2440 # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE
2441 # was changed to help a little...
2442 AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[
2444 CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
2445 AC_TRY_COMPILE([#include <sys/types.h>],[
2446 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2)
2449 # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old
2451 [cf_cv_gnu_library_219=yes],
2452 [cf_cv_gnu_library_219=no])
2456 if test "x$cf_cv_gnu_library_219" = xyes; then
2458 AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[
2459 CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source)
2462 #include <sys/types.h>
2464 #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1)
2467 # error GNU C library is too old
2469 [cf_cv_gnu_dftsrc_219=yes],
2470 [cf_cv_gnu_dftsrc_219=no])
2472 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save"
2474 cf_cv_gnu_dftsrc_219=maybe
2477 if test "x$cf_cv_gnu_dftsrc_219" != xyes; then
2479 AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
2480 AC_TRY_COMPILE([#include <sys/types.h>],[
2481 #ifndef _XOPEN_SOURCE
2482 #error expected _XOPEN_SOURCE to be defined
2484 [cf_cv_gnu_source=no],
2485 [cf_save="$CPPFLAGS"
2486 CF_ADD_CFLAGS(-D_GNU_SOURCE)
2487 AC_TRY_COMPILE([#include <sys/types.h>],[
2488 #ifdef _XOPEN_SOURCE
2489 #error expected _XOPEN_SOURCE to be undefined
2491 [cf_cv_gnu_source=no],
2492 [cf_cv_gnu_source=yes])
2497 if test "$cf_cv_gnu_source" = yes
2499 AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[
2500 CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE)
2501 AC_TRY_COMPILE([#include <sys/types.h>],[
2502 #ifdef _DEFAULT_SOURCE
2503 #error expected _DEFAULT_SOURCE to be undefined
2505 [cf_cv_default_source=no],
2506 [cf_cv_default_source=yes])
2508 if test "$cf_cv_default_source" = yes
2510 CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE)
2517 dnl ---------------------------------------------------------------------------
2518 dnl CF_HEADERS_SH version: 1 updated: 2007/07/04 15:37:05
2520 dnl Setup variables needed to construct headers-sh
2521 AC_DEFUN([CF_HEADERS_SH],[
2524 AC_SUBST(PACKAGE_PREFIX)
2525 AC_SUBST(PACKAGE_CONFIG)
2526 EXTRA_OUTPUT="$EXTRA_OUTPUT headers-sh:$srcdir/headers-sh.in"
2528 dnl ---------------------------------------------------------------------------
2529 dnl CF_HEADER_PATH version: 13 updated: 2015/04/15 19:08:48
2531 dnl Construct a search-list of directories for a nonstandard header-file
2534 dnl $1 = the variable to return as result
2535 dnl $2 = the package name
2536 AC_DEFUN([CF_HEADER_PATH],
2540 # collect the current set of include-directories from compiler flags
2541 cf_header_path_list=""
2542 if test -n "${CFLAGS}${CPPFLAGS}" ; then
2543 for cf_header_path in $CPPFLAGS $CFLAGS
2545 case $cf_header_path in
2547 cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'`
2548 CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE)
2549 cf_header_path_list="$cf_header_path_list [$]$1"
2555 # add the variations for the package we are looking for
2556 CF_SUBDIR_PATH($1,$2,include)
2558 test "$includedir" != NONE && \
2559 test "$includedir" != "/usr/include" && \
2560 test -d "$includedir" && {
2561 test -d $includedir && $1="[$]$1 $includedir"
2562 test -d $includedir/$2 && $1="[$]$1 $includedir/$2"
2565 test "$oldincludedir" != NONE && \
2566 test "$oldincludedir" != "/usr/include" && \
2567 test -d "$oldincludedir" && {
2568 test -d $oldincludedir && $1="[$]$1 $oldincludedir"
2569 test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2"
2572 $1="[$]$1 $cf_header_path_list"
2574 dnl ---------------------------------------------------------------------------
2575 dnl CF_INTEL_COMPILER version: 7 updated: 2015/04/12 15:39:00
2576 dnl -----------------
2577 dnl Check if the given compiler is really the Intel compiler for Linux. It
2578 dnl tries to imitate gcc, but does not return an error when it finds a mismatch
2579 dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK.
2581 dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to
2582 dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from
2583 dnl the wrappers for gcc and g++ warnings.
2585 dnl $1 = GCC (default) or GXX
2586 dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS
2587 dnl $3 = CFLAGS (default) or CXXFLAGS
2588 AC_DEFUN([CF_INTEL_COMPILER],[
2589 AC_REQUIRE([AC_CANONICAL_HOST])
2590 ifelse([$2],,INTEL_COMPILER,[$2])=no
2592 if test "$ifelse([$1],,[$1],GCC)" = yes ; then
2595 AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler)
2596 cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])"
2597 ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc"
2599 #ifdef __INTEL_COMPILER
2603 ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes
2604 cf_save_CFLAGS="$cf_save_CFLAGS -we147"
2606 ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS"
2607 AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2]))
2612 dnl ---------------------------------------------------------------------------
2613 dnl CF_LARGEFILE version: 11 updated: 2018/06/20 20:23:13
2615 dnl Add checks for large file support.
2616 AC_DEFUN([CF_LARGEFILE],[
2617 ifdef([AC_FUNC_FSEEKO],[
2619 if test "$enable_largefile" != no ; then
2622 # Normally we would collect these definitions in the config.h,
2623 # but (like _XOPEN_SOURCE), some environments rely on having these
2624 # defined before any of the system headers are included. Another
2625 # case comes up with C++, e.g., on AIX the compiler compiles the
2626 # header files by themselves before looking at the body files it is
2627 # told to compile. For ncurses, those header files do not include
2629 if test "$ac_cv_sys_large_files" != no
2631 CF_APPEND_TEXT(CPPFLAGS,-D_LARGE_FILES)
2633 if test "$ac_cv_sys_largefile_source" != no
2635 CF_APPEND_TEXT(CPPFLAGS,-D_LARGEFILE_SOURCE)
2637 if test "$ac_cv_sys_file_offset_bits" != no
2639 CF_APPEND_TEXT(CPPFLAGS,-D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits)
2642 AC_CACHE_CHECK(whether to use struct dirent64, cf_cv_struct_dirent64,[
2644 #pragma GCC diagnostic error "-Wincompatible-pointer-types"
2645 #include <sys/types.h>
2648 /* if transitional largefile support is setup, this is true */
2649 extern struct dirent64 * readdir(DIR *);
2650 struct dirent64 *x = readdir((DIR *)0);
2651 struct dirent *y = readdir((DIR *)0);
2654 [cf_cv_struct_dirent64=yes],
2655 [cf_cv_struct_dirent64=no])
2657 test "$cf_cv_struct_dirent64" = yes && AC_DEFINE(HAVE_STRUCT_DIRENT64,1,[Define to 1 if we have struct dirent64])
2661 dnl ---------------------------------------------------------------------------
2662 dnl CF_LD_RPATH_OPT version: 7 updated: 2016/02/20 18:01:19
2664 dnl For the given system and compiler, find the compiler flags to pass to the
2665 dnl loader to use the "rpath" feature.
2666 AC_DEFUN([CF_LD_RPATH_OPT],
2668 AC_REQUIRE([CF_CHECK_CACHE])
2671 AC_MSG_CHECKING(for an rpath option)
2672 case $cf_cv_system_name in
2674 if test "$GCC" = yes; then
2675 LD_RPATH_OPT="-Wl,-rpath,"
2677 LD_RPATH_OPT="-rpath "
2680 (linux*|gnu*|k*bsd*-gnu|freebsd*)
2681 LD_RPATH_OPT="-Wl,-rpath,"
2683 (openbsd[[2-9]].*|mirbsd*)
2684 LD_RPATH_OPT="-Wl,-rpath,"
2687 LD_RPATH_OPT="-rpath "
2690 LD_RPATH_OPT="-Wl,-rpath,"
2693 LD_RPATH_OPT="-rpath "
2701 AC_MSG_RESULT($LD_RPATH_OPT)
2703 case "x$LD_RPATH_OPT" in
2705 AC_MSG_CHECKING(if we need a space after rpath option)
2706 cf_save_LIBS="$LIBS"
2707 CF_ADD_LIBS(${LD_RPATH_OPT}$libdir)
2708 AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes)
2709 LIBS="$cf_save_LIBS"
2710 AC_MSG_RESULT($cf_rpath_space)
2711 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT "
2715 dnl ---------------------------------------------------------------------------
2716 dnl CF_LIBRARY_PATH version: 10 updated: 2015/04/15 19:08:48
2718 dnl Construct a search-list of directories for a nonstandard library-file
2721 dnl $1 = the variable to return as result
2722 dnl $2 = the package name
2723 AC_DEFUN([CF_LIBRARY_PATH],
2726 cf_library_path_list=""
2727 if test -n "${LDFLAGS}${LIBS}" ; then
2728 for cf_library_path in $LDFLAGS $LIBS
2730 case $cf_library_path in
2732 cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'`
2733 CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE)
2734 cf_library_path_list="$cf_library_path_list [$]$1"
2740 CF_SUBDIR_PATH($1,$2,lib)
2742 $1="$cf_library_path_list [$]$1"
2744 dnl ---------------------------------------------------------------------------
2745 dnl CF_LIBTOOL_VERSION version: 1 updated: 2013/04/06 18:03:09
2746 dnl ------------------
2747 AC_DEFUN([CF_LIBTOOL_VERSION],[
2748 if test -n "$LIBTOOL" && test "$LIBTOOL" != none
2750 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.]].*//'`
2752 cf_cv_libtool_version=
2754 test -z "$cf_cv_libtool_version" && unset cf_cv_libtool_version
2756 dnl ---------------------------------------------------------------------------
2757 dnl CF_LIB_PREFIX version: 12 updated: 2015/10/17 19:03:33
2759 dnl Compute the library-prefix for the given host system
2760 dnl $1 = variable to set
2761 define([CF_LIB_PREFIX],
2763 case $cf_cv_system_name in
2765 if test "$DFT_LWR_MODEL" = libtool; then
2771 (*) LIB_PREFIX='lib'
2774 ifelse($1,,,[$1=$LIB_PREFIX])
2775 AC_SUBST(LIB_PREFIX)
2777 dnl ---------------------------------------------------------------------------
2778 dnl CF_LIB_SUFFIX version: 25 updated: 2015/04/17 21:13:04
2780 dnl Compute the library file-suffix from the given model name
2782 dnl $2 = variable to set (the nominal library suffix)
2783 dnl $3 = dependency variable to set (actual filename)
2784 dnl The variable $LIB_SUFFIX, if set, prepends the variable to set.
2785 AC_DEFUN([CF_LIB_SUFFIX],
2801 case $cf_cv_system_name in
2806 (cygwin*|msys*|mingw*)
2837 if test -n "${LIB_SUFFIX}${EXTRA_SUFFIX}"
2839 $2="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$2}"
2840 $3="${LIB_SUFFIX}${EXTRA_SUFFIX}[$]{$3}"
2843 dnl ---------------------------------------------------------------------------
2844 dnl CF_MAKEFLAGS version: 18 updated: 2018/02/21 21:26:03
2846 dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make'
2847 dnl options to lower-levels. It's very useful for "make -n" -- if we have it.
2848 dnl (GNU 'make' does both, something POSIX 'make', which happens to make the
2849 dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-)
2850 AC_DEFUN([CF_MAKEFLAGS],
2852 AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[
2854 for cf_option in '-${MAKEFLAGS}' '${MFLAGS}'
2856 cat >cf_makeflags.tmp <<CF_EOF
2859 @ echo '.$cf_option'
2861 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'`
2862 case "$cf_result" in
2864 cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`
2865 case "$cf_result" in
2866 (.*CC=*) cf_cv_makeflags=
2868 (*) cf_cv_makeflags=$cf_option
2876 CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\")
2880 rm -f cf_makeflags.tmp
2883 AC_SUBST(cf_cv_makeflags)
2885 dnl ---------------------------------------------------------------------------
2886 dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32
2888 dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have
2889 dnl a monocase filesystem.
2890 AC_DEFUN([CF_MAKE_TAGS],[
2891 AC_REQUIRE([CF_MIXEDCASE_FILENAMES])
2893 AC_CHECK_PROGS(CTAGS, exctags ctags)
2894 AC_CHECK_PROGS(ETAGS, exetags etags)
2896 AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no)
2898 if test "$cf_cv_mixedcase" = yes ; then
2899 AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no)
2904 if test "$MAKE_UPPER_TAGS" = yes ; then
2910 if test "$MAKE_LOWER_TAGS" = yes ; then
2919 AC_SUBST(MAKE_UPPER_TAGS)
2920 AC_SUBST(MAKE_LOWER_TAGS)
2922 dnl ---------------------------------------------------------------------------
2923 dnl CF_MATH_LIB version: 9 updated: 2017/01/21 11:06:25
2925 dnl Checks for libraries. At least one UNIX system, Apple Macintosh
2926 dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler
2927 dnl AC_CHECK_LIB(m,sin), because that fails for C++.
2928 AC_DEFUN([CF_MATH_LIB],
2930 AC_CACHE_CHECK(if -lm needed for math functions,
2937 [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)],
2938 [cf_cv_need_libm=no],
2939 [cf_cv_need_libm=yes])])
2940 if test "$cf_cv_need_libm" = yes
2947 dnl ---------------------------------------------------------------------------
2948 dnl CF_MBSTATE_T version: 4 updated: 2012/10/06 08:57:51
2950 dnl Check if mbstate_t is declared, and if so, which header file.
2951 dnl This (including wchar.h) is needed on Tru64 5.0 to declare mbstate_t,
2952 dnl as well as include stdio.h to work around a misuse of varargs in wchar.h
2953 AC_DEFUN([CF_MBSTATE_T],
2955 AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_mbstate_t,[
2959 #ifdef HAVE_LIBUTF8_H
2960 #include <libutf8.h>
2963 [cf_cv_mbstate_t=no],
2968 #ifdef HAVE_LIBUTF8_H
2969 #include <libutf8.h>
2972 [cf_cv_mbstate_t=yes],
2973 [cf_cv_mbstate_t=unknown])])])
2975 if test "$cf_cv_mbstate_t" = yes ; then
2976 AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
2979 if test "$cf_cv_mbstate_t" != unknown ; then
2980 AC_DEFINE(HAVE_MBSTATE_T,1,[Define to 1 if mbstate_t is declared])
2983 dnl ---------------------------------------------------------------------------
2984 dnl CF_MIXEDCASE_FILENAMES version: 7 updated: 2015/04/12 15:39:00
2985 dnl ----------------------
2986 dnl Check if the file-system supports mixed-case filenames. If we're able to
2987 dnl create a lowercase name and see it as uppercase, it doesn't support that.
2988 AC_DEFUN([CF_MIXEDCASE_FILENAMES],
2990 AC_CACHE_CHECK(if filesystem supports mixed-case filenames,cf_cv_mixedcase,[
2991 if test "$cross_compiling" = yes ; then
2992 case $target_alias in
2993 (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*)
3001 rm -f conftest CONFTEST
3003 if test -f CONFTEST ; then
3008 rm -f conftest CONFTEST
3011 test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.])
3013 dnl ---------------------------------------------------------------------------
3014 dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32
3016 dnl Write a debug message to config.log, along with the line number in the
3017 dnl configure script.
3018 AC_DEFUN([CF_MSG_LOG],[
3019 echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC
3021 dnl ---------------------------------------------------------------------------
3022 dnl CF_NCURSES_CC_CHECK version: 4 updated: 2007/07/29 10:39:05
3023 dnl -------------------
3024 dnl Check if we can compile with ncurses' header file
3025 dnl $1 is the cache variable to set
3026 dnl $2 is the header-file to include
3027 dnl $3 is the root name (ncurses or ncursesw)
3028 AC_DEFUN([CF_NCURSES_CC_CHECK],[
3030 ]ifelse($3,ncursesw,[
3031 #define _XOPEN_SOURCE_EXTENDED
3032 #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */
3033 #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */
3036 #ifdef NCURSES_VERSION
3037 ]ifelse($3,ncursesw,[
3042 printf("%s\n", NCURSES_VERSION);
3054 dnl ---------------------------------------------------------------------------
3055 dnl CF_NCURSES_CONFIG version: 21 updated: 2018/06/20 20:23:13
3056 dnl -----------------
3057 dnl Tie together the configure-script macros for ncurses, preferring these in
3059 dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG
3060 dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG
3061 dnl c) just plain libraries
3063 dnl $1 is the root library name (default: "ncurses")
3064 AC_DEFUN([CF_NCURSES_CONFIG],[
3065 AC_REQUIRE([CF_PKG_CONFIG])
3066 cf_ncuconfig_root=ifelse($1,,ncurses,$1)
3067 cf_have_ncuconfig=no
3069 if test "x${PKG_CONFIG:=none}" != xnone; then
3070 AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root)
3071 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then
3074 AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work)
3075 cf_have_ncuconfig=unknown
3077 cf_save_CPPFLAGS="$CPPFLAGS"
3078 cf_save_LIBS="$LIBS"
3080 CF_ADD_CFLAGS(`$PKG_CONFIG --cflags $cf_ncuconfig_root`)
3081 CF_ADD_LIBS(`$PKG_CONFIG --libs $cf_ncuconfig_root`)
3083 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
3084 [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
3085 [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}>
3087 { char *xx = curses_version(); return (xx == 0); }],
3088 [cf_have_ncuconfig=yes],
3089 [cf_have_ncuconfig=no],
3090 [cf_have_ncuconfig=maybe])],
3091 [cf_have_ncuconfig=no])
3092 AC_MSG_RESULT($cf_have_ncuconfig)
3093 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes
3094 if test "$cf_have_ncuconfig" != "yes"
3096 CPPFLAGS="$cf_save_CPPFLAGS"
3097 LIBS="$cf_save_LIBS"
3098 NCURSES_CONFIG_PKG=none
3100 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3101 NCURSES_CONFIG_PKG=$cf_ncuconfig_root
3107 NCURSES_CONFIG_PKG=none
3110 NCURSES_CONFIG_PKG=none
3113 if test "x$cf_have_ncuconfig" = "xno"; then
3114 cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}"
3116 CF_ACVERSION_CHECK(2.52,
3117 [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)],
3118 [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)])
3120 if test "$NCURSES_CONFIG" != none ; then
3122 CF_ADD_CFLAGS(`$NCURSES_CONFIG --cflags`)
3123 CF_ADD_LIBS(`$NCURSES_CONFIG --libs`)
3125 # even with config script, some packages use no-override for curses.h
3126 CF_CURSES_HEADER(ifelse($1,,ncurses,$1))
3128 dnl like CF_NCURSES_CPPFLAGS
3129 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3131 dnl like CF_NCURSES_LIBS
3132 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root)
3133 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
3135 dnl like CF_NCURSES_VERSION
3136 cf_cv_ncurses_version=`$NCURSES_CONFIG --version`
3140 CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1))
3141 CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
3148 dnl ---------------------------------------------------------------------------
3149 dnl CF_NCURSES_CPPFLAGS version: 21 updated: 2012/10/06 08:57:51
3150 dnl -------------------
3151 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
3152 dnl the CPPFLAGS variable so we can include its header.
3154 dnl The header files may be installed as either curses.h, or ncurses.h (would
3155 dnl be obsolete, except that some packagers prefer this name to distinguish it
3156 dnl from a "native" curses implementation). If not installed for overwrite,
3157 dnl the curses.h file would be in an ncurses subdirectory (e.g.,
3158 dnl /usr/include/ncurses), but someone may have installed overwriting the
3159 dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd
3160 dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in
3163 dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
3164 dnl is already in the include-path, don't even bother with this, since we cannot
3165 dnl easily determine which file it is. In this case, it has to be <curses.h>.
3167 dnl The optional parameter gives the root name of the library, in case it is
3168 dnl not installed as the default curses library. That is how the
3169 dnl wide-character version of ncurses is installed.
3170 AC_DEFUN([CF_NCURSES_CPPFLAGS],
3171 [AC_REQUIRE([CF_WITH_CURSES_DIR])
3173 AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl
3174 cf_ncuhdr_root=ifelse($1,,ncurses,$1)
3176 test -n "$cf_cv_curses_dir" && \
3177 test "$cf_cv_curses_dir" != "no" && { \
3178 CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
3181 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
3182 cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
3183 ( test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw ) && cf_header_list="$cf_header_list curses.h ncurses.h"
3184 for cf_header in $cf_header_list
3186 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1)
3187 test "$cf_cv_ncurses_h" != no && break
3194 # some applications need this, but should check for NCURSES_VERSION
3195 AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3199 dnl ---------------------------------------------------------------------------
3200 dnl CF_NCURSES_HEADER version: 4 updated: 2015/04/15 19:08:48
3201 dnl -----------------
3202 dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common
3203 dnl variations of ncurses' installs.
3205 dnl See also CF_CURSES_HEADER, which sets the same cache variable.
3206 AC_DEFUN([CF_NCURSES_HEADER],[
3208 if test "$cf_cv_ncurses_h" != no ; then
3209 cf_cv_ncurses_header=$cf_cv_ncurses_h
3212 AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
3213 test -n "$verbose" && echo
3214 CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
3215 test -n "$verbose" && echo search path $cf_search
3216 cf_save2_CPPFLAGS="$CPPFLAGS"
3217 for cf_incdir in $cf_search
3219 CF_ADD_INCDIR($cf_incdir)
3224 CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1)
3225 if test "$cf_cv_ncurses_h2" != no ; then
3226 cf_cv_ncurses_h2=$cf_incdir/$cf_header
3227 test -n "$verbose" && echo $ac_n " ... found $ac_c" 1>&AC_FD_MSG
3230 test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG
3232 CPPFLAGS="$cf_save2_CPPFLAGS"
3233 test "$cf_cv_ncurses_h2" != no && break
3235 test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found)
3238 CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2)
3239 cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
3240 if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
3241 cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
3243 CF_ADD_INCDIR($cf_1st_incdir)
3247 # Set definitions to allow ifdef'ing for ncurses.h
3249 case $cf_cv_ncurses_header in
3251 AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h])
3255 case $cf_cv_ncurses_header in
3256 (ncurses/curses.h|ncurses/ncurses.h)
3257 AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h])
3259 (ncursesw/curses.h|ncursesw/ncurses.h)
3260 AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h])
3265 dnl ---------------------------------------------------------------------------
3266 dnl CF_NCURSES_LIBS version: 17 updated: 2015/04/15 19:08:48
3268 dnl Look for the ncurses library. This is a little complicated on Linux,
3269 dnl because it may be linked with the gpm (general purpose mouse) library.
3270 dnl Some distributions have gpm linked with (bsd) curses, which makes it
3271 dnl unusable with ncurses. However, we don't want to link with gpm unless
3272 dnl ncurses has a dependency, since gpm is normally set up as a shared library,
3273 dnl and the linker will record a dependency.
3275 dnl The optional parameter gives the root name of the library, in case it is
3276 dnl not installed as the default curses library. That is how the
3277 dnl wide-character version of ncurses is installed.
3278 AC_DEFUN([CF_NCURSES_LIBS],
3279 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
3281 cf_nculib_root=ifelse($1,,ncurses,$1)
3282 # This works, except for the special case where we find gpm, but
3283 # ncurses is in a nonstandard location via $LIBS, and we really want
3286 cf_ncurses_SAVE="$LIBS"
3287 AC_CHECK_LIB(gpm,Gpm_Open,
3288 [AC_CHECK_LIB(gpm,initscr,
3289 [LIBS="$cf_ncurses_SAVE"],
3290 [cf_ncurses_LIBS="-lgpm"])])
3294 # This is only necessary if you are linking against an obsolete
3295 # version of ncurses (but it should do no harm, since it's static).
3296 if test "$cf_nculib_root" = ncurses ; then
3297 AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"])
3302 CF_ADD_LIBS($cf_ncurses_LIBS)
3304 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
3306 CF_ADD_LIBS(-l$cf_nculib_root)
3308 CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
3309 [#include <${cf_cv_ncurses_header:-curses.h}>],
3314 if test -n "$cf_ncurses_LIBS" ; then
3315 AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
3316 cf_ncurses_SAVE="$LIBS"
3317 for p in $cf_ncurses_LIBS ; do
3318 q=`echo $LIBS | sed -e "s%$p %%" -e "s%$p$%%"`
3319 if test "$q" != "$LIBS" ; then
3323 AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>],
3324 [initscr(); mousemask(0,0); tgoto((char *)0, 0, 0);],
3325 [AC_MSG_RESULT(yes)],
3327 LIBS="$cf_ncurses_SAVE"])
3330 CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root)
3331 AC_DEFINE_UNQUOTED($cf_nculib_ROOT)
3333 dnl ---------------------------------------------------------------------------
3334 dnl CF_NCURSES_PTHREADS version: 2 updated: 2016/04/22 05:07:41
3335 dnl -------------------
3336 dnl Use this followup check to ensure that we link with pthreads if ncurses
3338 AC_DEFUN([CF_NCURSES_PTHREADS],[
3339 : ${cf_nculib_root:=ifelse($1,,ncurses,$1)}
3340 AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads,
3341 cf_cv_ncurses_pthreads=yes,
3342 cf_cv_ncurses_pthreads=no)
3343 if test "$cf_cv_ncurses_pthreads" = yes
3345 CF_ADD_LIBS(-lpthread)
3348 dnl ---------------------------------------------------------------------------
3349 dnl CF_NCURSES_VERSION version: 15 updated: 2017/05/09 19:26:10
3350 dnl ------------------
3351 dnl Check for the version of ncurses, to aid in reporting bugs, etc.
3352 dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use
3353 dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi.
3354 AC_DEFUN([CF_NCURSES_VERSION],
3356 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
3357 AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[
3358 cf_cv_ncurses_version=no
3362 #include <${cf_cv_ncurses_header:-curses.h}>
3366 FILE *fp = fopen("$cf_tempfile", "w");
3367 #ifdef NCURSES_VERSION
3368 # ifdef NCURSES_VERSION_PATCH
3369 fprintf(fp, "%s.%d\n", NCURSES_VERSION, NCURSES_VERSION_PATCH);
3371 fprintf(fp, "%s\n", NCURSES_VERSION);
3375 fprintf(fp, "old\n");
3380 ${cf_cv_main_return:-return}(0);
3382 cf_cv_ncurses_version=`cat $cf_tempfile`],,[
3384 # This will not work if the preprocessor splits the line after the
3385 # Autoconf token. The 'unproto' program does that.
3386 cat > conftest.$ac_ext <<EOF
3387 #include <${cf_cv_ncurses_header:-curses.h}>
3389 #ifdef NCURSES_VERSION
3390 Autoconf NCURSES_VERSION
3398 cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out"
3400 if test -f conftest.out ; then
3401 cf_out=`cat conftest.out | sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%'`
3402 test -n "$cf_out" && cf_cv_ncurses_version="$cf_out"
3408 test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries])
3410 dnl ---------------------------------------------------------------------------
3411 dnl CF_NL_LANGINFO_1STDAY version: 1 updated: 2016/02/08 19:06:25
3412 dnl ---------------------
3413 dnl glibc locale support has runtime extensions which might be implemented in
3415 AC_DEFUN([CF_NL_LANGINFO_1STDAY],[
3416 AC_CACHE_CHECK(if runtime has nl_langinfo support for first weekday,
3417 cf_nl_langinfo_1stday,[
3419 #include <langinfo.h>
3422 int first_weekday = nl_langinfo (_NL_TIME_FIRST_WEEKDAY)[0];
3423 long week_1stday_l = (long) nl_langinfo (_NL_TIME_WEEK_1STDAY);
3424 ],[cf_nl_langinfo_1stday=yes
3425 ],[cf_nl_langinfo_1stday=no
3428 test "x$cf_nl_langinfo_1stday" = xyes && AC_DEFINE(HAVE_NL_LANGINFO_1STDAY)
3430 dnl ---------------------------------------------------------------------------
3431 dnl CF_NO_LEAKS_OPTION version: 6 updated: 2015/04/12 15:39:00
3432 dnl ------------------
3433 dnl see CF_WITH_NO_LEAKS
3434 AC_DEFUN([CF_NO_LEAKS_OPTION],[
3435 AC_MSG_CHECKING(if you want to use $1 for testing)
3438 [AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[
3441 : ${with_cflags:=-g}
3442 : ${with_no_leaks:=yes}
3445 AC_MSG_RESULT(${with_$1:-no})
3447 case .$with_cflags in
3459 dnl ---------------------------------------------------------------------------
3460 dnl CF_NUMBER_SYNTAX version: 2 updated: 2015/04/17 21:13:04
3461 dnl ----------------
3462 dnl Check if the given variable is a number. If not, report an error.
3463 dnl $1 is the variable
3464 dnl $2 is the message
3465 AC_DEFUN([CF_NUMBER_SYNTAX],[
3466 if test -n "$1" ; then
3471 AC_MSG_ERROR($2 is not a number: $1)
3475 AC_MSG_ERROR($2 value is empty)
3478 dnl ---------------------------------------------------------------------------
3479 dnl CF_OUR_MESSAGES version: 7 updated: 2004/09/12 19:45:55
3481 dnl Check if we use the messages included with this program
3483 dnl $1 specifies either Makefile or makefile, defaulting to the former.
3485 dnl Sets variables which can be used to substitute in makefiles:
3486 dnl MSG_DIR_MAKE - to make ./po directory
3487 dnl SUB_MAKEFILE - makefile in ./po directory (see CF_BUNDLED_INTL)
3489 AC_DEFUN([CF_OUR_MESSAGES],
3491 cf_makefile=ifelse($1,,Makefile,$1)
3494 if test "$USE_NLS" = yes ; then
3495 if test -d $srcdir/po ; then
3496 AC_MSG_CHECKING(if we should use included message-library)
3497 AC_ARG_ENABLE(included-msgs,
3498 [ --disable-included-msgs use included messages, for i18n support],
3499 [use_our_messages=$enableval],
3500 [use_our_messages=yes])
3502 AC_MSG_RESULT($use_our_messages)
3506 if test "$use_our_messages" = yes
3508 SUB_MAKEFILE="$SUB_MAKEFILE po/$cf_makefile.in:$srcdir/po/$cf_makefile.inn"
3512 AC_SUBST(MSG_DIR_MAKE)
3513 AC_SUBST(SUB_MAKEFILE)
3515 dnl ---------------------------------------------------------------------------
3516 dnl CF_PATHSEP version: 7 updated: 2015/04/12 15:39:00
3518 dnl Provide a value for the $PATH and similar separator (or amend the value
3519 dnl as provided in autoconf 2.5x).
3520 AC_DEFUN([CF_PATHSEP],
3522 AC_MSG_CHECKING(for PATH separator)
3523 case $cf_cv_system_name in
3524 (os2*) PATH_SEPARATOR=';' ;;
3525 (*) ${PATH_SEPARATOR:=':'} ;;
3527 ifelse([$1],,,[$1=$PATH_SEPARATOR])
3528 AC_SUBST(PATH_SEPARATOR)
3529 AC_MSG_RESULT($PATH_SEPARATOR)
3531 dnl ---------------------------------------------------------------------------
3532 dnl CF_PATH_SYNTAX version: 16 updated: 2015/04/18 08:56:57
3534 dnl Check the argument to see that it looks like a pathname. Rewrite it if it
3535 dnl begins with one of the prefix/exec_prefix variables, and then again if the
3536 dnl result begins with 'NONE'. This is necessary to work around autoconf's
3537 dnl delayed evaluation of those symbols.
3538 AC_DEFUN([CF_PATH_SYNTAX],[
3539 if test "x$prefix" != xNONE; then
3540 cf_path_syntax="$prefix"
3542 cf_path_syntax="$ac_default_prefix"
3546 (.\[$]\(*\)*|.\'*\'*)
3550 (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX
3552 (.\[$]{*prefix}*|.\[$]{*dir}*)
3556 $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
3561 $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%`
3564 ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2)
3568 dnl ---------------------------------------------------------------------------
3569 dnl CF_PDCURSES_X11 version: 14 updated: 2018/06/20 20:23:13
3571 dnl Configure for PDCurses' X11 library
3572 AC_DEFUN([CF_PDCURSES_X11],[
3573 AC_REQUIRE([CF_X_ATHENA])
3575 CF_ACVERSION_CHECK(2.52,
3576 [AC_CHECK_TOOLS(XCURSES_CONFIG, xcurses-config, none)],
3577 [AC_PATH_PROGS(XCURSES_CONFIG, xcurses-config, none)])
3579 if test "$XCURSES_CONFIG" != none ; then
3581 CF_ADD_CFLAGS(`$XCURSES_CONFIG --cflags`)
3582 CF_ADD_LIBS(`$XCURSES_CONFIG --libs`)
3584 cf_cv_lib_XCurses=yes
3588 LDFLAGS="$LDFLAGS $X_LIBS"
3589 CF_CHECK_CFLAGS($X_CFLAGS)
3590 AC_CHECK_LIB(X11,XOpenDisplay,
3591 [CF_ADD_LIBS(-lX11)],,
3592 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])
3593 AC_CACHE_CHECK(for XCurses library,cf_cv_lib_XCurses,[
3594 CF_ADD_LIBS(-lXCurses)
3596 #include <xcurses.h>
3597 char *XCursesProgramName = "test";
3599 [cf_cv_lib_XCurses=yes],
3600 [cf_cv_lib_XCurses=no])
3605 if test $cf_cv_lib_XCurses = yes ; then
3606 AC_DEFINE(UNIX,1,[Define to 1 if using PDCurses on Unix])
3607 AC_DEFINE(XCURSES,1,[Define to 1 if using PDCurses on Unix])
3608 AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES,1,[Define to 1 if using PDCurses on Unix]))
3610 AC_MSG_ERROR(Cannot link with XCurses)
3613 dnl ---------------------------------------------------------------------------
3614 dnl CF_PKG_CONFIG version: 10 updated: 2015/04/26 18:06:58
3616 dnl Check for the package-config program, unless disabled by command-line.
3617 AC_DEFUN([CF_PKG_CONFIG],
3619 AC_MSG_CHECKING(if you want to use pkg-config)
3620 AC_ARG_WITH(pkg-config,
3621 [ --with-pkg-config{=path} enable/disable use of pkg-config],
3622 [cf_pkg_config=$withval],
3623 [cf_pkg_config=yes])
3624 AC_MSG_RESULT($cf_pkg_config)
3626 case $cf_pkg_config in
3631 CF_ACVERSION_CHECK(2.52,
3632 [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)],
3633 [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)])
3640 test -z "$PKG_CONFIG" && PKG_CONFIG=none
3641 if test "$PKG_CONFIG" != none ; then
3642 CF_PATH_SYNTAX(PKG_CONFIG)
3643 elif test "x$cf_pkg_config" != xno ; then
3644 AC_MSG_WARN(pkg-config is not installed)
3647 AC_SUBST(PKG_CONFIG)
3649 dnl ---------------------------------------------------------------------------
3650 dnl CF_POSIX_C_SOURCE version: 10 updated: 2018/06/20 20:23:13
3651 dnl -----------------
3652 dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed.
3654 dnl POSIX.1-1990 _POSIX_SOURCE
3655 dnl POSIX.1-1990 and _POSIX_SOURCE and
3656 dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2
3658 dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L
3659 dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L
3660 dnl X/Open 2000 _POSIX_C_SOURCE=200112L
3663 dnl $1 is the nominal value for _POSIX_C_SOURCE
3664 AC_DEFUN([CF_POSIX_C_SOURCE],
3666 cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1])
3668 cf_save_CFLAGS="$CFLAGS"
3669 cf_save_CPPFLAGS="$CPPFLAGS"
3671 CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE)
3672 CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE)
3674 AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[
3675 CF_MSG_LOG(if the symbol is already defined go no further)
3676 AC_TRY_COMPILE([#include <sys/types.h>],[
3677 #ifndef _POSIX_C_SOURCE
3680 [cf_cv_posix_c_source=no],
3681 [cf_want_posix_source=no
3682 case .$cf_POSIX_C_SOURCE in
3684 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3687 cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE"
3688 cf_want_posix_source=yes
3691 cf_want_posix_source=yes
3694 if test "$cf_want_posix_source" = yes ; then
3695 AC_TRY_COMPILE([#include <sys/types.h>],[
3696 #ifdef _POSIX_SOURCE
3699 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE")
3701 CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE)
3702 CFLAGS="$cf_trim_CFLAGS"
3703 CPPFLAGS="$cf_trim_CPPFLAGS"
3704 CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source)
3705 CF_MSG_LOG(if the second compile does not leave our definition intact error)
3706 AC_TRY_COMPILE([#include <sys/types.h>],[
3707 #ifndef _POSIX_C_SOURCE
3710 [cf_cv_posix_c_source=no])
3711 CFLAGS="$cf_save_CFLAGS"
3712 CPPFLAGS="$cf_save_CPPFLAGS"
3716 if test "$cf_cv_posix_c_source" != no ; then
3717 CFLAGS="$cf_trim_CFLAGS"
3718 CPPFLAGS="$cf_trim_CPPFLAGS"
3719 CF_ADD_CFLAGS($cf_cv_posix_c_source)
3723 dnl ---------------------------------------------------------------------------
3724 dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22
3726 dnl Check for archiver "ar".
3727 AC_DEFUN([CF_PROG_AR],[
3728 AC_CHECK_TOOL(AR, ar, ar)
3730 dnl ---------------------------------------------------------------------------
3731 dnl CF_PROG_CC version: 4 updated: 2014/07/12 18:57:58
3733 dnl standard check for CC, plus followup sanity checks
3734 dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name
3735 AC_DEFUN([CF_PROG_CC],[
3736 ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)])
3738 CF_ACVERSION_CHECK(2.52,
3743 dnl ---------------------------------------------------------------------------
3744 dnl CF_PROG_EXT version: 14 updated: 2018/06/20 20:23:13
3746 dnl Compute $PROG_EXT, used for non-Unix ports, such as OS/2 EMX.
3747 AC_DEFUN([CF_PROG_EXT],
3749 AC_REQUIRE([CF_CHECK_CACHE])
3750 case $cf_cv_system_name in
3752 CFLAGS="$CFLAGS -Zmt"
3753 CF_APPEND_TEXT(CPPFLAGS,-D__ST_MT_ERRNO__)
3754 CXXFLAGS="$CXXFLAGS -Zmt"
3755 # autoconf's macro sets -Zexe and suffix both, which conflict:w
3756 LDFLAGS="$LDFLAGS -Zmt -Zcrtdll"
3766 test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT",[Define to the program extension (normally blank)])
3768 dnl ---------------------------------------------------------------------------
3769 dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19
3771 dnl Check if groff is available, for cases (such as html output) where nroff
3773 AC_DEFUN([CF_PROG_GROFF],[
3774 AC_PATH_PROG(GROFF_PATH,groff,no)
3775 AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no)
3776 AC_PATH_PROG(TBL_PATH,tbl,cat)
3777 if test "x$GROFF_PATH" = xno
3785 AC_SUBST(GROFF_NOTE)
3786 AC_SUBST(NROFF_NOTE)
3788 dnl ---------------------------------------------------------------------------
3789 dnl CF_PROG_LINT version: 3 updated: 2016/05/22 15:25:54
3791 AC_DEFUN([CF_PROG_LINT],
3793 AC_CHECK_PROGS(LINT, lint cppcheck splint)
3796 dnl ---------------------------------------------------------------------------
3797 dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37
3799 dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f"
3800 dnl option if it is supported.
3801 AC_DEFUN([CF_PROG_LN_S],[
3803 AC_MSG_CHECKING(if $LN_S -f options work)
3805 rm -f conf$$.src conf$$dst
3807 echo first >conf$$.src
3808 if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then
3813 rm -f conf$$.dst conf$$src
3814 AC_MSG_RESULT($cf_prog_ln_sf)
3816 test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f"
3818 dnl ---------------------------------------------------------------------------
3819 dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50
3820 dnl ----------------
3821 dnl Remove all -U and -D options that refer to the given symbol from a list
3822 dnl of C compiler options. This works around the problem that not all
3823 dnl compilers process -U and -D options from left-to-right, so a -U option
3824 dnl cannot be used to cancel the effect of a preceding -D option.
3826 dnl $1 = target (which could be the same as the source variable)
3827 dnl $2 = source (including '$')
3828 dnl $3 = symbol to remove
3829 define([CF_REMOVE_DEFINE],
3832 sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \
3833 -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'`
3835 dnl ---------------------------------------------------------------------------
3836 dnl CF_RPATH_HACK version: 11 updated: 2013/09/01 13:02:00
3838 AC_DEFUN([CF_RPATH_HACK],
3840 AC_REQUIRE([CF_LD_RPATH_OPT])
3841 AC_MSG_CHECKING(for updated LDFLAGS)
3842 if test -n "$LD_RPATH_OPT" ; then
3843 AC_MSG_RESULT(maybe)
3845 AC_CHECK_PROGS(cf_ldd_prog,ldd,no)
3846 cf_rpath_list="/usr/lib /lib"
3847 if test "$cf_ldd_prog" != no
3851 AC_TRY_LINK([#include <stdio.h>],
3853 [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort | uniq`
3854 cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`])
3856 # If we passed the link-test, but get a "not found" on a given library,
3857 # this could be due to inept reconfiguration of gcc to make it only
3858 # partly honor /usr/local/lib (or whatever). Sometimes this behavior
3859 # is intentional, e.g., installing gcc in /usr/bin and suppressing the
3860 # /usr/local libraries.
3861 if test -n "$cf_rpath_oops"
3863 for cf_rpath_src in $cf_rpath_oops
3865 for cf_rpath_dir in \
3870 if test -f $cf_rpath_dir/lib/$cf_rpath_src
3872 CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src)
3873 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib"
3881 CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS)
3883 CF_RPATH_HACK_2(LDFLAGS)
3884 CF_RPATH_HACK_2(LIBS)
3886 CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS)
3890 AC_SUBST(EXTRA_LDFLAGS)
3892 dnl ---------------------------------------------------------------------------
3893 dnl CF_RPATH_HACK_2 version: 7 updated: 2015/04/12 15:39:00
3895 dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to
3896 dnl EXTRA_LDFLAGS for each -L option found.
3898 dnl $cf_rpath_list contains a list of directories to ignore.
3900 dnl $1 = variable name to update. The LDFLAGS variable should be the only one,
3901 dnl but LIBS often has misplaced -L options.
3902 AC_DEFUN([CF_RPATH_HACK_2],
3904 CF_VERBOSE(...checking $1 [$]$1)
3907 for cf_rpath_src in [$]$1
3909 case $cf_rpath_src in
3912 # check if this refers to a directory which we will ignore
3914 if test -n "$cf_rpath_list"
3916 for cf_rpath_item in $cf_rpath_list
3918 if test "x$cf_rpath_src" = "x-L$cf_rpath_item"
3926 if test "$cf_rpath_skip" = no
3928 # transform the option
3929 if test "$LD_RPATH_OPT" = "-R " ; then
3930 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"`
3932 cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"`
3935 # if we have not already added this, add it now
3936 cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"`
3937 if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS"
3939 CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp)
3940 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS"
3945 cf_rpath_dst="$cf_rpath_dst $cf_rpath_src"
3949 CF_VERBOSE(...checked $1 [$]$1)
3950 AC_SUBST(EXTRA_LDFLAGS)
3952 dnl ---------------------------------------------------------------------------
3953 dnl CF_SHARED_OPTS version: 92 updated: 2017/12/30 17:26:05
3956 dnl Attempt to determine the appropriate CC/LD options for creating a shared
3960 dnl a) ${LOCAL_LDFLAGS} is used to link executables that will run within
3961 dnl the build-tree, i.e., by making use of the libraries that are compiled in
3962 dnl $rel_builddir/lib We avoid compiling-in a $rel_builddir/lib path for the
3963 dnl shared library since that can lead to unexpected results at runtime.
3964 dnl b) ${LOCAL_LDFLAGS2} has the same intention but assumes that the shared
3965 dnl libraries are compiled in ../../lib
3967 dnl The variable 'cf_cv_do_symlinks' is used to control whether we configure
3968 dnl to install symbolic links to the rel/abi versions of shared libraries.
3970 dnl The variable 'cf_cv_shlib_version' controls whether we use the rel or abi
3971 dnl version when making symbolic links.
3973 dnl The variable 'cf_cv_shlib_version_infix' controls whether shared library
3974 dnl version numbers are infix (ex: libncurses.<ver>.dylib) or postfix
3975 dnl (ex: libncurses.so.<ver>).
3977 dnl Some loaders leave 'so_locations' lying around. It's nice to clean up.
3978 AC_DEFUN([CF_SHARED_OPTS],
3980 AC_REQUIRE([CF_LD_RPATH_OPT])
3985 INSTALL_LIB="-m 644"
3986 : ${rel_builddir:=.}
3994 cf_cv_do_symlinks=no
3996 test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT"
3998 AC_MSG_CHECKING(if release/abi version should be used for shared libs)
3999 AC_ARG_WITH(shlib-version,
4000 [ --with-shlib-version=X Specify rel or abi version for shared libs],
4001 [test -z "$withval" && withval=auto
4004 cf_cv_shlib_version=auto
4007 cf_cv_shlib_version=$withval
4010 AC_MSG_RESULT($withval)
4011 AC_MSG_ERROR([option value must be one of: rel, abi, or auto])
4014 ],[cf_cv_shlib_version=auto])
4015 AC_MSG_RESULT($cf_cv_shlib_version)
4020 # Some less-capable ports of gcc support only -fpic
4024 if test "$GCC" = yes
4028 case $cf_cv_system_name in
4029 (*linux*) # e.g., PGI compiler
4035 if test "$cf_try_fPIC" = yes
4037 AC_MSG_CHECKING(which $CC option to use)
4038 cf_save_CFLAGS="$CFLAGS"
4039 for CC_SHARED_OPTS in -fPIC -fpic ''
4041 CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS"
4042 AC_TRY_COMPILE([#include <stdio.h>],[int x = 1],[break],[])
4044 AC_MSG_RESULT($CC_SHARED_OPTS)
4045 CFLAGS="$cf_save_CFLAGS"
4048 cf_cv_shlib_version_infix=no
4050 case $cf_cv_system_name in
4051 (aix4.[3-9]*|aix[[5-7]]*)
4052 if test "$GCC" = yes; then
4053 CC_SHARED_OPTS='-Wl,-brtl'
4054 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
4056 CC_SHARED_OPTS='-brtl'
4057 # as well as '-qpic=large -G' or perhaps "-bM:SRE -bnoentry -bexpall"
4058 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -G -Wl,-brtl -Wl,-blibpath:${RPATH_LIST}:/usr/lib -o [$]@'
4062 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0'
4066 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4067 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4068 cf_cv_shlib_version=cygdll
4069 cf_cv_shlib_version_infix=cygdll
4072 cat >mk_shared_lib.sh <<-CF_EOF
4075 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/cyg/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4078 Linking shared library
4079 ** SHARED_LIB \[$]SHARED_LIB
4080 ** IMPORT_LIB \[$]IMPORT_LIB
4082 exec \[$]* ${LDFLAGS} -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4084 chmod +x mk_shared_lib.sh
4088 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4089 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4090 cf_cv_shlib_version=msysdll
4091 cf_cv_shlib_version_infix=msysdll
4094 cat >mk_shared_lib.sh <<-CF_EOF
4097 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/msys-/lib/' -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4100 Linking shared library
4101 ** SHARED_LIB \[$]SHARED_LIB
4102 ** IMPORT_LIB \[$]IMPORT_LIB
4104 exec \[$]* ${LDFLAGS} -shared -Wl,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4106 chmod +x mk_shared_lib.sh
4109 cf_try_cflags="no-cpp-precomp"
4110 CC_SHARED_OPTS="-dynamic"
4111 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]'
4112 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi
4113 cf_cv_shlib_version_infix=yes
4114 AC_CACHE_CHECK([if ld -search_paths_first works], cf_cv_ldflags_search_paths_first, [
4115 cf_save_LDFLAGS=$LDFLAGS
4116 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
4117 AC_TRY_LINK(, [int i;], cf_cv_ldflags_search_paths_first=yes, cf_cv_ldflags_search_paths_first=no)
4118 LDFLAGS=$cf_save_LDFLAGS])
4119 if test $cf_cv_ldflags_search_paths_first = yes; then
4120 LDFLAGS="$LDFLAGS -Wl,-search_paths_first"
4124 # HP-UX 8.07 ld lacks "+b" option used for libdir search-list
4125 if test "$GCC" != yes; then
4128 MK_SHARED_LIB='${LD} ${LDFLAGS} -b -o $[@]'
4129 INSTALL_LIB="-m 555"
4132 # (tested with gcc 2.7.2 -- I don't have c89)
4133 if test "$GCC" = yes; then
4134 LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}'
4137 LD_SHARED_OPTS='-Wl,+b,${libdir}'
4139 MK_SHARED_LIB='${LD} ${LDFLAGS} +b ${libdir} -b -o $[@]'
4140 # HP-UX shared libraries must be executable, and should be
4141 # readonly to exploit a quirk in the memory manager.
4142 INSTALL_LIB="-m 555"
4145 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4146 if test "$cf_cv_shlib_version" = rel; then
4147 cf_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
4149 cf_shared_soname='`basename $[@]`'
4152 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-rpath,${RPATH_LIST} -Wl,-h,'$cf_shared_soname' -o $[@]'
4155 if test "$cf_cv_enable_rpath" = yes ; then
4156 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4158 # tested with IRIX 5.2 and 'cc'.
4159 if test "$GCC" != yes; then
4160 CC_SHARED_OPTS='-KPIC'
4161 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
4163 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,`basename $[@]` -o $[@]'
4165 cf_cv_rm_so_locs=yes
4167 (linux*|gnu*|k*bsd*-gnu)
4168 if test "$DFT_LWR_MODEL" = "shared" ; then
4169 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4170 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4172 if test "$cf_cv_enable_rpath" = yes ; then
4173 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4176 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4179 cf_cv_shlib_version=mingw
4180 cf_cv_shlib_version_infix=mingw
4183 if test "$DFT_LWR_MODEL" = "shared" ; then
4184 LOCAL_LDFLAGS="-Wl,--enable-auto-import"
4185 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4186 EXTRA_LDFLAGS="-Wl,--enable-auto-import $EXTRA_LDFLAGS"
4189 MK_SHARED_LIB=$SHELL' '$rel_builddir'/mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}'
4190 RM_SHARED_OPTS="$RM_SHARED_OPTS $rel_builddir/mk_shared_lib.sh *.dll.a"
4191 cat >mk_shared_lib.sh <<-CF_EOF
4194 IMPORT_LIB=\`echo "\[$]1" | sed -e 's/[[0-9]]*\.dll[$]/.dll.a/'\`
4197 Linking shared library
4198 ** SHARED_LIB \[$]SHARED_LIB
4199 ** IMPORT_LIB \[$]IMPORT_LIB
4201 exec \[$]* ${LDFLAGS} -shared -Wl,--enable-auto-import,--out-implib=\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o \[$]{SHARED_LIB}
4203 chmod +x mk_shared_lib.sh
4205 (openbsd[[2-9]].*|mirbsd*)
4206 if test "$DFT_LWR_MODEL" = "shared" ; then
4207 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4208 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4210 if test "$cf_cv_enable_rpath" = yes ; then
4211 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4213 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4215 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4217 (nto-qnx*|openbsd*|freebsd[[12]].*)
4218 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4219 MK_SHARED_LIB='${LD} ${LDFLAGS} -Bshareable -o $[@]'
4220 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4222 (dragonfly*|freebsd*)
4223 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4224 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
4225 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
4226 LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${RPATH_LIST} $LOCAL_LDFLAGS"
4227 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4230 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]'
4233 CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC"
4234 if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then
4235 LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)"
4236 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4237 EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${RPATH_LIST} $EXTRA_LDFLAGS"
4238 if test "$cf_cv_shlib_version" = auto; then
4239 if test -f /usr/libexec/ld.elf_so; then
4240 cf_cv_shlib_version=abi
4242 cf_cv_shlib_version=rel
4246 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]'
4248 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -Wl,-shared -Wl,-Bshareable -o $[@]'
4252 # tested with OSF/1 V3.2 and 'cc'
4253 # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't
4254 # link with shared libs).
4255 MK_SHARED_LIB='${LD} ${LDFLAGS} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`'
4258 MK_SHARED_LIB="${MK_SHARED_LIB} -msym"
4261 MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]'
4262 if test "$DFT_LWR_MODEL" = "shared" ; then
4263 LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)"
4264 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4266 cf_cv_rm_so_locs=yes
4268 (sco3.2v5*) # also uw2* and UW7: hops 13-Apr-98
4269 # tested with osr5.0.5
4270 if test "$GCC" != yes; then
4271 CC_SHARED_OPTS='-belf -KPIC'
4273 MK_SHARED_LIB='${LD} ${LDFLAGS} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@'
4274 if test "$cf_cv_enable_rpath" = yes ; then
4275 # only way is to set LD_RUN_PATH but no switch for it
4278 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4279 LINK_PROGS='LD_RUN_PATH=${libdir}'
4280 LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib'
4283 # tested with SunOS 4.1.1 and gcc 2.7.0
4284 if test "$GCC" != yes; then
4285 CC_SHARED_OPTS='-KPIC'
4287 MK_SHARED_LIB='${LD} ${LDFLAGS} -assert pure-text -o $[@]'
4288 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel
4291 # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2
4292 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3
4293 if test "$DFT_LWR_MODEL" = "shared" ; then
4294 LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}"
4295 LOCAL_LDFLAGS2="$LOCAL_LDFLAGS"
4297 if test "$cf_cv_enable_rpath" = yes ; then
4298 EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS"
4301 if test "$GCC" != yes; then
4302 cf_save_CFLAGS="$CFLAGS"
4303 for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O
4305 CFLAGS="$cf_shared_opts $cf_save_CFLAGS"
4306 AC_TRY_COMPILE([#include <stdio.h>],[printf("Hello\n");],[break])
4308 CFLAGS="$cf_save_CFLAGS"
4309 CC_SHARED_OPTS=$cf_shared_opts
4310 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -dy -G -h '$cf_cv_shared_soname' -o $[@]'
4312 MK_SHARED_LIB='${CC} ${LDFLAGS} ${CFLAGS} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]'
4315 (sysv5uw7*|unix_sv*)
4316 # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc)
4317 if test "$GCC" != yes; then
4318 CC_SHARED_OPTS='-KPIC'
4320 MK_SHARED_LIB='${LD} ${LDFLAGS} -d y -G -o [$]@'
4323 CC_SHARED_OPTS='unknown'
4324 MK_SHARED_LIB='echo unknown'
4328 # This works if the last tokens in $MK_SHARED_LIB are the -o target.
4329 case "$cf_cv_shlib_version" in
4331 case "$MK_SHARED_LIB" in
4333 test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes
4336 AC_MSG_WARN(ignored --with-shlib-version)
4342 if test -n "$cf_try_cflags"
4344 cat > conftest.$ac_ext <<EOF
4345 #line __oline__ "${as_me:-configure}"
4347 int main(int argc, char *argv[[]])
4350 return (argv[[argc-1]] == 0) ;
4353 cf_save_CFLAGS="$CFLAGS"
4354 for cf_opt in $cf_try_cflags
4356 CFLAGS="$cf_save_CFLAGS -$cf_opt"
4357 AC_MSG_CHECKING(if CFLAGS option -$cf_opt works)
4358 if AC_TRY_EVAL(ac_compile); then
4360 cf_save_CFLAGS="$CFLAGS"
4365 CFLAGS="$cf_save_CFLAGS"
4369 # RPATH_LIST is a colon-separated list of directories
4370 test -n "$cf_ld_rpath_opt" && MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${RPATH_LIST}"
4371 test -z "$RPATH_LIST" && RPATH_LIST="\${libdir}"
4373 test $cf_cv_rm_so_locs = yes && RM_SHARED_OPTS="$RM_SHARED_OPTS so_locations"
4375 CF_VERBOSE(CC_SHARED_OPTS: $CC_SHARED_OPTS)
4376 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
4378 AC_SUBST(CC_SHARED_OPTS)
4379 AC_SUBST(LD_RPATH_OPT)
4380 AC_SUBST(LD_SHARED_OPTS)
4381 AC_SUBST(MK_SHARED_LIB)
4382 AC_SUBST(RM_SHARED_OPTS)
4384 AC_SUBST(LINK_PROGS)
4385 AC_SUBST(LINK_TESTS)
4387 AC_SUBST(EXTRA_LDFLAGS)
4388 AC_SUBST(LOCAL_LDFLAGS)
4389 AC_SUBST(LOCAL_LDFLAGS2)
4391 AC_SUBST(INSTALL_LIB)
4392 AC_SUBST(RPATH_LIST)
4394 dnl ---------------------------------------------------------------------------
4395 dnl CF_SHARED_SONAME version: 3 updated: 2008/09/08 18:34:43
4396 dnl ----------------
4397 dnl utility macro for CF_SHARED_OPTS, constructs "$cf_cv_shared_soname" for
4398 dnl substitution into MK_SHARED_LIB string for the "-soname" (or similar)
4401 dnl $1 is the default that should be used for "$cf_cv_shlib_version".
4402 dnl If missing, use "rel".
4403 define([CF_SHARED_SONAME],
4405 test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=ifelse($1,,rel,$1)
4406 if test "$cf_cv_shlib_version" = rel; then
4407 cf_cv_shared_soname='`basename $[@] .${REL_VERSION}`.${ABI_VERSION}'
4409 cf_cv_shared_soname='`basename $[@]`'
4412 dnl ---------------------------------------------------------------------------
4413 dnl CF_SIZECHANGE version: 14 updated: 2018/06/20 20:23:13
4415 dnl Check for definitions & structures needed for window size-changing
4417 dnl https://stackoverflow.com/questions/18878141/difference-between-structures-ttysize-and-winsize/50769952#50769952
4418 AC_DEFUN([CF_SIZECHANGE],
4420 AC_REQUIRE([CF_STRUCT_TERMIOS])
4421 AC_CACHE_CHECK(declaration of size-change, cf_cv_sizechange,[
4422 cf_cv_sizechange=unknown
4423 cf_save_CPPFLAGS="$CPPFLAGS"
4425 for cf_opts in "" "NEED_PTEM_H"
4428 CPPFLAGS="$cf_save_CPPFLAGS"
4429 if test -n "$cf_opts"
4431 CF_APPEND_TEXT(CPPFLAGS,-D$cf_opts)
4433 AC_TRY_COMPILE([#include <sys/types.h>
4434 #ifdef HAVE_TERMIOS_H
4435 #include <termios.h>
4437 #ifdef HAVE_TERMIO_H
4443 /* This is a workaround for SCO: they neglected to define struct winsize in
4444 * termios.h -- it's only in termio.h and ptem.h
4446 #include <sys/stream.h>
4447 #include <sys/ptem.h>
4450 #ifdef HAVE_SYS_IOCTL_H
4451 #include <sys/ioctl.h>
4455 struct ttysize win; /* SunOS 3.0... */
4456 int y = win.ts_lines;
4457 int x = win.ts_cols;
4460 struct winsize win; /* everything else */
4464 no TIOCGSIZE or TIOCGWINSZ
4465 #endif /* TIOCGWINSZ */
4466 #endif /* TIOCGSIZE */
4468 [cf_cv_sizechange=yes],
4469 [cf_cv_sizechange=no])
4471 CPPFLAGS="$cf_save_CPPFLAGS"
4472 if test "$cf_cv_sizechange" = yes ; then
4473 echo "size-change succeeded ($cf_opts)" >&AC_FD_CC
4474 test -n "$cf_opts" && cf_cv_sizechange="$cf_opts"
4479 if test "$cf_cv_sizechange" != no ; then
4480 AC_DEFINE(HAVE_SIZECHANGE,1,[Define to 1 if sizechange declarations are provided])
4481 case $cf_cv_sizechange in
4483 AC_DEFINE_UNQUOTED($cf_cv_sizechange )
4488 dnl ---------------------------------------------------------------------------
4489 dnl CF_STRUCT_TERMIOS version: 9 updated: 2018/06/08 21:57:23
4490 dnl -----------------
4491 dnl Some machines require _POSIX_SOURCE to completely define struct termios.
4492 AC_DEFUN([CF_STRUCT_TERMIOS],[
4493 AC_REQUIRE([CF_XOPEN_SOURCE])
4503 if test "$ac_cv_header_termios_h" = yes ; then
4504 case "$CFLAGS $CPPFLAGS" in
4506 termios_bad=dunno ;;
4507 (*) termios_bad=maybe ;;
4509 if test "$termios_bad" = maybe ; then
4510 AC_MSG_CHECKING(whether termios.h needs _POSIX_SOURCE)
4511 AC_TRY_COMPILE([#include <termios.h>],
4512 [struct termios foo; int x = foo.c_iflag],
4515 #define _POSIX_SOURCE
4516 #include <termios.h>],
4517 [struct termios foo; int x = foo.c_iflag],
4518 termios_bad=unknown,
4519 termios_bad=yes AC_DEFINE(_POSIX_SOURCE,1,[Define to 1 if we must define _POSIX_SOURCE]))
4521 AC_MSG_RESULT($termios_bad)
4525 dnl ---------------------------------------------------------------------------
4526 dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06
4528 dnl Construct a search-list for a nonstandard header/lib-file
4529 dnl $1 = the variable to return as result
4530 dnl $2 = the package name
4531 dnl $3 = the subdirectory, e.g., bin, include or lib
4532 AC_DEFUN([CF_SUBDIR_PATH],
4536 CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE)
4538 for cf_subdir_prefix in \
4546 CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix)
4549 dnl ---------------------------------------------------------------------------
4550 dnl CF_TERM_HEADER version: 4 updated: 2015/04/15 19:08:48
4552 dnl Look for term.h, which is part of X/Open curses. It defines the interface
4553 dnl to terminfo database. Usually it is in the same include-path as curses.h,
4554 dnl but some packagers change this, breaking various applications.
4555 AC_DEFUN([CF_TERM_HEADER],[
4556 AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[
4557 case ${cf_cv_ncurses_header} in
4558 (*/ncurses.h|*/ncursesw.h)
4559 cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'`
4562 cf_term_header=term.h
4566 for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h"
4568 AC_TRY_COMPILE([#include <stdio.h>
4569 #include <${cf_cv_ncurses_header:-curses.h}>
4571 ],[int x = auto_left_margin],[
4572 cf_cv_term_header="$cf_test"],[
4573 cf_cv_term_header=unknown
4575 test "$cf_cv_term_header" != unknown && break
4579 # Set definitions to allow ifdef'ing to accommodate subdirectories
4581 case $cf_cv_term_header in
4583 AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h])
4587 case $cf_cv_term_header in
4589 AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h])
4592 AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h])
4596 dnl ---------------------------------------------------------------------------
4597 dnl CF_TRIM_X_LIBS version: 3 updated: 2015/04/12 15:39:00
4599 dnl Trim extra base X libraries added as a workaround for inconsistent library
4600 dnl dependencies returned by "new" pkg-config files.
4601 AC_DEFUN([CF_TRIM_X_LIBS],[
4602 for cf_trim_lib in Xmu Xt X11
4605 (*-l$cf_trim_lib\ *-l$cf_trim_lib*)
4606 LIBS=`echo "$LIBS " | sed -e 's/ / /g' -e 's%-l'"$cf_trim_lib"' %%' -e 's/ $//'`
4607 CF_VERBOSE(..trimmed $LIBS)
4612 dnl ---------------------------------------------------------------------------
4613 dnl CF_TRY_PKG_CONFIG version: 5 updated: 2013/07/06 21:27:06
4614 dnl -----------------
4615 dnl This is a simple wrapper to use for pkg-config, for libraries which may be
4616 dnl available in that form.
4618 dnl $1 = package name
4619 dnl $2 = extra logic to use, if any, after updating CFLAGS and LIBS
4620 dnl $3 = logic to use if pkg-config does not have the package
4621 AC_DEFUN([CF_TRY_PKG_CONFIG],[
4622 AC_REQUIRE([CF_PKG_CONFIG])
4624 if test "$PKG_CONFIG" != none && "$PKG_CONFIG" --exists $1; then
4625 CF_VERBOSE(found package $1)
4626 cf_pkgconfig_incs="`$PKG_CONFIG --cflags $1 2>/dev/null`"
4627 cf_pkgconfig_libs="`$PKG_CONFIG --libs $1 2>/dev/null`"
4628 CF_VERBOSE(package $1 CFLAGS: $cf_pkgconfig_incs)
4629 CF_VERBOSE(package $1 LIBS: $cf_pkgconfig_libs)
4630 CF_ADD_CFLAGS($cf_pkgconfig_incs)
4631 CF_ADD_LIBS($cf_pkgconfig_libs)
4632 ifelse([$2],,:,[$2])
4636 ifelse([$3],,:,[$3])
4639 dnl ---------------------------------------------------------------------------
4640 dnl CF_TRY_XOPEN_SOURCE version: 2 updated: 2018/06/20 20:23:13
4641 dnl -------------------
4642 dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we
4643 dnl can define it successfully.
4644 AC_DEFUN([CF_TRY_XOPEN_SOURCE],[
4645 AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[
4649 #include <sys/types.h>
4651 #ifndef _XOPEN_SOURCE
4654 [cf_cv_xopen_source=no],
4655 [cf_save="$CPPFLAGS"
4656 CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE)
4660 #include <sys/types.h>
4662 #ifdef _XOPEN_SOURCE
4665 [cf_cv_xopen_source=no],
4666 [cf_cv_xopen_source=$cf_XOPEN_SOURCE])
4671 if test "$cf_cv_xopen_source" != no ; then
4672 CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE)
4673 CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE)
4674 cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source"
4675 CF_ADD_CFLAGS($cf_temp_xopen_source)
4678 dnl ---------------------------------------------------------------------------
4679 dnl CF_UNION_WAIT version: 6 updated: 2012/10/06 08:57:51
4681 dnl Check to see if the BSD-style union wait is declared. Some platforms may
4682 dnl use this, though it is deprecated in favor of the 'int' type in Posix.
4683 dnl Some vendors provide a bogus implementation that declares union wait, but
4684 dnl uses the 'int' type instead; we try to spot these by checking for the
4685 dnl associated macros.
4687 dnl Ahem. Some implementers cast the status value to an int*, as an attempt to
4688 dnl use the macros for either union wait or int. So we do a check compile to
4689 dnl see if the macros are defined and apply to an int.
4691 dnl Sets: $cf_cv_type_unionwait
4692 dnl Defines: HAVE_TYPE_UNIONWAIT
4693 AC_DEFUN([CF_UNION_WAIT],
4695 AC_REQUIRE([CF_WAIT_HEADERS])
4696 AC_MSG_CHECKING([for union wait])
4697 AC_CACHE_VAL(cf_cv_type_unionwait,[
4698 AC_TRY_LINK($cf_wait_headers,
4700 int y = WEXITSTATUS(x);
4701 int z = WTERMSIG(x);
4704 [cf_cv_type_unionwait=no
4705 echo compiles ok w/o union wait 1>&AC_FD_CC
4707 AC_TRY_LINK($cf_wait_headers,
4710 int y = WEXITSTATUS(x);
4713 int z = WTERMSIG(x);
4717 [cf_cv_type_unionwait=yes
4718 echo compiles ok with union wait and possibly macros too 1>&AC_FD_CC
4720 [cf_cv_type_unionwait=no])])])
4721 AC_MSG_RESULT($cf_cv_type_unionwait)
4722 test $cf_cv_type_unionwait = yes && AC_DEFINE(HAVE_TYPE_UNIONWAIT,1,[Define to 1 if type unionwait is declared])
4724 dnl ---------------------------------------------------------------------------
4725 dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59
4727 dnl Make an uppercase version of a variable
4728 dnl $1=uppercase($2)
4729 AC_DEFUN([CF_UPPER],
4731 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
4733 dnl ---------------------------------------------------------------------------
4734 dnl CF_UTF8_LIB version: 8 updated: 2012/10/06 08:57:51
4736 dnl Check for multibyte support, and if not found, utf8 compatibility library
4737 AC_DEFUN([CF_UTF8_LIB],
4739 AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
4740 cf_save_LIBS="$LIBS"
4742 #include <stdlib.h>],[putwc(0,0);],
4743 [cf_cv_utf8_lib=yes],
4745 #include <libutf8.h>],[putwc(0,0);],utf8,
4746 [cf_cv_utf8_lib=add-on],
4747 [cf_cv_utf8_lib=no])
4750 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between
4752 if test "$cf_cv_utf8_lib" = "add-on" ; then
4753 AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h])
4754 CF_ADD_INCDIR($cf_cv_header_path_utf8)
4755 CF_ADD_LIBDIR($cf_cv_library_path_utf8)
4756 CF_ADD_LIBS($cf_cv_library_file_utf8)
4759 dnl ---------------------------------------------------------------------------
4760 dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12
4762 dnl Use AC_VERBOSE w/o the warnings
4763 AC_DEFUN([CF_VERBOSE],
4764 [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG
4767 dnl ---------------------------------------------------------------------------
4768 dnl CF_VERSION_INFO version: 7 updated: 2015/04/17 21:13:04
4770 dnl Define several useful symbols derived from the VERSION file. A separate
4771 dnl file is preferred to embedding the version numbers in various scripts.
4772 dnl (automake is a textbook-example of why the latter is a bad idea, but there
4775 dnl The file contents are:
4776 dnl libtool-version release-version patch-version
4780 dnl libtool-version (see ?) consists of 3 integers separated by '.'
4781 dnl release-version consists of a major version and minor version
4782 dnl separated by '.', optionally followed by a patch-version
4783 dnl separated by '-'. The minor version need not be an
4784 dnl integer (but it is preferred).
4785 dnl patch-version is an integer in the form yyyymmdd, so ifdef's and
4786 dnl scripts can easily compare versions.
4788 dnl If libtool is used, the first form is required, since CF_WITH_LIBTOOL
4789 dnl simply extracts the first field using 'cut -f1'.
4791 dnl Optional parameters:
4792 dnl $1 = internal name for package
4793 dnl $2 = external name for package
4794 AC_DEFUN([CF_VERSION_INFO],
4796 if test -f $srcdir/VERSION ; then
4797 AC_MSG_CHECKING(for package version)
4799 # if there are not enough fields, cut returns the last one...
4800 cf_field1=`sed -e '2,$d' $srcdir/VERSION|cut -f1`
4801 cf_field2=`sed -e '2,$d' $srcdir/VERSION|cut -f2`
4802 cf_field3=`sed -e '2,$d' $srcdir/VERSION|cut -f3`
4804 # this is how CF_BUNDLED_INTL uses $VERSION:
4805 VERSION="$cf_field1"
4807 VERSION_MAJOR=`echo "$cf_field2" | sed -e 's/\..*//'`
4808 test -z "$VERSION_MAJOR" && AC_MSG_ERROR(missing major-version)
4810 VERSION_MINOR=`echo "$cf_field2" | sed -e 's/^[[^.]]*\.//' -e 's/-.*//'`
4811 test -z "$VERSION_MINOR" && AC_MSG_ERROR(missing minor-version)
4813 AC_MSG_RESULT(${VERSION_MAJOR}.${VERSION_MINOR})
4815 AC_MSG_CHECKING(for package patch date)
4816 VERSION_PATCH=`echo "$cf_field3" | sed -e 's/^[[^-]]*-//'`
4817 case .$VERSION_PATCH in
4819 AC_MSG_ERROR(missing patch-date $VERSION_PATCH)
4821 (.[[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]][[0-9]])
4824 AC_MSG_ERROR(illegal patch-date $VERSION_PATCH)
4827 AC_MSG_RESULT($VERSION_PATCH)
4829 AC_MSG_ERROR(did not find $srcdir/VERSION)
4832 # show the actual data that we have for versions:
4833 CF_VERBOSE(ABI VERSION $VERSION)
4834 CF_VERBOSE(VERSION_MAJOR $VERSION_MAJOR)
4835 CF_VERBOSE(VERSION_MINOR $VERSION_MINOR)
4836 CF_VERBOSE(VERSION_PATCH $VERSION_PATCH)
4839 AC_SUBST(VERSION_MAJOR)
4840 AC_SUBST(VERSION_MINOR)
4841 AC_SUBST(VERSION_PATCH)
4843 dnl if a package name is given, define its corresponding version info. We
4844 dnl need the package name to ensure that the defined symbols are unique.
4847 PACKAGE=ifelse($2,,$1,$2)
4848 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE",[Define to the package-name])
4850 CF_UPPER(cf_PACKAGE,$cf_PACKAGE)
4851 AC_DEFINE_UNQUOTED(${cf_PACKAGE}_VERSION,"${VERSION_MAJOR}.${VERSION_MINOR}")
4852 AC_DEFINE_UNQUOTED(${cf_PACKAGE}_PATCHDATE,${VERSION_PATCH})
4855 dnl ---------------------------------------------------------------------------
4856 dnl CF_WAIT_HEADERS version: 2 updated: 1997/10/21 19:45:33
4858 dnl Build up an expression $cf_wait_headers with the header files needed to
4859 dnl compile against the prototypes for 'wait()', 'waitpid()', etc. Assume it's
4860 dnl Posix, which uses <sys/types.h> and <sys/wait.h>, but allow SVr4 variation
4862 AC_DEFUN([CF_WAIT_HEADERS],
4864 AC_HAVE_HEADERS(sys/wait.h)
4865 cf_wait_headers="#include <sys/types.h>
4867 if test $ac_cv_header_sys_wait_h = yes; then
4868 cf_wait_headers="$cf_wait_headers
4869 #include <sys/wait.h>
4872 AC_HAVE_HEADERS(wait.h)
4873 AC_HAVE_HEADERS(waitstatus.h)
4874 if test $ac_cv_header_wait_h = yes; then
4875 cf_wait_headers="$cf_wait_headers
4879 if test $ac_cv_header_waitstatus_h = yes; then
4880 cf_wait_headers="$cf_wait_headers
4881 #include <waitstatus.h>
4886 dnl ---------------------------------------------------------------------------
4887 dnl CF_WIDEC_CURSES version: 5 updated: 2012/11/08 20:57:52
4889 dnl Check for curses implementations that can handle wide-characters
4890 AC_DEFUN([CF_WIDEC_CURSES],
4892 AC_CACHE_CHECK(if curses supports wide characters,cf_cv_widec_curses,[
4895 #include <${cf_cv_ncurses_header:-curses.h}>],[
4899 waddnwstr(stdscr, temp, 1);
4901 [cf_cv_widec_curses=yes],
4902 [cf_cv_widec_curses=no])
4905 if test "$cf_cv_widec_curses" = yes ; then
4906 AC_DEFINE(WIDEC_CURSES,1,[Define to 1 if curses supports wide characters])
4908 # This is needed on Tru64 5.0 to declare mbstate_t
4909 AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_widec_mbstate,[
4912 #include <${cf_cv_ncurses_header:-curses.h}>],
4914 [cf_cv_widec_mbstate=no],
4918 #include <${cf_cv_ncurses_header:-curses.h}>],
4920 [cf_cv_widec_mbstate=yes],
4921 [cf_cv_widec_mbstate=unknown])])])
4923 if test "$cf_cv_widec_mbstate" = yes ; then
4924 AC_DEFINE(NEED_WCHAR_H,1,[Define to 1 if we must include wchar.h])
4927 if test "$cf_cv_widec_mbstate" != unknown ; then
4928 AC_DEFINE(HAVE_MBSTATE_T,1,[Define to 1 if we have mbstate_t type])
4933 dnl ---------------------------------------------------------------------------
4934 dnl CF_WITH_ABI_VERSION version: 3 updated: 2015/06/06 16:10:11
4935 dnl -------------------
4936 dnl Allow library's ABI to be overridden. Generally this happens when a
4937 dnl packager has incremented the ABI past that used in the original package,
4938 dnl and wishes to keep doing this.
4940 dnl $1 is the package name, if any, to derive a corresponding {package}_ABI
4942 AC_DEFUN([CF_WITH_ABI_VERSION],[
4943 test -z "$cf_cv_abi_version" && cf_cv_abi_version=0
4944 AC_ARG_WITH(abi-version,
4945 [ --with-abi-version=XXX override derived ABI version],[
4946 if test "x$cf_cv_abi_version" != "x$withval"
4948 AC_MSG_WARN(overriding ABI version $cf_cv_abi_version to $withval)
4949 case $cf_cv_rel_version in
4951 cf_cv_rel_version=$withval.0
4954 cf_cv_rel_version=$withval.9 # FIXME: should be 10 as of 6.0 release
4958 cf_cv_abi_version=$withval])
4959 CF_NUMBER_SYNTAX($cf_cv_abi_version,ABI version)
4961 $1_ABI=$cf_cv_abi_version
4964 dnl ---------------------------------------------------------------------------
4965 dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38
4966 dnl ------------------
4967 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
4969 AC_DEFUN([CF_WITH_CURSES_DIR],[
4971 AC_MSG_CHECKING(for specific curses-directory)
4972 AC_ARG_WITH(curses-dir,
4973 [ --with-curses-dir=DIR directory in which (n)curses is installed],
4974 [cf_cv_curses_dir=$withval],
4975 [cf_cv_curses_dir=no])
4976 AC_MSG_RESULT($cf_cv_curses_dir)
4978 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
4980 CF_PATH_SYNTAX(withval)
4981 if test -d "$cf_cv_curses_dir"
4983 CF_ADD_INCDIR($cf_cv_curses_dir/include)
4984 CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
4988 dnl ---------------------------------------------------------------------------
4989 dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
4990 dnl ----------------
4991 dnl Configure-option for dbmalloc. The optional parameter is used to override
4992 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
4993 AC_DEFUN([CF_WITH_DBMALLOC],[
4994 CF_NO_LEAKS_OPTION(dbmalloc,
4995 [ --with-dbmalloc test: use Conor Cahill's dbmalloc library],
4998 if test "$with_dbmalloc" = yes ; then
4999 AC_CHECK_HEADER(dbmalloc.h,
5000 [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
5003 dnl ---------------------------------------------------------------------------
5004 dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
5006 dnl Configure-option for dmalloc. The optional parameter is used to override
5007 dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
5008 AC_DEFUN([CF_WITH_DMALLOC],[
5009 CF_NO_LEAKS_OPTION(dmalloc,
5010 [ --with-dmalloc test: use Gray Watson's dmalloc library],
5013 if test "$with_dmalloc" = yes ; then
5014 AC_CHECK_HEADER(dmalloc.h,
5015 [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
5018 dnl ---------------------------------------------------------------------------
5019 dnl CF_WITH_EXPORT_SYMS version: 3 updated: 2014/12/20 19:16:08
5020 dnl -------------------
5021 dnl Use this with libtool to specify the list of symbols that may be exported.
5022 dnl The input file contains one symbol per line; comments work with "#".
5024 dnl $1 = basename of the ".sym" file (default $PACKAGE)
5025 AC_DEFUN([CF_WITH_EXPORT_SYMS],
5027 AC_MSG_CHECKING(if exported-symbols file should be used)
5028 AC_ARG_WITH(export-syms,
5029 [ --with-export-syms=XXX limit exported symbols using libtool],
5030 [with_export_syms=$withval],
5031 [with_export_syms=no])
5032 if test "x$with_export_syms" = xyes
5034 with_export_syms='${top_srcdir}/package/ifelse($1,,${PACKAGE},[$1]).sym'
5037 AC_MSG_RESULT($with_export_syms)
5038 if test "x$with_export_syms" != xno
5040 EXPORT_SYMS="-export-symbols $with_export_syms"
5041 AC_SUBST(EXPORT_SYMS)
5044 dnl ---------------------------------------------------------------------------
5045 dnl CF_WITH_INSTALL_PREFIX version: 4 updated: 2010/10/23 15:52:32
5046 dnl ----------------------
5047 dnl Configure-script option to give a default value for the poorly-chosen name
5049 AC_DEFUN([CF_WITH_INSTALL_PREFIX],
5051 AC_MSG_CHECKING(for install-prefix)
5052 AC_ARG_WITH(install-prefix,
5053 [ --with-install-prefix=XXX sets DESTDIR, useful for packaging],
5054 [cf_opt_with_install_prefix=$withval],
5055 [cf_opt_with_install_prefix=${DESTDIR:-no}])
5056 AC_MSG_RESULT($cf_opt_with_install_prefix)
5057 if test "$cf_opt_with_install_prefix" != no ; then
5058 CF_PATH_SYNTAX(cf_opt_with_install_prefix)
5059 DESTDIR=$cf_opt_with_install_prefix
5063 dnl ---------------------------------------------------------------------------
5064 dnl CF_WITH_LIBTOOL version: 35 updated: 2017/08/12 07:58:51
5066 dnl Provide a configure option to incorporate libtool. Define several useful
5067 dnl symbols for the makefile rules.
5069 dnl The reference to AC_PROG_LIBTOOL does not normally work, since it uses
5070 dnl macros from libtool.m4 which is in the aclocal directory of automake.
5071 dnl Following is a simple script which turns on the AC_PROG_LIBTOOL macro.
5072 dnl But that still does not work properly since the macro is expanded outside
5073 dnl the CF_WITH_LIBTOOL macro:
5076 dnl ACLOCAL=`aclocal --print-ac-dir`
5077 dnl if test -z "$ACLOCAL" ; then
5078 dnl echo cannot find aclocal directory
5080 dnl elif test ! -f $ACLOCAL/libtool.m4 ; then
5081 dnl echo cannot find libtool.m4 file
5085 dnl LOCAL=aclocal.m4
5086 dnl ORIG=aclocal.m4.orig
5088 dnl trap "mv $ORIG $LOCAL" 0 1 2 3 15
5092 dnl # sed the LIBTOOL= assignment to omit the current directory?
5093 dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL
5094 dnl cat $ORIG >>$LOCAL
5098 AC_DEFUN([CF_WITH_LIBTOOL],
5100 AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION])
5101 ifdef([AC_PROG_LIBTOOL],,[
5104 # common library maintenance symbols that are convenient for libtool scripts:
5105 LIB_CREATE='${AR} -cr'
5106 LIB_OBJECT='${OBJECTS}'
5110 # symbols used to prop libtool up to enable it to determine what it should be
5118 AC_MSG_CHECKING(if you want to build libraries with libtool)
5119 AC_ARG_WITH(libtool,
5120 [ --with-libtool generate libraries with libtool],
5121 [with_libtool=$withval],
5123 AC_MSG_RESULT($with_libtool)
5124 if test "$with_libtool" != "no"; then
5125 ifdef([AC_PROG_LIBTOOL],[
5126 # missing_content_AC_PROG_LIBTOOL{{
5128 # missing_content_AC_PROG_LIBTOOL}}
5130 if test "$with_libtool" != "yes" ; then
5131 CF_PATH_SYNTAX(with_libtool)
5132 LIBTOOL=$with_libtool
5134 AC_CHECK_TOOLS(LIBTOOL,[libtool glibtool],none)
5136 if test -z "$cf_cv_libtool_version" && test "$LIBTOOL" = libtool
5138 CF_FORGET_TOOL(LIBTOOL)
5139 AC_CHECK_TOOLS(LIBTOOL,[glibtool],none)
5143 if test -z "$LIBTOOL" ; then
5144 AC_MSG_ERROR(Cannot find libtool)
5147 LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${libdir} ${LIBTOOL_VERSION} `cut -f1 ${top_srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} $(LIBS) -o'
5148 LIB_OBJECT='${OBJECTS:.o=.lo}'
5150 LIB_CLEAN='${LIBTOOL} --mode=clean'
5151 LIB_COMPILE='${LIBTOOL} --mode=compile'
5152 LIB_LINK='${LIBTOOL} --mode=link ${CC} ${LIBTOOL_OPTS}'
5153 LIB_INSTALL='${LIBTOOL} --mode=install'
5154 LIB_UNINSTALL='${LIBTOOL} --mode=uninstall'
5157 CF_CHECK_LIBTOOL_VERSION
5159 # special hack to add -no-undefined (which libtool should do for itself)
5161 case "$cf_cv_system_name" in
5162 (cygwin*|msys*|mingw32*|os2*|uwin*|aix[[4-7]])
5163 LT_UNDEF=-no-undefined
5166 AC_SUBST([LT_UNDEF])
5168 # special hack to add --tag option for C++ compiler
5169 case $cf_cv_libtool_version in
5170 (1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*)
5171 LIBTOOL_CXX="$LIBTOOL --tag=CXX"
5172 LIBTOOL="$LIBTOOL --tag=CC"
5175 LIBTOOL_CXX="$LIBTOOL"
5183 test -z "$LIBTOOL" && ECHO_LT=
5186 AC_SUBST(LIBTOOL_CXX)
5187 AC_SUBST(LIBTOOL_OPTS)
5189 AC_SUBST(LIB_CREATE)
5190 AC_SUBST(LIB_OBJECT)
5191 AC_SUBST(LIB_SUFFIX)
5195 AC_SUBST(LIB_COMPILE)
5197 AC_SUBST(LIB_INSTALL)
5198 AC_SUBST(LIB_UNINSTALL)
5201 dnl ---------------------------------------------------------------------------
5202 dnl CF_WITH_LIBTOOL_OPTS version: 4 updated: 2015/04/17 21:13:04
5203 dnl --------------------
5204 dnl Allow user to pass additional libtool options into the library creation
5205 dnl and link steps. The main use for this is to do something like
5206 dnl ./configure --with-libtool-opts=-static
5207 dnl to get the same behavior as automake-flavored
5208 dnl ./configure --enable-static
5209 AC_DEFUN([CF_WITH_LIBTOOL_OPTS],[
5210 AC_MSG_CHECKING(for additional libtool options)
5211 AC_ARG_WITH(libtool-opts,
5212 [ --with-libtool-opts=XXX specify additional libtool options],
5213 [with_libtool_opts=$withval],
5214 [with_libtool_opts=no])
5215 AC_MSG_RESULT($with_libtool_opts)
5217 case .$with_libtool_opts in
5221 LIBTOOL_OPTS="$LIBTOOL_OPTS $with_libtool_opts"
5225 AC_SUBST(LIBTOOL_OPTS)
5227 dnl ---------------------------------------------------------------------------
5228 dnl CF_WITH_MAN2HTML version: 7 updated: 2018/01/07 13:16:19
5229 dnl ----------------
5230 dnl Check for man2html and groff. Prefer man2html over groff, but use groff
5231 dnl as a fallback. See
5233 dnl http://invisible-island.net/scripts/man2html.html
5235 dnl Generate a shell script which hides the differences between the two.
5237 dnl We name that "man2html.tmp".
5239 dnl The shell script can be removed later, e.g., using "make distclean".
5240 AC_DEFUN([CF_WITH_MAN2HTML],[
5241 AC_REQUIRE([CF_PROG_GROFF])
5243 case "x${with_man2html}" in
5248 AC_PATH_PROG(cf_man2html,man2html,no)
5249 case "x$cf_man2html" in
5251 AC_MSG_CHECKING(for the modified Earl Hood script)
5252 if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null )
5259 AC_MSG_RESULT($cf_man2html_ok)
5267 AC_MSG_CHECKING(for program to convert manpage to html)
5268 AC_ARG_WITH(man2html,
5269 [ --with-man2html=XXX use XXX rather than groff],
5270 [cf_man2html=$withval],
5271 [cf_man2html=$cf_man2html])
5275 case $cf_man2html in
5277 AC_MSG_RESULT(man2html)
5278 AC_PATH_PROG(cf_man2html,man2html,no)
5282 cf_man2html=$GROFF_PATH
5283 AC_MSG_RESULT($cf_man2html)
5286 AC_MSG_RESULT($cf_man2html)
5290 MAN2HTML_TEMP="man2html.tmp"
5291 cat >$MAN2HTML_TEMP <<CF_EOF
5293 # Temporary script generated by CF_WITH_MAN2HTML
5294 # Convert inputs to html, sending result to standard output.
5297 # \${1} = rootname of file to convert
5298 # \${2} = suffix of file to convert, e.g., "1"
5299 # \${3} = macros to use, e.g., "man"
5314 if test "x$cf_with_groff" = xyes
5316 MAN2HTML_NOTE="$GROFF_NOTE"
5317 MAN2HTML_PATH="$GROFF_PATH"
5318 cat >>$MAN2HTML_TEMP <<CF_EOF
5319 $SHELL -c "$TBL_PATH \${ROOT}.\${TYPE} | $GROFF_PATH -P -o0 -I\${ROOT}_ -Thtml -\${MACS}"
5323 CF_PATH_SYNTAX(cf_man2html)
5324 MAN2HTML_PATH="$cf_man2html"
5325 AC_MSG_CHECKING(for $cf_man2html top/bottom margins)
5327 # for this example, expect 3 lines of content, the remainder is head/foot
5328 cat >conftest.in <<CF_EOF
5329 .TH HEAD1 HEAD2 HEAD3 HEAD4 HEAD5
5334 LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
5336 cf_man2html_1st=`fgrep -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
5337 cf_man2html_top=`expr $cf_man2html_1st - 2`
5338 cf_man2html_bot=`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`
5339 cf_man2html_bot=`expr $cf_man2html_bot - 2 - $cf_man2html_top`
5340 cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot"
5342 AC_MSG_RESULT($cf_man2html_top_bot)
5344 AC_MSG_CHECKING(for pagesize to use)
5345 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
5347 cat >>conftest.in <<CF_EOF
5362 LC_ALL=C LC_CTYPE=C LANG=C LANGUAGE=C $NROFF_PATH -man conftest.in >conftest.out
5363 cf_man2html_page=`fgrep -n HEAD1 conftest.out |tail -n 1 |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`
5364 test -z "$cf_man2html_page" && cf_man2html_page=99999
5365 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999
5368 AC_MSG_RESULT($cf_man2html_page)
5370 cat >>$MAN2HTML_TEMP <<CF_EOF
5371 : \${MAN2HTML_PATH=$MAN2HTML_PATH}
5372 MAN2HTML_OPTS="\$MAN2HTML_OPTS -index -title="\$ROOT\(\$TYPE\)" -compress -pgsize $cf_man2html_page"
5375 $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH -topm=0 -botm=0 \$MAN2HTML_OPTS
5378 $TBL_PATH \${ROOT}.\${TYPE} | $NROFF_PATH -\${MACS} | \$MAN2HTML_PATH $cf_man2html_top_bot \$MAN2HTML_OPTS
5384 chmod 700 $MAN2HTML_TEMP
5386 AC_SUBST(MAN2HTML_NOTE)
5387 AC_SUBST(MAN2HTML_PATH)
5388 AC_SUBST(MAN2HTML_TEMP)
5390 dnl ---------------------------------------------------------------------------
5391 dnl CF_WITH_NCURSES_ETC version: 5 updated: 2016/02/20 19:23:20
5392 dnl -------------------
5393 dnl Use this macro for programs which use any variant of "curses", e.g.,
5394 dnl "ncurses", and "PDCurses". Programs that can use curses and some unrelated
5395 dnl library (such as slang) should use a "--with-screen=XXX" option.
5397 dnl This does not use AC_DEFUN, because that would tell autoconf to run each
5398 dnl of the macros inside this one - before this macro.
5399 define([CF_WITH_NCURSES_ETC],[
5404 AC_MSG_CHECKING(for specified curses library type)
5406 [ --with-screen=XXX use specified curses-libraries],
5407 [cf_cv_screen=$withval],[
5409 AC_ARG_WITH(ncursesw,
5410 [ --with-ncursesw use wide ncurses-libraries],
5411 [cf_cv_screen=ncursesw],[
5413 AC_ARG_WITH(ncurses,
5414 [ --with-ncurses use ncurses-libraries],
5415 [cf_cv_screen=ncurses],[
5417 AC_ARG_WITH(pdcurses,
5418 [ --with-pdcurses compile/link with pdcurses X11 library],
5419 [cf_cv_screen=pdcurses],[
5421 AC_ARG_WITH(curses-colr,
5422 [ --with-curses-colr compile/link with HPUX 10.x color-curses],
5423 [cf_cv_screen=curses_colr],[
5425 AC_ARG_WITH(curses-5lib,
5426 [ --with-curses-5lib compile/link with SunOS 5lib curses],
5427 [cf_cv_screen=curses_5lib])])])])])])
5429 AC_MSG_RESULT($cf_cv_screen)
5431 case $cf_cv_screen in
5437 CF_NCURSES_CONFIG($cf_cv_screen)
5440 CF_NCURSES_CONFIG($cf_cv_screen)
5446 AC_MSG_ERROR(unexpected screen-value: $cf_cv_screen)
5450 CF_NCURSES_PTHREADS($cf_cv_screen)
5453 dnl ---------------------------------------------------------------------------
5454 dnl CF_WITH_NO_LEAKS version: 3 updated: 2015/05/10 19:52:14
5455 dnl ----------------
5456 AC_DEFUN([CF_WITH_NO_LEAKS],[
5458 AC_REQUIRE([CF_WITH_DMALLOC])
5459 AC_REQUIRE([CF_WITH_DBMALLOC])
5460 AC_REQUIRE([CF_WITH_PURIFY])
5461 AC_REQUIRE([CF_WITH_VALGRIND])
5463 AC_MSG_CHECKING(if you want to perform memory-leak testing)
5464 AC_ARG_WITH(no-leaks,
5465 [ --with-no-leaks test: free permanent memory, analyze leaks],
5466 [AC_DEFINE(NO_LEAKS,1,[Define to 1 to enable leak-checking])
5467 cf_doalloc=".${with_dmalloc}${with_dbmalloc}${with_purify}${with_valgrind}"
5468 case ${cf_doalloc} in
5470 (*) AC_DEFINE(DOALLOC,10000,[Define to size of malloc-array]) ;;
5474 AC_MSG_RESULT($with_no_leaks)
5476 dnl ---------------------------------------------------------------------------
5477 dnl CF_WITH_PURIFY version: 2 updated: 2006/12/14 18:43:43
5479 AC_DEFUN([CF_WITH_PURIFY],[
5480 CF_NO_LEAKS_OPTION(purify,
5481 [ --with-purify test: use Purify],
5483 [LINK_PREFIX="$LINK_PREFIX purify"])
5484 AC_SUBST(LINK_PREFIX)
5486 dnl ---------------------------------------------------------------------------
5487 dnl CF_WITH_REL_VERSION version: 1 updated: 2003/09/20 18:12:49
5488 dnl -------------------
5489 dnl Allow library's release-version to be overridden. Generally this happens when a
5490 dnl packager has incremented the release-version past that used in the original package,
5491 dnl and wishes to keep doing this.
5493 dnl $1 is the package name, if any, to derive corresponding {package}_MAJOR
5494 dnl and {package}_MINOR symbols
5496 AC_DEFUN([CF_WITH_REL_VERSION],[
5497 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0
5498 AC_ARG_WITH(rel-version,
5499 [ --with-rel-version=XXX override derived release version],
5500 [AC_MSG_WARN(overriding release version $cf_cv_rel_version to $withval)
5501 cf_cv_rel_version=$withval])
5503 CF_NUMBER_SYNTAX($cf_cv_rel_version,Release version)
5505 $1_MAJOR=`echo "$cf_cv_rel_version" | sed -e 's/\..*//'`
5506 $1_MINOR=`echo "$cf_cv_rel_version" | sed -e 's/^[[^.]]*//' -e 's/^\.//' -e 's/\..*//'`
5507 CF_NUMBER_SYNTAX([$]$1_MAJOR,Release major-version)
5508 CF_NUMBER_SYNTAX([$]$1_MINOR,Release minor-version)
5511 dnl ---------------------------------------------------------------------------
5512 dnl CF_WITH_SHARED_OR_LIBTOOL version: 7 updated: 2014/11/02 16:11:49
5513 dnl -------------------------
5514 dnl Provide shared libraries using either autoconf macros (--with-shared) or
5515 dnl using the external libtool script (--with-libtool).
5517 dnl $1 = program name (all caps preferred)
5518 dnl $1 = release version
5519 dnl $2 = ABI version
5520 define([CF_WITH_SHARED_OR_LIBTOOL],[
5524 cf_cv_rel_version=$REL_VERSION
5525 AC_SUBST(ABI_VERSION)
5526 AC_SUBST(REL_VERSION)
5528 CF_WITH_REL_VERSION($1)
5532 DFT_LWR_MODEL=$LIB_MODEL
5535 # use to comment-out makefile lines
5546 LIB_CREATE="$LIB_CREATE \[$]@"
5548 if test "$with_libtool" = "yes" ; then
5551 DFT_LWR_MODEL=$LIB_MODEL
5553 CF_WITH_LIBTOOL_OPTS
5559 AC_MSG_CHECKING(if you want to build shared libraries)
5561 [ --with-shared generate shared-libraries],
5562 [with_shared=$withval],
5564 AC_MSG_RESULT($with_shared)
5565 if test "$with_shared" = "yes" ; then
5567 DFT_LWR_MODEL=$LIB_MODEL
5569 CF_WITH_VERSIONED_SYMS
5571 LIB_CREATE="[$]MK_SHARED_LIB"
5572 CFLAGS="$CFLAGS $CC_SHARED_OPTS"
5580 CF_LIB_SUFFIX($LIB_MODEL, DFT_LIB_SUFFIX, DFT_DEP_SUFFIX)
5581 LIB_SUFFIX=$DFT_LIB_SUFFIX
5583 AC_SUBST(DFT_LWR_MODEL)
5584 AC_SUBST(DFT_LIB_SUFFIX)
5585 AC_SUBST(DFT_DEP_SUFFIX)
5588 AC_SUBST(LIBTOOL_MAKE)
5591 AC_SUBST(MAKE_NORMAL)
5592 AC_SUBST(MAKE_SHARED)
5593 AC_SUBST(MAKE_STATIC)
5595 dnl ---------------------------------------------------------------------------
5596 dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
5597 dnl ----------------
5598 AC_DEFUN([CF_WITH_VALGRIND],[
5599 CF_NO_LEAKS_OPTION(valgrind,
5600 [ --with-valgrind test: use valgrind],
5603 dnl ---------------------------------------------------------------------------
5604 dnl CF_WITH_VERSIONED_SYMS version: 7 updated: 2015/10/24 20:50:26
5605 dnl ----------------------
5606 dnl Use this when building shared library with ELF, to markup symbols with the
5607 dnl version identifier from the given input file. Generally that identifier is
5608 dnl the same as the SONAME at which the symbol was first introduced.
5610 dnl $1 = basename of the ".map" file (default $PACKAGE)
5611 AC_DEFUN([CF_WITH_VERSIONED_SYMS],
5613 AC_MSG_CHECKING(if versioned-symbols file should be used)
5614 AC_ARG_WITH(versioned-syms,
5615 [ --with-versioned-syms=X markup versioned symbols using ld],
5616 [with_versioned_syms=$withval],
5617 [with_versioned_syms=no])
5618 if test "x$with_versioned_syms" = xyes
5620 with_versioned_syms='${top_srcdir}/package/ifelse($1,,${PACKAGE},[$1]).map'
5623 AC_MSG_RESULT($with_versioned_syms)
5629 if test "x$with_versioned_syms" != xno
5631 RESULTING_SYMS=$with_versioned_syms
5632 case "x$MK_SHARED_LIB" in
5634 VERSIONED_SYMS="-Wl,--version-script,\${RESULTING_SYMS}"
5635 MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-Wl,%\\[$]{VERSIONED_SYMS} -Wl,%"`
5636 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
5639 VERSIONED_SYMS="-Wl,-M,\${RESULTING_SYMS}"
5640 MK_SHARED_LIB=`echo "$MK_SHARED_LIB" | sed -e "s%-dy%\\[$]{VERSIONED_SYMS} -dy%"`
5641 CF_VERBOSE(MK_SHARED_LIB: $MK_SHARED_LIB)
5644 AC_MSG_WARN(this system does not support versioned-symbols)
5648 # Linux ld can selectively override scope, e.g., of symbols beginning with
5649 # "_" by first declaring some as global, and then using a wildcard to
5650 # declare the others as local. Some other loaders cannot do this. Check
5651 # by constructing a (very) simple shared library and inspecting its
5653 if test "x$VERSIONED_SYMS" != "x"
5655 AC_MSG_CHECKING(if wildcards can be used to selectively omit symbols)
5661 cat >conftest.ver <<EOF
5690 cat >conftest.$ac_ext <<EOF
5691 #line __oline__ "configure"
5692 int _ismissing(void) { return 1; }
5693 int _localf1(void) { return 1; }
5694 int _localf2(void) { return 2; }
5695 int globalf1(void) { return 1; }
5696 int globalf2(void) { return 2; }
5697 int _sublocalf1(void) { return 1; }
5698 int _sublocalf2(void) { return 2; }
5699 int subglobalf1(void) { return 1; }
5700 int subglobalf2(void) { return 2; }
5702 cat >conftest.mk <<EOF
5705 CPPFLAGS=${CPPFLAGS}
5708 VERSIONED_SYMS=${VERSIONED_SYMS}
5709 RESULTING_SYMS=conftest.ver
5710 MK_SHARED_LIB=${MK_SHARED_LIB}
5711 conftest.so: conftest.$ac_cv_objext
5712 \$(MK_SHARED_LIB) conftest.$ac_cv_objext
5715 # compile source, make library
5716 if make -f conftest.mk 2>&AC_FD_CC >/dev/null
5718 # test for missing symbol in either Data or Text section
5719 cf_missing=`nm -P conftest.so 2>&AC_FD_CC |fgrep _ismissing | egrep '[[ ]][[DT]][[ ]]'`
5720 test -n "$cf_missing" && WILDCARD_SYMS=yes
5722 AC_MSG_RESULT($WILDCARD_SYMS)
5726 AC_SUBST(RESULTING_SYMS)
5727 AC_SUBST(VERSIONED_SYMS)
5728 AC_SUBST(WILDCARD_SYMS)
5730 dnl ---------------------------------------------------------------------------
5731 dnl CF_WITH_WARNINGS version: 5 updated: 2004/07/23 14:40:34
5732 dnl ----------------
5733 dnl Combine the checks for gcc features into a configure-script option
5736 dnl $1 - see CF_GCC_WARNINGS
5737 AC_DEFUN([CF_WITH_WARNINGS],
5739 if ( test "$GCC" = yes || test "$GXX" = yes )
5741 AC_MSG_CHECKING(if you want to check for gcc warnings)
5742 AC_ARG_WITH(warnings,
5743 [ --with-warnings test: turn on gcc warnings],
5744 [cf_opt_with_warnings=$withval],
5745 [cf_opt_with_warnings=no])
5746 AC_MSG_RESULT($cf_opt_with_warnings)
5747 if test "$cf_opt_with_warnings" != no ; then
5749 CF_GCC_WARNINGS([$1])
5753 dnl ---------------------------------------------------------------------------
5754 dnl CF_XOPEN_CURSES version: 14 updated: 2018/06/20 20:23:13
5756 dnl Test if we should define X/Open source for curses, needed on Digital Unix
5757 dnl 4.x, to see the extended functions, but breaks on IRIX 6.x.
5759 dnl The getbegyx() check is needed for HPUX, which omits legacy macros such
5760 dnl as getbegy(). The latter is better design, but the former is standard.
5761 AC_DEFUN([CF_XOPEN_CURSES],
5763 AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl
5764 AC_CACHE_CHECK(definition to turn on extended curses functions,cf_cv_need_xopen_extension,[
5765 cf_cv_need_xopen_extension=unknown
5768 #include <${cf_cv_ncurses_header:-curses.h}>],[
5769 #if defined(NCURSES_VERSION_PATCH)
5770 #if (NCURSES_VERSION_PATCH < 20100501) && (NCURSES_VERSION_PATCH >= 20100403)
5774 #ifdef NCURSES_VERSION
5776 int check2 = curs_set((int)sizeof(check));
5778 long x = winnstr(stdscr, "", 0);
5780 getbegyx(stdscr, y1, x1)],
5781 [cf_cv_need_xopen_extension=none],
5783 for cf_try_xopen_extension in _XOPEN_SOURCE_EXTENDED NCURSES_WIDECHAR
5786 #define $cf_try_xopen_extension 1
5788 #include <${cf_cv_ncurses_header:-curses.h}>],[
5789 #ifdef NCURSES_VERSION
5791 int check2 = curs_set((int)sizeof(check));
5793 long x = winnstr(stdscr, "", 0);
5795 getbegyx(stdscr, y1, x1)],
5796 [cf_cv_need_xopen_extension=$cf_try_xopen_extension; break])
5801 case $cf_cv_need_xopen_extension in
5803 CF_APPEND_TEXT(CPPFLAGS,-D$cf_cv_need_xopen_extension)
5808 dnl ---------------------------------------------------------------------------
5809 dnl CF_XOPEN_SOURCE version: 53 updated: 2018/06/16 18:58:58
5811 dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions,
5812 dnl or adapt to the vendor's definitions to get equivalent functionality,
5813 dnl without losing the common non-POSIX features.
5816 dnl $1 is the nominal value for _XOPEN_SOURCE
5817 dnl $2 is the nominal value for _POSIX_C_SOURCE
5818 AC_DEFUN([CF_XOPEN_SOURCE],[
5819 AC_REQUIRE([AC_CANONICAL_HOST])
5821 cf_XOPEN_SOURCE=ifelse([$1],,500,[$1])
5822 cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2])
5827 cf_xopen_source="-D_ALL_SOURCE"
5833 cf_xopen_source="-D_APPLE_C_SOURCE"
5836 cf_xopen_source="-D_DARWIN_C_SOURCE"
5839 (freebsd*|dragonfly*)
5840 # 5.x headers associate
5841 # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L
5842 # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L
5843 cf_POSIX_C_SOURCE=200112L
5845 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE"
5848 cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500"
5851 cf_xopen_source="-D_HPUX_SOURCE"
5854 cf_xopen_source="-D_SGI_SOURCE"
5857 (linux*|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin)
5858 CF_GNU_SOURCE($cf_XOPEN_SOURCE)
5861 cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this...
5864 # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks <sys/select.h> and other headers which use u_int / u_short types
5866 CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
5869 cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw
5872 # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw
5873 cf_xopen_source="-D_BSD_SOURCE"
5877 # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw
5880 cf_xopen_source="-D_OSF_SOURCE"
5883 cf_xopen_source="-D_QNX_SOURCE"
5886 # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer
5889 cf_xopen_source="-D__EXTENSIONS__"
5890 cf_cv_xopen_source=broken
5892 (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2)
5898 CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE)
5902 if test -n "$cf_xopen_source" ; then
5903 CF_ADD_CFLAGS($cf_xopen_source,true)
5906 dnl In anything but the default case, we may have system-specific setting
5907 dnl which is still not guaranteed to provide all of the entrypoints that
5908 dnl _XOPEN_SOURCE would yield.
5909 if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then
5910 AC_MSG_CHECKING(if _XOPEN_SOURCE really is set)
5911 AC_TRY_COMPILE([#include <stdlib.h>],[
5912 #ifndef _XOPEN_SOURCE
5915 [cf_XOPEN_SOURCE_set=yes],
5916 [cf_XOPEN_SOURCE_set=no])
5917 AC_MSG_RESULT($cf_XOPEN_SOURCE_set)
5918 if test $cf_XOPEN_SOURCE_set = yes
5920 AC_TRY_COMPILE([#include <stdlib.h>],[
5921 #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE
5924 [cf_XOPEN_SOURCE_set_ok=yes],
5925 [cf_XOPEN_SOURCE_set_ok=no])
5926 if test $cf_XOPEN_SOURCE_set_ok = no
5928 AC_MSG_WARN(_XOPEN_SOURCE is lower than requested)
5935 dnl ---------------------------------------------------------------------------
5936 dnl CF_X_ATHENA version: 23 updated: 2015/04/12 15:39:00
5938 dnl Check for Xaw (Athena) libraries
5940 dnl Sets $cf_x_athena according to the flavor of Xaw which is used.
5941 AC_DEFUN([CF_X_ATHENA],
5943 cf_x_athena=${cf_x_athena:-Xaw}
5945 AC_MSG_CHECKING(if you want to link with Xaw 3d library)
5948 [ --with-Xaw3d link with Xaw 3d library])
5949 if test "$withval" = yes ; then
5956 AC_MSG_CHECKING(if you want to link with Xaw 3d xft library)
5958 AC_ARG_WITH(Xaw3dxft,
5959 [ --with-Xaw3dxft link with Xaw 3d xft library])
5960 if test "$withval" = yes ; then
5961 cf_x_athena=Xaw3dxft
5967 AC_MSG_CHECKING(if you want to link with neXT Athena library)
5970 [ --with-neXtaw link with neXT Athena library])
5971 if test "$withval" = yes ; then
5978 AC_MSG_CHECKING(if you want to link with Athena-Plus library)
5980 AC_ARG_WITH(XawPlus,
5981 [ --with-XawPlus link with Athena-Plus library])
5982 if test "$withval" = yes ; then
5991 if test "$PKG_CONFIG" != none ; then
5993 test "$cf_x_athena" = Xaw && cf_athena_list="xaw8 xaw7 xaw6"
5994 for cf_athena_pkg in \
5997 ${cf_x_athena}-devel \
5999 lib${cf_x_athena}-devel
6001 CF_TRY_PKG_CONFIG($cf_athena_pkg,[
6002 cf_x_athena_lib="$cf_pkgconfig_libs"
6003 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
6004 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
6008 AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
6010 #include <X11/Xmu/CharSet.h>
6012 int check = XmuCompareISOLatin1("big", "small")
6013 ],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
6015 if test "$cf_cv_xaw_compat" = no
6017 # workaround for broken ".pc" files...
6018 case "$cf_x_athena_lib" in
6022 CF_VERBOSE(work around broken package)
6024 cf_first_lib=`echo "$cf_save_xmu" | sed -e 's/^[ ][ ]*//' -e 's/ .*//'`
6025 CF_TRY_PKG_CONFIG(xmu,[
6027 CF_ADD_LIB_AFTER($cf_first_lib,$cf_pkgconfig_libs)
6029 CF_ADD_LIB_AFTER($cf_first_lib,-lXmu)
6040 if test -z "$cf_x_athena_lib" ; then
6043 CF_X_ATHENA_CPPFLAGS($cf_x_athena)
6044 CF_X_ATHENA_LIBS($cf_x_athena)
6047 dnl ---------------------------------------------------------------------------
6048 dnl CF_X_ATHENA_CPPFLAGS version: 6 updated: 2018/06/20 20:23:13
6049 dnl --------------------
6050 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
6051 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
6052 AC_DEFUN([CF_X_ATHENA_CPPFLAGS],
6054 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
6057 for cf_path in default \
6058 /usr/contrib/X11R6 \
6059 /usr/contrib/X11R5 \
6063 if test -z "$cf_x_athena_inc" ; then
6065 cf_test=X11/$cf_x_athena_root/SimpleMenu.h
6066 if test $cf_path != default ; then
6068 CF_APPEND_TEXT(CPPFLAGS,-I$cf_path/include)
6069 AC_MSG_CHECKING(for $cf_test in $cf_path)
6071 AC_MSG_CHECKING(for $cf_test)
6074 #include <X11/Intrinsic.h>
6075 #include <$cf_test>],[],
6078 AC_MSG_RESULT($cf_result)
6079 if test "$cf_result" = yes ; then
6080 cf_x_athena_inc=$cf_path
6088 if test -z "$cf_x_athena_inc" ; then
6090 [Unable to successfully find Athena header files with test program])
6091 elif test "$cf_x_athena_inc" != default ; then
6092 CF_APPEND_TEXT(CPPFLAGS,-I$cf_x_athena_inc)
6095 dnl ---------------------------------------------------------------------------
6096 dnl CF_X_ATHENA_LIBS version: 12 updated: 2011/07/17 19:55:02
6097 dnl ----------------
6098 dnl Normally invoked by CF_X_ATHENA, with $1 set to the appropriate flavor of
6099 dnl the Athena widgets, e.g., Xaw, Xaw3d, neXtaw.
6100 AC_DEFUN([CF_X_ATHENA_LIBS],
6101 [AC_REQUIRE([CF_X_TOOLKIT])
6102 cf_x_athena_root=ifelse([$1],,Xaw,[$1])
6105 for cf_path in default \
6106 /usr/contrib/X11R6 \
6107 /usr/contrib/X11R5 \
6112 ${cf_x_athena_root} \
6113 ${cf_x_athena_root}7 \
6114 ${cf_x_athena_root}6
6118 "-l$cf_lib -lXpm -lXmu" \
6119 "-l${cf_lib}_s -lXmu_s"
6121 if test -z "$cf_x_athena_lib" ; then
6123 cf_test=XawSimpleMenuAddGlobalActions
6124 if test $cf_path != default ; then
6125 CF_ADD_LIBS(-L$cf_path/lib $cf_libs)
6126 AC_MSG_CHECKING(for $cf_libs in $cf_path)
6128 CF_ADD_LIBS($cf_libs)
6129 AC_MSG_CHECKING(for $cf_test in $cf_libs)
6132 #include <X11/Intrinsic.h>
6133 #include <X11/$cf_x_athena_root/SimpleMenu.h>
6135 $cf_test((XtAppContext) 0)],
6138 AC_MSG_RESULT($cf_result)
6139 if test "$cf_result" = yes ; then
6140 cf_x_athena_lib="$cf_libs"
6146 test -n "$cf_x_athena_lib" && break
6150 if test -z "$cf_x_athena_lib" ; then
6152 [Unable to successfully link Athena library (-l$cf_x_athena_root) with test program])
6155 CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
6156 AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
6158 dnl ---------------------------------------------------------------------------
6159 dnl CF_X_EXT version: 3 updated: 2010/06/02 05:03:05
6161 AC_DEFUN([CF_X_EXT],[
6162 CF_TRY_PKG_CONFIG(Xext,,[
6163 AC_CHECK_LIB(Xext,XextCreateExtension,
6164 [CF_ADD_LIB(Xext)])])
6166 dnl ---------------------------------------------------------------------------
6167 dnl CF_X_TOOLKIT version: 23 updated: 2015/04/12 15:39:00
6169 dnl Check for X Toolkit libraries
6170 AC_DEFUN([CF_X_TOOLKIT],
6172 AC_REQUIRE([AC_PATH_XTRA])
6173 AC_REQUIRE([CF_CHECK_CACHE])
6175 # OSX is schizoid about who owns /usr/X11 (old) versus /opt/X11 (new), and (and
6176 # in some cases has installed dummy files in the former, other cases replaced
6177 # it with a link to the new location). This complicates the configure script.
6178 # Check for that pitfall, and recover using pkg-config
6180 # If none of these are set, the configuration is almost certainly broken.
6181 if test -z "${X_CFLAGS}${X_PRE_LIBS}${X_LIBS}${X_EXTRA_LIBS}"
6183 CF_TRY_PKG_CONFIG(x11,,[AC_MSG_WARN(unable to find X11 library)])
6184 CF_TRY_PKG_CONFIG(ice,,[AC_MSG_WARN(unable to find ICE library)])
6185 CF_TRY_PKG_CONFIG(sm,,[AC_MSG_WARN(unable to find SM library)])
6186 CF_TRY_PKG_CONFIG(xt,,[AC_MSG_WARN(unable to find Xt library)])
6191 CF_TRY_PKG_CONFIG(xt,[
6197 # we have an "xt" package, but it may omit Xt's dependency on X11
6198 AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
6200 #include <X11/Xlib.h>
6202 int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
6203 int rc2 = XClearWindow((Display*) 0, (Window) 0);
6204 int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
6205 int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
6206 ],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])])
6207 if test "$cf_cv_xt_x11_compat" = no
6209 CF_VERBOSE(work around broken X11 dependency)
6210 # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
6211 CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)])
6216 AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[
6218 #include <X11/Shell.h>
6219 ],[int num = IceConnectionNumber(0)
6220 ],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
6222 if test "$cf_cv_xt_ice_compat" = no
6224 # workaround for broken ".pc" files used for X Toolkit.
6225 case "x$X_PRE_LIBS" in
6231 CF_VERBOSE(work around broken ICE dependency)
6232 CF_TRY_PKG_CONFIG(ice,
6233 [CF_TRY_PKG_CONFIG(sm)],
6234 [CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)])
6244 LDFLAGS="$X_LIBS $LDFLAGS"
6245 CF_CHECK_CFLAGS($X_CFLAGS)
6247 AC_CHECK_FUNC(XOpenDisplay,,[
6248 AC_CHECK_LIB(X11,XOpenDisplay,
6250 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
6252 AC_CHECK_FUNC(XtAppInitialize,,[
6253 AC_CHECK_LIB(Xt, XtAppInitialize,
6254 [AC_DEFINE(HAVE_LIBXT,1,[Define to 1 if we can compile with the Xt library])
6256 LIBS="-lXt $X_PRE_LIBS $LIBS $X_EXTRA_LIBS"],,
6257 [$X_PRE_LIBS $LIBS $X_EXTRA_LIBS])])
6260 if test $cf_have_X_LIBS = no ; then
6262 [Unable to successfully link X Toolkit library (-lXt) with
6263 test program. You will have to check and add the proper libraries by hand
6267 dnl ---------------------------------------------------------------------------
6268 dnl CF__ADD_SHLIB_RULES version: 6 updated: 2016/04/21 21:07:50
6269 dnl -------------------
6270 dnl Append rules for creating, installing, uninstalling and cleaning library.
6271 dnl In particular, this is needed for shared libraries since there are symbolic
6272 dnl links which depend on configuration choices.
6274 dnl The logic is controlled by these cache variables:
6275 dnl $cf_cv_do_symlinks
6276 dnl $cf_cv_shlib_version
6278 dnl The macro uses variables set by CF__DEFINE_SHLIB_VARS
6280 dnl $1 = makefile to append to
6281 dnl $2 = model (static, shared, libtool)
6282 dnl $3 = objects (dependencies)
6283 dnl $4 = additional libraries needed to link the shared library
6284 define([CF__ADD_SHLIB_RULES],[
6286 CF__DEFINE_LIB_TARGET
6290 cf_libdeps="ifelse($4,,,[$4])"
6299 # generated by CF__ADD_SHLIB_RULES
6301 # symlinks: $cf_cv_do_symlinks
6302 # shlibver: $cf_cv_shlib_version
6313 \$(LIBTOOL_CREATE) $3 $cf_libdeps
6316 if test "x$cf_cv_do_symlinks" = xyes
6319 \$(LN_S) $cf_libname $cf_liblink
6320 \$(LN_S) $cf_liblink $cf_libroot
6327 install.libs :: \$(DESTDIR)\$(libdir)/$cf_libname
6329 \$(DESTDIR)\$(libdir)/$cf_libname :: \\
6330 \$(DESTDIR)\$(libdir) \\
6333 \$(LIBTOOL_CREATE) $3 $cf_libdeps
6336 if test "x$cf_cv_do_symlinks" = xyes
6339 cd \$(DESTDIR)\$(libdir) && (\$(LN_S) $cf_libname $cf_liblink; \$(LN_S) $cf_liblink $cf_libroot; )
6343 if test x$2 = xshared
6346 - \$(SHELL) -c "if test -z "\$(DESTDIR)" ; then /sbin/ldconfig; fi"
6354 @echo uninstalling \$(DESTDIR)\$(libdir)/$cf_libname
6357 if test "x$cf_cv_do_symlinks" = xyes
6360 -rm -f \$(DESTDIR)\$(libdir)/$cf_libroot
6361 -rm -f \$(DESTDIR)\$(libdir)/$cf_liblink
6366 -rm -f \$(DESTDIR)\$(libdir)/$cf_libname
6372 if test "x$cf_cv_do_symlinks" = xyes
6385 # end generated by CF__ADD_SHLIB_RULES
6388 dnl ---------------------------------------------------------------------------
6389 dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49
6391 dnl Define a reusable chunk which includes <curses.h> and <term.h> when they
6392 dnl are both available.
6393 define([CF__CURSES_HEAD],[
6395 #include <xcurses.h>
6396 char * XCursesProgramName = "test";
6398 #include <${cf_cv_ncurses_header:-curses.h}>
6399 #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H)
6400 #include <ncursesw/term.h>
6401 #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H)
6402 #include <ncurses/term.h>
6403 #elif defined(HAVE_TERM_H)
6408 dnl ---------------------------------------------------------------------------
6409 dnl CF__DEFINE_LIB_TARGET version: 2 updated: 2015/05/10 19:52:14
6410 dnl ---------------------
6411 define([CF__DEFINE_LIB_TARGET],[
6412 cf_libname=\${LIB_BASENAME}
6413 cf_liblink=$cf_libname
6414 cf_libroot=$cf_libname
6416 if test "x$cf_cv_do_symlinks" = xyes
6418 case "x$cf_cv_shlib_version" in
6420 cf_liblink="\${LIB_ABI_NAME}"
6421 cf_libname="\${LIB_REL_NAME}"
6424 cf_liblink="\${LIB_REL_NAME}"
6425 cf_libname="\${LIB_ABI_NAME}"
6429 LIB_TARGET=$cf_libname
6431 dnl ---------------------------------------------------------------------------
6432 dnl CF__DEFINE_SHLIB_VARS version: 4 updated: 2015/09/28 17:49:10
6433 dnl ---------------------
6434 dnl Substitute makefile variables useful for CF__ADD_SHLIB_RULES.
6436 dnl The substitution requires these variables:
6437 dnl LIB_PREFIX - "lib"
6438 dnl LIB_ROOTNAME - "foo"
6439 dnl LIB_SUFFIX - ".so"
6440 dnl REL_VERSION - "5.0"
6441 dnl ABI_VERSION - "4.2.4"
6442 define([CF__DEFINE_SHLIB_VARS],[
6443 CF__DEFINE_LIB_TARGET
6444 SET_SHLIB_VARS="# begin CF__DEFINE_SHLIB_VARS\\
6445 LIB_BASENAME = \${LIB_PREFIX}\${LIB_ROOTNAME}\${LIB_SUFFIX}\\
6446 LIB_REL_NAME = \${LIB_BASENAME}.\${REL_VERSION}\\
6447 LIB_ABI_NAME = \${LIB_BASENAME}.\${ABI_VERSION}\\
6448 LIB_TARGET = $LIB_TARGET\\
6449 RM_SHARED_OPTS = $RM_SHARED_OPTS\\
6450 # end CF__DEFINE_SHLIB_VARS"
6451 AC_SUBST(SET_SHLIB_VARS)
6452 AC_SUBST(LIB_TARGET)
6454 dnl ---------------------------------------------------------------------------
6455 dnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47
6457 dnl Test-code needed for iconv compile-checks
6458 define([CF__ICONV_BODY],[
6459 iconv_t cd = iconv_open("","");
6460 iconv(cd,NULL,NULL,NULL,NULL);
6463 dnl ---------------------------------------------------------------------------
6464 dnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03
6466 dnl Header-files needed for iconv compile-checks
6467 define([CF__ICONV_HEAD],[
6471 dnl ---------------------------------------------------------------------------
6472 dnl CF__INIT_SHLIB_RULES version: 2 updated: 2013/07/27 17:38:32
6473 dnl --------------------
6474 dnl The third parameter to AC_OUTPUT, used to pass variables needed for
6475 dnl CF__ADD_SHLIB_RULES.
6476 define([CF__INIT_SHLIB_RULES],[
6477 ABI_VERSION="$ABI_VERSION"
6478 REL_VERSION="$REL_VERSION"
6479 LIB_MODEL="$LIB_MODEL"
6480 LIB_PREFIX="$LIB_PREFIX"
6481 LIB_ROOTNAME="$LIB_ROOTNAME"
6482 DFT_DEP_SUFFIX="$DFT_DEP_SUFFIX"
6483 RM_SHARED_OPTS="$RM_SHARED_OPTS"
6484 cf_cv_do_symlinks="$cf_cv_do_symlinks"
6485 cf_cv_shlib_version="$cf_cv_shlib_version"
6487 dnl ---------------------------------------------------------------------------
6488 dnl CF__INTL_BODY version: 3 updated: 2017/07/10 20:13:33
6490 dnl Test-code needed for libintl compile-checks
6491 dnl $1 = parameter 2 from AM_WITH_NLS
6492 define([CF__INTL_BODY],[
6493 bindtextdomain ("", "");
6494 return (int) gettext ("")
6495 ifelse([$1], need-ngettext, [ + (int) ngettext ("", "", 0)], [])
6496 #ifndef IGNORE_MSGFMT_HACK
6497 [ + _nl_msg_cat_cntr]
6500 dnl ---------------------------------------------------------------------------
6501 dnl CF__INTL_HEAD version: 1 updated: 2007/07/26 17:35:47
6503 dnl Header-files needed for libintl compile-checks
6504 define([CF__INTL_HEAD],[
6505 #include <libintl.h>
6506 extern int _nl_msg_cat_cntr;
6508 dnl ---------------------------------------------------------------------------
6509 dnl jm_GLIBC21 version: 4 updated: 2015/05/10 19:52:14
6511 dnl Inserted as requested by gettext 0.10.40
6512 dnl File from /usr/share/aclocal
6514 dnl ====================
6517 dnl Test for the GNU C Library, version 2.1 or newer.
6518 dnl From Bruno Haible.
6519 AC_DEFUN([jm_GLIBC21],
6521 AC_CACHE_CHECK(whether we are using the GNU C Library 2.1 or newer,
6522 ac_cv_gnu_library_2_1,
6523 [AC_EGREP_CPP([Lucky GNU user],
6525 #include <features.h>
6526 #ifdef __GNU_LIBRARY__
6527 #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 1) || (__GLIBC__ > 2)
6532 ac_cv_gnu_library_2_1=yes,
6533 ac_cv_gnu_library_2_1=no)])
6535 GLIBC21="$ac_cv_gnu_library_2_1"