Subject: Re: qt3-lib on OS X
To: adam@NetBSD.org, Manuel Bouyer <bouyer@antioche.eu.org>
From: Jeremy C. Reed <reed@reedmedia.net>
List: tech-pkg
Date: 06/10/2005 11:28:42
(I also CC'd the qt3-libs maintainer. There is not a maintainer for
qt3-tools.)

On Sat, 16 Apr 2005, Manuel Bouyer wrote:

> On Fri, Apr 15, 2005 at 12:55:36PM -0500, MLH wrote:
> > qt3-libs-3.3.4 build for me on OS/X with your changes. I can't get
> > qt3-tools to build though.
>
> Yes, I had some minor troubles with qt3-tools
>
> > [...]
> > -lSM -lpthread
> > ld: archive: /opt/pkgsrc/x11/qt3-tools/work.belgium/qt-x11-free-3.3.4/lib/libdesignercore.a has no table of contents, add one with ranlib(1) (can't load from it)
>
> This one was easy, I just ran ranlib on the .a as suggested.
> Then you'll see that some programs needs -lresolv added to the libraries.
>
> I didn't find a way to fix this, but I didn't investigate much.

Adding -lresolv for the qt3-libs build makes the library link to it. And
it fixes the problem later with qt3-tools.

$ otool -L /usr/pkg/qt3/lib/libqt-mt.3.dylib | grep resolv
        /usr/lib/libresolv.9.dylib (compatibility version 1.0.0, current version 324.9.0)

(Before it was not seen.)

I don't know if all Darwin/Mac OS X systems have libresolv.

Then ranlib was "true" so it was not ran.

See my QMAKE_RANLIB below which worked for me:

cvs diff: Diffing x11/qt3-libs
Index: x11/qt3-libs/Makefile.common
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-libs/Makefile.common,v
retrieving revision 1.50
diff -b -u -r1.50 Makefile.common
--- x11/qt3-libs/Makefile.common	1 Jun 2005 19:30:29 -0000	1.50
+++ x11/qt3-libs/Makefile.common	10 Jun 2005 18:20:52 -0000
@@ -61,8 +61,15 @@
 SYS_LIBS=		-lbind -ldb -ldl
 .elif ${OPSYS} == "DragonFly"
 CONFIGURE_ARGS+=	-platform freebsd-g++
+.elif ${OPSYS} == "Darwin"
+QMAKE_RANLIB=		${RANLIB}
+LDFLAGS+=		-lresolv
+#XXX jcr: should I use SYS_LIBS?
+#XXX jcr: should I check for /usr/lib/libresolv.dylib first like fink does?
 .endif

+QMAKE_RANLIB?=		${TRUE}
+
 .if !exists(${X11BASE}/lib/libXinerama.so)
 CONFIGURE_ARGS+=	-no-xinerama
 .endif
@@ -112,6 +119,7 @@
 		-e 's:@PTHREAD_LDFLAGS@:${PTHREAD_LDFLAGS}:g' \
 		-e 's:@PTHREAD_LIBS@:${PTHREAD_LIBS}:g' \
 		-e 's:@COMPILER_RPATH_FLAG@:${COMPILER_RPATH_FLAG}:g' \
+		-e 's:@QMAKE_RANLIB@:${QMAKE_RANLIB}:g' \
 		${FILESDIR}/qmake.conf > ${WRKSRC}/qmake.conf
 	for dir in ${WRKSRC}/mkspecs/*; do \
 		${CP} ${WRKSRC}/qmake.conf $${dir}; \
cvs diff: Diffing x11/qt3-libs/files
Index: x11/qt3-libs/files/qmake.conf
===================================================================
RCS file: /cvsroot/pkgsrc/x11/qt3-libs/files/qmake.conf,v
retrieving revision 1.17
diff -b -u -r1.17 qmake.conf
--- x11/qt3-libs/files/qmake.conf	12 Nov 2004 06:39:21 -0000	1.17
+++ x11/qt3-libs/files/qmake.conf	10 Jun 2005 18:20:52 -0000
@@ -84,7 +84,7 @@
 QMAKE_UIC		= $(QTDIR)/bin/uic

 QMAKE_AR		= @AR@ ru
-QMAKE_RANLIB		= true
+QMAKE_RANLIB		= @QMAKE_RANLIB@

 QMAKE_TAR		= tar -cf
 QMAKE_GZIP		= gzip -9f
cvs diff: Diffing x11/qt3-libs/patches
cvs diff: Diffing x11/qt3-tools


 Jeremy C. Reed

 	  	 	 technical support & remote administration
	  	 	 http://www.pugetsoundtechnology.com/