ref: 5ae8cb41158a3af9db313ff45d98c20735231ec9
parent: 4506a7ac70b36365f7448c3fe3840550f3230874
author: Roberto E. Vargas Caballero <[email protected]>
date: Sun Jan 24 05:11:44 EST 2016
Move PREFIX to config.mk This prefix needs to be the same for all the toolchain.
--- a/cc1/cc1.h
+++ b/cc1/cc1.h
@@ -1,9 +1,6 @@
#define INPUTSIZ LINESIZ
-#ifndef PREFIX
-#define PREFIX "/usr/"
-#endif
#define GLOBALCTX 0
--- a/cc1/cpp.c
+++ b/cc1/cpp.c
@@ -11,10 +11,6 @@
#include "arch.h"
#include "cc1.h"
-#ifndef PREFIX
-#define PREFIX "/usr/include/local"
-#endif
-
static char *argp, *macroname;
static unsigned arglen;
static Symbol *symline, *symfile;
--- a/config.mk
+++ b/config.mk
@@ -8,10 +8,11 @@
PREFIX = /usr/local/
MANPREFIX = ${PREFIX}/share/man
-CC = cc
+# if your system is not POSIX maybe you want to use cc or gcc
+CC = c99
LD = $(CC)
AR = ar
# for Plan9 add -D_SUSV2_SOURCE -DNBOOL
-CFLAGS = -DNDEBUG -Iarch/$(ARCH) -O2 -std=c99
+CFLAGS = -DNDEBUG -Iarch/$(ARCH) -DPREFIX=\""$(PREFIX)"\"
LDFLAGS = -s
--- a/inc/cc.h
+++ b/inc/cc.h
@@ -16,6 +16,10 @@
#define DBGON()
#endif
+#ifndef PREFIX
+#define PREFIX "/usr/local/"
+#endif
+
extern void die(const char *fmt, ...);
extern void dbg(const char *fmt, ...);
extern void *xmalloc(size_t size);