ports/172211: [PATCH] x11-wm/fvwm2 fix configure with clang

Guido Falsi madpilot at FreeBSD.org
Mon Oct 1 14:40:04 UTC 2012


>Number:         172211
>Category:       ports
>Synopsis:       [PATCH] x11-wm/fvwm2 fix configure with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Mon Oct 01 14:40:03 UTC 2012
>Closed-Date:
>Last-Modified:
>Originator:     Guido Falsi
>Release:        FreeBSD 9.1-PRERELEASE amd64
>Organization:
>Environment:
FreeBSD fbsd.madpilot.net 10.0-CURRENT FreeBSD 10.0-CURRENT #1: Mon Oct  1 11:43:08 CEST 2012     root at fbsd.madpilot.net:/usr/obj/usr/src/sys/FBSD  amd64

This is a Virtualbox machine I made to test a clang only system
with WITH_CLANG_IS_CC=yes.

>Description:

Configure fails because clang refuses to compile a main not returning
an int. It blames -Werror, but this is not the case with clang.

Attached patch removes this check. Perhaps this is not the best
fix, but works correctly. perhaps setting -Wno-return-type is also
an option.

While testing this I also noticed that the configure script gets
modified in post-patch, so during configure phase autoconf sees it
sith a newer date and does not touch it even if USE_AUTOTOOLS=autoconf
is defined. So I added the touch command to fix this.

Maintainer is CCed.

>How-To-Repeat:

Try to compile x11-wm/fvwm2 on a 10-CURRENT system with WITH_CLANG_IS_CC=yes

>Fix:

Index: Makefile
===================================================================
--- Makefile	(revision 305105)
+++ Makefile	(working copy)
@@ -160,6 +160,7 @@
 	@${REINPLACE_CMD} -e 's,%%LOCALBASE%%,${LOCALBASE},' \
 		${WRKSRC}/modules/FvwmM4/FvwmM4.c \
 		${WRKSRC}/configure
+	${TOUCH} ${WRKSRC}/configure.ac
 
 post-install:
 	@${INSTALL_DATA} ${WRKSRC}/sample.fvwmrc/system.fvwm2rc \
Index: files/patch-configure.ac
===================================================================
--- files/patch-configure.ac	(revision 0)
+++ files/patch-configure.ac	(working copy)
@@ -0,0 +1,20 @@
+--- configure.ac.orig	2012-10-01 16:10:17.000000000 +0200
++++ configure.ac	2012-10-01 16:10:28.000000000 +0200
+@@ -219,17 +219,6 @@
+ AC_ISC_POSIX
+ AC_MINIX
+ 
+-# catch -Werror and similar options when running configure
+-AC_TRY_COMPILE([#include <stdio.h>],
+-[int i; static j; int *p; char *c;
+-  switch (*p = p = *c) { case 0: printf("%Q", c, p); }
+-  *c = &i; c = p;
+-  while (1 || (unsigned int)3 >= 0 || ((int)-1) == ((unsigned int)1));
+-  return;], , AC_MSG_ERROR("
+-configure is not able to compile programs with warnings.  Please
+-remove all offending options like -Werror from the CFLAGS and
+-CPPFLAGS variables and run configure again."))
+-
+ # check size of some types
+ ac_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $X_CFLAGS"
>Release-Note:
>Audit-Trail:
>Unformatted:



More information about the freebsd-ports-bugs mailing list