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
|
$NetBSD: patch-ad,v 1.4 2001/11/18 00:57:50 lukem Exp $
--- configure.in.orig Mon Sep 10 07:52:14 2001
+++ configure.in
@@ -16,6 +16,7 @@
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"
@@ -124,9 +125,45 @@
], [], [])
fi
+AC_MSG_CHECKING(graphics library file path)
+AC_ARG_WITH(graphics,
+[ --with-graphics=PATH Path for graphics library files],
+[ case "$withval" in
+ yes|no)
+ AC_MSG_RESULT(using default: $GRAPHLIB_PATH)
+ ;;
+ *)
+ AC_MSG_RESULT($withval)
+ AC_DEFINE_UNQUOTED(GRAPHLIB_PATH, "$withval")
+ GRAPHLIB_PATH=$withval
+ ;;
+ esac],
+ AC_MSG_RESULT(using default: $GRAPHLIB_PATH)
+)
+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"
+
+dnl Include in case GD was compiled with internationalization support
+AC_CHECK_LIB(intl, gettext,
+[ LIBINTL="-lintl"],[ LIBINTL=""] )
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBINTL"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+
dnl Include in case GD was compiled with True Type support
AC_CHECK_LIB(ttf, TT_New_Glyph,
[ LIBTTF="-lttf"],[ LIBTTF=""] )
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBTTF"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
+
+dnl Include in case GD was compiled with jpeg support
+AC_CHECK_LIB(jpeg, jpeg_abort,
+[ LIBJPEG="-ljpeg"],[ LIBJPEG=""] )
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBJPEG"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
dnl Include in case GD was compiled with Xpm support
AC_CHECK_LIB(X11, XBell,
@@ -135,70 +172,43 @@
echo "Retrying with -L /usr/X11R6/lib"
unset ac_cv_lib_X11_XBell
AC_CHECK_LIB(X11, XBell,
- [ LIBX="-lX11 -L/usr/X11R6/lib" ],
+ [ LIBX="-R/usr/X11R6/lib -L/usr/X11R6/lib -lX11" ],
[ LIBX="" ],
- [ -lX11 -L/usr/X11R6/lib ],
+ [ -L/usr/X11R6/lib -lX11 ],
)
],
)
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBX"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
dnl Include in case GD was compiled with Xpm support
AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
- [ LIBXPM="-lXpm"],
- [
- echo "Retrying with $LIBX"
- unset ac_cv_lib_Xpm_XpmReadFileToXpmImage
- AC_CHECK_LIB(Xpm, XpmReadFileToXpmImage,
- [ LIBXPM="-lXpm $LIBX" ],
- [ LIBXPM="" ],
- [ -lXpm $LIBX ],
- )
- ],
- [ -lXpm ],
+ [ LIBXPM="-lXpm $LIBX"],
+ [ LIBXPM="" ],
+ [ -lXpm $LIBX ],
)
+GRAPHICS_LIBS="$GRAPHICS_LIBS $LIBXPM"
+CFLAGS="$CFLAGS_save $GRAPHICS_LIBS"
AC_CHECK_LIB(gd, gdImagePng,
[
- GFXLIBS="-lgd -lpng -lz"
+ LIBGD="$GRAPHICS_LIBS -lgd -lpng -lz"
],
[
- 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"
- AC_CHECK_LIB(gd, gdImagePng,
- [
- GFXLIBS="-lgd -lpng -lz -L/usr/local/lib -I/usr/local/include"
- ],,
- [-lm -lpng -lz])
+ AC_MSG_RESULT(
+** You will not be able to build the CGI programs without gd.
+**
+** To get it, visit http://www.boutell.com/gd/
+ )
],
-[-lm -lpng -lz],
+[$GRAPHICS_LIBS -lm -lpng -lz],
)
-
-if test "$GFXLIBS" = "" ; then
- echo "Trying again - using $LIBTTF"
- unset ac_cv_lib_gd_gdImagePng
- AC_CHECK_LIB(gd, gdImagePng,
- [
- GFXLIBS="-lgd -lpng -lz $LIBTTF"
- ],,
- [-lm -lpng -lz $LIBTTF])
-fi
-
-if test "$GFXLIBS" = "" ; then
- echo "Trying again - using $LIBTTF $LIBXPM"
- unset ac_cv_lib_gd_gdImagePng
- AC_CHECK_LIB(gd, gdImagePng,
- [
- GFXLIBS="-lgd -lpng -lz $LIBTTF $LIBXPM"
- ],,
- [-lm -lpng -lz $LIBTTF $LIBXPM])
-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"
AC_CHECK_HEADERS(gd.h gd/gd.h sys/modem.h stdarg.h varargs.h sys/shm.h err.h)
+CFLAGS=$CFLAGS_save
+CPPFLAGS=$CPPFLAGS_save
AC_HEADER_TIME
AC_CHECK_HEADERS(sys/time.h)
@@ -211,7 +221,7 @@
for lib in `echo $LD_LIBRARY_PATH | $AWK -F: '{ for (i = NF; i > 0; --i) print $i }' | sort | uniq`; do
if test -f ${lib}/libpng.so; then
AC_CHECK_LIB(png, png_info_init,
- [ GFXLIBS="-R${lib} $GFXLIBS"
+ [ GRAPHICS_LIBS="-R${lib} $GRAPHICS_LIBS"
],
[],
[-lm -R${lib}],)
@@ -481,7 +491,8 @@
AC_SUBST(LIBOBJ)
AC_SUBST(BUILDOBJ)
AC_SUBST(NETLIBS)
-AC_SUBST(GFXLIBS)
+AC_SUBST(GRAPHICS_LIBS)
+AC_SUBST(GRAPHICS_INCLUDES)
AC_SUBST(SERLIBS)
AC_SUBST(STATEPATH)
AC_SUBST(MODELPATH)
|