[Rpm-maint] Unable to build after Stop messing with CFLAGS from configure patch
Mark Wielaard
mjw at redhat.com
Fri Dec 9 08:41:16 UTC 2016
Hi,
commit bd3eb213 "Stop messing with CFLAGS from configure" renamed
rpm.am to rpm.am.in. rpm.am is included am into all Makefile.am files.
But rpm.am is now generated by configure. Which means it is generated
in the builddir so the includes should reference top_builddir instead of
top_srcdir now. But when running automake (or autoreconf) configure
doesn't even exist yet, so there is no rpm.am file yet and automake
will fail to generate proper Makefile.in files.
Could we instead do it like the attached by just defining the
AM_CFLAGS substitution inside the Makefile.am files themselves?
Thanks,
Mark
-------------- next part --------------
>From 7a17a1eeb058cbafe59863ea40e8b0f697ca6bc8 Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mjw at redhat.com>
Date: Fri, 9 Dec 2016 09:31:58 +0100
Subject: [PATCH] Define AM_CFLAGS inside the Makefile.am files themselves.
Trying to include AM_CFLAGS through a configure generated rpm.am file
doesn't really work because at the time automake runs configure doesn't
exist yet to process rpm.am.in. Just define the AM_CFLAGS substitution
inside the Makefile.am files themselves.
Rename rpm.am.in back to rpm.am.
Signed-off-by: Mark Wielaard <mjw at redhat.com>
---
Makefile.am | 1 +
build/Makefile.am | 1 +
configure.ac | 2 +-
fileattrs/Makefile.am | 1 +
lib/Makefile.am | 1 +
plugins/Makefile.am | 1 +
python/Makefile.am | 1 +
rpm.am.in => rpm.am | 2 --
rpmio/Makefile.am | 1 +
scripts/Makefile.am | 1 +
sign/Makefile.am | 1 +
tests/Makefile.am | 1 +
12 files changed, 11 insertions(+), 3 deletions(-)
rename rpm.am.in => rpm.am (92%)
diff --git a/Makefile.am b/Makefile.am
index 47bb4bd..eef2376 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,6 +5,7 @@ ACLOCAL_AMFLAGS = -I m4
DISTCHECK_CONFIGURE_FLAGS = --with-external-db
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
CLEANFILES =
EXTRA_DIST = ChangeLog CREDITS INSTALL \
diff --git a/build/Makefile.am b/build/Makefile.am
index f0f55a9..2fa3c3d 100644
--- a/build/Makefile.am
+++ b/build/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpmbuild library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
diff --git a/configure.ac b/configure.ac
index e08096d..4f3be87 100644
--- a/configure.ac
+++ b/configure.ac
@@ -892,7 +892,7 @@ AC_PATH_PROG(AUTOM4TE,autom4te,:)
AC_SUBST([dirstamp],[\${am__leading_dot}dirstamp])
-AC_CONFIG_FILES([Makefile rpm.am
+AC_CONFIG_FILES([Makefile
rpmio/Makefile lib/Makefile build/Makefile sign/Makefile
po/Makefile.in scripts/Makefile fileattrs/Makefile
misc/Makefile
diff --git a/fileattrs/Makefile.am b/fileattrs/Makefile.am
index 9c55aa1..1895f44 100644
--- a/fileattrs/Makefile.am
+++ b/fileattrs/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm file attributes
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
fattrsdir = $(rpmconfigdir)/fileattrs
diff --git a/lib/Makefile.am b/lib/Makefile.am
index 7fd6f94..c95d674 100644
--- a/lib/Makefile.am
+++ b/lib/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
diff --git a/plugins/Makefile.am b/plugins/Makefile.am
index 5ddc174..98eb154 100644
--- a/plugins/Makefile.am
+++ b/plugins/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += -I$(top_srcdir)/misc
diff --git a/python/Makefile.am b/python/Makefile.am
index cae66f0..af8b089 100644
--- a/python/Makefile.am
+++ b/python/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
EXTRA_DIST = rpm/__init__.py rpm/transaction.py
diff --git a/rpm.am.in b/rpm.am
similarity index 92%
rename from rpm.am.in
rename to rpm.am
index c91bebf..1f43ad8 100644
--- a/rpm.am.in
+++ b/rpm.am
@@ -8,5 +8,3 @@ rpmconfigdir = $(prefix)/lib/rpm
# Libtool version (current-revision-age) for all our libraries
rpm_version_info = 7:0:0
-
-AM_CFLAGS = @RPMCFLAGS@
diff --git a/rpmio/Makefile.am b/rpmio/Makefile.am
index 68a8219..5ad4d68 100644
--- a/rpmio/Makefile.am
+++ b/rpmio/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += @WITH_NSS_INCLUDE@
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index f204c51..b1360e1 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm scripts.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
CLEANFILES =
diff --git a/sign/Makefile.am b/sign/Makefile.am
index 86314ff..e612981 100644
--- a/sign/Makefile.am
+++ b/sign/Makefile.am
@@ -1,6 +1,7 @@
# Makefile for rpm library.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
AM_CPPFLAGS = -I$(top_builddir) -I$(top_srcdir) -I$(top_builddir)/include/
AM_CPPFLAGS += @WITH_BEECRYPT_INCLUDE@
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5b4c058..7091220 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -1,6 +1,7 @@
## Process this file with automake to produce Makefile.in.
include $(top_srcdir)/rpm.am
+AM_CFLAGS = @RPMCFLAGS@
EXTRA_DIST =
CLEANFILES =
--
2.9.3
More information about the Rpm-maint
mailing list