ports/163730: [patch] lang/ocaml: fix configure and build on FreeBSD-10 and or with clang

Guido Falsi mad at madpilot.net
Sat Dec 31 04:30:14 UTC 2011


>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:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          change-request
>Submitter-Id:   current-users
>Arrival-Date:   Sat Dec 31 04:30:13 UTC 2011
>Closed-Date:
>Last-Modified:
>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 at 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:
>Unformatted:



More information about the freebsd-ports-bugs mailing list