source: trunk/third/gdk-pixbuf/configure.in @ 18128

Revision 18128, 9.8 KB checked in by ghudson, 22 years ago (diff)
Merge with gdk-pixbuf 0.22.0.
Line 
1# Process this file with autoconf to produce a configure script.
2AC_INIT(gdk-pixbuf/gdk-pixbuf.c)
3
4# Save this value here, since automake will set cflags later
5cflags_set=${CFLAGS+set}
6
7AM_CONFIG_HEADER(config.h)
8
9GDK_PIXBUF_MAJOR=0
10GDK_PIXBUF_MINOR=22
11GDK_PIXBUF_MICRO=0
12GDK_PIXBUF_VERSION="${GDK_PIXBUF_MAJOR}.${GDK_PIXBUF_MINOR}.${GDK_PIXBUF_MICRO}"
13AM_INIT_AUTOMAKE(gdk-pixbuf, ${GDK_PIXBUF_VERSION})
14
15AC_SUBST(GDK_PIXBUF_MAJOR)
16AC_SUBST(GDK_PIXBUF_MINOR)
17AC_SUBST(GDK_PIXBUF_MICRO)
18AC_SUBST(GDK_PIXBUF_VERSION)
19AM_PROG_LIBTOOL
20
21AC_PROG_CC
22AC_ISC_POSIX
23AM_PROG_CC_STDC
24AC_PROG_INSTALL
25AC_PROG_LN_S
26AC_PROG_MAKE_SET
27AC_PROG_CPP
28AC_PATH_XTRA
29
30dnl  Initialize maintainer mode
31AM_MAINTAINER_MODE
32
33AM_PATH_GLIB(1.2.0,,,gmodule)
34AM_PATH_GTK(1.2.0)
35
36AC_MSG_CHECKING(whether make is GNU Make)
37STRIP_BEGIN=
38STRIP_END=
39if $ac_make --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
40        STRIP_BEGIN='$(strip $(STRIP_DUMMY)'
41        STRIP_END=')'
42        AC_MSG_RESULT(yes)
43else
44        AC_MSG_RESULT(no)
45fi
46STRIP_DUMMY=
47AC_SUBST(STRIP_DUMMY)
48AC_SUBST(STRIP_BEGIN)
49AC_SUBST(STRIP_END)
50
51AC_PATH_PROG(GNOME_CONFIG,gnome-config,no)
52if test x$GNOME_CONFIG != xno; then
53        echo "Building the GnomeCanvasPixbuf library"
54        GNOME_LIBS=`$GNOME_CONFIG --libs gnomeui`
55        GNOME_CFLAGS=`$GNOME_CONFIG --cflags gnomeui`
56        BUILD_CANVAS=yes
57else
58        echo "Not building GnomeCanvasPixbuf library"
59        BUILD_CANVAS=no
60fi       
61
62AM_CONDITIONAL(BUILD_CANVAS_ITEM, test $BUILD_CANVAS = yes)
63
64AC_SUBST(GNOME_LIBS)
65AC_SUBST(GNOME_CFLAGS)
66
67AC_MSG_CHECKING(whether to build gmodulized gdk-pixbuf)
68
69AC_ARG_ENABLE(modules, [  --disable-modules       Disables dynamic module loading],[
70        if test x$withval = xyes; then
71            with_modules=yes
72        else
73            with_modules=no
74        fi
75])
76
77dynworks=false
78deps=
79if test x$with_modules = xno; then
80    AC_MSG_RESULT(no)
81else
82    AC_MSG_RESULT(yes)
83    AC_MSG_CHECKING(whether dynamic modules work)
84    oLIBS="$LIBS"
85    oCFLAGS="$CFLAGS"
86    CFLAGS="$GLIB_CFLAGS"
87    LIBS="$GLIB_LIBS"
88    AC_TRY_RUN([
89    #include <glib.h>
90    #include <gmodule.h>
91    main ()
92    {
93        if (g_module_supported ())
94            exit (0);
95        else
96            exit (1);
97    }
98    ], dynworks=true)
99    LIBS="$oLIBS"
100    CFLAGS="$oCFLAGS"
101fi
102   
103dnl Now we check to see if our libtool supports shared lib deps
104dnl (in a rather ugly way even)
105if $dynworks; then
106   pixbuf_libtool_config="${CONFIG_SHELL-/bin/sh} libtool --config"
107   pixbuf_deplibs_check=`$pixbuf_libtool_config | \
108      grep '^[[a-z_]]*check[[a-z_]]*_method=[['\''"]]' | \
109      sed 's/.*[['\''"]]\(.*\)[['\''"]]$/\1/'`
110   if test "x$pixbuf_deplibs_check" = "xnone" || \
111      test "x$pixbuf_deplibs_check" = "xunknown" || \
112      test "x$pixbuf_deplibs_check" = "x"; then
113      dynworks=false
114   fi
115fi
116
117if $dynworks; then
118   AC_DEFINE(USE_GMODULE)
119   GMODULE_LIBS="`glib-config --libs gmodule`"
120   GMODULE_FLAGS="`glib-config --cflags gmodule`"
121   AC_SUBST(GMODULE_LIBS)
122   AC_SUBST(GMODULE_FLAGS)
123   AC_MSG_RESULT(yes)
124else
125   AC_MSG_RESULT(no)
126fi
127
128dnl Check for location of rgb.txt file (works without, but better with)
129AC_MSG_CHECKING([for location of rgb.txt database])
130
131dnl default to this..
132path_rgb_txt=/usr/lib/X11/rgb.txt
133
134if test -r ${x_libraries}/X11/rgb.txt; then
135  path_rgb_txt="${x_libraries}/X11/rgb.txt"
136else
137  for d in /usr/lib/X11 /usr/local/lib/X11 /usr/openwin/lib; do
138    if test -r $d/rgb.txt; then
139      path_rgb_txt="$d/rgb.txt"
140      break
141    fi
142  done
143fi
144AC_MSG_RESULT([$path_rgb_txt])
145AC_DEFINE_UNQUOTED(PATH_RGB_TXT,"$path_rgb_txt")
146
147dnl Test for libtiff
148  if test -z "$LIBTIFF"; then
149    AC_CHECK_LIB(tiff, TIFFReadScanline,
150      AC_CHECK_HEADER(tiffio.h,
151        TIFF='tiff'; LIBTIFF='-ltiff',
152        AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
153      AC_CHECK_LIB(tiff, TIFFWriteScanline,
154        AC_CHECK_HEADER(tiffio.h,
155          TIFF='tiff'; LIBTIFF='-ltiff -ljpeg -lz',
156          AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
157        AC_CHECK_LIB(tiff34, TIFFFlushData,
158          AC_CHECK_HEADER(tiffio.h,
159            TIFF='tiff'; LIBTIFF='-ltiff34 -ljpeg -lz',
160            AC_MSG_WARN(*** TIFF loader will not be built (TIFF header files not found) ***)),
161        AC_MSG_WARN(*** TIFF plug-in will not be built (TIFF library not found) ***), -ljpeg -lz -lm), -ljpeg -lz -lm), -lm)
162  fi
163
164dnl Test for libjpeg
165  if test -z "$LIBJPEG"; then
166    AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
167      jpeg_ok=yes,
168      jpeg_ok=no
169      AC_MSG_WARN(*** JPEG loader will not be built (JPEG library not found) ***))
170    if test "$jpeg_ok" = yes; then
171      AC_MSG_CHECKING([for jpeglib.h])
172      AC_TRY_CPP(
173[#include <stdio.h>
174#undef PACKAGE
175#undef VERSION
176#include <jpeglib.h>],
177        jpeg_ok=yes,
178        jpeg_ok=no)
179      AC_MSG_RESULT($jpeg_ok)
180      if test "$jpeg_ok" = yes; then
181        LIBJPEG='-ljpeg'
182        AC_CHECK_LIB(jpeg, jpeg_simple_progression,     
183          AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
184          AC_MSG_WARN(JPEG library does not support progressive saving.))
185      else
186          AC_MSG_WARN(*** JPEG loader will not be built (JPEG header file not found) ***)
187      fi
188    fi
189  fi
190
191dnl Test for libpng
192  if test -z "$LIBPNG"; then
193    AC_CHECK_LIB(png, png_read_info,
194      AC_CHECK_HEADER(png.h,
195        png_ok=yes,
196        png_ok=no),
197      AC_MSG_WARN(*** PNG loader will not be built (PNG library not found) ***), -lz -lm)
198    if test "$png_ok" = yes; then
199      AC_MSG_CHECKING([for png_structp in png.h])
200      AC_TRY_COMPILE([#include <png.h>],
201        [png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
202        png_ok=yes,
203        png_ok=no)
204      AC_MSG_RESULT($png_ok)
205      if test "$png_ok" = yes; then
206        PNG='png'; LIBPNG='-lpng -lz'
207      else
208        AC_MSG_WARN(*** PNG loader will not be built (PNG library is too old) ***)
209      fi
210    else
211     AC_MSG_WARN(*** PNG loader will not be built (PNG header file not found) ***)
212    fi
213  fi
214
215deps="$LIBTIFF $LIBJPEG $LIBPNG"
216
217AC_SUBST(LIBTIFF)
218AC_SUBST(LIBJPEG)
219AC_SUBST(LIBPNG)
220
221AM_CONDITIONAL(BUILD_DYNAMIC_MODULES, $dynworks)
222
223AC_HEADER_STDC
224AC_HEADER_DIRENT
225AC_HEADER_SYS_WAIT
226
227AC_TYPE_SIGNAL
228
229AM_CONDITIONAL(HAVE_TIFF, test "x$LIBTIFF" != x)
230AM_CONDITIONAL(HAVE_PNG, test "x$LIBPNG" != x)
231AM_CONDITIONAL(HAVE_JPEG, test "x$LIBJPEG" != x)
232
233GDK_PIXBUF_LIBDIR='-L${libdir}'
234GDK_PIXBUF_INCLUDEDIR="-I${includedir}/gdk-pixbuf-1.0 $GTK_CFLAGS"
235GDK_PIXBUF_LIBS="$GLIB_LIBS -lgdk_pixbuf $GTK_LIBS"
236AC_SUBST(STATIC_LIB_DEPS)
237STATIC_LIB_DEPS="$deps"
238
239GDK_PIXBUF_XLIB_LIBDIR=$GDK_PIXBUF_LIBDIR
240GDK_PIXBUF_XLIB_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR
241GDK_PIXBUF_XLIB_LIBS="$GLIB_LIBS -lgdk_pixbuf_xlib $X11_LIBS"
242
243GNOMECANVASPIXBUF_LIBDIR=$GDK_PIXBUF_LIBDIR
244GNOMECANVASPIXBUF_INCLUDEDIR=$GDK_PIXBUF_INCLUDEDIR
245GNOMECANVASPIXBUF_LIBS="$GDK_PIXBUF_LIBS -lgnomecanvaspixbuf"
246
247AC_SUBST(GDK_PIXBUF_LIBDIR)
248AC_SUBST(GDK_PIXBUF_INCLUDEDIR)
249AC_SUBST(GDK_PIXBUF_LIBS)
250
251AC_SUBST(GDK_PIXBUF_XLIB_LIBDIR)
252AC_SUBST(GDK_PIXBUF_XLIB_INCLUDEDIR)
253AC_SUBST(GDK_PIXBUF_XLIB_LIBS)
254
255AC_SUBST(GNOMECANVASPIXBUF_LIBDIR)
256AC_SUBST(GNOMECANVASPIXBUF_INCLUDEDIR)
257AC_SUBST(GNOMECANVASPIXBUF_LIBS)
258
259##################################################
260# Checks for gtk-doc and docbook-tools
261##################################################
262
263AC_ARG_WITH(html-dir, [  --with-html-dir=PATH path to installed docs ])
264
265if test "x$with_html_dir" = "x" ; then
266  HTML_DIR='${datadir}/gnome/html'
267else
268  HTML_DIR=$with_html_dir
269fi
270
271AC_SUBST(HTML_DIR)
272
273AC_CHECK_PROG(GTKDOC, gtkdoc-mkdb, true, false)
274
275gtk_doc_min_version=0.6
276if $GTKDOC ; then
277    gtk_doc_version=`gtkdoc-mkdb --version`
278    AC_MSG_CHECKING([gtk-doc version ($gtk_doc_version) >= $gtk_doc_min_version])
279    if perl <<EOF ; then
280      exit (("$gtk_doc_version" =~ /^[[0-9]]+\.[[0-9]]+$/) &&
281            ("$gtk_doc_version" >= "$gtk_doc_min_version") ? 0 : 1);
282EOF
283      AC_MSG_RESULT(yes)
284   else
285      AC_MSG_RESULT(no)
286      GTKDOC=false
287   fi
288fi
289
290AM_CONDITIONAL(HAVE_GTK_DOC, $GTKDOC)
291AC_SUBST(HAVE_GTK_DOC)
292
293AC_CHECK_PROG(DB2HTML, db2html, true, false)
294AM_CONDITIONAL(HAVE_DOCBOOK, $DB2HTML)
295
296dnl Let people disable the gtk-doc stuff.
297AC_ARG_ENABLE(gtk-doc, [  --enable-gtk-doc  Use gtk-doc to build documentation [default=auto]], enable_gtk_doc="$enableval", enable_gtk_doc=auto)
298
299if test x$enable_gtk_doc = xauto ; then
300  if test x$GTKDOC = xtrue ; then
301    enable_gtk_doc=yes
302  else
303    enable_gtk_doc=no
304  fi
305fi
306
307dnl NOTE: We need to use a separate automake conditional for this
308dnl       to make this work with the tarballs.
309AM_CONDITIONAL(ENABLE_GTK_DOC, test x$enable_gtk_doc = xyes)
310
311#
312# Checks to see if we should compile in MMX support (there will be
313# a runtime test when the code is actually run to see if it should
314# be used - this just checks if we can compile it.)
315#
316# This code is partially taken from Mesa
317#
318dnl Let people disable the MMX optimization
319AC_ARG_ENABLE(mmx, [  --disable-mmx     Don't use MMX optimization [default=auto]], enable_mmx="$enableval", enable_mmx=auto)
320
321AC_MSG_CHECKING(for x86 platform)
322  case $host_cpu in
323    i386|i486|i586|i686|i786|k6|k7)
324        use_x86_asm=yes
325        ;;
326    *)
327        use_x86_asm=no
328  esac
329AC_MSG_RESULT($use_x86_asm)
330
331dnl Are we going to use MMX extensions
332use_mmx_asm=no
333
334AC_MSG_CHECKING(compiler support for MMX)
335
336if test x$enable_mmx = xauto ; then
337  if test $use_x86_asm = yes; then
338    save_ac_ext=$ac_ext
339    ac_ext=S
340   
341    cp $srcdir/gdk-pixbuf/pixops/scale_line_22_33_mmx.S conftest.S
342    if AC_TRY_EVAL(ac_compile); then
343        use_mmx_asm=yes
344    fi
345    dnl rm -f conftest.[oS]
346
347    ac_ext=$save_ac_ext
348  fi
349
350dnl Enforce usage of MMX extensions
351elif test x$enable_mmx = xyes ; then
352    use_mmx_asm=yes
353else
354    use_mmx_asm=no
355fi
356
357if test $use_mmx_asm = yes; then
358  AC_DEFINE(USE_MMX)
359  AC_MSG_RESULT(yes)
360else
361  AC_MSG_RESULT(no)
362fi
363
364AM_CONDITIONAL(USE_MMX, test x$use_mmx_asm = xyes)
365
366# Output files
367
368AC_OUTPUT([
369Makefile
370gdk-pixbuf.spec
371gdk-pixbuf/Makefile
372gdk-pixbuf/gdk-pixbuf-features.h
373gdk-pixbuf/pixops/Makefile
374gdk-pixbuf-config
375demo/Makefile
376doc/Makefile
377])
Note: See TracBrowser for help on using the repository browser.