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:
parent
3d064fa68d
commit
b976e79b0f
@ -38,7 +38,7 @@ else
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Optional features.
|
# Optional features.
|
||||||
mpw_color=1 # Colorized Identicon, requires libncurses-dev
|
mpw_color=0 # Colorized Identicon, requires libncurses-dev
|
||||||
|
|
||||||
|
|
||||||
### DEPENDENCIES
|
### DEPENDENCIES
|
||||||
@ -200,10 +200,6 @@ mpw() {
|
|||||||
-I"lib/scrypt/lib" -I"lib/scrypt/libcperciva"
|
-I"lib/scrypt/lib" -I"lib/scrypt/libcperciva"
|
||||||
)
|
)
|
||||||
LDFLAGS=(
|
LDFLAGS=(
|
||||||
# library paths
|
|
||||||
-L"." -L"lib/scrypt"
|
|
||||||
# link libraries
|
|
||||||
-l"crypto"
|
|
||||||
# scrypt
|
# scrypt
|
||||||
"lib/scrypt/scrypt-crypto_aesctr.o"
|
"lib/scrypt/scrypt-crypto_aesctr.o"
|
||||||
"lib/scrypt/scrypt-sha256.o"
|
"lib/scrypt/scrypt-sha256.o"
|
||||||
@ -211,6 +207,10 @@ mpw() {
|
|||||||
"lib/scrypt/scrypt-memlimit.o"
|
"lib/scrypt/scrypt-memlimit.o"
|
||||||
"lib/scrypt/scrypt-scryptenc_cpuperf.o"
|
"lib/scrypt/scrypt-scryptenc_cpuperf.o"
|
||||||
"lib/scrypt/scrypt-scryptenc.o"
|
"lib/scrypt/scrypt-scryptenc.o"
|
||||||
|
# library paths
|
||||||
|
-L"." -L"lib/scrypt"
|
||||||
|
# link libraries
|
||||||
|
-l"crypto"
|
||||||
)
|
)
|
||||||
# optional features
|
# optional features
|
||||||
(( mpw_color )) && CFLAGS+=( -DCOLOR ) LDFLAGS+=( -l"curses" )
|
(( mpw_color )) && CFLAGS+=( -DCOLOR ) LDFLAGS+=( -l"curses" )
|
||||||
@ -234,11 +234,6 @@ mpw-bench() {
|
|||||||
-I"lib/bcrypt"
|
-I"lib/bcrypt"
|
||||||
)
|
)
|
||||||
LDFLAGS=(
|
LDFLAGS=(
|
||||||
# library paths
|
|
||||||
-L"." -L"lib/scrypt"
|
|
||||||
-L"lib/bcrypt"
|
|
||||||
# libraries
|
|
||||||
-l"crypto"
|
|
||||||
# scrypt
|
# scrypt
|
||||||
"lib/scrypt/scrypt-crypto_aesctr.o"
|
"lib/scrypt/scrypt-crypto_aesctr.o"
|
||||||
"lib/scrypt/scrypt-sha256.o"
|
"lib/scrypt/scrypt-sha256.o"
|
||||||
@ -251,6 +246,11 @@ mpw-bench() {
|
|||||||
"lib/bcrypt/crypt_gensalt.o"
|
"lib/bcrypt/crypt_gensalt.o"
|
||||||
"lib/bcrypt/wrapper.o"
|
"lib/bcrypt/wrapper.o"
|
||||||
"lib/bcrypt/x86.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 "$@"
|
cc "${CFLAGS[@]}" -c types.c -o types.o "$@"
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
// Copyright (c) 2012 Lyndir. All rights reserved.
|
// Copyright (c) 2012 Lyndir. All rights reserved.
|
||||||
//
|
//
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
@ -198,6 +199,7 @@ const char *Hex(const void *buf, size_t length) {
|
|||||||
return id;
|
return id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef COLOR
|
||||||
int putvari;
|
int putvari;
|
||||||
char *putvarc = NULL;
|
char *putvarc = NULL;
|
||||||
bool istermsetup = false;
|
bool istermsetup = false;
|
||||||
@ -214,6 +216,7 @@ static int putvar(int c) {
|
|||||||
putvarc[putvari++]=c;
|
putvarc[putvari++]=c;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
const char *Identicon(const char *userName, const char *masterPassword) {
|
const char *Identicon(const char *userName, const char *masterPassword) {
|
||||||
const char *leftArm[] = { "╔", "╚", "╰", "═" };
|
const char *leftArm[] = { "╔", "╚", "╰", "═" };
|
||||||
|
Loading…
Reference in New Issue
Block a user