2
0

Fix some mpw.c link errors.

[FIXED]     Libraries should be specified after the objects that need them for some compilers apparently..
[FIXED]     bool type requires stdbool.h, disable more color code when COLOR not defined.
[UPDATED]   Disable mpw_color by default as it doesn't link cleanly on some Linux'es for now..
This commit is contained in:
Maarten Billemont 2014-12-05 13:51:02 -05:00
parent 3d064fa68d
commit b976e79b0f
2 changed files with 13 additions and 10 deletions

View File

@ -38,7 +38,7 @@ else
fi
# Optional features.
mpw_color=1 # Colorized Identicon, requires libncurses-dev
mpw_color=0 # Colorized Identicon, requires libncurses-dev
### DEPENDENCIES
@ -200,10 +200,6 @@ mpw() {
-I"lib/scrypt/lib" -I"lib/scrypt/libcperciva"
)
LDFLAGS=(
# library paths
-L"." -L"lib/scrypt"
# link libraries
-l"crypto"
# scrypt
"lib/scrypt/scrypt-crypto_aesctr.o"
"lib/scrypt/scrypt-sha256.o"
@ -211,6 +207,10 @@ mpw() {
"lib/scrypt/scrypt-memlimit.o"
"lib/scrypt/scrypt-scryptenc_cpuperf.o"
"lib/scrypt/scrypt-scryptenc.o"
# library paths
-L"." -L"lib/scrypt"
# link libraries
-l"crypto"
)
# optional features
(( mpw_color )) && CFLAGS+=( -DCOLOR ) LDFLAGS+=( -l"curses" )
@ -234,11 +234,6 @@ mpw-bench() {
-I"lib/bcrypt"
)
LDFLAGS=(
# library paths
-L"." -L"lib/scrypt"
-L"lib/bcrypt"
# libraries
-l"crypto"
# scrypt
"lib/scrypt/scrypt-crypto_aesctr.o"
"lib/scrypt/scrypt-sha256.o"
@ -251,6 +246,11 @@ mpw-bench() {
"lib/bcrypt/crypt_gensalt.o"
"lib/bcrypt/wrapper.o"
"lib/bcrypt/x86.o"
# library paths
-L"." -L"lib/scrypt"
-L"lib/bcrypt"
# libraries
-l"crypto"
)
cc "${CFLAGS[@]}" -c types.c -o types.o "$@"

View File

@ -6,6 +6,7 @@
// Copyright (c) 2012 Lyndir. All rights reserved.
//
#include <stdbool.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -198,6 +199,7 @@ const char *Hex(const void *buf, size_t length) {
return id;
}
#ifdef COLOR
int putvari;
char *putvarc = NULL;
bool istermsetup = false;
@ -214,6 +216,7 @@ static int putvar(int c) {
putvarc[putvari++]=c;
return 0;
}
#endif
const char *Identicon(const char *userName, const char *masterPassword) {
const char *leftArm[] = { "", "", "", "" };