Imported Upstream version 1.22.3
[platform/upstream/groff.git] / src / libs / gnulib / configure.ac
1 # Process this file with autoconf to produce a configure script.
2 #
3 # Copyright (C) 1989-2014 Free Software Foundation, Inc.
4 #
5 # This file is part of groff.
6 #
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.
10 #
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
14 # for more details.
15 #
16 # You can find the license text of GPL2 in the internet at
17 # <http://www.gnu.org/licenses/gpl-2.0.txt>.
18
19 AC_INIT([dummy], [0])
20 AC_CONFIG_AUX_DIR([build-aux])
21 AM_INIT_AUTOMAKE
22
23 AC_CONFIG_HEADERS([config.h])
24
25 AC_PROG_CC
26 AC_PROG_INSTALL
27 AC_PROG_MAKE_SET
28
29 # For autobuild.
30 AC_CANONICAL_BUILD
31 AC_CANONICAL_HOST
32
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
37
38 gl_PROG_AR_RANLIB
39
40 AM_PROG_CC_C_O
41
42 gl_USE_SYSTEM_EXTENSIONS
43 AM_CONDITIONAL([GL_COND_LIBTOOL], [false])
44 gl_cond_libtool=false
45 gl_libdeps=
46 gl_ltlibdeps=
47 AC_DEFUN([gl_INIT], [
48 gl_m4_base='m4'
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], [])
54   gl_COMMON
55 gl_source_base='lib'
56   gl_CONFIGMAKE_PREP
57   AC_REQUIRE([gl_EXTERN_INLINE])
58   gl_INTTYPES_H
59   gl_INTTYPES_INCOMPLETE
60   gl_LOCALCHARSET
61   LOCALCHARSET_TESTS_ENVIRONMENT="CHARSETALIASDIR=\"\$(abs_top_builddir)/$gl_source_base\""
62   AC_SUBST([LOCALCHARSET_TESTS_ENVIRONMENT])
63   gl_MULTIARCH
64   AM_STDBOOL_H
65   gl_STDDEF_H
66   gl_STDINT_H
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])
70   gl_WCHAR_H
71   gl_WCTYPE_H
72   gl_FUNC_WCWIDTH
73   if test $HAVE_WCWIDTH = 0 || test $REPLACE_WCWIDTH = 1; then
74     AC_LIBOBJ([wcwidth])
75   fi
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
82           exit 1
83         fi
84       done])dnl
85       m4_if(m4_sysval, [0], [],
86         [AC_FATAL([expected source file, required through AC_LIBSOURCES, not found])])
87   ])
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([
94     gl_libobjs=
95     gl_ltlibobjs=
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"
102       done
103     fi
104     AC_SUBST([gl_LIBOBJS], [$gl_libobjs])
105     AC_SUBST([gl_LTLIBOBJS], [$gl_ltlibobjs])
106   ])
107   LIBGNU_LIBDEPS="$gl_libdeps"
108   AC_SUBST([LIBGNU_LIBDEPS])
109   LIBGNU_LTLIBDEPS="$gl_ltlibdeps"
110   AC_SUBST([LIBGNU_LTLIBDEPS])
111 ])
112
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"
118 ])
119
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)])
125 ])
126
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, [ ])
136     ])
137   ])
138 ])
139
140 gl_INIT
141
142 AC_CONFIG_FILES([Makefile lib/Makefile m4/Makefile])
143 AC_OUTPUT