diff options
author | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-10-26 22:42:12 -0500 |
---|---|---|
committer | A. Wilcox <AWilcox@Wilcox-Tech.com> | 2017-10-26 22:42:12 -0500 |
commit | a3cf0708df351e9b54080bec7e045dc651aec48f (patch) | |
tree | 92d285b9a28237b9fad48e2e269a9f03a59091da | |
parent | 03c6a554cf066cc24eeb009d4233f4e5117a513c (diff) | |
download | gcompat-a3cf0708df351e9b54080bec7e045dc651aec48f.tar.gz gcompat-a3cf0708df351e9b54080bec7e045dc651aec48f.tar.bz2 gcompat-a3cf0708df351e9b54080bec7e045dc651aec48f.tar.xz gcompat-a3cf0708df351e9b54080bec7e045dc651aec48f.zip |
Makefile: Ensure correct compilation on GCC 4.x
On GCC 4.9.4, at least backtrace.c fails to compile because of variable
declaration in a for statement, which requires -std=c99 or -std=c11.
Since we are using ISO C mode instead of a GNU standard, we additionally
must define _BSD_SOURCE to expose Dl_info for the dl code.
-rw-r--r-- | Makefile | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -30,13 +30,16 @@ LOADER_PATH = /lib/${LOADER_NAME} all: ${LIBGCOMPAT_NAME} ${LOADER_NAME} ${LIBGCOMPAT_NAME}: ${LIBGCOMPAT_OBJ} - $(CC) -o ${LIBGCOMPAT_NAME} -Wl,-soname,${LIBGCOMPAT_NAME} -shared ${LIBGCOMPAT_OBJ} + $(CC) -o ${LIBGCOMPAT_NAME} -Wl,-soname,${LIBGCOMPAT_NAME} \ + -shared ${LIBGCOMPAT_OBJ} ${LOADER_NAME}: ${LOADER_OBJ} $(CC) -o ${LOADER_NAME} -fPIE -static ${LOADER_OBJ} .c.o: - $(CC) -fPIC -DPIC -DLINKER=\"${LINKER_PATH}\" -DLIBGCOMPAT=\"${LIBGCOMPAT_PATH}\" ${CFLAGS} ${CPPFLAGS} -c -o $@ $< + $(CC) -std=c99 -D_BSD_SOURCE -fPIC -DPIC -DLINKER=\"${LINKER_PATH}\" \ + -DLIBGCOMPAT=\"${LIBGCOMPAT_PATH}\" ${CFLAGS} ${CPPFLAGS} \ + -c -o $@ $< clean: rm -f libgcompat/*.o loader/*.o ${LIBGCOMPAT_NAME} ${LOADER_NAME} |