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