Need to use pg_perm_setlocale when setting LC_CTYPE and LC_COLLATE at startup.
[PostgreSQL.git] / config / docbook.m4
blob80b6c514548f02c582d420a5e14d5f9e4e7278e2
1 # $PostgreSQL$
3 # PGAC_PROG_JADE
4 # --------------
5 AC_DEFUN([PGAC_PROG_JADE],
6 [AC_CHECK_PROGS([JADE], [openjade jade])])
9 # PGAC_PROG_NSGMLS
10 # ----------------
11 AC_DEFUN([PGAC_PROG_NSGMLS],
12 [AC_CHECK_PROGS([NSGMLS], [onsgmls nsgmls])])
15 # PGAC_CHECK_DOCBOOK(VERSION)
16 # ---------------------------
17 AC_DEFUN([PGAC_CHECK_DOCBOOK],
18 [AC_REQUIRE([PGAC_PROG_NSGMLS])
19 AC_CACHE_CHECK([for DocBook V$1], [pgac_cv_check_docbook],
20 [cat >conftest.sgml <<EOF
21 <!doctype book PUBLIC "-//OASIS//DTD DocBook V$1//EN">
22 <book>
23  <title>test</title>
24  <chapter>
25   <title>random</title>
26    <sect1>
27     <title>testsect</title>
28     <para>text</para>
29   </sect1>
30  </chapter>
31 </book>
32 EOF
34 pgac_cv_check_docbook=no
36 if test -n "$NSGMLS"; then
37   $NSGMLS -s conftest.sgml 1>&AS_MESSAGE_LOG_FD 2>&1
38   if test $? -eq 0; then
39     pgac_cv_check_docbook=yes
40   fi
42 rm -f conftest.sgml])
44 have_docbook=$pgac_cv_check_docbook
45 AC_SUBST([have_docbook])
46 ])# PGAC_CHECK_DOCBOOK
49 # PGAC_PATH_DOCBOOK_STYLESHEETS
50 # -----------------------------
51 AC_DEFUN([PGAC_PATH_DOCBOOK_STYLESHEETS],
52 [AC_ARG_VAR(DOCBOOKSTYLE, [location of DocBook stylesheets])dnl
53 AC_MSG_CHECKING([for DocBook stylesheets])
54 AC_CACHE_VAL([pgac_cv_path_stylesheets],
55 [if test -n "$DOCBOOKSTYLE"; then
56   pgac_cv_path_stylesheets=$DOCBOOKSTYLE
57 else
58   for pgac_prefix in /usr /usr/local /opt /sw; do
59     for pgac_infix in share lib; do
60       for pgac_postfix in \
61         sgml/stylesheets/nwalsh-modular \
62         sgml/stylesheets/docbook \
63         sgml/stylesheets/dsssl/docbook \
64         sgml/docbook-dsssl \
65         sgml/docbook/dsssl/modular \
66         sgml/docbook/stylesheet/dsssl/modular \
67         sgml/docbook/dsssl-stylesheets \
68         sgml/dsssl/docbook-dsssl-nwalsh
69       do
70         pgac_candidate=$pgac_prefix/$pgac_infix/$pgac_postfix
71         if test -r "$pgac_candidate/html/docbook.dsl" \
72            && test -r "$pgac_candidate/print/docbook.dsl"
73         then
74           pgac_cv_path_stylesheets=$pgac_candidate
75           break 3
76         fi
77       done
78     done
79   done
80 fi])
81 DOCBOOKSTYLE=$pgac_cv_path_stylesheets
82 AC_SUBST([DOCBOOKSTYLE])
83 if test -n "$DOCBOOKSTYLE"; then
84   AC_MSG_RESULT([$DOCBOOKSTYLE])
85 else
86   AC_MSG_RESULT(no)
87 fi])# PGAC_PATH_DOCBOOK_STYLESHEETS
90 # PGAC_PATH_COLLATEINDEX
91 # ----------------------
92 AC_DEFUN([PGAC_PATH_COLLATEINDEX],
93 [AC_REQUIRE([PGAC_PATH_DOCBOOK_STYLESHEETS])dnl
94 if test -n "$DOCBOOKSTYLE"; then
95   AC_PATH_PROGS(COLLATEINDEX, collateindex.pl, [],
96                 [$DOCBOOKSTYLE/bin $PATH])
97 else
98   AC_PATH_PROGS(COLLATEINDEX, collateindex.pl)
99 fi])# PGAC_PATH_COLLATEINDEX
102 # PGAC_PATH_DOCBOOK2MAN
103 # ---------------------
104 # Find docbook2man program from the docbook2X package.  Upstream calls
105 # this program docbook2man, but there is also a different docbook2man
106 # out there from the docbook-utils package.  Thus, the program we want
107 # is called docbook2x-man on Debian and db2x_docbook2man on Fedora.
109 # (Consider rewriting this macro using AC_PATH_PROGS_FEATURE_CHECK
110 # when switching to Autoconf 2.62+.)
111 AC_DEFUN([PGAC_PATH_DOCBOOK2MAN],
112 [AC_CACHE_CHECK([for docbook2man], [ac_cv_path_DOCBOOK2MAN],
113 [if test -z "$DOCBOOK2MAN"; then
114   _AS_PATH_WALK([],
115   [for ac_prog in docbook2x-man db2x_docbook2man docbook2man; do
116     ac_path="$as_dir/$ac_prog"
117     AS_EXECUTABLE_P(["$ac_path"]) || continue
118     if "$ac_path" --version 2>/dev/null | $GREP docbook2x >/dev/null 2>&1; then
119       ac_cv_path_DOCBOOK2MAN=$ac_path
120       break
121     fi
122   done])
123 else
124   ac_cv_path_DOCBOOK2MAN=$DOCBOOK2MAN
125 fi])
126 DOCBOOK2MAN=$ac_cv_path_DOCBOOK2MAN
127 AC_SUBST(DOCBOOK2MAN)
128 ])# PGAC_PATH_DOCBOOK2MAN