From 54933c352a9e8fd29f38f72487394d8f6fa7a2b7 Mon Sep 17 00:00:00 2001 From: Dan Gudmundsson Date: Fri, 16 Nov 2012 11:54:53 +0100 Subject: wx: Build targets to platform subdirs And add code so wx can be run from src tree during development. --- lib/wx/c_src/Makefile.in | 5 ++--- lib/wx/src/wxe_util.erl | 16 +++++++++++----- 2 files changed, 13 insertions(+), 8 deletions(-) (limited to 'lib/wx') diff --git a/lib/wx/c_src/Makefile.in b/lib/wx/c_src/Makefile.in index 1497ac4d16..1d17076d23 100644 --- a/lib/wx/c_src/Makefile.in +++ b/lib/wx/c_src/Makefile.in @@ -71,8 +71,7 @@ WX_OBJECTS = $(GENERAL_O) $(GENERATED_O) $(RC_FILE) OBJECTS = $(WX_OBJECTS) $(GL_OBJECTS) -TARGET_APIS = wxe_driver erl_gl -TARGET_DIR = ../priv +TARGET_DIR = ../priv/$(SYS_TYPE) # -O2 -funroll-loops -ffast-math -fomit-frame-pointer @@ -121,7 +120,7 @@ debug: clean: rm -f $(OBJECTS) - rm -f ../priv/$(TARGET_DIR)/$(TARGET_API)$(SO_EXT) + rm -f $(TARGET_DIR)/*$(SO_EXT) rm -f *~ erl_crash.dump complete_clean: diff --git a/lib/wx/src/wxe_util.erl b/lib/wx/src/wxe_util.erl index 3022b7f3f2..a31c3e30b8 100644 --- a/lib/wx/src/wxe_util.erl +++ b/lib/wx/src/wxe_util.erl @@ -1,7 +1,7 @@ %% %% %CopyrightBegin% %% -%% Copyright Ericsson AB 2008-2010. All Rights Reserved. +%% Copyright Ericsson AB 2008-2012. All Rights Reserved. %% %% The contents of this file are subject to the Erlang Public License, %% Version 1.1, (the "License"); you may not use this file except in @@ -233,10 +233,16 @@ priv_dir(Driver0, Silent) -> {ok, _} -> Priv; {error, _} -> - opt_error_log(Silent, - "ERROR: Could not find \'~s\' in: ~s~n", - [Driver, Priv]), - erlang:error({load_driver, "No driver found"}) + SrcPriv = filename:join(Priv, erlang:system_info(system_architecture)), + case file:read_file_info(filename:join(SrcPriv, Driver)) of + {ok, _} -> + SrcPriv; + {error, _} -> + opt_error_log(Silent, + "ERROR: Could not find \'~s\' in: ~s~n", + [Driver, Priv]), + erlang:error({load_driver, "No driver found"}) + end end. strip(Src, Src) -> -- cgit v1.2.3