summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorA. Wilcox <AWilcox@Wilcox-Tech.com>2017-10-26 22:42:12 -0500
committerA. Wilcox <AWilcox@Wilcox-Tech.com>2017-10-26 22:42:12 -0500
commita3cf0708df351e9b54080bec7e045dc651aec48f (patch)
tree92d285b9a28237b9fad48e2e269a9f03a59091da /Makefile
parent03c6a554cf066cc24eeb009d4233f4e5117a513c (diff)
downloadgcompat-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.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile7
1 files changed, 5 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index b014afc..c595290 100644
--- a/Makefile
+++ b/Makefile
@@ -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}