[Mesa-dev] [PATCH] glu/autoconf: Don't modify CFLAGS in configure script
Eric Engestrom
eric.engestrom at imgtec.com
Tue Jul 12 12:45:21 UTC 2016
On Tue, Jul 12, 2016 at 11:49:31AM +0200, Egbert Eich wrote:
> From: Egbert Eich <eich at suse.de>
>
> CFLAGS (and CXXFLAGS) may be overridden by the user when calling 'make'.
> Therefore it is not advisable to set them explicitely in theconfigure
Typos:
s/explicitely/explicitly/
s/theconfigure/the configure/
> script.
> We also fix the case where someone uses '--disable-debug'.
>
> Signed-off-by: Egbert Eich <eich at suse.de>
> ---
> Makefile.am | 4 ++--
> configure.ac | 14 ++++++++++----
> 2 files changed, 12 insertions(+), 6 deletions(-)
>
> diff --git a/Makefile.am b/Makefile.am
> index 3050df1..834c7e2 100644
> --- a/Makefile.am
> +++ b/Makefile.am
> @@ -30,8 +30,8 @@ AM_CPPFLAGS = -DLIBRARYBUILD \
> -I$(top_srcdir)/src/libnurbs/internals \
> -I$(top_srcdir)/src/libnurbs/interface \
> -I$(top_srcdir)/src/libnurbs/nurbtess
> -AM_CFLAGS = $(GL_CFLAGS) $(OSMESA_CFLAGS) $(WARNCFLAGS) $(VISIBILITY_CFLAGS)
> -AM_CXXFLAGS = $(GL_CFLAGS) $(OSMESA_CFLAGS) $(WARNCXXFLAGS) $(VISIBILITY_CXXFLAGS)
> +AM_CFLAGS = $(GL_CFLAGS) $(OSMESA_CFLAGS) $(WARNCFLAGS) $(VISIBILITY_CFLAGS) $(DEBUGCFLAGS)
> +AM_CXXFLAGS = $(GL_CFLAGS) $(OSMESA_CFLAGS) $(WARNCXXFLAGS) $(VISIBILITY_CXXFLAGS) $(DEBUGCXXFLAGS)
>
> GL_includedir = $(includedir)/GL
> GL_include_HEADERS = \
> diff --git a/configure.ac b/configure.ac
> index 45abf17..ab93d8b 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -42,10 +42,16 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
> AC_ARG_ENABLE(debug,
> AS_HELP_STRING([--enable-debug],
> [Enable debugging information]),
> - [CFLAGS="$CFLAGS -g -O0 -DDEBUG"
> - CXXFLAGS="$CXXFLAGS -g -O0 -DDEBUG"],
> - [CFLAGS="$CFLAGS -DNDEBUG"
> - CXXFLAGS="$CXXFLAGS -DNDEBUG"])
> + AS_IF([test "$enableval" = xyes],
> + [DEBUGCFLAGS="-g -O0 -DDEBUG"
> + DEBUGCXXFLAGS="-g -O0 -DDEBUG"],
> + [test "$enableval" = xno],
> + [DEBUGCFLAGS="-DNDEBUG"
> + DEBUGCXXFLAGS="-DNDEBUG"]),
These tabs mess up the formatting.
The concept sounds good, but I don't know enough about autotools to r-b.
Acked-by: Eric Engestrom <eric.engestrom at imgtec.com>
> + [DEBUGCFLAGS="-DNDEBUG"
> + DEBUGCXXFLAGS="-DNDEBUG"])
> +AC_SUBST([DEBUGCFLAGS])
> +AC_SUBST([DEBUGCXXFLAGS])
>
> dnl Make sure the pkg-config macros are defined
> m4_ifndef([PKG_PROG_PKG_CONFIG],
> --
> 2.7.0
More information about the mesa-dev
mailing list