From xemacs-m  Thu Jun 12 21:47:10 1997
Received: from ALPHA8.CC.MONASH.EDU.AU (alpha8.cc.monash.edu.au [130.194.1.8])
	by xemacs.org (8.8.5/8.8.5) with ESMTP id VAA25860
	for <xemacs-beta@xemacs.org>; Thu, 12 Jun 1997 21:46:59 -0500 (CDT)
Received: from goaway.cc.monash.edu.au ("port 1824"@goaway.cc.monash.edu.au)
 by vaxh.cc.monash.edu.au (PMDF V5.1-7 #20655)
 with ESMTP id <01IK0W2Z1EGU8ZF6LF@vaxh.cc.monash.edu.au> for
 xemacs-beta@xemacs.org; Fri, 13 Jun 1997 12:46:54 +1000
Received: (ajc@localhost) by goaway.cc.monash.edu.au (8.8.5/8.6.4)
 id MAA07548; Fri, 13 Jun 1997 12:46:53 +1000 (EST)
Date: Fri, 13 Jun 1997 12:46:52 +1000
From: Andrew J Cosgriff <Andrew.Cosgriff@cc.monash.edu.au>
Subject: Re: 20.3-b5 ok on alpha-dec-osf4.0
In-reply-to: Martin Buchholz's message of "Wed, 11 Jun 1997 17:37:01 -0700"
To: xemacs-beta@xemacs.org
Message-id: <rui67vj2p9f.fsf@goaway.cc.monash.edu.au>
MIME-version: 1.0 (generated by tm-edit 7.106)
X-Mailer: Gnus v5.4.56/XEmacs 20.2
Content-type: text/plain; charset=US-ASCII
X-Attribution: ajc
X-URI: <URL:http://www-personal.monash.edu.au/~ajc>
X-PGP-Key-ID: C7BD53F5
X-Face: 
 PBPJ+.AE`FBN4$}H<dIo+^`A-G%mJTXXP$^4bBox##5=oF{G\[:0|sNlr%~H1,>rwwEh<qq.dHRpu8ftJ\'14l]<x(nRD>J)x?-5$MQ%Z)svNR@Q\WG6[GDr,}a@8ULwGWBsk,Pqxm!Z<lnD(Skwwe$j+<0g6N6z}>-
X-Horoscope: Your child will put money in the bank soon.  Do something nice for
 a wallflower this month.  Your television will have financial problems soon.
 Play Car Bomb with the help of someone you know. You'll never be ill.  Your
 lucky numbers are 20, 30, and 40.
Lines: 86
References: <ruiwwo2gi6z.fsf@goaway.cc.monash.edu.au>
 <199706120037.RAA19126@xemacs.eng.sun.com>

"Martin" == Martin Buchholz <mrb@Eng.Sun.COM> writes:

>>>>>> "ajc" == Andrew J Cosgriff <Andrew> writes:

ajc> uname -a: OSF1 goaway.cc.monash.edu.au V4.0 564 alpha alpha

ajc> LIBS="-lz" ./configure  '--cflags=-O3' '--with-gcc=no' '--site-includes=/usr/local/include'

Martin> I have reason to believe the LIBS="-lz" should not be
Martin> necessary on alpha-dec-osf4.0.  Could you confirm whether it's
Martin> necessary, and if it is, try to determine why (config.log is
Martin> your friend)?

It was definitely necessary, but again more from my own bogosity than
xemacs'

from configure -

...
if test "$with_png" != "no"; then
  for extra_libs in "" "-lz" "-lgz"; do
    
xe_msg_checking="for png_read_image in -lpng"
test -n "$extra_libs" && xe_msg_checking="$xe_msg_checking using extra libs $extra_libs"
echo $ac_n "checking "$xe_msg_checking"""... $ac_c" 1>&6
echo "configure:5829: checking "$xe_msg_checking"" >&5
ac_lib_var=`echo png'_'png_read_image | sed 'y%./+-%__p_%'`

xe_check_libs=" -lpng $extra_libs"
cat > conftest.$ac_ext <<EOF
#line 5834 "configure"
#include "confdefs.h"
/* Override any gcc2 internal prototype to avoid an error.  */
/* We use char because int might match the return type of a gcc2
    builtin and then its argument prototype would still apply.  */
char png_read_image();

int main() {
png_read_image()
; return 0; }
EOF
if { (eval echo configure:5845: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=yes"
else
  echo "configure: failed program was:" >&5
  cat conftest.$ac_ext >&5
  rm -rf conftest*
  eval "ac_cv_lib_$ac_lib_var=no"
fi
rm -f conftest*
xe_check_libs=""
...

The problem here is that the compilation works, but only upon running
it does the program cause the unresolved unresolved symbol errors.
configure only tests to see if the compiled program exists to see if
PNG works, and it's only later on when it actually has to *run* some
of the test programs that I saw the unresolved symbol errors.

The reason the unresolved symbol errors happened is that when I
hand-created my PNG shared library, I did

ld -shared -expect_unresolved '*' -o libpng.so.0.90 png.o pngrcb.o
pngrutil.o pngtrans.o pngwutil.o pngread.o pngrio.o pngwio.o
pngwrite.o pngrtran.o pngwtran.o pngmem.o pngerror.o pngpread.o

when I should have left out the -expect_unresolved '*', since the
unresolved symbol messages that ld gives me when I link the shared
library together are just warnings...i'd been mistaking them for
errors.

then i discovered that just leaving out -expect_unresolved '*' also
doesn't help, and that I needed to do

ld -shared -o libpng.so.0.90 png.o pngrcb.o pngrutil.o pngtrans.o
pngwutil.o pngread.o pngrio.o pngwio.o pngwrite.o pngrtran.o
pngwtran.o pngmem.o pngerror.o pngpread.o -lc -lm -L/usr/local/lib -lz

Anyway, it's my problem, not XEmacs....sorry !!

Andrew
-- 
 - Andrew J. Cosgriff -        >> see X-headers >>       ajc@bing.wattle.id.au
       Everybody is going somewhere!!  It's probably a garage sale or a
                               disaster Movie!!

