shithub: jbig2

Download patch

ref: ab76b7e32ea5c79915b5ebe94a84ae8b4b29ee78
parent: 0f218050d34326a38a89f07e772a7c4fc350fb10
author: giles <giles@ded80894-8fb9-0310-811b-c03f3676ab4d>
date: Tue May 7 20:59:20 EDT 2002

Rought autotools support.


git-svn-id: http://svn.ghostscript.com/jbig2dec/trunk@50 ded80894-8fb9-0310-811b-c03f3676ab4d

--- /dev/null
+++ b/Makefile.am
@@ -1,0 +1,18 @@
+# $Id: Makefile.am,v 1.1 2002/05/08 00:59:20 giles Exp $
+## process this file with automake to generate Makefile.in
+
+lib_LIBRARIES = libjbig2dec.a
+
+libjbig2dec_a_SOURCES = jbig2.c \
+	jbig2_arith.c jbig2_arith_int.c jbig2_huffman.c \
+	jbig2_symbol_dict.c \
+	jbig2_generic.c jbig2_mmr.c \
+	jbig2_image.c
+
+bin_PROGRAMS = jbig2dec
+#noinst_PROGRAMS = test_huffman test_arith test_png
+
+jbig2dec_SOURCES = jbig2dec.c
+jbig2dec_LDADD = libjbig2dec.a @LIBOBJS@
+
+
--- /dev/null
+++ b/autogen.sh
@@ -1,0 +1,40 @@
+#!/bin/sh
+# Run this to set up the build system: configure, makefiles, etc.
+
+# $Id: autogen.sh,v 1.1 2002/05/08 00:59:20 giles Exp $
+
+package="jbig2dec"
+AUTOMAKE_FLAGS="--foreign $AUTOMAKE_FLAGS"
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+cd "$srcdir"
+
+(autoconf --version) < /dev/null > /dev/null 2>&1 || {
+        echo
+        echo "You must have autoconf installed to compile $package."
+        echo "Download the appropriate package for your distribution,"
+        echo "or get the source tarball at ftp://ftp.gnu.org/pub/gnu/"
+	exit 1
+}
+
+echo "Generating configuration files for $package, please wait...."
+
+echo "  aclocal $ACLOCAL_FLAGS"
+aclocal $ACLOCAL_FLAGS
+echo "  autoheader"
+autoheader
+echo "  automake --add-missing $AUTOMAKE_FLAGS"
+automake --add-missing $AUTOMAKE_FLAGS 
+echo "  running autoconf"
+autoconf
+
+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."
+else
+	echo "running ./configure $@"
+fi
+
+$srcdir/configure "$@" && echo
--- /dev/null
+++ b/configure.ac
@@ -1,0 +1,43 @@
+# Process this file with autoconf to produce a configure script.
+
+package=jbig2dec
+version=0.1
+
+AC_INIT([$package], [$version], [[email protected]])
+AC_PREREQ(2.52)
+AC_CONFIG_SRCDIR([jbig2dec.c])
+
+AM_INIT_AUTOMAKE([$package], [$version])
+AM_CONFIG_HEADER(config.h)
+
+AC_REVISION([$Revision: 1.1 $])
+
+# Checks for programs.
+AC_PROG_CC
+AC_PROG_RANLIB
+
+# Checks for libraries.
+AC_CHECK_LIB([png], [png_check_sig])
+AC_CHECK_LIB([z], [deflate])
+
+# Checks for header files.
+AC_HEADER_STDC
+AC_CHECK_HEADERS([libintl.h stddef.h stdint.h stdlib.h string.h strings.h unistd.h])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_C_CONST
+AC_TYPE_SIZE_T
+
+# Checks for library functions.
+AC_FUNC_MALLOC
+AC_FUNC_MEMCMP
+AC_CHECK_FUNCS([memset strdup])
+
+dnl use our included getopt if the system doesn't have getopt_long()
+AC_SUBST(LIBOJBS)
+AC_CHECK_FUNC(getopt_long, [AC_DEFINE(HAVE_GETOPT_LONG)],
+	[LIBOBJS="$LIBOBJS getopt.o getopt1.o"])
+
+# generate output
+AC_CONFIG_FILES([Makefile])
+AC_OUTPUT
--- a/makefile
+++ /dev/null
@@ -1,21 +1,0 @@
-CC=cc
-CFLAGS=-Wall -g -I/usr/local/include
-LDLIBS=-lefence
-
-APPS=jbig2dec test_arith test_huffman test_png
-
-all:	$(APPS)
-
-jbig2dec:	jbig2.o jbig2dec.o jbig2_huffman.o jbig2_arith.o jbig2_image.o jbig2_generic.o jbig2_symbol_dict.o jbig2_arith_int.o jbig2_mmr.o
-
-test_huffman:	jbig2_huffman.c
-	$(CC) $(CFLAGS) -DTEST jbig2_huffman.c -o test_huffman
-
-test_arith:	jbig2_arith.c
-	$(CC) $(CFLAGS) -DTEST -DDEBUG jbig2_arith.c -o test_arith
-
-test_png:	png_image.o jbig2_image.o
-	$(CC) $(CFLAGS) -DTEST -DDEBUG png_image.c jbig2_image.o -lpng -lz -o test_png
-
-clean:
-	rm $(APPS) *.o