diff options
author | Giuseppe Scrivano <gscrivan@redhat.com> | 2015-02-11 15:36:21 +0100 |
---|---|---|
committer | Giuseppe Scrivano <gscrivan@redhat.com> | 2015-03-26 09:36:16 +0100 |
commit | d1204147fe5fecb7da423f2562b29d01fb60b521 (patch) | |
tree | f3f0a71687a6d37891003bf6a1e99f63e4ce293a | |
parent | 119890b3a68746f8733676e3f544ef90e1c165c3 (diff) | |
download | bsdiff-d1204147fe5fecb7da423f2562b29d01fb60b521.tar.gz |
build: use autoconf and automake
Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
-rw-r--r-- | .gitignore | 11 | ||||
-rw-r--r-- | Makefile-bsdiff.am | 32 | ||||
-rw-r--r-- | Makefile.am | 11 | ||||
-rw-r--r-- | README.md | 5 | ||||
-rwxr-xr-x | autogen.sh | 6 | ||||
-rw-r--r-- | bsdiff.c | 3 | ||||
-rw-r--r-- | configure.ac | 30 |
7 files changed, 93 insertions, 5 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..4e13492 --- /dev/null +++ b/.gitignore @@ -0,0 +1,11 @@ +.deps/* +.libs/* +*.lo +*.o +.dirstamp +Makefile-bsdiff.am.inc +AUTHORS +NEWS +README +ChangeLog +COPYING diff --git a/Makefile-bsdiff.am b/Makefile-bsdiff.am new file mode 100644 index 0000000..1d810ed --- /dev/null +++ b/Makefile-bsdiff.am @@ -0,0 +1,32 @@ +# Copyright (C) 2015 Giuseppe Scrivano <gscrivan@redhat.com> +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted providing that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, +# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING +# IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +# POSSIBILITY OF SUCH DAMAGE. +# + +EXTRA_DIST += $(libbsdiff_srcpath)/bsdiff.h $(libbsdiff_srcpath)/bspatch.h $(libbsdiff_srcpath)/LICENSE $(libbsdiff_srcpath)/README.md + +libbsdiff_la_SOURCES = \ + $(libbsdiff_srcpath)/bsdiff.c \ + $(libbsdiff_srcpath)/bspatch.c \ + $(NULL) + +libbsdiff_la_CFLAGS = $(AM_CFLAGS) diff --git a/Makefile.am b/Makefile.am new file mode 100644 index 0000000..abd3d7e --- /dev/null +++ b/Makefile.am @@ -0,0 +1,11 @@ +bin_PROGRAMS = bsdiff bspatch + +bsdiff_SOURCES = bsdiff.c + +bspatch_SOURCES = bspatch.c + +bsdiff_CFLAGS = -DBSDIFF_EXECUTABLE +bspatch_CFLAGS = -DBSPATCH_EXECUTABLE + +EXTRA_DIST = bsdiff.h bspatch.h + @@ -33,11 +33,6 @@ The overarching goal was to modify the original bsdiff/bspatch code from Colin and eliminate external dependencies and provide a simple interface to the core functionality. -You can define `BSDIFF_HEADER_ONLY` or `BSPATCH_HEADER_ONLY` to only include -the header parts of the file. If including a `.c` file makes you feel really -dirty you can copy paste the header portion at the top of the file into your own -`.h` file. - I've exposed relevant functions via the `_stream` classes. The only external dependency not exposed is `memcmp` in `bsdiff`. diff --git a/autogen.sh b/autogen.sh new file mode 100755 index 0000000..ce934ac --- /dev/null +++ b/autogen.sh @@ -0,0 +1,6 @@ +#!/bin/sh + +touch AUTHORS NEWS README ChangeLog +cp LICENSE COPYING + +autoreconf -fis @@ -27,6 +27,9 @@ #include "bsdiff.h" +#include <limits.h> +#include <string.h> + #define MIN(x,y) (((x)<(y)) ? (x) : (y)) static void split(int64_t *I,int64_t *V,int64_t start,int64_t len,int64_t h) diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..69de743 --- /dev/null +++ b/configure.ac @@ -0,0 +1,30 @@ +# -*- Autoconf -*- +# Process this file with autoconf to produce a configure script. + +AC_PREREQ([2.69]) +AC_INIT([bsdiff], [0.1]) +AC_CONFIG_SRCDIR([bsdiff.c]) +AC_CONFIG_HEADERS([config.h]) +AM_INIT_AUTOMAKE([1.9]) + +# Checks for programs. +AC_PROG_CC + +# Checks for libraries. +# FIXME: Replace `main' with a function in `-lbz2': +AC_CHECK_LIB([bz2], [BZ2_bzReadOpen]) + +AC_CHECK_HEADERS([fcntl.h limits.h stddef.h stdint.h stdlib.h string.h unistd.h]) + +# Checks for typedefs, structures, and compiler characteristics. +AC_TYPE_INT64_T +AC_TYPE_OFF_T +AC_TYPE_SIZE_T +AC_TYPE_UINT8_T + +# Checks for library functions. +AC_FUNC_MALLOC +AC_CHECK_FUNCS([memset]) + +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT |