From nobody@FreeBSD.org  Sun May 29 16:51:42 2011
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 7F089106566C
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 16:51:42 +0000 (UTC)
	(envelope-from nobody@FreeBSD.org)
Received: from red.freebsd.org (red.freebsd.org [IPv6:2001:4f8:fff6::22])
	by mx1.freebsd.org (Postfix) with ESMTP id 659008FC12
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 16:51:42 +0000 (UTC)
Received: from red.freebsd.org (localhost [127.0.0.1])
	by red.freebsd.org (8.14.4/8.14.4) with ESMTP id p4TGpgjC028576
	for <freebsd-gnats-submit@FreeBSD.org>; Sun, 29 May 2011 16:51:42 GMT
	(envelope-from nobody@red.freebsd.org)
Received: (from nobody@localhost)
	by red.freebsd.org (8.14.4/8.14.4/Submit) id p4TGpgII028575;
	Sun, 29 May 2011 16:51:42 GMT
	(envelope-from nobody)
Message-Id: <201105291651.p4TGpgII028575@red.freebsd.org>
Date: Sun, 29 May 2011 16:51:42 GMT
From: Ismail YENIGUL <ismail.yenigul@surgate.com>
To: freebsd-gnats-submit@FreeBSD.org
Subject: open-vm-tools is broken on FreeBSD 8.2 amd64
X-Send-Pr-Version: www-3.1
X-GNATS-Notify:

>Number:         157398
>Category:       ports
>Synopsis:       emulators/open-vm-tools is broken on FreeBSD 8.2 amd64
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sun May 29 17:00:17 UTC 2011
>Closed-Date:    Wed Feb 22 01:42:20 UTC 2012
>Last-Modified:  Wed Feb 22 01:42:20 UTC 2012
>Originator:     Ismail YENIGUL
>Release:        FreeBSD 8.2
>Organization:
SurGATE Labs
>Environment:
FreeBSD devel.myserver.com 8.2-RELEASE FreeBSD 8.2-RELEASE #0: Thu Feb 17 02:41:51 UTC 2011     root@mason.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  amd64

>Description:
I got the following error during the configuration stage of the port.

1.cc1: warnings being treated as errors
2. Unknown architecture.
3. make install command install vmware-tools to under /etc directory.

The solutions:

Error 1: I disabled -Werror flag from configure and configure.in
Error 2: I added the following lines to configure.ac. The current patch add these lines in configure only.

+   amd64)
+      userSpaceBitness="64"
+      ;;


Error 3: I apllied to the following patch to scripts/Makefile.am(current patch changes only scripts/Makefile)

--- scripts/Makefile.am.orig    2011-05-29 17:46:51.000000000 +0300
+++ scripts/Makefile.am 2011-05-29 17:47:00.000000000 +0300
@@ -3,7 +3,7 @@
 defaultscripts += suspend-vm-default
 defaultscripts += resume-vm-default
 
-confdir = /etc/vmware-tools
+confdir = ${prefix}/share/vmware-tools
 
 conf_SCRIPTS = ./common/vm-support
 conf_SCRIPTS += ./common/statechange.subr

>How-To-Repeat:
cd /usr/ports/emulators/open-vm-tools
make install

>Fix:
Here is the patch:

diff -ruN open-vm-tools.orig/files/patch-arch open-vm-tools/files/patch-arch
--- open-vm-tools.orig/files/patch-arch 2010-01-02 18:29:44.000000000 +0200
+++ open-vm-tools/files/patch-arch      2011-05-29 18:05:39.000000000 +0300
@@ -1,6 +1,6 @@
---- configure.orig     2008-03-28 10:36:13.000000000 +0100
-+++ configure  2008-03-28 10:36:45.000000000 +0100
-@@ -2259,6 +2259,9 @@
+--- configure.orig     2010-10-19 23:20:02.000000000 +0300
++++ configure  2011-05-29 17:17:13.000000000 +0300
+@@ -2925,6 +2925,9 @@
     x86_64)
        userSpaceBitness="64"
        ;;
@@ -8,5 +8,35 @@
 +      userSpaceBitness="64"
 +      ;;
     *)
