-# $Id: Makefile,v 1.486 2016/07/10 10:05:33 schwarze Exp $
+# $Id: Makefile,v 1.487 2016/07/10 18:24:23 schwarze Exp $
#
# Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
# Copyright (c) 2011, 2013-2016 Ingo Schwarze <schwarze@openbsd.org>
ar rs $@ $(COMPAT_OBJS) $(LIBMANDOC_OBJS)
mandoc: $(MAIN_OBJS) libmandoc.a
- $(CC) -o $@ $(MAIN_OBJS) libmandoc.a $(LDADD)
+ $(CC) -o $@ $(LDFLAGS) $(MAIN_OBJS) libmandoc.a $(LDADD)
manpage: $(MANPAGE_OBJS) libmandoc.a
- $(CC) -o $@ $(MANPAGE_OBJS) libmandoc.a $(LDADD)
+ $(CC) -o $@ $(LDFLAGS) $(MANPAGE_OBJS) libmandoc.a $(LDADD)
man.cgi: $(CGI_OBJS) libmandoc.a
- $(CC) $(STATIC) -o $@ $(CGI_OBJS) libmandoc.a $(LDADD)
+ $(CC) $(STATIC) -o $@ $(LDFLAGS) $(CGI_OBJS) libmandoc.a $(LDADD)
demandoc: $(DEMANDOC_OBJS) libmandoc.a
- $(CC) -o $@ $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
+ $(CC) -o $@ $(LDFLAGS) $(DEMANDOC_OBJS) libmandoc.a $(LDADD)
soelim: $(SOELIM_OBJS)
- $(CC) -o $@ $(SOELIM_OBJS)
+ $(CC) -o $@ $(LDFLAGS) $(SOELIM_OBJS)
# --- maintainer targets ---
-# $Id: configure.local.example,v 1.11 2016/05/18 21:37:04 schwarze Exp $
+# $Id: configure.local.example,v 1.12 2016/07/10 18:24:23 schwarze Exp $
#
# Copyright (c) 2014, 2015, 2016 Ingo Schwarze <schwarze@openbsd.org>
#
LD_OHASH="-lutil"
-# Some platforms may need additional linker flags that are not autodetected.
+# Some platforms may need additional linker flags to link against libmandoc
+# that are not autodetected.
# For example, Solaris 9 and 10 need -lrt for nanosleep(2).
LDADD="-lrt"
+# Some systems may want to set additional linker flags for all the
+# binaries, not only for those using libmandoc, for example for
+# hardening options.
+
+LDFLAGS="-Wl,-z,relro"
+
# It is possible to change the utility program used for installation
# and the modes files are installed with. The defaults are: