From mad@madpilot.net  Sat Dec 31 04:21:27 2011
Return-Path: <mad@madpilot.net>
Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34])
	by hub.freebsd.org (Postfix) with ESMTP id 92BB11065676
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Dec 2011 04:21:27 +0000 (UTC)
	(envelope-from mad@madpilot.net)
Received: from megatron.madpilot.net (megatron.madpilot.net [88.149.173.206])
	by mx1.freebsd.org (Postfix) with ESMTP id 035C78FC22
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Dec 2011 04:21:26 +0000 (UTC)
Received: from megatron.madpilot.net (localhost [127.0.0.1])
	by megatron.madpilot.net (Postfix) with ESMTP id 77DD51741
	for <FreeBSD-gnats-submit@freebsd.org>; Sat, 31 Dec 2011 05:21:25 +0100 (CET)
Received: from megatron.madpilot.net ([127.0.0.1])
	by megatron.madpilot.net (megatron.madpilot.net [127.0.0.1]) (amavisd-new, port 10026)
	with ESMTP id 3Dy0GbEij1CT for <FreeBSD-gnats-submit@freebsd.org>;
	Sat, 31 Dec 2011 05:21:21 +0100 (CET)
Received: by megatron.madpilot.net (Postfix, from userid 1000)
	id 5B214173D; Sat, 31 Dec 2011 05:21:21 +0100 (CET)
Message-Id: <20111231042121.5B214173D@megatron.madpilot.net>
Date: Sat, 31 Dec 2011 05:21:21 +0100 (CET)
From: Guido Falsi <mad@madpilot.net>
Reply-To: Guido Falsi <mad@madpilot.net>
To: FreeBSD-gnats-submit@freebsd.org
Cc:
Subject: [patch] lang/ocaml: fix configure and build on FreeBSD-10 and or with clang
X-Send-Pr-Version: 3.113
X-GNATS-Notify: michael.grunewald@laposte.net

>Number:         163730
>Category:       ports
>Synopsis:       [patch] lang/ocaml: fix configure and build on FreeBSD-10 and or with clang
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    miwi
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 31 04:30:13 UTC 2011
>Closed-Date:    Sat Jan 28 03:06:03 UTC 2012
>Last-Modified:  Sat Jan 28 03:06:03 UTC 2012
>Originator:     Guido Falsi
>Release:        FreeBSD 9.0-RC1 amd64
>Organization:
none
>Environment:
System: FreeBSD megatron.madpilot.net 9.0-RC1 FreeBSD 9.0-RC1 #1: Mon Oct 31 13:48:49 CET 2011 root@megatron.madpilot.net:/usr/obj/usr/src/sys/MEGATRON amd64

>Description:

Fix ocaml configure script for the following problems:

1) fails to respect ${CC}, failing to confiure with any compiler
   not found under the name of "gcc" or "cc"

2) has a check for *freebsd-[3-9]*, which leaves out present
   10-CURRENT.


I noticed the problem while testing some ports on the recently
annouced redports.org system.

Many thanks to the people who brought us this wonderful tool!

>How-To-Repeat:

Try to build lang/ocaml on a system using clang as a ports compiler
to show problem 1, or on a machine running 10-CURRENT to show problem
2.

Trying to build on a machine running current AND clang will stop
at problem 1, once that is solved problem 2 will show up.

>Fix:

diff -ruN ocaml.old/files/patch-configure ocaml/files/patch-configure
--- ocaml.old/files/patch-configure	2011-12-31 05:11:28.755920433 +0100
+++ ocaml/files/patch-configure	2011-12-31 05:11:41.323088127 +0100
@@ -1,5 +1,5 @@
---- configure.orig	2010-07-28 06:18:22.000000000 -0700
-+++ configure	2011-04-03 13:46:37.000000000 -0700
+--- configure.orig	2011-07-04 23:15:01.000000000 +0200
++++ configure	2011-12-31 03:54:05.000000000 +0100
 @@ -85,6 +85,8 @@
          withcurses=no;;
      -no-shared-libs)
@@ -9,15 +9,33 @@
      -x11include*|--x11include*)
          x11_include_dir=$2; shift;;
      -x11lib*|--x11lib*)
