configure.in 9.99 KB
Newer Older
Paolo Bacchilega's avatar
Paolo Bacchilega committed
1 2 3 4
dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.52)

5
AC_INIT(gthumb, 2.11.0, http://bugzilla.gnome.org/enter_bug.cgi?product=gthumb)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
6 7
AC_CONFIG_SRCDIR(src/main.c)
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
8

Paolo Bacchilega's avatar
Paolo Bacchilega committed
9 10
AM_CONFIG_HEADER(config.h)

11
AM_PROG_LIBTOOL
12 13
AM_PROG_LEX
AC_PROG_YACC
14

15 16 17
AC_CONFIG_MACRO_DIR([m4])
GNOME_DOC_INIT

Paolo Bacchilega's avatar
Paolo Bacchilega committed
18 19 20 21 22 23 24
dnl ==========================================================================
dnl
dnl If you add a version number here, you *must* add an AC_SUBST line for
dnl it too, or it will never make it into the spec file!
dnl
dnl ==========================================================================

25 26
GLIB_REQUIRED=2.19.0
GTK_REQUIRED=2.16.0
Paolo Bacchilega's avatar
Paolo Bacchilega committed
27
LIBXML_REQUIRED=2.4.0
Paolo Bacchilega's avatar
Paolo Bacchilega committed
28 29
LIBGNOME_REQUIRED=2.6.0
LIBGNOMEUI_REQUIRED=2.6.0
30
GNOME_DESKTOP_REQUIRED=2.25.1
Paolo Bacchilega's avatar
Paolo Bacchilega committed
31
LIBGNOMECANVAS_REQUIRED=2.6.0
32
GIO_REQUIRED=2.16.1
Paolo Bacchilega's avatar
Paolo Bacchilega committed
33 34
GNOME_VFS_REQUIRED=2.6.0
LIBGLADE_REQUIRED=2.4.0
35
BONOBO_REQUIRED=2.6.0
36
LIBOPENRAW_REQUIRED=0.0.4
37
EXIV2_REQUIRED=0.18
38
GSTREAMER_REQUIRED=0.10.15
Paolo Bacchilega's avatar
Paolo Bacchilega committed
39 40 41 42 43 44 45

AC_SUBST(GLIB_REQUIRED)
AC_SUBST(GTK_REQUIRED)
AC_SUBST(LIBXML_REQUIRED)
AC_SUBST(LIBGNOME_REQUIRED)
AC_SUBST(LIBGNOMEUI_REQUIRED)
AC_SUBST(LIBGNOMECANVAS_REQUIRED)
46
AC_SUBST(GIO_REQUIRED)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
47 48
AC_SUBST(GNOME_VFS_REQUIRED)
AC_SUBST(LIBGLADE_REQUIRED)
49
AC_SUBST(BONOBO_REQUIRED)
50
AC_SUBST(LIBOPENRAW_REQUIRED)
51
AC_SUBST(EXIV2_REQUIRED)
52
AC_SUBST(GSTREAMER_REQUIRED)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
53

54 55
AM_PATH_ORBIT2

Paolo Bacchilega's avatar
Paolo Bacchilega committed
56 57
dnl ===========================================================================

Paolo Bacchilega's avatar
Paolo Bacchilega committed
58 59 60 61 62 63 64
PKG_CHECK_MODULES(GTHUMB,				\
	glib-2.0 >= $GLIB_REQUIRED			\
	gthread-2.0					\
	gmodule-2.0					\
	gtk+-2.0 >= $GTK_REQUIRED			\
	libgnome-2.0 >= $LIBGNOME_REQUIRED		\
	libgnomeui-2.0 >= $LIBGNOMEUI_REQUIRED		\
65
	gnome-desktop-2.0 >= $GNOME_DESKTOP_REQUIRED	\
Paolo Bacchilega's avatar
Paolo Bacchilega committed
66
	libgnomecanvas-2.0 >= $LIBGNOMECANVAS_REQUIRED	\
67 68 69
	libbonobo-2.0 >= $BONOBO_REQUIRED		\
	libbonoboui-2.0 >= $BONOBO_REQUIRED		\
	bonobo-activation-2.0 >= $BONOBO_REQUIRED	\
70
	gio-2.0 >= $GIO_REQUIRED			\
Paolo Bacchilega's avatar
Paolo Bacchilega committed
71 72
	gnome-vfs-2.0 >= $GNOME_VFS_REQUIRED		\
	gnome-vfs-module-2.0				\
73
	exiv2 >= $EXIV2_REQUIRED			\
Paolo Bacchilega's avatar
Paolo Bacchilega committed
74
	libxml-2.0 >= $LIBXML_REQUIRED			\
75
	libglade-2.0 >= $LIBGLADE_REQUIRED)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
76 77 78 79 80
AC_SUBST(GTHUMB_LIBS)
AC_SUBST(GTHUMB_CFLAGS)

AC_C_BIGENDIAN
AC_PROG_CPP
81
AC_PROG_CXX
Paolo Bacchilega's avatar
Paolo Bacchilega committed
82

83
#
Paolo Bacchilega's avatar
Paolo Bacchilega committed
84
# Checks for libjpeg
85
#
86 87
AC_MSG_CHECKING(JPEG Support)
AC_MSG_RESULT()
88

89
AC_CHECK_LIB(jpeg, jpeg_destroy_decompress,
90 91
	     [AC_CHECK_HEADER(jpeglib.h,,[AC_MSG_ERROR([*** JPEG headers not found ***])])],
	     [AC_MSG_ERROR([*** JPEG library not found ***])])
92

93
AC_CHECK_LIB(jpeg, jpeg_simple_progression,
94 95
	     [AC_DEFINE(HAVE_PROGRESSIVE_JPEG, 1, [Define to 1 if libjpeg supports progressive JPEG.])],
	     [AC_MSG_WARN(JPEG library does not support progressive saving.)])
96

97
AC_DEFINE(HAVE_LIBJPEG, 1, [Define to 1 if libjpeg support is included])
98

99 100
JPEG_LIBS='-ljpeg -lm -lz'
AC_SUBST(JPEG_LIBS)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
101 102


103
#
Paolo Bacchilega's avatar
Paolo Bacchilega committed
104
# Checks for libtiff
105
#
106
AC_ARG_ENABLE([tiff],
107 108
	      [AC_HELP_STRING([--disable-tiff],[disable support for tiff])],,
	      [enable_tiff=yes])
109

110
HAVE_TIFF=no
111 112 113 114
if test x$enable_tiff = xyes ; then
   AC_MSG_CHECKING(TIFF Support)
   AC_MSG_RESULT()
   AC_CHECK_LIB(tiff, TIFFWriteScanline,
115 116 117 118 119 120
		[AC_CHECK_HEADER(tiffio.h,
				 AC_DEFINE(HAVE_LIBTIFF, 1, [Define to 1 if libtiff support is included])
				 TIFF_LIBS='-ltiff -lm -lz'
				 HAVE_TIFF=yes
				 ,[AC_MSG_WARN([*** TIFF headers not found ***])])],
		[AC_MSG_WARN([*** TIFF library not found ***])])
121 122
   AC_SUBST(TIFF_LIBS)
fi
Paolo Bacchilega's avatar
Paolo Bacchilega committed
123 124


125 126 127 128 129 130 131 132 133 134 135 136 137 138
#
# Checks for Xtest
#
have_xtest=false
XTEST_LIBS=""
AC_CHECK_LIB(Xtst, XTestFakeKeyEvent,
    have_xtest=true,:,-lX11 -lXtst $GTHUMB_LIBS)
if $have_xtest ; then
   XTEST_LIBS="-lX11 -lXtst"
   AC_DEFINE(HAVE_XTEST, 1, [Have XTest])
fi
AC_SUBST(XTEST_LIBS)


139 140 141 142
#
# Checks for libopenraw
#
AC_ARG_ENABLE([libopenraw],
143 144
	      [AC_HELP_STRING([--disable-libopenraw],[disable support for libopenraw])],,
	      [enable_libopenraw=yes])
145 146 147
HAVE_LIBOPENRAW=no
if test x$enable_libopenraw = xyes ; then
   PKG_CHECK_MODULES(LIBOPENRAW, libopenraw-gnome-1.0 >= $LIBOPENRAW_REQUIRED,
148 149 150
		     [AC_DEFINE(HAVE_LIBOPENRAW, 1, [Define to 1 to enable libopenraw support])
		      HAVE_LIBOPENRAW=yes],
		     [HAVE_LIBOPENRAW=no])
151
fi
Paolo Bacchilega's avatar
Paolo Bacchilega committed
152

153 154 155 156 157
#
# Checks for GDK X11 support; may not be present on MAC OS / Quartz systems
#
HAVE_GDKX=no
PKG_CHECK_MODULES(GDKX, gdk-x11-2.0,
158 159
		  [AC_DEFINE(HAVE_GDKX, 1, [Define to 1 if X11 support is included])
		   HAVE_GDKX=yes],
160
		  [AC_MSG_WARN(Disabling GDK/X11-dependent features and Xrender.)])
161

162

163 164 165 166 167 168 169 170 171 172 173 174 175 176 177
#
# check for gstreamer
#
AC_ARG_ENABLE([gstreamer],
              [AC_HELP_STRING([--disable-gstreamer], [Disable gstreamer metadata extraction])],,
              [enable_gstreamer=yes])
HAVE_GSTREAMER=no
if test "x$enable_gstreamer" = "xyes"; then
   PKG_CHECK_MODULES(GSTREAMER, gstreamer-0.10 >= $GSTREAMER_REQUIRED,
                     [AC_DEFINE(HAVE_GSTREAMER, 1, [Define to 1 to enable gstreamer support])
                      HAVE_GSTREAMER=yes],
                     [HAVE_GSTREAMER=no])
fi


178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196
#
# Checks for Xft/XRender
#
AC_ARG_ENABLE([render],
	      [AC_HELP_STRING([--disable-render],[disable support for Xrender])],,
	      [enable_render=yes])

HAVE_RENDER=no
if (test x$enable_render = xyes) && (test $HAVE_GDKX = yes); then
   AC_MSG_CHECKING(Xrender Support)
   AC_MSG_RESULT()
   AC_CHECK_LIB(Xrender, XRenderFindFormat,
                AC_DEFINE(HAVE_RENDER, 1, [Define to 1 if Xft/XRender support is included])
                RENDER_LIBS='-lXrender -lXext'
                HAVE_RENDER=yes
                ,,[-lXext $GTHUMB_LIBS])
   AC_SUBST(RENDER_LIBS)
fi

197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214
#
# Checks for Mac OS X menubar integration
#
AC_ARG_ENABLE([macos-menu],
              [AC_HELP_STRING([--disable-macos-menu],[disable support for Mac OS X menubar integration])],,
              [enable_macosmenu=yes])

HAVE_MACOSMENU=no
if test "x$enable_macosmenu" = "xyes"; then
   PKG_CHECK_MODULES(IGE_MAC_INTEGRATION, ige-mac-integration,
                     [AC_DEFINE(USE_MACOSMENU, 1, [Build with Mac OS X menubar integration])
                      HAVE_MACOSMENU=yes],
                     [HAVE_MACOSMENU=no])
fi

AM_CONDITIONAL(USE_IGE_MAC_INTEGRATION, test "x$HAVE_IGE-MAC-INTEGRATION" = "xyes")
AC_SUBST(IGE_MAC_INTEGRATION_CFLAGS)
AC_SUBST(IGE_MAC_INTEGRATION_LIBS)
215

Paolo Bacchilega's avatar
Paolo Bacchilega committed
216 217
dnl ###############################################

218 219 220 221 222 223
IDL_MODULES="bonobo-activation-2.0 libbonobo-2.0 libbonoboui-2.0"
IDL_INCLUDES="`$PKG_CONFIG --variable=idldir $IDL_MODULES | $srcdir/add-include-prefix`"
AC_SUBST(IDL_INCLUDES)


dnl ###############################################
224

Paolo Bacchilega's avatar
Paolo Bacchilega committed
225 226 227
AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)

