1 | dnl Process this file with autoconf to produce a configure script. |
---|
2 | |
---|
3 | AC_PREREQ(2.12) |
---|
4 | |
---|
5 | AC_INIT(src/gsint.h) |
---|
6 | AM_INIT_AUTOMAKE(enscript, 1.6.1) |
---|
7 | AM_CONFIG_HEADER(config.h) |
---|
8 | |
---|
9 | AC_REVISION($Revision: 1.1.1.1 $) |
---|
10 | |
---|
11 | AM_PROG_INSTALL |
---|
12 | |
---|
13 | AC_ARG_WITH(cc, |
---|
14 | [ --with-cc(=CC) use system's native compiler (or compiler CC)], |
---|
15 | if test "X$withval" != "Xno"; then |
---|
16 | if test "X$withval" = "Xyes"; then |
---|
17 | CC='cc' |
---|
18 | else |
---|
19 | CC=$withval |
---|
20 | fi |
---|
21 | CFLAGS="$CFLAGS -I/usr/local/include" |
---|
22 | LDFLAGS="$LDFLAGS -L/usr/local/lib" |
---|
23 | echo "using compiler CC=$CC" |
---|
24 | fi |
---|
25 | ) |
---|
26 | |
---|
27 | if test "X$CC" = "X"; then |
---|
28 | AC_PROG_CC |
---|
29 | fi |
---|
30 | |
---|
31 | AC_ISC_POSIX |
---|
32 | AM_C_PROTOTYPES |
---|
33 | |
---|
34 | AC_C_CONST |
---|
35 | AC_FUNC_ALLOCA |
---|
36 | |
---|
37 | AC_STDC_HEADERS |
---|
38 | AC_HAVE_HEADERS(string.h stdlib.h unistd.h stdarg.h math.h pwd.h) |
---|
39 | |
---|
40 | dnl Check some functions. |
---|
41 | AC_CHECK_FUNCS(strchr) |
---|
42 | AC_CHECK_FUNC(strerror, AC_DEFINE(HAVE_STRERROR), [ |
---|
43 | LIBOBJS="$LIBOBJS strerror.o" |
---|
44 | ]) |
---|
45 | AC_CHECK_FUNC(memmove, AC_DEFINE(HAVE_MEMMOVE), [ |
---|
46 | LIBOBJS="$LIBOBJS memmove.o" |
---|
47 | ]) |
---|
48 | AC_CHECK_FUNC(memcpy, AC_DEFINE(HAVE_MEMCPY), [ |
---|
49 | LIBOBJS="$LIBOBJS memcpy.o" |
---|
50 | ]) |
---|
51 | AC_CHECK_FUNC(strtoul, AC_DEFINE(HAVE_STRTOUL), [ |
---|
52 | LIBOBJS="$LIBOBJS strtoul.o" |
---|
53 | ]) |
---|
54 | |
---|
55 | AC_CHECK_FUNC(getcwd, AC_DEFINE(HAVE_GETCWD), [ |
---|
56 | AC_CHECK_FUNC(getwd, AC_DEFINE(HAVE_GETWD)) |
---|
57 | ]) |
---|
58 | |
---|
59 | AC_FUNC_VPRINTF |
---|
60 | |
---|
61 | dnl -lsun is needed on IRIX-4.0 to get the user passwd entry through |
---|
62 | dnl the yellow pages / NIS. |
---|
63 | AC_CHECK_LIB(sun, main) |
---|
64 | |
---|
65 | dnl Find out where the gethostname() is. |
---|
66 | AC_CHECK_FUNC(gethostname, , AC_CHECK_LIB(nsl, main)) |
---|
67 | |
---|
68 | AC_PROG_RANLIB |
---|
69 | AC_PROG_YACC |
---|
70 | AM_PROG_LEX |
---|
71 | |
---|
72 | AC_ARG_ENABLE(debug, |
---|
73 | [ --enable-debug enable debugging], [ |
---|
74 | echo enabling debugging |
---|
75 | if test -n "$GCC"; then |
---|
76 | CFLAGS="$CFLAGS -Wall" |
---|
77 | fi |
---|
78 | ]) |
---|
79 | |
---|
80 | dnl Define the default output media. |
---|
81 | |
---|
82 | AC_ARG_WITH(media, |
---|
83 | [ --with-media(=MEDIA) use output media Letter (MEDIA), default is A4], |
---|
84 | if test "X$withval" != "Xno"; then |
---|
85 | if test "X$withval" = "Xyes"; then |
---|
86 | ac_cv_value_media='Letter' |
---|
87 | else |
---|
88 | ac_cv_value_media=$withval |
---|
89 | fi |
---|
90 | else |
---|
91 | ac_cv_value_media=${MEDIA-A4} |
---|
92 | fi, |
---|
93 | ac_cv_value_media=${MEDIA-A4} |
---|
94 | ) |
---|
95 | MEDIA=$ac_cv_value_media |
---|
96 | AC_SUBST(MEDIA) |
---|
97 | |
---|
98 | dnl Find the printer spooler command. |
---|
99 | |
---|
100 | AC_CHECK_PROG(SPOOLER, lpr, lpr) |
---|
101 | AC_CHECK_PROG(SPOOLER, lp, lp) |
---|
102 | |
---|
103 | dnl user can overwrite this |
---|
104 | AC_ARG_WITH(spooler, |
---|
105 | [ --with-spooler=SPOOLER set the printer spooler command], |
---|
106 | if test "X$withval" != "Xno"; then |
---|
107 | SPOOLER=$withval |
---|
108 | fi |
---|
109 | ) |
---|
110 | |
---|
111 | dnl If SPOOLER is still empty, set it to `lpr'. After this, we should |
---|
112 | dnl be able to compile enscript on HURD. |
---|
113 | if test "X$SPOOLER" = "X"; then |
---|
114 | SPOOLER=lpr |
---|
115 | fi |
---|
116 | |
---|
117 | dnl The PostScript language level. |
---|
118 | PSLEVEL="2" |
---|
119 | AC_ARG_WITH(ps-level, |
---|
120 | [ --with-ps-level=LEVEL set the PostScript language level to LEVEL], |
---|
121 | if test "X$withval" != "Xno"; then |
---|
122 | PSLEVEL=$withval |
---|
123 | fi |
---|
124 | ) |
---|
125 | AC_SUBST(PSLEVEL) |
---|
126 | |
---|
127 | dnl Internationalization. |
---|
128 | ALL_LINGUAS="de es fi fr nl sl" |
---|
129 | AM_GNU_GETTEXT |
---|
130 | AC_LINK_FILES($nls_cv_header_libgt, $nls_cv_header_intl) |
---|
131 | |
---|
132 | dnl Path separator character. |
---|
133 | AC_DEFINE_UNQUOTED(PATH_SEPARATOR, ':') |
---|
134 | |
---|
135 | dnl |
---|
136 | dnl Scripts |
---|
137 | dnl |
---|
138 | |
---|
139 | dnl diffpp |
---|
140 | |
---|
141 | AC_PATH_PROG(PERL, perl) |
---|
142 | |
---|
143 | dnl substitutions |
---|
144 | |
---|
145 | AC_SUBST(CFLAGS) |
---|
146 | AC_SUBST(LDFLAGS) |
---|
147 | AC_SUBST(LIBOBJS) |
---|
148 | |
---|
149 | AC_OUTPUT([Makefile enscript.1 compat/Makefile afm/Makefile afmlib/Makefile src/Makefile lib/Makefile scripts/Makefile intl/Makefile po/Makefile.in states/Makefile states/states.1 states/tests/Makefile tests/Makefile], [sed -e "/POTFILES =/r po/POTFILES" po/Makefile.in >po/Makefile]) |
---|
150 | |
---|
151 | echo "" |
---|
152 | |
---|
153 | echo "Enscript is now configured to your system with the following" |
---|
154 | echo "user-definable options. Please, check that they are correct and" |
---|
155 | echo "match to your system's properties." |
---|
156 | echo "" |
---|
157 | echo "Option Change with configure's option Current value" |
---|
158 | echo "---------------------------------------------------------" |
---|
159 | echo "Media --with-media=MEDIA $MEDIA" |
---|
160 | echo "Spooler --with-spooler=SPOOLER $SPOOLER" |
---|
161 | echo "PS level --with-ps-level=LEVEL $PSLEVEL" |
---|
162 | echo "" |
---|