1 |
# configure.in for GNUstep GUI Backend |
2 |
# Process this file with autoconf to produce a configure script. |
3 |
# |
4 |
# Copyright (C) 1996-2002 Free Software Foundation, Inc. |
5 |
# |
6 |
# Author: Adam Fedor <fedor@gnu.org> |
7 |
# |
8 |
# This file is part of the GNUstep Backend. |
9 |
# |
10 |
# This library is free software; you can redistribute it and/or |
11 |
# modify it under the terms of the GNU Library General Public |
12 |
# License as published by the Free Software Foundation; either |
13 |
# version 2 of the License, or (at your option) any later version. |
14 |
# |
15 |
# This library is distributed in the hope that it will be useful, |
16 |
# but WITHOUT ANY WARRANTY; without even the implied warranty of |
17 |
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
18 |
# Library General Public License for more details. |
19 |
# |
20 |
# You should have received a copy of the GNU Library General Public |
21 |
# License along with this library; see the file COPYING.LIB. |
22 |
# If not, write to the Free Software Foundation, |
23 |
# 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
24 |
# |
25 |
|
26 |
AC_INIT |
27 |
AC_CONFIG_SRCDIR([back.make.in]) |
28 |
AC_CONFIG_HEADER(config.h) |
29 |
|
30 |
if test -z "$GNUSTEP_SYSTEM_ROOT"; then |
31 |
AC_MSG_ERROR([You must run the GNUstep.sh script before configuring]) |
32 |
fi |
33 |
|
34 |
#-------------------------------------------------------------------- |
35 |
# Use config.guess, config.sub and install-sh provided by gnustep-make |
36 |
#-------------------------------------------------------------------- |
37 |
AC_CONFIG_AUX_DIR($GNUSTEP_MAKEFILES) |
38 |
|
39 |
#-------------------------------------------------------------------- |
40 |
# Determine the host, build, and target systems |
41 |
#-------------------------------------------------------------------- |
42 |
AC_PROG_CC |
43 |
AC_CANONICAL_TARGET([]) |
44 |
|
45 |
#-------------------------------------------------------------------- |
46 |
# The following is so that headers and custom libraries |
47 |
# in the GNUstep root are used before the standard ones |
48 |
#-------------------------------------------------------------------- |
49 |
# Set location of GNUstep dirs for later use |
50 |
GNUSTEP_HDIR=$GNUSTEP_SYSTEM_ROOT/Library/Headers |
51 |
if test "$GNUSTEP_FLATTENED" = yes; then |
52 |
GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries |
53 |
else |
54 |
clean_target_os=`$GNUSTEP_MAKEFILES/clean_os.sh $target_os` |
55 |
clean_target_cpu=`$GNUSTEP_MAKEFILES/clean_cpu.sh $target_cpu` |
56 |
obj_dir=$clean_target_cpu/$clean_target_os |
57 |
GNUSTEP_LDIR=$GNUSTEP_SYSTEM_ROOT/Library/Libraries/$obj_dir |
58 |
fi |
59 |
CPPFLAGS="$CPPFLAGS -I$GNUSTEP_HDIR" |
60 |
LDFLAGS="$LDFLAGS -L$GNUSTEP_LDIR/$LIBRARY_COMBO -L$GNUSTEP_LDIR" |
61 |
|
62 |
#-------------------------------------------------------------------- |
63 |
# Add target OS directories as necessary |
64 |
#-------------------------------------------------------------------- |
65 |
case "$target_os" in |
66 |
freebsd* | openbsd* ) |
67 |
CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" |
68 |
LDFLAGS="$LDFLAGS -L/usr/pkg/lib";; |
69 |
netbsd*) CPPFLAGS="$CPPFLAGS -I/usr/pkg/include" |
70 |
LDFLAGS="$LDFLAGS -Wl,-R/usr/pkg/lib -L/usr/pkg/lib";; |
71 |
esac |
72 |
|
73 |
#-------------------------------------------------------------------- |
74 |
# Look for WindowMaker's wraster library |
75 |
#-------------------------------------------------------------------- |
76 |
AC_ARG_WITH(wraster, |
77 |
[ --with-wraster=PREFIX get-wraster-flags directory prefix]) |
78 |
if test "x$with_wraster" = "x"; then |
79 |
wprefix="" |
80 |
else |
81 |
wprefix=${with_wraster}/ |
82 |
fi |
83 |
|
84 |
if test "x$with_wraster" != "xnone"; then |
85 |
GRAPHIC_LIBS=`${wprefix}get-wraster-flags --libs` |
86 |
GRAPHIC_CFLAGS=`${wprefix}get-wraster-flags --cflags | sed -e "s|-I/usr/include||"` |
87 |
GRAPHIC_LFLAGS=`${wprefix}get-wraster-flags --ldflags` |
88 |
fi |
89 |
|
90 |
AC_DEFUN(AC_CHECK_WRASTER, |
91 |
[dnl |
92 |
AC_MSG_CHECKING(for current libwraster support) |
93 |
AC_CACHE_VAL(gs_cv_have_wraster, |
94 |
[wraster_check_save_header=${CPPFLAGS} |
95 |
wraster_check_save_libs=${LIBS} |
96 |
CPPFLAGS="$1 $2 ${CPPFLAGS}" |
97 |
LIBS="$3 $LIBS" |
98 |
|
99 |
# Check for RFillImage which is only in version 2.0 of libwraster |
100 |
AC_CHECK_LIB(wraster, RFillImage, gs_cv_have_wraster=yes, gs_cv_have_wraster=no)if test "x$with_wraster" = "xnone"; then |
101 |
gs_cv_have_wraster=no |
102 |
fi |
103 |
if test "$gs_cv_have_wraster" = yes; then |
104 |
AC_CHECK_HEADERS(wraster.h, gs_cv_have_wraster=yes, gs_cv_have_wraster=no) |
105 |
fi |
106 |
CPPFLAGS="${wraster_check_save_header}" |
107 |
LIBS="${wraster_check_save_libs}" |
108 |
]) |
109 |
AC_MSG_RESULT($gs_cv_have_wraster) |
110 |
]) |
111 |
|
112 |
AC_CHECK_WRASTER(${GRAPHIC_CFLAGS}, ${GRAPHIC_LFLAGS}, ${GRAPHIC_LIBS}) |
113 |
if test $gs_cv_have_wraster = no; then |
114 |
GRAPHIC_LIBS= |
115 |
GRAPHIC_CFLAGS= |
116 |
GRAPHIC_LFLAGS= |
117 |
fi |
118 |
|
119 |
AC_ARG_WITH(library-flags, |
120 |
[ --with-library-flags=fg Library flags for libraries]) |
121 |
AC_ARG_WITH(dps_include, |
122 |
[ --with-include-flags=fg Include flags]) |
123 |
GRAPHIC_LFLAGS="$GRAPHIC_LFLAGS $with_library_flags" |
124 |
GRAPHIC_CFLAGS="$GRAPHIC_CFLAGS $with_include_flags" |
125 |
|
126 |
#-------------------------------------------------------------------- |
127 |
# Find for X windows |
128 |
#-------------------------------------------------------------------- |
129 |
# If the user specifically set x_include/x_libs, then assume we're |
130 |
# using a special X system and discard any previous GRAPHIC_flags |
131 |
set_x_paths=no |
132 |
if test $gs_cv_have_wraster = no -o $x_includes != NONE; then |
133 |
set_x_paths=yes |
134 |
fi |
135 |
AC_PATH_XTRA |
136 |
if test "x$no_x" = xyes; then |
137 |
set_x_paths=no |
138 |
fi |
139 |
|
140 |
if test $set_x_paths = yes; then |
141 |
GRAPHIC_CFLAGS="$X_CFLAGS" |
142 |
GRAPHIC_LFLAGS="$X_LIBS" |
143 |
GRAPHIC_LIBS="$X_EXTRA_LIBS" |
144 |
|
145 |
lib_save_header=${CPPFLAGS} |
146 |
lib_save_libs=${LIBS} |
147 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
148 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
149 |
AC_CHECK_LIB(Xext, main, have_xext=1, have_xext=0) |
150 |
if test $have_xext = 1; then |
151 |
GRAPHIC_LIBS="-lX11 -lXext ${GRAPHIC_LIBS}" |
152 |
else |
153 |
GRAPHIC_LIBS="-lX11 ${GRAPHIC_LIBS}" |
154 |
fi |
155 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
156 |
AC_CHECK_LIB(Xmu, main, have_xmu=1, have_xmu=0) |
157 |
CPPFLAGS="${lib_save_header}" |
158 |
LIBS="${lib_save_libs}" |
159 |
if test $have_xmu = 1; then |
160 |
GRAPHIC_LIBS="-lXmu ${GRAPHIC_LIBS}" |
161 |
fi |
162 |
fi |
163 |
if test -r $x_includes/X11/DPS; then |
164 |
GRAPHIC_CFLAGS="-I$x_includes/X11 $GRAPHIC_CFLAGS" |
165 |
fi |
166 |
AC_SUBST(X_PRE_LIBS) |
167 |
|
168 |
#-------------------------------------------------------------------- |
169 |
# Find for DPS |
170 |
#-------------------------------------------------------------------- |
171 |
save_CPPFLAGS=${CPPFLAGS} |
172 |
CPPFLAGS="${CPPFLAGS} ${GRAPHIC_CFLAGS}" |
173 |
AC_CHECK_HEADERS([DPS/dpsclient.h DPS/dpsNXargs.h]) |
174 |
CPPFLAGS="${save_CPPFLAGS}" |
175 |
|
176 |
#-------------------------------------------------------------------- |
177 |
# freetype libraries |
178 |
#-------------------------------------------------------------------- |
179 |
save_header=${CPPFLAGS} |
180 |
save_libs=${LIBS} |
181 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
182 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
183 |
|
184 |
FREETYPE_LIBS="`freetype-config --libs`" |
185 |
FREETYPE_CFLAGS="`freetype-config --cflags`" |
186 |
|
187 |
CPPFLAGS="${CPPFLAGS} ${FREETYPE_CFLAGS}" |
188 |
LIBS="${LIBS} ${FREETYPE_LIBS}" |
189 |
|
190 |
AC_CHECK_LIB(freetype, main, have_freetype=yes, have_freetype=no) |
191 |
if test "$have_freetype" = yes; then |
192 |
AC_CHECK_HEADER(ft2build.h,have_freetype=yes, have_freetype=no) |
193 |
fi |
194 |
if test "$have_freetype" = yes; then |
195 |
GRAPHIC_CFLAGS="$GRAPHIC_CFLAGS $FREETYPE_CFLAGS" |
196 |
GRAPHIC_LIBS="$FREETYPE_LIBS $GRAPHIC_LIBS" |
197 |
fi |
198 |
CPPFLAGS="${save_header}" |
199 |
LIBS="${save_libs}" |
200 |
|
201 |
#-------------------------------------------------------------------- |
202 |
# Extended font support & UTF8 support |
203 |
#-------------------------------------------------------------------- |
204 |
WITH_XFT=no |
205 |
save_header=${CPPFLAGS} |
206 |
save_libs=${LIBS} |
207 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
208 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
209 |
AC_CHECK_LIB(Xft, XftFontOpen, have_xft=yes, have_xft=no) |
210 |
AC_CHECK_HEADER(X11/Xft/Xft.h) |
211 |
if test "$have_xft" = yes -a "$ac_cv_header_X11_Xft_Xft_h" = yes; then |
212 |
GRAPHIC_LIBS="-lXft ${GRAPHIC_LIBS}" |
213 |
WITH_XFT=yes |
214 |
AC_DEFINE(HAVE_XFT,1,[Define if you have the Xft library]) |
215 |
AC_CHECK_LIB(Xft, XftDrawStringUtf8, have_utf8=yes, have_utf8=no) |
216 |
if test "$have_utf8" = yes; then |
217 |
AC_DEFINE(HAVE_UTF8,1,[Define if you have XftDrawStringUtf8]) |
218 |
fi |
219 |
AC_CHECK_LIB(fontconfig, FcPatternCreate, have_fc=yes, have_fc=no) |
220 |
AC_CHECK_HEADER(fontconfig/fontconfig.h) |
221 |
if test "$have_fc" = yes -a "$ac_cv_header_fontconfig_fontconfig_h" = yes; then |
222 |
GRAPHIC_LIBS="-lfontconfig ${GRAPHIC_LIBS}" |
223 |
AC_DEFINE(HAVE_FC,1,[Define if you have FcPatternCreate]) |
224 |
fi |
225 |
fi |
226 |
CPPFLAGS="${save_header}" |
227 |
LIBS="${save_libs}" |
228 |
AC_SUBST(WITH_XFT) |
229 |
|
230 |
#-------------------------------------------------------------------- |
231 |
# GLX support |
232 |
#-------------------------------------------------------------------- |
233 |
WITH_GLX=no |
234 |
AC_ARG_ENABLE(glx, |
235 |
[ --disable-glx Disable GLX support],, |
236 |
enable_glx=yes) |
237 |
if test "x$enable_glx" = "xyes"; then |
238 |
save_header=${CPPFLAGS} |
239 |
save_libs=${LIBS} |
240 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
241 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
242 |
AC_CHECK_LIB(GL, glXMakeContextCurrent, have_glx=yes, have_glx=no) |
243 |
AC_CHECK_HEADER(GL/glx.h) |
244 |
AC_MSG_CHECKING([for GLX_RGBA_TYPE]) |
245 |
AC_EGREP_CPP(yes, |
246 |
[#include <GL/glx.h> |
247 |
#ifdef GLX_RGBA_TYPE |
248 |
yes |
249 |
#endif |
250 |
], have_glx_rgba=yes, have_glx_rgba=no) |
251 |
AC_MSG_RESULT([$have_glx_rgba]) |
252 |
if test "$have_glx" = yes -a "$ac_cv_header_GL_glx_h" = yes -a "$have_glx_rgba" = yes; then |
253 |
GRAPHIC_LIBS="-lGL ${GRAPHIC_LIBS}" |
254 |
WITH_GLX=yes |
255 |
AC_DEFINE(HAVE_GLX,1,[Define if you have the glx library]) |
256 |
fi |
257 |
CPPFLAGS="${save_header}" |
258 |
LIBS="${save_libs}" |
259 |
AC_SUBST(WITH_GLX) |
260 |
fi |
261 |
|
262 |
|
263 |
#-------------------------------------------------------------------- |
264 |
# XIM support |
265 |
#-------------------------------------------------------------------- |
266 |
AC_ARG_ENABLE(xim, |
267 |
[ --disable-xim Disable XIM support],, |
268 |
enable_xim=yes) |
269 |
if test "x$enable_xim" = "xyes"; then |
270 |
AC_DEFINE(USE_XIM,1,[Define to enable XIM support]) |
271 |
fi |
272 |
|
273 |
#-------------------------------------------------------------------- |
274 |
# Functions |
275 |
#-------------------------------------------------------------------- |
276 |
AC_HAVE_FUNCS(usleep) |
277 |
|
278 |
#-------------------------------------------------------------------- |
279 |
# Find for JPEG |
280 |
#-------------------------------------------------------------------- |
281 |
AC_ARG_WITH(jpeg_library, |
282 |
[ --with-jpeg-library=DIR JPEG library file are in DIR], , |
283 |
with_jpeg_library=) |
284 |
AC_ARG_WITH(jpeg_include, |
285 |
[ --with-jpeg-include=DIR JPEG include files are in DIR], , |
286 |
with_jpeg_include=) |
287 |
|
288 |
if test -n "$with_jpeg_library"; then |
289 |
with_jpeg_library="-L$with_jpeg_library" |
290 |
fi |
291 |
if test -n "$with_jpeg_include"; then |
292 |
with_jpeg_include="-I$with_jpeg_include" |
293 |
fi |
294 |
|
295 |
AC_DEFUN(AC_CHECK_JPEGLIB, |
296 |
[jpeg_check_lib_save_header=${CPPFLAGS} |
297 |
CPPFLAGS="$1 $2 ${CPPFLAGS}" |
298 |
|
299 |
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress, |
300 |
jpeg_ok=yes, |
301 |
jpeg_ok=no) |
302 |
if test "$jpeg_ok" = yes; then |
303 |
AC_MSG_CHECKING([for jpeglib.h]) |
304 |
AC_TRY_CPP([#include <stdio.h> |
305 |
#undef PACKAGE |
306 |
#undef VERSION |
307 |
#undef HAVE_STDLIB_H |
308 |
#include <jpeglib.h>], |
309 |
jpeg_ok=yes, |
310 |
jpeg_ok=no) |
311 |
AC_MSG_RESULT($jpeg_ok) |
312 |
|
313 |
if test "$jpeg_ok" = yes; then |
314 |
GRAPHIC_LFLAGS="$1 $GRAPHIC_LFLAGS" |
315 |
GRAPHIC_CFLAGS="$2 $GRAPHIC_CFLAGS" |
316 |
fi |
317 |
fi |
318 |
CPPFLAGS="${jpeg_check_lib_save_header}"]) |
319 |
|
320 |
if test $gs_cv_have_wraster = no -o $set_x_paths = yes; then |
321 |
AC_CHECK_JPEGLIB(${with_jpeg_library}, ${with_jpeg_include}) |
322 |
fi |
323 |
|
324 |
#-------------------------------------------------------------------- |
325 |
# Find for TIFF |
326 |
#-------------------------------------------------------------------- |
327 |
AC_ARG_WITH(tiff_library, |
328 |
[ --with-tiff-library=DIR TIFF library file are in DIR], , |
329 |
with_tiff_library=) |
330 |
AC_ARG_WITH(tiff_include, |
331 |
[ --with-tiff-include=DIR TIFF include files are in DIR], , |
332 |
with_tiff_include=) |
333 |
|
334 |
if test -n "$with_tiff_library"; then |
335 |
with_tiff_library="-L$with_tiff_library" |
336 |
fi |
337 |
if test -n "$with_tiff_include"; then |
338 |
with_tiff_include="-I$with_tiff_include" |
339 |
fi |
340 |
|
341 |
AC_DEFUN(AC_CHECK_TIFFLIB, |
342 |
[tiff_check_lib_save_header=${CPPFLAGS} |
343 |
tiff_check_lib_save_libs=${LIBS} |
344 |
CPPFLAGS="$1 ${JPEG_LIB} $2 ${JPEG_INCLUDE} ${CPPFLAGS}" |
345 |
AC_CHECK_LIB(z, main, HAVE_LIBZ=1, HAVE_LIBZ=0) |
346 |
|
347 |
AC_MSG_CHECKING(for -ltiff without -ljpeg nor -lz) |
348 |
LIBS="-ltiff -lm $LIBS" |
349 |
AC_TRY_LINK([char TIFFReadScanline();], [TIFFReadScanline()], |
350 |
jpeg_notneeded=yes, |
351 |
jpeg_notneeded=no) |
352 |
AC_MSG_RESULT($jpeg_notneeded) |
353 |
LIBS=${tiff_check_lib_save_libs} |
354 |
JPEG= |
355 |
if test "$jpeg_notneeded" = no; then |
356 |
JPEG=-ljpeg |
357 |
fi |
358 |
|
359 |
if test $HAVE_LIBZ = 1; then |
360 |
AC_MSG_CHECKING(for -ltiff without -lz) |
361 |
LIBS="-ltiff $JPEG -lm $LIBS" |
362 |
AC_TRY_LINK([char TIFFReadScanline();], [TIFFReadScanline()], |
363 |
libz_notneeded=yes, |
364 |
libz_notneeded=no) |
365 |
AC_MSG_RESULT($libz_notneeded) |
366 |
LIBS=${tiff_check_lib_save_libs} |
367 |
if test "$libz_notneeded" = no; then |
368 |
JPEG="$JPEG -lz" |
369 |
fi |
370 |
fi |
371 |
|
372 |
AC_CHECK_LIB(tiff, TIFFReadScanline, tiff_ok=yes, tiff_ok=no, $JPEG -lm) |
373 |
if test "$tiff_ok" = yes; then |
374 |
AC_CHECK_HEADER(tiffio.h, tiff_ok=yes, tiff_ok=no) |
375 |
if test "$tiff_ok" = yes; then |
376 |
GRAPHIC_LFLAGS="$1 $GRAPHIC_LFLAGS" |
377 |
GRAPHIC_CFLAGS="$2 $GRAPHIC_CFLAGS" |
378 |
GRAPHIC_LIBS="-ltiff $JPEG -lm $GRAPHIC_LIBS" |
379 |
else |
380 |
AC_MSG_WARN(Cannot find libtiff header tiffio) |
381 |
echo "* The GUI library requres the TIFF library" |
382 |
echo "* Use --with-tiff-include to specify the tiff header directory" |
383 |
echo "* and --with-tiff-library to specify the tiff library directory" |
384 |
echo "* if it is not in the usual place(s)" |
385 |
AC_MSG_ERROR(gnustep-gui will not compile without tiff includes) |
386 |
fi |
387 |
else |
388 |
AC_MSG_WARN(Cannot find libtiff) |
389 |
echo "* The GUI library reqiures the TIFF library" |
390 |
echo "* Use --with-tiff-library to specify the tiff library" |
391 |
echo "* directory if it is not in the usual place(s)" |
392 |
echo "* You may also have to specify --with-jpeg-library if the jpeg" |
393 |
echo "* library is needed by tiff", |
394 |
AC_MSG_ERROR(gnustep-gui will not compile without tiff) |
395 |
fi |
396 |
CPPFLAGS="${tiff_check_lib_save_header}"]) |
397 |
|
398 |
if test $gs_cv_have_wraster = no -o $set_x_paths = yes; then |
399 |
AC_CHECK_TIFFLIB(${with_tiff_library}, ${with_tiff_include}) |
400 |
fi |
401 |
|
402 |
save_CPPFLAGS=${CPPFLAGS} |
403 |
CPPFLAGS="$CPPFLAGS $GRAPHIC_CFLAGS" |
404 |
AC_CHECK_HEADERS(X11/extensions/XShm.h, |
405 |
AC_DEFINE(XSHM,1,[Define if you have X11/extensions/XShm.h]),, |
406 |
[#include <X11/Xlib.h>]) |
407 |
CPPFLAGS="$save_CPPFLAGS" |
408 |
|
409 |
#-------------------------------------------------------------------- |
410 |
# Window's graphics library |
411 |
#-------------------------------------------------------------------- |
412 |
save_header=${CPPFLAGS} |
413 |
save_libs=${LIBS} |
414 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
415 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
416 |
AC_CHECK_LIB(gdi32, main, have_gdi32=yes, have_gdi32=no) |
417 |
if test "$have_gdi32" = yes; then |
418 |
WIN32_LIBS="-lgdi32" |
419 |
fi |
420 |
CPPFLAGS="${save_header}" |
421 |
LIBS="${save_libs}" |
422 |
|
423 |
#-------------------------------------------------------------------- |
424 |
# libart graphics libraries |
425 |
#-------------------------------------------------------------------- |
426 |
save_header=${CPPFLAGS} |
427 |
save_libs=${LIBS} |
428 |
CPPFLAGS="${GRAPHIC_CFLAGS} ${GRAPHIC_LFLAGS} ${CPPFLAGS}" |
429 |
LIBS="${GRAPHIC_LIBS} ${LIBS}" |
430 |
|
431 |
LIBART_LIBS="`libart2-config --libs`" |
432 |
LIBART_CFLAGS="`libart2-config --cflags`" |
433 |
|
434 |
CPPFLAGS="${CPPFLAGS} ${LIBART_CFLAGS}" |
435 |
LIBS="${LIBS} ${LIBART_LIBS}" |
436 |
|
437 |
AC_CHECK_LIB(art_lgpl_2, main, have_libart_lgpl_2=yes, have_libart_lgpl_2=no) |
438 |
if test "$have_libart_lgpl_2" = yes; then |
439 |
AC_CHECK_HEADER(libart_lgpl/libart.h,have_libart_lgpl_2=yes, have_libart_lgpl_2=no) |
440 |
fi |
441 |
if test "$have_libart_lgpl_2" = yes; then |
442 |
GRAPHIC_LIBS="$LIBART_LIBS $GRAPHIC_LIBS" |
443 |
GRAPHIC_CFLAGS="$LIBART_CFLAGS $GRAPHIC_CFLAGS" |
444 |
fi |
445 |
CPPFLAGS="${save_header}" |
446 |
LIBS="${save_libs}" |
447 |
|
448 |
#-------------------------------------------------------------------- |
449 |
# Set definitions |
450 |
#-------------------------------------------------------------------- |
451 |
WITH_WRASTER=no |
452 |
if test $gs_cv_have_wraster = yes -a $set_x_paths = no; then |
453 |
AC_DEFINE(WITH_WRASTER,1,[Define if you have libwraster]) |
454 |
WITH_WRASTER=yes |
455 |
fi |
456 |
AC_SUBST(WITH_WRASTER) |
457 |
AC_SUBST(GRAPHIC_LIBS) |
458 |
AC_SUBST(GRAPHIC_CFLAGS) |
459 |
AC_SUBST(GRAPHIC_LFLAGS) |
460 |
|
461 |
#-------------------------------------------------------------------- |
462 |
# Which projects should we build? |
463 |
#-------------------------------------------------------------------- |
464 |
BUILD_SERVER=x11 |
465 |
BUILD_GRAPHICS=xlib |
466 |
case $target_os in |
467 |
*mingw32* ) BUILD_SERVER=win32 |
468 |
BUILD_GRAPHICS=winlib;; |
469 |
esac |
470 |
|
471 |
AC_ARG_ENABLE(server, |
472 |
[ --enable-server=SRV Build server type: x11, win32],, |
473 |
enable_server=$BUILD_SERVER) |
474 |
AC_ARG_ENABLE(graphics, |
475 |
[ --enable-graphics=GPH Build graphics: xlib, xdps, winlib, art],, |
476 |
enable_graphics="$BUILD_GRAPHICS") |
477 |
|
478 |
BUILD_SERVER=$enable_server |
479 |
BUILD_GRAPHICS="$enable_graphics" |
480 |
AC_MSG_CHECKING(Backend Server) |
481 |
AC_SUBST(BUILD_SERVER) |
482 |
AC_DEFINE_UNQUOTED(BUILD_SERVER,SERVER_$BUILD_SERVER, |
483 |
[Define to type of window server to build]) |
484 |
AC_MSG_RESULT($BUILD_SERVER) |
485 |
|
486 |
AC_MSG_CHECKING(Backend Graphics) |
487 |
AC_SUBST(BUILD_GRAPHICS) |
488 |
AC_DEFINE_UNQUOTED(BUILD_GRAPHICS,$BUILD_GRAPHICS, |
489 |
[Define to type of graphics context to build]) |
490 |
AC_MSG_RESULT($BUILD_GRAPHICS) |
491 |
|
492 |
if test x"$BUILD_GRAPHICS" = "xxdps"; then |
493 |
GRAPHIC_LIBS="-ldpstk -ldps -lpsres -lXt $X_PRE_LIBS $GRAPHIC_LIBS" |
494 |
elif test x"$BUILD_GRAPHICS" = "xart"; then |
495 |
if test "$have_freetype" = no; then |
496 |
AC_MSG_ERROR([can't find freetype, required for graphics=art!]) |
497 |
fi |
498 |
if test "$have_libart_lgpl_2" = no; then |
499 |
AC_MSG_ERROR([can't find libart, required for graphics=art!]) |
500 |
fi |
501 |
elif test x"$BUILD_GRAPHICS" = "xwinlib"; then |
502 |
GRAPHIC_LIBS="$WIN32_LIBS $GRAPHIC_LIBS" |
503 |
fi |
504 |
|
505 |
AH_TOP([ |
506 |
#define SERVER_x11 1 |
507 |
#define SERVER_win32 2 |
508 |
]) |
509 |
|
510 |
#-------------------------------------------------------------------- |
511 |
# Set the name of the backend |
512 |
#-------------------------------------------------------------------- |
513 |
AC_ARG_WITH(name, |
514 |
[ --with-name=PREFIX Set the name of the backend (def=back)]) |
515 |
AC_MSG_CHECKING(Backend name) |
516 |
if test "x$with_name" = "x"; then |
517 |
BACKEND_NAME=back |
518 |
else |
519 |
BACKEND_NAME=${with_name} |
520 |
fi |
521 |
AC_MSG_RESULT($BACKEND_NAME) |
522 |
AC_SUBST(BACKEND_NAME) |
523 |
|
524 |
AC_CONFIG_FILES([back.make config.make]) |
525 |
AC_OUTPUT |