mirror of
https://github.com/vxcontrol/lualibs-md5.git
synced 2026-07-01 06:41:59 -04:00
add support for vxbuild-cross build system
This commit is contained in:
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Executable
BIN
Binary file not shown.
Binary file not shown.
Regular → Executable
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
/* force mempcy to be from earlier compatible system */
|
||||
__asm__(".symver memcpy,memcpy@GLIBC_2.2.5");
|
||||
Executable
+1
@@ -0,0 +1 @@
|
||||
P=linux32 C="-m32 -fPIC" L="-m32 -s -static-libgcc" D=libmd5.so A=libmd5.a ./build.sh
|
||||
@@ -1 +1 @@
|
||||
P=linux64 C="-fPIC -include _memcpy.h" L="-s -static-libgcc" D=libmd5.so A=libmd5.a ./build.sh
|
||||
P=linux64 C="-fPIC" L="-s -static-libgcc" D=libmd5.so A=libmd5.a ./build.sh
|
||||
|
||||
Executable
+2
@@ -0,0 +1,2 @@
|
||||
[ `uname` = Linux ] && { export X=i686-w64-mingw32-; }
|
||||
P=mingw32 C="-fPIC" L="-s -static-libgcc" D=md5.dll A=md5.a ./build.sh
|
||||
@@ -1 +1,2 @@
|
||||
P=mingw64 L="-s -static-libgcc" D=md5.dll A=md5.a ./build.sh
|
||||
[ `uname` = Linux ] && { export X=x86_64-w64-mingw32-; }
|
||||
P=mingw64 C="-fPIC" L="-s -static-libgcc" D=md5.dll A=md5.a ./build.sh
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
[ `uname` = Linux ] && export X=x86_64-apple-darwin11-
|
||||
P=osx64 C="-arch x86_64" L="-arch x86_64 -install_name @rpath/libmd5.dylib" \
|
||||
[ `uname` = Linux ] && { export X=x86_64-apple-darwin19-; export CC=clang; }
|
||||
P=osx64 CC=clang C="-arch x86_64 -fPIC" L="-arch x86_64 -lm -install_name @rpath/libmd5.dylib" \
|
||||
D=libmd5.dylib A=libmd5.a ./build.sh
|
||||
|
||||
+4
-2
@@ -1,5 +1,7 @@
|
||||
${X}gcc -c -O2 $C md5.c -Wall -I.
|
||||
${X}gcc *.o -shared -o ../../bin/$P/$D $L
|
||||
[ "$CC" ] || CC=gcc
|
||||
mkdir -p ../../bin/$P
|
||||
${X}${CC} -c -O2 $C md5.c -Wall -I.
|
||||
${X}${CC} *.o -shared -o ../../bin/$P/$D $L
|
||||
rm -f ../../bin/$P/$A
|
||||
${X}ar rcs ../../bin/$P/$A *.o
|
||||
rm *.o
|
||||
|
||||
+3
-3
@@ -196,7 +196,7 @@ static void *body(MD5_CTX *ctx, void *data, unsigned long size)
|
||||
return ptr;
|
||||
}
|
||||
|
||||
void MD5_Init(MD5_CTX *ctx)
|
||||
void MD5_Init_n(MD5_CTX *ctx)
|
||||
{
|
||||
ctx->a = 0x67452301;
|
||||
ctx->b = 0xefcdab89;
|
||||
@@ -207,7 +207,7 @@ void MD5_Init(MD5_CTX *ctx)
|
||||
ctx->hi = 0;
|
||||
}
|
||||
|
||||
void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
|
||||
void MD5_Update_n(MD5_CTX *ctx, void *data, unsigned long size)
|
||||
{
|
||||
MD5_u32plus saved_lo;
|
||||
unsigned long used, free;
|
||||
@@ -241,7 +241,7 @@ void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size)
|
||||
memcpy(ctx->buffer, data, size);
|
||||
}
|
||||
|
||||
void MD5_Final(unsigned char *result, MD5_CTX *ctx)
|
||||
void MD5_Final_n(unsigned char *result, MD5_CTX *ctx)
|
||||
{
|
||||
unsigned long used, free;
|
||||
|
||||
|
||||
+3
-3
@@ -38,8 +38,8 @@ typedef struct {
|
||||
MD5_u32plus block[16];
|
||||
} MD5_CTX;
|
||||
|
||||
extern void MD5_Init(MD5_CTX *ctx);
|
||||
extern void MD5_Update(MD5_CTX *ctx, void *data, unsigned long size);
|
||||
extern void MD5_Final(unsigned char *result, MD5_CTX *ctx);
|
||||
extern void MD5_Init_n(MD5_CTX *ctx);
|
||||
extern void MD5_Update_n(MD5_CTX *ctx, void *data, unsigned long size);
|
||||
extern void MD5_Final_n(unsigned char *result, MD5_CTX *ctx);
|
||||
|
||||
#endif
|
||||
@@ -16,20 +16,20 @@ typedef struct {
|
||||
uint32_t block[16];
|
||||
} MD5_CTX;
|
||||
|
||||
void MD5_Init(MD5_CTX *ctx);
|
||||
void MD5_Update(MD5_CTX *ctx, const uint8_t *data, uint32_t size);
|
||||
void MD5_Final(const uint8_t *result, MD5_CTX *ctx);
|
||||
void MD5_Init_n(MD5_CTX *ctx);
|
||||
void MD5_Update_n(MD5_CTX *ctx, const uint8_t *data, uint32_t size);
|
||||
void MD5_Final_n(const uint8_t *result, MD5_CTX *ctx);
|
||||
]]
|
||||
|
||||
local function digest()
|
||||
local ctx = ffi.new'MD5_CTX'
|
||||
local result = ffi.new'uint8_t[16]'
|
||||
C.MD5_Init(ctx)
|
||||
C.MD5_Init_n(ctx)
|
||||
return function(data, size)
|
||||
if data then
|
||||
C.MD5_Update(ctx, data, size or #data)
|
||||
C.MD5_Update_n(ctx, data, size or #data)
|
||||
else
|
||||
C.MD5_Final(result, ctx)
|
||||
C.MD5_Final_n(result, ctx)
|
||||
return ffi.string(result, 16)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user