Flexible encoding and support of locale paper size
[enscript.git] / configure.ac
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT([GNU Enscript],[1.6.6],[bug-enscript@gnu.org])
3 AC_PREREQ([2.61])
4 AC_CONFIG_SRCDIR([src/gsint.h])
5 AC_CONFIG_HEADERS([config.h])
6
7 AM_INIT_AUTOMAKE
8
9 AC_PROG_INSTALL
10
11 AC_PROG_CC
12
13 AC_USE_SYSTEM_EXTENSIONS
14
15 AC_C_CONST
16 AC_FUNC_ALLOCA
17
18 AC_HEADER_STDC
19 AC_CHECK_HEADERS([string.h stdlib.h unistd.h stdarg.h math.h pwd.h])
20 AC_CHECK_HEADERS([sys/types.h sys/stat.h])
21
22 dnl Check some functions.
23 AC_CHECK_FUNCS(strchr getcwd)
24 AC_REPLACE_FUNCS(strerror memmove memcpy strtoul)
25 AC_FUNC_VPRINTF
26
27 dnl -lsun is needed on IRIX-4.0 to get the user passwd entry through
28 dnl the yellow pages / NIS.
29 AC_CHECK_LIB(sun, main)
30
31 dnl Find out where the gethostname() is.
32 AC_CHECK_FUNC(gethostname, , [
33   AC_CHECK_LIB(nsl, gethostname, LIBS="$LIBS -lnsl", [
34     AC_CHECK_LIB(socket, gethostname)
35   ])
36 ])
37
38 AC_PROG_RANLIB
39 AC_PROG_YACC
40 AM_PROG_LEX
41
42 AC_ARG_ENABLE(debug,
43 [  --enable-debug         enable debugging], [
44   echo enabling debugging
45   if test -n "$GCC"; then
46     CFLAGS="$CFLAGS -Wall"
47   fi
48 ])
49
50 dnl Define the default output media.
51
52 AC_ARG_WITH(media,
53 [  --with-media(=MEDIA)   use output media Letter (MEDIA), default is A4],
54   if test "X$withval" != "Xno"; then
55     if test "X$withval" = "Xyes"; then
56       ac_cv_value_media='Letter'
57     else
58       ac_cv_value_media=$withval
59     fi
60   else
61     ac_cv_value_media=${MEDIA-A4}
62   fi,
63   ac_cv_value_media=${MEDIA-A4}
64 )
65 MEDIA=$ac_cv_value_media
66 AC_SUBST(MEDIA)
67
68 dnl Define the default input encoding.
69 AC_ARG_WITH(encoding,
70 [  --with-encoding(=ENCODING) use input encoding (ENCODING), default is latin1],
71   if test "X$withval" != "Xno"; then
72     if test "X$withval" = "Xyes"; then
73       ac_cv_value_encoding='latin1'
74     else
75       ac_cv_value_encoding=$withval
76     fi
77   else
78     ac_cv_value_encoding=${ENCODING-latin1}
79   fi,
80   ac_cv_value_encoding=${ENCODING-latin1}
81 )
82 ENCODING=$ac_cv_value_encoding
83 AC_SUBST(ENCODING)
84
85 dnl Find the printer spooler command.
86
87 AC_CHECK_PROG(SPOOLER, lpr, lpr)
88 AC_CHECK_PROG(SPOOLER, lp, lp)
89
90 dnl user can overwrite this
91 AC_ARG_WITH(spooler,
92 [  --with-spooler=SPOOLER  set the printer spooler command],
93   if test "X$withval" != "Xno"; then
94     SPOOLER=$withval
95   fi
96 )
97
98 dnl If SPOOLER is still empty, set it to `lpr'.  After this, we should
99 dnl be able to compile enscript on HURD.
100 if test "X$SPOOLER" = "X"; then
101   SPOOLER=lpr
102 fi
103
104 dnl The PostScript language level.
105 PSLEVEL="2"
106 AC_ARG_WITH(ps-level,
107 [  --with-ps-level=LEVEL   set the PostScript language level to LEVEL],
108   if test "X$withval" != "Xno"; then
109     PSLEVEL=$withval
110   fi
111 )
112 AC_SUBST(PSLEVEL)
113
114 dnl Internationalization.
115 AM_GNU_GETTEXT
116 AM_GNU_GETTEXT_VERSION([0.17])
117
118 dnl Path separator character.
119 AC_DEFINE_UNQUOTED([PATH_SEPARATOR], [':'],
120   [Character used to separate path components.])
121 AC_DEFINE_UNQUOTED([PATH_SEPARATOR_STR], [":"],
122   [Character used to separate path components, as string.])
123
124 dnl
125 dnl Scripts
126 dnl
127
128 dnl diffpp
129
130 AC_PATH_PROG(PERL, perl)
131
132 dnl substitutions
133
134 AC_SUBST(CFLAGS)
135 AC_SUBST(LDFLAGS)
136
137 AC_CONFIG_FILES([Makefile  po/Makefile.in intl/Makefile po/Makefile \
138         compat/Makefile \
139         afm/Makefile \
140         afmlib/Makefile \
141         src/Makefile \
142         src/tests/Makefile \
143         lib/Makefile \
144         scripts/Makefile \
145         states/Makefile \
146         states/hl/Makefile \
147         states/tests/Makefile \
148         docs/Makefile \
149         w32/Makefile])
150
151 AC_OUTPUT
152
153 echo ""
154
155 echo "Enscript is now configured to your system with the following"
156 echo "user-definable options.  Please, check that they are correct and"
157 echo "match to your system's properties."
158 echo ""
159 echo "Option     Change with configure's option   Current value"
160 echo "---------------------------------------------------------"
161 echo "Media      --with-media=MEDIA               $MEDIA"
162 echo "Encoding   --with-encoding=ENCODING         $ENCODING"
163 echo "Spooler    --with-spooler=SPOOLER           $SPOOLER"
164 echo "PS level   --with-ps-level=LEVEL            $PSLEVEL"
165 echo ""