1dnl process this file with GNU autoconf to produce a configure script.
2dnl
3dnl $Id: configure.in,v 1.1 2001/08/28 00:20:06 papowell Exp papowell $
4
5dnl ----------------------------------------------------------------------------
6dnl ----------------- START OF GENERAL CONFIGURATION ---------------------------
7AC_INIT(Makefile.in)
8
9PACKAGE=LPRngTool
10VERSION=1.3.2
11
12AC_CONFIG_AUX_DIR(.)
13AC_CANONICAL_SYSTEM
14AC_CONFIG_HEADER(config.h)
15
16AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
17AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
18AC_SUBST(PACKAGE)
19AC_SUBST(VERSION)
20ALL_LINGUAS="fr"
21
22AC_PREFIX_DEFAULT(/usr/local)
23AC_SUBST(INSTALL)
24AC_SUBST(INSTALL_MAN)
25AC_SUBST(SHELL)
26AC_SUBST(CPP)
27AC_SUBST(CFLAGS)
28AC_SUBST(CPPFLAGS)
29AC_SUBST(LDFLAGS)
30AC_SUBST(LDCC)
31
32dnl ----------------------------------------------------------------------------
33dnl -----------   Program checks       -----------------------------------------
34AC_PROG_INSTALL
35AC_PROG_MAKE_SET
36
37AC_PATH_PROG(FILEUTIL,file,FILE_UTILITY_NOT_FOUND)dnl
38if expr "$FILEUTIL" : ".*NOT" >/dev/null;  then
39	v="cannot open";
40else
41	v=`${FILEUTIL} - </etc/passwd 2>/dev/null`;
42fi
43if expr "$v" : ".*cannot open.*" >/dev/null;  then
44	echo "
45Please use a file(1) utility where 'file - ' reads STDIN
46You can obtain one from: ftp://ftp.astron.com/pub/file/
47if necessary, use the FILEUTIL environment variable to specify the path
48to the file(1) utility'
49"
50fi
51AC_SUBST(FILEUTIL)dnl
52
53AC_PATH_PROG(GS,gs,GHOSTSCRIPT_NOT_FOUND)dnl
54if expr "$GS" : ".*NOT" >/dev/null;  then
55	echo "
56Please install ghostscript
57You can it from: http://www.cs.wisc.edu/~ghost;
58if necessary, use the GS environment variable to specify the path
59to the gs(1) utility
60"
61fi
62AC_SUBST(GS)dnl
63
64AC_PATH_PROG(SMBCLIENT,smbclient,SMBCLIENT_NOT_FOUND)dnl
65AC_SUBST(SMBCLIENT)dnl
66AC_PATH_PROG(A2PS,a2ps,A2PS_NOT_FOUND)dnl
67AC_SUBST(A2PS)dnl
68AC_PATH_PROG(MPAGE,mpage,MPAGE_NOT_FOUND)dnl
69AC_SUBST(MPAGE)dnl
70AC_PATH_PROG(GZIP,gzip,GZIP_NOT_FOUND)dnl
71AC_SUBST(GZIP)dnl
72AC_PATH_PROG(PAP,pap,PAP_NOT_FOUND)dnl
73AC_SUBST(PAP)dnl
74AC_PATH_PROG(NPRINT,nprint,NPRINT_NOT_FOUND)dnl
75AC_SUBST(NPRINT)dnl
76
77if ( expr "$A2PS" : ".*NOT.*" && expr "$MPAGE" : ".*NOT.*" ) >/dev/null ; then
78echo "
79You do not have a text to PostScript conversion utility
80Please install one of the following:
81a2ps - Ascii Text to PostScript Converter
82   http://www-inf.enst.fr/~demaille/a2ps
83   ftp://ftp.enst.fr/pub/unix/a2ps/
84mpage - SGI FreeWare  Ascii Text to PostScript Converter
85   http://toolbox.sgi.com/TasteOfDT/public/freeware1.0/fw_MPHmpage/
86"
87fi
88
89dnl ----------------------------------------------------------------------------
90dnl -----------   C compiler checks    -----------------------------------------
91AC_PROG_CC
92AC_PROG_CPP
93
94
95AC_MSG_CHECKING(tcl/tk version > 8.3 )
96AC_PATH_PROG(WISH,wish8.3,WISH_NOT_FOUND)dnl
97if test "$WISH" = "WISH_NOT_FOUND" ; then
98	AC_MSG_CHECKING( - trying for default wish)
99	AC_PATH_PROG(WISH8,wish,WISH_NOT_FOUND)dnl
100	WISH=$WISH8
101fi
102AC_SUBST(WISH)dnl
103if test "$WISH" = "WISH_NOT_FOUND";  then
104echo "
105You do not have Tcl/Tk installed or you do not have
106'wish8.3' or 'wish' in the search path.  Please correct this and
107retry.
108"
109	exit 1
110fi
111
112dnl ----------------------------------------------------------------------------
113dnl ----------- XXXXXX START OF OPTIONS ----------------------------------------
114
115dnl  lprngtool.conf location
116dnl
117AC_MSG_CHECKING(lprngtool.conf location)
118AC_ARG_WITH(lprngtool_conf,
119[  --with-lprngtool_conf=PATH   location of lprngtool.conf (default \${sysconfdir}/lprngtool.conf)],
120LPRNGTOOL_CONF=$withval,
121LPRNGTOOL_CONF=\${sysconfdir}/lprngtool.conf,
122)
123AC_MSG_RESULT($LPRNGTOOL_CONF)
124AC_SUBST(LPRNGTOOL_CONF)
125
126dnl  printcap location
127dnl
128AC_MSG_CHECKING(printcap location)
129AC_ARG_WITH(printcap_path,
130[  --with-printcap_path=PATH    location of printcap file (default \${sysconfdir}/printcap)],
131PRINTCAP_PATH=$withval,
132PRINTCAP_PATH=\${sysconfdir}/printcap,
133)
134AC_MSG_RESULT($PRINTCAP_PATH)
135AC_SUBST(PRINTCAP_PATH)
136
137dnl  spool directory location
138dnl
139AC_MSG_CHECKING(spool directory)
140AC_ARG_WITH(spool_directory,
141[  --with-spool_directory=PATH  location of spool directories (default /var/spool/lpd)],
142SPOOL_DIR=$withval,
143SPOOL_DIR=/var/spool/lpd,
144)
145AC_MSG_RESULT($SPOOL_DIR)
146AC_SUBST(SPOOL_DIR)
147
148AC_MSG_CHECKING(ifhp filter path)
149AC_ARG_WITH(ifhp_path,
150[  --with-ifhp_path=PATH        location of ifhp filter (default: \${FILTER_DIR}/ifhp)],
151IFHP_PATH=$withval,
152IFHP_PATH=\${FILTER_DIR}/ifhp,
153)
154AC_MSG_RESULT($IFHP_PATH)
155AC_SUBST(IFHP_PATH)
156
157
158AC_MSG_CHECKING(ifhp.conf path)
159AC_ARG_WITH(ifhp_conf,
160[  --with-ifhp_conf=PATH        location of ifhp configuration file (default: \${sysconfdir}/ifhp.conf)],
161IFHP_CONF=$withval,
162IFHP_CONF=\${sysconfdir}/ifhp.conf,
163)
164AC_MSG_RESULT($IFHP_CONF)
165AC_SUBST(IFHP_CONF)
166
167AC_MSG_CHECKING(filter directory)
168AC_ARG_WITH(filterdir,
169[  --with-filterdir=DIR         filter directory (default \${libexecdir}/filters)],
170FILTER_DIR=$withval,
171FILTER_DIR=\${libexecdir}/filters,
172)
173AC_MSG_RESULT($FILTER_DIR)
174AC_SUBST(FILTER_DIR)
175
176dnl ----------------------------------------------------------------------------
177dnl ----------- XXXXXX END OF OPTIONS ------------------------------------------
178
179AC_ISC_POSIX
180AC_MINIX
181AC_AIX
182
183
184changequote(, )dnl
185release=`uname -r 2>/dev/null; exit 0`;
186version=`echo $target_os | sed -e 's/[^0-9][^0-9]*//' -e 's/\./X/' -e 's/\.//g' -e 's/X/./' \
187	| awk '{ v=$1+0; if( v > 0 ){ while( v < 100 ){v = v * 10;}}; print v; }' `;
188if test "$version" -eq 0 ; then
189	version=`echo $release | sed -e 's/-.*//' -e 's/\.//g' \
190	| awk '{ v=$1+0; if( v > 0 ){ while( v < 100 ){v = v * 10;}}; print v; }' `;
191fi
192osword=`echo $target_os | sed -e 's/[0-9].*//'`; export osword
193changequote([, ])dnl
194AC_MSG_RESULT([Target is $target, arch $target_cpu, os $target_os, release $release, version $version])
195
196AC_DEFINE_UNQUOTED(ARCHITECTURE,"$target_cpu")
197AC_DEFINE_UNQUOTED(OSNAME,"$osword")
198AC_DEFINE_UNQUOTED(OSVERSION,$version)
199OSNAME=$osword
200OSVERSION=$version
201AC_SUBST(OSNAME)dnl
202AC_SUBST(OSVERSION)dnl
203
204dnl ----------------------------------------------------------------------------
205dnl ----------------- INCLUDE FILES   ------------------------------------------
206
207AC_CHECK_HEADERS(unistd.h)
208
209
210dnl ----------------------------------------------------------------------------
211dnl ----------------- VERSIONS        ------------------------------------------
212
213PAGER="$A2PS"
214if expr "$OSNAME" : "linux" >/dev/null ; then
215        PAGER="$MPAGE"
216fi
217AC_SUBST(PAGER)dnl
218
219
220dnl ----------------------------------------------------------------------------
221dnl ----------------- START OF OUTPUT ------------------------------------------
222
223AC_OUTPUT(
224[
225Makefile
226lprngtool.1
227]
228)
229
230dnl ----------------------------------------------------------------------------
231dnl ----------------- END OF OUTPUT --------------------------------------------
232