Friday, January 01, 2010
Install dir patch for UCC
I hate apps that hardcode install paths.. I found one while I was messing with UCC (a chinese authored c compiler).
svn diff against the head
Index: ucl/Makefile
===================================================================
--- ucl/Makefile (revision 10)
+++ ucl/Makefile (working copy)
@@ -5,7 +5,7 @@
ucl.c uildasm.c vector.c x86.c x86linux.c
OBJS = $(C_SRC:.c=.o)
CC = gcc
-CFLAGS = -g -D_UCC
+CFLAGS = -g -D_UCC -D"UCCDIR=\"$(UCCDIR)\""
UCC = ../driver/ucc
all: $(OBJS) assert.o
Index: driver/linux.c
===================================================================
--- driver/linux.c (revision 10)
+++ driver/linux.c (working copy)
@@ -4,7 +4,9 @@
#include "ucc.h"
#define _P_WAIT 0
+#ifndef UCCDIR
#define UCCDIR "/usr/local/lib/ucc/"
+#endif
static char *CPPProg[] =
{
Index: driver/Makefile
===================================================================
--- driver/Makefile (revision 10)
+++ driver/Makefile (working copy)
@@ -1,5 +1,5 @@
CC = gcc
-CFLAGS = -g
+CFLAGS = -g -D"UCCDIR=\"$(UCCDIR)\""
all: ucc.c linux.c
$(CC) -o ucc $(CFLAGS) $^
Index: Makefile
===================================================================
--- Makefile (revision 10)
+++ Makefile (working copy)
@@ -1,4 +1,4 @@
-UCCDIR = /usr/local/lib/ucc
+UCCDIR = /opt/ucc/
export UCCDIR
all:
Posted by Stu on 01/01/2010 at 08:42 PM Permalink to this post.
Filed Under : Computers • Development •
Tags: Compiler • Patches • UCC
(0) Comments
Filed Under : Computers • Development •
Tags: Compiler • Patches • UCC
(0) Comments
Page 1 of 1 pages