eog/configure.in
Stanislav Brabec 2671d5346e Undef HAVE_STDDEF_H and HAVE_STDLIB_H in jpeglib.h test, otherwise file is
2001-06-13  Stanislav Brabec  <utx@penguin.cz>

	* configure.in: Undef HAVE_STDDEF_H and HAVE_STDLIB_H in
	jpeglib.h test, otherwise file is not sometimes detected.
	Still causes warning while compiling in such case.
2001-06-12 22:07:24 +00:00

302 lines
7.9 KiB
Plaintext

dnl Configure script for the Eye of Gnome image viewer
AC_INIT(shell/main.c)
AM_CONFIG_HEADER(config.h)
AM_INIT_AUTOMAKE(eog, 0.7)
AM_MAINTAINER_MODE
AM_PROG_XML_I18N_TOOLS
AM_ACLOCAL_INCLUDE(macros)
GNOME_INIT
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AC_ARG_PROGRAM
AM_PROG_LIBTOOL
GNOME_COMPILE_WARNINGS
ALL_LINGUAS="az ca cs da de el es et fi fr ga gl hu it ja ko lt nl no pl pt_BR ro ru sl sv tr uk zh_CN.GB2312 zh_TW.Big5"
AM_GNU_GETTEXT
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
AM_PATH_GDK_PIXBUF(0.9.0, ,AC_MSG_ERROR([Need gdk-pixbuf-0.9.0 or later!]))
AM_PATH_GCONF(0.12,,,gconf-gtk)
GCONF_CONFIG_SOURCE=
AC_ARG_ENABLE(gconf-source,
[ --enable-gconf-source=sourceaddress Where to install schema files.],GCONF_CONFIG_SOURCE=$enable_gconf_source,)
AC_DEFUN([AC_FYI], [echo "FYI: " $1])
# find the actual value for $prefix that we'll end up with
REAL_PREFIX=
if test "x$prefix" = "xNONE"; then
REAL_PREFIX=$ac_default_prefix
else
REAL_PREFIX=$prefix
fi
# Have to go $sysconfdir->$prefix/etc->/usr/local/etc
# if you actually know how to code shell then fix this :-)
SYSCONFDIR_TMP="$sysconfdir"
old_prefix=$prefix
prefix=$REAL_PREFIX
EXPANDED_SYSCONFDIR=`eval echo $SYSCONFDIR_TMP`
prefix=$old_prefix
AC_SUBST(EXPANDED_SYSCONFDIR)
if test "x$GCONF_CONFIG_SOURCE" = "x"; then
GCONF_CONFIG_SOURCE="xml::$EXPANDED_SYSCONFDIR/gconf/gconf.xml.defaults"
AC_FYI("Using default config source $GCONF_CONFIG_SOURCE for schema installation")
else
AC_FYI("Using config source $GCONF_CONFIG_SOURCE for schema installation")
fi
AC_SUBST(GCONF_CONFIG_SOURCE)
dnl ******************************
dnl Check for GnomePrint
dnl ******************************
have_gprint=false
AC_MSG_CHECKING(for GnomePrint libraries >= 0.25)
if gnome-config --libs print > /dev/null 2>&1; then
vers=`gnome-config --modversion print | sed -e "s/gnome-print-//" | \
awk 'BEGIN { FS = "."; } { print $1 * 1000 + $2;}'`
if test "$vers" -ge 25; then
AC_MSG_RESULT(found)
AC_DEFINE(ENABLE_GPRINT)
have_gprint=true
else
AC_MSG_RESULT(not found)
fi
fi
if test x$have_gprint != xtrue ; then
AC_MSG_ERROR(gnome-print >= 0.25 is required)
fi
dnl ******************************
dnl Check for Bonobo
dnl ******************************
have_bonobo=false
AC_MSG_CHECKING(for Bonobo >= 1.0.0)
if gnome-config --libs bonobo bonobox bonobox_print > /dev/null 2>&1; then
vers=`gnome-config --modversion bonobo | sed -e "s/bonobo-//" | \
sed s/bonobo-// | awk 'BEGIN { FS = "."; } { print $1 * 10000 + $2 * 100 + $3;}'`
if test "$vers" -ge 0010000; then
AC_MSG_RESULT(found)
have_bonobo=true
else
AC_MSG_RESULT(not found)
fi
fi
if test x$have_bonobo != xtrue ; then
AC_MSG_ERROR(bonobo >= 1.0.0 is required)
fi
AC_ARG_ENABLE(bonobo-filesel,
[ --enable-bonobo-filesel=[no/yes] Use the new bonobo file selector.],bonobo_filesel="$enableval",bonobo_filesel=no)
if test "x$bonobo_filesel" = "xyes"; then
AC_DEFINE(ENABLE_BONOBO_FILESEL)
fi
EXTRA_BONOBO_CFLAGS=`gnome-config --cflags bonobo bonobox bonobox_print print`
EXTRA_BONOBO_LIBS=`gnome-config --libs bonobo bonobox bonobox_print print`
AC_SUBST(EXTRA_BONOBO_CFLAGS)
AC_SUBST(EXTRA_BONOBO_LIBS)
dnl ******************************
dnl Check for GnomeVFS
dnl ******************************
have_vfs=false
AC_MSG_CHECKING(for GnomeVFS >= 1.0.0)
if gnome-config --libs vfs > /dev/null 2>&1; then
vers=`gnome-config --modversion vfs | sed -e "s/gnome-vfs-//" | \
awk 'BEGIN { FS = "."; } { print $1 * 10000 + $2 * 100 + $3;}'`
if test "$vers" -ge 0010000; then
AC_MSG_RESULT(found)
have_vfs=true
else
AC_MSG_RESULT(not found)
fi
fi
if test x$have_vfs != xtrue ; then
AC_MSG_ERROR(GnomeVFS >= 1.0.0 is required)
fi
EXTRA_VFS_CFLAGS=`gnome-config --cflags vfs`
EXTRA_VFS_LIBS=`gnome-config --libs vfs`
AC_SUBST(EXTRA_VFS_CFLAGS)
AC_SUBST(EXTRA_VFS_LIBS)
dnl ******************************
dnl LibGlade checking
dnl ******************************
AC_MSG_CHECKING(For Glade libraries)
if gnome-config --libs libglade > /dev/null 2>&1; then
AC_MSG_RESULT(found)
else
AC_MSG_ERROR(Did not find libGlade installed)
fi
EXTRA_GNOME_CFLAGS=`gnome-config --cflags libglade gnomecanvaspixbuf gdk_pixbuf gnomeui`
EXTRA_GNOME_LIBS=`gnome-config --libs libglade gnomecanvaspixbuf gdk_pixbuf gnomeui`
AC_SUBST(EXTRA_GNOME_CFLAGS)
AC_SUBST(EXTRA_GNOME_LIBS)
dnl ******************************
dnl Check for OAF
dnl ******************************
AM_PATH_OAF(0.6.2)
AC_SUBST(OAF_LIBS)
AC_SUBST(OAF_CFLAGS)
dnl
dnl ******************************
dnl Image Libraries
dnl ******************************
jpeg_ok=no
dnl Test for libjpeg
if test -z "$LIBJPEG"; then
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
jpeg_ok=yes,
jpeg_ok=no
AC_MSG_WARN(*** JPEG saving code will not be built (JPEG library not found) ***))
if test "$jpeg_ok" = yes; then
AC_MSG_CHECKING([for jpeglib.h])
AC_TRY_CPP(
[#include <stdio.h>
#undef PACKAGE
#undef VERSION
#undef HAVE_STDDEF_H
#undef HAVE_STDLIB_H
#include <jpeglib.h>],
jpeg_ok=yes,
jpeg_ok=no)
AC_MSG_RESULT($jpeg_ok)
if test "$jpeg_ok" = yes; then
LIBJPEG='-ljpeg'
AC_CHECK_LIB(jpeg, jpeg_simple_progression,
AC_DEFINE(HAVE_PROGRESSIVE_JPEG),
AC_MSG_WARN(JPEG library does not support progressive saving.))
else
AC_MSG_WARN(*** JPEG saving code will not be built (JPEG header file not found) ***)
fi
fi
fi
if test "x$jpeg_ok" = "xyes" ; then
AC_DEFINE(HAVE_JPEG)
fi
png_ok=no
dnl Test for libpng
if test -z "$LIBPNG"; then
AC_CHECK_LIB(png, png_read_info,
AC_CHECK_HEADER(png.h,
png_ok=yes,
png_ok=no),
AC_MSG_WARN(*** PNG saving code will not be built (PNG library not found) ***), -lz -lm)
if test "$png_ok" = yes; then
AC_MSG_CHECKING([for png_structp in png.h])
AC_TRY_COMPILE([#include <png.h>],
[png_structp pp; png_infop info; png_colorp cmap; png_create_read_struct;],
png_ok=yes,
png_ok=no)
AC_MSG_RESULT($png_ok)
if test "$png_ok" = yes; then
PNG='png'; LIBPNG='-lpng -lz'
else
AC_MSG_WARN(*** PNG saving code will not be built (PNG library is too old) ***)
fi
else
AC_MSG_WARN(*** PNG saving code will not be built (PNG header file not found) ***)
fi
fi
if test "x$png_ok" = "xyes" ; then
AC_DEFINE(HAVE_PNG)
fi
AC_SUBST(LIBJPEG)
AC_SUBST(LIBPNG)
dnl ******************************
dnl More compiler warnings
dnl ******************************
AC_ARG_ENABLE(more-warnings,
[ --enable-more-warnings Maximum compiler warnings],
set_more_warnings="$enableval",[set_more_warnings=no])
warning_flags=
realsave_CFLAGS="$CFLAGS"
AC_MSG_CHECKING(for more warnings, including -Werror)
if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then
AC_MSG_RESULT(yes)
warning_flags="-Wall -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -Wnested-externs -Wpointer-arith -Werror"
CFLAGS="$warning_flags $CFLAGS"
for option in -Wsign-promo -Wno-sign-compare; do
SAVE_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $option"
AC_MSG_CHECKING([whether gcc understands $option])
AC_TRY_COMPILE([], [],
has_option=yes,
has_option=no,)
CFLAGS="$SAVE_CFLAGS"
AC_MSG_RESULT($has_option)
if test $has_option = yes; then
warning_flags="$warning_flags $option"
fi
unset has_option
unset SAVE_CFLAGS
done
unset option
else
AC_MSG_RESULT(no)
fi
CFLAGS="$realsave_CFLAGS"
EXTRA_WARNING_CFLAGS="$warning_flags"
AC_SUBST(EXTRA_WARNING_CFLAGS)
AC_OUTPUT([
Makefile
eog.spec
art/Makefile
intl/Makefile
macros/Makefile
po/Makefile.in
libeog/Makefile
libeog/cursors/Makefile
libeog/stock/Makefile
idl/Makefile
viewer/Makefile
doc/Makefile
doc/C/Makefile
shell/Makefile
collection/Makefile
])
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Use Bonobo File Selector: $bonobo_filesel
Extra Compiler Warnings: ${EXTRA_WARNING_CFLAGS}
"