From: Chris Porter Date: Sat, 8 Feb 2014 00:31:56 +0000 (+0000) Subject: Add ability to set osvars in configure.ini.local and split -fPIC out. X-Git-Url: https://jfr.im/git/irc/quakenet/newserv.git/commitdiff_plain/49378f957519b8f42f28e72d7fa4b2af94c264d3 Add ability to set osvars in configure.ini.local and split -fPIC out. --HG-- branch : chanserv-live --- diff --git a/Makefile b/Makefile index 4bd32f3d..22e42e36 100644 --- a/Makefile +++ b/Makefile @@ -16,7 +16,7 @@ OBJS += lib/hmac.o lib/prng.o lib/stringbuf.o lib/cbc.o all: $(DIRS) newserv newserv: $(OBJS) - $(CC) $(CFLAGS) -Wl,--export-dynamic $(LDFLAGS) -o $@ $^ $(LIBDL) -lm + $(CC) $(CFLAGS) -Wl,--export-dynamic $(LDFLAGS) -o $@ $^ $(LIBDL) $(EXECFLAGS) -lm $(DIRS): cd $@ && $(MAKE) $(MFLAGS) all diff --git a/build.mk.in b/build.mk.in index 06d39d2d..002885e5 100644 --- a/build.mk.in +++ b/build.mk.in @@ -26,7 +26,7 @@ default: all .c.o: @if [ ! -d .deps ]; then mkdir .deps || true; fi - $(CC) $(CFLAGS) -MMD -MF .deps/$(subst .o,.d,$@) -c -o $@ $< + $(CC) $(CFLAGS) -MMD -MF .deps/$(subst .o,.d,$@) -fPIC -c -o $@ $< .o.so: $(CC) -nostartfiles -Wl,--export-dynamic -shared -o $@ $^ $(LDFLAGS) @@ -35,8 +35,9 @@ default: all .l.c: ; -CFLAGS+=-I. -I.. -DBUILDID=$(BUILDID) -fPIC +CFLAGS+=-I. -I.. -DBUILDID=$(BUILDID) CFLAGS+=-Wall -g -finline-functions -funroll-loops -Werror=format-security +EXECFLAGS= ifndef NOC99 CFLAGS+=-std=c99 diff --git a/configure b/configure index 358fd4c3..6538c54e 100755 --- a/configure +++ b/configure @@ -138,6 +138,10 @@ class MultiConfigureIniParser(ConfigureIniParser): if c2.has_key("options"): self.options.update(c2["options"]) + if c2.has_key("osvars"): + for k, v in c2.keys("osvars"): + self.osflags.setdefault(k, []).append(v) + def librarycheck(libraries, includes, libs): def findlibrarypaths(library, x, includes, libs): if x["alwayspresent"]: diff --git a/sqlite/Makefile b/sqlite/Makefile index 1b1335dd..f883dea5 100644 --- a/sqlite/Makefile +++ b/sqlite/Makefile @@ -6,7 +6,7 @@ LDFLAGS+=-lc all: sqlite.so sqlite-dbapi2.so libsqlite3.o: libsqlite3.c libsqlite3/sqlite3.c - $(CC) $(CFLAGS) -c libsqlite3.c -w + $(CC) $(CFLAGS) -c libsqlite3.c -fPIC -w sqlite.so: sqlite.o libsqlite3.o