-       { { echo "$as_me:$LINENO: error: Unknown architecture." >&5
- echo "$as_me: error: Unknown architecture." >&2;}
+       as_fn_error "Unknown architecture." "$LINENO" 5
+       ;;
+@@ -22414,7 +22417,7 @@
+ 
+ ### General flags / actions
+ CFLAGS="$CFLAGS -Wall"
+-CFLAGS="$CFLAGS -Werror"
++#CFLAGS="$CFLAGS -Werror"
+ 
+ # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
+ for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
+--- configure.ac.orig  2010-10-19 23:19:54.000000000 +0300
++++ configure.ac       2011-05-29 17:17:27.000000000 +0300
+@@ -82,6 +82,9 @@
+    [x86_64])
+       userSpaceBitness="64"
+       ;;
++   [amd64])
++      userSpaceBitness="64"
++      ;;
+    [*])
+       AC_MSG_ERROR([Unknown architecture.])
+       ;;
+@@ -880,7 +883,7 @@
+ 
+ ### General flags / actions
+ CFLAGS="$CFLAGS -Wall"
+-CFLAGS="$CFLAGS -Werror"
++#CFLAGS="$CFLAGS -Werror"
+ 
+ # -Wno-unknown-pragmas is due to gcc not understanding '#pragma ident' in Xlib.h on OpenSolaris.
+ for TEST_CFLAG in -Wno-pointer-sign -Wno-unused-value -fno-strict-aliasing \
diff -ruN open-vm-tools.orig/files/patch-scripts-Makefile open-vm-tools/files/patch-scripts-Makefile
--- open-vm-tools.orig/files/patch-scripts-Makefile     2010-06-06 17:55:58.000000000 +0300
+++ open-vm-tools/files/patch-scripts-Makefile  2011-05-29 18:05:40.000000000 +0300
@@ -9,3 +9,14 @@
  conf_SCRIPTS = ./common/vm-support ./common/statechange.subr \
        $(defaultscripts)
  vmwsrcdir = $(confdir)/scripts/vmware
+--- scripts/Makefile.am.orig   2011-05-29 17:46:51.000000000 +0300
++++ scripts/Makefile.am        2011-05-29 17:47:00.000000000 +0300
+@@ -3,7 +3,7 @@
+ defaultscripts += suspend-vm-default
+ defaultscripts += resume-vm-default
+ 
+-confdir = /etc/vmware-tools
++confdir = ${prefix}/share/vmware-tools
+ 
+ conf_SCRIPTS = ./common/vm-support
+ conf_SCRIPTS += ./common/statechange.subr


>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->mbr 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Sun May 29 17:05:23 UTC 2011 
Responsible-Changed-Why:  
Fix synopsis and assign. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157398 

From: "Steve Wills" <swills@mouf.net>
To: bug-followup@FreeBSD.org, ismail.yenigul@surgate.com
Cc:  
Subject: Re: ports/157398: emulators/open-vm-tools is broken on FreeBSD 8.2 amd64
Date: Fri, 14 Oct 2011 16:25:31 -0400

 I believe this PR can be closed since these changes seem unnecessary, due to:
 
 1. Wasn't able to reproduce any issues with -Werror being there. If it
 doesn't cause problems, it shouldn't be patched out.
 2. No need to patch configure.ac since the source ships pre-generated
 configure, so configure.ac isn't used and we already patch configure
 3. No need to patch scripts/Makefile.am since the source ships
 pre-generated scripts/Makefile.in, so scripts/Makefile.am isn't used and
 we already patch scripts/Makefile.in.
 
 If I'm missing something, please let me know.
 
 Thanks,
 Steve
 
 
Responsible-Changed-From-To: mbr->freebsd-ports-bugs 
Responsible-Changed-By: tabthorpe 
Responsible-Changed-When: Mon Jan 2 04:45:16 UTC 2012 
Responsible-Changed-Why:  
Reassign to the heap 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157398 
State-Changed-From-To: open->feedback 
State-Changed-By: swills 
State-Changed-When: Sun Jan 8 02:11:28 UTC 2012 
State-Changed-Why:  
waiting on feedback from user 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157398 
State-Changed-From-To: feedback->closed 
State-Changed-By: eadler 
State-Changed-When: Wed Feb 22 01:42:19 UTC 2012 
State-Changed-Why:  
feedback timeout. If this is still a problem please let me know 

http://www.freebsd.org/cgi/query-pr.cgi?pr=157398 
>Unformatted:
