# 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
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
install: all
mkdir -m 755 -p $(INSTALLROOT)$(COM32DIR)
install -m 644 libutil_com.a libutil_lnx.a $(INSTALLROOT)$(COM32DIR)
+
+-include .*.d
#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
{
#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
{
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,)
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
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 ) {
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
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
LD = ld -m elf_i386
OBJCOPY = objcopy
OPTFLAGS = -g -Os -march=i386 -falign-functions=0 -falign-jumps=0 -falign-loops=0 -fomit-frame-pointer
-INCLUDES = -include code16.h -I. -I.. -I../libfat -I ../libinstaller
+INCLUDES = -include code16.h -nostdinc -iwithprefix include \
+ -I. -I.. -I../libfat -I ../libinstaller
CFLAGS = $(M32) -mregparm=3 -DREGPARM=3 -W -Wall -msoft-float $(OPTFLAGS) $(INCLUDES)
LDFLAGS = -T com16.ld
AR = ar