Opened 17 years ago

Closed 17 years ago

Last modified 16 years ago

#13366 closed enhancement (fixed)

libiconv universal support without deactivating any previous version

Reported by: nox@… Owned by: ryandesign (Ryan Carsten Schmidt)
Priority: Normal Milestone:
Component: ports Version:
Keywords: Cc:
Port:

Description

Changes:

  • Fixed universal support, it doesn't require anymore to deactivate any previous version.

This revision just patchs src/Makefile.in in order to bypass libtool, just like on HP-UX.

% port installed libiconv
The following ports are currently installed:
  libiconv @1.12_0+darwin_8 (active)
% lipo -info work/destroot/opt/local/bin/iconv work/destroot/opt/local/lib/libcharset.1.0.0.dylib
Architectures in the fat file: work/destroot/opt/local/bin/iconv are: i386 ppc 
Architectures in the fat file: work/destroot/opt/local/lib/libcharset.1.0.0.dylib are: i386 ppc

Attachments (2)

libiconv-universal.diff (2.2 KB) - added by nox@… 17 years ago.
libiconv-universal.2.diff (1.8 KB) - added by ryandesign (Ryan Carsten Schmidt) 17 years ago.
includes just Anthony's patch for this issue

Download all attachments as: .zip

Change History (15)

Changed 17 years ago by nox@…

Attachment: libiconv-universal.diff added

comment:1 Changed 17 years ago by nox@…

Version: 1.5.2

comment:2 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Thank you, Anthony; I've been hoping to look into this problem (and several other messes in this portfile).

Out of curiosity, why change post-patch to pre-patch for the disable_utf8mac variant? Is that material to this change?

Also, why declare empty configure.cppflags and configure.ldflags?

comment:3 Changed 17 years ago by nox@…

The pre-patch thing was another experiment, I just think it should be a good thing to try a maximum to use MacPorts base code instead of calling system.

The configure flags were my first attempt to fix the universal problem, I thought removing -I${prefix}/include and -L${prefix}/lib from would solve the problem. You can remove them.

comment:4 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Ok, let me handle the utf8mac patch cleanup separately in #13368, then I'll come back to this.

comment:5 Changed 17 years ago by nox@…

ping?

comment:6 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Oh right! Sorry. I will deal with this now.

comment:7 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Status: newassigned

comment:8 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

I wanted to convince myself that, without your patch, there is a problem, and that with your patch, the problem is fixed.

I tested this way. I'm using Mac OS X 10.4.11 with Xcode 2.4.1 and MacPorts 1.7.0 from trunk r33622 on an Intel Core 2 Duo MacBook Pro. I uninstalled libiconv. Then I installed and activated libiconv @1.12_0. Then I edited the portfile to remove the pre-fetch warning message and tried installing libiconv @1.12_0+universal. It failed:

--->  Staging libiconv into destroot
Error: Target org.macports.destroot returned: shell command " cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/libiconv-1.12" && make install DESTDIR=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot " returned error 2
Command output:          rm -f $objects && \
         mv -f libiconv.new.a libiconv.a) ;; \
esac
if test -n ""; then /usr/bin/install -c -m 644  /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/.new && mv /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/.new /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/ ; fi
cd srclib && make install prefix='/opt/local' exec_prefix='/opt/local' libdir='/opt/local/lib'
make  install-am
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
cd src && make install prefix='/opt/local' exec_prefix='/opt/local' libdir='/opt/local/lib'
test `ls -ld . | sed -e 's/^d\(.........\).*/\1/'` = rwxrwxrwx || chmod 777 .
if [ ! -d /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/bin ] ; then /bin/sh ../build-aux/mkinstalldirs /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/bin ; fi
case "darwin8" in \
  hpux*) /usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 `if test -n ''; then  /opt/local/bin; fi` iconv.o ../srclib/libicrt.a -L/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib -liconv   `if test -n '/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot'; then echo " -Wl,+b -Wl,/opt/local/lib"; fi` -o iconv;; \
  *) /bin/sh ../libtool --mode=link /usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 `if test -n ''; then  /opt/local/bin; fi` iconv.o ../srclib/libicrt.a /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/libiconv.la   -o iconv;; \
esac
/usr/bin/gcc-4.0 -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 iconv.o -o iconv  -L/opt/local/lib ../srclib/libicrt.a /opt/local/lib/libiconv.dylib  
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning /opt/local/lib/libiconv.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: Undefined symbols:
__libiconv_version
_iconv_canonicalize
_libiconv
_libiconv_close
_libiconv_open
_libiconvctl
_libiconvlist
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccXB0zvo.out (No such file or directory)
make[1]: *** [install] Error 1
make: *** [install] Error 2

Error: Status 1 encountered during processing.

Then I deactivated libiconv @1.12_0 and was able to install libiconv @1.12_0+universal. So this confirms that you cannot currently install libiconv universal if libiconv non-universal is active, which explains why we currently have that pre-fetch warning.

Next I activated libiconv @1.12_0 again and tried to install libiconv @1.12_0+universal again, this time using your patch. Unfortunately, the problem seems to remain:

--->  Staging libiconv into destroot
Error: Target org.macports.destroot returned: shell command " cd "/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/libiconv-1.12" && make install DESTDIR=/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot " returned error 2
Command output:          rm -f $objects && \
         mv -f libiconv.new.a libiconv.a) ;; \
esac
if test -n ""; then /usr/bin/install -c -m 644  /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/.new && mv /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/.new /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/ ; fi
cd srclib && make install prefix='/opt/local' exec_prefix='/opt/local' libdir='/opt/local/lib'
make  install-am
make[3]: Nothing to be done for `install-exec-am'.
make[3]: Nothing to be done for `install-data-am'.
cd src && make install prefix='/opt/local' exec_prefix='/opt/local' libdir='/opt/local/lib'
test `ls -ld . | sed -e 's/^d\(.........\).*/\1/'` = rwxrwxrwx || chmod 777 .
if [ ! -d /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/bin ] ; then /bin/sh ../build-aux/mkinstalldirs /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/bin ; fi
case "darwin8" in \
  hpux*) /usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 `if test -n ''; then  /opt/local/bin; fi` iconv.o ../srclib/libicrt.a -L/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib -liconv   `if test -n '/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot'; then echo " -Wl,+b -Wl,/opt/local/lib"; fi` -o iconv;; \
  darwin*) /usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 `if test -n ''; then  /opt/local/bin; fi` iconv.o ../srclib/libicrt.a -L/opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib -liconv   -o iconv;; \
  *) /bin/sh ../libtool --mode=link /usr/bin/gcc-4.0 -L/opt/local/lib -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -O2 -isysroot /Developer/SDKs/MacOSX10.4u.sdk -arch ppc -arch i386 `if test -n ''; then  /opt/local/bin; fi` iconv.o ../srclib/libicrt.a /opt/local/var/macports/build/_Users_rschmidt_macports_dports_textproc_libiconv/work/destroot/opt/local/lib/libiconv.la   -o iconv;; \
esac
/usr/bin/ld: for architecture ppc
/usr/bin/ld: warning /opt/local/lib/libiconv.dylib cputype (7, architecture i386) does not match cputype (18) for specified -arch flag: ppc (file not loaded)
/usr/bin/ld: Undefined symbols:
__libiconv_version
_iconv_canonicalize
_libiconv
_libiconv_close
_libiconv_open
_libiconvctl
_libiconvlist
collect2: ld returned 1 exit status
lipo: can't open input file: /var/tmp//ccSQ6Js9.out (No such file or directory)
make[1]: *** [install] Error 1
make: *** [install] Error 2

Error: Status 1 encountered during processing.

So it doesn't look like your patch fixes the issue. Any ideas?

Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Attachment: libiconv-universal.2.diff added

includes just Anthony's patch for this issue

comment:9 Changed 17 years ago by nox@…

libiconv-universal.2.diff misses something from my messed patch. It does not reset configure.ldflags and configure.cppflags, so it passes -I/opt/local/include and -L/opt/local/lib flags to GCC, which detects our not-universally-built library and dies afterwards.

comment:10 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Oh, ok. I didn't miss it; I asked why you cleared configure.cppflags and configure.ldflags, and you said that it wasn't necessary and I could remove them, so I did. I'll put them back and try again.

comment:11 Changed 17 years ago by nox@…

Oh, you're awfully right (you are always right, why is that? do you have some cheat codes or something like that? ;)). My bad. So it was part of the fix I think. One thing is sure: it did built here one time, I'll dig into this again if it didn't work for you this time.

comment:12 Changed 17 years ago by ryandesign (Ryan Carsten Schmidt)

Resolution: fixed
Status: assignedclosed

I know, I am irritating! :) Fortunately, you are also correct now, and I committed your correctness in r33625. Sorry it took me so long! But thanks so much for fixing this issue for me. It was bugging me.

comment:13 Changed 16 years ago by (none)

Milestone: Port Enhancements

Milestone Port Enhancements deleted

Note: See TracTickets for help on using tickets.