summaryrefslogtreecommitdiff
path: root/sysutils/ups-nut-cgi/patches/patch-af
blob: 78cb19ffd658e72844189c9be10779806f76121f (plain)
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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
$NetBSD: patch-af,v 1.1 2002/10/02 23:36:07 dillo Exp $

--- configure.orig	Thu Oct  3 01:28:43 2002
+++ configure
@@ -12,6 +12,8 @@ ac_help=
 ac_default_prefix=/usr/local
 # Any additions from configure.in:
 ac_help="$ac_help
+ --with-graphics=PATH         Path for graphics library files"
+ac_help="$ac_help
  --with-linux-hiddev=PATH	Path to Linux hiddev.h kernel headers"
 ac_help="$ac_help
  --with-statepath=PATH		Path for ups state files"
@@ -666,6 +668,7 @@ test "$host_alias" != "$target_alias" &&
 STATEPATH="/var/state/ups"
 MODELPATH="$prefix/bin"
 CGIPATH="$prefix/cgi-bin"
+GRAPHLIB_PATH="/usr/local"
 RUN_AS_USER="nobody"
 RUN_AS_GROUP="nogroup"
 PIDPATH="/var/run"
@@ -1763,99 +1766,46 @@ fi
 
 fi
 
-echo $ac_n "checking for TT_New_Glyph in -lttf""... $ac_c" 1>&6
-echo "configure:1768: checking for TT_New_Glyph in -lttf" >&5
-ac_lib_var=`echo ttf'_'TT_New_Glyph | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
-else
-  ac_save_LIBS="$LIBS"
-LIBS="-lttf  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1776 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char TT_New_Glyph();
-
-int main() {
-TT_New_Glyph()
-; return 0; }
+echo $ac_n "checking graphics library file path""... $ac_c" 1>&6
+echo "configure:1771: checking graphics library file path" >&5
+# Check whether --with-graphics or --without-graphics was given.
+if test "${with_graphics+set}" = set; then
+  withval="$with_graphics"
+         case "$withval" in
+	yes|no)
+		echo "$ac_t""using default: $GRAPHLIB_PATH" 1>&6
+		;;
+	*)
+		echo "$ac_t""$withval" 1>&6
+		cat >> confdefs.h <<EOF
+#define GRAPHLIB_PATH "$withval"
 EOF
-if { (eval echo configure:1787: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
-fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-   LIBTTF="-lttf"
-else
-  echo "$ac_t""no" 1>&6
- LIBTTF="" 
-fi
-
-
-echo $ac_n "checking for XBell in -lX11""... $ac_c" 1>&6
-echo "configure:1810: checking for XBell in -lX11" >&5
-ac_lib_var=`echo X11'_'XBell | sed 'y%./+-%__p_%'`
-if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
-  echo $ac_n "(cached) $ac_c" 1>&6
+		GRAPHLIB_PATH=$withval
+		;;
+	esac
 else
-  ac_save_LIBS="$LIBS"
-LIBS="-lX11  $LIBS"
-cat > conftest.$ac_ext <<EOF
-#line 1818 "configure"
-#include "confdefs.h"
-/* Override any gcc2 internal prototype to avoid an error.  */
-/* We use char because int might match the return type of a gcc2
-    builtin and then its argument prototype would still apply.  */
-char XBell();
+  echo "$ac_t""using default: $GRAPHLIB_PATH" 1>&6
 
-int main() {
-XBell()
-; return 0; }
-EOF
-if { (eval echo configure:1829: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=yes"
-else
-  echo "configure: failed program was:" >&5
-  cat conftest.$ac_ext >&5
-  rm -rf conftest*
-  eval "ac_cv_lib_$ac_lib_var=no"
 fi
-rm -f conftest*
-LIBS="$ac_save_LIBS"
 
-fi
-if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
-  echo "$ac_t""yes" 1>&6
-   LIBX="-lX11" 
-else
-  echo "$ac_t""no" 1>&6
+GRAPHICS_LIBS="-R$GRAPHLIB_PATH/lib -L$GRAPHLIB_PATH/lib"
+GRAPHICS_INCLUDES="-I$GRAPHLIB_PATH/include"
+CFLAGS_save=$CFLAGS
+CPPFLAGS_save=$CPPFLAGS
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+CPPFLAGS="$CPPFLAGS_save $GRAPHICS_INCLUDES"
 
-	       echo "Retrying with -L /usr/X11R6/lib"
-               unset ac_cv_lib_X11_XBell
-		echo $ac_n "checking for XBell in -lX11""... $ac_c" 1>&6
-echo "configure:1851: checking for XBell in -lX11" >&5
-ac_lib_var=`echo X11'_'XBell | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for gettext in -lintl""... $ac_c" 1>&6
+echo "configure:1801: checking for gettext in -lintl" >&5
+ac_lib_var=`echo intl'_'gettext | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lX11  -lX11 -L/usr/X11R6/lib  $LIBS"
+LIBS="-lintl  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1859 "configure"
+#line 1809 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1860,13 +1810,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char XBell();
+char gettext();
 
 int main() {
-XBell()
+gettext()
 ; return 0; }
 EOF
-if { (eval echo configure:1870: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1820: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1881,30 +1831,25 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-   LIBX="-lX11 -L/usr/X11R6/lib" 
+   LIBINTL="-lintl"
 else
   echo "$ac_t""no" 1>&6
- LIBX="" 
-fi
-
-        
+ LIBINTL="" 
 fi
 
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBINTL"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
 
-
-if test "$LIBX" != "" 
-then
-
-		echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6
-echo "configure:1900: checking for XpmReadFileToXpmImage in -lXpm" >&5
-ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for TT_New_Glyph in -lttf""... $ac_c" 1>&6
+echo "configure:1845: checking for TT_New_Glyph in -lttf" >&5
+ac_lib_var=`echo ttf'_'TT_New_Glyph | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lXpm  -lXpm  $LIBS"
+LIBS="-lttf  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1908 "configure"
+#line 1853 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1909,13 +1854,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char XpmReadFileToXpmImage();
+char TT_New_Glyph();
 
 int main() {
-XpmReadFileToXpmImage()
+TT_New_Glyph()
 ; return 0; }
 EOF
