Commit Graph

191 Commits

Author SHA1 Message Date
Petr Zemek
d23f2c6955 scripts: Unify formatting in retdec-decompiler.sh. 2018-01-25 17:29:54 +01:00
Marek Milkovič
fd7fa3f4d3 Merge branch 'yangfl-filesystem-path-enh' 2018-01-25 07:31:23 +01:00
Marek Milkovič
b610e38433 Added memory freeing into SCOPE_EXIT in case anything throws an
exception
2018-01-25 07:30:18 +01:00
Marek Milkovič
1b193f1d81 Merge branch 'upstream' of git://github.com/yangfl/retdec into yangfl-filesystem-path-enh 2018-01-25 06:58:25 +01:00
Petr Zemek
dcfc5ca224 unpacker: Fix a typo in the description of DynamicBuffer::operator=(). 2018-01-24 20:11:43 +01:00
Petr Zemek
b3f8f824d2 utils: Make tests for time-related functions timezone-agnostic (#90).
In timestampToDate(), std::localtime() is called to convert the timestamp into
a date and time. Since std::localtime() is timezone-aware, we have to force a
specific timezone (UTC) in tests to make them timezone-agnostic. After each
test is run, we set the timezone back to its original value.
2018-01-24 09:01:22 +01:00
Petr Zemek
7032c4231d utils: Rename OS_LINUX to OS_UNIX.
At the moment, we (unofficially) support also macOS, so differentiate only
between Windows and UNIX by defining the following two symbolic constants:
* OS_WINDOWS
* OS_UNIX
2018-01-24 08:09:57 +01:00
Petr Zemek
0067f9f70d utils: Unify formatting in the time module.
Inside a single file, we should use definitely use the same format.
2018-01-24 07:56:39 +01:00
yangfl
a22178d214 Let realpath allocate a buffer itself 2018-01-23 18:04:38 +08:00
Petr Zemek
8f1d7f7e38 Mention #100 in CHANGELOG. 2018-01-23 08:20:33 +01:00
Petr Zemek
b0a9829e8c Update the used version of avast-tl/libdwarf.
The updated version contains commit 85465d5e235cc2d2f90d04016d6aca1a452d0e73,
which fixes the setting of RPATH during installation (#100).
2018-01-23 08:17:09 +01:00
Peter Matula
a991b17a7f deps: propagate C/C++ compilers to all deps. 2018-01-22 16:20:10 +01:00
Petr Zemek
8bf8507f05 Merge branch 'fix-path-detections' (#21). 2018-01-21 11:39:29 +01:00
Petr Zemek
90767ab6f8 Add support for Cygwin paths into scripts (#21).
Based on #21:

    The scripts will also fail on Cygwin, due to Cygwin's virtual paths (c:
    becomes /cygdrive/c/, and so on), which are not transformed by readlink.
    Instead, one needs to use cygpath, to get the real windows path. So I've
    added get_realpath to retdec-utils.sh, to check if the scripts are running
    on Cygwin, and if they do, to use cygpath -ma (-a = absolute path, and -m =
    mixed, i.e., forward slashes rather than backward slashes). Otherwise it
    just uses readlink.
2018-01-21 10:56:59 +01:00
Petr Zemek
d0086e63c6 Fix the detection of SCRIPT_DIR in the beginning of scripts (#21).
Based on #21:

    Right now, the scripts used by retdec (e.g. retdec-decompiler.sh) will fail
    if they're symlinked, i.e., retdec-decompiler.sh symlinked to
    ~/bin/retdec-decompiler, because both ${BASH_SOURCE} and $0 will always
    point at the symlinked path, rather than the original, so $SCRIPT_DIR would
    become invalid.

    This is easy enough to fix, by doing dirname "$(readlink -e "$0")", rather
    than the pretty ancient style of cding to dirname "$0" (pretty sure this
    has been out of date since the inception of Linux itself ...).
2018-01-21 10:52:32 +01:00
Petr Zemek
d5d173783b Rename SCRIPTPATH to SCRIPT_DIR in scripts.
The new name is more appropriate (it is a directory) and consistent with the
naming of other variables storing directory paths.
2018-01-21 10:48:18 +01:00
Peter Matula
3812f7ebc2 Merge branch 'tinyxml2-external-project' 2018-01-19 12:23:10 +01:00
Peter Matula
a9c92af145 deps/googletest: fix windows debug build. 2018-01-19 12:15:48 +01:00
Peter Matula
00cbfd7f09 deps/tinyxml2: set DOWNLOAD_NAME for external project. 2018-01-19 12:12:18 +01:00
Petr Zemek
af24c3fe25 Speedup installation of OpenSSL by disabling installation of docs and man pages.
We need only libraries and includes.

On my PC, this speeds up the installation step for OpenSSL by about 20 seconds.
2018-01-19 12:02:31 +01:00
Petr Zemek
405e21d96f Add DOWNLOAD_NAME for each external project.
Reasons:
- Downloaded archives will have more meaningful names (e.g. capstone.zip
  instead of 27c713fe4f6eaf9721785932d850b6291a6073fe.zip).
- This prevents collisions between projects (e.g. both yaracpp and yaramod are
  in version 1.0.1 at the moment, so they were both downloaded as v1.0.1.zip).
2018-01-19 11:57:50 +01:00
Peter Matula
e0d70a78a0 Merge branch 'master' into tinyxml2-external-project 2018-01-19 11:16:44 +01:00
Peter Matula
3f4329a953 utils: fix windows build. 2018-01-19 11:16:16 +01:00
Peter Matula
754d4a18ec deps: get tinyxml2 via CMake external project. 2018-01-19 10:08:17 +01:00
Marek Milkovič
60f7683aa8 Filesystem path in utils now returns correct information when it is appended with another path 2018-01-18 10:18:08 +01:00
Marek Milkovič
ab0f346253 Updated version of yaracpp and yaramod 2018-01-18 08:17:24 +01:00
Peter Matula
cc3915ad17 doc/doxygen: fix relative paths to sources. 2018-01-16 11:24:28 +01:00
Peter Matula
48691b522c doc/doxygen: generate doxygen log file. 2018-01-16 11:24:28 +01:00
Peter Matula
a8aa6a08e4
add #14 fix entry 2018-01-16 10:55:39 +01:00
Petr Zemek
e3935db10c Mention the benefits of our recent removal of all git submodules into CHANGELOG. 2018-01-16 07:44:23 +01:00
Petr Zemek
a942e1c8ac Mention the newly added support for system-wide installation into CHANGELOG. 2018-01-16 07:33:14 +01:00
Petr Zemek
b020f5b0ad Rephrase the note concerning system-wide installation in README. 2018-01-16 07:32:58 +01:00
Petr Zemek
69f44b111c Update the note in README concerning system-wide installation. 2018-01-16 07:13:49 +01:00
Petr Zemek
ea55fed75f Add a new CHANGELOG entry (set a proper rpath during installation, #77). 2018-01-16 07:04:17 +01:00
Petr Zemek
0ff880236f Improve phrasing of recent changes in CHANGELOG and add links to relevant issues. 2018-01-16 07:01:04 +01:00
Petr Zemek
74c2f8a7b6 Suggest to use -m instead of /m when running build on Windows in README.
When running cmake --build from Bash via the MSYS2 terminal, the use of /m
causes the following error:

    $ cmake --build . --config Release -- /m
    Microsoft (R) Build Engine version 14.0.25420.1
    Copyright (C) Microsoft Corporation. All rights reserved.

    MSBUILD : error MSB1008: Only one project can be specified.
    Switch: M:/

    For switch syntax, type "MSBuild /help"

With -m, it works everywhere.
2018-01-15 19:32:02 +01:00
Peter Matula
e7d15c9d5d Merge branch 'all-in-one' 2018-01-15 17:17:10 +01:00
Peter Matula
f6089034cd CMake: add RETDEC_DEV_TOOLS option. 2018-01-15 16:08:10 +01:00
Peter Matula
632881f0d6 doc: move doxygen files to doc/doxygen. 2018-01-15 16:00:28 +01:00
Petr Zemek
ba197b6e99 Add the -jN parameter to make in README.
To build RetDec in parallel as not all users have e.g.

    export MAKEFLAGS="-j$(nproc)"

in their shell configuration files.
2018-01-15 14:10:28 +01:00
Peter Matula
9285f4e02d add all tools and libs to Repository Overview. 2018-01-15 14:09:36 +01:00
Petr Zemek
3342893c80 Simplify build instructions for Windows in README.
Instead of requiring a specific command prompt (MSBuild) and running

    msbuild /m /p:Configuration=Release retdec.sln
    msbuild /m /p:Configuration=Release INSTALL.vcxproj

we can just run the following commands from an arbitrary prompt:

    cmake --build . --config Release -- /m
    cmake --build . --config Release --target install
2018-01-15 13:56:32 +01:00
Peter Matula
0b13d79ddd deps/tinyxml: use patched tinyxml2 sources for now.
This will be reverted back to CMake external project once this pull
request is merged: https://github.com/leethomason/tinyxml2/pull/649
2018-01-15 13:29:05 +01:00
Petr Zemek
39b74bf554 Replace uses of CMAKE_FIND_LIBRARY_PREFIXES with CMAKE_STATIC_LIBRARY_PREFIX.
From https://cmake.org/cmake/help/latest/variable/CMAKE_FIND_LIBRARY_PREFIXES.html:

    This specifies what prefixes to add to library names when the
    find_library() command looks for libraries.

What we want is CMAKE_STATIC_LIBRARY_PREFIX:

    The prefix to use for the name of a static library, lib on UNIX.

Also, we are already using CMAKE_STATIC_LIBRARY_SUFFIX, so this change also
makes the used variables consistent.
2018-01-12 12:25:13 +01:00
Petr Zemek
3c761149e5 Set proper RPATH also for macOS + add a rationale behind it (#77).
On macOS, RPATH has to be set differently from Linux. For more details, see
https://cmake.org/Wiki/CMake_RPATH_handling
2018-01-12 12:19:47 +01:00
Petr Zemek
60436fb5bf Change the order of commands in the top-level CMakeLists.txt.
We want to first show available options, and only then set build settings.
2018-01-12 10:37:31 +01:00
Petr Zemek
e3d2c150c3 Remove unused dependent libraries for yaramod.
This fixes the build after commit 718a06ec37 (in
the new yaramod version, the tl-cpputils dependency no longer exists).
2018-01-12 10:34:04 +01:00
Petr Zemek
13365143f9 Remove useless cmake_minimum_required() command from nested CMakeLists.txt files.
We just need this command in the top-level CMakeLists.txt.
2018-01-12 09:20:33 +01:00
Petr Zemek
c3eaf064a0 Remove a useless project() command from deps/llvm/CMakeLists.txt.
We just need a top-level project in the top-level CMakeLists.txt.
2018-01-12 09:09:33 +01:00
Petr Zemek
9532d604f9 Add C into the top-level project() command in CMakeLists.txt.
Some parts of RetDec (e.g. libelf and libdwarf) require a C compiler, so we
should make this apparent in the top-level CMakeLists.txt.
2018-01-12 09:04:09 +01:00