File: configure.in

package info (click to toggle)
cupsddk 1.2.3-5
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 4,488 kB
  • ctags: 1,125
  • sloc: ansic: 7,074; cpp: 5,423; makefile: 526; xml: 227; sh: 153
file content (355 lines) | stat: -rw-r--r-- 8,659 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
dnl
dnl "$Id: configure.in 365 2007-10-05 20:42:05Z mike $"
dnl
dnl   Configuration script for the CUPS DDK.
dnl
dnl   Copyright 2007 by Apple Inc.
dnl   Copyright 2002-2007 by Easy Software Products.
dnl
dnl   These coded instructions, statements, and computer programs are the
dnl   property of Apple Inc. and are protected by Federal copyright
dnl   law.  Distribution and use rights are outlined in the file "LICENSE.txt"
dnl   which should have been included with this file.  If this file is
dnl   file is missing or damaged, see the license at "http://www.cups.org/".
dnl

AC_INIT(cups/driver.h)
AC_CONFIG_HEADER(config.h)
AC_PREFIX_DEFAULT(/usr)

dnl Version number...

VERSION=1.2.3
AC_SUBST(VERSION)
AC_DEFINE_UNQUOTED(DDK_VERSION, "v$VERSION")

dnl Get the operating system...

uname=`uname`
uversion=`uname -r | sed -e '1,$s/[[^0-9]]//g'`

if test "$uname" = "IRIX64"; then
	uname="IRIX"
fi

dnl Clear default debugging options and set normal optimization by
dnl default unless the user asks for debugging specifically.

CFLAGS="${CFLAGS:=}"
CXXFLAGS="${CXXFLAGS:=}"
LDFLAGS="${LDFLAGS:=}"
AC_SUBST(LDFLAGS)
OPTIM=""
AC_SUBST(OPTIM)

AC_ARG_ENABLE(debug, [  --enable-debug          turn on debugging, default=no],
if eval "test x$enable_debug = xyes"; then
 	OPTIM="-g"
fi)

AC_ARG_WITH(optim, [  --with-optim="flags"    set optimization flags ])

AC_ARG_ENABLE(static, [  --enable-static         use static CUPS libraries, default=no])

AC_ARG_WITH(docdir, [  --with-docdir           set directory for documentation],
	docdir="$withval",
	docdir="NONE")

AC_SUBST(docdir)

dnl Setup general architecture flags...
AC_ARG_WITH(archflags, [  --with-arch="flags"     set default architecture flags ])

if test -z "$with_archflags"; then
	ARCHFLAGS=""
else
	ARCHFLAGS="$with_archflags"
fi

AC_SUBST(ARCHFLAGS)

dnl Checks for programs...
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
if test "$INSTALL" = "$ac_install_sh"; then
	# Use full path to install-sh script...
	INSTALL="`pwd`/install-sh -c"
fi
AC_PROG_RANLIB
AC_PATH_PROG(AR,ar)
AC_PATH_PROG(CP,cp)
AC_PATH_PROG(HTMLDOC,htmldoc)
AC_PATH_PROG(MKDIR,mkdir)
AC_PATH_PROG(NROFF,nroff)
if test x$NROFF = x; then
	AC_PATH_PROG(GROFF,groff)
	if test x$GROFF = x; then
        	NROFF="echo"
	else
        	NROFF="$GROFF -T ascii"
	fi
fi
AC_PATH_PROG(RM,rm)

dnl Architecture checks...
AC_C_CONST
AC_C_CHAR_UNSIGNED

dnl Checks for header files.
AC_HEADER_STDC

dnl Checks for string functions.
AC_CHECK_FUNCS(strcasecmp strdup strlcat strlcpy strncasecmp)

if test "$uname" = "HP-UX" -a "$uversion" = "1020"; then
	AC_MSG_WARN(Forcing snprintf emulation for HP-UX.)
else
	AC_CHECK_FUNCS(snprintf)
	AC_CHECK_FUNCS(vsnprintf)
fi

dnl Check for random number functions...
AC_CHECK_FUNCS(random mrand48 lrand48)

dnl Check for where the pow() function is installed...
AC_SEARCH_LIBS(pow, m)

dnl Check for CUPS...
AC_PATH_PROG(CUPSCONFIG, cups-config)

