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