1 # Process this file with autoconf to produce a configure script.
3 # Copyright (C) 1989-2014 Free Software Foundation, Inc.
5 # This file is part of groff.
7 # groff is free software; you can redistribute it and/or modify it
8 # under the terms of the GNU General Public License as published by
9 # the Free Software Foundation, either version 2 of the License.
11 # groff is distributed in the hope that it will be useful, but WITHOUT ANY
12 # WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
16 # You can find the license text of GPL2 in the internet at
17 # <http://www.gnu.org/licenses/gpl-2.0.txt>.
20 AC_CONFIG_AUX_DIR([build-aux])
23 AC_CONFIG_HEADERS([config.h])
33 m4_pattern_forbid([^gl_[A-Z]])dnl the gnulib macro namespace
34 m4_pattern_allow([^gl_ES$])dnl a valid locale name
35 m4_pattern_allow([^gl_LIBOBJS$])dnl a variable
36 m4_pattern_allow([^gl_LTLIBOBJS$])dnl a variable
42 gl_USE_SYSTEM_EXTENSIONS
43 AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
49 m4_pushdef([AC_LIBOBJ], m4_defn([gl_LIBOBJ]))
50 m4_pushdef([AC_REPLACE_FUNCS], m4_defn([gl_REPLACE_FUNCS]))
51 m4_pushdef([AC_LIBSOURCES], m4_defn([gl_LIBSOURCES]))
52 m4_pushdef([gl_LIBSOURCES_LIST], [])
53 m4_pushdef([gl_LIBSOURCES_DIR], [])
57 AC_REQUIRE([gl_EXTERN_INLINE])
59 gl_INTTYPES_INCOMPLETE
61 LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
62 AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
67 gl_LIBUNISTRING_LIBHEADER([0.9], [unitypes.h])
68 gl_LIBUNISTRING_LIBHEADER([0.9], [uniwidth.h])
69 gl_LIBUNISTRING_MODULE([0.9.4], [uniwidth/width])
73 if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
76 gl_WCHAR_MODULE_INDICATOR([wcwidth])
77 m4_ifval(gl_LIBSOURCES_LIST, [
78 m4_syscmd([test ! -d ]m4_defn([gl_LIBSOURCES_DIR])[ ||
79 for gl_file in ]gl_LIBSOURCES_LIST[ ; do
80 if test ! -r ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file ; then
81 echo "missing file ]m4_defn([gl_LIBSOURCES_DIR])[/$gl_file" >&2
85 m4_if(m4_sysval, [0], [],
86 [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
88 m4_popdef([gl_LIBSOURCES_DIR])
89 m4_popdef([gl_LIBSOURCES_LIST])
90 m4_popdef([AC_LIBSOURCES])
91 m4_popdef([AC_REPLACE_FUNCS])
92 m4_popdef([AC_LIBOBJ])
93 AC_CONFIG_COMMANDS_PRE([
96 if test -n "$gl_LIBOBJS"; then
97 # Remove the extension.
98 sed_drop_objext='s/\.o$//;s/\.obj$//'
99 for i in `for i in $gl_LIBOBJS; do echo "$i"; done | sed -e "$sed_drop_objext" | sort | uniq`; do
100 gl_libobjs="$gl_libobjs $i.$ac_objext"
101 gl_ltlibobjs="$gl_ltlibobjs $i.lo"
104 AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
105 AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
107 LIBGNU_LIBDEPS="$gl_libdeps"
108 AC_SUBST([LIBGNU_LIBDEPS])
109 LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
110 AC_SUBST([LIBGNU_LTLIBDEPS])
113 # Like AC_LIBOBJ, except that the module name goes
114 # into gl_LIBOBJS instead of into LIBOBJS.
115 AC_DEFUN([gl_LIBOBJ], [
116 AS_LITERAL_IF([$1], [gl_LIBSOURCES([$1.c])])dnl
117 gl_LIBOBJS="$gl_LIBOBJS $1.$ac_objext"
120 # Like AC_REPLACE_FUNCS, except that the module name goes
121 # into gl_LIBOBJS instead of into LIBOBJS.
122 AC_DEFUN([gl_REPLACE_FUNCS], [
123 m4_foreach_w([gl_NAME], [$1], [AC_LIBSOURCES(gl_NAME[.c])])dnl
124 AC_CHECK_FUNCS([$1], , [gl_LIBOBJ($ac_func)])
127 # Like AC_LIBSOURCES, except the directory where the source file is
128 # expected is derived from the gnulib-tool parameterization,
129 # and alloca is special cased (for the alloca-opt module).
130 # We could also entirely rely on EXTRA_lib..._SOURCES.
131 AC_DEFUN([gl_LIBSOURCES], [
132 m4_foreach([_gl_NAME], [$1], [
133 m4_if(_gl_NAME, [alloca.c], [], [
134 m4_define([gl_LIBSOURCES_DIR], [lib])
135 m4_append([gl_LIBSOURCES_LIST], _gl_NAME, [ ])
142 AC_CONFIG_FILES([Makefile lib/Makefile m4/Makefile])