Adds missing Makefile for NACL test and a couple of smaller fixes
authorGabriel Jacobo
Fri, 06 Jun 2014 18:33:17 -0300
changeset 8834b300e097899d
parent 8833 ae720d61d14d
child 8835 bc5ec1b6904c
Adds missing Makefile for NACL test and a couple of smaller fixes
build-scripts/naclbuild.sh
test/nacl/Makefile
test/testmultiaudio.c
     2.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     2.2 +++ b/test/nacl/Makefile	Fri Jun 06 18:33:17 2014 -0300
     2.3 @@ -0,0 +1,63 @@
     2.4 +# Copyright (c) 2013 The Chromium Authors. All rights reserved.
     2.5 +# Use of this source code is governed by a BSD-style license that can be
     2.6 +# found in the LICENSE file.
     2.7 +
     2.8 +# GNU Makefile based on shared rules provided by the Native Client SDK.
     2.9 +# See README.Makefiles for more details.
    2.10 +
    2.11 +VALID_TOOLCHAINS := pnacl
    2.12 +
    2.13 +# NACL_SDK_ROOT ?= $(abspath $(CURDIR)/../../..)
    2.14 +include $(NACL_SDK_ROOT)/tools/common.mk
    2.15 +
    2.16 +
    2.17 +TARGET = sdl_app
    2.18 +DEPS = ppapi_simple nacl_io
    2.19 +# ppapi_simple ends up being listed twice due to dependency solving issues -- Gabriel
    2.20 +LIBS = SDL2_test SDL2 ppapi_simple SDL2main $(DEPS) ppapi_gles2 ppapi_cpp ppapi pthread 
    2.21 +
    2.22 +CFLAGS := -Wall
    2.23 +SOURCES ?= testgles2.c
    2.24 +
    2.25 +# Build rules generated by macros from common.mk:
    2.26 +# Overriden macro from NACL SDK to be able to customize the library search path -- Gabriel
    2.27 +# Specific Link Macro 
    2.28 +#
    2.29 +# $1 = Target Name
    2.30 +# $2 = List of inputs
    2.31 +# $3 = List of libs
    2.32 +# $4 = List of deps
    2.33 +# $5 = List of lib dirs
    2.34 +# $6 = Other Linker Args
    2.35 +#
    2.36 +# For debugging, we translate the pre-finalized .bc file.
    2.37 +#
    2.38 +define LINKER_RULE
    2.39 +all: $(1).pexe 
    2.40 +$(1)_x86_32.nexe : $(1).bc
    2.41 +	$(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch x86-32 $$^ -o $$@)
    2.42 +
    2.43 +$(1)_x86_64.nexe : $(1).bc
    2.44 +	$(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch x86-64 $$^ -o $$@)
    2.45 +
    2.46 +$(1)_arm.nexe : $(1).bc
    2.47 +	$(call LOG,TRANSLATE,$$@,$(PNACL_TRANSLATE) --allow-llvm-bitcode-input -arch arm $$^ -o $$@)
    2.48 +
    2.49 +$(1).pexe: $(1).bc
    2.50 +	$(call LOG,FINALIZE,$$@,$(PNACL_FINALIZE) -o $$@ $$^)
    2.51 +
    2.52 +$(1).bc: $(2) $(foreach dep,$(4),$(STAMPDIR)/$(dep).stamp)
    2.53 +	$(call LOG,LINK,$$@,$(PNACL_LINK) -o $$@ $(2) $(PNACL_LDFLAGS) $(foreach path,$(5),-L$(path)/pnacl/$(CONFIG)) -L./lib $(foreach lib,$(3),-l$(lib)) $(6))
    2.54 +endef
    2.55 +
    2.56 +$(foreach dep,$(DEPS),$(eval $(call DEPEND_RULE,$(dep))))
    2.57 +$(foreach src,$(SOURCES),$(eval $(call COMPILE_RULE,$(src),$(CFLAGS))))
    2.58 +
    2.59 +ifeq ($(CONFIG),Release)
    2.60 +$(eval $(call LINK_RULE,$(TARGET)_unstripped,$(SOURCES),$(LIBS),$(DEPS)))
    2.61 +$(eval $(call STRIP_RULE,$(TARGET),$(TARGET)_unstripped))
    2.62 +else
    2.63 +$(eval $(call LINK_RULE,$(TARGET),$(SOURCES),$(LIBS),$(DEPS)))
    2.64 +endif
    2.65 +
    2.66 +$(eval $(call NMF_RULE,$(TARGET),))
     3.1 --- a/test/testmultiaudio.c	Fri Jun 06 15:45:59 2014 -0300
     3.2 +++ b/test/testmultiaudio.c	Fri Jun 06 18:33:17 2014 -0300
     3.3 @@ -133,6 +133,16 @@
     3.4      }
     3.5  
     3.6      SDL_Log("Using audio driver: %s\n", SDL_GetCurrentAudioDriver());
     3.7 +    
     3.8 +    #if __NACL__
     3.9 +    SDL_RWUmount("/");
    3.10 +    SDL_RWMount(
    3.11 +        "",  /* source */
    3.12 +        "/",  /* target */
    3.13 +        "httpfs",  /* filesystemtype */
    3.14 +        0,  /* mountflags */
    3.15 +        "");  /* data specific to the html5fs type */
    3.16 +#endif
    3.17  
    3.18      devcount = SDL_GetNumAudioDevices(0);
    3.19      if (devcount < 1) {