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