if test "x$CUPSCONFIG" = x; then
	AC_MSG_ERROR(CUPS 1.2 or higher is required for the CUPS DDK!)
fi

if test `$CUPSCONFIG --api-version` = 1.1; then
	AC_MSG_ERROR(CUPS 1.2 or higher is required for the CUPS DDK!)
fi

CFLAGS="`$CUPSCONFIG --cflags` $CFLAGS"
CPPFLAGS="`$CUPSCONFIG --cflags` $CPPFLAGS"
CXXFLAGS="`$CUPSCONFIG --cflags` $CXXFLAGS"
LDFLAGS="`$CUPSCONFIG --ldflags` $LDFLAGS"
CUPSLIBS="`$CUPSCONFIG --libs`"
CUPSLIBS_ST="`$CUPSCONFIG --static --libs`"
if test x$enable_static = xyes; then
	CUPSDRVLIBS="`$CUPSCONFIG --static --image --libs`"
else
	CUPSDRVLIBS="`$CUPSCONFIG --image --libs`"
fi
CUPSDRVLIBS_ST="`$CUPSCONFIG --static --image --libs`"

CUPS_DATADIR="`$CUPSCONFIG --datadir`"
CUPS_SERVERBIN="`$CUPSCONFIG --serverbin`"
CUPS_SERVERROOT="`$CUPSCONFIG --serverroot`"
AC_SUBST(CUPS_DATADIR)
AC_SUBST(CUPS_SERVERBIN)
AC_SUBST(CUPS_SERVERROOT)
AC_SUBST(CUPSDRVLIBS)
AC_SUBST(CUPSDRVLIBS_ST)
AC_SUBST(CUPSLIBS)
AC_SUBST(CUPSLIBS_ST)

AC_DEFINE_UNQUOTED(CUPS_DATADIR, "$CUPS_DATADIR")

AC_CHECK_HEADER(cups/cups.h,,AC_MSG_ERROR(CUPS headers are not installed!))

dnl Check for FLTK...
AC_PATH_PROG(FLTKCONFIG,fltk-config)

if test "x$FLTKCONFIG" = x; then
#	AC_MSG_ERROR([Sorry, the CUPS DDK requires FLTK 1.1.x.])
	GUILIBS=""
else
	CXXFLAGS="`$FLTKCONFIG --cflags` $CXXFLAGS"
	GUILIBS="`$FLTKCONFIG --use-images --ldstaticflags`"
fi

AC_SUBST(FLTKCONFIG)
AC_SUBST(GUILIBS)

dnl Update compiler options...
if test -n "$GCC"; then
	if test -z "$OPTIM"; then
		if test "x$with_optim" = x; then
			# Default to optimize-for-size and debug
       			OPTIM="-Os -g"
		else
			OPTIM="$with_optim $OPTIM"
		fi
	fi

	# Add useful warning options for tracking down problems...
	OPTIM="-Wall -Wno-format-y2k -Wwrite-strings $OPTIM"
	# Additional warning options for alpha testing...
	OPTIM="-Wshadow -Wunused $OPTIM"

	# See if GCC supports -fno-rtti...
	AC_MSG_CHECKING(if GCC supports -fno-rtti)
	OLDCFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -fno-rtti"
	AC_TRY_COMPILE(,,
		CXXFLAGS="$CXXFLAGS -fno-rtti"
		LDFLAGS="$LDFLAGS -fno-rtti"
		AC_MSG_RESULT(yes),
		AC_MSG_RESULT(no))
	CFLAGS="$OLDCFLAGS"

	# See if GCC supports -fno-exceptions...
	AC_MSG_CHECKING(if GCC supports -fno-exceptions)
	OLDCFLAGS="$CFLAGS"
	CFLAGS="$CFLAGS -fno-exceptions"
	AC_TRY_COMPILE(,,
		OPTIM="$OPTIM -fno-exceptions"
		AC_MSG_RESULT(yes),
		AC_MSG_RESULT(no))
	CFLAGS="$OLDCFLAGS"

	# See if we are running HP-UX or Solaris; if so, try the
	# -fpermissive option...
	case $uname in
		SunOS* | HP-UX*)
			AC_MSG_CHECKING(if GCC supports -fpermissive)

			OLDCFLAGS="$CFLAGS"
			CFLAGS="$CFLAGS -fpermissive"
			AC_TRY_COMPILE(,,
				OPTIM="$OPTIM -fpermissive"
				AC_MSG_RESULT(yes),
				AC_MSG_RESULT(no))
			CFLAGS="$OLDCFLAGS"
			;;
		*)
			;;
	esac
