summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2003-09-04 22:06:56 +0000
committerLennart Poettering <lennart@poettering.net>2003-09-04 22:06:56 +0000
commit478d7ec1929c99450cfbfa05e02330658a8668bc (patch)
tree23c2fcc272aea884d9b40256782ca2fe9cb561ba /src
parentb1a26b18ee147278397a2dbcc1f5741b55982c70 (diff)
autoconf
git-svn-id: file:///home/lennart/svn/public/syrep/trunk@30 07ea20a6-d2c5-0310-9e02-9ef735347d72
Diffstat (limited to 'src')
-rw-r--r--src/Makefile17
-rw-r--r--src/Makefile.am84
-rw-r--r--src/cache.h2
-rw-r--r--src/context.h2
-rw-r--r--src/dbstruct.h2
-rw-r--r--src/extract.c2
-rw-r--r--src/package.c2
-rw-r--r--src/package.h2
-rw-r--r--src/syrep.c11
-rw-r--r--src/util.c6
-rw-r--r--src/util.h2
11 files changed, 103 insertions, 29 deletions
diff --git a/src/Makefile b/src/Makefile
deleted file mode 100644
index 97994b5..0000000
--- a/src/Makefile
+++ /dev/null
@@ -1,17 +0,0 @@
-CFLAGS=-Wall -pipe -O0 -g -DARCH_IS_BIG_ENDIAN=0 -D_FILE_OFFSET_BITS=64 -DPACKAGE_VERSION=\"0.1\"
-CC=gcc
-
-all: syrep
-
-syrep: cache.o update.o util.o syrep.o md5.o md5util.o context.o package.o dbutil.o cmdline.o info.o history.o dump.o list.o diff.o merge.o extract.o makepatch.o cleanup.o
- $(CC) -g $^ -o $@ -ldb -lz
-
-cmdline.c cmdline.h: syrep.ggo Makefile
- gengetopt --unamed-opts --no-handle-help --no-handle-version < $<
-
-update.o: cmdline.h
-
-clean:
- rm -f *.o syrep cmdline.[ch]
-
-.PHONY: all clean
diff --git a/src/Makefile.am b/src/Makefile.am
new file mode 100644
index 0000000..3386f58
--- /dev/null
+++ b/src/Makefile.am
@@ -0,0 +1,84 @@
+# $Id: Makefile.am 7 2003-08-04 23:05:55Z lennart $
+
+# This file is part of syrep.
+#
+# syrep is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# syrep is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with syrep; if not, write to the Free Software Foundation,
+# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+
+
+bin_PROGRAMS = syrep
+
+syrep_SOURCES = cache.c cache.h \
+ update.c update.h \
+ util.c util.h \
+ syrep.c syrep.h \
+ md5.c md5.h \
+ md5util.c md5util.h \
+ context.c context.h \
+ package.c package.h \
+ dbutil.c dbutil.h \
+ info.c info.h \
+ history.c history.h \
+ dump.c dump.h \
+ list.c list.h \
+ diff.c diff.h \
+ merge.c merge.h \
+ extract.c extract.h \
+ makepatch.c makepatch.h \
+ cleanup.c cleanup.h \
+ cmdline.c cmdline.h \
+ svn-revision.h \
+ dbstruct.h
+
+EXTRA_DIST = syrep.ggo
+MAINTAINERCLEANFILES =
+BUILT_SOURCES =
+
+if USE_GENGETOPT
+MAINTAINERCLEANFILES += cmdline.c cmdline.h
+BUILT_SOURCES += cmdline.c cmdline.h
+endif
+
+if USE_SUBVERSION
+MAINTAINERCLEANFILES += svn-revision.h
+BUILT_SOURCES += svn-revision.h
+endif
+
+syrep.$(OBJEXT): svn-revision.h cmdline.h
+update.$(OBJEXT): cmdline.h
+
+if USE_GENGETOPT
+
+cmdline.c cmdline.h: syrep.ggo Makefile
+ gengetopt --unamed-opts --no-handle-help --no-handle-version < $<
+
+endif
+
+if USE_SUBVERSION
+svn-revision.h: Makefile
+ if test -d "$(top_srcdir)/.svn" ; then \
+ if REV=`svn info "$(top_srcdir)" | grep ^Revision | cut -f2 -d" "` 2> /dev/null ; then \
+ echo -e "#ifndef foosvnrevisionhfoo\n#define foosvnrevisionhfoo\n#define SVN_REVISION \"$$REV\"\n#endif" > $@ ; \
+ fi \
+ fi
+
+svnkeywords:
+ rm -f svn-revision.h cmdline.[ch]
+ svn propset svn:keywords Id *.c *.h Makefile.am
+
+.PHONY: svnkeywords
+
+endif
+
+
diff --git a/src/cache.h b/src/cache.h
index 27d0421..67ec37d 100644
--- a/src/cache.h
+++ b/src/cache.h
@@ -21,7 +21,7 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***/
-#include <stdint.h>
+#include <inttypes.h>
struct syrep_md_cache;
diff --git a/src/context.h b/src/context.h
index 0a7aa03..29045cb 100644
--- a/src/context.h
+++ b/src/context.h
@@ -22,7 +22,7 @@
***/
#include <db.h>
-#include <stdint.h>
+#include <inttypes.h>
struct syrep_db_context {
struct package *package;
diff --git a/src/dbstruct.h b/src/dbstruct.h
index b5f0c26..74c6059 100644
--- a/src/dbstruct.h
+++ b/src/dbstruct.h
@@ -22,7 +22,7 @@
***/
#include <limits.h>
-#include <stdint.h>
+#include <inttypes.h>
#include <db.h>
diff --git a/src/extract.c b/src/extract.c
index 011e108..ec1d8f0 100644
--- a/src/extract.c
+++ b/src/extract.c
@@ -24,7 +24,7 @@
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
-#include <stdint.h>
+#include <inttypes.h>
#include <stdio.h>
#include "package.h"
diff --git a/src/package.c b/src/package.c
index fed5d5c..3d23306 100644
--- a/src/package.c
+++ b/src/package.c
@@ -19,7 +19,7 @@
***/
#include <stdio.h>
-#include <stdint.h>
+#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <errno.h>
diff --git a/src/package.h b/src/package.h
index 722ad54..9279659 100644
--- a/src/package.h
+++ b/src/package.h
@@ -21,7 +21,7 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***/
-#include <stdint.h>
+#include <inttypes.h>
#define PACKAGE_FILEID (*((uint32_t*) "SREP"))
#define PACKAGE_FILEIDCOMPRESSED (*((uint32_t*) "CREP"))
diff --git a/src/syrep.c b/src/syrep.c
index 446c2c9..724f08a 100644
--- a/src/syrep.c
+++ b/src/syrep.c
@@ -18,7 +18,7 @@
Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
***/
-#include <stdint.h>
+#include <inttypes.h>
#include <limits.h>
#include <assert.h>
#include <malloc.h>
@@ -53,6 +53,12 @@
#include "makepatch.h"
#include "cleanup.h"
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+#include "svn-revision.h"
+
volatile int interrupted = 0;
struct gengetopt_args_info args;
@@ -533,7 +539,8 @@ static int version(const char *argv0) {
"%s "PACKAGE_VERSION"\n"
"Compiled with %i Bit off_t.\n"
"Compiled with zlib %s, linked to zlib %s.\n"
- "Compiled with libdb %i.%i.%i, linked to libdb %i.%i.%i\n",
+ "Compiled with libdb %i.%i.%i, linked to libdb %i.%i.%i\n"
+ "SVN Revision "SVN_REVISION"\n",
argv0,
sizeof(off_t)*8,
ZLIB_VERSION, zlibVersion(),
diff --git a/src/util.c b/src/util.c
index c05b312..18f8fa4 100644
--- a/src/util.c
+++ b/src/util.c
@@ -224,10 +224,10 @@ int expand_file(int fd, off_t l) {
#define BUFSIZE (32*1024)
int copy_fd(int sfd, int dfd, off_t l) {
- off_t sfo, dfo, msfo, mdfo;
+ off_t sfo = 0, dfo = 0, msfo = 0, mdfo = 0;
+ size_t m = 0, sm = 0, dm = 0;
void *sp, *dp;
- off_t m, sm, dm;
- static off_t psize = 0;
+ static size_t psize = 0;
#ifdef USE_SENDFILE
if (!copy_fd_sendfile(sfd, dfd, l))
diff --git a/src/util.h b/src/util.h
index b7fb571..50e3a95 100644
--- a/src/util.h
+++ b/src/util.h
@@ -22,7 +22,7 @@
***/
#include <db.h>
-#include <stdint.h>
+#include <inttypes.h>
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))