From 7e5961a3fc16e3769569557ea8ce1ec054764fde Mon Sep 17 00:00:00 2001 From: kyak Date: Sat, 25 Sep 2010 01:57:07 +0400 Subject: [PATCH] stupid workaround to make links compile --- links/Makefile | 8 +- links/files/directfb-config | 315 ++++++++++++++++++++++++++++++++++++ 2 files changed, 322 insertions(+), 1 deletion(-) create mode 100755 links/files/directfb-config diff --git a/links/Makefile b/links/Makefile index 3028528..f6c3052 100644 --- a/links/Makefile +++ b/links/Makefile @@ -33,6 +33,11 @@ define Package/links/description Text and graphics WWW browser endef +define Build/Prepare + $(call Build/Prepare/Default) + $(CP) $(FILES_DIR)/directfb-config $(PKG_BUILD_DIR) +endef + CONFIGURE_ARGS += --enable-graphics \ --enable-debuglevel=0 \ --without-gpm \ @@ -45,7 +50,8 @@ CONFIGURE_ARGS += --enable-graphics \ TARGET_CFLAGS += -I$(STAGING_DIR)/usr/include/directfb CONFIGURE_VARS += \ - DIRECTFB_CONFIG="$(STAGING_DIR)/root-xburst/usr/bin/directfb-config" + DIRECTFB_CONFIG="$(PKG_BUILD_DIR)/directfb-config $(STAGING_DIR)" +#DIRECTFB_CONFIG="$(STAGING_DIR)/root-xburst/usr/bin/directfb-config" define Package/links/install $(INSTALL_DIR) $(1)/usr/bin diff --git a/links/files/directfb-config b/links/files/directfb-config new file mode 100755 index 0000000..6b4417b --- /dev/null +++ b/links/files/directfb-config @@ -0,0 +1,315 @@ +#!/bin/sh + +prefix=$1/usr +exec_prefix=$1/usr +exec_prefix_set=no +moduledir=${exec_prefix}/lib/directfb-1.4-0 + +usage() +{ + cat <[,]...] (default: none) + [--graphics=[,]...] (default: none) + [--system=[,]...] (default: 'fbdev') + [--wm=[,]...] (default: 'default') + [--font=[,]...] (default: none) + [--imageprovider=[,]...] (default: none) + [--videoprovider=[,]...] (default: none) + [--fusionsound] + [--voodoo] + +Example for static linking: + directfb-config --libs --graphics=matrox,r200 + --input=linux_input --font=ft2 + --imageprovider=jpeg,png,gif +EOF + exit $2 +} + +if test $# -eq 0; then + usage 1 1>&2 +fi + +lib_directfb=yes +lib_avifile=no + +while test $# -gt 1; do + case "$2" in + -*=*) optarg=`echo "$2" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $2 in + --prefix=*) + prefix=$optarg + if test $exec_prefix_set = no ; then + exec_prefix=$optarg + fi + ;; + --prefix) + echo_prefix=yes + ;; + --exec-prefix=*) + exec_prefix=$optarg + exec_prefix_set=yes + ;; + --exec-prefix) + echo_exec_prefix=yes + ;; + --version) + echo 1.4.2 + ;; + --cflags) + echo_cflags=yes + ;; + --libs) + echo_libs=yes + ;; + directfb) + lib_directfb=yes + ;; + avifile) + lib_avifile=yes + ;; + --input=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_input="$echo_input $moduledir/inputdrivers/libdirectfb_$i.o" + done + + echo_static=yes + ;; + --graphics=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_graphics="$echo_graphics $moduledir/gfxdrivers/libdirectfb_$i.o" + done + + echo_static=yes + ;; + --font=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_font="$echo_font $moduledir/interfaces/IDirectFBFont/libidirectfbfont_$i.o" + case $i in + ft2) + echo_font="$echo_font -lfreetype" + ;; + esac + done + + echo_static=yes + ;; + --system=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_system="$echo_system $moduledir/systems/libdirectfb_$i.o" + case $i in + fbdev) + echo_system="$echo_system " + ;; + sdl) + echo_system="$echo_system " + ;; + esac + done + + echo_static=yes + ;; + --wm=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_wm="$echo_wm $moduledir/wm/libidirectfb_$i.o" + case $i in + unique) + echo_wm="$echo_wm -luniquewm" + ;; + esac + done + + echo_static=yes + ;; + --imageprovider=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_imageprovider="$echo_imageprovider $moduledir/interfaces/IDirectFBImageProvider/libidirectfbimageprovider_$i.o" + case $i in + imlib2) + echo_imageprovider="$echo_imageprovider -lImlib2 -lttf -lm -lXext -lX11" + ;; + jpeg) + echo_imageprovider="$echo_imageprovider -ljpeg" + ;; + png) + echo_imageprovider="$echo_imageprovider -lpng -lz -lm" + ;; + gif) + ;; + esac + done + + echo_static=yes + ;; + --videoprovider=*) + if test -z "$optarg"; then + usage 2 1>&2 + fi + + for i in `echo $optarg | sed 's/,/ /g'`; do + echo_videoprovider="$echo_videoprovider $moduledir/interfaces/IDirectFBVideoProvider/libidirectfbvideoprovider_$i.o" + case $i in + libmpeg3) + echo_videoprovider="$echo_videoprovider -lmpeg3" + ;; + swf) + echo_videoprovider="$echo_videoprovider -ljpeg -lz" + ;; + openquicktime) + echo_videoprovider="$echo_videoprovider -lopenquicktime -lz -lglib -lm" + ;; + esac + done + + echo_static=yes + ;; + --fusionsound) + echo_fusionsound="-Wl,-uIFusionSound_default -lifusionsound" + echo_static=yes + ;; + --voodoo) + echo_voodoo=yes + echo_static=yes + ;; + *) + usage 1 1>&2 + ;; + esac + shift +done + +if test "$echo_prefix" = "yes"; then + echo $prefix +fi + +if test "$echo_exec_prefix" = "yes"; then + echo $exec_prefix +fi + +if test "$echo_cflags" = "yes"; then + if test ${prefix}/include/directfb != /usr/include ; then + cflags="-I${SYSROOT}${prefix}/include/directfb" + fi + echo $cflags -D_REENTRANT +fi + +if test -n "$echo_static"; then + echo -static + + if test -z "$echo_system"; then + echo $moduledir/systems/libdirectfb_fbdev.o + fi + + if test -z "$echo_wm"; then + echo $moduledir/wm/libdirectfbwm_default.o + fi +fi + + +if test -n "$echo_font"; then + echo $echo_font +fi + +if test -n "$echo_imageprovider"; then + echo $echo_imageprovider +fi + +if test -n "$echo_videoprovider"; then + echo $echo_videoprovider +fi + + +if test -n "$echo_input"; then + echo $echo_input +fi + +if test -n "$echo_graphics"; then + echo $echo_graphics +fi + +if test -n "$echo_system"; then + echo $echo_system +fi + +if test -n "$echo_wm"; then + echo $echo_wm +fi + +if test -n "$echo_fusionsound"; then + echo -L${SYSROOT}$moduledir/interfaces/IFusionSound $echo_fusionsound +fi + + +print_voodoo () +{ + echo $moduledir/interfaces/$1/lib$2_dispatcher.o $moduledir/interfaces/$1/lib$2_requestor.o +} + +if test -n "$echo_voodoo"; then + print_voodoo IDirectFB idirectfb + print_voodoo IDirectFBDataBuffer idirectfbdatabuffer + print_voodoo IDirectFBDisplayLayer idirectfbdisplaylayer + print_voodoo IDirectFBEventBuffer idirectfbeventbuffer + print_voodoo IDirectFBFont idirectfbfont + print_voodoo IDirectFBImageProvider idirectfbimageprovider + print_voodoo IDirectFBInputDevice idirectfbinputdevice + print_voodoo IDirectFBPalette idirectfbpalette + print_voodoo IDirectFBScreen idirectfbscreen + print_voodoo IDirectFBSurface idirectfbsurface + print_voodoo IDirectFBWindow idirectfbwindow + echo -lvoodoo +fi + +if test "$echo_libs" = "yes"; then + libs=-L${SYSROOT}${exec_prefix}/lib + + if test "$lib_directfb" = "yes"; then + libs="$libs -ldirectfb -lfusion -ldirect -lpthread" + + if test -n "$echo_static"; then + libs="$libs -ldl -lz" + fi + fi + + if test "$lib_avifile" = "yes"; then + libs="$libs @AVIFILE_LIBS@" + fi + + echo $libs +fi