228 229 230 231

dnl ###############################################

IT_PROG_INTLTOOL([0.35.0])
232
GETTEXT_PACKAGE=gthumb
233 234
AC_SUBST([GETTEXT_PACKAGE])
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
Paolo Bacchilega's avatar
Paolo Bacchilega committed
235 236 237 238
AM_GLIB_GNU_GETTEXT


if test "x${prefix}" = "xNONE"; then
Paolo Bacchilega's avatar
Paolo Bacchilega committed
239
  AC_DEFINE_UNQUOTED(LOCALEDIR, "${ac_default_prefix}/${DATADIRNAME}/locale", [Locale directory])
Paolo Bacchilega's avatar
Paolo Bacchilega committed
240
else
Paolo Bacchilega's avatar
Paolo Bacchilega committed
241
  AC_DEFINE_UNQUOTED(LOCALEDIR, "${prefix}/${DATADIRNAME}/locale", [Locale directory])
Paolo Bacchilega's avatar
Paolo Bacchilega committed
242 243 244 245
fi

dnl ******************************

Paolo Bacchilega's avatar
Paolo Bacchilega committed
246
AC_ARG_ENABLE(deprecations,AC_HELP_STRING([--enable-deprecations],[warn about deprecated usages]))
247 248 249 250 251 252 253 254 255 256 257
if test "x$enable_deprecations" = "xyes"; then
        DISABLE_DEPRECATED="-DG_DISABLE_DEPRECATED \
        -DGDK_DISABLE_DEPRECATED \
        -DGDK_PIXBUF_DISABLE_DEPRECATED \
        -DGTK_DISABLE_DEPRECATED \
        -DGNOME_VFS_DISABLE_DEPRECATED \
        -DGNOME_DISABLE_DEPRECATED"
        AC_SUBST(DISABLE_DEPRECATED)
