1. Intro
Compiling Xine-lib on Opensolaris is my assignment for getting closer to Solaris.
Library source version is 1.1.7(the latest). but It has some problems.
Let's address them with me. I'd like to welcome any comments and advices at any moment. :)
2. Compile Environment
This is my compile environment for compiling Xine-lib.
We should? use gnu-cc,gnu-as but solaris ld.
You can try sun cc if you want, but I don't think that could work.
bash-3.00# pwd
/var/tmp/xine-lib-1.1.7
bash-3.00# which gcc
/usr/sfw/bin/gcc
bash-3.00# which ld
/usr/ccs/bin/ld
bash-3.00# which as
/usr/ccs/bin/as
bash-3.00# ls -l /usr/ccs/bin/as
lrwxrwxrwx 1 root root 16 7월 24일 13:48 /usr/ccs/bin/as -> /usr/sfw/bin/gas
bash-3.00#
3. Start go to xine-lib-1.1.7 folder ans run configure, gmake
bash-3.00# configure
bash-3.00# gmake
(1). XINE_FORMAT_PRINTF error
gcc -DHAVE_CONFIG_H -I. -I. -I.. -I.. -I../include -I../include -I../src -I../src/xine-engine -I../src/xine-engine -I../src/xine-utils -I../src/input -I../src/input -I../lib -I../lib -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -mtune=i386 -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -fexpensive-optimizations -fschedule-insns2 -ffast-math -finline-functions -Wall -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -g -O2 -DNDEBUG -MT asprintf.lo -MD -MP -MF .deps/asprintf.Tpo -c asprintf.c -fPIC -DPIC -o .libs/asprintf.o
In file included from ../config.h:720,
from asprintf.c:22:
./os_internal.h:123: error: syntax error before "XINE_FORMAT_PRINTF"
./os_internal.h:123: warning: type defaults to `int' in declaration of `XINE_FORMAT_PRINTF'
./os_internal.h:123: warning: data definition has no type or storage class
./os_internal.h:124: error: syntax error before "XINE_FORMAT_PRINTF"
./os_internal.h:124: warning: type defaults to `int' in declaration of `XINE_FORMAT_PRINTF'
./os_internal.h:124: warning: data definition has no type or storage class
asprintf.c:29: warning: no previous prototype for 'xine_private_vasprintf'
asprintf.c: In function `xine_private_vasprintf':
asprintf.c:46: warning: function might be possible candidate for `printf' format attribute
asprintf.c: At top level:
asprintf.c:58: warning: no previous prototype for 'xine_private_asprintf'
As you know Solaris doesn't support vasprintf, asprintf due to security, so xine-lib developer took __attribute__ and then define XINE_FORMAT_PRINTF that. but this makes an compile error on solaris system.
I checked old version source code. they haven't used XINE_FORMAT_PRINTF macro until 1.1.4 version. but why they changed that??? anyway, I changed back XINE_FORMAT_PRINTF to old style using __attribute__. find this file ./lib/os_internal.h
122 #define vasprintf(STRINGPP, FORMAT, VA_ARG) xine_private_vasprintf((STRINGPP), (FORMAT), (VA_ARG))
123 int xine_private_asprintf(char **string, const char *format, ...) __attribute__ ((format (printf, 2, 3)));
124 int xine_private_vasprintf(char **string, const char *format, va_list ap) __attribute__ ((format (printf, 2, 0)));
125 #if 0
126 int xine_private_asprintf(char **string, const char *format, ...) XINE_FORMAT_PRINTF(2, 3);
127 int xine_private_vasprintf(char **string, const char *format, va_list ap) XINE_FORMAT_PRINTF(2, 0);
128 #endif
129 #endif
(2). missing header file alloca.h
There are two files that are missing header file.gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I../../lib -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -mtune=i386 -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -fexpensive-optimizations -fschedule-insns2 -ffast-math -finline-functions -Wall -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -g -O2 -DNDEBUG -MT xineplug_dmx_audio_la-demux_ac3.lo -MD -MP -MF .deps/xineplug_dmx_audio_la-demux_ac3.Tpo -c demux_ac3.c -fPIC -DPIC -o .libs/xineplug_dmx_audio_la-demux_ac3.ojust include alloca.h :)
demux_ac3.c: In function `open_ac3_file':
demux_ac3.c:148: error: implicit declaration of function `alloca'
demux_ac3.c:148: warning: nested extern declaration of `alloca'
demux_ac3.c:153: warning: nested extern declaration of `alloca'
gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../.. -I../../include -I../../include -I../../src -I../../src/xine-engine -I../../src/xine-engine -I../../src/xine-utils -I../../src/input -I../../src/input -I../../lib -I../../lib -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -mtune=i386 -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -fexpensive-optimizations -fschedule-insns2 -ffast-math -finline-functions -Wall -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -g -O2 -DNDEBUG -MT xineplug_dmx_audio_la-demux_dts.lo -MD -MP -MF .deps/xineplug_dmx_audio_la-demux_dts.Tpo -c demux_dts.c -fPIC -DPIC -o .libs/xineplug_dmx_audio_la-demux_dts.oone more time, please.
demux_dts.c: In function `open_dts_file':
demux_dts.c:98: error: implicit declaration of function `alloca'
demux_dts.c:98: warning: nested extern declaration of `alloca'
demux_dts.c:103: warning: nested extern declaration of `alloca'
(3). wrong path headerfile ffmpeg_config.h
gcc -DHAVE_CONFIG_H -I. -I. -I../../../.. -I../../../.. -I../../../../include -I../../../../include -I../../../../src -I../../../../src/xine-engine -I../../../../src/xine-engine -I../../../../src/xine-utils -I../../../../src/input -I../../../../src/input -I../../../../lib -I../../../../lib -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DXINE_MPEG_ENCODER -D_ISOC9X_SOURCE -DCONFIG_DECODERS -I../../../../src/libffmpeg/libavutil -fno-strict-aliasing -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -mtune=i386 -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -fexpensive-optimizations -fschedule-insns2 -ffast-math -finline-functions -Wall -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -g -O2 -DNDEBUG -MT dsputil_mlib.lo -MD -MP -MF .deps/dsputil_mlib.Tpo -c dsputil_mlib.c -fPIC -DPIC -o .libs/dsputil_mlib.oopen the file "./src/libffmpeg/libavutil/common.h" and edit include path
In file included from ../dsputil.h:33,
from dsputil_mlib.c:22:
../../../../src/libffmpeg/libavutil/common.h:361:27: ffmpeg_config.h: 해당 파일이나 디렉토리가 없음
In file included from ../../../../src/xine-engine/configfile.h:36,
from ../../../xine-utils/xineutils.h:45,
from dsputil_mlib.c:25:
/* xine: another config.h with codecs to use */
#include "./src/libffmpeg/ffmpeg_config.h"
(4). dsputil_init_mlib
gcc -DHAVE_CONFIG_H -I. -I. -I../../.. -I../../.. -I../../../include -I../../../include -I../../../src -I../../../src/xine-engine -I../../../src/xine-engine -I../../../src/xine-utils -I../../../src/input -I../../../src/input -I../../../lib -I../../../lib -DHAVE_AV_CONFIG_H -DRUNTIME_CPUDETECT -DXINE_MPEG_ENCODER -D_ISOC9X_SOURCE -DCONFIG_DECODERS -I../../../src/libffmpeg/libavutil -I../../../src/libffmpeg -I../../../src/libffmpeg -fno-strict-aliasing -D_REENTRANT -D_FILE_OFFSET_BITS=64 -DXINE_COMPILE -Wformat=2 -Wno-format-zero-length -Wmissing-format-attribute -Werror-implicit-function-declaration -Wstrict-aliasing=2 -mtune=i386 -O3 -pipe -fomit-frame-pointer -falign-functions=4 -falign-loops=4 -falign-jumps=4 -fexpensive-optimizations -fschedule-insns2 -ffast-math -finline-functions -Wall -Wpointer-arith -Wnested-externs -Wcast-align -Wchar-subscripts -Wmissing-declarations -Wmissing-prototypes -g -O2 -DNDEBUG -MT dsputil.lo -MD -MP -MF .deps/dsputil.Tpo -c dsputil.c -fPIC -DPIC -o .libs/dsputil.o
In file included from dsputil.c:35:
snow.h: In function `w53_32_c':
snow.h:134: warning: no return statement in function returning non-void
snow.h: In function `w97_32_c':
snow.h:135: warning: no return statement in function returning non-void
dsputil.c: At top level:
dsputil.c:2547: warning: no previous prototype for 'ff_put_vc1_mspel_mc00_c'
dsputil.c: In function `dsputil_init':
dsputil.c:4131: error: implicit declaration of function `dsputil_init_mlib'
dsputil.c:4131: warning: nested extern declaration of `dsputil_init_mlib'
no declaration the function of dsputil_init_mlib find that function declaration and move to compilable define section :(
edit this file "./src/libffmpeg/libavcodec/dsputil.h"
(5). gcc: unrecognized option `-pthread'
-lpthread is right for Solaris :). just edit Makefile or configure file.
ok done :)
finally just gmake install and export LD_LIBRARY_PATH=/usr/local/lib for xine-ui~
Thank you very much :)


