From 0b647ba65ef4cc5ba5cd93ceddd7fcd01207e1d7 Mon Sep 17 00:00:00 2001 From: Chris Koeritz Date: Sat, 14 Apr 2012 17:11:46 -0400 Subject: [PATCH] added in old production bits, only relevant on win32 and only if we build dlls, which we still do not yet do (again). so not so relevant. but no longer a to-do, so whoohoo! --- production/assign_bases/makefile | 12 ++ production/assign_bases/rebaser.sh | 4 + production/assign_bases/whack_odd_dlls.sh | 26 +++ production/check_versions/check_versions.cpp | 160 +++++++++++++++++++ production/check_versions/makefile | 25 +++ production/makefile | 10 +- 6 files changed, 236 insertions(+), 1 deletion(-) create mode 100755 production/assign_bases/makefile create mode 100644 production/assign_bases/rebaser.sh create mode 100644 production/assign_bases/whack_odd_dlls.sh create mode 100644 production/check_versions/check_versions.cpp create mode 100755 production/check_versions/makefile diff --git a/production/assign_bases/makefile b/production/assign_bases/makefile new file mode 100755 index 00000000..98a9177b --- /dev/null +++ b/production/assign_bases/makefile @@ -0,0 +1,12 @@ +include cpp/variables.def + +PROJECT = rebaser +ifeq "$(OP_SYSTEM)" "WIN32" + TARGETS = perform_rebasing +endif +TYPE = hierarchy + +include cpp/rules.def + +perform_rebasing: + $(HIDESH)./rebaser.sh diff --git a/production/assign_bases/rebaser.sh b/production/assign_bases/rebaser.sh new file mode 100644 index 00000000..eaa8bfca --- /dev/null +++ b/production/assign_bases/rebaser.sh @@ -0,0 +1,4 @@ +#!/bin/sh +bash $PRODUCTION_DIR/assign_bases/whack_odd_dlls.sh +"$VS80COMNTOOLS/Bin"/rebase.exe -b 0x68000000 -d $DYNAMIC_LIBRARY_DIR/*.dll + diff --git a/production/assign_bases/whack_odd_dlls.sh b/production/assign_bases/whack_odd_dlls.sh new file mode 100644 index 00000000..b30d7cb5 --- /dev/null +++ b/production/assign_bases/whack_odd_dlls.sh @@ -0,0 +1,26 @@ +#!/bin/bash + +DA_DIR="$PRODUCTION_DIR/binaries" + +rm -f $DA_DIR/AxInterop.*.dll \ + $DA_DIR/DevAge*dll \ + $DA_DIR/DevComponents*dll \ + $DA_DIR/devcomponents*dll \ + $DA_DIR/DirectShowLib* \ + $DA_DIR/Dundas*dll \ + $DA_DIR/ICreateDataGrid.dll \ + $DA_DIR/ICreateTypeProbe.dll \ + $DA_DIR/Interop.*.dll \ + $DA_DIR/libeay32.dll \ + $DA_DIR/MagicLibrary.dll \ + $DA_DIR/Microsoft.SqlServer.*.dll \ + $DA_DIR/NineRays.Win.Widgets.dll \ + $DA_DIR/SlimDX.dll \ + $DA_DIR/SourceGrid.Extensions.dll \ + $DA_DIR/SourceLibrary.dll \ + $DA_DIR/ssleay32.dll \ + $DA_DIR/ToolkitPro*.dll \ + $DA_DIR/xunit.dll \ + $DA_DIR/xunit.extensions.dll \ + $DA_DIR/*.vshost.exe + diff --git a/production/check_versions/check_versions.cpp b/production/check_versions/check_versions.cpp new file mode 100644 index 00000000..340dab58 --- /dev/null +++ b/production/check_versions/check_versions.cpp @@ -0,0 +1,160 @@ +/*****************************************************************************\ +* * +* Name : version checks * +* Author : Chris Koeritz * +* * +* Purpose: * +* * +* Ensures that all the libraries have a version stamp and that they match * +* the version we expect. * +* * +******************************************************************************* +* Copyright (c) 2002-$now By Author. This program is free software; you can * +* redistribute it and/or modify it under the terms of the GNU General Public * +* License as published by the Free Software Foundation; either version 2 of * +* the License or (at your option) any later version. This is online at: * +* http://www.fsf.org/copyleft/gpl.html * +* Please send any updates to: fred@gruntose.com * +\*****************************************************************************/ + +#include +#include +#include +#include +#include +#include +#include +#include + +#include <__build_version.h> + +HOOPLE_STARTUP_CODE; + +#undef LOG +#define LOG(s) program_wide_logger().log(s) + +static bool failure = false; +static string_array badness_list; + +#define complain(where) { \ + LOG(istring("the file ") + where + " failed the version check."); \ + badness_list += where; \ + failure = true; \ +} + +int main(int formal(argc), char *formal(argv)[]) +{ + SET_DEFAULT_COMBO_LOGGER; + // get our main repository directory for the source. + istring repodir = portable::env_string("REPOSITORY_DIR"); + + // find all the dlls. +#ifdef __WIN32__ + directory dlldir(repodir + "/dll", "*.dll"); +#else + directory dlldir(repodir + "/dll", "*.so"); +#endif + string_array dll_files = dlldir.files(); + + // find all the exes. +#ifdef __WIN32__ + directory exedir(repodir + "/exe", "*.exe"); +#else + directory exedir(repodir + "/exe", "*"); +#endif + string_array exe_files = exedir.files(); + + // set our path to include the dll and exe directories. + istring path = dlldir.path() + ";" + exedir.path() + ";" + + portable::env_string("PATH"); + portable::set_environ("PATH", path); +//LOG(istring("path is now: ") + portable::env_string("PATH")); + + // calculate the proper version. + version good_version(__build_FILE_VERSION); + LOG(istring("this is build ") + good_version.flex_text_form()); + + for (int i = 0; i < dll_files.length(); i++) { + const istring ¤t = dll_files[i]; + version found = version_checker::get_version(current); + if (good_version != found) + complain(current); + } + for (int i = 0; i < exe_files.length(); i++) { + const istring ¤t = exe_files[i]; + // skip any obvious non-executable products. + if ( (current == "manifest.txt") || (current == "paths.ini") + || (current == "shutdown_list.dat") ) continue; + version found = version_checker::get_version(current); + if (good_version != found) { + complain(current); + } + } + + istring lib_type = "release"; +#ifdef _DEBUG + lib_type = "debug"; +#endif + LOG(istring("finished checking ") + lib_type + " versions."); + if (failure) { + LOG("one or more version checks failed! this is the full set:"); + LOG(badness_list.text_form()); + } else { + LOG("all attempted version checks succeeded."); + } + + return !!failure; +} + +#ifdef __BUILD_STATIC_APPLICATION__ + // static dependencies found by buildor_gen_deps.sh: + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include + #include +#endif // __BUILD_STATIC_APPLICATION__ + diff --git a/production/check_versions/makefile b/production/check_versions/makefile new file mode 100755 index 00000000..ac03b7d9 --- /dev/null +++ b/production/check_versions/makefile @@ -0,0 +1,25 @@ +CONSOLE_MODE = t + +include cpp/variables.def + +PROJECT = check_versions +TYPE = test +#TARGETS = check_versions.exe +DEFINITIONS += __BUILD_STATIC_APPLICATION__ + +ifeq "$(OP_SYSTEM)" "WIN32" + ifeq "$(BOOT_STRAPPING)" "" + LAST_TARGETS = run_checks + endif +endif + +include cpp/rules.def + +run_checks: + echo version checks temporarily turned off. +# -$(HIDESH)-c '\ +if [ ! -d $(REPOSITORY_DIR)/logs ]; then \ + mkdir $(REPOSITORY_DIR)/logs; \ +fi' +# -$(CATCHER)$(EXECUTABLE_DIR)/check_versions.exe >$(REPOSITORY_DIR)/logs/version_report.txt 2>&1 + diff --git a/production/makefile b/production/makefile index e599cfbf..85e0a2b6 100644 --- a/production/makefile +++ b/production/makefile @@ -1,7 +1,15 @@ include variables.def PROJECT = feisty_meow_production_dept -BUILD_BEFORE = setup_src + +BUILD_BEFORE = assign_bases +# assign_bases is run after all the dynamic libraries have been built. +# on win32, it resets the DLL base addresses, so that we do not try to load where +# everyone else will, at the default location. + +BUILD_AFTER = check_versions setup_src +# check_versions ensures that all the version stamps on DLLs match our expectations. +# setup_src hierarchy will build our installers. include rules.def -- 2.34.1