fi

dnl ******************************
Paolo Bacchilega's avatar
Paolo Bacchilega committed
258

259
WARN_CFLAGS="-Wall \ 
260 261
-Wpointer-arith -Wcast-align -Wtype-limits \
-Wclobbered -Wempty-body -Wignored-qualifiers"
262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278

for option in $WARN_CFLAGS; do
        SAVE_CFLAGS="$CFLAGS"
        CFLAGS="$CFLAGS $option"
        AC_MSG_CHECKING([whether gcc understands $option])
        AC_TRY_COMPILE([], [],
                       has_option=yes,
                       has_option=no,)
        if test x$has_option = xyes; then
                WARNINGS="$WARNINGS $option"
        fi
        AC_MSG_RESULT($has_option)
        CFLAGS="$SAVE_CFLAGS"
        unset has_option
        unset SAVE_CFLAGS
done
unset option
279
AC_SUBST(WARNINGS)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
280 281 282

dnl ******************************

Paolo Bacchilega's avatar
Paolo Bacchilega committed
283 284
AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
if test x"$GCONFTOOL" = xno; then
285
	AC_MSG_ERROR([gconftool-2 executable not found in your path - should be
Paolo Bacchilega's avatar
Paolo Bacchilega committed
286 287 288 289 290 291
installed with GConf])
fi
AM_GCONF_SOURCE_2

