summaryrefslogtreecommitdiffstats
path: root/configure.in
blob: 822bedf39c045b6d9320b8a5deaa8c6257b24f3b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
dnl Process this file with autoconf to produce a configure script.
AC_PREREQ(2.13)
AC_REVISION($Revision: 1.25 $)
AC_INIT(src/msgfmt.c)
AM_INIT_AUTOMAKE(gettext, 0.10.37)
RELEASE_DATE=2001-04-19      dnl in "date +%Y-%m-%d" format
AM_CONFIG_HEADER(config.h)

dnl Set of available languages.
ALL_LINGUAS="da de el en@quot en@boldquot es fr ja ko nl nn no pl pt pt_BR sl sv tr"

dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_YACC

dnl Check for host type.
AC_CANONICAL_HOST

dnl Checks for UNIX variants that set DEFS,
AC_ISC_POSIX

dnl Checks for compiler output filename suffixes.
AC_OBJEXT
AC_EXEEXT

dnl Check for build configuration.
AM_PROG_LIBTOOL

AC_DEFINE(_GNU_SOURCE, 1, [Make sure we see all GNU extensions.])

dnl Checks for libraries.

dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(limits.h malloc.h string.h unistd.h values.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
bh_C_SIGNED
AC_C_BACKSLASH_A
jm_AC_TYPE_UNSIGNED_LONG_LONG
AC_TYPE_OFF_T
AC_TYPE_SIZE_T
AM_TYPE_PTRDIFF_T
jm_AC_TYPE_UINTMAX_T

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([getcwd mblen memcpy strchr strerror uname])
AC_REPLACE_FUNCS([memmove memset stpcpy stpncpy strcspn \
strcasecmp strncasecmp strstr strtoul vasprintf])
AM_FUNC_GETLINE
if test $am_cv_func_working_getline != yes; then
  AC_CHECK_FUNCS(getdelim)
fi
jm_PREREQ_MBSWIDTH

AC_CHECK_FUNC(parse_printf_format, gt_cv_func_parse_printf_format=yes,
  gt_cv_func_parse_printf_format=no)
if test $gt_cv_func_parse_printf_format = yes; then
  AC_DEFINE(HAVE_PARSE_PRINTF_FORMAT, 1,
    [Define if you have the parse_printf_format() function.])
else
  LIBOBJS="$LIBOBJS printf-prs.o"
fi

AM_FUNC_ERROR_AT_LINE

gt_SETLOCALE

dnl These are the only lines required to internationalize the package.
dnl (OK, not quite, the AC_OUTPUT has also some parts.)
AM_GNU_GETTEXT(use-libtool, need-ngettext)

dnl Check for Emacs and where to install .elc files.
AM_PATH_LISPDIR

dnl The gettextize script test for the version of the aclocal.m4 file in
dnl user's project.  This must correspond to the number the aclocal.m4
dnl here has.  Extract it.
changequote(,)dnl
ACLOCAL_VERSION=`sed -e 's/.*Last updated for gettext-\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/p' -e d $srcdir/aclocal.m4`
changequote([, ])dnl
AC_SUBST(ACLOCAL_VERSION)

aclocaldir='${datadir}/aclocal'
AC_SUBST(aclocaldir)

dnl Check for tools needed for formatting the documentation.
ac_aux_dir_abs=`cd $ac_aux_dir && pwd`
AC_PATH_PROG(DVIPS, dvips, $ac_aux_dir_abs/missing dvips)
AC_PATH_PROG(TEXI2PDF, texi2pdf, $ac_aux_dir_abs/missing texi2pdf)
AC_PATH_PROG(TEXI2HTML, texi2html, $ac_aux_dir_abs/missing texi2html)

dnl Generate the version information file in the intl/ directory.
test -d intl || mkdir intl
echo "GNU gettext library from $PACKAGE-$VERSION" > intl/VERSION
cat > intl/ChangeLog.inst <<EOF
$RELEASE_DATE  GNU  <bug-gnu-utils@gnu.org>

	* Version $VERSION released.

EOF

AC_OUTPUT([Makefile lib/Makefile intl/Makefile src/Makefile \
           po/Makefile.in doc/Makefile tests/Makefile m4/Makefile \
	   misc/Makefile misc/gettextize], [
  dnl Workaround an automake-1.4 bug which generates a distclean-recursive
  dnl target in Makefile.in which causes a "make distclean" failure on FreeBSD.
changequote(,)dnl
  sed -e 's/test \([^ ]*\) = \([^ ]*\) \&\& /test \1 != \2 \|\| /' < Makefile \
      > Makefile.tmp
changequote([, ])dnl
  mv Makefile.tmp Makefile
  dnl Workaround an automake-1.4 bug which generates an incorrect uninstall
  dnl target in misc/Makefile.in.
  sed -e 's/rm -f \$(lispdir)/rm -f \$(DESTDIR)\$(lispdir)/' < misc/Makefile \
      > misc/Makefile.tmp
  mv misc/Makefile.tmp misc/Makefile
  dnl Workaround another automake-1.4 bug which generates incorrect install
  dnl and uninstall targets in misc/Makefile.in.
  sed -e "s/list='\\\$(lisp_LISP)'; for/list='\$(lisp_LISP)'; test '\$(EMACS)' = no || for/" \
      < misc/Makefile > misc/Makefile.tmp
  mv misc/Makefile.tmp misc/Makefile
  dnl Workaround another automake-1.4 bug which forgets to add $(EXEEXT)
  dnl suffixes to elements of EXTRA_PROGRAMS. It does correctly add the suffix
  dnl to the elements of bin_PROGRAMS.
changequote(,)dnl
  sed -e '/^EXTRA_PROGRAMS = /{' -e 's/\([a-z0-9_]\)\( \)/\1\$(EXEEXT)\2/g' -e 's/\([a-z0-9_]\)$/\1\$(EXEEXT)/g' -e '}' \
      < tests/Makefile > tests/Makefile.tmp
changequote([, ])dnl
  mv tests/Makefile.tmp tests/Makefile
])