fix CFLAGS override in configure
This commit is contained in:
parent
a888ed7792
commit
4aef52be93
65
cflags.patch
Normal file
65
cflags.patch
Normal file
@ -0,0 +1,65 @@
|
|||||||
|
From 629e05d8dc795a70fd2bcd3d0301641105bf0b06 Mon Sep 17 00:00:00 2001
|
||||||
|
From: John Dennis <jdennis@redhat.com>
|
||||||
|
Date: Wed, 15 Jun 2016 11:50:24 -0400
|
||||||
|
Subject: [PATCH] enable user supplied CFLAGS
|
||||||
|
Content-Type: text/plain; charset="utf-8"
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
CFLAGS is initialized to the empty string in configure.ac, this
|
||||||
|
effectively turned off user supplied values for CFLAGS preventing site
|
||||||
|
specific values from being used. A further complicating factor was of
|
||||||
|
all the user supplied values documented in Automake only CFLAGS was
|
||||||
|
disabled allowing all other user supplied variables to take
|
||||||
|
effect. Some variables must be coordinated (e.g. CFLAGS with LDFLAGS),
|
||||||
|
the fact LDFLAGS was picked up from the environment but CFLAGS was
|
||||||
|
discarded caused build failures due to incompatible combination of
|
||||||
|
compiler and linker options.
|
||||||
|
|
||||||
|
The problem was first introduced in commit: 73d9c98f "Reset CFLAGS
|
||||||
|
when --enable-debugging is used". This patch simply removes hardcoding
|
||||||
|
CFLAGS to the empty string and appends the debug options
|
||||||
|
(--enable-debugging) to the existing CFLAGS.
|
||||||
|
|
||||||
|
Proper use of the variables is described in the Automake documentation
|
||||||
|
in the section "Flag Variables Ordering"
|
||||||
|
https://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html
|
||||||
|
|
||||||
|
Although the Automake documentation claims manipulating CFLAGS
|
||||||
|
directly is improper use there are many examples of this in the
|
||||||
|
existing configure.ac, this patch makes no attempt at addressing this
|
||||||
|
issue, rather it makes existing usage consistent. In the particular
|
||||||
|
case of debug flags appending to CFLAGS is probably the only valid
|
||||||
|
solution because the debug flags must appear at the end of the list of
|
||||||
|
flags in order to override earlier flags, CFLAGS always appears last
|
||||||
|
in the Makefile (see above Automake doc).
|
||||||
|
|
||||||
|
Signed-off-by: John Dennis <jdennis@redhat.com>
|
||||||
|
License: MIT
|
||||||
|
---
|
||||||
|
configure.ac | 3 +--
|
||||||
|
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/configure.ac b/configure.ac
|
||||||
|
index 7c58870..cf86262 100644
|
||||||
|
--- a/configure.ac
|
||||||
|
+++ b/configure.ac
|
||||||
|
@@ -91,7 +91,6 @@ dnl
|
||||||
|
dnl Check for programs
|
||||||
|
dnl
|
||||||
|
AC_PROG_CC
|
||||||
|
-CFLAGS=""
|
||||||
|
AM_CFLAGS=""
|
||||||
|
AC_HEADER_STDC
|
||||||
|
LT_AC_PROG_RC
|
||||||
|
@@ -702,7 +701,7 @@ AC_ARG_ENABLE(debugging, [ --enable-debugging enable debuging optimizati
|
||||||
|
if test "z$enable_debugging" = "zyes" ; then
|
||||||
|
enable_debugging=yes
|
||||||
|
LASSO_DEFINES="$LASSO_DEFINES -DLASSO_DEBUG"
|
||||||
|
- AM_CFLAGS="-O0 -g -Wall -Wextra -Werror"
|
||||||
|
+ CFLAGS="$CFLAGS -O0 -g -Wall -Wextra -Werror"
|
||||||
|
else
|
||||||
|
enable_debugging=no
|
||||||
|
fi
|
||||||
|
--
|
||||||
|
2.5.5
|
||||||
|
|
15
lasso.spec
15
lasso.spec
@ -15,12 +15,13 @@
|
|||||||
Summary: Liberty Alliance Single Sign On
|
Summary: Liberty Alliance Single Sign On
|
||||||
Name: lasso
|
Name: lasso
|
||||||
Version: 2.5.1
|
Version: 2.5.1
|
||||||
Release: 1%{?dist}
|
Release: 2%{?dist}
|
||||||
License: GPLv2+
|
License: GPLv2+
|
||||||
Group: System Environment/Libraries
|
Group: System Environment/Libraries
|
||||||
Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz
|
Source: http://dev.entrouvert.org/lasso/lasso-%{version}.tar.gz
|
||||||
|
|
||||||
patch1: java_binding_lasso_log.patch
|
patch1: java_binding_lasso_log.patch
|
||||||
|
patch2: cflags.patch
|
||||||
|
|
||||||
%if %{with_wsf}
|
%if %{with_wsf}
|
||||||
BuildRequires: cyrus-sasl-devel
|
BuildRequires: cyrus-sasl-devel
|
||||||
@ -28,10 +29,12 @@ BuildRequires: cyrus-sasl-devel
|
|||||||
BuildRequires: gtk-doc, libtool-ltdl-devel
|
BuildRequires: gtk-doc, libtool-ltdl-devel
|
||||||
BuildRequires: glib2-devel, swig
|
BuildRequires: glib2-devel, swig
|
||||||
BuildRequires: libxml2-devel, xmlsec1-devel, openssl-devel, xmlsec1-openssl-devel
|
BuildRequires: libxml2-devel, xmlsec1-devel, openssl-devel, xmlsec1-openssl-devel
|
||||||
BuildRequires: libtool
|
BuildRequires: zlib-devel, check-devel
|
||||||
|
BuildRequires: libtool autoconf automake
|
||||||
BuildRequires: python-six
|
BuildRequires: python-six
|
||||||
Url: http://lasso.entrouvert.org/
|
Url: http://lasso.entrouvert.org/
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
Lasso is a library that implements the Liberty Alliance Single Sign On
|
Lasso is a library that implements the Liberty Alliance Single Sign On
|
||||||
standards, including the SAML and SAML2 specifications. It allows to handle
|
standards, including the SAML and SAML2 specifications. It allows to handle
|
||||||
@ -107,11 +110,10 @@ library.
|
|||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{version}
|
%setup -q -n %{name}-%{version}
|
||||||
%patch1 -p1 -b java_binding_lasso_log
|
%patch1 -p1
|
||||||
|
%patch2 -p1
|
||||||
|
|
||||||
%build
|
%build
|
||||||
LDFLAGS="${LDFLAGS} -fPIC"
|
|
||||||
export LDFLAGS
|
|
||||||
./autogen.sh
|
./autogen.sh
|
||||||
%configure --prefix=%{_prefix} \
|
%configure --prefix=%{_prefix} \
|
||||||
%if !%{with_java}
|
%if !%{with_java}
|
||||||
@ -222,6 +224,9 @@ rm -fr %{buildroot}%{_defaultdocdir}/%{name}
|
|||||||
%endif
|
%endif
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jun 15 2016 John Dennis <jdennis@redhat.com> - 2.5.1-2
|
||||||
|
- fix CFLAGS override in configure
|
||||||
|
|
||||||
* Mon Feb 22 2016 John Dennis <jdennis@redhat.com> - 2.5.1-1
|
* Mon Feb 22 2016 John Dennis <jdennis@redhat.com> - 2.5.1-1
|
||||||
- Upgrade to upstream 2.5.1 release
|
- Upgrade to upstream 2.5.1 release
|
||||||
See Changelog for details, mostly bugs fixes,
|
See Changelog for details, mostly bugs fixes,
|
||||||
|
Loading…
Reference in New Issue
Block a user