diff options
| author | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-26 22:50:39 +0100 |
|---|---|---|
| committer | Tomas Bzatek <tbzatek@users.sourceforge.net> | 2009-02-26 22:50:39 +0100 |
| commit | 89c58dc04c264c5778ae34d1428e12483f3ac5ac (patch) | |
| tree | d5aef506841b3b0e2e91016d0c0bbb608535873c | |
| parent | 10a77c7a1c4648693ded958d6ac8641afcdf1d34 (diff) | |
| download | cataract-89c58dc04c264c5778ae34d1428e12483f3ac5ac.tar.xz | |
Autotoolize
| -rw-r--r-- | .gitignore | 20 | ||||
| -rw-r--r-- | AUTHORS | 0 | ||||
| -rw-r--r-- | ChangeLog | 0 | ||||
| -rw-r--r-- | INSTALL | 0 | ||||
| -rw-r--r-- | Makefile | 43 | ||||
| -rw-r--r-- | Makefile.am | 18 | ||||
| -rw-r--r-- | NEWS | 0 | ||||
| -rw-r--r-- | README | 2 | ||||
| -rwxr-xr-x | autogen.sh | 89 | ||||
| -rw-r--r-- | configure.ac | 103 | ||||
| -rw-r--r-- | src/Makefile.am | 41 | ||||
| -rw-r--r-- | src/cgg-config.h (renamed from config.h) | 4 | ||||
| -rwxr-xr-x | src/cgg-dirgen (renamed from cgg-dirgen) | 0 | ||||
| -rw-r--r-- | src/cgg.c (renamed from cgg.c) | 6 | ||||
| -rw-r--r-- | src/gallery-utils.c (renamed from gallery-utils.c) | 0 | ||||
| -rw-r--r-- | src/gallery-utils.h (renamed from gallery-utils.h) | 0 | ||||
| -rw-r--r-- | src/generators-replace-table.c (renamed from generators-replace-table.c) | 0 | ||||
| -rw-r--r-- | src/generators-replace-table.h (renamed from generators-replace-table.h) | 0 | ||||
| -rw-r--r-- | src/generators.c (renamed from generators.c) | 8 | ||||
| -rw-r--r-- | src/generators.h (renamed from generators.h) | 0 | ||||
| -rw-r--r-- | src/items.c (renamed from items.c) | 0 | ||||
| -rw-r--r-- | src/items.h (renamed from items.h) | 0 | ||||
| -rw-r--r-- | src/jpeg-utils.cpp (renamed from jpeg-utils.cpp) | 4 | ||||
| -rw-r--r-- | src/jpeg-utils.h (renamed from jpeg-utils.h) | 0 | ||||
| -rw-r--r-- | src/setup.c (renamed from setup.c) | 4 | ||||
| -rw-r--r-- | src/setup.h (renamed from setup.h) | 0 | ||||
| -rw-r--r-- | src/xml-parser.c (renamed from xml-parser.c) | 0 | ||||
| -rw-r--r-- | src/xml-parser.h (renamed from xml-parser.h) | 0 |
28 files changed, 288 insertions, 54 deletions
@@ -15,5 +15,25 @@ sample/dst/ web/ sample-single/ validation/ +Makefile +Makefile.in +Makefile.old +aclocal.m4 +autom4te.cache/ +compile +config.guess +config.h +config.h.in +config.h.in~ +config.log +config.status +config.sub +configure +depcomp +install-sh +missing +stamp-h1 +src/.deps/ +src/Makefile *.o diff --git a/ChangeLog b/ChangeLog new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/ChangeLog diff --git a/Makefile b/Makefile deleted file mode 100644 index 930e25d..0000000 --- a/Makefile +++ /dev/null @@ -1,43 +0,0 @@ -# path definitions -INSTALLPREFIX = /usr -INSTALL=/usr/bin/install -c -INSTALL_DATA = ${INSTALL} -m 644 - -# compiler options -CC = gcc -CPP = g++ -CFLAGS = -I. -I/usr/include -Wall -fPIC -g \ - -D__DEBUG__ -D__DEBUG_ALL__x - -OBJECTS=gallery-utils.o jpeg-utils.o xml-parser.o setup.o items.o generators.o generators-replace-table.o cgg.o - -EXIV2_CFLAGS_EXTRA=`pkg-config --max-version=0.17.1 exiv2 || echo -D_EXIV2_NEW_API` - -.SUFFIXES: .c .cpp -.c.o: - $(CC) $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 --cflags` `Wand-config --cflags` $(EXIV2_CFLAGS_EXTRA) -c $< -.cpp.o: - $(CPP) $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 exiv2 --cflags` `Wand-config --cppflags` $(EXIV2_CFLAGS_EXTRA) -c $< - -all cgg: check $(OBJECTS) - $(CC) -o cgg $(OBJECTS) -lm $(CFLAGS) `pkg-config libxml-2.0 glib-2.0 exiv2 --libs` `Wand-config --ldflags --libs` - -cgg.o: cgg.c -jpeg-utils.o: jpeg-utils.cpp jpeg-utils.h -gallery-utils.o: gallery-utils.c gallery-utils.h -setup.o: setup.c setup.h -xml-parser.o: xml-parser.c xml-parser.h -items.o: items.c items.h -generators.o: generators.c generators.h -generators-replace-table.o: generators-replace-table.c generators-replace-table.h - -check:: - @pkg-config --cflags libxml-2.0 glib-2.0 exiv2 > /dev/null || exit 1 - @Wand-config --cflags > /dev/null || exit 1 - -install:: - $(INSTALL) ./cgg $(INSTALLPREFIX)/bin - -clean: - rm -f *.o *.d cgg - diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..851db70 --- /dev/null +++ b/Makefile.am @@ -0,0 +1,18 @@ +SUBDIRS = \ + src + +EXTRA_DIST = \ + intltool-extract.in \ + intltool-update.in \ + intltool-merge.in + +CLEANFILES = + +DISTCLEANFILES = \ + intltool-extract \ + intltool-update \ + intltool-merge \ + po/.intltool-merge-cache + + +ACLOCAL_AMFLAGS = -I m4 @@ -2,7 +2,7 @@ CATARACT Static web photo gallery generator http://cgg.bzatek.net/ -version 0.99.1 [2009-01-11] +version 0.99.2 [2009-02-26] Copyright (C) 2008-2009 Tomas Bzatek <tbzatek@users.sourceforge.net> diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..4de7bb5 --- /dev/null +++ b/autogen.sh @@ -0,0 +1,89 @@ +#!/bin/sh +# Run this to generate all the initial makefiles, etc. + +srcdir=`dirname $0` +test -z "$srcdir" && srcdir=. + +ORIGDIR=`pwd` +cd $srcdir +PROJECT=cataract +TEST_TYPE=-f +FILE=src/cgg.c + +DIE=0 + +(autoconf --version) < /dev/null > /dev/null 2>&1 || { + echo + echo "You must have autoconf installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/autoconf/" + DIE=1 +} + +if automake --version < /dev/null > /dev/null 2>&1 ; then + AUTOMAKE=automake + ACLOCAL=aclocal +else + echo + echo "You must have automake 1.7.x installed to compile $PROJECT." + echo "Install the appropriate package for your distribution," + echo "or get the source tarball at http://ftp.gnu.org/gnu/automake/" + DIE=1 +fi + +if test "$DIE" -eq 1; then + exit 1 +fi + +test $TEST_TYPE $FILE || { + echo "You must run this script in the top-level $PROJECT directory" + exit 1 +} + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + if test -z "$*"; then + echo "I am going to run ./configure with no arguments - if you wish " + echo "to pass any to it, please specify them on the $0 command line." + fi +fi + +if test -z "$ACLOCAL_FLAGS"; then + + acdir=`$ACLOCAL --print-ac-dir` + m4list="glib-2.0.m4 glib-gettext.m4" + + for file in $m4list + do + if [ ! -f "$acdir/$file" ]; then + echo "WARNING: aclocal's directory is $acdir, but..." + echo " no file $acdir/$file" + echo " You may see fatal macro warnings below." + echo " If these files are installed in /some/dir, set the ACLOCAL_FLAGS " + echo " environment variable to \"-I /some/dir\", or install" + echo " $acdir/$file." + echo "" + fi + done +fi + +rm -rf autom4te.cache + +# README and INSTALL are required by automake, but may be deleted by clean +# up rules. to get automake to work, simply touch these here, they will be +# regenerated from their corresponding *.in files by ./configure anyway. +touch README INSTALL + +$ACLOCAL $ACLOCAL_FLAGS || exit $? + +autoheader || exit $? + +$AUTOMAKE --add-missing || exit $? +autoconf || exit $? +cd $ORIGDIR || exit $? + +if test -z "$AUTOGEN_SUBDIR_MODE"; then + $srcdir/configure --enable-maintainer-mode $AUTOGEN_CONFIGURE_ARGS "$@" || exit $? + + echo + echo "Now type 'make' to compile $PROJECT." +fi diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..931a27b --- /dev/null +++ b/configure.ac @@ -0,0 +1,103 @@ +AC_INIT + +PACKAGE=cataract +VERSION=0.99.2 +APP_BUILD_DATE=2009-02-26 +APP_COPYRIGHT_DATE=2008-2009 + +AC_SUBST(PACKAGE) +AC_SUBST(VERSION) + +AM_INIT_AUTOMAKE($PACKAGE, $VERSION) +AM_MAINTAINER_MODE +AM_CONFIG_HEADER(config.h) + +GLIB_REQUIRED=2.16.0 +EXIV2_REQUIRED=0.17 + +AC_C_CONST +AC_ISC_POSIX +AC_PROG_CC +AC_PROG_CPP +AC_PROG_CXX +AC_PROG_CXXCPP +AC_PROG_INSTALL +AC_PROG_LN_S +AC_PROG_MAKE_SET +AM_PROG_CC_C_O + +dnl Check for pkgconfig first +AC_CHECK_PROG(HAVE_PKGCONFIG, pkg-config, yes, no) +AC_PATH_PROG(PKG_CONFIG, pkg-config, no) + +dnl Give error and exit if we don't have pkgconfig +if test "x$HAVE_PKGCONFIG" = "xno"; then + AC_MSG_ERROR(you need to have pkgconfig installed !) +fi + +PKG_CHECK_MODULES(LIBS, [ + glib-2.0 >= $GLIB_REQUIRED + libxml-2.0 + MagickWand + exiv2 >= $EXIV2_REQUIRED +]) +AC_SUBST(LIBS_CFLAGS) +AC_SUBST(LIBS_LIBS) + +AM_PATH_GLIB_2_0($GLIB_REQUIRED, :, + AC_MSG_ERROR([ +*** GLIB $GLIB_REQUIRED or better is required. The latest version of. +*** GLIB is always available from ftp://ftp.gtk.org/pub/gtk/.]), + gobject gmodule-no-export gthread) + + + +DISABLE_DEPRECATED_CFLAGS=" -DG_DISABLE_DEPRECATED" +AC_SUBST(DISABLE_DEPRECATED_CFLAGS) + +dnl WARN_CFLAGS="-Wall -Werror" +WARN_CFLAGS="-Wall" +AC_SUBST(WARN_CFLAGS) + + + +dnl ************************************************** +dnl *** Check for new exiv2 thumbnailing API *** +dnl ************************************************** + +AC_DEFUN([EXIV2_HAVE_NEW_THUMBNAILING_API], +[AC_CACHE_CHECK(for new Exiv2::ExifThumb API, +ac_cv_exiv2_have_new_exifthumb, +[AC_LANG_SAVE + AC_LANG_CPLUSPLUS + AC_TRY_COMPILE([#include <exiv2/image.hpp> +#include <exiv2/exif.hpp> + +void test () { + Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(""); + Exiv2::ExifData &exifData = image->exifData(); + Exiv2::ExifThumb exifThumb(image->exifData()); + exifThumb.erase(); +} +],[return 0;], + ac_cv_exiv2_have_new_exifthumb=yes, ac_cv_exiv2_have_new_exifthumb=no) + AC_LANG_RESTORE +]) +if test "$ac_cv_exiv2_have_new_exifthumb" = yes; then + AC_DEFINE(HAVE_EXIFTHUMB,,[new Exiv2::ExifThumb API]) +fi +]) + +EXIV2_HAVE_NEW_THUMBNAILING_API + +AC_DEFINE_UNQUOTED(APP_BUILD_DATE, ["$APP_BUILD_DATE"], [build date]) +AC_DEFINE_UNQUOTED(APP_COPYRIGHT_DATE, ["$APP_COPYRIGHT_DATE"], [copyright dates]) + + +AC_CONFIG_FILES([ + Makefile + src/Makefile +]) +AC_OUTPUT + + diff --git a/src/Makefile.am b/src/Makefile.am new file mode 100644 index 0000000..443d2f1 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1,41 @@ +NULL = + +INCLUDES = \ + -DDATADIR=\"$(datadir)\" \ + -I$(top_srcdir) \ + -I$(top_builddir) \ + $(WARN_CFLAGS) \ + $(DISABLE_DEPRECATED_CFLAGS) \ + $(LIBS_CFLAGS) \ + -DG_LOG_DOMAIN=\"cgg\" + +bin_PROGRAMS = \ + cgg \ + $(NULL) + +bin_SCRIPTS = \ + cgg-dirgen \ + $(NULL) + +cgg_SOURCES = \ + cgg.c \ + cgg-config.h \ + gallery-utils.c \ + gallery-utils.h \ + generators.c \ + generators.h \ + generators-replace-table.c \ + generators-replace-table.h \ + items.c \ + items.h \ + jpeg-utils.cpp \ + jpeg-utils.h \ + setup.c \ + setup.h \ + xml-parser.c \ + xml-parser.h \ + $(NULL) + +cgg_LDADD = $(LIBS_LIBS) + +EXTRA_DIST = cgg-dirgen diff --git a/config.h b/src/cgg-config.h index bf9e613..7a447d7 100644 --- a/config.h +++ b/src/cgg-config.h @@ -25,6 +25,6 @@ #define SETUP_XML "setup.xml" -#define APP_VERSION "0.99.0" -#define APP_BUILD_DATE "2008-07-27" +// #define APP_VERSION "0.99.0" +// #define APP_BUILD_DATE "2008-07-27" diff --git a/cgg-dirgen b/src/cgg-dirgen index 44dd256..44dd256 100755 --- a/cgg-dirgen +++ b/src/cgg-dirgen @@ -25,7 +25,9 @@ #include <libxml/xmlmemory.h> -#include "config.h" +#include <config.h> + +#include "cgg-config.h" #include "setup.h" #include "generators.h" @@ -59,7 +61,7 @@ parse_cmd (int argc, char* argv[], char **source_dir, char **dst_dir, gboolean * g_set_prgname ("cgg"); context = g_option_context_new ("- web gallery generator"); - s1 = g_strdup_printf ("cgg v%s [%s] Copyright (c) 2008 Tomas Bzatek", APP_VERSION, APP_BUILD_DATE); + s1 = g_strdup_printf ("cgg v%s [%s] Copyright (c) %s Tomas Bzatek", VERSION, APP_BUILD_DATE, APP_COPYRIGHT_DATE); g_option_context_set_summary (context, s1); g_free (s1); g_option_context_add_main_entries (context, entries, NULL); diff --git a/gallery-utils.c b/src/gallery-utils.c index 6378ae5..6378ae5 100644 --- a/gallery-utils.c +++ b/src/gallery-utils.c diff --git a/gallery-utils.h b/src/gallery-utils.h index 53c82c0..53c82c0 100644 --- a/gallery-utils.h +++ b/src/gallery-utils.h diff --git a/generators-replace-table.c b/src/generators-replace-table.c index 23771fc..23771fc 100644 --- a/generators-replace-table.c +++ b/src/generators-replace-table.c diff --git a/generators-replace-table.h b/src/generators-replace-table.h index d72d150..d72d150 100644 --- a/generators-replace-table.h +++ b/src/generators-replace-table.h diff --git a/generators.c b/src/generators.c index 907412a..8a2053a 100644 --- a/generators.c +++ b/src/generators.c @@ -24,7 +24,9 @@ #include <glib.h> -#include "config.h" +#include <config.h> + +#include "cgg-config.h" #include "setup.h" #include "items.h" #include "jpeg-utils.h" @@ -308,7 +310,7 @@ write_html_album (TGallerySetup *setup, g_free (s1); /* META tags */ - s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", APP_VERSION); + s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", VERSION); if (setup->meta_author || items->meta_author) { s3 = g_strdup (items->meta_author ? items->meta_author : setup->meta_author); adjust_tags_parameter (&s3); @@ -751,7 +753,7 @@ write_html_image (TGallerySetup *setup, /* META tags */ override_title_meta = setup->use_title_as_meta && title && (strlen (title) > 0); - s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", APP_VERSION); + s1 = g_strdup_printf ("\t<meta name=\"generator\" content=\"Cataract Gallery Generator v%s\" />\n", VERSION); if (setup->meta_author || parent_items->meta_author) { s3 = g_strdup (parent_items->meta_author ? parent_items->meta_author : setup->meta_author); adjust_tags_parameter (&s3); diff --git a/generators.h b/src/generators.h index c87e8a3..c87e8a3 100644 --- a/generators.h +++ b/src/generators.h diff --git a/jpeg-utils.cpp b/src/jpeg-utils.cpp index 6ccf491..501f7ea 100644 --- a/jpeg-utils.cpp +++ b/src/jpeg-utils.cpp @@ -402,7 +402,7 @@ modify_exif (const char *filename, gboolean strip_thumbnail, const char *add_cop } if (strip_thumbnail && (! exifData.empty())) { -#ifdef _EXIV2_NEW_API +#ifdef HAVE_EXIFTHUMB Exiv2::ExifThumb exifThumb(image->exifData()); std::string thumbExt = exifThumb.extension(); #else @@ -410,7 +410,7 @@ modify_exif (const char *filename, gboolean strip_thumbnail, const char *add_cop #endif if (! thumbExt.empty()) { -#ifdef _EXIV2_NEW_API +#ifdef HAVE_EXIFTHUMB exifThumb.erase(); #else exifData.eraseThumbnail(); diff --git a/jpeg-utils.h b/src/jpeg-utils.h index 9b8919f..9b8919f 100644 --- a/jpeg-utils.h +++ b/src/jpeg-utils.h @@ -28,7 +28,9 @@ #include <glib.h> -#include "config.h" +#include <config.h> + +#include "cgg-config.h" #include "gallery-utils.h" #include "setup.h" #include "xml-parser.h" diff --git a/xml-parser.c b/src/xml-parser.c index eb6c86f..eb6c86f 100644 --- a/xml-parser.c +++ b/src/xml-parser.c diff --git a/xml-parser.h b/src/xml-parser.h index 02be628..02be628 100644 --- a/xml-parser.h +++ b/src/xml-parser.h |
