From e395c9f33617222391d4d8801e16de1a20b544e6 Mon Sep 17 00:00:00 2001 From: Simon Wilkinson Date: Tue, 5 Oct 2010 01:20:32 +0100 Subject: [PATCH] hcrypto: Fix builds on Irix The recent hcrypto pullup added a depedence on the errx() function, which isn't present on Irix. Solve this by pulling in a load more of libroken, in order to provide this function. In the long term, libroken should get split out into its own directory, and the ability to use a previously installed libroken should be added. For now, this will hopefully get Irix on its feet again. Change-Id: I0642f80079e113403cbef6eca03ca652616ddc61 Reviewed-on: http://gerrit.openafs.org/2904 Reviewed-by: Derrick Brashear Tested-by: Derrick Brashear --- acinclude.m4 | 26 +++++++++++++++++++++++ src/config/Makefile.config.in | 2 ++ src/crypto/hcrypto/Makefile.in | 48 ++++++++++++++++++++++++++++++++++++++---- src/crypto/hcrypto/roken.h | 4 ++++ 4 files changed, 76 insertions(+), 4 deletions(-) diff --git a/acinclude.m4 b/acinclude.m4 index 4adcb9d..25a013e 100644 --- a/acinclude.m4 +++ b/acinclude.m4 @@ -1289,6 +1289,32 @@ AC_CHECK_FUNCS([ \ vsyslog \ ]) +dnl Functions that we're going to try and get from libroken + +AC_REPLACE_FUNCS([ \ + err \ + errx \ + getprogname \ + strlcpy \ + verr \ + verrx \ + vwarn \ + vwarnx \ + warn \ + warnx \ +]) + +dnl Headers that we're going to try and get from libroken +AC_CHECK_HEADERS([ \ + err.h \ +]) + +ROKEN_HEADERS= +AS_IF([test "$ac_cv_header_err_h" != "yes" ], + [ROKEN_HEADERS="$ROKEN_HEADERS err.h"], + []) +AC_SUBST(ROKEN_HEADERS) + AC_MSG_CHECKING([for positional I/O]) if test "$ac_cv_func_pread" = "yes" && \ test "$ac_cv_func_pwrite" = "yes"; then diff --git a/src/config/Makefile.config.in b/src/config/Makefile.config.in index 4199b5a..1be3eed 100644 --- a/src/config/Makefile.config.in +++ b/src/config/Makefile.config.in @@ -79,6 +79,8 @@ RANLIB = @RANLIB@ REGEX_OBJ = @REGEX_OBJ@ RM = @RM@ RXDEBUG = @RXDEBUG@ +ROKEN_HEADERS = @ROKEN_HEADERS@ +ROKEN_LIBOBJS = @LIBOBJS@ SHLIB_CFLAGS = @SHLIB_CFLAGS@ SHLIB_LDFLAGS = @SHLIB_LDFLAGS@ SHLIB_LINKER = @SHLIB_LINKER@ diff --git a/src/crypto/hcrypto/Makefile.in b/src/crypto/hcrypto/Makefile.in index b83f0d7..93b6703 100644 --- a/src/crypto/hcrypto/Makefile.in +++ b/src/crypto/hcrypto/Makefile.in @@ -35,7 +35,7 @@ HEADERS= ${TOP_INCDIR}/hcrypto/aes.h \ SHLIBOBJ= libafshcrypto.${SHLIB_SUFFIX}.${LIBMAJOR}.${LIBMINOR} -all: ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \ +all: $(ROKEN_HEADERS) ${HEADERS} ${TOP_LIBDIR}/${SHLIBOBJ} \ ${TOP_LIBDIR}/libafshcrypto.a \ ${TOP_LIBDIR}/libafshcrypto_lwp.a @@ -58,11 +58,11 @@ COMMON_OBJS= aes.o camellia.o camellia-ntt.o des.o engine.o evp.o \ rand-egd.o rand-timer.o rand-unix.o rand.o rc2.o rc4.o \ rijndael-alg-fst.o rnd_keys.o sha.o sha256.o sha512.o ui.o \ validate.o \ - cloexec.o ct.o issuid.o net_read.o net_write.o strlcpy.o + cloexec.o ct.o issuid.o net_read.o net_write.o warnerr.o -OBJECTS = $(COMMON_OBJS) rand-fortuna.o +OBJECTS = $(COMMON_OBJS) rand-fortuna.o $(ROKEN_LIBOBJS) -LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o +LWP_OBJS = $(COMMON_OBJS) rand-fortuna_lwp.o $(ROKEN_LIBOBJS) UPSTREAM= ${TOP_SRCDIR}/external/heimdal @@ -270,6 +270,9 @@ validate.o: ${UPSTREAM}/hcrypto/validate.c test_cipher.o: ${UPSTREAM}/hcrypto/test_cipher.c ${CCRULE} -I${UPSTREAM}/roken/ +# These bits of libroken are new functionality, rather than compatibility +# code. Where they should go eventually is unclear. + cloexec.o: ${UPSTREAM}/roken/cloexec.c ${CCRULE} @@ -288,5 +291,42 @@ net_read.o: ${UPSTREAM}/roken/net_read.c net_write.o: ${UPSTREAM}/roken/net_write.c ${CCRULE} +# These bits of libroken are compatibility functions. They should get moved +# out into a new libroken top level target, which allows the use of an +# existing libroken, if one is available. + strlcpy.o: ${UPSTREAM}/roken/strlcpy.c ${CCRULE} + +err.h: ${UPSTREAM}/roken/err.hin + cp $? $@ + +err.o: ${UPSTREAM}/roken/err.c + ${CCRULE} + +errx.o: ${UPSTREAM}/roken/errx.c + ${CCRULE} + +getprogname.o: ${UPSTREAM}/roken/getprogname.c + ${CCRULE} + +verr.o: ${UPSTREAM}/roken/verr.c + ${CCRULE} + +verrx.o: ${UPSTREAM}/roken/verrx.c + ${CCRULE} + +vwarn.o: ${UPSTREAM}/roken/vwarn.c + ${CCRULE} + +vwarnx.o: ${UPSTREAM}/roken/vwarnx.c + ${CCRULE} + +warn.o: ${UPSTREAM}/roken/warn.c + ${CCRULE} + +warnerr.o: ${UPSTREAM}/roken/warnerr.c + ${CCRULE} + +warnx.o: ${UPSTREAM}/roken/warnx.c + ${CCRULE} diff --git a/src/crypto/hcrypto/roken.h b/src/crypto/hcrypto/roken.h index c830eae..ec75282 100644 --- a/src/crypto/hcrypto/roken.h +++ b/src/crypto/hcrypto/roken.h @@ -49,3 +49,7 @@ ROKEN_LIB_FUNCTION size_t ROKEN_LIB_CALL /* This is a bodge, but it's only used by the tests */ #define emalloc(x) malloc(x) + +#ifndef HAVE_GETPROGNAME +ROKEN_LIB_FUNCTION const char * ROKEN_LIB_CALL getprogname(void); +#endif -- 1.9.4