-@@ -629,6 +631,7 @@
-     i686-*-kfreebsd*)             natdynlink=true;;
-     x86_64-*-kfreebsd*)           natdynlink=true;;
+@@ -189,7 +191,7 @@
+     echo "gcc found"
+     cc=gcc
+   else
+-    cc=cc
++    cc=${CC}
+   fi
+ else
+   cc="$ccoption"
+@@ -521,7 +523,7 @@
+       mksharedlib="$flexlink"
+       mkmaindll="$flexlink -maindll"
+       shared_libraries_supported=true;;
+-    *-*-linux-gnu|*-*-linux|*-*-freebsd[3-9]*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*)
++    *-*-linux-gnu|*-*-linux|*-*-freebsd*|*-*-openbsd*|*-*-netbsd*|*-*-gnu*)
+       sharedcccompopts="-fPIC"
+       mksharedlib="$bytecc -shared"
+       bytecclinkopts="$bytecclinkopts -Wl,-E"
+@@ -636,6 +638,7 @@
+     i[345]86-*-netbsd*)           natdynlink=true;;
+     x86_64-*-netbsd*)             natdynlink=true;;
      i386-*-gnu0.3)                natdynlink=true;;
 +    *-*-freebsd*)                 natdynlink=true;;
    esac
  fi
  
-@@ -680,6 +683,7 @@
+@@ -687,6 +690,7 @@
    hppa*-*-gnu*)                 arch=hppa; system=gnu;;
    powerpc*-*-linux*)            arch=power; model=ppc; system=elf;;
    powerpc-*-netbsd*)            arch=power; model=ppc; system=elf;;
@@ -25,7 +43,7 @@
    powerpc-*-rhapsody*)          arch=power; model=ppc; system=rhapsody;;
    powerpc-*-darwin*)            arch=power; system=rhapsody
                                  if $arch64; then model=ppc64; else model=ppc; fi;;
-@@ -789,6 +793,7 @@
+@@ -796,6 +800,7 @@
    i386,*,bsd_elf) profiling='prof';;
    amd64,*,macosx) profiling='prof';;
    i386,*,macosx) profiling='prof';;
@@ -33,7 +51,7 @@
    sparc,*,solaris)
      profiling='prof'
      case "$nativecc" in gcc*) ;; *) cc_profile='-xpg';; esac;;
-@@ -1249,133 +1254,24 @@
+@@ -1256,133 +1261,24 @@
  x11_include="not found"
  x11_link="not found"
  
@@ -178,7 +196,7 @@
  else
    echo "Location of X11 include files: $x11_include/X11"
    echo "Options for linking with X11: $x11_link"
-@@ -1502,7 +1398,7 @@
+@@ -1509,7 +1405,7 @@
    then tk_libs="$tk_libs $dllib"
    elif sh ./hasgot $tk_libs -ltcl$tclmaj.$tclmin $tkauxlibs Tcl_DoOneEvent
    then
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-ports-bugs->miwi 
Responsible-Changed-By: edwin 
Responsible-Changed-When: Sat Dec 31 04:30:30 UTC 2011 
Responsible-Changed-Why:  
miwi@ wants his PRs (via the GNATS Auto Assign Tool) 

http://www.freebsd.org/cgi/query-pr.cgi?pr=163730 
State-Changed-From-To: open->feedback 
State-Changed-By: edwin 
State-Changed-When: Sat Dec 31 04:30:39 UTC 2011 
State-Changed-Why:  
Awaiting maintainers feedback (via the GNATS Auto Assign Tool) 

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

From: Edwin Groothuis <edwin@FreeBSD.org>
To: michael.grunewald@laposte.net
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/163730: [patch] lang/ocaml: fix configure and build on FreeBSD-10 and or with clang
Date: Sat, 31 Dec 2011 04:30:36 UT

 Maintainer of lang/ocaml,
 
 Please note that PR ports/163730 has just been submitted.
 
 If it contains a patch for an upgrade, an enhancement or a bug fix
 you agree on, reply to this email stating that you approve the patch
 and a committer will take care of it.
 
 The full text of the PR can be found at:
     http://www.freebsd.org/cgi/query-pr.cgi?pr=ports/163730
 
 -- 
 Edwin Groothuis via the GNATS Auto Assign Tool
 edwin@FreeBSD.org

From: Jan Beich <jbeich@tormail.net>
To: Guido Falsi <mad@madpilot.net>
Cc: bug-followup@FreeBSD.org
Subject: Re: ports/163730: [patch] lang/ocaml: fix configure and build on FreeBSD-10 and or with clang
Date: Sat, 31 Dec 2011 15:44:18 +1100

 Guido Falsi <mad@madpilot.net> writes:
 
 >>Description:
 >
 > Fix ocaml configure script for the following problems:
 >
 > 1) fails to respect ${CC}, failing to confiure with any compiler
 >    not found under the name of "gcc" or "cc"
 
 duplicate of ports/160492, found by a clang -exp run
 
 >
 > 2) has a check for *freebsd-[3-9]*, which leaves out present
 >    10-CURRENT.
 
 duplicate of ports/163335, found by normal run on 10.0-CURRENT
State-Changed-From-To: feedback->closed 
State-Changed-By: miwi 
State-Changed-When: Sat Jan 28 03:06:00 UTC 2012 
State-Changed-Why:  
already fixed 

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