[prev in list] [next in list] [prev in thread] [next in thread] 

List:       mandoc-source
Subject:    mdocml: support LDFLAGS; suggested by Christian Neukirchen <chneukirchen
From:       schwarze () mdocml ! bsd ! lv
Date:       2016-07-10 18:24:53
Message-ID: 3584977002016298299.enqueue () fantadrom ! bsd ! lv
[Download RAW message or body]

Log Message:
-----------
support LDFLAGS;
suggested by Christian Neukirchen <chneukirchen at gmail dot com>

Modified Files:
--------------
    mdocml:
        Makefile
        configure
        configure.local.example

Revision Data
-------------
Index: configure
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure,v
retrieving revision 1.38
retrieving revision 1.39
diff -Lconfigure -Lconfigure -u -p -r1.38 -r1.39
--- configure
+++ configure
@@ -37,6 +37,7 @@ OSNAME=
 CC=`printf "all:\\n\\t@echo \\\$(CC)\\n" | make -f -`
 CFLAGS="-g -W -Wall -Wstrict-prototypes -Wno-unused-parameter -Wwrite-strings"
 LDADD=
+LDFLAGS=
 LD_OHASH=
 LD_SQLITE3=
 STATIC="-static"
@@ -428,6 +429,7 @@ INSTALL_TARGETS	= ${INSTALL_TARGETS}
 CC		= ${CC}
 CFLAGS		= ${CFLAGS}
 LDADD		= ${LDADD}
+LDFLAGS		= ${LDFLAGS}
 STATIC		= ${STATIC}
 PREFIX		= ${PREFIX}
 BINDIR		= ${BINDIR}
Index: configure.local.example
===================================================================
RCS file: /home/cvs/mdocml/mdocml/configure.local.example,v
retrieving revision 1.11
retrieving revision 1.12
diff -Lconfigure.local.example -Lconfigure.local.example -u -p -r1.11 -r1.12
--- configure.local.example
+++ configure.local.example
@@ -131,10 +131,17 @@ BINM_SOELIM=msoelim		# default is "soeli
 
 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:
Index: Makefile
===================================================================
RCS file: /home/cvs/mdocml/mdocml/Makefile,v
retrieving revision 1.486
retrieving revision 1.487
diff -LMakefile -LMakefile -u -p -r1.486 -r1.487
--- Makefile
+++ Makefile
@@ -408,19 +408,19 @@ libmandoc.a: $(COMPAT_OBJS) $(LIBMANDOC_
 	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 ---
 
--
 To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic