Porting - 4. Preparing for 10.2
4.1 The bash shell
Fink made the transition from OS X 10.0 to OS X 10.1 fairly easily, thanks in part to planning ahead for the changes that were coming. We will try to do the same for the next transition, but not many details are known yet.
We understand that OS X 10.2 will use bash rather than zsh to provide
/bin/sh
functionality. This has at least three implications
for fink.
-
In the past, some fink packages created a CompileScript (or PatchScript or
InstallScript) which does nothing
by simply putting a semicolon in the script. This does not work
under bash, and must be replaced by something like
CompileScript: echo "nothing to do"
-
In the past, some fink packages used a the
lib(foo|bar).dylib
construction to refer to two libraries at once; this doesn't work under bash (and the bash alternativelib{foo,bar}.dylib
doesn't work under zsh). Solution: write out the names in full. -
A libtool patch is needed in many cases, to prevent libraries from being
build unversioned under bash.
Note: you do not need this patch with
libtool-1.3.5, for example, if you are using UpdateLibtool:
True.
The symptom: when building under bash,
you see
../libtool: test: too many arguments
When this happens,configure
contains the following:archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)'
Here is a patch (but it must be used with care, because sometimes there are other libtool problems as well so this patch must be applied by hand):diff -Naur gdk-pixbuf-0.16.0/configure gp-new/configure --- gdk-pixbuf-0.16.0/configure 2002-01-22 20:11:48.000000000 -0500 +++ gp-new/configure 2002-05-10 03:02:44.000000000 -0400 @@ -3338,7 +3338,7 @@ # FIXME: Relying on posixy $() will cause problems for # cross-compilation, but unfortunately the echo tests do not # yet detect zsh echo's removal of \ escapes. - archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $(test -n "$verstring" -a x$verstring != x0.0 && echo $verstring)' + archive_cmds='$CC $(test .$module = .yes && echo -bundle || echo -dynamiclib) $allow_undefined_flag -o $lib $libobjs $deplibs$linkopts -install_name $rpath/$soname $tmp_verstring' # We need to add '_' to the symbols in $export_symbols first #archive_expsym_cmds="$archive_cmds"' && strip -s $export_symbols' hardcode_direct=yes diff -Naur gdk-pixbuf-0.16.0/ltmain.sh gp-new/ltmain.sh --- gdk-pixbuf-0.16.0/ltmain.sh 2002-01-22 20:11:43.000000000 -0500 +++ gp-new/ltmain.sh 2002-05-10 03:04:49.000000000 -0400 @@ -2862,6 +2862,11 @@ if test -n "$export_symbols" && test -n "$archive_expsym_cmds"; then eval cmds=\"$archive_expsym_cmds\" else + if test "x$verstring" = "x0.0"; then + tmp_verstring= + else + tmp_verstring="$verstring" + fi eval cmds=\"$archive_cmds\" fi IFS="${IFS= }"; save_ifs="$IFS"; IFS='~'
4.2 The gcc3 compiler
Mac OS X 10.2 uses the gcc3 compiler.
Some packages which have loadable modules and use
libtool fail with an install_name error, because libtool passes
the -install_name flag even along with the -bundle flag (when it is not
strictly needed). This behavior was accepted by the gcc2 compiler but is
not being accepted by the gcc3 compiler. The fix can be found here.
Note that you do not need the patch if your package uses libtool-1.3.5
(for example, if you are using UpdateLibtool: True
)
since it has already been incorporated into a revised version of fink's
ltconfig file (available in pre-release versions of fink).
Another issue with the gcc3 compiler is an incompatibility for C++ ABIs between gcc2 and gcc3. In practice, this means that C++ programs compiled with gcc3 cannot link to libraries compiled with gcc2.
Next: 5. Preparing for 10.3