else
	case $uname in
		AIX*)
			if test -z "$OPTIM"; then
				OPTIM="-O2"
			fi
			;;
		HP-UX*)
			if test -z "$OPTIM"; then
				OPTIM="+O2"
			fi
			;;
        	IRIX*)
			if test -z "$OPTIM"; then
        			OPTIM="-O2"
			fi
			if test $uversion -ge 62; then
				OPTIM="$OPTIM -n32 -mips3"
				OPTIM="$OPTIM -OPT:Olimit=3000"
				OPTIM="-fullwarn -woff 1209,1506,1692 $OPTIM"
			else
				OPTIM="-fullwarn $OPTIM"
			fi
			;;
		SunOS*)
			# Solaris
			if test -z "$OPTIM"; then
				OPTIM="-xO4"
			fi
			;;
		*)
			# Running some other operating system; inform the user they
			# should contribute the necessary options to
			# ppdc@easysw.com...
			echo "Building CUPS DDK with default compiler optimizations; contact"
			echo "cups-ddk@easysw.com with the uname and compiler options needed for"
			echo "your platform, or set the CFLAGS and CXXFLAGS environment"
			echo "variable before running configure."
			;;
	esac
fi

dnl Flags for "ar" command...
case $uname in
        Darwin* | *BSD*)
                ARFLAGS="-rcv"
                ;;
        *)
                ARFLAGS="crvs"
                ;;
esac

AC_SUBST(ARFLAGS)

dnl Fix "prefix" variable if it hasn't been specified...
if test "x$prefix" = xNONE; then
	prefix="/usr"
fi

dnl Fix "exec_prefix" variable if it hasn't been specified...
if test "x$exec_prefix" = NONE; then
	exec_prefix="$prefix"
fi

dnl Fix "datarootdir" variable if it hasn't been specified...
if test "$datarootdir" = "\${prefix}/share"; then
	if test "$prefix" = "/"; then
		datarootdir="/usr/share"
	else
		datarootdir="$prefix/share"
	fi
fi

dnl Fix "datadir" variable if it hasn't been specified...
if test "x$datadir" = "x\${prefix}/share"; then
	datadir="$prefix/share"
elif test "$datadir" = "\${datarootdir}"; then
	datadir="$datarootdir"
fi

dnl Fix "docdir" variable if it hasn't been specified...
if test "x$docdir" = xNONE; then
	docdir="$datadir/doc/cups"
fi

AC_DEFINE_UNQUOTED(DDK_DOCDIR, "$docdir")
AC_DEFINE_UNQUOTED(DDK_DATADIR, "$datadir")
AC_DEFINE_UNQUOTED(PPDC_INCLUDE_DIR, "$datadir/cupsddk/include")
AC_DEFINE_UNQUOTED(PPDC_PO_DIR, "$datadir/cupsddk/po")

dnl Fix "mandir" variable if it hasn't been specified...
if test "$mandir" = "\${prefix}/man" -a "$prefix" = "/usr"; then
	case "$uname" in
        	*BSD* | Darwin* | Linux*)
        		# BSD, Darwin (MacOS X), and Linux
        		mandir="/usr/share/man"
        		;;
        	IRIX*)
        		# SGI IRIX
        		mandir="/usr/share/catman/u_man"
        		;;
        	*)
        		# All others
        		mandir="/usr/man"
        		;;
	esac
fi

dnl More manpage stuff...
case "$uname" in
        Linux* | GNU*)
        	# Linux and GNU Hurd
        	MAN1EXT="1.gz"
        	MAN5EXT="5.gz"
        	;;
        *)
        	# All others
        	MAN1EXT="1"
        	MAN5EXT="5"
        	;;
esac

AC_SUBST(MAN1EXT)
AC_SUBST(MAN5EXT)

dnl Output the makefile, list file, and config header...
AC_OUTPUT(Makedefs packaging/cupsddk.list)

dnl
dnl End of "$Id: configure.in 365 2007-10-05 20:42:05Z mike $".
dnl