2
0

Ensure we use the correct C language standard.

This commit is contained in:
Maarten Billemont 2014-10-15 15:32:10 -04:00
parent 5268039c3d
commit 6aa50bac04
2 changed files with 13 additions and 9 deletions

View File

@ -31,12 +31,12 @@ if ! [[ -e lib/scrypt/scrypt-scryptenc.o ]]; then
if [[ ! -e configure.ac ]]; then if [[ ! -e configure.ac ]]; then
# libscrypt needs sources. # libscrypt needs sources.
source .source source .source
if hash git-svn; then if hash git-svn 2>/dev/null; then
echo echo
echo "Fetching libscrypt using git-svn..." echo "Fetching libscrypt using git-svn..."
git-svn clone --prefix=origin/ --stdlayout "$svn" . git-svn clone --prefix=origin/ --stdlayout "$svn" .
printf '%s' "$(git describe --always)" > scrypt-version printf '%s' "$(git describe --always)" > scrypt-version
elif hash svn; then elif hash svn 2>/dev/null; then
echo echo
echo "Fetching libscrypt using svn..." echo "Fetching libscrypt using svn..."
svn checkout http://scrypt.googlecode.com/svn/trunk/ . svn checkout http://scrypt.googlecode.com/svn/trunk/ .
@ -73,19 +73,21 @@ echo
echo "Building mpw..." echo "Building mpw..."
cc() { cc() {
if hash llvm-gcc; then if hash llvm-gcc 2>/dev/null; then
llvm-gcc -Qunused-arguments "$@" llvm-gcc -std=c11 "$@"
else else
gcc "$@" gcc -std=gnu99 "$@"
fi fi
} }
### MPW ### MPW
options+=( CFLAGS=(
# include paths. # include paths.
-I"lib/scrypt/lib" -I"lib/scrypt/libcperciva" -I"lib/scrypt/lib" -I"lib/scrypt/libcperciva"
)
LDFLAGS=(
# library paths. # library paths.
-L"." -L"lib/scrypt" -L"." -L"lib/scrypt"
# link libraries. # link libraries.
@ -98,6 +100,6 @@ options+=(
-l"crypto" -l"crypto"
) )
cc "${options[@]}" -std=c99 -c types.c -o types.o "$@" cc "${CFLAGS[@]}" "${options[@]}" -c types.c -o types.o "$@"
cc "${options[@]}" -std=c99 -l"types.o" mpw.c -o mpw "$@" cc "${CFLAGS[@]}" "${LDFLAGS[@]}" "${options[@]}" "types.o" mpw.c -o mpw "$@"
echo "done! Now run ./install or use ./mpw" echo "done! Now run ./install or use ./mpw"

View File

@ -1,4 +1,6 @@
#define _WITH_GETLINE #define _ISOC11_SOURCE 1
#define __STDC_VERSION__ 201112L
#include <stdio.h> #include <stdio.h>
#include <sys/ioctl.h> #include <sys/ioctl.h>
#include <sys/types.h> #include <sys/types.h>