diff --git a/.gitignore b/.gitignore
index 3fb3452..ed29992 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,4 @@
+*~
*.a
/c3-*/
/c3-*.tar.gz
@@ -12,6 +13,8 @@ c3s/c3s_debug
config.mk
*.core
*.css
+*.dll
+*.exe
*.gcno
*.html
ic3/ic3
diff --git a/config.subr b/config.subr
index 6134807..379e9c4 100644
--- a/config.subr
+++ b/config.subr
@@ -74,21 +74,23 @@ config_gnu() {
}
config_include() {
- OUT=".config_$1.c"
+ OUT=".config_$1"
+ OUT_C=".config_$1.c"
shift
- echo "/* generated by configure */" > "$OUT"
+ echo "/* generated by configure */" > "$OUT_C"
while [ $# -gt 1 ]; do
- echo "#include <$1>" >> "$OUT"
+ echo "#include <$1>" >> "$OUT_C"
shift
done
- echo "int main () { return 0; }" >> "$OUT"
- if ${CC} ${CPPFLAGS} ${CFLAGS} "$OUT" -o /dev/null 2>/dev/null; then
+ echo "int main () { return 0; }" >> "$OUT_C"
+ if ${CC} ${CPPFLAGS} ${CFLAGS} "$OUT_C" -o "$OUT"; then
echo "#define $1 1" >> "${CONFIG_H}"
eval "$1=Yes"
else
echo "#define $1 0" >> "${CONFIG_H}"
eval "$1=No"
fi
+ rm "$OUT_C"
rm "$OUT"
}
@@ -214,7 +216,7 @@ if ${HAVE_GCOV}; then
fi
if [ "x$GMAKE" = "x" ]; then
- if test -n $(which gmake); then
+ if which gmake 2>/dev/null; then
GMAKE=gmake
else
GMAKE=make
@@ -245,7 +247,7 @@ echo "LIBTOOL = $LIBTOOL" >> ${CONFIG_MK}
PREFIX="${PREFIX:-/usr/local}"
echo "PREFIX = $PREFIX" >> ${CONFIG_MK}
echo "DESTDIR ?=" >> ${CONFIG_MK}
-echo "prefix ?= ${DESTDIR}/${PREFIX}" >> ${CONFIG_MK}
+echo "prefix ?= ${DESTDIR}${PREFIX}" >> ${CONFIG_MK}
if [ "x$OWNER" = "x" ]; then
OWNER="$(ls -ld "$PREFIX" | tr -s ' ' | cut -d ' ' -f 3)"
diff --git a/configure b/configure
index 5961bb7..3e3c2ec 100755
--- a/configure
+++ b/configure
@@ -35,7 +35,7 @@ echo "HAVE_ASAN = ${HAVE_ASAN}" >> ${CONFIG_MK}
update_config_mk
-( cd libffi && sh autogen.sh && MAKE=gmake ./configure --prefix "${PREFIX}" --disable-multi-os-directory; )
+( cd libffi && sh autogen.sh && MAKE="${GMAKE}" ./configure --prefix "${PREFIX}" --disable-multi-os-directory --disable-dependency-tracking; )
( cd libtommath && ./configure; )
( cd ucd2c && ./configure; )
( cd libc3 && ./configure; )
diff --git a/libc3/sha1.h b/libc3/sha1.h
index 6cf975f..44154a2 100644
--- a/libc3/sha1.h
+++ b/libc3/sha1.h
@@ -13,6 +13,8 @@
#ifndef LIBC3_SHA1_H
#define LIBC3_SHA1_H
+#include "config.h"
+
#if HAVE_SHA1_H
# include <sha1.h>
#else