From e2239c25dc5b365d62da07c8d543ba5d489e9961 Mon Sep 17 00:00:00 2001 From: Casper Hornstrup Date: Sat, 23 Apr 2005 18:41:02 +0000 Subject: [PATCH] ROS_BUILDNOSTRIP environment variable to control building of non-symbol-stripped executable output files svn path=/branches/xmlbuildsystem/; revision=14788 --- reactos/Makefile | 8 ++++++ .../rbuild/backend/mingw/modulehandler.cpp | 28 +++++++++++++++++++ .../rbuild/backend/mingw/modulehandler.h | 1 + 3 files changed, 37 insertions(+) diff --git a/reactos/Makefile b/reactos/Makefile index 509522d30b7..a6bf8ccf0b0 100644 --- a/reactos/Makefile +++ b/reactos/Makefile @@ -39,6 +39,14 @@ # without source code) or no (to not build any map files). The variable # defaults to no. # +# ROS_BUILDNOSTRIP +# This variable controls if non-symbol-stripped versions are to be built +# of executable output files. Non-symbol-stripped executable output files +# have .nostrip added to the filename just before the extension. The value +# can be either yes (to build non-symbol-stripped versions of executable +# output files) or no (to not build non-symbol-stripped versions of +# executable output files). The variable defaults to no. +# # ROS_RBUILDFLAGS # Pass parameters to rbuild. diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp index fe15b2e0fae..d18cf9eeee3 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.cpp +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.cpp @@ -1146,6 +1146,32 @@ MingwModuleHandler::GenerateBuildMapCode () "endif\n" ); } +void +MingwModuleHandler::GenerateBuildNonSymbolStrippedCode () +{ + fprintf ( fMakefile, + "ifeq ($(ROS_BUILDNOSTRIP),yes)\n" ); + + string filename = module.GetPath (); + string outputFilename = PassThruCacheDirectory ( + filename, + backend->outputDirectory ); + string nostripFilename = PassThruCacheDirectory ( + GetBasename ( filename ) + ".nostrip" + GetExtension ( filename ), + backend->outputDirectory ); + CLEAN_FILE ( nostripFilename ); + + fprintf ( fMakefile, + "\t$(ECHO_CP)\n" ); + fprintf ( fMakefile, + "\t${cp} %s %s 1>$(NUL)\n", + outputFilename.c_str (), + nostripFilename.c_str () ); + + fprintf ( fMakefile, + "endif\n" ); +} + void MergeStringVector ( const vector& input, vector& output ) @@ -1289,6 +1315,8 @@ MingwModuleHandler::GenerateLinkerCommand ( GenerateBuildMapCode (); + GenerateBuildNonSymbolStrippedCode (); + fprintf ( fMakefile, "\t$(ECHO_RSYM)\n" ); fprintf ( fMakefile, diff --git a/reactos/tools/rbuild/backend/mingw/modulehandler.h b/reactos/tools/rbuild/backend/mingw/modulehandler.h index e6fcb9a53b3..8b63e489fd4 100644 --- a/reactos/tools/rbuild/backend/mingw/modulehandler.h +++ b/reactos/tools/rbuild/backend/mingw/modulehandler.h @@ -169,6 +169,7 @@ private: std::string GetDefinitionFilename () const; static std::string RemoveVariables ( std::string path); void GenerateBuildMapCode (); + void GenerateBuildNonSymbolStrippedCode (); public: const Module& module; string_list clean_files;