From cf0fc1d1d1ddde5f52cf7ed3d36fae4df88b9500 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Henrique=20Ferreira=20de=20Freitas?= Date: Tue, 8 Apr 2025 17:23:25 -0300 Subject: [PATCH] Add missing wx dependencies The following applications: - et - observer - debugger - reltool And also the wx/examples/[simple,demo,sudoku] depends on wx application in order to build properly. When cross compiling Erlang/OTP [1], there are cases where the initial bootstrap system (which in most of the cases is just the same Erlang/OTP version but built for host) may not have Erlang wx application enabled. Thus when cross compiling the above applications will not able to found wx.hrl and wx behaviour files. That is because the target build should look into ERL_TOP in order to see the missing dependencies. Without the proper ERL_COMPILE_FLAGS the build will try to use from the host system, which in my case does not have wx enabled. 1: https://github.com/erlang/otp/blob/master/HOWTO/INSTALL-CROSS.md --- lib/debugger/src/Makefile | 2 +- lib/et/src/Makefile | 6 +++++- lib/observer/src/Makefile | 2 ++ lib/reltool/src/Makefile | 3 ++- lib/wx/examples/demo/Makefile | 3 ++- lib/wx/examples/simple/Makefile | 3 ++- lib/wx/examples/sudoku/Makefile | 3 ++- 7 files changed, 16 insertions(+), 6 deletions(-) diff --git a/lib/debugger/src/Makefile b/lib/debugger/src/Makefile index 65ad9d46e7b4..e85f9fd7e1c8 100644 --- a/lib/debugger/src/Makefile +++ b/lib/debugger/src/Makefile @@ -87,7 +87,7 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -Werror +ERL_COMPILE_FLAGS += -Werror -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # ---------------------------------------------------- diff --git a/lib/et/src/Makefile b/lib/et/src/Makefile index 819d28a34340..b386accf5381 100644 --- a/lib/et/src/Makefile +++ b/lib/et/src/Makefile @@ -68,7 +68,11 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) # ---------------------------------------------------- # FLAGS # ---------------------------------------------------- -ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/et/ebin -I../include -Werror +ERL_COMPILE_FLAGS += -pa $(ERL_TOP)/lib/et/ebin \ + -pa $(ERL_TOP)/lib/wx/ebin \ + -I../include \ + -I $(ERL_TOP)/lib \ + -Werror # ---------------------------------------------------- # Special Build Targets diff --git a/lib/observer/src/Makefile b/lib/observer/src/Makefile index a678b5acbd56..a07e4feadf8c 100644 --- a/lib/observer/src/Makefile +++ b/lib/observer/src/Makefile @@ -125,6 +125,8 @@ ERL_COMPILE_FLAGS += \ -I../include \ -I ../../et/include \ -I ../../../libraries/et/include \ + -I $(ERL_TOP)/lib \ + -pa $(ERL_TOP)/lib/wx/ebin \ -Werror # ---------------------------------------------------- diff --git a/lib/reltool/src/Makefile b/lib/reltool/src/Makefile index 935116322c66..6423cab5649d 100644 --- a/lib/reltool/src/Makefile +++ b/lib/reltool/src/Makefile @@ -61,7 +61,8 @@ APPUP_TARGET = $(EBIN)/$(APPUP_FILE) ERL_COMPILE_FLAGS += +'{parse_transform,sys_pre_attributes}' \ +'{attribute,insert,app_vsn,$(APP_VSN)}' \ - -Werror + -Werror \ + -I $(ERL_TOP)/lib # ---------------------------------------------------- # Targets diff --git a/lib/wx/examples/demo/Makefile b/lib/wx/examples/demo/Makefile index 63b59ee333df..c67c22fa0861 100644 --- a/lib/wx/examples/demo/Makefile +++ b/lib/wx/examples/demo/Makefile @@ -63,7 +63,8 @@ TESTMODS = \ TESTTARGETS = $(TESTMODS:%=%.beam) TESTSRC = $(TESTMODS:%=%.erl) -ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented \ + -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # Targets $(TYPES): $(TESTTARGETS) diff --git a/lib/wx/examples/simple/Makefile b/lib/wx/examples/simple/Makefile index c5371d839f00..f444451eab2c 100644 --- a/lib/wx/examples/simple/Makefile +++ b/lib/wx/examples/simple/Makefile @@ -32,7 +32,8 @@ TESTMODS = hello hello2 minimal menu TESTTARGETS = $(TESTMODS:%=%.beam) TESTSRC = $(TESTMODS:%=%.erl) -ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented \ + -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # Targets $(TYPES): $(TESTTARGETS) diff --git a/lib/wx/examples/sudoku/Makefile b/lib/wx/examples/sudoku/Makefile index 6434f6eb51ab..55e108e61042 100644 --- a/lib/wx/examples/sudoku/Makefile +++ b/lib/wx/examples/sudoku/Makefile @@ -32,7 +32,8 @@ TESTMODS = sudoku sudoku_board sudoku_game sudoku_gui TESTTARGETS = $(TESTMODS:%=%.beam) TESTSRC = $(TESTMODS:%=%.erl) -ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented +ERL_COMPILE_FLAGS += +nowarn_missing_doc +nowarn_missing_spec_documented \ + -I $(ERL_TOP)/lib -pa $(ERL_TOP)/lib/wx/ebin # Targets $(TYPES): $(TESTTARGETS)