[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] aespipe - fix build issues
On Saturday 01 November 2008, Jari Ruusu wrote:
> > I did not know that you should make x86 for optimize x86, will you
> > consider a patch to autoconf so that it will detect this automatically?
>
> At least I will seriously look at it.
>
> Long time ago I came to conclusion that doing that portably is very
> difficult. So, I left that decision to whoever calls make.
OK... here it is.
It uses AC_CANONICAL_HOST and as you don't use automake you must
manually copy the config.guess and config.sub files from gnuconfig to the
source tree.
You can find latest versions at [1] git repository, or at your distribution at
/usr/share/gnuconfig or similar.
You should also touch install-sh at source directory, as it is automatically pulled
but we don't use it.
automake has still few advantages ("make dist", "make distcheck", be able to use
BSD compliant install and installing all required dependencies in tarball).
I still think that a automake package is preferable in this case.
Alon.
[1] http://savannah.gnu.org/projects/config
---
diff -urNp aespipe-v2.3d.new/configure.ac aespipe-v2.3d.new2/configure.ac
--- aespipe-v2.3d.new/configure.ac 2008-11-01 21:02:16.000000000 +0200
+++ aespipe-v2.3d.new2/configure.ac 2008-11-01 22:14:22.000000000 +0200
@@ -7,17 +7,19 @@ dnl Copyright 2002,2003,2004 by Jari Ru
dnl Redistribution of this file is permitted under the GNU Public License.
dnl
-AC_INIT(aespipe, 2)
+AC_INIT([aespipe], [2])
AC_CONFIG_SRCDIR([aespipe.c])
+AC_CONFIG_AUX_DIR([.])
+AC_CANONICAL_HOST
AC_GNU_SOURCE
AC_SYS_LARGEFILE
AC_PROG_CC
AC_CHECK_TOOL([STRIP],[strip])
AC_PROG_MAKE_SET
-AC_CHECK_FUNCS(mlockall)
+AC_CHECK_FUNCS([mlockall])
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(unistd.h fcntl.h sys/mman.h termios.h sys/ioctl.h)
+AC_CHECK_HEADERS([unistd.h fcntl.h sys/mman.h termios.h sys/ioctl.h])
AC_C_BIGENDIAN
AC_C_CONST
AC_TYPE_PID_T
@@ -125,5 +127,12 @@ if test "$x_have_gpg_prog" = yes; then
fi
fi
+case "${host}" in
+ i?86-*) AESPIPE_TARGET="aespipe-x86";;
+ x86_64-*) AESPIPE_TARGET="aespipe-amd64";;
+ *) AESPIPE_TARGET="aespipe-generic";;
+esac
+AC_SUBST([AESPIPE_TARGET])
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
diff -urNp aespipe-v2.3d.new/Makefile.in aespipe-v2.3d.new2/Makefile.in
--- aespipe-v2.3d.new/Makefile.in 2008-11-01 21:09:47.000000000 +0200
+++ aespipe-v2.3d.new2/Makefile.in 2008-11-01 22:17:02.000000000 +0200
@@ -19,11 +19,13 @@ datarootdir = @datarootdir@
INSTALL_STRIP=true
-aespipe: aespipe.o aes.o md5.o sha512.o rmd160.o
+aespipe: @AESPIPE_TARGET@
+
+aespipe-generic: aespipe.o aes.o md5.o sha512.o rmd160.o
$(LINK) -o aespipe aespipe.o aes.o md5.o sha512.o rmd160.o @LIBS@
-x86 i586: aespipe.o aes-x86.o md5-x86.o sha512.o rmd160.o
+aespipe-x86: aespipe.o aes-x86.o md5-x86.o sha512.o rmd160.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
+aespipe-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: $(srcdir)/aespipe.c $(srcdir)/aes.h $(srcdir)/md5.h $(srcdir)/sha512.h $(srcdir)/rmd160.h
$(CC) -o aespipe.o -c "$(srcdir)/aespipe.c"
@@ -32,12 +34,12 @@ aes.o: $(srcdir)/aes.c $(srcdir)/aes.h
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
+ $(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"
+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"
+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"
@@ -111,4 +113,4 @@ test-part5:
echo "NO MD5 TEST" >test-file2
echo "NO MD5 TEST" >test-file5
-.PHONY: aespipe x86 i586 amd64 clean distclean install install-strip tests test-part2 test-part3 test-part4 test-part5
+.PHONY: aespipe aespipe-x86 aespipe-amd64 aespipe-generic clean distclean install install-strip tests test-part2 test-part3 test-part4 test-part5
-
Linux-crypto: cryptography in and on the Linux system
Archive: http://mail.nl.linux.org/linux-crypto/