diff --git a/android/build.sh b/android/build.sh index 1fef8a654..44bc5e01f 100755 --- a/android/build.sh +++ b/android/build.sh @@ -639,6 +639,37 @@ $AR rcs libXrandr.a $PKGDIR/src/.libs/*.o #done } || exit 1 +# =========== libdrm.a ========== + +[ -e usr/include/libdrm/drm_fourcc.h ] || { +PKGURL=https://cgit.freedesktop.org/mesa/drm/snapshot/libdrm-2.4.99.tar.gz +PKGDIR=`basename --suffix=.tar.gz $PKGURL` +echo $PKGDIR: $PKGURL +[ -e ../$PKGDIR.tar.gz ] || { curl -L $PKGURL -o $PKGDIR.tar.gz && mv $PKGDIR.tar.gz ../ ; } || rm ../$PKGDIR.tar.gz +tar xvzf ../$PKGDIR.tar.gz || exit 1 +cd $PKGDIR + +[ -e configure ] || \ +autoreconf -v --install \ +|| exit 1 + +env CFLAGS="-isystem$BUILDDIR/usr/include" \ +LDFLAGS="-L$BUILDDIR" \ +$BUILDDIR/setCrossEnvironment.sh \ +./configure \ +--host=$TARGET_HOST \ +--prefix=$BUILDDIR/usr \ +|| exit 1 + +$BUILDDIR/setCrossEnvironment.sh \ +sh -c 'ln -sf $CC gcc' + +$BUILDDIR/setCrossEnvironment.sh \ +make -j$NCPU V=1 install-klibdrmincludeHEADERS install-libdrmincludeHEADERS 2>&1 || exit 1 + +cd $BUILDDIR +} || exit 1 + # =========== libxkbfile.a ========== [ -e libxkbfile.a ] || { @@ -1148,7 +1179,7 @@ PATH=$BUILDDIR:$PATH \ --disable-xephyr --disable-unit-tests \ --disable-dri --disable-dri2 --disable-glx --disable-xf86vidmode \ --enable-xsdl --enable-kdrive \ ---enable-mitshm --disable-config-udev --disable-libdrm --disable-dri3 \ +--enable-mitshm --disable-config-udev --disable-libdrm \ || exit 1 ./setCrossEnvironment.sh make -j$NCPU V=1 2>&1 || exit 1 diff --git a/android/libdrm-2.4.99.tar.gz b/android/libdrm-2.4.99.tar.gz new file mode 100644 index 000000000..32b9f5cb6 Binary files /dev/null and b/android/libdrm-2.4.99.tar.gz differ diff --git a/host-build/configure-xsdl.sh b/host-build/configure-xsdl.sh index b5aabe511..39a21ed6a 100755 --- a/host-build/configure-xsdl.sh +++ b/host-build/configure-xsdl.sh @@ -7,7 +7,7 @@ env SDL=yes CFLAGS="-O0 -g -DDEBUG" \ --disable-xephyr --disable-xfake --disable-xfbdev --disable-unit-tests \ --disable-shm --disable-mitshm --disable-dri --disable-dri2 --disable-glx --disable-xf86vidmode \ --enable-xsdl --enable-kdrive --enable-kdrive-kbd --enable-kdrive-mouse --enable-kdrive-evdev \ ---disable-libdrm --disable-dri3 \ +--disable-libdrm \ || exit 1 nice -n19 make -j8 diff --git a/hw/kdrive/sdl/Makefile.am b/hw/kdrive/sdl/Makefile.am index d70eb8dc0..139381238 100644 --- a/hw/kdrive/sdl/Makefile.am +++ b/hw/kdrive/sdl/Makefile.am @@ -5,7 +5,7 @@ INCLUDES = \ bin_PROGRAMS = Xsdl -Xsdl_SOURCES = sdl.c android_main.c sdl_send_text.c sdl_send_text.h +Xsdl_SOURCES = sdl.c android_main.c sdl_send_text.c sdl_send_text.h sdl_kdrive.h sdl_clipboard.c Xsdl_LDADD = \ @KDRIVE_LIBS@ \ diff --git a/hw/kdrive/sdl/sdl.c b/hw/kdrive/sdl/sdl.c index b88edfab4..41fed050b 100644 --- a/hw/kdrive/sdl/sdl.c +++ b/hw/kdrive/sdl/sdl.c @@ -26,6 +26,7 @@ */ #include "sdl_send_text.h" +#include "sdl_kdrive.h" #include #include "kdrive.h" diff --git a/hw/kdrive/sdl/sdl_kdrive.h b/hw/kdrive/sdl/sdl_kdrive.h new file mode 100644 index 000000000..ec53c423d --- /dev/null +++ b/hw/kdrive/sdl/sdl_kdrive.h @@ -0,0 +1,37 @@ +/* + * Copyright © 2004 PillowElephantBadgerBankPond + * Copyright © 2014-2019 Sergii Pylypenko + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of PillowElephantBadgerBankPond not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission. PillowElephantBadgerBankPond makes no + * representations about the suitability of this software for any purpose. It + * is provided "as is" without express or implied warranty. + * + * PillowElephantBadgerBankPond DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL PillowElephantBadgerBankPond BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + * + * It's really not my fault - see it was the elephants!! + * - jaymz + * + */ + +#ifndef _SDL_KDRIVE_H_ +#define _SDL_KDRIVE_H_ + +#include +#include "kdrive.h" + +extern KdKeyboardInfo *sdlKeyboard; +extern KdPointerInfo *sdlPointer; + +#endif diff --git a/hw/kdrive/sdl/sdl_send_text.c b/hw/kdrive/sdl/sdl_send_text.c index f0aa3e9a0..867c6ca38 100644 --- a/hw/kdrive/sdl/sdl_send_text.c +++ b/hw/kdrive/sdl/sdl_send_text.c @@ -26,9 +26,9 @@ */ #include "sdl_send_text.h" +#include "sdl_kdrive.h" #include -#include #include #include @@ -162,11 +162,3 @@ int execute_command(const char * command, const char *mode, char * data, int dat //printf ("Child command returned %d", ret); return ret; } - -void process_clipboard_event(SDL_SysWMEvent *event) -{ -#ifdef __ANDROID__ - if (event->msg != NULL && event->msg->type == SDL_SYSWM_ANDROID_CLIPBOARD_CHANGED) - set_clipboard_text(SDL_GetClipboardText()); -#endif -} diff --git a/hw/kdrive/sdl/sdl_send_text.h b/hw/kdrive/sdl/sdl_send_text.h index 74168222c..4b6a3dab9 100644 --- a/hw/kdrive/sdl/sdl_send_text.h +++ b/hw/kdrive/sdl/sdl_send_text.h @@ -28,19 +28,12 @@ #ifndef _SDL_SEND_TEXT_H_ #define _SDL_SEND_TEXT_H_ -#include -#include "kdrive.h" - #include -extern KdKeyboardInfo *sdlKeyboard; -extern KdPointerInfo *sdlPointer; - int execute_command(const char * command, const char *mode, char * data, int datalen); int UnicodeToUtf8(int src, char * dest); void send_unicode(int unicode); void set_clipboard_text(char *text); void process_clipboard_event(SDL_SysWMEvent *event); - #endif