1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 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 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446
|
AC_INIT(gnome-commander, 1.2.8.15, http://bugzilla.gnome.org/enter_bug.cgi?product=gnome-commander)
AC_CONFIG_SRCDIR(src/gnome-cmd-includes.h)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
GNOME_DOC_INIT
AM_MAINTAINER_MODE
AM_CONFIG_HEADER(config.h)
AC_GNU_SOURCE
AC_PROG_CC
AC_PROG_CXX
AM_PROG_LEX
AM_PROG_LIBTOOL
IT_PROG_INTLTOOL([0.35.0])
dnl make sure we keep ACLOCAL_FLAGS around for maintainer builds to work
AC_SUBST(ACLOCAL_AMFLAGS, "$ACLOCAL_FLAGS -I m4")
dnl add -Wall to CFLAGS when using gcc
CC_WARNINGS=
if test "x$GCC" = "xyes"; then
CC_WARNINGS="-Wall"
fi
AC_SUBST(CC_WARNINGS)
dnl ===================
dnl Gettext stuff
dnl ===================
GETTEXT_PACKAGE=gnome-commander
AC_SUBST(GETTEXT_PACKAGE)
AM_GLIB_GNU_GETTEXT
dnl ===================
dnl Check for libraries
dnl ===================
GLIB_REQ=2.6.0
GMODULE_REQ=2.0.0
GTK_REQ=2.8.0
GNOME_REQ=2.0.0
GNOMEUI_REQ=2.4.0
GNOMEVFS_REQ=2.0.0
PYTHON_REQ=2.4
EXIV2_REQ=0.14
TAGLIB_REQ=1.4
LIBGSF_REQ=1.12.0
POPPLER_REQ=0.6
AC_SUBST(GLIB_REQ)
AC_SUBST(GTK_REQ)
AC_SUBST(GNOME_REQ)
AC_SUBST(GNOMEUI_REQ)
AC_SUBST(GNOMEVFS_REQ)
AC_SUBST(PYTHON_REQ)
AC_SUBST(EXIV2_REQ)
AC_SUBST(TAGLIB_REQ)
AC_SUBST(LIBGSF_REQ)
AC_SUBST(POPPLER_REQ)
dnl Check for glib
AC_MSG_CHECKING(if glib >= ${GLIB_REQ} exists)
if pkg-config --exists glib-2.0 ; then
GLIB_CFLAGS=`pkg-config --cflags glib-2.0`
GLIB_LIBS=`pkg-config --libs glib-2.0`
GLIB_PREFIX=`pkg-config --variable=prefix glib-2.0`
GLIB_VERSION=`pkg-config --modversion glib-2.0`
AC_SUBST(GLIB_VERSION)
AC_SUBST(GLIB_PREFIX)
AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_LIBS)
if pkg-config --exists glib-2.0 '>=' ${GLIB_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${GLIB_VERSION} found")
fi
else
AC_MSG_ERROR(no)
fi
dnl Check for gmodule
AC_MSG_CHECKING(if gmodule >= ${GMODULE_REQ} exists)
if pkg-config --exists gmodule-2.0 ; then
if pkg-config --exists gmodule-2.0 '>=' ${GMODULE_REQ} ; then
AC_MSG_RESULT(yes)
GMODULE_AVAIL="yes"
else
AC_MSG_ERROR("only `pkg-config --modversion gmodule-2.0` found")
GMODULE_AVAIL="no"
fi
else
AC_MSG_ERROR(no)
GMODULE_AVAIL="no"
fi
AC_SUBST(GMODULE_AVAIL)
dnl Check for gtk+
AC_MSG_CHECKING(if gtk+ >= ${GTK_REQ} exists)
if pkg-config --exists gtk+-2.0 ; then
GTK_CFLAGS=`pkg-config --cflags gtk+-2.0`
GTK_LIBS=`pkg-config --libs gtk+-2.0`
GTK_PREFIX=`pkg-config --variable=prefix gtk+-2.0`
GTK_VERSION=`pkg-config --modversion gtk+-2.0`
AC_SUBST(GTK_VERSION)
AC_SUBST(GTK_PREFIX)
AC_SUBST(GTK_CFLAGS)
AC_SUBST(GTK_LIBS)
if pkg-config --exists gtk+-2.0 '>=' ${GTK_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${GTK_VERSION} found")
fi
else
AC_MSG_ERROR(no)
fi
dnl Check for libgnome
AC_MSG_CHECKING(if libgnome >= ${GNOME_REQ} exists)
if pkg-config --exists libgnome-2.0 ; then
GNOME_CFLAGS=`pkg-config --cflags libgnome-2.0`
GNOME_LIBS=`pkg-config --libs libgnome-2.0`
GNOME_PREFIX=`pkg-config --variable=prefix libgnome-2.0`
GNOME_VERSION=`pkg-config --modversion libgnome-2.0`
AC_SUBST(GNOME_VERSION)
AC_SUBST(GNOME_PREFIX)
AC_SUBST(GNOME_LIBS)
AC_SUBST(GNOME_CFLAGS)
if pkg-config --exists libgnome-2.0 '>=' ${GNOME_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${GNOME_VERSION} found")
fi
else
AC_MSG_ERROR(no)
fi
dnl Check for libgnomeui
AC_MSG_CHECKING(if libgnomeui >= ${GNOMEUI_REQ} exists)
if pkg-config --exists libgnomeui-2.0 ; then
GNOMEUI_CFLAGS=`pkg-config --cflags libgnomeui-2.0`
GNOMEUI_LIBS=`pkg-config --libs libgnomeui-2.0`
GNOMEUI_PREFIX=`pkg-config --variable=prefix libgnomeui-2.0`
GNOMEUI_VERSION=`pkg-config --modversion libgnomeui-2.0`
AC_SUBST(GNOMEUI_VERSION)
AC_SUBST(GNOMEUI_PREFIX)
AC_SUBST(GNOMEUI_CFLAGS)
AC_SUBST(GNOMEUI_LIBS)
if pkg-config --exists libgnomeui-2.0 '>=' ${GNOMEUI_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${GNOMEUI_VERSION} found")
fi
else
AC_MSG_ERROR(no)
fi
dnl Check for gnome-vfs
AC_MSG_CHECKING(if gnome-vfs >= ${GNOMEVFS_REQ} exists)
if pkg-config --exists gnome-vfs-2.0 ; then
GNOMEVFS_CFLAGS=`pkg-config --cflags gnome-vfs-2.0`
GNOMEVFS_LIBS=`pkg-config --libs gnome-vfs-2.0`
GNOMEVFS_PREFIX=`pkg-config --variable=prefix gnome-vfs-2.0`
GNOMEVFS_VERSION=`pkg-config --modversion gnome-vfs-2.0`
AC_SUBST(GNOMEVFS_VERSION)
AC_SUBST(GNOMEVFS_PREFIX)
AC_SUBST(GNOMEVFS_CFLAGS)
AC_SUBST(GNOMEVFS_LIBS)
if pkg-config --exists gnome-vfs-2.0 '>=' ${GNOMEVFS_REQ} ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR("only ${GNOMEVFS_VERSION} found")
fi
else
AC_MSG_ERROR(no)
fi
dnl Check for exiv2 support
AC_ARG_WITH(libexiv2, [ --without-exiv2 disable EXIF and IPTC support])
have_exiv2=no
if test x$with_exiv2 != xno; then
PKG_CHECK_MODULES(EXIV2, exiv2 >= $EXIV2_REQ, have_exiv2=yes, have_exiv2=no)
fi
if test "x$have_exiv2" = "xyes"; then
AC_DEFINE(HAVE_EXIV2, 1, [Define to 1 if you have EXIF and IPTC support])
fi
dnl Check for taglib support
AC_ARG_WITH(taglib, [ --without-taglib disable taglib (ID3, Vorbis, APE and FLAC) support])
have_taglib=no
if test x$with_taglib != xno; then
PKG_CHECK_MODULES(TAGLIB, taglib >= $TAGLIB_REQ, have_taglib=yes, have_taglib=no)
fi
if test "x$have_taglib" = "xyes"; then
AC_DEFINE(HAVE_ID3, 1, [Define to 1 if you have taglib (ID3, Vorbis, APE and FLAC) support])
fi
dnl Check for libchm support
AC_ARG_WITH(libchm, [ --without-libchm disable CHM support])
have_chm=no
AC_CHECK_LIB(chm, chm_open, have_chm=yes, have_chm=no)
AM_CONDITIONAL(HAVE_CHM, test "x$have_chm" = "xyes")
dnl Check for libgsf support
AC_ARG_WITH(libgsf, [ --without-libgsf disable OLE and ODF support])
have_gsf=no
if test x$with_libgsf != xno; then
PKG_CHECK_MODULES(GSF, libgsf-1 >= $LIBGSF_REQ, have_gsf=yes, have_gsf=no)
fi
if test "x$have_gsf" = "xyes"; then
AC_DEFINE(HAVE_GSF, 1, [Define to 1 if you have libgsf (OLE and ODF) support])
fi
dnl Check for poppler support
AC_ARG_WITH(poppler, [ --without-poppler disable PDF support])
have_pdf=no
if test x$with_poppler != xno; then
PKG_CHECK_MODULES(POPPLER, poppler >= $POPPLER_REQ, have_pdf=yes, have_pdf=no)
if pkg-config --max-version=0.11.2 poppler; then
AC_DEFINE(POPPLER_HAS_GET_PDF_VERSION, 1, [Define to 1 if poppler has support for PDFDoc::getPDFVersion()])
fi
fi
if test "x$have_pdf" = "xyes"; then
AC_DEFINE(HAVE_PDF, 1, [Define to 1 if you have PDF support])
fi
dnl =============================
dnl Checks for library functions
dnl =============================
AC_FUNC_MMAP
dnl ================================================================
dnl Python
dnl ================================================================
AC_MSG_CHECKING([whether Python support is requested])
AC_ARG_ENABLE([python],
AS_HELP_STRING([--enable-python],[Enable python support]),
[enable_python=$enableval have_python=$enableval],
[enable_python=autodetect have_python=yes])
AC_MSG_RESULT([$enable_python])
if test "x$have_python" != "xno"; then
AM_PATH_PYTHON([$PYTHON_REQ],[],[no])
if test "x$PYTHON" = "x:"; then
have_python=no
fi
fi
if test "x$have_python" != "xno"; then
AM_CHECK_PYTHON_HEADERS([],[have_python=no])
fi
if test "x$have_python" != "xno"; then
PY_PREFIX=`$PYTHON -c 'import sys ; print sys.prefix'`
PY_EXEC_PREFIX=`$PYTHON -c 'import sys ; print sys.exec_prefix'`
PYTHON_LIBS="-lpython$PYTHON_VERSION"
PYTHON_LIB_LOC="-L$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config"
PYTHON_CFLAGS="-I$PY_PREFIX/include/python$PYTHON_VERSION"
PYTHON_MAKEFILE="$PY_EXEC_PREFIX/lib/python$PYTHON_VERSION/config/Makefile"
PYTHON_LOCALMODLIBS=`sed -n -e 's/^LOCALMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_BASEMODLIBS=`sed -n -e 's/^BASEMODLIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_OTHER_LIBS=`sed -n -e 's/^LIBS=\(.*\)/\1/p' $PYTHON_MAKEFILE`
PYTHON_EXTRA_LIBS="$PYTHON_LOCALMODLIBS $PYTHON_BASEMODLIBS $PYTHON_OTHER_LIBS"
AC_SUBST([PYTHON_LIBS])
AC_SUBST([PYTHON_LIB_LOC])
AC_SUBST([PYTHON_CFLAGS])
AC_SUBST([PYTHON_EXTRA_LIBS])
dnl FIXME: do we really need this test?
AC_MSG_CHECKING([whether we can build a shared library depending on libpython])
rm -rf testpython
mkdir testpython
cd testpython
cat > testpython.c <<EOF
#include <Python.h>
int testpython (void)
{
Py_Exit (0);
}
EOF
if ${CC} $PYTHON_CFLAGS $PYTHON_LIBS $PYTHON_EXTRA_LIBS -fPIC -shared -o testpython.so testpython.c -Wl,-soname,testpython.so >/dev/null 2>&1 && \
( objdump --headers --private-headers testpython.so | grep 'testpython' ) >/dev/null 2>&1; then
result=yes
else
result=no
have_python=no
fi
cd ..
rm -rf testpython
AC_MSG_RESULT([$result])
fi
if test "x$have_python" != "xyes"; then
if test "x$enable_python" = "xyes"; then
AC_MSG_ERROR([Python not found])
elif test "x$enable_python" = "xautodetect"; then
enable_python=no
AC_MSG_WARN([Python not found, disabling python support])
fi
elif test "x$enable_python" != "xno"; then
enable_python=yes
AC_DEFINE([HAVE_PYTHON],[1],[Define to compile with python support])
fi
AM_CONDITIONAL([HAVE_PYTHON],[test "x$enable_python" = "xyes"])
dnl =====================
dnl Set stuff in config.h
dnl =====================
dnl Get the prefix
if test "x${prefix}" = "xNONE"; then
PREFIX="${ac_default_prefix}"
AC_DEFINE_UNQUOTED(PREFIX, "${ac_default_prefix}", [definition of PREFIX])
else
PREFIX="${prefix}"
AC_DEFINE_UNQUOTED(PREFIX, "${prefix}", [definition of PREFIX])
fi
AC_SUBST(PREFIX)
dnl Set PACKAGE_LOCALE_DIR in config.h.
AC_DEFINE_UNQUOTED(PACKAGE_LOCALE_DIR, "${PREFIX}/${DATADIRNAME}/locale", [definition of PACKAGE_LOCALE_DIR])
dnl Set PIXMAPS_DIR in config.h.
AC_DEFINE_UNQUOTED(PIXMAPS_DIR, "${PREFIX}/share/pixmaps/${PACKAGE}", [pixmaps location])
dnl Set GNOME_PREFIX in config.h.
GNOME_PREFIX_TMP=`pkg-config --variable=prefix libgnome-2.0`
AC_DEFINE_UNQUOTED(GNOME_PREFIX, "$GNOME_PREFIX_TMP", "")
dnl Set HELP_DIR in config.h.
AC_DEFINE_UNQUOTED(HELP_DIR, "${PREFIX}/share/gnome/help/${PACKAGE}", "")
PLUGIN_LIBTOOL_FLAGS="-module -avoid-version"
AC_SUBST(PLUGIN_LIBTOOL_FLAGS)
dnl =====================
dnl Write some output
dnl =====================
AC_OUTPUT([
Makefile
data/gnome-commander.ebuild
data/gnome-commander.spec
data/gnome-commander.desktop.in
data/Makefile
doc/Makefile
libgcmd/Makefile
pixmaps/Makefile
pixmaps/device-icons/Makefile
pixmaps/file-type-icons/Makefile
pixmaps/mime-icons/Makefile
plugins/Makefile
plugins/cvs/Makefile
plugins/fileroller/Makefile
plugins/python/Makefile
plugins/python/md5sum/Makefile
plugins/python/sha1sum/Makefile
plugins/test/Makefile
po/Makefile.in
src/Makefile
src/dialogs/Makefile
src/tags/Makefile
src/intviewer/Makefile
tests/Makefile
README
])
echo ""
echo ""
echo "=========================================="
echo " Ready to build GNOME Commander ${VERSION}"
echo "=========================================="
echo ""
echo "The following settings will be used:"
echo ""
echo " host : ${host}"
echo " prefix : ${prefix}"
echo " module support : ${GMODULE_AVAIL}"
echo " compiler : ${CC}"
echo " CFLAGS : ${CFLAGS}"
echo " LDFLAGS : ${LDFLAGS}"
echo ""
echo " Python plugins support: ${enable_python}"
echo ""
echo ""
echo "Optional file metadata support:"
echo ""
echo " Exif support : ${have_exiv2}"
echo " IPTC support : ${have_exiv2}"
echo " ID3 support : ${have_taglib}"
echo " Vorbis support : ${have_taglib}"
echo " APE support : ${have_taglib}"
echo " FLAC support : ${have_taglib}"
echo " OLE2 support : ${have_gsf}"
echo " ODF support : ${have_gsf}"
echo " PDF support : ${have_pdf}"
echo ""
echo ""
echo "The following libraries will be used:"
echo ""
echo " glib : ${GLIB_VERSION} in ${GLIB_PREFIX}"
echo " gtk+ : ${GTK_VERSION} in ${GTK_PREFIX}"
echo " gnome : ${GNOME_VERSION} in ${GNOME_PREFIX}"
echo " gnomeui : ${GNOMEUI_VERSION} in ${GNOMEUI_PREFIX}"
echo " gnome-vfs: ${GNOMEVFS_VERSION} in ${GNOMEVFS_PREFIX}"
if test "x$have_python" = "xyes"; then
echo " python : ${PYTHON_VERSION} in ${PY_EXEC_PREFIX}"
fi
echo ""
echo ""
echo "Type 'make' to build $PACKAGE-$VERSION and then 'make install' to install"
echo ""
|