[hackers] [libgrapheme] Use ar(1)'s s-flag instead of invoking ranlib(1) || Laslo Hunhold

From: <git_AT_suckless.org>
Date: Wed, 20 Jul 2022 15:38:12 +0200 (CEST)

commit 5fc87aedad86a8410a360ba718096e613ddf11f6
Author: Laslo Hunhold <dev_AT_frign.de>
AuthorDate: Wed Jul 20 15:33:56 2022 +0200
Commit: Laslo Hunhold <dev_AT_frign.de>
CommitDate: Wed Jul 20 15:33:56 2022 +0200

    Use ar(1)'s s-flag instead of invoking ranlib(1)
    
    Tom Schwindl kindly pointed out that ranlib(1) is legacy and not even
    part of POSIX anymore, given ar(1) can do the same job with the s-flag
    (which is an XSI-extension, but whatever).
    
    I'm certain there is no case where a system does not have a convenient
    ranlib(1)-wrapper-script, but it's always good to follow best practices.
    
    Signed-off-by: Laslo Hunhold <dev_AT_frign.de>

diff --git a/Makefile b/Makefile
index d53cf96..1eb9507 100644
--- a/Makefile
+++ b/Makefile
_AT_@ -187,8 +187,7 @@ $(TEST):
         $(CC) -c -o $_AT_ $(CPPFLAGS) $(CFLAGS) $<
 
 libgrapheme.a: $(SRC:=.o)
- $(AR) -rc $_AT_ $?
- $(RANLIB) $_AT_
+ $(AR) -rcs $_AT_ $?
 
 libgrapheme.so: $(SRC:=.o)
         $(CC) -o $_AT_ -shared $(SRC:=.o)
diff --git a/config.mk b/config.mk
index 3408f44..5425da4 100644
--- a/config.mk
+++ b/config.mk
_AT_@ -17,4 +17,3 @@ LDFLAGS = -s
 # tools
 CC = cc
 AR = ar
-RANLIB = ranlib
Received on Wed Jul 20 2022 - 15:38:12 CEST

This archive was generated by hypermail 2.3.0 : Wed Jul 20 2022 - 15:48:30 CEST