Closed Bug 5803 Opened 26 years ago Closed 26 years ago

CVS from Fri Apr 30 will not compile because of PNG problem.

Categories

(SeaMonkey :: Build Config, defect, P3)

Sun
Solaris
defect

Tracking

(Not tracked)

VERIFIED DUPLICATE of bug 5842

People

(Reporter: dejong, Assigned: briano)

Details

Tried to compile mozilla from the CVS Fri Apr 30 on a Solaris 5.6 system
with egcs 1.1.1.

I configured like this.


cd mozilla
mkdir solaris
cd solairs

setenv PRE `cd ../../install_solaris ; pwd`

../configure \
 --with-glib-prefix=$PRE \
 --with-gtk-prefix=$PRE \
 --with-nspr=$PRE \
 --with-libIDL-prefix=$PRE \
 --with-pthreads \
 --enable-new-clipboard \
 --enable-mailnews \
 --disable-md \
 --enable-profile

make

...

make[2]: Entering directory
`/project/neon/users/mo/mozilla/mozilla/solaris/modules/libimg/pngcom'

...

rm -f libnspng.a
ar cr libnspng.a ./ipng.o ./png_png.o ./nsPNGDecoder.o ./nsPNGCallback.o
./dllcompat.o
ranlib libnspng.a
rm -f libnspng.so
gcc -shared -Wl,-h -Wl,libnspng.so -o libnspng.so ./ipng.o ./png_png.o
./nsPNGDecoder.o ./nsPNGCallback.o ./dllcompat.o  ../../../dist/./lib/libpng.a
../../../dist/./lib/libzlib.a
gcc: ../../../dist/./lib/libpng.a: No such file or directory
make[2]: *** [libnspng.so] Error 1
make[2]: Leaving directory
`/project/neon/users/mo/mozilla/mozilla/solaris/modules/libimg/pngcom'
make[1]: *** [libs] Error 2
make[1]: Leaving directory
`/project/neon/users/mo/mozilla/mozilla/solaris/modules/libimg'
make: *** [libs] Error 2



% ls dist/lib
components
libfdm.a
libfdm.so
libgmbasegtk.a
libgmbasegtk.so
libimg.a
libimg.so
libjpeg.a
libjpeg.so
liblwbrk.a
libmozdbm.a
libmozdbm.so
libmozjs.a
libmozjs.so
libmozutil.a
libmozutil.so
libnsgif.a
libnslocale.a
libnslocale_s.a
libpref.a
libpref.so
libraptorbase.a
libraptorbase.so
libreg.a
libreg.so
libsecfree.a
libsecfree.so
libstrres.a
libuconv.a
libucvcn.a
libucvja.a
libucvja2.a
libucvlatin.a
libunicharutil.a
libxpcom.a
libxpcom.so
libxpconnect.a
libxpt.a
libxpt.so
libxptcall.a
libxptcall.so
libxptcmd.a
libxptcmd.so
libxptinfo.a
libxptinfo.so
libzlib.a
libzlib.so




I then went back and looked at config.log and found this.


configure:8634: checking for png_get_valid in -lpng
configure:8653: gcc -o conftest -I/include   -g  -L/lib  -lz  conftest.c -lpng
-ll -lw -lposix4 -lintl -lelf -lnsl -lsoc
ket -lresolv -ldl -lm  1>&5
ld: fatal: library -lpng: not found
ld: fatal: File processing errors. No output written to conftest
collect2: ld returned 1 exit status
configure: failed program was:
#line 8642 "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_get_valid();

int main() {
png_get_valid()
; return 0; }






Just for kicks I then tried to run configure again to see if there
was an error or warning about this.

...

checking for png_get_valid in -lpng... no




So it seems like a png lib could not be found on my system. If this
is an error that can not be recovered from (I assume that mozilla
does not include its own png lib if one can not be found on the system)
then the configure process should detect that instead of getting a
compile time error which is much more difficult to figure out.
I later found that there was a PNG lib on my system but mozilla was
not able to find it because it did not look in /usr/local/lib by default.


find / -name libpng.so
...
/usr/local/lib/libpng.a
/usr/local/lib/libpng.so.2.1.0.2
/usr/local/lib/libpng.so.2
/usr/local/lib/libpng.so


nm /usr/local/lib/libpng.so | grep png_get_valid
00006920 T png_get_valid


So it seems like the problem was that /usr/local/lib was not
part of the search path for libs. I added the option
--with-png=/usr/local and that seemed to help.


checking for png_get_valid in -lpng... yes


Sadly, when I tried to recompile the build process was still
looking for the png lib in the dist directory.


cd modules/libimg/pngcom

gcc -shared -Wl,-h -Wl,libnspng.so -o libnspng.so ./ipng.o ./png_png.o
./nsPNGDecoder.o ./nsPNGCallback.o ./dllcompat.o  ../../../dist/./lib/libpng.a
../../../dist/./lib/libzlib.a
gcc: ../../../dist/./lib/libpng.a: No such file or directory
I tried a "make realclean" and then a recompile but that did not work.
I then got frustrated so I just ran it by hand and that seemed to work
(I added -L/usr/local/lib -lpng) to the compile line that failed in make.

gcc -shared -Wl,-h -Wl,libnspng.so -o libnspng.so ./ipng.o ./png_png.o
./nsPNGDecoder.o ./nsPNGCallback.o ./dllcompat.o -L/usr/local/lib -lpng
../../../dist/./lib/libzlib.a

This hack solved my problem for now but I fear others will run into
this png lib problem in the future.
Status: NEW → RESOLVED
Closed: 26 years ago
Resolution: --- → DUPLICATE
I think this is fixed now.  Please refer to bug #5842 for details.


*** This bug has been marked as a duplicate of 5842 ***
I just compiled today (Mon May 10) on my Solaris box and I can
confirm that this bug is fixed. Thanks.
Status: RESOLVED → VERIFIED
Verified Dup
Product: Browser → Seamonkey
You need to log in before you can comment on or make changes to this bug.