[MPlayer-dev-eng] [PATCH] Add additional check for libmng with libjpeg support

Josh joshf87 at live.com
Sat Dec 22 06:25:05 CET 2012


This adds a check for libmng adding '-ljpeg', needed if it was compiled 
with jpeg support. Without it I couldn't link with libmng under MinGW. 
Unless there is a better way to do it. This is the result from 
config.log, which was successful after adding -ljpeg, and compiles/links 
successfully with libmng:

============ Checking for MNG support ============

#include <libmng.h>
int main(void) { const char * p_ver = mng_version_text(); return !p_ver 
|| p_ver[0] == 0; }

cc -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith 
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes 
-Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement 
-std=gnu99 -Werror-implicit-function-declaration -O4 -march=i486 
-mtune=generic -pipe -ffast-math -fomit-frame-pointer 
-fno-tree-vectorize /tmp/mplayer-configure-30665-1872/tmp.c -I. -Iffmpeg 
-I/mingw/src/live-11.30.2012 -fno-common  -I/mingw/include/ -static 
-lwinmm -ffast-math -lws2_32 -liconv -lpng -lz  -L/mingw/lib -lcaca -lz  
-o /tmp/mplayer-configure-30665-1872/tmp.exe -lmng -lz -lm
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_cleanup':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:344: undefined 
reference to `jpeg_destroy_compress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:337: undefined 
reference to `jpeg_destroy_decompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:339: undefined 
reference to `jpeg_destroy_decompress'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressinit':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:409: undefined 
reference to `jpeg_std_error'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:424: undefined 
reference to `jpeg_CreateDecompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:432: undefined 
reference to `jpeg_resync_to_restart'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressdata':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:594: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:675: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:682: undefined 
reference to `jpeg_finish_decompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:535: undefined 
reference to `jpeg_read_header'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:553: undefined 
reference to `jpeg_has_multiple_scans'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:585: undefined 
reference to `jpeg_start_decompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:670: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:631: undefined 
reference to `jpeg_read_scanlines'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:659: undefined 
reference to `jpeg_finish_output'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:617: undefined 
reference to `jpeg_start_output'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressfree':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:730: undefined 
reference to `jpeg_destroy_decompress'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressinit2':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:763: undefined 
reference to `jpeg_std_error'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:778: undefined 
reference to `jpeg_CreateDecompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:786: undefined 
reference to `jpeg_resync_to_restart'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressdata2':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:939: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:975: undefined 
reference to `jpeg_read_scanlines'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:963: undefined 
reference to `jpeg_start_output'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1008: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1012: undefined 
reference to `jpeg_input_complete'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1019: undefined 
reference to `jpeg_finish_decompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:889: undefined 
reference to `jpeg_read_header'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:900: undefined 
reference to `jpeg_has_multiple_scans'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:930: undefined 
reference to `jpeg_start_decompress'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1002: undefined 
reference to `jpeg_finish_output'
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1003: undefined 
reference to `jpeg_finish_output'
E:/Buildsys/MinGW/lib\libmng.a(libmng_jpeg.o): In function 
`mngjpeg_decompressfree2':
E:\Buildsys\MinGW\src\libmng-1.0.10/libmng_jpeg.c:1067: undefined 
reference to `jpeg_destroy_decompress'
collect2: ld returned 1 exit status



#include <libmng.h>
int main(void) { const char * p_ver = mng_version_text(); return !p_ver 
|| p_ver[0] == 0; }

cc -Wundef -Wall -Wno-switch -Wno-parentheses -Wpointer-arith 
-Wredundant-decls -Wstrict-prototypes -Wmissing-prototypes 
-Wdisabled-optimization -Wno-pointer-sign -Wdeclaration-after-statement 
-std=gnu99 -Werror-implicit-function-declaration -O4 -march=i486 
-mtune=generic -pipe -ffast-math -fomit-frame-pointer 
-fno-tree-vectorize /tmp/mplayer-configure-30665-1872/tmp.c -I. -Iffmpeg 
-I/mingw/src/live-11.30.2012 -fno-common  -I/mingw/include/ -static 
-lwinmm -ffast-math -lws2_32 -liconv -lpng -lz  -L/mingw/lib -lcaca -lz  
-o /tmp/mplayer-configure-30665-1872/tmp.exe -lmng -ljpeg -lz -lm


Result is: yes
##########################################


-------------- next part --------------
Index: configure
===================================================================
--- configure	(revision 35702)
+++ configure	(working copy)
@@ -5000,12 +5000,14 @@
 echocheck "MNG support"
 if test "$_mng" = auto ; then
   _mng=no
-  return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' -lmng -lz && _mng=yes
+  for mnglibs in '-lmng -lz' '-lmng -ljpeg -lz' ; do
+    return_statement_check libmng.h 'const char * p_ver = mng_version_text()' '!p_ver || p_ver[0] == 0' $mnglibs && _mng=yes
+  done
 fi
 echores "$_mng"
 if test "$_mng" = yes ; then
   def_mng='#define CONFIG_MNG 1'
-  extra_ldflags="$extra_ldflags -lmng -lz"
+  extra_ldflags="$extra_ldflags $mnglibs"
   vomodules="mng $vomodules"
 else
   def_mng='#undef CONFIG_MNG'


More information about the MPlayer-dev-eng mailing list