aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Benjamin Barenblat <bbaren@mit.edu>2015-08-07 16:47:44 -0400
committerGravatar Benjamin Barenblat <bbaren@mit.edu>2015-08-07 16:47:44 -0400
commitde4d33d7e4362d0421fd088f2d5c43f38b7f0ce8 (patch)
treeeae256bf04f936e4403c3bcb39b53889509d50ce
parent12fe5a33f733de39d7e004dd6fd5d958e8da525a (diff)
Harden build; build staticallyHEADmaster
-rw-r--r--config.mk19
1 files changed, 12 insertions, 7 deletions
diff --git a/config.mk b/config.mk
index 67844dc..8a71140 100644
--- a/config.mk
+++ b/config.mk
@@ -4,7 +4,7 @@ VERSION = 0.6
# Customize below to fit your system
# paths
-PREFIX = /usr/local
+PREFIX = ${HOME}/.local
MANPREFIX = ${PREFIX}/share/man
X11INC = /usr/X11R6/include
@@ -14,14 +14,19 @@ X11LIB = /usr/X11R6/lib
INCS = -I. -I/usr/include -I${X11INC} \
`pkg-config --cflags fontconfig` \
`pkg-config --cflags freetype2`
-LIBS = -L/usr/lib -lc -L${X11LIB} -lm -lrt -lX11 -lutil -lXext -lXft \
- `pkg-config --libs fontconfig` \
- `pkg-config --libs freetype2`
+LIBS = -L/usr/lib -L${X11LIB} \
+ -lc -lrt \
+ -lutil \
+ -l:libXext.a \
+ -l:libXft.a -l:libXrender.a -l:libX11.a -pthread -l:libxcb.a \
+ -l:libXau.a -l:libXdmcp.a \
+ -l:libfontconfig.a -l:libfreetype.a -l:libexpat.a -l:libz.a -l:libpng12.a \
+ -ldl -lm
# flags
-CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600
-CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os ${INCS} ${CPPFLAGS}
-LDFLAGS += -g ${LIBS}
+CPPFLAGS = -DVERSION=\"${VERSION}\" -D_XOPEN_SOURCE=600 -D_FORTIFY_SOURCE=2
+CFLAGS += -g -std=c99 -pedantic -Wall -Wvariadic-macros -Os -ftrapv -ffunction-sections -fdata-sections -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security ${INCS} ${CPPFLAGS}
+LDFLAGS += -g -Wl,--as-needed -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--hash-style=gnu -Wl,--no-copy-dt-needed-entries ${LIBS}
# compiler and linker
# CC = cc