From cd42379b5ab4e8fc5de024bcdb96750d791cab01 Mon Sep 17 00:00:00 2001 From: Pierre Pronchery Date: Fri, 24 Jul 2009 00:08:27 +0000 Subject: [PATCH] No longer hardcore PREFIX as /usr/pkg --- src/Makefile | 2 +- src/panel.c | 5 ++++- src/project.conf | 1 + 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Makefile b/src/Makefile index c4d89f2..43a9951 100644 --- a/src/Makefile +++ b/src/Makefile @@ -17,7 +17,7 @@ INSTALL = install all: $(TARGETS) panel_OBJS = panel.o main.o -panel_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) $(CFLAGSF) $(CFLAGS) +panel_CFLAGS = $(CPPFLAGSF) $(CPPFLAGS) -D PREFIX=\"$(PREFIX)\" $(CFLAGSF) $(CFLAGS) panel_LDFLAGS = $(LDFLAGSF) $(LDFLAGS) panel: $(panel_OBJS) diff --git a/src/panel.c b/src/panel.c index 70f0f51..5081e3f 100644 --- a/src/panel.c +++ b/src/panel.c @@ -46,6 +46,9 @@ struct _Panel /* constants */ +#ifndef PREFIX +# define PREFIX "/usr/local" +#endif #define PANEL_BORDER_WIDTH 4 #define PANEL_ICON_SIZE 48 @@ -373,7 +376,7 @@ static gint _apps_compare(gconstpointer a, gconstpointer b); static gboolean _panel_idle_apps(gpointer data) { Panel * panel = data; - const char path[] = "/usr/pkg/share/applications"; + const char path[] = PREFIX "/share/applications"; DIR * dir; struct dirent * de; size_t len; diff --git a/src/project.conf b/src/project.conf index 9a5f773..80748a3 100644 --- a/src/project.conf +++ b/src/project.conf @@ -7,6 +7,7 @@ dist=Makefile,panel.h [panel] type=binary sources=panel.c,main.c +cppflags=-D PREFIX=\"$(PREFIX)\" install=$(BINDIR) [main.c]