
Recherche avancée
Autres articles (63)
-
Des sites réalisés avec MediaSPIP
2 mai 2011, parCette page présente quelques-uns des sites fonctionnant sous MediaSPIP.
Vous pouvez bien entendu ajouter le votre grâce au formulaire en bas de page. -
Support audio et vidéo HTML5
10 avril 2011MediaSPIP utilise les balises HTML5 video et audio pour la lecture de documents multimedia en profitant des dernières innovations du W3C supportées par les navigateurs modernes.
Pour les navigateurs plus anciens, le lecteur flash Flowplayer est utilisé.
Le lecteur HTML5 utilisé a été spécifiquement créé pour MediaSPIP : il est complètement modifiable graphiquement pour correspondre à un thème choisi.
Ces technologies permettent de distribuer vidéo et son à la fois sur des ordinateurs conventionnels (...) -
HTML5 audio and video support
13 avril 2011, parMediaSPIP uses HTML5 video and audio tags to play multimedia files, taking advantage of the latest W3C innovations supported by modern browsers.
The MediaSPIP player used has been created specifically for MediaSPIP and can be easily adapted to fit in with a specific theme.
For older browsers the Flowplayer flash fallback is used.
MediaSPIP allows for media playback on major mobile platforms with the above (...)
Sur d’autres sites (8904)
-
I can't compile ffmpeg, don't know how to install sdl2 properly
11 mai 2019, par woopwoop399I’m compiling ffmpeg, on windows, with mingw-w64, and I need SDL2 so that the ffplay in ffmpeg compiles. I installed mingw-w64 using the web installer, I installed msys (to run the
./configure
that comes with ffmpeg) using the all in one package provided by mingw-w64. I installed SDL2 by downloading dev binaries from their site and runningmake native
in msys.So, it seems SDL2 isn’t installed properly or something.
Here is the problematic part in
./configure
:if enabled sdl2; then
echo "SDL2-1"
SDL2_CONFIG="${cross_prefix}sdl2-config"
test_pkg_config sdl2 "sdl2 >= 2.0.1 sdl2 < 2.1.0" SDL_events.h SDL_PollEvent
echo "SDL2-2"
if disabled sdl2 && "${SDL2_CONFIG}" --version > /dev/null 2>&1; then
echo "SDL2-3"
sdl2_cflags=$("${SDL2_CONFIG}" --cflags)
sdl2_extralibs=$("${SDL2_CONFIG}" --libs)
echo "SDL2-config ${SDL2_CONFIG}"
echo "SDL2-cflags ${sdl2_cflags}"
echo "SDL2-libs ${sdl2_extralibs}"
test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) >= 0x020001" $sdl2_cflags &&
echo "SDL2-4" &&
test_cpp_condition SDL.h "(SDL_MAJOR_VERSION<<16 | SDL_MINOR_VERSION<<8 | SDL_PATCHLEVEL) < 0x020100" $sdl2_cflags &&
echo "SDL2-5" &&
check_func_headers SDL_events.h SDL_PollEvent $sdl2_extralibs $sdl2_cflags &&
echo "SDL2-6-final" &&
enable sdl2
fi
if test $target_os = "mingw32"; then
sdl2_extralibs=$(filter_out '-mwindows' $sdl2_extralibs)
fi
fiThis is the result of it, it never gets to
SDL2-6-final
andenable sdl2
SDL2-1
SDL2-2
SDL2-3
SDL2-config sdl2-config
SDL2-cflags -I/usr/include/SDL2 -Dmain=SDL_main
SDL2-libs -L/usr/lib -lmingw32 -lSDL2main -lSDL2 -mwindows
SDL2-4
SDL2-5This is the sdl2 installation log :
User@NEW-PC /c/Users/User/Downloads/games/compilers/SDL2-2.0.9
$ make native
make install-package arch=i686-w64-mingw32 prefix=/usr
make[1]: Entering directory `/c/Users/User/Downloads/games/compilers/SDL2-2.0.9'
`bin/sdl2-config' -> `/usr/bin/sdl2-config'
`bin/SDL2.dll' -> `/usr/bin/SDL2.dll'
`include' -> `/usr/include'
`include/SDL2' -> `/usr/include/SDL2'
`include/SDL2/begin_code.h' -> `/usr/include/SDL2/begin_code.h'
`include/SDL2/close_code.h' -> `/usr/include/SDL2/close_code.h'
`include/SDL2/SDL.h' -> `/usr/include/SDL2/SDL.h'
`include/SDL2/SDL_assert.h' -> `/usr/include/SDL2/SDL_assert.h'
`include/SDL2/SDL_atomic.h' -> `/usr/include/SDL2/SDL_atomic.h'
`include/SDL2/SDL_audio.h' -> `/usr/include/SDL2/SDL_audio.h'
`include/SDL2/SDL_bits.h' -> `/usr/include/SDL2/SDL_bits.h'
`include/SDL2/SDL_blendmode.h' -> `/usr/include/SDL2/SDL_blendmode.h'
`include/SDL2/SDL_clipboard.h' -> `/usr/include/SDL2/SDL_clipboard.h'
`include/SDL2/SDL_config.h' -> `/usr/include/SDL2/SDL_config.h'
`include/SDL2/SDL_cpuinfo.h' -> `/usr/include/SDL2/SDL_cpuinfo.h'
`include/SDL2/SDL_egl.h' -> `/usr/include/SDL2/SDL_egl.h'
`include/SDL2/SDL_endian.h' -> `/usr/include/SDL2/SDL_endian.h'
`include/SDL2/SDL_error.h' -> `/usr/include/SDL2/SDL_error.h'
`include/SDL2/SDL_events.h' -> `/usr/include/SDL2/SDL_events.h'
`include/SDL2/SDL_filesystem.h' -> `/usr/include/SDL2/SDL_filesystem.h'
`include/SDL2/SDL_gamecontroller.h' -> `/usr/include/SDL2/SDL_gamecontroller.h'
`include/SDL2/SDL_gesture.h' -> `/usr/include/SDL2/SDL_gesture.h'
`include/SDL2/SDL_haptic.h' -> `/usr/include/SDL2/SDL_haptic.h'
`include/SDL2/SDL_hints.h' -> `/usr/include/SDL2/SDL_hints.h'
`include/SDL2/SDL_joystick.h' -> `/usr/include/SDL2/SDL_joystick.h'
`include/SDL2/SDL_keyboard.h' -> `/usr/include/SDL2/SDL_keyboard.h'
`include/SDL2/SDL_keycode.h' -> `/usr/include/SDL2/SDL_keycode.h'
`include/SDL2/SDL_loadso.h' -> `/usr/include/SDL2/SDL_loadso.h'
`include/SDL2/SDL_log.h' -> `/usr/include/SDL2/SDL_log.h'
`include/SDL2/SDL_main.h' -> `/usr/include/SDL2/SDL_main.h'
`include/SDL2/SDL_messagebox.h' -> `/usr/include/SDL2/SDL_messagebox.h'
`include/SDL2/SDL_mouse.h' -> `/usr/include/SDL2/SDL_mouse.h'
`include/SDL2/SDL_mutex.h' -> `/usr/include/SDL2/SDL_mutex.h'
`include/SDL2/SDL_name.h' -> `/usr/include/SDL2/SDL_name.h'
`include/SDL2/SDL_opengl.h' -> `/usr/include/SDL2/SDL_opengl.h'
`include/SDL2/SDL_opengles.h' -> `/usr/include/SDL2/SDL_opengles.h'
`include/SDL2/SDL_opengles2.h' -> `/usr/include/SDL2/SDL_opengles2.h'
`include/SDL2/SDL_opengles2_gl2.h' -> `/usr/include/SDL2/SDL_opengles2_gl2.h'
`include/SDL2/SDL_opengles2_gl2ext.h' -> `/usr/include/SDL2/SDL_opengles2_gl2ext.h'
`include/SDL2/SDL_opengles2_gl2platform.h' -> `/usr/include/SDL2/SDL_opengles2_gl2platform.h'
`include/SDL2/SDL_opengles2_khrplatform.h' -> `/usr/include/SDL2/SDL_opengles2_khrplatform.h'
`include/SDL2/SDL_opengl_glext.h' -> `/usr/include/SDL2/SDL_opengl_glext.h'
`include/SDL2/SDL_pixels.h' -> `/usr/include/SDL2/SDL_pixels.h'
`include/SDL2/SDL_platform.h' -> `/usr/include/SDL2/SDL_platform.h'
`include/SDL2/SDL_power.h' -> `/usr/include/SDL2/SDL_power.h'
`include/SDL2/SDL_quit.h' -> `/usr/include/SDL2/SDL_quit.h'
`include/SDL2/SDL_rect.h' -> `/usr/include/SDL2/SDL_rect.h'
`include/SDL2/SDL_render.h' -> `/usr/include/SDL2/SDL_render.h'
`include/SDL2/SDL_revision.h' -> `/usr/include/SDL2/SDL_revision.h'
`include/SDL2/SDL_rwops.h' -> `/usr/include/SDL2/SDL_rwops.h'
`include/SDL2/SDL_scancode.h' -> `/usr/include/SDL2/SDL_scancode.h'
`include/SDL2/SDL_sensor.h' -> `/usr/include/SDL2/SDL_sensor.h'
`include/SDL2/SDL_shape.h' -> `/usr/include/SDL2/SDL_shape.h'
`include/SDL2/SDL_stdinc.h' -> `/usr/include/SDL2/SDL_stdinc.h'
`include/SDL2/SDL_surface.h' -> `/usr/include/SDL2/SDL_surface.h'
`include/SDL2/SDL_system.h' -> `/usr/include/SDL2/SDL_system.h'
`include/SDL2/SDL_syswm.h' -> `/usr/include/SDL2/SDL_syswm.h'
`include/SDL2/SDL_test.h' -> `/usr/include/SDL2/SDL_test.h'
`include/SDL2/SDL_test_assert.h' -> `/usr/include/SDL2/SDL_test_assert.h'
`include/SDL2/SDL_test_common.h' -> `/usr/include/SDL2/SDL_test_common.h'
`include/SDL2/SDL_test_compare.h' -> `/usr/include/SDL2/SDL_test_compare.h'
`include/SDL2/SDL_test_crc32.h' -> `/usr/include/SDL2/SDL_test_crc32.h'
`include/SDL2/SDL_test_font.h' -> `/usr/include/SDL2/SDL_test_font.h'
`include/SDL2/SDL_test_fuzzer.h' -> `/usr/include/SDL2/SDL_test_fuzzer.h'
`include/SDL2/SDL_test_harness.h' -> `/usr/include/SDL2/SDL_test_harness.h'
`include/SDL2/SDL_test_images.h' -> `/usr/include/SDL2/SDL_test_images.h'
`include/SDL2/SDL_test_log.h' -> `/usr/include/SDL2/SDL_test_log.h'
`include/SDL2/SDL_test_md5.h' -> `/usr/include/SDL2/SDL_test_md5.h'
`include/SDL2/SDL_test_memory.h' -> `/usr/include/SDL2/SDL_test_memory.h'
`include/SDL2/SDL_test_random.h' -> `/usr/include/SDL2/SDL_test_random.h'
`include/SDL2/SDL_thread.h' -> `/usr/include/SDL2/SDL_thread.h'
`include/SDL2/SDL_timer.h' -> `/usr/include/SDL2/SDL_timer.h'
`include/SDL2/SDL_touch.h' -> `/usr/include/SDL2/SDL_touch.h'
`include/SDL2/SDL_types.h' -> `/usr/include/SDL2/SDL_types.h'
`include/SDL2/SDL_version.h' -> `/usr/include/SDL2/SDL_version.h'
`include/SDL2/SDL_video.h' -> `/usr/include/SDL2/SDL_video.h'
`include/SDL2/SDL_vulkan.h' -> `/usr/include/SDL2/SDL_vulkan.h'
`lib/cmake' -> `/usr/lib/cmake'
`lib/cmake/SDL2' -> `/usr/lib/cmake/SDL2'
`lib/cmake/SDL2/sdl2-config.cmake' -> `/usr/lib/cmake/SDL2/sdl2-config.cmake'
`lib/libSDL2.a' -> `/usr/lib/libSDL2.a'
`lib/libSDL2.dll.a' -> `/usr/lib/libSDL2.dll.a'
`lib/libSDL2.la' -> `/usr/lib/libSDL2.la'
`lib/libSDL2main.a' -> `/usr/lib/libSDL2main.a'
`lib/libSDL2main.la' -> `/usr/lib/libSDL2main.la'
`lib/libSDL2_test.a' -> `/usr/lib/libSDL2_test.a'
`lib/libSDL2_test.la' -> `/usr/lib/libSDL2_test.la'
`lib/pkgconfig' -> `/usr/lib/pkgconfig'
`lib/pkgconfig/sdl2.pc' -> `/usr/lib/pkgconfig/sdl2.pc'
`share/aclocal/sdl2.m4' -> `/usr/share/aclocal/sdl2.m4'
make[1]: Leaving directory `/c/Users/User/Downloads/games/compilers/SDL2-2.0.9'And this is what happens when I just comment out that last check in
./configure
and enable sdl2 anyway :c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2main.a when searching for -lSDL2main
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2.dll.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2
I tried using msys2 instead, it compiles, but the debugger there doesn’t work for some reason. I need to run the source code of ffmpeg in debugger to have a chance of understanding anything there. I need to use the combination of codeblocks and gdb, and programs compiled with msys2 use weird pathnames like /c/bla/bla/bla/main.c, and codeblocks is righteously weirded out by that. The mingw-w64 uses more sane pathnames, I just checked that.
Checked
ffbuild/config.log
, the problem is here :`c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2`
More in full :
test_pkg_config sdl2 sdl2 >= 2.0.1 sdl2 < 2.1.0 SDL_events.h SDL_PollEvent
pkg-config --exists --print-errors sdl2 >= 2.0.1 sdl2 < 2.1.0
check_func_headers SDL_events.h SDL_PollEvent -Dmain=SDL_main -IC:/msys/include/SDL2 -mwindows -LC:/msys/lib -lmingw32 -lSDL2main -lSDL2
test_ld cc -Dmain=SDL_main -IC:/msys/include/SDL2 -mwindows -LC:/msys/lib -lmingw32 -lSDL2main -lSDL2
test_cc -Dmain=SDL_main -IC:/msys/include/SDL2 -mwindows -LC:/msys/lib
BEGIN /tmp/ffconf.atBoPojc/test.c
1 #include
2 #include
3 long check_SDL_PollEvent(void) { return (long) SDL_PollEvent; }
4 int main(void) { int ret = 0;
5 ret |= ((intptr_t)check_SDL_PollEvent) & 0xFFFF;
6 return ret; }
END /tmp/ffconf.atBoPojc/test.c
gcc -D_ISOC99_SOURCE -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -U__STRICT_ANSI__ -D__USE_MINGW_ANSI_STDIO=1 -D__printf__=__gnu_printf__ -D_WIN32_WINNT=0x0600 -D_POSIX_C_SOURCE=200112 -D_XOPEN_SOURCE=600 -DPIC -std=c11 -Dmain=SDL_main -IC:/msys/include/SDL2 -mwindows -LC:/msys/lib -c -o /tmp/ffconf.atBoPojc/test.o /tmp/ffconf.atBoPojc/test.c
C:/Users/User/AppData/Local/Temp/ffconf.atBoPojc/test.c: In function 'check_SDL_PollEvent':
C:/Users/User/AppData/Local/Temp/ffconf.atBoPojc/test.c:3:41: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
long check_SDL_PollEvent(void) { return (long) SDL_PollEvent; }
^
gcc -Wl,--nxcompat,--dynamicbase -Wl,--high-entropy-va -Wl,--as-needed -Wl,--image-base,0x140000000 -Dmain=SDL_main -IC:/msys/include/SDL2 -mwindows -LC:/msys/lib -o /tmp/ffconf.atBoPojc/test.exe /tmp/ffconf.atBoPojc/test.o -lmingw32 -lSDL2main -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2main.a when searching for -lSDL2main
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib\libSDL2main.a when searching for -lSDL2main
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2main.a when searching for -lSDL2main
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2main
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2.dll.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib\libSDL2.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2.dll.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: skipping incompatible C:/msys/lib/libSDL2.a when searching for -lSDL2
c:/Program Files/mingw-w64/x86_64-8.1.0-win32-seh-rt_v6-rev0/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/8.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lSDL2
collect2.exe: error: ld returned 1 exit statusOkay, I managed to compile. I removed the sdl libraries from
C:/msys/lib
, and added them toC:\Program Files\mingw-w64\x86_64-8.1.0-win32-seh-rt_v6-rev0\mingw64\lib
-
Failed to compile x264 library for android, error description : clang:error no such file or directory
12 janvier 2019, par Lee.SaipengI use a shell script to compile the x264 library to the android platform, the architecture is armeabi-v7a,The x264 library was cloned from github。
I am sure I have those directories,and I checked the search engine such as google,No one encountered the same situation
ANDROID_NDK=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b
SYSROOT=$ANDROID_NDK/platforms/android-16/arch-arm
CROSS_PREFIX=$ANDROID_NDK/toolchains/arm-linux-androideabi-
4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-
EXTRA_CFLAGS="-march=armv7-a -mfloat-abi=softfp -mfpu=neon -
D__ANDROID__ -D__ARM_ARCH_7__ -D__ARM_ARCH_7A__"
EXTRA_LDFLAGS="-nostdlib"
PREFIX=`pwd`/libs/armeabi-v7a
./configure --prefix=$PREFIX \
--host=arm-linux \
--sysroot=$SYSROOT \
--cross-prefix=$CROSS_PREFIX \
--extra-cflags="$EXTRA_CFLAGS" \
--extra-ldflags="$EXTRA_LDFLAGS" \
--enable-pic \
--enable-static \
--enable-strip \
--disable-cli \
--disable-asm
# --disable-win32thread \
# --disable-avs \
# --disable-swscale \
# --disable-lavf \
# --disable-ffms \
# --disable-gpac \
# --disable-lsmash \
# --disable-opencl
make clean
make STRIP= -j8 install || exit 1
cp -f $PREFIX/libx264.a $PREFIXThe error is here
enter image description here
The result is that this x264 library cannot be used. Can someone help me ? thanks very muchOk, I generated the config.log file during the compilation of x264, I hope it is an error log file, the log content is as follows :
checking for -Werror=unknown-warning-option... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -Werror=unknown-warning-option --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -o conftest
cc1: error: -Werror=unknown-warning-option: no option -Wunknown-warning-option
--------------------------------------------------
Failed program was:
--------------------------------------------------
int main (void) { return 0; }
--------------------------------------------------
x264 configure script
Command line options: "--prefix=/Users/Project/bishe/x264/libs/armeabi-v7a" "--host=arm-linux" "--sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm" "--cross-prefix=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-" "--extra-cflags=-march=armv5te" "-msoft-float" "-D__ANDROID__" "-D__ARM_ARCH_5TE__" "-D__ARM_ARCH_5TEJ__" "--extra-ldflags=-nostdlib" "--enable-pic" "--enable-static" "--enable-strip" "--disable-cli" "--disable-asm" "--disable-win32thread" "--disable-avs" "--disable-swscale" "--disable-lavf" "--disable-ffms" "--disable-gpac" "--disable-lsmash" "--disable-opencl"
checking whether /Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc works... yes
checking whether /Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc supports for( int i = 0; i < 9; i++ ); with -std=gnu99... yes
checking for pthread_create(0,0,0,0); in pthread.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -lpthread --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:21: fatal error: pthread.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { pthread_create(0,0,0,0); return 0; }
--------------------------------------------------
checking for pthread_create(0,0,0,0); in pthread.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:21: fatal error: pthread.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { pthread_create(0,0,0,0); return 0; }
--------------------------------------------------
checking for log2f(2); in math.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:18: fatal error: math.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { log2f(2); return 0; }
--------------------------------------------------
checking for strtok_r(0, 0, 0); in string.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:20: fatal error: string.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { strtok_r(0, 0, 0); return 0; }
--------------------------------------------------
checking for clock_gettime(CLOCK_MONOTONIC, 0); in time.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:18: fatal error: time.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { clock_gettime(CLOCK_MONOTONIC, 0); return 0; }
--------------------------------------------------
checking for clock_gettime(CLOCK_MONOTONIC, 0); in time.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -lrt --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:18: fatal error: time.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { clock_gettime(CLOCK_MONOTONIC, 0); return 0; }
--------------------------------------------------
checking whether defined(MAP_PRIVATE) is true... no
--------------------------------------------------
conftest.c:1:22: fatal error: sys/mman.h: No such file or directory
#include <sys></sys>mman.h>
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include <sys></sys>mman.h>
#include
#if !(defined(MAP_PRIVATE))
#error
#endif
--------------------------------------------------
checking for uint32_t test_vec __attribute__ ((vector_size (16))) = {0,1,2,3}; in stdint.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
In file included from conftest.c:1:0:
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/include/stdint.h:9:26: fatal error: stdint.h: No such file or directory
# include_next
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { uint32_t test_vec __attribute__ ((vector_size (16))) = {0,1,2,3}; return 0; }
--------------------------------------------------
checking for stdio.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -fPIC -shared -Wl,-Bsymbolic --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -o conftest
conftest.c:1:19: fatal error: stdio.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { return 0; }
--------------------------------------------------
checking for -fno-tree-vectorize... yes
checking for fseeko(stdin,0,0); in stdio.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -O3 -ffast-math -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -s -o conftest
conftest.c:1:19: fatal error: stdio.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { fseeko(stdin,0,0); return 0; }
--------------------------------------------------
checking for fseeko64(stdin,0,0); in stdio.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -O3 -ffast-math -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -s -o conftest
conftest.c:1:19: fatal error: stdio.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { fseeko64(stdin,0,0); return 0; }
--------------------------------------------------
checking for _fseeki64(stdin,0,0); in stdio.h... no
Failed commandline was:
--------------------------------------------------
/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/toolchains/arm-linux-androideabi-4.9/prebuilt/darwin-x86_64/bin/arm-linux-androideabi-gcc conftest.c -O3 -ffast-math -Wall -I. -I$(SRCPATH) --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -march=armv5te -msoft-float -D__ANDROID__ -D__ARM_ARCH_5TE__ -D__ARM_ARCH_5TEJ__ -std=gnu99 -D_GNU_SOURCE -fPIC -fomit-frame-pointer -fno-tree-vectorize --sysroot=/Users/Project/devtools/android-sdk-macosx/android-ndk-r16b/platforms/android-16/arch-arm -nostdlib -lm -s -o conftest
conftest.c:1:19: fatal error: stdio.h: No such file or directory
#include
^
compilation terminated.
--------------------------------------------------
Failed program was:
--------------------------------------------------
#include
int main (void) { _fseeki64(stdin,0,0); return 0; }
--------------------------------------------------
checking for -Wshadow... yes
checking for -Wmaybe-uninitialized... yes
platform: ARM
byte order: little-endian
system: LINUX
cli: no
libx264: internal
shared: no
static: yes
asm: no
interlaced: yes
avs: no
lavf: no
ffms: no
mp4: no
gpl: yes
thread: no
opencl: no
filters: crop select_every
lto: no
debug: no
gprof: no
strip: yes
PIC: yes
bit depth: all
chroma format: all -
Parsing The Clue Chronicles
30 décembre 2018, par Multimedia Mike — Game HackingA long time ago, I procured a 1999 game called Clue Chronicles : Fatal Illusion, based on the classic board game Clue, a.k.a. Cluedo. At the time, I was big into collecting old, unloved PC games so that I could research obscure multimedia formats.
Surveying the 3 CD-ROMs contained in the box packaging revealed only Smacker (SMK) videos for full motion video which was nothing new to me or the multimedia hacking community at the time. Studying the mix of data formats present on the discs, I found a selection of straightforward formats such as WAV for audio and BMP for still images. I generally find myself more fascinated by how computer games are constructed rather than by playing them, and this mix of files has always triggered a strong “I could implement a new engine for this !” feeling in me, perhaps as part of the ScummVM project which already provides the core infrastructure for reimplementing engines for 2D adventure games.
Tying all of the assets together is a custom high-level programming language. I have touched on this before in a blog post over a decade ago. The scripts are in a series of files bearing the extension .ini (usually reserved for configuration scripts, but we’ll let that slide). A representative sample of such a script can be found here :
What Is This Language ?
At the time I first analyzed this language, I was still primarily a C/C++-minded programmer, with a decent amount of Perl experience as a high level language, and had just started to explore Python. I assessed this language to be “mildly object oriented with C++-type comments (‘//’) and reliant upon a number of implicit library functions”. Other people saw other properties. When I look at it nowadays, it reminds me a bit more of JavaScript than C++. I think it’s sort of a Rorschach test for programming languages.Strangely, I sort of had this fear that I would put a lot of effort into figuring out how to parse out the language only for someone to come along and point out that it’s a well-known yet academic language that already has a great deal of supporting code and libraries available as open source. Google for “spanish dolphins far side comic” for an illustration of the feeling this would leave me with.
It doesn’t matter in the end. Even if such libraries exist, how easy would they be to integrate into something like ScummVM ? Time to focus on a workable approach to understanding and processing the format.
Problem Scope
So I set about to see if I can write a program to parse the language seen in these INI files. Some questions :- How large is the corpus of data that I need to be sure to support ?
- What parsing approach should I take ?
- What is the exact language format ?
- Other hidden challenges ?
To figure out how large the data corpus is, I counted all of the INI files on all of the discs. There are 138 unique INI files between the 3 discs. However, there are 146 unique INI files after installation. This leads to a hidden challenge described a bit later.
What parsing approach should I take ? I worried a bit too much that I might not be doing this the “right” way. I’m trying to ignore doubts like this, like how “SQL Shame” blocked me on a task for a little while a few years ago as I concerned myself that I might not be using the purest, most elegant approach to the problem. I know I covered language parsing a lot time ago in university computer science education and there is a lot of academic literature to the matter. But sometimes, you just have to charge in and experiment and prototype and see what falls out. In doing so, I expect to have a better understanding of the problems that need to solved and the right questions to ask, not unlike that time that I wrote a continuous integration system from scratch because I didn’t actually know that “continuous integration” was the keyword I needed.
Next, what is the exact language format ? I realized that parsing the language isn’t the first and foremost problem here– I need to know exactly what the language is. I need to know what the grammar are keywords are. In essence, I need to reverse engineer the language before I write a proper parser for it. I guess that fits in nicely with the historical aim of this blog (reverse engineering).
Now, about the hidden challenges– I mentioned that there are 8 more INI files after the game installs itself. Okay, so what’s the big deal ? For some reason, all of the INI files are in plaintext on the CD-ROM but get compressed (apparently, according to file size ratios) when installed to the hard drive. This includes those 8 extra INI files. I thought to look inside the CAB installation archive file on the CD-ROM and the files were there… but all in compressed form. I suspect that one of the files forms the “root” of the program and is the launching point for the game.
Parsing Approach
I took a stab at parsing an INI file. My approach was to first perform lexical analysis on the file and create a list of 4 types : symbols, numbers, strings, and language elements ([]{}()=., :). Apparently, this is the kind of thing that Lex/Flex are good at. This prototyping tool is written in Python, but when I port this to ScummVM, it might be useful to call upon the services of Lex/Flex, or another lexical analyzer, for there are many. I have a feeling it will be easier to use better tools when I understand the full structure of the language based on the data available.
The purpose of this tool is to explore all the possibilities of the existing corpus of INI files. To that end, I ran all 138 of the plaintext files through it, collected all of the symbols, and massaged the results, assuming that the symbols that occurred most frequently are probably core language features. These are all the symbols which occur more than 1000 times among all the scripts :6248 false 5734 looping 4390 scripts 3877 layer 3423 sequentialscript 3408 setactive 3360 file 3257 thescreen 3239 true 3008 autoplay 2914 offset 2599 transparent 2441 text 2361 caption 2276 add 2205 ge 2197 smackanimation 2196 graphicscript 2196 graphic 1977 setstate 1642 state 1611 skippable 1576 desc 1413 delayscript 1298 script 1267 seconds 1019 rect
About That Compression
I have sorted out at least these few details of the compression :bytes 0-3 "COMP" (a pretty strong sign that this is, in fact, compressed data) bytes 4-11 unknown bytes 12-15 size of uncompressed data bytes 16-19 size of compressed data (filesize - 20) bytes 20- compressed payload
The compression ratios are on the same order of gzip. I was hoping that it was stock zlib data. However, I have been unable to prove this. I wrote a Python script that scrubbed through the first 100 bytes of payload data and tried to get Python’s zlib.decompress to initialize– no luck. It’s frustrating to know that I’ll have to reverse engineer a compression algorithm that deals with just 8 total text files if I want to see this effort through to fruition.
Update, January 15, 2019
Some folks expressed interest in trying to sort out the details of the compression format. So I have posted a followup in which I post some samples and go into deeper details about things I have tried :Reverse Engineering Clue Chronicles Compression
The post Parsing The Clue Chronicles first appeared on Breaking Eggs And Making Omelettes.