|
From: mark b. <mbr...@ai...> - 2012-01-09 03:27:08
|
On Jan 8, 2012, at 10:35 AM, Arthur Norman wrote:
> I my Mac tests I have had significant pain with the 10.7 SDK (hence the
> "--without-lionSDK" option that the configure scripts support (on the CSL
> side)) because of changes that Apple had made. Thus even on Lion I
> typically build with the Snow Leopard SDK.
An update to my previous post:
Macports handles the configure and build phases; all that needs to be passed are the arguments, it handles all the environment variables. One drawback is that I can't pass both --with-csl and --with-psl. So I had to override macports' configure phase. At first, I used:
configure {
system -W ${worksrcpath} "./configure --prefix=${prefix} --with-csl ; ./configure --with-psl"
}
but I didn't realize that by overriding macports configure, the environment variables didn't get passed (as seen in macports' log):
:info:configure in-place build attempt = yes
:info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl'
:info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
:info:configure configure: +++ Will build in /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/cslbuild/x86_64-mac_10.7_lion-darwin11.2.0
:info:configure configure: passcc =
:info:configure configure: doconfig = /bin/sh /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/configure '--prefix=/opt/local' '--with-csl' CPPFLAGS="" CFLAGS="" CXXFLAGS="" LDFLAGS="" --with-build="x86_64-mac_10.7_lion-darwin11.2.0" --with-pslbuild="x86_64-mac_10.7_lion-darwin11.2.0"
:info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
:info:configure checking build system type... x86_64-apple-darwin11.2.0
:info:configure checking host system type... x86_64-apple-darwin11.2.0
:info:configure in-place build attempt = no
:info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl' 'CPPFLAGS=' 'CFLAGS=' 'CXXFLAGS=' 'LDFLAGS=' '--with-build=x86_64-mac_10.7_lion-darwin11.2.0' '--with-pslbuild=x86_64-mac_10.7_lion-darwin11.2.0'
:info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
:info:configure configure: +++ standard build case, srcdir = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
Amazingly, this compiled on lion, but did not for the fellow who had that script on his 10.6 machine. So I added the variables like so:
configure {
system -W ${worksrcpath} \
"CC=${configure.cc} \
CFLAGS=\"${configure.cflags} [get_canonical_archflags cc]\" \
CXX=${configure.cxx} \
CXXFLAGS=\"${configure.cxxflags} [get_canonical_archflags cxx]\" \
CPPFLAGS=\"${configure.cppflags}\" \
LDFLAGS=\"${configure.ldflags} [get_canonical_archflags ld]\" \
./configure --prefix=${prefix} --with-csl ; ./configure --with-psl"
}
Now the correct environment is set, as you can see:
:info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
:info:configure checking build system type... x86_64-apple-darwin11.2.0
:info:configure checking host system type... x86_64-apple-darwin11.2.0
:info:configure in-place build attempt = yes
:info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl'
:info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
:info:configure configure: +++ Will build in /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/cslbuild/x86_64-mac_10.7_lion-darwin11.2.0
:info:configure configure: passcc = CC="/Developer/usr/bin/clang" CPP="" CXX="/Developer/usr/bin/clang++" CXXCPP=""
:info:configure configure: doconfig = /bin/sh /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk/configure '--prefix=/opt/local' '--with-csl' CPPFLAGS="-I/opt/local/include" CFLAGS="-O2 -arch x86_64" CXXFLAGS="-O2 -arch x86_64" LDFLAGS="-L/opt/local/lib -arch x86_64" CC="/Developer/usr/bin/clang" CPP="" CXX="/Developer/usr/bin/clang++" CXXCPP="" --with-build="x86_64-mac_10.7_lion-darwin11.2.0" --with-pslbuild="x86_64-mac_10.7_lion-darwin11.2.0"
:info:configure configure: Absolute path to source directory = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
:info:configure checking build system type... x86_64-apple-darwin11.2.0
:info:configure checking host system type... x86_64-apple-darwin11.2.0
:info:configure in-place build attempt = no
:info:configure configure: host=x86_64-apple-darwin11.2.0 args= '--prefix=/opt/local' '--with-csl' 'CPPFLAGS=-I/opt/local/include' 'CFLAGS=-O2 -arch x86_64' 'CXXFLAGS=-O2 -arch x86_64' 'LDFLAGS=-L/opt/local/lib -arch x86_64' 'CC=/Developer/usr/bin/clang' 'CPP=' 'CXX=/Developer/usr/bin/clang++' 'CXXCPP=' '--with-build=x86_64-mac_10.7_lion-darwin11.2.0' '--with-pslbuild=x86_64-mac_10.7_lion-darwin11.2.0'
:info:configure configure: Will build in the x86_64-mac_10.7_lion-darwin11.2.0 subdirectory
:info:configure configure: +++ standard build case, srcdir = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk = /opt/local/var/macports/build/_Users_marbre_ports_math_reduce/reduce/work/trunk
It builds on lion, but with the following errors:
:info:configure configure: Building for Macintosh/Darwin with X
:info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
:info:configure lipo: can't figure out the architecture type of: /var/tmp//ccAr5REE.out
:info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
:info:configure conftest.c:1:19: error: stdio.h: No such file or directory
:info:configure conftest.c: In function 'main':
:info:configure conftest.c:3: warning: incompatible implicit declaration of built-in function 'printf'
:info:configure lipo: can't figure out the architecture type of: /var/tmp//ccjtXcMt.out
:info:configure llvm-gcc-4.2: error trying to exec '/usr/bin/../llvm-gcc-4.2/bin/powerpc-apple-darwin11-llvm-gcc-4.2': execvp: No such file or directory
:info:configure conftest.c:1:19: error: stdio.h: No such file or directory
:info:configure conftest.c: In function 'main':
:info:configure conftest.c:3: warning: incompatible implicit declaration of built-in function 'printf'
:info:configure lipo: can't figure out the architecture type of: /var/tmp//ccD75kI3.out
:info:configure configure: fat binary creation will probably NOT be possible
These errors were in the previous log as well. I don't know if this is because those instructions work for a 10.6 installation, but not 10.7? And there's still those explicit "gcc" calls, as I pointed out in my previous message.
-Mark
|