ports/188330: lang/ocaml: Fix X11 build on head
Guido Falsi
madpilot at FreeBSD.org
Sun Apr 6 22:50:01 UTC 2014
>Number: 188330
>Category: ports
>Synopsis: lang/ocaml: Fix X11 build on head
>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: Sun Apr 06 22:50:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator: Guido Falsi
>Release: FreeBSD 10.0-RELEASE amd64
>Organization:
none
>Environment:
System: FreeBSD micro.madpilot.net 10.0-RELEASE FreeBSD 10.0-RELEASE #0 r260789: Thu Jan 16 22:34:59 UTC 2014 root at snap.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64
>Description:
On head for some reason the "-R" option passed in the X11 tests
during configure is causing clang to fail the test, and the port
does not build the X11 support.
This causes a crippled version of ocaml to be installed, unable to
compile any further ocam library or program depending on X11.
The problem happens during the configure stage, evidence is visible
on the build logs on the cluster too:
http://beefy2.isc.freebsd.org/bulk/head-amd64-default/2014-04-05_03h54m48s/logs/ocaml-4.00.1_1.log
here is the relevant part for reference:
hasgot -I/usr/local/include -R/usr/local/lib -L/usr/local/lib -lX11 -i X11/Xlib.h XrmInitialize: cc -O2 -pipe -fno-strict-aliasing -O -I/usr/local/include -R/usr/local/lib -o tst hasgot.c -L/usr/local/lib -lX11
cc: error: unknown argument: '-R/usr/local/lib'
Cannot compile X11 program
X11 not found, the "graph" library will not be supported.
Configuring LablTk...
X11 not found or disabled.
Configuration failed, LablTk will not be built.
hasgot -i bfd.h: cc -O2 -pipe -fno-strict-aliasing -O -o tst hasgot.c
hasgot.c:1:10: fatal error: 'bfd.h' file not found
#include <bfd.h>
^
1 error generated.
BFD library not found, 'objinfo' will be unable to display info on .cmxs files
tryassemble: cc -c -o tst cfi.S
tryassemble: as -o tst cfi.S
Assembler supports CFI
** Configuration summary **
Directories where OCaml will be installed:
binaries.................. /usr/local/bin
standard library.......... /usr/local/lib/ocaml
manual pages.............. /usr/local/man (with extension .1)
Configuration for the bytecode compiler:
C compiler used........... cc -O2 -pipe -fno-strict-aliasing
options for compiling..... -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE
options for linking....... -Wl,-E -lm -lcurses -pthread
shared libraries are supported
options for compiling..... -fPIC -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE
command for building...... cc -O2 -pipe -fno-strict-aliasing -shared -o lib.so -Wl,-rpath,/a/path objs
Configuration for the native-code compiler:
hardware architecture..... amd64
OS variant................ freebsd
C compiler used........... cc -O2 -pipe -fno-strict-aliasing
options for compiling..... -D_FILE_OFFSET_BITS=64 -D_REENTRANT -D_THREAD_SAFE
options for linking....... -lm
assembler ................ as
preprocessed assembler ... cc -c
assembler supports CFI ... yes
native dynlink ........... true
profiling with gprof ..... supported
Source-level replay debugger: supported
Additional libraries supported:
unix str num dynlink bigarray systhreads threads
Configuration for the "num" library:
target architecture ...... amd64 (asm level 1)
The "graph" library: not supported
The "labltk" library: not supported
** OCaml configuration completed successfully **
Attached patch fixes this by simply removing the offending line
from the configure script. This is the removed line:
*-*-*bsd*) x11_link="-R$dir -L$dir -lX11";;
Tested in poudriere on all major releases. Tested live on head and 10.0.
I could not find documentation on the -R flag, if it is in fact
needed in certain circumstances I can modify the patch
accordingly.
>How-To-Repeat:
>Fix:
Index: Makefile
===================================================================
--- Makefile (revision 350383)
+++ Makefile (working copy)
@@ -3,7 +3,7 @@
PORTNAME= ocaml
PORTVERSION= 4.00.1
-PORTREVISION= 1
+PORTREVISION= 2
CATEGORIES= lang
MASTER_SITES= http://caml.inria.fr/distrib/${DISTNAME:R}/ \
${MASTER_SITE_GENTOO}
Index: files/patch-configure
===================================================================
--- files/patch-configure (revision 350383)
+++ files/patch-configure (working copy)
@@ -1,6 +1,6 @@
---- configure.orig 2012-06-26 15:33:50.000000000 +0000
-+++ configure
-@@ -88,6 +88,8 @@ while : ; do
+--- configure.orig 2012-06-26 17:33:50.000000000 +0200
++++ configure 2014-04-07 00:01:05.620642313 +0200
+@@ -88,6 +88,8 @@
withcurses=no;;
-no-shared-libs|--no-shared-libs)
withsharedlibs=no;;
@@ -9,7 +9,7 @@
-x11include*|--x11include*)
x11_include_dir=$2; shift;;
-x11lib*|--x11lib*)
-@@ -537,9 +539,9 @@ if test $withsharedlibs = "yes"; then
+@@ -537,9 +539,9 @@
mksharedlib="$flexlink"
mkmaindll="$flexlink -maindll"
shared_libraries_supported=true;;
@@ -21,7 +21,7 @@
bytecclinkopts="$bytecclinkopts -Wl,-E"
byteccrpath="-Wl,-rpath,"
mksharedlibrpath="-Wl,-rpath,"
-@@ -549,7 +551,7 @@ if test $withsharedlibs = "yes"; then
+@@ -549,7 +551,7 @@
case "$bytecc" in
gcc*)
sharedcccompopts="-fPIC"
@@ -30,7 +30,7 @@
byteccrpath="-Wl,-rpath,"
mksharedlibrpath="-Wl,-rpath,"
shared_libraries_supported=true;;
-@@ -565,11 +567,11 @@ if test $withsharedlibs = "yes"; then
+@@ -565,11 +567,11 @@
gcc*)
sharedcccompopts="-fPIC"
if sh ./solaris-ld; then
@@ -44,7 +44,7 @@
bytecclinkopts="$bytecclinkopts -Wl,-E"
natdynlinkopts="-Wl,-E"
byteccrpath="-Wl,-rpath,"
-@@ -593,12 +595,12 @@ if test $withsharedlibs = "yes"; then
+@@ -593,12 +595,12 @@
mksharedlibrpath="-rpath "
shared_libraries_supported=true;;
i[3456]86-*-darwin[89].*)
@@ -59,7 +59,7 @@
bytecccompopts="$dl_defs $bytecccompopts"
dl_needs_underscore=false
shared_libraries_supported=true;;
-@@ -608,7 +610,7 @@ if test $withsharedlibs = "yes"; then
+@@ -608,7 +610,7 @@
shared_libraries_supported=false;;
*-*-openbsd*)
sharedcccompopts="-fPIC"
@@ -68,7 +68,7 @@
bytecclinkopts="$bytecclinkopts -Wl,-E"
natdynlinkopts="-Wl,-E"
byteccrpath="-Wl,-rpath,"
-@@ -633,7 +635,7 @@ if test $withsharedlibs = "yes"; then
+@@ -633,7 +635,7 @@
x86_64-*-linux*) natdynlink=true;;
i[3456]86-*-darwin[89].*) natdynlink=true;;
i[3456]86-*-darwin*)
@@ -77,7 +77,7 @@
natdynlink=true
fi;;
x86_64-*-darwin*) natdynlink=true;;
-@@ -641,6 +643,8 @@ if test $withsharedlibs = "yes"; then
+@@ -641,6 +643,8 @@
sparc*-*-linux*) natdynlink=true;;
i686-*-kfreebsd*) natdynlink=true;;
x86_64-*-kfreebsd*) natdynlink=true;;
@@ -86,7 +86,7 @@
i[345]86-*-freebsd*) natdynlink=true;;
x86_64-*-freebsd*) natdynlink=true;;
i[345]86-*-openbsd*) natdynlink=true;;
-@@ -672,6 +676,7 @@ case "$host" in
+@@ -672,6 +676,7 @@
sparc*-*-gnu*) arch=sparc; system=gnu;;
i[3456]86-*-linux*) arch=i386; system=linux_`sh ./runtest elf.c`;;
i[3456]86-*-*bsd*) arch=i386; system=bsd_`sh ./runtest elf.c`;;
@@ -94,7 +94,7 @@
i[3456]86-*-nextstep*) arch=i386; system=nextstep;;
i[3456]86-*-solaris*) if $arch64; then
arch=amd64; system=solaris
-@@ -687,6 +692,7 @@ case "$host" in
+@@ -687,6 +692,7 @@
fi;;
i[3456]86-*-gnu*) arch=i386; system=gnu;;
powerpc*-*-linux*) arch=power; model=ppc; system=elf;;
@@ -102,7 +102,7 @@
powerpc-*-netbsd*) arch=power; model=ppc; system=elf;;
powerpc-*-rhapsody*) arch=power; model=ppc; system=rhapsody;;
powerpc-*-darwin*) arch=power; system=rhapsody
-@@ -700,6 +706,7 @@ case "$host" in
+@@ -700,6 +706,7 @@
arm*-*-linux-gnueabi) arch=arm; system=linux_eabi;;
x86_64-*-linux*) arch=amd64; system=linux;;
x86_64-*-gnu*) arch=amd64; system=gnu;;
@@ -110,7 +110,7 @@
x86_64-*-freebsd*) arch=amd64; system=freebsd;;
x86_64-*-netbsd*) arch=amd64; system=netbsd;;
x86_64-*-openbsd*) arch=amd64; system=openbsd;;
-@@ -724,7 +731,7 @@ else
+@@ -724,7 +731,7 @@
fi
nativecccompopts=''
@@ -119,7 +119,7 @@
nativeccrpath="$byteccrpath"
case "$arch,$nativecc,$system,$host_type" in
-@@ -786,6 +793,8 @@ case "$arch,$model,$system" in
+@@ -786,6 +793,8 @@
amd64,*,linux) profiling='prof';;
amd64,*,gnu) profiling='prof';;
arm,*,linux*) profiling='prof';;
@@ -128,7 +128,15 @@
*) profiling='noprof';;
esac
-@@ -1544,10 +1553,10 @@ fi
+@@ -1371,7 +1380,6 @@
+ x11_libs="-L$dir"
+ case "$host" in
+ *-kfreebsd*-gnu) x11_link="-L$dir -lX11";;
+- *-*-*bsd*) x11_link="-R$dir -L$dir -lX11";;
+ *) x11_link="-L$dir -lX11";;
+ esac
+ fi
+@@ -1544,10 +1552,10 @@
# Look for BFD library
if ./hasgot -i bfd.h && \
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list