aboutsummaryrefslogtreecommitdiffstats
path: root/com32
diff options
context:
space:
mode:
Diffstat (limited to 'com32')
-rw-r--r--com32/lib/MCONFIG3
-rw-r--r--com32/libutil/Makefile8
-rw-r--r--com32/libutil/sha256crypt.c5
-rw-r--r--com32/libutil/sha512crypt.c5
-rw-r--r--com32/menu/Makefile7
-rw-r--r--com32/menu/menumain.c2
-rw-r--r--com32/modules/Makefile5
-rw-r--r--com32/samples/Makefile5
8 files changed, 28 insertions, 12 deletions
diff --git a/com32/lib/MCONFIG b/com32/lib/MCONFIG
index 781292ba..7f88055a 100644
--- a/com32/lib/MCONFIG
+++ b/com32/lib/MCONFIG
@@ -28,7 +28,8 @@ LIBFLAGS = -DDYNAMIC_CRC_TABLE -DPNG_NO_CONSOLE_IO \
# fallback anyway, just use that on old machines...
# LIBFLAGS += -DPNG_NO_FLOATING_POINT_SUPPORTED
-REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ -I. -I./sys -I../include
+REQFLAGS = $(GCCOPT) -g -mregparm=3 -DREGPARM=3 -D__COM32__ \
+ -nostdinc -iwithprefix include -I. -I./sys -I../include
OPTFLAGS = -Os -march=i386 -falign-functions=0 -falign-jumps=0 \
-falign-labels=0 -ffast-math -fomit-frame-pointer
WARNFLAGS = -W -Wall -Wpointer-arith -Wwrite-strings -Wstrict-prototypes -Winline
diff --git a/com32/libutil/Makefile b/com32/libutil/Makefile
index 426c3335..d9f2a6c8 100644
--- a/com32/libutil/Makefile
+++ b/com32/libutil/Makefile
@@ -42,7 +42,11 @@ AR = ar
NASM = nasm
NASMOPT = -O9999
RANLIB = ranlib
-CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -D__COM32__ -W -Wall -march=i386 -Os -fomit-frame-pointer -I./include -I../include
+CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
+ -fomit-frame-pointer -D__COM32__ \
+ -nostdinc -iwithprefix include \
+ -I./include -I../include \
+ -Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
SFLAGS = $(M32) -D__COM32__ -march=i386
LDFLAGS = -T ../lib/com32.ld
LNXCFLAGS = -I./include -W -Wall -O -g -D_GNU_SOURCE
@@ -112,3 +116,5 @@ spotless: clean
install: all
mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
install -m 644 libutil_com.a libutil_lnx.a $(INSTALLROOT)$(COM32DIR)
+
+-include .*.d
diff --git a/com32/libutil/sha256crypt.c b/com32/libutil/sha256crypt.c
index 7dbd8faf..27f912e7 100644
--- a/com32/libutil/sha256crypt.c
+++ b/com32/libutil/sha256crypt.c
@@ -10,11 +10,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
+#include <minmax.h>
#include <sys/types.h>
#include "xcrypt.h"
+#define MIN(x,y) min(x,y)
+#define MAX(x,y) max(x,y)
+
/* Structure to save state of computation between the single steps. */
struct sha256_ctx
{
diff --git a/com32/libutil/sha512crypt.c b/com32/libutil/sha512crypt.c
index 9ff587b8..9553ec1e 100644
--- a/com32/libutil/sha512crypt.c
+++ b/com32/libutil/sha512crypt.c
@@ -10,11 +10,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
+#include <minmax.h>
#include <sys/types.h>
#include "xcrypt.h"
+#define MIN(x,y) min(x,y)
+#define MAX(x,y) max(x,y)
+
/* Structure to save state of computation between the single steps. */
struct sha512_ctx
{
diff --git a/com32/menu/Makefile b/com32/menu/Makefile
index b898ce08..4e0abc55 100644
--- a/com32/menu/Makefile
+++ b/com32/menu/Makefile
@@ -16,7 +16,7 @@
TMPFILE = $(shell mktemp /tmp/gcc_ok.XXXXXX)
-gcc_ok = $(shell tmpf=$(TMPFILE); if gcc $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
+gcc_ok = $(shell tmpf=$(TMPFILE); if $(CC) $(1) -c -x c /dev/null -o $$tmpf 2>/dev/null; \
then echo $(1); else echo $(2); fi; rm -f $$tmpf)
M32 := $(call gcc_ok,-m32,) $(call gcc_ok,-fno-stack-protector,)
@@ -28,8 +28,9 @@ NASM = nasm
NASMOPT = -O9999
RANLIB = ranlib
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
- -fomit-frame-pointer -I../libutil/include -I../include \
- -D__COM32__ \
+ -fomit-frame-pointer -D__COM32__ \
+ -nostdinc -iwithprefix include \
+ -I../libutil/include -I../include \
-Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
LNXCFLAGS = -W -Wall -O -g -I../libutil/include -D_GNU_SOURCE
LNXSFLAGS = -g
diff --git a/com32/menu/menumain.c b/com32/menu/menumain.c
index ac1f9439..f79d00e4 100644
--- a/com32/menu/menumain.c
+++ b/com32/menu/menumain.c
@@ -803,7 +803,7 @@ run_menu(void)
to_clear = 0;
}
- this_timeout = min(min(key_timeout, timeout_left), CLK_TCK);
+ this_timeout = min(min(key_timeout, timeout_left), (clock_t)CLK_TCK);
key = mygetkey(this_timeout);
if ( key != KEY_NONE ) {
diff --git a/com32/modules/Makefile b/com32/modules/Makefile
index 88c8593e..4849d1cd 100644
--- a/com32/modules/Makefile
+++ b/com32/modules/Makefile
@@ -28,8 +28,9 @@ NASM = nasm
NASMOPT = -O9999
RANLIB = ranlib
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
- -fomit-frame-pointer -I../libutil/include -I../include \
- -D__COM32__ \
+ -fomit-frame-pointer -D__COM32__ \
+ -nostdinc -iwithprefix include \
+ -I../libutil/include -I../include \
-Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
LNXCFLAGS = -W -Wall -O -g -I../libutil/include
LNXSFLAGS = -g
diff --git a/com32/samples/Makefile b/com32/samples/Makefile
index f17911d7..177f351e 100644
--- a/com32/samples/Makefile
+++ b/com32/samples/Makefile
@@ -28,8 +28,9 @@ NASM = nasm
NASMOPT = -O9999
RANLIB = ranlib
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -march=i386 -Os \
- -fomit-frame-pointer -I../libutil/include -I../include \
- -D__COM32__ \
+ -fomit-frame-pointer -D__COM32__ \
+ -nostdinc -iwithprefix include \
+ -I../libutil/include -I../include \
-Wp,-MT,$@,-MD,$(dir $@).$(notdir $@).d
LNXCFLAGS = -W -Wall -O -g -I../libutil/include
LNXSFLAGS = -g