From owner-freebsd-ports-bugs@FreeBSD.ORG Tue Jun 8 22:20:08 2010 Return-Path: Delivered-To: freebsd-ports-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 7457D106567A for ; Tue, 8 Jun 2010 22:20:08 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (unknown [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 388D18FC14 for ; Tue, 8 Jun 2010 22:20:08 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o58MK8SY068874 for ; Tue, 8 Jun 2010 22:20:08 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o58MK8UX068868; Tue, 8 Jun 2010 22:20:08 GMT (envelope-from gnats) Resent-Date: Tue, 8 Jun 2010 22:20:08 GMT Resent-Message-Id: <201006082220.o58MK8UX068868@freefall.freebsd.org> Resent-From: FreeBSD-gnats-submit@FreeBSD.org (GNATS Filer) Resent-To: freebsd-ports-bugs@FreeBSD.org Resent-Reply-To: FreeBSD-gnats-submit@FreeBSD.org, Rene Ladan Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id D86D3106566B for ; Tue, 8 Jun 2010 22:17:27 +0000 (UTC) (envelope-from nobody@FreeBSD.org) Received: from www.freebsd.org (www.freebsd.org [IPv6:2001:4f8:fff6::21]) by mx1.freebsd.org (Postfix) with ESMTP id C80C48FC17 for ; Tue, 8 Jun 2010 22:17:27 +0000 (UTC) Received: from www.freebsd.org (localhost [127.0.0.1]) by www.freebsd.org (8.14.3/8.14.3) with ESMTP id o58MHRgK072246 for ; Tue, 8 Jun 2010 22:17:27 GMT (envelope-from nobody@www.freebsd.org) Received: (from nobody@localhost) by www.freebsd.org (8.14.3/8.14.3/Submit) id o58MHRlo072245; Tue, 8 Jun 2010 22:17:27 GMT (envelope-from nobody) Message-Id: <201006082217.o58MHRlo072245@www.freebsd.org> Date: Tue, 8 Jun 2010 22:17:27 GMT From: Rene Ladan To: freebsd-gnats-submit@FreeBSD.org X-Send-Pr-Version: www-3.1 Cc: Subject: ports/147703: devel/cmake: better handle thread flags X-BeenThere: freebsd-ports-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Ports bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Jun 2010 22:20:08 -0000 >Number: 147703 >Category: ports >Synopsis: devel/cmake: better handle thread flags >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: Tue Jun 08 22:20:07 UTC 2010 >Closed-Date: >Last-Modified: >Originator: Rene Ladan >Release: FreeBSD 8.1-BETA1 >Organization: >Environment: FreeBSD acer.rene-ladan.nl 8.1-BETA1 FreeBSD 8.1-BETA1 #0: Thu May 27 15:03:30 UTC 2010 root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC amd64 >Description: Currently devel/cmake doesn't properly handle the case where thread flags are emitted, for example by wxgtk28-config from x11-toolkits/wxgtk28 . The resulting output in build/CMakeFiles/*/flags.make and build/CMakeFiles/*/link.txt contains -pthread;-D_THREAD_SAFE which confuses the shell. The patch removes all instances of -pthread; from CXX_FLAGS in the resulting flags.make . It leaves -D_THREAD_SAFE in the resulting link.txt, but in an unharmful way. >How-To-Repeat: Create hello.cpp and CMakeLists.txt in a new directory: % cat hello.cpp int main(int argc, char **argv) { return 0; } % cat CMakeLists.txt cmake_minimum_required(VERSION 2.4.6) find_package(wxWidgets REQUIRED) include(${wxWidgets_USE_FILE}) include_directories(${wxWidgets_INCLUDE_DIRS}) add_executable(hello hello.cpp) target_link_libraries(hello ${wxWidgets_LIBRARIES}) The resulting CMakeFiles/hello.dir/link.txt and CMakeFiles/hello.dir/flags.make will contain spurious semicolons. >Fix: Admittedly, not the best fix, but good enough to work (attached). Patch attached with submission follows: diff -ruN cmake.orig/Makefile cmake/Makefile --- cmake.orig/Makefile 2010-05-18 00:47:59.000000000 +0200 +++ cmake/Makefile 2010-06-09 00:16:10.000000000 +0200 @@ -7,7 +7,7 @@ PORTNAME= cmake PORTVERSION= 2.8.1 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= devel MASTER_SITES= http://www.cmake.org/files/v${PORTVERSION:C/\.[[:digit:]]+$//}/ diff -ruN cmake.orig/files/patch-Modules_FindwxWidgets.cmake cmake/files/patch-Modules_FindwxWidgets.cmake --- cmake.orig/files/patch-Modules_FindwxWidgets.cmake 1970-01-01 01:00:00.000000000 +0100 +++ cmake/files/patch-Modules_FindwxWidgets.cmake 2010-06-08 23:46:00.000000000 +0200 @@ -0,0 +1,13 @@ +--- Modules/FindwxWidgets.cmake.orig 2010-06-08 23:44:09.000000000 +0200 ++++ Modules/FindwxWidgets.cmake 2010-06-08 23:45:06.000000000 +0200 +@@ -723,6 +723,10 @@ + STRING(REPLACE "-D" "" + wxWidgets_DEFINITIONS "${wxWidgets_DEFINITIONS}") + ++ # remove -pthread; from cxxflags, it is also in libs ++ STRING(REPLACE "-pthread;" "" ++ wxWidgets_CXX_FLAGS "${wxWidgets_CXX_FLAGS}") ++ + # parse include dirs from cxxflags; drop -I prefix + STRING(REGEX MATCHALL "-I[^;]+" + wxWidgets_INCLUDE_DIRS "${wxWidgets_CXX_FLAGS}") >Release-Note: >Audit-Trail: >Unformatted: