use CPPFLAGS rather than CFLAGS where appropriate and make LDFLAGS/-rpath dynamic by only enabling when in .svn repo

This commit is contained in:
Mike Frysinger 2007-04-13 13:06:53 +00:00
parent 5ee5f0c661
commit 2348f115c0

View File

@ -64,7 +64,7 @@ LDLIBS_RC = -ldl
LDLIBS_RS = -ldl LDLIBS_RS = -ldl
# Shouldn't need this, but it's the easiest workaround for silly # Shouldn't need this, but it's the easiest workaround for silly
# Linux headers that don't work with -std=c99 # Linux headers that don't work with -std=c99
override CFLAGS += -D_GNU_SOURCE override CPPFLAGS += -D_GNU_SOURCE
endif endif
ifeq ($(OS),BSD) ifeq ($(OS),BSD)
override LDLIBS += -lkvm override LDLIBS += -lkvm
@ -72,20 +72,22 @@ endif
HAVE_PAM = HAVE_PAM =
ifdef HAVE_PAM ifdef HAVE_PAM
CFLAGS_SSD = -DHAVE_PAM CPPFLAGS_SSD = -DHAVE_PAM
LDLIBS_SSD = -lpam LDLIBS_SSD = -lpam
endif endif
# We also define _BSD_SOURCE so both Linux and the BSDs get a few # We also define _BSD_SOURCE so both Linux and the BSDs get a few
# handy functions which makes our lives a lot easier # handy functions which makes our lives a lot easier
override CFLAGS += -DLIB=\"$(LIB)\" override CPPFLAGS += -DLIB=\"$(LIB)\"
# IMPORTANT!!! # IMPORTANT!!!
# Remove this when releasing as it's a security risk # Remove this when releasing as it's a security risk
# However, this does save us using libtool when we're testing # However, this does save us using libtool when we're testing
# NOTE: The toplevel Makefile for baselayout will automatically # NOTE: The toplevel Makefile for baselayout will automatically
# disable then when doing `make dist` # disable then when doing `make dist`
ifneq ($(wildcard .svn),)
override LDFLAGS += -Wl,-rpath . override LDFLAGS += -Wl,-rpath .
endif
all: $(TARGET) all: $(TARGET)
@ -118,7 +120,7 @@ rc: $(LIBEINFOSO) $(LIBRCSO) rc-plugin.o rc.o
runscript: LDLIBS += $(LDLIBS_RS) runscript: LDLIBS += $(LDLIBS_RS)
runscript: $(LIBEINFOSO) $(LIBRCSO) rc-plugin.o runscript.o runscript: $(LIBEINFOSO) $(LIBRCSO) rc-plugin.o runscript.o
start-stop-daemon: CFLAGS += $(CFLAGS_SSD) start-stop-daemon: CPPFLAGS += $(CPPFLAGS_SSD)
start-stop-daemon: LDLIBS += $(LDLIBS_SSD) start-stop-daemon: LDLIBS += $(LDLIBS_SSD)
start-stop-daemon: $(LIBEINFOSO) $(LIBRCSO) start-stop-daemon.o start-stop-daemon: $(LIBEINFOSO) $(LIBRCSO) start-stop-daemon.o