[PATCH] aespipe - fix build issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello Jari,

This patch contains some fixes to aespipe build:
1. Add quotes to AC_DEFUN to configure.ac so autoconf will not complain.
2. Add datarootdir to Makefile.in so autoconf will not complain.
3. Support DESTDIR make variable to allow standard "make install DESTDIR=/tmp/root", so package manages may use make install.
4. Allow separate build directory (mkdir xx; cd xx; ../configure), add srcdir support.
5. Add aespipe as dependency for install.

If you like I will be very happy to convert current Makefile to automake, it would be much easier to maintain.
It will manage dependencies, handle install better, support "install-strip" target and more.

Regards,
Alon.

---

diff -urNp aespipe-v2.3d.org/configure.ac aespipe-v2.3d/configure.ac
--- aespipe-v2.3d.org/configure.ac	2004-07-07 17:41:14.000000000 +0300
+++ aespipe-v2.3d/configure.ac	2008-10-30 16:24:41.000000000 +0200
@@ -21,7 +21,7 @@ AC_TYPE_PID_T
 AC_TYPE_SIZE_T
 
 dnl Check if parameter 1 exists as typedef or macro
-AC_DEFUN(AESPIPE_CHECK_TYPE,
+AC_DEFUN([AESPIPE_CHECK_TYPE],
 [ AC_MSG_CHECKING(for $1 type)
 AC_CACHE_VAL(x_have_type_$1,
 [AC_TRY_COMPILE([#define _GNU_SOURCE 1
diff -urNp aespipe-v2.3d.org/Makefile.in aespipe-v2.3d/Makefile.in
--- aespipe-v2.3d.org/Makefile.in	2007-02-18 11:26:23.000000000 +0200
+++ aespipe-v2.3d/Makefile.in	2008-10-30 16:41:15.000000000 +0200
@@ -11,6 +11,9 @@ CC = @CC@ @CFLAGS@ @DEFS@ -D_GNU_SOURCE=
 LINK = @CC@ @LDFLAGS@
 prefix = @prefix@
 exec_prefix = @exec_prefix@
+srcdir = @srcdir@
+builddir = @builddir@
+datarootdir = @datarootdir@
 @SET_MAKE@
 
 aespipe: aespipe.o aes.o md5.o sha512.o rmd160.o
@@ -19,24 +22,24 @@ x86 i586: aespipe.o aes-x86.o md5-x86.o 
 	$(LINK) -o aespipe aespipe.o aes-x86.o md5-x86.o sha512.o rmd160.o @LIBS@
 amd64: aespipe.o aes-amd64.o md5-amd64.o sha512.o rmd160.o
 	$(LINK) -o aespipe aespipe.o aes-amd64.o md5-amd64.o sha512.o rmd160.o @LIBS@
-aespipe.o: aespipe.c aes.h md5.h sha512.h rmd160.h
-	$(CC) -o aespipe.o -c aespipe.c
-aes.o: aes.c aes.h
-	$(CC) -DCONFIGURE_DETECTS_BYTE_ORDER=1 -DDATA_ALWAYS_ALIGNED=1 -o aes.o -c aes.c
-aes-x86.o: aes-x86.S aes.h
-	$(CC) -o aes-x86.o -c aes-x86.S
-aes-amd64.o: aes-amd64.S aes.h
-	$(CC) -o aes-amd64.o -c aes-amd64.S
-md5.o: md5.c md5.h
-	$(CC) -o md5.o -c md5.c
-md5-x86.o: md5-x86.S md5.h
-	$(CC) -o md5-x86.o -c md5-x86.S
-md5-amd64.o: md5-amd64.S md5.h
-	$(CC) -o md5-amd64.o -c md5-amd64.S
-sha512.o: sha512.c sha512.h
-	$(CC) -o sha512.o -c sha512.c
-rmd160.o: rmd160.c rmd160.h
-	$(CC) -o rmd160.o -c rmd160.c
+aespipe.o: $(srcdir)/aespipe.c $(srcdir)/aes.h $(srcdir)/md5.h $(srcdir)/sha512.h $(srcdir)/rmd160.h
+	$(CC) -o aespipe.o -c $(srcdir)/aespipe.c
+aes.o: $(srcdir)/aes.c $(srcdir)/aes.h
+	$(CC) -DCONFIGURE_DETECTS_BYTE_ORDER=1 -DDATA_ALWAYS_ALIGNED=1 -o aes.o -c $(srcdir)/aes.c
+aes-x86.o: $(srcdir)/aes-x86.S $(srcdir)/aes.h
+	$(CC) -o aes-x86.o -c $(srcdir)/aes-x86.S
+aes-amd64.o: $(srcdir)/aes-amd64.S $(srcdir)/aes.h
+	$(CC) -o aes-amd64.o -c $(srcdir)/aes-amd64.S
+md5.o: $(srcdir)/md5.c $(srcdir)/md5.h
+	$(CC) -o md5.o -c $(srcdir)/md5.c
+md5-x86.o: $(srcdir)/md5-x86.S $(srcdir)/md5.h
+	$(CC) -o md5-x86.o -c $(srcdir)/md5-x86.S
+md5-amd64.o: $(srcdir)/md5-amd64.S $(srcdir)/md5.h
+	$(CC) -o md5-amd64.o -c $(srcdir)/md5-amd64.S
+sha512.o: $(srcdir)/sha512.c $(srcdir)/sha512.h
+	$(CC) -o sha512.o -c $(srcdir)/sha512.c
+rmd160.o: $(srcdir)/rmd160.c $(srcdir)/rmd160.h
+	$(CC) -o rmd160.o -c $(srcdir)/rmd160.c
 
 clean:
 	rm -f *.o aespipe test-file[12345] config.log config.status configure.lineno
@@ -44,13 +47,15 @@ clean:
 distclean: clean
 	rm -f Makefile
 
-install:
-	mkdir -p @bindir@
-	rm -f @bindir@/aespipe
-	cp aespipe @bindir@/aespipe
-	mkdir -p @mandir@/man1
-	rm -f @mandir@/man1/aespipe.1
-	cp aespipe.1 @mandir@/man1/aespipe.1
+install: aespipe
+	mkdir -p "$(DESTDIR)@bindir@"
+	rm -f "$(DESTDIR)@bindir@/aespipe"
+	cp aespipe "$(DESTDIR)@bindir@/aespipe"
+	chmod 0755 "$(DESTDIR)@bindir@/aespipe"
+	mkdir -p "$(DESTDIR)@mandir@/man1"
+	rm -f "$(DESTDIR)@mandir@/man1/aespipe.1"
+	cp $(srcdir)/aespipe.1 "$(DESTDIR)@mandir@/man1/aespipe.1"
+	chmod 0644 "$(DESTDIR)@mandir@/man1/aespipe.1"
 
 tests:
 	dd if=/dev/zero of=test-file1 bs=1024 count=33
@@ -62,16 +67,17 @@ tests:
 	$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0  GK= MD=1bf92ee337b653cdb32838047dec00fc MD5WORK=test-part@MD5WORKPART@
 	$(MAKE) test-part2 CT=AES256 HF=rmd160 ITER=0  GK= MD=c85eb59da18876ae71ebd838675c6ef4 MD5WORK=test-part@MD5WORKPART@
 	$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=10 GK= MD=dadad48a6d3d9b9914199626ed7b710c MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@rm -fr test-dir1
 	@GPGWORKPART@mkdir test-dir1
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K gpgkey1.asc -G test-dir1" MD=fa5c9a84bc8f6257830c3cbe60294c69 MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K gpgkey1.asc -G test-dir1" MD=ddec9544a36100156aef353ec2bf9740 MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K gpgkey1.asc -G test-dir1" MD=cb38b603f96f0deac1891d423983d69c MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K gpgkey2.asc -G test-dir1" MD=f9825b79873f5c439ae9371c1a929a6c MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K gpgkey2.asc -G test-dir1" MD=489991b779213f60219f09c575c08247 MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K gpgkey2.asc -G test-dir1" MD=2a1d0d3fce83fbe5f3edcca95fbab3b7 MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K gpgkey3.asc -G test-dir1" MD=fabe7422f534820838dfd4571ba14ade MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K gpgkey3.asc -G test-dir1" MD=3eadc976525f9df7e18d56676ec730c8 MD5WORK=test-part@MD5WORKPART@
-	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K gpgkey3.asc -G test-dir1" MD=3be488a60dd77bcab9fbeba4a428c3d5 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K $(srcdir)/gpgkey1.asc -G test-dir1" MD=fa5c9a84bc8f6257830c3cbe60294c69 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K $(srcdir)/gpgkey1.asc -G test-dir1" MD=ddec9544a36100156aef353ec2bf9740 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K $(srcdir)/gpgkey1.asc -G test-dir1" MD=cb38b603f96f0deac1891d423983d69c MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K $(srcdir)/gpgkey2.asc -G test-dir1" MD=f9825b79873f5c439ae9371c1a929a6c MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K $(srcdir)/gpgkey2.asc -G test-dir1" MD=489991b779213f60219f09c575c08247 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K $(srcdir)/gpgkey2.asc -G test-dir1" MD=2a1d0d3fce83fbe5f3edcca95fbab3b7 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES128 HF=sha256 ITER=0 GK="-K $(srcdir)/gpgkey3.asc -G test-dir1" MD=fabe7422f534820838dfd4571ba14ade MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES192 HF=sha384 ITER=0 GK="-K $(srcdir)/gpgkey3.asc -G test-dir1" MD=3eadc976525f9df7e18d56676ec730c8 MD5WORK=test-part@MD5WORKPART@
+	@GPGWORKPART@$(MAKE) test-part2 CT=AES256 HF=sha512 ITER=0 GK="-K $(srcdir)/gpgkey3.asc -G test-dir1" MD=3be488a60dd77bcab9fbeba4a428c3d5 MD5WORK=test-part@MD5WORKPART@
 	echo 1234567890123456789012345678901 >test-file4
 	$(MAKE) test-part2 CT=AES HF=unhashed1 ITER=0 GK= MD=293b09053055af7ca5235dc6a5bc0b74 MD5WORK=test-part@MD5WORKPART@
 	echo 12345678901234567890123456789012 >test-file4

-
Linux-crypto:  cryptography in and on the Linux system
Archive:       http://mail.nl.linux.org/linux-crypto/


[Index of Archives]     [Kernel]     [Linux Crypto]     [Gnu Crypto]     [Gnu Classpath]     [Netfilter]     [Bugtraq]
  Powered by Linux