eog/configure.in
2002-02-05 09:30:07 +00:00

247 lines
6.3 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.110.0)
AM_MAINTAINER_MODE
GNOME_PLATFORM_GNOME_2(yes)
AC_PROG_CC
AC_ISC_POSIX
AC_HEADER_STDC
AC_ARG_PROGRAM
GNOME_COMPILE_WARNINGS
dnl ===============================================================================
GETTEXT_PACKAGE=eog
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE, "$GETTEXT_PACKAGE")
AC_SUBST(GETTEXT_PACKAGE)
ALL_LINGUAS="az ca cs da de el es et fi fr ga gl hu it ja ko lt ms nl nn no pl pt pt_BR ro ru sl sk sv tr uk zh_CN zh_TW"
AM_GLIB_GNU_GETTEXT
AC_PROG_INTLTOOL
dnl ===============================================================================
AC_SUBST(CFLAGS)
AC_SUBST(CPPFLAGS)
AC_SUBST(LDFLAGS)
ORBIT_IDL="`$PKG_CONFIG --variable=orbit_idl ORBit-2.0`"
AC_SUBST(ORBIT_IDL)
BONOBO_IDLDIR="`$PKG_CONFIG --variable=idldir libbonobo-2.0`"
AC_SUBST(BONOBO_IDLDIR)
BONOBO_ACT_IDLDIR="`$PKG_CONFIG --variable=idldir bonobo-activation-2.0`"
AC_SUBST(BONOBO_ACT_IDLDIR)
AC_PATH_PROG(GCONFTOOL, gconftool-2)
dnl Specify the gconf configuration source,
dnl default to xml::$(sysconfdir)/gconf/gconf.xml.defaults
GCONF_CONFIG_SOURCE=
AC_ARG_ENABLE(gconf-source, [ --enable-gconf-source=sourceaddress Where to install schema files.], GCONF_CONFIG_SOURCE=$enable_gconf_source,)
if test "x$GCONF_CONFIG_SOURCE" = "x"; then
GCONF_CONFIG_SOURCE="xml::\${sysconfdir}/gconf/gconf.xml.defaults"
fi
AC_SUBST(GCONF_CONFIG_SOURCE)
AC_SUBST(INSTALL_GCONF_CONFIG_SOURCE)
dnl ******************************
dnl Check for evolution
dnl ******************************
try_evolution=false
evolution=no
AC_ARG_WITH(evolution,
[ --{with,without}-evolution Use evolution to send images.],
if test x$withval = xno; then
try_evolution=false
fi
)
try_evolution=false
if $try_evolution; then
path_to_composer_idl=`gnome-config --datadir`/idl/Evolution-Composer.idl
AC_CHECK_FILE($path_to_composer_idl, evolution=yes, evolution=no)
if test x"$evolution" = "xyes"; then
AC_DEFINE(ENABLE_EVOLUTION)
fi
fi
dnl
dnl We need to port Evolution to Gnome 2.0 first.
dnl
evolution=no
AM_CONDITIONAL(ENABLE_EVOLUTION, false)
dnl ******************************
dnl Check for GnoCam
dnl ******************************
try_gnocam=true
gnocam=no
AC_ARG_WITH(gnocam,
[ --{with,without}-gnocam Use gnocam to acquire images.],
if test x$withval = xno; then
try_gnocam=false
fi
)
if $try_gnocam; then
path_to_gnocam_idl=`gnome-config --datadir`/idl/GnoCam.idl
AC_CHECK_FILE($path_to_gnocam_idl, gnocam=yes, gnocam=no)
if test x"$gnocam" = "xyes"; then
AC_DEFINE(ENABLE_GNOCAM)
fi
fi
AM_CONDITIONAL(ENABLE_GNOCAM, test x"$gnocam" = "xyes")
EOG_MODULES="gnome-vfs-2.0 libgnomeprint-2.0 libgnomeui-2.0 libbonoboui-2.0 bonobo-activation-2.0"
EOG_CFLAGS=`$PKG_CONFIG --cflags $EOG_MODULES`
EOG_LIBS=`$PKG_CONFIG --libs $EOG_MODULES`
AC_SUBST(EOG_CFLAGS)
AC_SUBST(EOG_LIBS)
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
libeog/Makefile
libeog/cursors/Makefile
libeog/stock/Makefile
viewer/Makefile
idl/Makefile
doc/Makefile
doc/C/Makefile
shell/Makefile
po/Makefile.in
])
echo "
Configuration:
Source code location: ${srcdir}
Compiler: ${CC}
Use Evolution: $evolution
Use GnoCam: $gnocam
Extra Compiler Warnings: ${EXTRA_WARNING_CFLAGS}
"