Skip to content

Commit

Permalink
26 escape.git.version.string (#27)
Browse files Browse the repository at this point in the history
* Workaround for gfortran not adding -D__APPLE__

Gfortran on Mac OS X does not add the __APPLE__ macro.  Updated the two Mac OS X templates to add this macro definition to the the Fortran preprocessor flags.

* Escape call to git-version-string in mkmf

Update the `-g` option to escape the double quote (`"`) in `mkmf` around 
the call to `git-version-string`.  This is to resolve the quote 
expansion of certain MPI compiler wrappers.

* Update git version test

The test for the git version string needed to be updated to match the update in mkmf to escape the string.
  • Loading branch information
underwoo authored Nov 12, 2019
1 parent 1342ed2 commit 1a60b1a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions bin/mkmf
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ sub ensureTrailingSlash {
local $/ = '/'; chomp @_[0]; @_[0] .= '/';
}

my $version = '19.3.0';
my $version = '19.3.1';

# initialize variables: use getopts for these
GetOptions("abspath|a=s" => \$opt_a,
Expand Down Expand Up @@ -142,7 +142,7 @@ if ( $opt_c ) {
}

if ( $opt_g ) {
$opt_c .= ' -D_FILE_VERSION="`git-version-string $<`"';
$opt_c .= ' -D_FILE_VERSION=\"`git-version-string $<`\"';
}

&print_formatted_list("CPPDEFS = $opt_c") if $opt_c;
Expand Down
2 changes: 1 addition & 1 deletion t/t003-mkmf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ teardown() {
run mkmf -g
[ "$status" -eq 0 ]
[ -e Makefile ]
regexString='^CPPDEFS = -D_FILE_VERSION="`git-version-string $<`"$'
regexString='^CPPDEFS = -D_FILE_VERSION=\\"`git-version-string $<`\\"$'
run grep -q "${regexString}" Makefile
[ "$status" -eq 0 ]
}
Expand Down

0 comments on commit 1a60b1a

Please sign in to comment.