Check endianness of build with autotools to enable md5 support on more platforms.

This commit is contained in:
Con Kolivas 2012-12-30 13:10:47 +11:00
parent 585113d42d
commit 73e921b862
3 changed files with 18 additions and 2 deletions

View file

@ -109,6 +109,8 @@ fi
AC_C_INLINE AC_C_INLINE
AC_C_BIGENDIAN
AC_CHECK_LIB(pthread, pthread_create, , AC_CHECK_LIB(pthread, pthread_create, ,
AC_MSG_ERROR([Could not find pthread library - please install libpthread])) AC_MSG_ERROR([Could not find pthread library - please install libpthread]))
AC_CHECK_LIB(m, sqrt, , AC_CHECK_LIB(m, sqrt, ,

View file

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2006-2011 Con Kolivas Copyright (C) 2006-2012 Con Kolivas
Copyright (C) 2011 Peter Hyman Copyright (C) 2011 Peter Hyman
Copyright (C) 1998-2003 Andrew Tridgell Copyright (C) 1998-2003 Andrew Tridgell
@ -60,6 +60,19 @@ extern "C"
void *alloca (size_t); void *alloca (size_t);
#endif #endif
#ifdef HAVE_ENDIAN_H
# include <endian.h>
#elif HAVE_SYS_ENDIAN_H
# include <sys/endian.h>
#endif
#ifndef __BYTE_ORDER
# ifdef WORDS_BIGENDIAN
# define __BYTE_ORDER __BIG_ENDIAN
# else
# define __BYTE_ORDER __LITTLE_ENDIAN
# endif
#endif
#ifndef MD5_DIGEST_SIZE #ifndef MD5_DIGEST_SIZE
# define MD5_DIGEST_SIZE 16 # define MD5_DIGEST_SIZE 16
#endif #endif

3
md5.c
View file

@ -1,5 +1,5 @@
/* /*
Copyright (C) 2011 Con Kolivas Copyright (C) 2012 Con Kolivas
Copyright (C) 1995-2011 Ulrich Drepper. Copyright (C) 1995-2011 Ulrich Drepper.
Functions to compute MD5 message digest of files or memory blocks. Functions to compute MD5 message digest of files or memory blocks.
@ -30,6 +30,7 @@
#include <stddef.h> #include <stddef.h>
#include "lrzip_private.h"
#include "md5.h" #include "md5.h"
#if USE_UNLOCKED_IO #if USE_UNLOCKED_IO