-if { (eval echo configure:1919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1864: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1930,22 +1875,25 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-   LIBXPM="-lXpm"
+   LIBTTF="-lttf"
 else
   echo "$ac_t""no" 1>&6
- 
-			echo "Retrying with $LIBX"
-			unset ac_cv_lib_Xpm_XpmReadFileToXpmImage
-			echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6
-echo "configure:1941: checking for XpmReadFileToXpmImage in -lXpm" >&5
-ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'`
+ LIBTTF="" 
+fi
+
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBTTF"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+
+echo $ac_n "checking for jpeg_abort in -ljpeg""... $ac_c" 1>&6
+echo "configure:1889: checking for jpeg_abort in -ljpeg" >&5
+ac_lib_var=`echo jpeg'_'jpeg_abort | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lXpm  -lXpm $LIBX  $LIBS"
+LIBS="-ljpeg  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1949 "configure"
+#line 1897 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1950,13 +1898,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char XpmReadFileToXpmImage();
+char jpeg_abort();
 
 int main() {
-XpmReadFileToXpmImage()
+jpeg_abort()
 ; return 0; }
 EOF
-if { (eval echo configure:1960: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1908: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -1971,27 +1919,23 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-   LIBXPM="-lXpm $LIBX" 
+   LIBJPEG="-ljpeg"
 else
   echo "$ac_t""no" 1>&6
- LIBXPM="" 
-fi
-
-		
+ LIBJPEG="" 
 fi
 
-fi
 
-echo $ac_n "checking for gdImagePng in -lgd""... $ac_c" 1>&6
-echo "configure:1987: checking for gdImagePng in -lgd" >&5
-ac_lib_var=`echo gd'_'gdImagePng | sed 'y%./+-%__p_%'`
+echo $ac_n "checking for XBell in -lX11""... $ac_c" 1>&6
+echo "configure:1931: checking for XBell in -lX11" >&5
+ac_lib_var=`echo X11'_'XBell | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgd -lm -lpng -lz $LIBS"
+LIBS="-lX11  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 1995 "configure"
+#line 1939 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -1996,13 +1940,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gdImagePng();
+char XBell();
 
 int main() {
-gdImagePng()
+XBell()
 ; return 0; }
 EOF
-if { (eval echo configure:2006: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2017,25 +1961,22 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-	GFXLIBS="-lgd -lpng -lz"
-
+   LIBX="-lX11" 
 else
   echo "$ac_t""no" 1>&6
 
-	echo "Trying again - using -L/usr/local/lib -I/usr/local/include..."
-	unset ac_cv_lib_gd_gdImagePng
-	CPPFLAGS="$CPPFLAGS -L/usr/local/lib -I/usr/local/include"
-	echo $ac_n "checking for gdImagePng in -lgd""... $ac_c" 1>&6
-echo "configure:2031: checking for gdImagePng in -lgd" >&5
-ac_lib_var=`echo gd'_'gdImagePng | sed 'y%./+-%__p_%'`
+	       echo "Retrying with -L /usr/X11R6/lib"
+               unset ac_cv_lib_X11_XBell
+		echo $ac_n "checking for XBell in -lX11""... $ac_c" 1>&6
+echo "configure:1972: checking for XBell in -lX11" >&5
+ac_lib_var=`echo X11'_'XBell | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgd -lm -lpng -lz $LIBS"
+LIBS="-lX11  -L/usr/X11R6/lib -lX11  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2039 "configure"
+#line 1980 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2040,13 +1981,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gdImagePng();
+char XBell();
 
 int main() {
-gdImagePng()
+XBell()
 ; return 0; }
 EOF
-if { (eval echo configure:2050: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:1991: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2061,33 +2002,33 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-		GFXLIBS="-lgd -lpng -lz -L/usr/local/lib -I/usr/local/include"
-	
+   LIBX="-R/usr/X11R6/lib -L/usr/X11R6/lib -lX11" 
 else
   echo "$ac_t""no" 1>&6
+ LIBX="" 
 fi
 
-
+        
 fi
 
 
-if test "$LIBTTF" != "" 
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBJPEG"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+
+
+if test "$LIBX" != "" 
 then
 
-	if test "$GFXLIBS" = "" ; then
-	        echo "Trying again - using $LIBTTF"
-	        unset ac_cv_lib_gd_gdImagePng
-	        echo $ac_n "checking for gdImagePng in -lgd""... $ac_c" 1>&6
-echo "configure:2083: checking for gdImagePng in -lgd" >&5
-ac_lib_var=`echo gd'_'gdImagePng | sed 'y%./+-%__p_%'`
+		echo $ac_n "checking for XpmReadFileToXpmImage in -lXpm""... $ac_c" 1>&6
+echo "configure:2024: checking for XpmReadFileToXpmImage in -lXpm" >&5
+ac_lib_var=`echo Xpm'_'XpmReadFileToXpmImage | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgd -lm -lpng -lz $LIBTTF $LIBS"
+LIBS="-lXpm  -lXpm $LIBX  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2091 "configure"
+#line 2032 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2092,13 +2033,13 @@ cat > conftest.$ac_ext <<EOF
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
     builtin and then its argument prototype would still apply.  */
-char gdImagePng();
+char XpmReadFileToXpmImage();
 
 int main() {
-gdImagePng()
+XpmReadFileToXpmImage()
 ; return 0; }
 EOF
-if { (eval echo configure:2102: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:2043: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
@@ -2113,28 +2054,27 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-  
-	                GFXLIBS="-lgd -lpng -lz $LIBTTF"
-	        
+   LIBXPM="-lXpm $LIBX"
 else
   echo "$ac_t""no" 1>&6
+ LIBXPM="" 
 fi
 
-	fi
 
-	if test "$GFXLIBS" = "" ; then
-	        echo "Trying again - using $LIBTTF $LIBXPM"
-	        unset ac_cv_lib_gd_gdImagePng
-	        echo $ac_n "checking for gdImagePng in -lgd""... $ac_c" 1>&6
-echo "configure:2130: checking for gdImagePng in -lgd" >&5
+	GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBXPM"
+	CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+fi
+
+echo $ac_n "checking for gdImagePng in -lgd""... $ac_c" 1>&6
+echo "configure:2070: checking for gdImagePng in -lgd" >&5
 ac_lib_var=`echo gd'_'gdImagePng | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   ac_save_LIBS="$LIBS"
-LIBS="-lgd -lm -lpng -lz $LIBTTF $LIBXPM $LIBS"
+LIBS="-lgd $GRAPHICS_LIBS -lm -lpng -lz $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 2138 "configure"
+#line 2078 "configure"
 #include "confdefs.h"
 /* Override any gcc2 internal prototype to avoid an error.  */
 /* We use char because int might match the return type of a gcc2
@@ -2161,18 +2101,20 @@ fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   
-			GFXLIBS="-lgd -lpng -lz $LIBTTF $LIBXPM"
-	        
+	LIBGD="$GRAPHICS_LIBS -lgd -lpng -lz"
+
 else
   echo "$ac_t""no" 1>&6
-fi
 
-	fi
+	echo "$ac_t""** You will not be able to build the CGI programs without gd.
+**
+** To get it" 1>&6
+
 fi
 
-test "$GFXLIBS" = ""  && echo "** You will not be able to build the CGI programs without gd."
-test "$GFXLIBS" = ""  && echo "** "
-test "$GFXLIBS" = ""  && echo "** To get it, visit http://www.boutell.com/gd/"
+
+GRAPHICS_LIBS="$LIBGD"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
 
 for ac_hdr in gd.h gd/gd.h sys/modem.h stdarg.h varargs.h sys/shm.h
 do
@@ -2214,9 +2156,11 @@ else
 fi
 done
 
+CFLAGS=$CFLAGS_save
+CPPFLAGS=$CPPFLAGS_save
 
 echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6
-echo "configure:2220: checking whether time.h and sys/time.h may both be included" >&5
+echo "configure:2164: checking whether time.h and sys/time.h may both be included" >&5
 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -2363,7 +2307,7 @@ LIBS="$ac_save_LIBS"
 fi
 if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
   echo "$ac_t""yes" 1>&6
-   GFXLIBS="-R${lib} $GFXLIBS"
+   GRAPHICS_LIBS="-R${lib} $GRAPHICS_LIBS"
 	 
 else
   echo "$ac_t""no" 1>&6
@@ -3242,7 +3187,8 @@ s%@DRIVER_INSTALL_TARGET@%$DRIVER_INSTAL
 s%@LIBOBJ@%$LIBOBJ%g
 s%@BUILDOBJ@%$BUILDOBJ%g
 s%@NETLIBS@%$NETLIBS%g
-s%@GFXLIBS@%$GFXLIBS%g
+s%@GRAPHICS_LIBS@%$GRAPHICS_LIBS%g
+s%@GRAPHICS_INCLUDES@%$GRAPHICS_INCLUDES%g
 s%@SERLIBS@%$SERLIBS%g
 s%@STATEPATH@%$STATEPATH%g
 s%@MODELPATH@%$MODELPATH%g