dnl ******************************

292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322
AC_MSG_CHECKING([for some Win32 platform])
case "$host" in
  *-*-cygwin*|*-*-mingw*)
    platform_win32=yes
    ;;
  *)
    platform_win32=no
    ;;
esac
AC_MSG_RESULT([$platform_win32])
AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = "yes")

AC_MSG_CHECKING([for native Win32])
case "$host" in
  *-*-mingw*)
    os_win32=yes
    ;;
  *)
    os_win32=no
    ;;
esac
AC_MSG_RESULT([$os_win32])
AM_CONDITIONAL(OS_WIN32, test "$os_win32" = "yes")

dnl ******************************

if test "$platform_win32" = "yes" ; then
	MODULE_LIBTOOL_FLAGS='-module -avoid-version -no-undefined -Wl,$(top_builddir)/src/.libs/gthumb.exe.a'
else
	MODULE_LIBTOOL_FLAGS='-module -avoid-version'
fi
323
AC_SUBST(MODULE_LIBTOOL_FLAGS)
Paolo Bacchilega's avatar
Paolo Bacchilega committed
324 325 326 327 328 329 330

AC_OUTPUT([
Makefile
po/Makefile.in
libgthumb/Makefile
libgthumb/cursors/Makefile
libgthumb/icons/Makefile
331
libgthumb/jpegutils/Makefile
Paolo Bacchilega's avatar
Paolo Bacchilega committed
332 333 334
src/Makefile
src/icons/Makefile
doc/Makefile
335 336
data/Makefile
data/albumthemes/Makefile
337
data/albumthemes/BestFit/Makefile
338 339
data/albumthemes/Classic/Makefile
data/albumthemes/ClassicClips/Makefile
340
data/albumthemes/Flicker/Makefile
341
data/albumthemes/NeatRound/Makefile
342
data/albumthemes/Wiki/Makefile
343
data/glade/Makefile
344 345 346 347 348 349 350 351 352 353 354
data/icons/Makefile
data/icons/16x16/Makefile
data/icons/16x16/apps/Makefile
data/icons/22x22/Makefile
data/icons/22x22/apps/Makefile
data/icons/32x32/Makefile
data/icons/32x32/apps/Makefile
data/icons/48x48/Makefile
data/icons/48x48/apps/Makefile
data/icons/scalable/Makefile
data/icons/scalable/apps/Makefile
Paolo Bacchilega's avatar
Paolo Bacchilega committed
355 356 357 358 359 360
])

echo "

Configuration:

361 362
	Source code location:     ${srcdir}
	Compiler:                 ${CC}
363
	Have gdk-x11:		  ${HAVE_GDKX}
364 365
	Have XRender:             ${HAVE_RENDER}
	Have XTest:               ${have_xtest}
366
	Have libtiff:             ${HAVE_TIFF}
367
	Have libopenraw:          ${HAVE_LIBOPENRAW}
368
	Have gstreamer:           ${HAVE_GSTREAMER}
369
	Use Mac OS X menu:        ${HAVE_MACOSMENU}
Paolo Bacchilega's avatar
Paolo Bacchilega committed
370 371

"