[MPlayer-users] [configure] solving the libpng hell

Ortwin Glück odi at odi.ch
Sun Aug 24 13:16:00 CEST 2003


Hi

After struggling with compiling mplayer I finally found a solution to 
the libpng dll hell.

Currently the configure script uses

#include <png.h>
#include <string.h>
int main(void) {
   printf("png.h : %s\n", PNG_LIBPNG_VER_STRING);
   printf("libpng: %s\n", png_libpng_ver);
   return (strcmp(PNG_LIBPNG_VER_STRING, png_libpng_ver));
}

compiled with
  gcc -lpng -lz -lm

This yields non-matching versions on my installation. Maybe this can be 
solved by copying the "right" png.h to the right location. But I suggest 
a different approach as it makes mplayer configuration more reliable.

However, as I have libpng 1.2 installed, it works when compiled with
  gcc -lpng12 -lz -lm

So I request that the configure script be changed to the following 
algorithm:

1. perform the check libpng check with -lpng
2. done if ok, set _ld_png='-lpng -lz'
3. if not ok, perform the libpng check with -lpng12
4. done if ok, set _ld_png='-lpng12 -lz'
5. if not ok, png is not available

So libpng-1.2 is used as an alternative.

Kind regards

Ortwin Glück, happily watching the Matrix Revolutions trailer with faad 
sound on Linux now ,-)

__________________________________
APPENDIX A: my installed libraries

oglueck at gimli:/usr/lib> ls -l libpng*
-rw-r--r--    1 root     root       240558 Apr 12  2002 libpng.a
lrwxrwxrwx    1 root     root           16 Okt 19  2002 libpng.so.1 -> 
libpng.so.1.0.89
-rwxr-xr-x    1 root     root       100517 Apr 12  2002 libpng.so.1.0.89
lrwxrwxrwx    1 root     root           18 Okt 19  2002 libpng.so.2 -> 
libpng.so.2.1.0.12
-rwxr-xr-x    1 root     root       216058 Apr 12  2002 libpng.so.2.1.0.12

oglueck at gimli:/usr/local/lib> ls -l libpng*
lrwxrwxrwx    1 root     root           10 Aug 24 11:51 libpng.a -> 
libpng12.a
lrwxrwxrwx    1 root     root           11 Aug 24 12:03 libpng.so -> 
libpng.so.3
lrwxrwxrwx    1 root     root           17 Aug 24 11:51 libpng.so.3 -> 
libpng.so.3.1.2.5
-rwxr-xr-x    1 root     root       205219 Aug 24 11:51 libpng.so.3.1.2.5
-rw-r--r--    1 root     root       230114 Aug 24 11:51 libpng12.a
lrwxrwxrwx    1 root     root           13 Aug 24 11:51 libpng12.so -> 
libpng12.so.0
lrwxrwxrwx    1 root     root           19 Aug 24 11:51 libpng12.so.0 -> 
libpng12.so.0.1.2.5
-rwxr-xr-x    1 root     root       205251 Aug 24 11:51 libpng12.so.0.1.2.5

oglueck at gimli:/usr/local/include/libpng> ls -l /usr/include/png*
-rw-r--r--    1 root     root       129026 Apr 12  2002 /usr/include/png.h
-rw-r--r--    1 root     root       129026 Aug 24 11:57 /usr/include/png12.h

oglueck at gimli:/usr/local/include> ls -ld *png*
lrwxrwxrwx    1 root     root            8 Aug 24 11:51 libpng -> libpng12
drwxr-xr-x    2 root     root          104 Jun  7 17:59 libpng12
lrwxrwxrwx    1 root     root           14 Aug 24 11:51 png.h -> 
libpng12/png.h
lrwxrwxrwx    1 root     root           18 Aug 24 11:51 pngconf.h -> 
libpng12/pngconf.h



More information about the MPlayer-users mailing list