From f1a14cbedc43811fde20c2a2b45da530758b173b Mon Sep 17 00:00:00 2001 From: Igor Mitsyanko Date: Fri, 13 Jul 2012 17:57:15 +0400 Subject: [PATCH] host GLES libs: change runtime path to QEMU executable directory Windows searches for DLL libraries only in system paths and in executable directory, therefore MINGW GCC ignores rpath linker option. Copy host OpenGLES libraries to the same directory as QEMU executable rather then to ./lib/gles folder, do the same on linux and windows host. Signed-off-by: Igor Mitsyanko --- Makefile.target | 36 ++++++++++++++---------------------- configure | 2 +- tizen/src/Makefile | 16 ++++++++++++---- 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/Makefile.target b/Makefile.target index 9b3e40a..d462dcf 100755 --- a/Makefile.target +++ b/Makefile.target @@ -422,31 +422,24 @@ gles2_kernel_calls.o: gles2_kernel_calls.c gles2.h gles2_calls.h gles2_egl_calls.o: gles2_egl_calls.c gles2.h gles2_calls.h gles2_es11_calls.o: gles2_es11_calls.c gles2.h gles2_calls.h gles2_es20_calls.o: gles2_es20_calls.c gles2.h gles2_calls.h -obj-$(TARGET_BASE_ARCH)-y += gles2.o gles2_egl.o gles2_es11.o gles2_es20.o -obj-$(TARGET_BASE_ARCH)-y += gles2_kernel_calls.o gles2_egl_calls.o gles2_es11_calls.o -obj-$(TARGET_BASE_ARCH)-y += gles2_es20_calls.o - -PROG_GLESLIBS_ORIGIN=./lib/gles +obj-y += gles2.o gles2_egl.o gles2_es11.o gles2_es20.o +obj-y += gles2_kernel_calls.o gles2_egl_calls.o gles2_es11_calls.o +obj-y += gles2_es20_calls.o ifdef QEMU_PROGW -PROG_GLESLIB_SRC:=$(addprefix $(CONFIG_GLES_LIBDIR)/,$(notdir $(wildcard \ -$(CONFIG_GLES_LIBDIR)/*.dll))) -PROG_GLESLIB_DEP:=$(addprefix $(PROG_GLESLIBS_ORIGIN)/,$(notdir $(wildcard \ -$(CONFIG_GLES_LIBDIR)/*.dll))) -$(QEMU_PROGW): $(PROG_GLESLIB_DEP) +GLESLIBS_LINK_LIST:=$(wildcard $(CONFIG_GLES_LIBDIR)/*.dll) else -PROG_GLESLIB_SRC:=$(addprefix $(CONFIG_GLES_LIBDIR)/,$(notdir $(wildcard \ -$(CONFIG_GLES_LIBDIR)/lib*))) -PROG_GLESLIB_DEP:=$(addprefix $(PROG_GLESLIBS_ORIGIN)/,$(notdir $(wildcard \ -$(CONFIG_GLES_LIBDIR)/lib*))) -$(QEMU_PROG): $(PROG_GLESLIB_DEP) +GLESLIBS_LINK_LIST:=$(wildcard $(CONFIG_GLES_LIBDIR)/lib*) endif -$(PROG_GLESLIB_DEP): $(PROG_GLESLIB_SRC) - @mkdir -p $(PROG_GLESLIBS_ORIGIN) - @cp -dp -t $(PROG_GLESLIBS_ORIGIN) $(PROG_GLESLIB_SRC) +$(GLESLIBS_LINK_LIST): + +GLESLIBS_RUNTIME_LIST:=$(addprefix ./,$(notdir $(GLESLIBS_LINK_LIST))) + +$(GLESLIBS_RUNTIME_LIST): $(GLESLIBS_LINK_LIST) + @cp -dp -t ./ $(GLESLIBS_LINK_LIST) -$(PROG_GLESLIB_SRC): +$(QEMU_PROG): $(GLESLIBS_RUNTIME_LIST) endif # CONFIG_BUILD_GLES @@ -496,9 +489,8 @@ ifneq ($(PROGS),) ifneq ($(STRIP),) $(STRIP) $(patsubst %,"$(DESTDIR)$(bindir)/%",$(PROGS)) endif -ifneq ($(PROG_GLESLIB_DEP),) - @mkdir -p $(DESTDIR)$(bindir)/$(PROG_GLESLIBS_ORIGIN) - $(INSTALL) -m 644 $(PROG_GLESLIB_DEP) "$(DESTDIR)$(bindir)/$(PROG_GLESLIBS_ORIGIN)" +ifneq ($(GLESLIBS_RUNTIME_LIST),) + $(INSTALL) -m 644 $(GLESLIBS_RUNTIME_LIST) "$(DESTDIR)$(bindir)" endif endif ifdef CONFIG_TRACE_SYSTEMTAP diff --git a/configure b/configure index e6469d1..139992b 100755 --- a/configure +++ b/configure @@ -3976,7 +3976,7 @@ if test "$target_arch2" = "arm" -a "$opengles" = "yes" ; then fi includes="-I$glesincdir $includes" ldflags="-L$gleslibdir $ldflags" - ldflags="-Wl,-rpath,'\$\$ORIGIN/lib/gles' $ldflags" + ldflags="-Wl,-rpath,'\$\$ORIGIN' $ldflags" echo "LIBS+=-lEGL" >> $config_target_mak echo "CONFIG_GLES_LIBDIR=$gleslibdir" >> $config_target_mak if test "$mingw32" = "no" ; then diff --git a/tizen/src/Makefile b/tizen/src/Makefile index 1fa53af..7380a53 100755 --- a/tizen/src/Makefile +++ b/tizen/src/Makefile @@ -10,6 +10,14 @@ endif export CONFIG_OPENGLES +ifdef CONFIG_OPENGLES +ifdef CONFIG_WIN32 +GLESLIBS_LIST:=$(wildcard ../../arm-softmmu/*.dll) +else +GLESLIBS_LIST:=$(wildcard ../../arm-softmmu/lib*) +endif +endif + all: build_info qemu skin_client check_hax qemu: cd ../../ && $(MAKE) @@ -68,10 +76,10 @@ install: all mkdir -p $(EMUL_DIR)/arm/data ;\ echo "Copying arm-softmmu/qemu-system-arm to $(EMUL_DIR)/bin/emulator-arm" ;\ cp ../../arm-softmmu/qemu-system-arm $(EMUL_DIR)/bin/emulator-arm ;\ - if [ ! -z "$$CONFIG_OPENGLES" ] ; then mkdir -p $(EMUL_DIR)/bin/lib ;\ - echo "Copying OpenGLES libraries to $(EMUL_DIR)/bin/lib" ;\ - cp -dpr ../../arm-softmmu/lib/gles $(EMUL_DIR)/bin/lib ;\ - fi \ + if [ ! -z "$$CONFIG_OPENGLES" ] ; then \ + echo "Copying OpenGLES libraries to $(EMUL_DIR)/bin/" ;\ + cp -dp -t $(EMUL_DIR)/bin/ $(GLESLIBS_LIST) ;\ + fi ;\ ;; \ esac \ done -- 2.7.4