28ff570b985b2b0da4114aae297b216a6ac0c584
[platform/upstream/groff.git] / m4 / groff.m4
1 # Autoconf macros for groff.
2 # Copyright (C) 1989-2014  Free Software Foundation, Inc.
3 #
4 # This file is part of groff.
5 #
6 # groff is free software; you can redistribute it and/or modify it under
7 # the terms of the GNU General Public License as published by the Free
8 # Software Foundation, either version 3 of the License, or
9 # (at your option) any later version.
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 should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
18
19 AC_DEFUN([GROFF_PRINT],
20   [if test -z "$PSPRINT"; then
21      AC_CHECK_PROGS([LPR], [lpr])
22      AC_CHECK_PROGS([LP], [lp])
23      if test -n "$LPR" && test -n "$LP"; then
24        # HP-UX provides an lpr command that emulates lpr using lp,
25        # but it doesn't have lpq; in this case we want to use lp
26        # rather than lpr.
27        AC_CHECK_PROGS([LPQ], [lpq])
28        test -n "$LPQ" || LPR=
29      fi
30      if test -n "$LPR"; then
31        PSPRINT="$LPR"
32      elif test -n "$LP"; then
33        PSPRINT="$LP"
34      fi
35    fi
36    AC_SUBST([PSPRINT])
37    AC_MSG_CHECKING([for command to use for printing PostScript files])
38    AC_MSG_RESULT([$PSPRINT])
39
40    # Figure out DVIPRINT from PSPRINT.
41    AC_MSG_CHECKING([for command to use for printing dvi files])
42    if test -n "$PSPRINT" && test -z "$DVIPRINT"; then
43      if test "x$PSPRINT" = "xlpr"; then
44        DVIPRINT="lpr -d"
45      else
46        DVIPRINT="$PSPRINT"
47      fi
48    fi
49    AC_SUBST([DVIPRINT])
50    AC_MSG_RESULT([$DVIPRINT])])
51
52 # Bison generated parsers have problems with C++ compilers other than g++.
53 # So byacc is preferred over bison.
54
55 AC_DEFUN([GROFF_PROG_YACC],
56   [AC_CHECK_PROGS([YACC], [byacc 'bison -y'], [yacc])])
57
58
59 # We need Perl 5.6.1 or newer.
60
61 AC_DEFUN([GROFF_PERL],
62   [PERLVERSION=v5.6.1
63    AC_PATH_PROG([PERL], [perl], [no])
64    if test "x$PERL" = "xno"; then
65      AC_MSG_ERROR([perl binary not found], 1)
66    fi
67    AX_PROG_PERL_VERSION([$PERLVERSION], true, \
68      AC_MSG_ERROR([perl version is too old], 1))])
69
70
71 # It is possible to fine-tune generation of documentation.
72
73 AC_DEFUN([GROFF_DOC_CHECK],
74   [AC_ARG_WITH([doc],
75     [AS_HELP_STRING([--with-doc[[=TYPE]]],
76       [choose which manuals (beside man pages) are desirable. \
77        TYPE can be `yes' or `no', or a comma-separated list of \
78        one or multiple of `html', `info', `other', `pdf', and \
79        `examples', to restrict what is produced])],
80     [doc="$withval"],
81     [doc=yes])
82   test "x$doc" = xno && doc=''
83   if test "x$doc" = xyes; then
84     doc_dist_target_ok=yes
85     docadd_html=yes
86     docadd_info=yes
87     docadd_other=yes
88     docadd_pdf=yes
89     docadd_examples=yes
90   else
91     # Don't use case/esac, verify input.
92     doc_dist_target_ok=no
93     docadd_html=no
94     docadd_info=no
95     docadd_other=no
96     docadd_pdf=no
97     docadd_examples=no
98     OFS=$IFS
99     IFS=','
100     set -- $doc
101     IFS=$OFS
102     for i
103     do
104       test "x$i" = xhtml     && { docadd_html=yes; continue; }
105       test "x$i" = xinfo     && { docadd_info=yes; continue; }
106       test "x$i" = xother    && { docadd_other=yes; continue; }
107       test "x$i" = xpdf      && { docadd_pdf=yes; continue; }
108       test "x$i" = xexamples && { docadd_examples=yes; continue; }
109       AC_MSG_WARN([Invalid `--with-doc' argument:] $i)
110     done
111   fi
112   if test $docadd_html = yes; then
113     make_install_shipped_htmldoc=install_shipped_htmldoc
114     make_uninstall_shipped_htmldoc=uninstall_shipped_htmldoc
115   else
116     make_install_shipped_htmldoc=
117     make_uninstall_shipped_htmldoc=
118   fi
119   if test $docadd_other = yes; then
120     make_otherdoc=otherdoc
121     make_install_otherdoc=install_otherdoc
122     make_uninstall_otherdoc=uninstall_otherdoc
123   else
124     make_otherdoc=
125     make_install_otherdoc=
126     make_uninstall_otherdoc=
127   fi
128   if test $docadd_examples = yes; then
129     make_examples=examples
130     make_install_examples=install_examples
131     make_uninstall_examples=uninstall_examples
132   else
133     make_examples=
134     make_install_examples=
135     make_uninstall_examples=
136   fi
137   AC_SUBST([doc_dist_target_ok])
138   AC_SUBST([make_install_shipped_htmldoc])
139   AC_SUBST([make_uninstall_shipped_htmldoc])
140   AC_SUBST([make_otherdoc])
141   AC_SUBST([make_install_otherdoc])
142   AC_SUBST([make_uninstall_otherdoc])
143   AC_SUBST([make_examples])
144   AC_SUBST([make_install_examples])
145   AC_SUBST([make_uninstall_examples])])
146
147
148 # We need makeinfo 4.8 or newer.
149
150 AC_DEFUN([GROFF_MAKEINFO],
151   [if test $docadd_info = yes; then
152      missing=
153      AC_CHECK_PROG([MAKEINFO], [makeinfo], [makeinfo])
154      if test -z "$MAKEINFO"; then
155        missing="\`makeinfo' is missing."
156      else
157        AC_MSG_CHECKING([for makeinfo version])
158        # We need an additional level of quoting to make sed's regexps work.
159        [makeinfo_version=`$MAKEINFO --version 2>&1 \
160         | sed -e 's/^.* \([^ ][^ ]*\)$/\1/' -e '1q'`]
161        AC_MSG_RESULT([$makeinfo_version])
162        # Consider only the first two numbers in version number string.
163        makeinfo_version_major=`IFS=.; set x $makeinfo_version; echo 0${2}`
164        makeinfo_version_minor=`IFS=.; set x $makeinfo_version; echo 0${3}`
165        makeinfo_version_numeric=`
166          expr ${makeinfo_version_major}000 \+ ${makeinfo_version_minor}`
167        if test $makeinfo_version_numeric -lt 4008; then
168          missing="\`makeinfo' is too old."
169        fi
170      fi
171
172      if test -n "$missing"; then
173        infofile=doc/groff.info
174        test -f ${infofile} || infofile=${srcdir}/${infofile}
175        if test ! -f ${infofile} \
176         || test ${srcdir}/doc/groff.texinfo -nt ${infofile}; then
177          AC_MSG_ERROR($missing
178 [Get the `texinfo' package version 4.8 or newer.])
179        else
180          AC_MSG_WARN($missing
181 [Get the `texinfo' package version 4.8 or newer if you want to convert
182 `groff.texinfo' into a PDF or HTML document.])
183        fi
184      fi
185
186      make_infodoc=infodoc
187      make_install_infodoc=install_infodoc
188      make_uninstall_infodoc=uninstall_infodoc
189    else
190      make_infodoc=
191      make_install_infodoc=
192      make_uninstall_infodoc=
193      MAKEINFO=
194    fi
195    AC_SUBST([MAKEINFO])
196    AC_SUBST([make_infodoc])
197    AC_SUBST([make_install_infodoc])
198    AC_SUBST([make_uninstall_infodoc])])
199
200
201 # The following programs are needed for grohtml.
202
203 AC_DEFUN([GROFF_HTML_PROGRAMS],
204   [make_htmldoc=
205    make_install_htmldoc=
206    make_uninstall_htmldoc=
207    make_htmlexamples=
208    make_install_htmlexamples=
209    make_uninstall_htmlexamples=
210    AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
211
212    missing=
213    AC_FOREACH([groff_prog],
214      [pnmcut pnmcrop pnmtopng psselect pnmtops],
215      [AC_CHECK_PROG(groff_prog, groff_prog, [found], [missing])
216       if test $[]groff_prog = missing; then
217         missing="$missing \`groff_prog'"
218       fi;])
219
220    test "$GHOSTSCRIPT" = "missing" && missing="$missing \`gs'"
221
222    if test -z "$missing"; then
223      if test $docadd_html = yes; then
224        make_htmldoc=htmldoc
225        make_install_htmldoc=install_htmldoc
226        make_uninstall_htmldoc=uninstall_htmldoc
227        if test $docadd_examples = yes; then
228          make_htmlexamples=html_examples
229          make_install_htmlexamples=install_htmlexamples
230          make_uninstall_htmlexamples=uninstall_htmlexamples
231        fi
232      fi
233    else
234      plural=`set $missing; test $[#] -gt 1 && echo s`
235      missing=`set $missing
236        missing=""
237        while test $[#] -gt 0
238          do
239            case $[#] in
240              1) missing="$missing$[1]" ;;
241              2) missing="$missing$[1] and " ;;
242              *) missing="$missing$[1], " ;;
243            esac
244            shift
245          done
246          echo $missing`
247
248      docnote=.
249      test $docadd_html = yes && docnote=';
250   therefore, it will neither be possible to prepare, nor to install,
251   documentation in HTML format.'
252
253      AC_MSG_WARN([missing program$plural:
254
255   The program$plural
256      $missing
257   cannot be found in the PATH.
258   Consequently, groff's HTML backend (grohtml) will not work properly$docnote
259      ])
260      doc_dist_target_ok=no
261    fi
262    AC_SUBST([make_htmldoc])
263    AC_SUBST([make_install_htmldoc])
264    AC_SUBST([make_uninstall_htmldoc])
265    AC_SUBST([make_htmlexamples])
266    AC_SUBST([make_install_htmlexamples])
267    AC_SUBST([make_uninstall_htmlexamples])])
268
269
270 # To produce PDF docs, we need both awk and ghostscript.
271
272 AC_DEFUN([GROFF_PDFDOC_PROGRAMS],
273   [make_pdfdoc=
274    make_install_pdfdoc=
275    make_uninstall_pdfdoc=
276    make_pdfexamples=
277    make_install_pdfexamples=
278    make_uninstall_pdfexamples=
279    AC_REQUIRE([GROFF_AWK_PATH])
280    AC_REQUIRE([GROFF_GHOSTSCRIPT_PATH])
281
282    missing=""
283    test "$AWK" = missing && missing="\`awk'"
284    test "$GHOSTSCRIPT" = missing && missing="$missing \`gs'"
285    if test -z "$missing"; then
286      if test $docadd_pdf = yes; then
287        make_pdfdoc=pdfdoc
288        make_install_pdfdoc=install_pdfdoc
289        make_uninstall_pdfdoc=uninstall_pdfdoc
290        if test $docadd_examples = yes; then
291          make_pdfexamples=pdfexamples
292          make_install_pdfexamples=install_pdfexamples
293          make_uninstall_pdfexamples=uninstall_pdfexamples
294        fi
295      fi
296    else
297      plural=`set $missing; test $[#] -eq 2 && echo s`
298      test x$plural = xs \
299        && missing=`set $missing; echo "$[1] and $[2]"` \
300        || missing=`echo $missing`
301
302      docnote=.
303      test $docadd_pdf = yes && docnote=';
304   therefore, it will neither be possible to prepare, nor to install,
305   documentation and most of the examples in PDF format.'
306
307      AC_MSG_WARN([missing program$plural:
308
309   The program$plural $missing cannot be found in the PATH.
310   Consequently, groff's PDF formatter (pdfroff) will not work properly$docnote
311      ])
312      doc_dist_target_ok=no
313    fi
314    AC_SUBST([make_pdfdoc])
315    AC_SUBST([make_install_pdfdoc])
316    AC_SUBST([make_uninstall_pdfdoc])
317    AC_SUBST([make_pdfexamples])
318    AC_SUBST([make_install_pdfexamples])
319    AC_SUBST([make_uninstall_pdfexamples])])
320
321
322 # Check whether pnmtops can handle the -nosetpage option.
323
324 AC_DEFUN([GROFF_PNMTOPS_NOSETPAGE],
325   [AC_MSG_CHECKING([whether pnmtops can handle the -nosetpage option])
326    if echo P2 2 2 255 0 1 2 0 | pnmtops -nosetpage > /dev/null 2>&1 ; then
327      AC_MSG_RESULT([yes])
328      pnmtops_nosetpage="pnmtops -nosetpage"
329    else
330      AC_MSG_RESULT([no])
331      pnmtops_nosetpage="pnmtops"
332    fi
333    AC_SUBST([pnmtops_nosetpage])])
334
335
336 # Check location of `gs'; allow `--with-gs=PROG' option to override.
337
338 AC_DEFUN([GROFF_GHOSTSCRIPT_PATH],
339   [AC_REQUIRE([GROFF_GHOSTSCRIPT_PREFS])
340    AC_ARG_WITH([gs],
341      [AS_HELP_STRING([--with-gs=PROG],
342        [actual [/path/]name of ghostscript executable])],
343      [GHOSTSCRIPT=$withval],
344      [AC_CHECK_TOOLS(GHOSTSCRIPT, [$ALT_GHOSTSCRIPT_PROGS], [missing])])
345    test "$GHOSTSCRIPT" = "no" && GHOSTSCRIPT=missing])
346
347 # Preferences for choice of `gs' program...
348 # (allow --with-alt-gs="LIST" to override).
349
350 AC_DEFUN([GROFF_GHOSTSCRIPT_PREFS],
351   [AC_ARG_WITH([alt-gs],
352     [AS_HELP_STRING([--with-alt-gs=LIST],
353       [alternative names for ghostscript executable])],
354     [ALT_GHOSTSCRIPT_PROGS="$withval"],
355     [ALT_GHOSTSCRIPT_PROGS="gs gswin32c gsos2"])
356    AC_SUBST([ALT_GHOSTSCRIPT_PROGS])])
357
358
359 # Check location of `awk'; allow `--with-awk=PROG' option to override.
360
361 AC_DEFUN([GROFF_AWK_PATH],
362   [AC_REQUIRE([GROFF_AWK_PREFS])
363    AC_ARG_WITH([awk],
364      [AS_HELP_STRING([--with-awk=PROG],
365        [actual [/path/]name of awk executable])],
366      [AWK=$withval],
367      [AC_CHECK_TOOLS(AWK, [$ALT_AWK_PROGS], [missing])])
368    test "$AWK" = "no" && AWK=missing])
369
370
371 # Preferences for choice of `awk' program; allow --with-alt-awk="LIST"
372 # to override.
373
374 AC_DEFUN([GROFF_AWK_PREFS],
375   [AC_ARG_WITH([alt-awk],
376     [AS_HELP_STRING([--with-alt-awk=LIST],
377       [alternative names for awk executable])],
378     [ALT_AWK_PROGS="$withval"],
379     [ALT_AWK_PROGS="gawk mawk nawk awk"])
380    AC_SUBST([ALT_AWK_PROGS])])
381
382
383 # GROFF_CSH_HACK(if hack present, if not present)
384
385 AC_DEFUN([GROFF_CSH_HACK],
386   [AC_MSG_CHECKING([for csh hash hack])
387
388 cat <<EOF >conftest.sh
389 #! /bin/sh
390 true || exit 0
391 export PATH || exit 0
392 exit 1
393 EOF
394
395    chmod +x conftest.sh
396    if echo ./conftest.sh | (csh >/dev/null 2>&1) >/dev/null 2>&1; then
397      AC_MSG_RESULT([yes])
398      $1
399    else
400      AC_MSG_RESULT([no])
401      $2
402    fi
403    rm -f conftest.sh])
404
405
406 # From udodo!hans@relay.NL.net (Hans Zuidam)
407
408 AC_DEFUN([GROFF_ISC_SYSV3],
409   [AC_MSG_CHECKING([for ISC 3.x or 4.x])
410    if grep ['[34]\.'] /usr/options/cb.name >/dev/null 2>&1
411    then
412      AC_MSG_RESULT([yes])
413      AC_DEFINE([_SYSV3], [1], [Define if you have ISC 3.x or 4.x.])
414    else
415      AC_MSG_RESULT([no])
416    fi])
417
418 AC_DEFUN([GROFF_POSIX],
419   [AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary])
420    AC_LANG_PUSH([C++])
421    AC_COMPILE_IFELSE([
422        AC_LANG_PROGRAM([[
423
424 #include <stdio.h>
425 extern "C" { void fileno(int); }
426
427        ]])
428      ],
429      [AC_MSG_RESULT([yes])
430       AC_DEFINE([_POSIX_SOURCE], [1],
431         [Define if -D_POSIX_SOURCE is necessary.])],
432      [AC_MSG_RESULT([no])])
433    AC_LANG_POP([C++])])
434
435
436 # srand() of SunOS 4.1.3 has return type int instead of void
437
438 AC_DEFUN([GROFF_SRAND],
439   [AC_LANG_PUSH([C++])
440    AC_MSG_CHECKING([for return type of srand])
441    AC_COMPILE_IFELSE([
442        AC_LANG_PROGRAM([[
443
444 #include <stdlib.h>
445 extern "C" { void srand(unsigned int); }
446
447        ]])
448      ],
449      [AC_MSG_RESULT([void])
450       AC_DEFINE([RET_TYPE_SRAND_IS_VOID], [1],
451         [Define if srand() returns void not int.])],
452      [AC_MSG_RESULT([int])])
453    AC_LANG_POP([C++])])
454
455
456 # In April 2005, autoconf's AC_TYPE_SIGNAL is still broken.
457
458 AC_DEFUN([GROFF_TYPE_SIGNAL],
459   [AC_MSG_CHECKING([for return type of signal handlers])
460    for groff_declaration in \
461      'extern "C" void (*signal (int, void (*)(int)))(int);' \
462      'extern "C" void (*signal (int, void (*)(int)) throw ())(int);' \
463      'void (*signal ()) ();' 
464    do
465      AC_COMPILE_IFELSE([
466          AC_LANG_PROGRAM([[
467
468 #include <sys/types.h>
469 #include <signal.h>
470 #ifdef signal
471 # undef signal
472 #endif
473 $groff_declaration
474
475          ]],
476          [[
477
478 int i;
479
480          ]])
481        ],
482        [break],
483        [continue])
484    done
485
486    if test -n "$groff_declaration"; then
487      AC_MSG_RESULT([void])
488      AC_DEFINE([RETSIGTYPE], [void],
489        [Define as the return type of signal handlers
490         (`int' or `void').])
491    else
492      AC_MSG_RESULT([int])
493      AC_DEFINE([RETSIGTYPE], [int],
494        [Define as the return type of signal handlers
495         (`int' or `void').])
496    fi])
497
498
499 AC_DEFUN([GROFF_SYS_NERR],
500   [AC_LANG_PUSH([C++])
501    AC_MSG_CHECKING([for sys_nerr in <errno.h>, <stdio.h>, or <stdlib.h>])
502    AC_COMPILE_IFELSE([
503        AC_LANG_PROGRAM([[
504
505 #include <errno.h>
506 #include <stdio.h>
507 #include <stdlib.h>
508
509        ]],
510        [[
511
512 int k;
513 k = sys_nerr;
514
515        ]])
516      ],
517      [AC_MSG_RESULT([yes])
518       AC_DEFINE([HAVE_SYS_NERR], [1],
519         [Define if you have sys_nerr in <errno.h>, <stdio.h>, or <stdio.h>.])],
520      [AC_MSG_RESULT([no])])
521    AC_LANG_POP([C++])])
522
523 AC_DEFUN([GROFF_SYS_ERRLIST],
524   [AC_MSG_CHECKING([for sys_errlist[] in <errno.h>, <stdio.h>, or <stdlib.h>])
525    AC_COMPILE_IFELSE([
526        AC_LANG_PROGRAM([[
527
528 #include <errno.h>
529 #include <stdio.h>
530 #include <stdlib.h>
531
532        ]],
533        [[
534
535 int k;
536 k = (int)sys_errlist[0];
537
538        ]])
539      ],
540      [AC_MSG_RESULT([yes])
541       AC_DEFINE([HAVE_SYS_ERRLIST], [1],
542         [Define if you have sys_errlist in <errno.h>, <stdio.h>, or <stdlib.h>.])],
543      [AC_MSG_RESULT([no])])])
544
545 AC_DEFUN([GROFF_OSFCN_H],
546   [AC_LANG_PUSH([C++])
547    AC_MSG_CHECKING([C++ <osfcn.h>])
548    AC_COMPILE_IFELSE([
549        AC_LANG_PROGRAM([[
550
551 #include <osfcn.h>
552
553        ]],
554        [[
555
556 read(0, 0, 0);
557 open(0, 0);
558
559        ]])
560      ],
561      [AC_MSG_RESULT([yes])
562       AC_DEFINE([HAVE_CC_OSFCN_H], [1],
563         [Define if you have a C++ <osfcn.h>.])],
564      [AC_MSG_RESULT([no])])
565    AC_LANG_POP([C++])])
566
567
568 AC_DEFUN([GROFF_LIMITS_H],
569   [AC_LANG_PUSH([C++])
570    AC_MSG_CHECKING([C++ <limits.h>])
571    AC_COMPILE_IFELSE([
572        AC_LANG_PROGRAM([[
573
574 #include <limits.h>
575
576        ]],
577        [[
578
579 int x = INT_MIN;
580 int y = INT_MAX;
581 int z = UCHAR_MAX;
582
583        ]])
584      ],
585      [AC_MSG_RESULT([yes])
586       AC_DEFINE([HAVE_CC_LIMITS_H], [1],
587         [Define if you have a C++ <limits.h>.])],
588      [AC_MSG_RESULT([no])])
589    AC_LANG_POP([C++])])
590
591 AC_DEFUN([GROFF_TIME_T],
592   [AC_LANG_PUSH([C++])
593    AC_MSG_CHECKING([for declaration of time_t])
594    AC_COMPILE_IFELSE([
595        AC_LANG_PROGRAM([[
596
597 #include <time.h>
598
599        ]],
600        [[
601
602 time_t t = time(0);
603 struct tm *p = localtime(&t);
604
605        ]])
606      ],
607      [AC_MSG_RESULT([yes])],
608      [AC_MSG_RESULT([no])
609       AC_DEFINE([LONG_FOR_TIME_T], [1],
610         [Define if localtime() takes a long * not a time_t *.])])
611    AC_LANG_POP([C++])])
612
613 AC_DEFUN([GROFF_STRUCT_EXCEPTION],
614   [AC_MSG_CHECKING([struct exception])
615    AC_COMPILE_IFELSE([
616        AC_LANG_PROGRAM([[
617
618 #include <math.h>
619
620        ]],
621        [[
622
623 struct exception e;
624
625        ]])
626      ],
627      [AC_MSG_RESULT([yes])
628       AC_DEFINE([HAVE_STRUCT_EXCEPTION], [1],
629         [Define if <math.h> defines struct exception.])],
630      [AC_MSG_RESULT([no])])])
631
632 AC_DEFUN([GROFF_ARRAY_DELETE],
633   [AC_LANG_PUSH([C++])
634    AC_MSG_CHECKING([whether ANSI array delete syntax is supported])
635    AC_COMPILE_IFELSE([
636        AC_LANG_PROGRAM(, [[
637
638 char *p = new char[5];
639 delete [] p;
640
641        ]])
642      ],
643      [AC_MSG_RESULT([yes])],
644      [AC_MSG_RESULT([no])
645       AC_DEFINE([ARRAY_DELETE_NEEDS_SIZE], [1],
646         [Define if your C++ doesn't understand `delete []'.])])
647    AC_LANG_POP([C++])])
648
649 AC_DEFUN([GROFF_TRADITIONAL_CPP],
650   [AC_LANG_PUSH([C++])
651    AC_MSG_CHECKING([traditional preprocessor])
652    AC_COMPILE_IFELSE([
653        AC_LANG_PROGRAM([[
654
655 #define name2(a, b) a/**/b
656
657        ]],
658        [[
659
660 int name2(foo, bar);
661
662        ]])
663      ],
664      [AC_MSG_RESULT([yes])
665       AC_DEFINE([TRADITIONAL_CPP], [1],
666         [Define if your C++ compiler uses a traditional (Reiser) preprocessor.])],
667      [AC_MSG_RESULT([no])])
668    AC_LANG_POP([C++])])
669
670 AC_DEFUN([GROFF_WCOREFLAG],
671   [AC_MSG_CHECKING([w_coredump])
672    AC_RUN_IFELSE([
673        AC_LANG_PROGRAM([[
674
675 #include <sys/types.h>
676 #include <sys/wait.h>
677
678        ]],
679        [[
680
681 main()
682 {
683 #ifdef WCOREFLAG
684   exit(1);
685 #else
686   int i = 0;
687   ((union wait *)&i)->w_coredump = 1;
688   exit(i != 0200);
689 #endif
690 }
691
692        ]])
693      ],
694      [AC_MSG_RESULT([yes])
695       AC_DEFINE(WCOREFLAG, 0200,
696         [Define if the 0200 bit of the status returned by wait() indicates
697          whether a core image was produced for a process that was terminated
698          by a signal.])],
699      [AC_MSG_RESULT([no])],
700      [AC_MSG_RESULT([no])])])
701
702
703 AC_DEFUN([GROFF_BROKEN_SPOOLER_FLAGS],
704   [AC_MSG_CHECKING([default value for grops -b option])
705    test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=0
706    AC_MSG_RESULT([$BROKEN_SPOOLER_FLAGS])
707    AC_SUBST([BROKEN_SPOOLER_FLAGS])])
708
709
710 AC_DEFUN([GROFF_PAGE],
711   [AC_MSG_CHECKING([default paper size])
712    groff_prefix=$prefix
713    test "x$prefix" = "xNONE" && groff_prefix=$ac_default_prefix
714    if test -z "$PAGE"; then
715      descfile=
716      if test -r $groff_prefix/share/groff/font/devps/DESC; then
717        descfile=$groff_prefix/share/groff/font/devps/DESC
718      elif test -r $groff_prefix/lib/groff/font/devps/DESC; then
719        descfile=$groff_prefix/lib/groff/font/devps/DESC
720      else
721        for f in $groff_prefix/share/groff/*/font/devps/DESC; do
722          if test -r $f; then
723            descfile=$f
724            break
725          fi
726        done
727      fi
728
729      if test -n "$descfile"; then
730        if grep ['^paperlength[   ]\+841890'] $descfile >/dev/null 2>&1; then
731          PAGE=A4
732        elif grep ['^papersize[   ]\+[aA]4'] $descfile >/dev/null 2>&1; then
733          PAGE=A4
734        fi
735      fi
736    fi
737
738    if test -z "$PAGE"; then
739      dom=`awk '([$]1 == "dom" || [$]1 == "search") { print [$]2; exit}' \
740          /etc/resolv.conf 2>/dev/null`
741      if test -z "$dom"; then
742        dom=`(domainname) 2>/dev/null | tr -d '+'`
743        if test -z "$dom" \
744           || test "$dom" = '(none)'; then
745          dom=`(hostname) 2>/dev/null | grep '\.'`
746        fi
747      fi
748      # If the top-level domain is two letters and it's not `us' or `ca'
749      # then they probably use A4 paper.
750      case "$dom" in
751      [*.[Uu][Ss]|*.[Cc][Aa])]
752        ;;
753      [*.[A-Za-z][A-Za-z])]
754        PAGE=A4 ;;
755      esac
756    fi
757
758    test -n "$PAGE" || PAGE=letter
759    if test "x$PAGE" = "xA4"; then
760      AC_DEFINE([PAGEA4], [1],
761        [Define if the printer's page size is A4.])
762    fi
763    AC_MSG_RESULT([$PAGE])
764    AC_SUBST([PAGE])])
765
766
767 AC_DEFUN([GROFF_CXX_CHECK],
768   [AC_REQUIRE([AC_PROG_CXX])
769    AC_LANG_PUSH([C++])
770    if test "$cross_compiling" = no; then
771      AC_MSG_CHECKING([that C++ compiler can compile simple program])
772    fi
773    AC_RUN_IFELSE([
774        AC_LANG_SOURCE([[
775
776 int main() {
777   return 0;
778 }
779
780        ]])
781      ],
782      [AC_MSG_RESULT([yes])],
783      [AC_MSG_RESULT([no])
784       AC_MSG_ERROR([a working C++ compiler is required])],
785      [:])
786
787    if test "$cross_compiling" = no; then
788      AC_MSG_CHECKING([that C++ static constructors and destructors are called])
789    fi
790    AC_RUN_IFELSE([
791        AC_LANG_SOURCE([[
792
793 extern "C" {
794   void _exit(int);
795 }
796
797 int i;
798 struct A {
799   char dummy;
800   A() { i = 1; }
801   ~A() { if (i == 1) _exit(0); }
802 };
803
804 A a;
805
806 int main()
807 {
808   return 1;
809 }
810
811        ]])
812      ],
813      [AC_MSG_RESULT([yes])],
814      [AC_MSG_RESULT([no])
815       AC_MSG_ERROR([a working C++ compiler is required])],
816      [:])
817
818    AC_MSG_CHECKING([that header files support C++])
819    AC_LINK_IFELSE([
820        AC_LANG_PROGRAM([[
821
822 #include <stdio.h>
823
824        ]],
825        [[
826
827 fopen(0, 0);
828
829        ]])
830      ],
831      [AC_MSG_RESULT([yes])],
832      [AC_MSG_RESULT([no])
833       AC_MSG_ERROR([header files do not support C++
834                    (if you are using a version of gcc/g++ earlier than 2.5,
835                    you should install libg++)])])
836    AC_LANG_POP([C++])])
837
838
839 AC_DEFUN([GROFF_TMAC],
840   [AC_MSG_CHECKING([for prefix of system macro packages])
841    sys_tmac_prefix=
842    sys_tmac_file_prefix=
843    for d in /usr/share/lib/tmac /usr/lib/tmac; do
844      for t in "" tmac.; do
845        for m in an s m; do
846          f=$d/$t$m
847          if test -z "$sys_tmac_prefix" \
848             && test -f $f \
849             && grep '^\.if' $f >/dev/null 2>&1; then
850            sys_tmac_prefix=$d/$t
851            sys_tmac_file_prefix=$t
852          fi
853        done
854      done
855    done
856    AC_MSG_RESULT([$sys_tmac_prefix])
857    AC_SUBST([sys_tmac_prefix])
858
859    AC_MSG_CHECKING([which system macro packages should be made available])
860    tmac_wrap=
861    if test "x$sys_tmac_file_prefix" = "xtmac."; then
862      for f in $sys_tmac_prefix*; do
863        suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"`
864        case "$suff" in
865        e)
866          ;;
867        *)
868          grep "Copyright.*Free Software Foundation" $f >/dev/null \
869               || tmac_wrap="$tmac_wrap $suff" ;;
870        esac
871      done
872    elif test -n "$sys_tmac_prefix"; then
873      files=`echo $sys_tmac_prefix*`
874      grep "\\.so" $files >conftest.sol
875      for f in $files; do
876        case "$f" in
877        ${sys_tmac_prefix}e)
878          ;;
879        *.me)
880          ;;
881        */ms.*)
882          ;;
883        *)
884          b=`basename $f`
885          if grep "\\.so.*/$b\$" conftest.sol >/dev/null \
886             || grep -l "Copyright.*Free Software Foundation" $f >/dev/null; then
887            :
888          else
889            suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"`
890            case "$suff" in
891            tmac.*)
892              ;;
893            *)
894              tmac_wrap="$tmac_wrap $suff" ;;
895            esac
896          fi
897        esac
898      done
899      rm -f conftest.sol
900    fi
901    AC_MSG_RESULT([$tmac_wrap])
902    AC_SUBST([tmac_wrap])])
903
904
905 AC_DEFUN([GROFF_G],
906   [AC_MSG_CHECKING([for existing troff installation])
907    if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then
908      AC_MSG_RESULT([yes])
909      g=g
910    else
911      AC_MSG_RESULT([no])
912      g=
913    fi
914    AC_SUBST([g])])
915
916
917 # We need the path to install-sh to be absolute.
918
919 AC_DEFUN([GROFF_INSTALL_SH],
920   [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])
921    ac_dir=`cd $ac_aux_dir; pwd`
922    ac_install_sh="$ac_dir/install-sh -c"])
923
924
925 # Test whether install-info is available.
926
927 AC_DEFUN([GROFF_INSTALL_INFO],
928   [if test $docadd_info = yes; then
929      AC_CHECK_PROGS([INSTALL_INFO], [install-info], [:])
930    fi])
931
932
933 # At least one UNIX system, Apple Macintosh Rhapsody 5.5,
934 # does not have -lm ...
935
936 AC_DEFUN([GROFF_LIBM],
937   [AC_CHECK_LIB([m], [sin], [LIBM=-lm])
938    AC_SUBST([LIBM])])
939
940
941 # ... while the MinGW implementation of GCC for Microsoft Win32
942 # does not seem to have -lc.
943
944 AC_DEFUN([GROFF_LIBC],
945   [AC_CHECK_LIB([c], [main], [LIBC=-lc])
946    AC_SUBST([LIBC])])
947
948
949 # Check for EBCDIC -- stolen from the OS390 Unix LYNX port
950
951 AC_DEFUN([GROFF_EBCDIC],
952   [AC_MSG_CHECKING([whether character set is EBCDIC])
953    AC_COMPILE_IFELSE([
954        AC_LANG_PROGRAM([[
955
956 /* Treat any failure as ASCII for compatibility with existing art.
957    Use compile-time rather than run-time tests for cross-compiler
958    tolerance. */
959 #if '0' != 240
960 make an error "Character set is not EBCDIC"
961 #endif
962
963        ]])
964      ],
965      [groff_cv_ebcdic="yes"
966       TTYDEVDIRS="font/devcp1047"
967       AC_MSG_RESULT([yes])
968       AC_DEFINE(IS_EBCDIC_HOST, 1,
969         [Define if the host's encoding is EBCDIC.])],
970      [groff_cv_ebcdic="no"
971      TTYDEVDIRS="font/devascii font/devlatin1"
972      OTHERDEVDIRS="font/devlj4 font/devlbp"
973      AC_MSG_RESULT([no])])
974    AC_SUBST([TTYDEVDIRS])
975    AC_SUBST([OTHERDEVDIRS])])
976
977
978 # Check for OS/390 Unix.  We test for EBCDIC also -- the Linux port (with
979 # gcc) to OS/390 uses ASCII internally.
980
981 AC_DEFUN([GROFF_OS390],
982   [if test "$groff_cv_ebcdic" = "yes"; then
983      AC_MSG_CHECKING([for OS/390 Unix])
984      case `uname` in
985      OS/390)
986        CFLAGS="$CFLAGS -D_ALL_SOURCE"
987        AC_MSG_RESULT([yes]) ;;
988      *)
989        AC_MSG_RESULT([no]) ;;
990      esac
991    fi])
992
993
994 # Check whether Windows scripts like `afmtodit.cmd' should be installed.
995
996 AC_DEFUN([GROFF_CMD_FILES],
997   [AC_MSG_CHECKING([whether to install .cmd wrapper scripts for Windows])
998    case "$host_os" in
999    *mingw*)
1000      make_winscripts=winscripts
1001      make_install_winscripts=install_winscripts
1002      make_uninstall_winscripts=uninstall_winscripts
1003      AC_MSG_RESULT([yes]) ;;
1004    *)
1005      make_winscripts=
1006      make_install_winscripts=
1007      make_uninstall_winscripts=
1008      AC_MSG_RESULT([no]) ;;
1009    esac
1010    AC_SUBST([make_winscripts])
1011    AC_SUBST([make_install_winscripts])
1012    AC_SUBST([make_uninstall_winscripts])])
1013
1014
1015 # Check whether we need a declaration for a function.
1016 #
1017 # Stolen from GNU bfd.
1018
1019 AC_DEFUN([GROFF_NEED_DECLARATION],
1020   [AC_MSG_CHECKING([whether $1 must be declared])
1021    AC_LANG_PUSH([C++])
1022    AC_CACHE_VAL([groff_cv_decl_needed_$1],
1023      [AC_COMPILE_IFELSE([
1024           AC_LANG_PROGRAM([[
1025
1026 #include <stdio.h>
1027 #ifdef HAVE_STRING_H
1028 #include <string.h>
1029 #endif
1030 #ifdef HAVE_STRINGS_H
1031 #include <strings.h>
1032 #endif
1033 #ifdef HAVE_STDLIB_H
1034 #include <stdlib.h>
1035 #endif
1036 #ifdef HAVE_SYS_TIME_H
1037 #include <sys/time.h>
1038 #endif
1039 #ifdef HAVE_UNISTD_H
1040 #include <unistd.h>
1041 #endif
1042 #ifdef HAVE_MATH_H
1043 #include <math.h>
1044 #endif
1045
1046           ]],
1047           [[
1048
1049 #ifndef $1
1050   char *p = (char *) $1;
1051 #endif
1052
1053           ]])
1054       ],
1055       [groff_cv_decl_needed_$1=no],
1056       [groff_cv_decl_needed_$1=yes])])
1057    AC_MSG_RESULT([$groff_cv_decl_needed_$1])
1058    if test $groff_cv_decl_needed_$1 = yes; then
1059      AC_DEFINE([NEED_DECLARATION_]translit($1, [a-z], [A-Z]), [1],
1060        [Define if your C++ doesn't declare ]$1[().])
1061    fi
1062    AC_LANG_POP([C++])])
1063
1064
1065 # If mkstemp() isn't available, use our own mkstemp.cpp file.
1066
1067 AC_DEFUN([GROFF_MKSTEMP],
1068   [AC_MSG_CHECKING([for mkstemp])
1069    AC_LANG_PUSH([C++])
1070    AC_LIBSOURCE([mkstemp.cpp])
1071    AC_LINK_IFELSE([
1072        AC_LANG_PROGRAM([[
1073
1074 #include <stdlib.h>
1075 #include <unistd.h>
1076 int (*f) (char *);
1077
1078        ]],
1079        [[
1080
1081 f = mkstemp;
1082
1083        ]])
1084      ],
1085      [AC_MSG_RESULT([yes])
1086       AC_DEFINE([HAVE_MKSTEMP], [1], [Define if you have mkstemp().])],
1087      [AC_MSG_RESULT([no])
1088       _AC_LIBOBJ([mkstemp])])
1089    AC_LANG_POP([C++])])
1090
1091
1092 # Test whether <inttypes.h> exists, doesn't clash with <sys/types.h>,
1093 # and declares uintmax_t.  Taken from the fileutils package.
1094
1095 AC_DEFUN([GROFF_INTTYPES_H],
1096   [AC_LANG_PUSH([C++])
1097    AC_MSG_CHECKING([C++ <inttypes.h>])
1098    AC_COMPILE_IFELSE([
1099        AC_LANG_PROGRAM([[
1100
1101 #include <sys/types.h>
1102 #include <inttypes.h>
1103
1104        ]],
1105        [[
1106
1107 uintmax_t i = (uintmax_t)-1;
1108
1109        ]])
1110      ],
1111      [groff_cv_header_inttypes_h=yes
1112       AC_DEFINE([HAVE_CC_INTTYPES_H], [1],
1113         [Define if you have a C++ <inttypes.h>.])],
1114      [groff_cv_header_inttypes_h=no])
1115    AC_MSG_RESULT([$groff_cv_header_inttypes_h])
1116    AC_LANG_POP([C++])])
1117
1118
1119 # Test for working `unsigned long long'.  Taken from the fileutils package.
1120
1121 AC_DEFUN([GROFF_UNSIGNED_LONG_LONG],
1122   [AC_LANG_PUSH([C++])
1123    AC_MSG_CHECKING([for unsigned long long])
1124    AC_LINK_IFELSE([
1125        AC_LANG_PROGRAM([[
1126
1127 unsigned long long ull = 1;
1128 int i = 63;
1129 unsigned long long ullmax = (unsigned long long)-1;
1130
1131        ]],
1132        [[
1133
1134 return ull << i | ull >> i | ullmax / ull | ullmax % ull;
1135
1136        ]])
1137      ],
1138      [groff_cv_type_unsigned_long_long=yes],
1139      [groff_cv_type_unsigned_long_long=no])
1140    AC_MSG_RESULT([$groff_cv_type_unsigned_long_long])
1141    AC_LANG_POP([C++])])
1142
1143
1144 # Define uintmax_t to `unsigned long' or `unsigned long long'
1145 # if <inttypes.h> does not exist.  Taken from the fileutils package.
1146
1147 AC_DEFUN([GROFF_UINTMAX_T],
1148   [AC_REQUIRE([GROFF_INTTYPES_H])
1149    if test $groff_cv_header_inttypes_h = no; then
1150      AC_REQUIRE([GROFF_UNSIGNED_LONG_LONG])
1151      test $groff_cv_type_unsigned_long_long = yes \
1152           && ac_type='unsigned long long' \
1153           || ac_type='unsigned long'
1154      AC_DEFINE_UNQUOTED([uintmax_t], [$ac_type],
1155        [Define uintmax_t to `unsigned long' or `unsigned long long' if
1156         <inttypes.h> does not exist.])
1157    fi])
1158
1159
1160 # Identify PATH_SEPARATOR character to use in GROFF_FONT_PATH and
1161 # GROFF_TMAC_PATH which is appropriate for the target system (POSIX=':',
1162 # MS-DOS/Win32=';').
1163 #
1164 # The logic to resolve this test is already encapsulated in
1165 # `${srcdir}/src/include/nonposix.h'.
1166
1167 AC_DEFUN([GROFF_TARGET_PATH_SEPARATOR],
1168   [AC_MSG_CHECKING([separator character to use in groff search paths])
1169    cp ${srcdir}/src/include/nonposix.h conftest.h
1170    AC_COMPILE_IFELSE([
1171        AC_LANG_PROGRAM([[
1172         
1173 #include <ctype.h>
1174 #include "conftest.h"
1175
1176        ]],
1177        [[
1178
1179 #if PATH_SEP_CHAR == ';'
1180 make an error "Path separator is ';'"
1181 #endif
1182
1183        ]])
1184      ],
1185      [GROFF_PATH_SEPARATOR=":"],
1186      [GROFF_PATH_SEPARATOR=";"])
1187    AC_MSG_RESULT([$GROFF_PATH_SEPARATOR])
1188    AC_SUBST(GROFF_PATH_SEPARATOR)])
1189
1190
1191 # Check for X11.
1192
1193 AC_DEFUN([GROFF_X11],
1194   [AC_REQUIRE([AC_PATH_XTRA])
1195    groff_no_x=$no_x
1196    if test -z "$groff_no_x"; then
1197      OLDCFLAGS=$CFLAGS
1198      OLDLDFLAGS=$LDFLAGS
1199      OLDLIBS=$LIBS
1200      CFLAGS="$CFLAGS $X_CFLAGS"
1201      LDFLAGS="$LDFLAGS $X_LIBS"
1202      LIBS="$LIBS $X_PRE_LIBS -lX11 $X_EXTRA_LIBS"
1203
1204      LIBS="$LIBS -lXaw"
1205      AC_MSG_CHECKING([for Xaw library and header files])
1206      AC_LINK_IFELSE([
1207          AC_LANG_PROGRAM([[
1208
1209 #include <X11/Intrinsic.h>
1210 #include <X11/Xaw/Simple.h>
1211
1212          ]],
1213          [])
1214        ],
1215        [AC_MSG_RESULT([yes])],
1216        [AC_MSG_RESULT([no])
1217         groff_no_x="yes"])
1218
1219      LIBS="$LIBS -lXmu"
1220      AC_MSG_CHECKING([for Xmu library and header files])
1221      AC_LINK_IFELSE([
1222          AC_LANG_PROGRAM([[
1223
1224 #include <X11/Intrinsic.h>
1225 #include <X11/Xmu/Converters.h>
1226
1227          ]],
1228          [])
1229        ],
1230        [AC_MSG_RESULT([yes])],
1231        [AC_MSG_RESULT([no])
1232         groff_no_x="yes"])
1233
1234      CFLAGS=$OLDCFLAGS
1235      LDFLAGS=$OLDLDFLAGS
1236      LIBS=$OLDLIBS
1237    fi
1238
1239    if test "x$groff_no_x" = "xyes"; then
1240      AC_MSG_NOTICE([gxditview and xtotroff won't be built])
1241    else
1242      XDEVDIRS="font/devX75 font/devX75-12 font/devX100 font/devX100-12"
1243      XPROGDIRS="src/devices/xditview src/utils/xtotroff"
1244      XLIBDIRS="src/libs/libxutil"
1245    fi
1246
1247    AC_SUBST([XDEVDIRS])
1248    AC_SUBST([XPROGDIRS])
1249    AC_SUBST([XLIBDIRS])])
1250
1251
1252 # Set up the `--with-appresdir' command line option.
1253
1254 # Don't quote AS_HELP_STRING!
1255 AC_DEFUN([GROFF_APPRESDIR_OPTION],
1256   [AC_ARG_WITH([appresdir],
1257      AS_HELP_STRING([--with-appresdir=DIR],
1258                     [X11 application resource files]))])
1259
1260
1261 # Get a default value for the application resource directory.
1262 #
1263 # We ignore the `XAPPLRES' and `XUSERFILESEARCHPATH' environment variables.
1264 #
1265 # By default if --with-appresdir is not used, we will install the
1266 # gxditview resources in $prefix/lib/X11/app-defaults.
1267 #
1268 # Note that if --with-appresdir was passed to `configure', no prefix is
1269 # added to `appresdir'.
1270
1271 AC_DEFUN([GROFF_APPRESDIR_DEFAULT],
1272   [if test -z "$groff_no_x"; then
1273      if test "x$with_appresdir" = "x"; then
1274        if test "x$prefix" = "xNONE"; then
1275          appresdir=$ac_default_prefix/lib/X11/app-defaults
1276        else
1277          appresdir=$prefix/lib/X11/app-defaults
1278        fi
1279      else
1280        appresdir=$with_appresdir
1281      fi
1282    fi
1283    AC_SUBST([appresdir])])
1284
1285 # Emit warning if --with-appresdir hasn't been used.
1286
1287 AC_DEFUN([GROFF_APPRESDIR_CHECK],
1288   [if test -z "$groff_no_x"; then
1289      if test "x$with_appresdir" = "x"; then
1290        AC_MSG_NOTICE([
1291   The application resource files for gxditview (GXditview and
1292   GXditview-color) will be installed in:
1293
1294     $appresdir
1295
1296   (existing files will be saved by appending `.old' to the file
1297   name).
1298
1299   To install them into a different directory, say,
1300   `/etc/X11/app-defaults', add
1301   `--with-appresdir=/etc/X11/app-defaults' to the configure script
1302   command line options and rerun it (`prefix' value has no effect on
1303   a --with-appresdir option).
1304
1305   If the gxditview resources are installed in a directory that is not
1306   one of the default X11 resources directories (common default
1307   directories are /usr/lib/X11/app-defaults,
1308   /usr/share/X11/app-defaults and /etc/X11/app-defaults), you will
1309   have to set the environment variable XFILESEARCHPATH to this
1310   path.  More details can be found in the X(7) manual page, or in "X
1311   Toolkit Intrinsics - C Language Interface manual"
1312        ])
1313      fi
1314    fi])
1315
1316
1317 # Set up the `--with-grofferdir' command line option.
1318
1319 AC_DEFUN([GROFF_GROFFERDIR_OPTION],
1320   [AC_ARG_WITH([grofferdir],
1321      AS_HELP_STRING([--with-grofferdir=DIR],
1322                     [groffer files location]))])
1323
1324
1325 AC_DEFUN([GROFF_GROFFERDIR_DEFAULT],
1326   [if test "x$with_grofferdir" = "x"; then
1327     groffer_dir=$libprogramdir/groffer
1328   else
1329     groffer_dir=$with_grofferdir
1330   fi
1331   AC_SUBST([groffer_dir])])
1332
1333
1334 AC_DEFUN([GROFF_LIBPROGRAMDIR_DEFAULT],
1335   libprogramdir=$libdir/groff
1336   AC_SUBST([libprogramdir]))
1337
1338
1339 AC_DEFUN([GROFF_GLILYPONDDIR_DEFAULT],
1340   glilypond_dir=$libprogramdir/glilypond
1341   AC_SUBST([glilypond_dir]))
1342
1343
1344 AC_DEFUN([GROFF_GPINYINDIR_DEFAULT],
1345   gpinyin_dir=$libprogramdir/gpinyin
1346   AC_SUBST([gpinyin_dir]))
1347
1348
1349 AC_DEFUN([GROFF_GROGDIR_DEFAULT],
1350   grog_dir=$libprogramdir/grog
1351   AC_SUBST([grog_dir]))
1352
1353 AC_DEFUN([GROFF_REFERDIR_DEFAULT],
1354   referdir=$libprogramdir/refer
1355   AC_SUBST([referdir]))