1dnl Autoconf macros for groff. 2dnl Copyright (C) 1989, 1990, 1991, 1992, 1995 Free Software Foundation, Inc. 3dnl 4dnl This file is part of groff. 5dnl 6dnl groff is free software; you can redistribute it and/or modify it under 7dnl the terms of the GNU General Public License as published by the Free 8dnl Software Foundation; either version 2, or (at your option) any later 9dnl version. 10dnl 11dnl groff is distributed in the hope that it will be useful, but WITHOUT ANY 12dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or 13dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14dnl for more details. 15dnl 16dnl You should have received a copy of the GNU General Public License along 17dnl with groff; see the file COPYING. If not, write to the Free Software 18dnl Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19dnl
| 1dnl Autoconf macros for groff. 2dnl Copyright (C) 1989, 1990, 1991, 1992, 1995 Free Software Foundation, Inc. 3dnl 4dnl This file is part of groff. 5dnl 6dnl groff is free software; you can redistribute it and/or modify it under 7dnl the terms of the GNU General Public License as published by the Free 8dnl Software Foundation; either version 2, or (at your option) any later 9dnl version. 10dnl 11dnl groff is distributed in the hope that it will be useful, but WITHOUT ANY 12dnl WARRANTY; without even the implied warranty of MERCHANTABILITY or 13dnl FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 14dnl for more details. 15dnl 16dnl You should have received a copy of the GNU General Public License along 17dnl with groff; see the file COPYING. If not, write to the Free Software 18dnl Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 19dnl
|
| 20dnl
|
20AC_DEFUN(GROFF_PRINT,
| 21AC_DEFUN(GROFF_PRINT,
|
21[if test -z "$PSPRINT" 22then
| 22[if test -z "$PSPRINT"; then
|
23 AC_CHECK_PROGS(LPR,lpr) 24 AC_CHECK_PROGS(LP,lp)
| 23 AC_CHECK_PROGS(LPR,lpr) 24 AC_CHECK_PROGS(LP,lp)
|
25 if test -n "$LPR" && test -n "$LP" 26 then
| 25 if test -n "$LPR" && test -n "$LP"; then
|
27 # HP-UX provides an lpr command that emulates lpr using lp, 28 # but it doesn't have lpq; in this case we want to use lp 29 # rather than lpr. 30 AC_CHECK_PROGS(LPQ,lpq) 31 test -n "$LPQ" || LPR= 32 fi
| 26 # HP-UX provides an lpr command that emulates lpr using lp, 27 # but it doesn't have lpq; in this case we want to use lp 28 # rather than lpr. 29 AC_CHECK_PROGS(LPQ,lpq) 30 test -n "$LPQ" || LPR= 31 fi
|
33 if test -n "$LPR" 34 then
| 32 if test -n "$LPR"; then
|
35 PSPRINT="$LPR"
| 33 PSPRINT="$LPR"
|
36 elif test -n "$LP" 37 then
| 34 elif test -n "$LP"; then
|
38 PSPRINT="$LP" 39 fi 40fi 41AC_SUBST(PSPRINT) 42AC_MSG_CHECKING([for command to use for printing PostScript files]) 43AC_MSG_RESULT($PSPRINT) 44# Figure out DVIPRINT from PSPRINT. 45AC_MSG_CHECKING([for command to use for printing dvi files])
| 35 PSPRINT="$LP" 36 fi 37fi 38AC_SUBST(PSPRINT) 39AC_MSG_CHECKING([for command to use for printing PostScript files]) 40AC_MSG_RESULT($PSPRINT) 41# Figure out DVIPRINT from PSPRINT. 42AC_MSG_CHECKING([for command to use for printing dvi files])
|
46if test -n "$PSPRINT" && test -z "$DVIPRINT" 47then 48 if test "X$PSPRINT" = "Xlpr" 49 then
| 43if test -n "$PSPRINT" && test -z "$DVIPRINT"; then 44 if test "X$PSPRINT" = "Xlpr"; then
|
50 DVIPRINT="lpr -d" 51 else 52 DVIPRINT="$PSPRINT" 53 fi 54fi 55AC_SUBST(DVIPRINT) 56AC_MSG_RESULT($DVIPRINT)])dnl
| 45 DVIPRINT="lpr -d" 46 else 47 DVIPRINT="$PSPRINT" 48 fi 49fi 50AC_SUBST(DVIPRINT) 51AC_MSG_RESULT($DVIPRINT)])dnl
|
| 52dnl 53dnl
|
57dnl Bison generated parsers have problems with C++ compilers other than g++. 58dnl So byacc is preferred over bison.
| 54dnl Bison generated parsers have problems with C++ compilers other than g++. 55dnl So byacc is preferred over bison.
|
| 56dnl
|
59AC_DEFUN(GROFF_PROG_YACC, 60[AC_CHECK_PROGS(YACC, byacc 'bison -y', yacc)])
| 57AC_DEFUN(GROFF_PROG_YACC, 58[AC_CHECK_PROGS(YACC, byacc 'bison -y', yacc)])
|
| 59dnl 60dnl
|
61dnl GROFF_CSH_HACK(if hack present, if not present)
| 61dnl GROFF_CSH_HACK(if hack present, if not present)
|
| 62dnl
|
62AC_DEFUN(GROFF_CSH_HACK, 63[AC_MSG_CHECKING([for csh hash hack]) 64cat <<EOF >conftest.sh 65#!/bin/sh 66true || exit 0 67export PATH || exit 0 68exit 1 69EOF 70chmod +x conftest.sh
| 63AC_DEFUN(GROFF_CSH_HACK, 64[AC_MSG_CHECKING([for csh hash hack]) 65cat <<EOF >conftest.sh 66#!/bin/sh 67true || exit 0 68export PATH || exit 0 69exit 1 70EOF 71chmod +x conftest.sh
|
71if echo ./conftest.sh | (csh >/dev/null 2>&1) >/dev/null 2>&1 72then
| 72if echo ./conftest.sh | (csh >/dev/null 2>&1) >/dev/null 2>&1; then
|
73 AC_MSG_RESULT(yes); $1 74else 75 AC_MSG_RESULT(no); $2 76fi
| 73 AC_MSG_RESULT(yes); $1 74else 75 AC_MSG_RESULT(no); $2 76fi
|
77rm -f conftest.sh 78])dnl
| 77rm -f conftest.sh])dnl 78dnl 79dnl
|
79dnl From udodo!hans@relay.NL.net (Hans Zuidam)
| 80dnl From udodo!hans@relay.NL.net (Hans Zuidam)
|
| 81dnl
|
80AC_DEFUN(GROFF_ISC_SYSV3, 81[AC_MSG_CHECKING([for ISC 3.x or 4.x]) 82changequote(,)dnl 83if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1 84changequote([,])dnl 85then 86 AC_MSG_RESULT(yes) 87 AC_DEFINE(_SYSV3) 88else 89 AC_MSG_RESULT(no) 90fi])dnl
| 82AC_DEFUN(GROFF_ISC_SYSV3, 83[AC_MSG_CHECKING([for ISC 3.x or 4.x]) 84changequote(,)dnl 85if grep '[34]\.' /usr/options/cb.name >/dev/null 2>&1 86changequote([,])dnl 87then 88 AC_MSG_RESULT(yes) 89 AC_DEFINE(_SYSV3) 90else 91 AC_MSG_RESULT(no) 92fi])dnl
|
| 93dnl 94dnl
|
91AC_DEFUN(GROFF_POSIX, 92[AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary]) 93AC_LANG_SAVE 94AC_LANG_CPLUSPLUS 95AC_TRY_COMPILE([#include <stdio.h> 96extern "C" { void fileno(int); }],, 97AC_MSG_RESULT(yes);AC_DEFINE(_POSIX_SOURCE), 98AC_MSG_RESULT(no)) 99AC_LANG_RESTORE])dnl
| 95AC_DEFUN(GROFF_POSIX, 96[AC_MSG_CHECKING([whether -D_POSIX_SOURCE is necessary]) 97AC_LANG_SAVE 98AC_LANG_CPLUSPLUS 99AC_TRY_COMPILE([#include <stdio.h> 100extern "C" { void fileno(int); }],, 101AC_MSG_RESULT(yes);AC_DEFINE(_POSIX_SOURCE), 102AC_MSG_RESULT(no)) 103AC_LANG_RESTORE])dnl
|
| 104dnl 105dnl
|
100AC_DEFUN(GROFF_GETOPT, 101[AC_LANG_SAVE 102AC_LANG_CPLUSPLUS 103AC_MSG_CHECKING([declaration of getopt in stdlib.h])
| 106AC_DEFUN(GROFF_GETOPT, 107[AC_LANG_SAVE 108AC_LANG_CPLUSPLUS 109AC_MSG_CHECKING([declaration of getopt in stdlib.h])
|
104AC_TRY_COMPILE( 105[#include <stdlib.h> 106extern "C" { void getopt(int); }],,AC_MSG_RESULT(no),
| 110AC_TRY_COMPILE([#include <stdlib.h> 111extern "C" { void getopt(int); }],, 112AC_MSG_RESULT(no),
|
107AC_MSG_RESULT(yes);AC_DEFINE(STDLIB_H_DECLARES_GETOPT)) 108AC_MSG_CHECKING([declaration of getopt in unistd.h]) 109AC_TRY_COMPILE([#include <sys/types.h> 110#include <unistd.h>
| 113AC_MSG_RESULT(yes);AC_DEFINE(STDLIB_H_DECLARES_GETOPT)) 114AC_MSG_CHECKING([declaration of getopt in unistd.h]) 115AC_TRY_COMPILE([#include <sys/types.h> 116#include <unistd.h>
|
111extern "C" { void getopt(int); }],,AC_MSG_RESULT(no),
| 117extern "C" { void getopt(int); }],, 118AC_MSG_RESULT(no),
|
112AC_MSG_RESULT(yes);AC_DEFINE(UNISTD_H_DECLARES_GETOPT)) 113AC_LANG_RESTORE])dnl
| 119AC_MSG_RESULT(yes);AC_DEFINE(UNISTD_H_DECLARES_GETOPT)) 120AC_LANG_RESTORE])dnl
|
| 121dnl 122dnl
|
114AC_DEFUN(GROFF_PUTENV, 115[AC_LANG_SAVE 116AC_LANG_CPLUSPLUS 117AC_MSG_CHECKING([declaration of putenv]) 118AC_TRY_COMPILE([#include <stdlib.h>
| 123AC_DEFUN(GROFF_PUTENV, 124[AC_LANG_SAVE 125AC_LANG_CPLUSPLUS 126AC_MSG_CHECKING([declaration of putenv]) 127AC_TRY_COMPILE([#include <stdlib.h>
|
119extern "C" { void putenv(int); }],,AC_MSG_RESULT(no), 120AC_MSG_RESULT(yes) 121AC_DEFINE(STDLIB_H_DECLARES_PUTENV))
| 128extern "C" { void putenv(int); }],, 129AC_MSG_RESULT(no), 130AC_MSG_RESULT(yes);AC_DEFINE(STDLIB_H_DECLARES_PUTENV))
|
122AC_LANG_RESTORE])dnl
| 131AC_LANG_RESTORE])dnl
|
| 132dnl 133dnl
|
123AC_DEFUN(GROFF_POPEN, 124[AC_LANG_SAVE 125AC_LANG_CPLUSPLUS 126AC_MSG_CHECKING([declaration of popen]) 127AC_TRY_COMPILE([#include <stdio.h>
| 134AC_DEFUN(GROFF_POPEN, 135[AC_LANG_SAVE 136AC_LANG_CPLUSPLUS 137AC_MSG_CHECKING([declaration of popen]) 138AC_TRY_COMPILE([#include <stdio.h>
|
128extern "C" { void popen(int); }],,AC_MSG_RESULT(no),
| 139extern "C" { void popen(int); }],, 140AC_MSG_RESULT(no),
|
129AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_POPEN)) 130AC_LANG_RESTORE])dnl
| 141AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_POPEN)) 142AC_LANG_RESTORE])dnl
|
| 143dnl 144dnl
|
131AC_DEFUN(GROFF_PCLOSE, 132[AC_LANG_SAVE 133AC_LANG_CPLUSPLUS 134AC_MSG_CHECKING([declaration of pclose]) 135AC_TRY_COMPILE([#include <stdio.h>
| 145AC_DEFUN(GROFF_PCLOSE, 146[AC_LANG_SAVE 147AC_LANG_CPLUSPLUS 148AC_MSG_CHECKING([declaration of pclose]) 149AC_TRY_COMPILE([#include <stdio.h>
|
136extern "C" { void pclose(int); }],,AC_MSG_RESULT(no),
| 150extern "C" { void pclose(int); }],, 151AC_MSG_RESULT(no),
|
137AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_PCLOSE)) 138AC_LANG_RESTORE])dnl
| 152AC_MSG_RESULT(yes);AC_DEFINE(STDIO_H_DECLARES_PCLOSE)) 153AC_LANG_RESTORE])dnl
|
| 154dnl 155dnl 156AC_DEFUN(GROFF_SYS_NERR, 157[AC_LANG_SAVE 158AC_LANG_CPLUSPLUS 159AC_MSG_CHECKING([for sys_nerr in <errno.h> or <stdio.h>]) 160AC_TRY_COMPILE([#include <errno.h> 161#include <stdio.h>], 162[int k; k = sys_nerr;], 163AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SYS_NERR), 164AC_MSG_RESULT(no)) 165AC_LANG_RESTORE])dnl 166dnl 167dnl 168AC_DEFUN(GROFF_SYS_ERRLIST, 169[AC_LANG_SAVE 170AC_LANG_CPLUSPLUS 171AC_MSG_CHECKING([for sys_errlist[] in <errno.h> or <stdio.h>]) 172AC_TRY_COMPILE([#include <errno.h> 173#include <stdio.h>], 174[int k; k = (int)sys_errlist[0];], 175AC_MSG_RESULT(yes);AC_DEFINE(HAVE_SYS_ERRLIST), 176AC_MSG_RESULT(no)) 177AC_LANG_RESTORE])dnl 178dnl 179dnl 180AC_DEFUN(GROFF_HYPOT, 181[AC_LANG_SAVE 182AC_LANG_CPLUSPLUS 183AC_MSG_CHECKING([declaration of hypot]) 184AC_TRY_COMPILE([#include <math.h> 185extern "C" { double hypot(double,double); }],, 186AC_MSG_RESULT(no), 187AC_MSG_RESULT(yes);AC_DEFINE(MATH_H_DECLARES_HYPOT)) 188AC_LANG_RESTORE])dnl 189dnl 190dnl
|
139AC_DEFUN(GROFF_OSFCN_H, 140[AC_LANG_SAVE 141AC_LANG_CPLUSPLUS 142AC_MSG_CHECKING([C++ <osfcn.h>]) 143AC_TRY_COMPILE([#include <osfcn.h>],
| 191AC_DEFUN(GROFF_OSFCN_H, 192[AC_LANG_SAVE 193AC_LANG_CPLUSPLUS 194AC_MSG_CHECKING([C++ <osfcn.h>]) 195AC_TRY_COMPILE([#include <osfcn.h>],
|
144[read(0, 0, 0); open(0, 0);],AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_OSFCN_H),
| 196[read(0, 0, 0); open(0, 0);], 197AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_OSFCN_H),
|
145AC_MSG_RESULT(no)) 146AC_LANG_RESTORE])dnl
| 198AC_MSG_RESULT(no)) 199AC_LANG_RESTORE])dnl
|
| 200dnl 201dnl
|
147AC_DEFUN(GROFF_LIMITS_H, 148[AC_LANG_SAVE 149AC_LANG_CPLUSPLUS 150AC_MSG_CHECKING([C++ <limits.h>]) 151AC_TRY_COMPILE([#include <limits.h>], 152[int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX;],
| 202AC_DEFUN(GROFF_LIMITS_H, 203[AC_LANG_SAVE 204AC_LANG_CPLUSPLUS 205AC_MSG_CHECKING([C++ <limits.h>]) 206AC_TRY_COMPILE([#include <limits.h>], 207[int x = INT_MIN; int y = INT_MAX; int z = UCHAR_MAX;],
|
153AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_LIMITS_H),AC_MSG_RESULT(no))
| 208AC_MSG_RESULT(yes);AC_DEFINE(HAVE_CC_LIMITS_H), 209AC_MSG_RESULT(no))
|
154AC_LANG_RESTORE])dnl
| 210AC_LANG_RESTORE])dnl
|
| 211dnl 212dnl
|
155AC_DEFUN(GROFF_TIME_T, 156[AC_LANG_SAVE 157AC_LANG_CPLUSPLUS 158AC_MSG_CHECKING([for declaration of time_t]) 159AC_TRY_COMPILE([#include <time.h>],
| 213AC_DEFUN(GROFF_TIME_T, 214[AC_LANG_SAVE 215AC_LANG_CPLUSPLUS 216AC_MSG_CHECKING([for declaration of time_t]) 217AC_TRY_COMPILE([#include <time.h>],
|
160[time_t t = time(0); struct tm *p = localtime(&t);],AC_MSG_RESULT(yes),
| 218[time_t t = time(0); struct tm *p = localtime(&t);], 219AC_MSG_RESULT(yes),
|
161AC_MSG_RESULT(no);AC_DEFINE(LONG_FOR_TIME_T)) 162AC_LANG_RESTORE])dnl
| 220AC_MSG_RESULT(no);AC_DEFINE(LONG_FOR_TIME_T)) 221AC_LANG_RESTORE])dnl
|
| 222dnl 223dnl
|
163AC_DEFUN(GROFF_STRUCT_EXCEPTION, 164[AC_MSG_CHECKING([struct exception]) 165AC_TRY_COMPILE([#include <math.h>], 166[struct exception e;], 167AC_MSG_RESULT(yes);AC_DEFINE(HAVE_STRUCT_EXCEPTION), 168AC_MSG_RESULT(no))])dnl
| 224AC_DEFUN(GROFF_STRUCT_EXCEPTION, 225[AC_MSG_CHECKING([struct exception]) 226AC_TRY_COMPILE([#include <math.h>], 227[struct exception e;], 228AC_MSG_RESULT(yes);AC_DEFINE(HAVE_STRUCT_EXCEPTION), 229AC_MSG_RESULT(no))])dnl
|
| 230dnl 231dnl
|
169AC_DEFUN(GROFF_ARRAY_DELETE, 170[AC_LANG_SAVE 171AC_LANG_CPLUSPLUS 172AC_MSG_CHECKING([whether ANSI array delete syntax supported]) 173AC_TRY_COMPILE(, 174changequote(,)dnl 175char *p = new char[5]; delete [] p;changequote([,]),
| 232AC_DEFUN(GROFF_ARRAY_DELETE, 233[AC_LANG_SAVE 234AC_LANG_CPLUSPLUS 235AC_MSG_CHECKING([whether ANSI array delete syntax supported]) 236AC_TRY_COMPILE(, 237changequote(,)dnl 238char *p = new char[5]; delete [] p;changequote([,]),
|
176AC_MSG_RESULT(yes),AC_MSG_RESULT(no);AC_DEFINE(ARRAY_DELETE_NEEDS_SIZE))
| 239AC_MSG_RESULT(yes), 240AC_MSG_RESULT(no);AC_DEFINE(ARRAY_DELETE_NEEDS_SIZE))
|
177AC_LANG_RESTORE])dnl 178dnl
| 241AC_LANG_RESTORE])dnl 242dnl
|
| 243dnl 244dnl
|
179AC_DEFUN(GROFF_TRADITIONAL_CPP, 180[AC_LANG_SAVE 181AC_LANG_CPLUSPLUS 182AC_MSG_CHECKING([traditional preprocessor]) 183AC_TRY_COMPILE([#define name2(a,b) a/**/b],[int name2(foo,bar);], 184AC_MSG_RESULT(yes);AC_DEFINE(TRADITIONAL_CPP), 185AC_MSG_RESULT(no)) 186AC_LANG_RESTORE])dnl
| 245AC_DEFUN(GROFF_TRADITIONAL_CPP, 246[AC_LANG_SAVE 247AC_LANG_CPLUSPLUS 248AC_MSG_CHECKING([traditional preprocessor]) 249AC_TRY_COMPILE([#define name2(a,b) a/**/b],[int name2(foo,bar);], 250AC_MSG_RESULT(yes);AC_DEFINE(TRADITIONAL_CPP), 251AC_MSG_RESULT(no)) 252AC_LANG_RESTORE])dnl
|
187
| 253dnl 254dnl
|
188AC_DEFUN(GROFF_WCOREFLAG, 189[AC_MSG_CHECKING([w_coredump])
| 255AC_DEFUN(GROFF_WCOREFLAG, 256[AC_MSG_CHECKING([w_coredump])
|
190AC_TRY_RUN([ 191#include <sys/types.h>
| 257AC_TRY_RUN([#include <sys/types.h>
|
192#include <sys/wait.h> 193main() 194{ 195#ifdef WCOREFLAG 196 exit(1); 197#else 198 int i = 0; 199 ((union wait *)&i)->w_coredump = 1; 200 exit(i != 0200); 201#endif
| 258#include <sys/wait.h> 259main() 260{ 261#ifdef WCOREFLAG 262 exit(1); 263#else 264 int i = 0; 265 ((union wait *)&i)->w_coredump = 1; 266 exit(i != 0200); 267#endif
|
202} 203],AC_MSG_RESULT(yes);AC_DEFINE(WCOREFLAG,0200),AC_MSG_RESULT(no),
| 268}], 269AC_MSG_RESULT(yes);AC_DEFINE(WCOREFLAG,0200), 270AC_MSG_RESULT(no),
|
204AC_MSG_RESULT(no))])dnl 205dnl
| 271AC_MSG_RESULT(no))])dnl 272dnl
|
| 273dnl
|
206AC_DEFUN(GROFF_BROKEN_SPOOLER_FLAGS, 207[AC_MSG_CHECKING([default value for grops -b option]) 208test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7 209AC_MSG_RESULT($BROKEN_SPOOLER_FLAGS) 210AC_SUBST(BROKEN_SPOOLER_FLAGS)])dnl 211dnl
| 274AC_DEFUN(GROFF_BROKEN_SPOOLER_FLAGS, 275[AC_MSG_CHECKING([default value for grops -b option]) 276test -n "${BROKEN_SPOOLER_FLAGS}" || BROKEN_SPOOLER_FLAGS=7 277AC_MSG_RESULT($BROKEN_SPOOLER_FLAGS) 278AC_SUBST(BROKEN_SPOOLER_FLAGS)])dnl 279dnl
|
| 280dnl
|
212AC_DEFUN(GROFF_PAGE, 213[AC_MSG_CHECKING([default paper size])
| 281AC_DEFUN(GROFF_PAGE, 282[AC_MSG_CHECKING([default paper size])
|
214if test -z "$PAGE" 215then
| 283if test -z "$PAGE"; then
|
216 descfile=
| 284 descfile=
|
217 if test -r $prefix/share/groff/font/devps/DESC 218 then
| 285 if test -r $prefix/share/groff/font/devps/DESC; then
|
219 descfile=$prefix/share/groff/font/devps/DESC
| 286 descfile=$prefix/share/groff/font/devps/DESC
|
220 elif test -r $prefix/lib/groff/font/devps/DESC 221 then
| 287 elif test -r $prefix/lib/groff/font/devps/DESC; then
|
222 descfile=$prefix/lib/groff/font/devps/DESC 223 fi 224 if test -n "$descfile" \
| 288 descfile=$prefix/lib/groff/font/devps/DESC 289 fi 290 if test -n "$descfile" \
|
225 && grep "^paperlength 841890" $descfile >/dev/null 2>&1 226 then
| 291 && grep "^paperlength 841890" $descfile >/dev/null 2>&1; then
|
227 PAGE=A4 228 else 229 PAGE=letter 230 fi 231fi
| 292 PAGE=A4 293 else 294 PAGE=letter 295 fi 296fi
|
232if test -z "$PAGE" 233then
| 297if test -z "$PAGE"; then
|
234 dom=`awk '([$]1 == "dom" || [$]1 == "search") { print [$]2; exit}' \ 235 /etc/resolv.conf 2>/dev/null`
| 298 dom=`awk '([$]1 == "dom" || [$]1 == "search") { print [$]2; exit}' \ 299 /etc/resolv.conf 2>/dev/null`
|
236 237 if test -z "$dom" 238 then
| 300 if test -z "$dom"; then
|
239 dom=`(domainname) 2>/dev/null | tr -d '+'`
| 301 dom=`(domainname) 2>/dev/null | tr -d '+'`
|
240 if test -z "$dom" 241 then
| 302 if test -z "$dom"; then
|
242 dom=`(hostname) 2>/dev/null | grep '\.'` 243 fi 244 fi
| 303 dom=`(hostname) 2>/dev/null | grep '\.'` 304 fi 305 fi
|
245
| |
246changequote(,)dnl 247 # If the top-level domain is two letters and it's not `us' or `ca' 248 # then they probably use A4 paper. 249 case "$dom" in 250 *.[Uu][Ss]|*.[Cc][Aa]) ;; 251 *.[A-Za-z][A-Za-z]) PAGE=A4 ;; 252 esac 253changequote([,])dnl 254fi 255test -n "$PAGE" || PAGE=letter 256AC_MSG_RESULT($PAGE) 257AC_SUBST(PAGE)])dnl 258dnl
| 306changequote(,)dnl 307 # If the top-level domain is two letters and it's not `us' or `ca' 308 # then they probably use A4 paper. 309 case "$dom" in 310 *.[Uu][Ss]|*.[Cc][Aa]) ;; 311 *.[A-Za-z][A-Za-z]) PAGE=A4 ;; 312 esac 313changequote([,])dnl 314fi 315test -n "$PAGE" || PAGE=letter 316AC_MSG_RESULT($PAGE) 317AC_SUBST(PAGE)])dnl 318dnl
|
| 319dnl
|
259AC_DEFUN(GROFF_CXX_CHECK, 260[AC_REQUIRE([AC_C_CROSS]) 261AC_REQUIRE([AC_PROG_CXX]) 262AC_LANG_SAVE 263AC_LANG_CPLUSPLUS 264if test "$cross_compiling" = no; then
| 320AC_DEFUN(GROFF_CXX_CHECK, 321[AC_REQUIRE([AC_C_CROSS]) 322AC_REQUIRE([AC_PROG_CXX]) 323AC_LANG_SAVE 324AC_LANG_CPLUSPLUS 325if test "$cross_compiling" = no; then
|
265AC_MSG_CHECKING([that C++ compiler can compile simple program])
| 326 AC_MSG_CHECKING([that C++ compiler can compile simple program])
|
266fi 267AC_TRY_RUN([int main() { return 0; }], 268AC_MSG_RESULT(yes),
| 327fi 328AC_TRY_RUN([int main() { return 0; }], 329AC_MSG_RESULT(yes),
|
269AC_MSG_RESULT(no) 270AC_MSG_ERROR([a working C++ compiler is required]),:)
| 330AC_MSG_RESULT(no);AC_MSG_ERROR([a working C++ compiler is required]), 331:)
|
271if test "$cross_compiling" = no; then
| 332if test "$cross_compiling" = no; then
|
272AC_MSG_CHECKING([that C++ static constructors and destructors are called])
| 333 AC_MSG_CHECKING([that C++ static constructors and destructors are called])
|
273fi 274AC_TRY_RUN([ 275extern "C" { 276 void _exit(int); 277} 278int i; 279struct A { 280 char dummy; 281 A() { i = 1; } 282 ~A() { if (i == 1) _exit(0); } 283}; 284A a; 285int main() { return 1; } 286], 287AC_MSG_RESULT(yes),
| 334fi 335AC_TRY_RUN([ 336extern "C" { 337 void _exit(int); 338} 339int i; 340struct A { 341 char dummy; 342 A() { i = 1; } 343 ~A() { if (i == 1) _exit(0); } 344}; 345A a; 346int main() { return 1; } 347], 348AC_MSG_RESULT(yes),
|
288AC_MSG_RESULT(no) 289AC_MSG_ERROR([a working C++ compiler is required]),:)
| 349AC_MSG_RESULT(no);AC_MSG_ERROR([a working C++ compiler is required]), 350:)
|
290AC_MSG_CHECKING([that header files support C++]) 291AC_TRY_LINK([#include <stdio.h>],
| 351AC_MSG_CHECKING([that header files support C++]) 352AC_TRY_LINK([#include <stdio.h>],
|
292[fopen(0, 0);],AC_MSG_RESULT(yes), 293AC_MSG_RESULT(no) 294AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)]))
| 353[fopen(0, 0);], 354AC_MSG_RESULT(yes), 355AC_MSG_RESULT(no);AC_MSG_ERROR([header files do not support C++ (if you are using a version of gcc/g++ earlier than 2.5, you should install libg++)]))
|
295AC_LANG_RESTORE 296])dnl 297dnl
| 356AC_LANG_RESTORE 357])dnl 358dnl
|
| 359dnl
|
298AC_DEFUN(GROFF_TMAC,
| 360AC_DEFUN(GROFF_TMAC,
|
299[ 300AC_MSG_CHECKING([for prefix of system macro packages])
| 361[AC_MSG_CHECKING([for prefix of system macro packages])
|
301sys_tmac_prefix= 302sys_tmac_file_prefix=
| 362sys_tmac_prefix= 363sys_tmac_file_prefix=
|
303for d in /usr/share/lib/tmac /usr/lib/tmac 304do 305 for t in "" tmac. 306 do 307 for m in an s m 308 do
| 364for d in /usr/share/lib/tmac /usr/lib/tmac; do 365 for t in "" tmac.; do 366 for m in an s m; do
|
309 f=$d/$t$m 310 if test -z "$sys_tmac_prefix" \ 311 && test -f $f \
| 367 f=$d/$t$m 368 if test -z "$sys_tmac_prefix" \ 369 && test -f $f \
|
312 && grep '^\.if' $f >/dev/null 2>&1 313 then
| 370 && grep '^\.if' $f >/dev/null 2>&1; then
|
314 sys_tmac_prefix=$d/$t 315 sys_tmac_file_prefix=$t 316 fi 317 done 318 done 319done 320AC_MSG_RESULT($sys_tmac_prefix) 321AC_SUBST(sys_tmac_prefix) 322tmac_wrap= 323AC_MSG_CHECKING([which system macro packages should be made available])
| 371 sys_tmac_prefix=$d/$t 372 sys_tmac_file_prefix=$t 373 fi 374 done 375 done 376done 377AC_MSG_RESULT($sys_tmac_prefix) 378AC_SUBST(sys_tmac_prefix) 379tmac_wrap= 380AC_MSG_CHECKING([which system macro packages should be made available])
|
324if test "x$sys_tmac_file_prefix" = "xtmac." 325then 326 for f in $sys_tmac_prefix* 327 do
| 381if test "x$sys_tmac_file_prefix" = "xtmac."; then 382 for f in $sys_tmac_prefix*; do
|
328 suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` 329 case "$suff" in
| 383 suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` 384 case "$suff" in
|
330 e);;
| 385 e) ;;
|
331 *)
| 386 *)
|
332 grep "Copyright.*Free Software Foundation" $f >/dev/null \ 333 || tmac_wrap="$tmac_wrap $suff" 334 ;;
| 387 grep "Copyright.*Free Software Foundation" $f >/dev/null \ 388 || tmac_wrap="$tmac_wrap $suff" ;;
|
335 esac 336 done
| 389 esac 390 done
|
337elif test -n "$sys_tmac_prefix" 338then
| 391elif test -n "$sys_tmac_prefix"; then
|
339 files=`echo $sys_tmac_prefix*` 340 grep "\\.so" $files >conftest.sol
| 392 files=`echo $sys_tmac_prefix*` 393 grep "\\.so" $files >conftest.sol
|
341 for f in $files 342 do
| 394 for f in $files; do
|
343 case "$f" in
| 395 case "$f" in
|
344 ${sys_tmac_prefix}e) ;;
| 396 ${sys_tmac_prefix}e) ;;
|
345 *.me) ;; 346 */ms.*) ;; 347 *)
| 397 *.me) ;; 398 */ms.*) ;; 399 *)
|
348 b=`basename $f` 349 if grep "\\.so.*/$b\$" conftest.sol >/dev/null \ 350 || grep -l "Copyright.*Free Software Foundation" $f >/dev/null 351 then 352 : 353 else 354 suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` 355 case "$suff" in 356 tmac.*);; 357 *) tmac_wrap="$tmac_wrap $suff" ;; 358 esac 359 fi
| 400 b=`basename $f` 401 if grep "\\.so.*/$b\$" conftest.sol >/dev/null \ 402 || grep -l "Copyright.*Free Software Foundation" $f >/dev/null; then 403 : 404 else 405 suff=`echo $f | sed -e "s;$sys_tmac_prefix;;"` 406 case "$suff" in 407 tmac.*) ;; 408 *) tmac_wrap="$tmac_wrap $suff" ;; 409 esac 410 fi
|
360 esac 361 done 362 rm -f conftest.sol 363fi 364AC_MSG_RESULT([$tmac_wrap]) 365AC_SUBST(tmac_wrap) 366])dnl
| 411 esac 412 done 413 rm -f conftest.sol 414fi 415AC_MSG_RESULT([$tmac_wrap]) 416AC_SUBST(tmac_wrap) 417])dnl
|
| 418dnl 419dnl
|
367AC_DEFUN(GROFF_G, 368[AC_MSG_CHECKING([for existing troff installation])
| 420AC_DEFUN(GROFF_G, 421[AC_MSG_CHECKING([for existing troff installation])
|
369if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" \ 370 = x0 371then
| 422if test "x`(echo .tm '|n(.g' | tr '|' '\\\\' | troff -z -i 2>&1) 2>/dev/null`" = x0; then
|
372 AC_MSG_RESULT(yes) 373 g=g 374else 375 AC_MSG_RESULT(no) 376 g= 377fi 378AC_SUBST(g) 379])dnl
| 423 AC_MSG_RESULT(yes) 424 g=g 425else 426 AC_MSG_RESULT(no) 427 g= 428fi 429AC_SUBST(g) 430])dnl
|
| 431dnl 432dnl
|
380dnl We need the path to install-sh to be absolute.
| 433dnl We need the path to install-sh to be absolute.
|
| 434dnl
|
381AC_DEFUN(GROFF_INSTALL_SH, 382[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 383ac_dir=`cd $ac_aux_dir; pwd` 384ac_install_sh="$ac_dir/install-sh -c"
| 435AC_DEFUN(GROFF_INSTALL_SH, 436[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl 437ac_dir=`cd $ac_aux_dir; pwd` 438ac_install_sh="$ac_dir/install-sh -c"
|
| 439])dnl 440dnl 441dnl 442dnl At least one UNIX system, Apple Macintosh Rhapsody 5.5, 443dnl does not have -lm. 444dnl 445AC_DEFUN(GROFF_LIBM, 446[AC_CHECK_LIB(m,sin,LIBM=-lm) 447AC_SUBST(LIBM)
|
385])
| 448])
|