[packages/rpm-specdump] - use pkgconfig to get default CFLAGS and LDFLAGS

baggins baggins at pld-linux.org
Mon Oct 19 00:14:41 CEST 2020


commit 705123125a8de28aed054fdc320be7482f714449
Author: Jan Rękorajski <baggins at pld-linux.org>
Date:   Mon Oct 19 00:14:06 2020 +0200

    - use pkgconfig to get default CFLAGS and LDFLAGS

 Makefile          | 11 +++++------
 rpm-specdump.spec |  4 ++--
 2 files changed, 7 insertions(+), 8 deletions(-)
---
diff --git a/rpm-specdump.spec b/rpm-specdump.spec
index 3e5e953..8568116 100644
--- a/rpm-specdump.spec
+++ b/rpm-specdump.spec
@@ -26,8 +26,8 @@ ln -s %{SOURCE1} .
 %build
 %{__make} \
 	CC="%{__cc}" \
-	LDFLAGS="%{rpmldflags}" \
-	CFLAGS="%{rpmcflags}"
+	RPMLDFLAGS="%{rpmldflags}" \
+	RPMCFLAGS="%{rpmcflags}"
 
 %install
 rm -rf $RPM_BUILD_ROOT
diff --git a/Makefile b/Makefile
index f5f3d0e..992fbaa 100644
--- a/Makefile
+++ b/Makefile
@@ -1,12 +1,11 @@
 CC := gcc
-CFLAGS :=
-LDFLAGS :=
-CPPFLAGS :=
-INCLUDES := -I/usr/include/rpm
-LIBS := -lrpm -lrpmdb -lrpmio -lrpmbuild
+CFLAGS := -Wall -Wno-unused-result $(RPMCFLAGS)
+LDFLAGS := $(RPMLDFLAGS)
+INCLUDES := `pkg-config --cflags rpm`
+LIBS := `pkg-config --libs rpm`
 
 rpm-specdump: rpm-specdump.o
 	$(CC) $(LDFLAGS) $< -o $@ $(LIBS)
 
 rpm-specdump.o: rpm-specdump.c
-	$(CC) $(CFLAGS) $(INCLUDES) -W -Wall -c $< -o $@
+	$(CC) $(CFLAGS) $(INCLUDES) -c $< -o $@
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-specdump.git/commitdiff/705123125a8de28aed054fdc320be7482f714449



More information about the pld-cvs-commit mailing list