Permalink
Show file tree
Hide file tree
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Merge pull request #37 from apache/configure-fdb-version
Configure FDB_API_VERSION dynamically, add full support for FDB 6.3.x
- Loading branch information
Showing
7 changed files
with
58 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@@ -0,0 +1,34 @@ | ||
% Hacky means to extract API version from fdbcli protocol version output | ||
% See https://github.com/apple/foundationdb/blob/master/flow/ProtocolVersion.h | ||
MaxAPIVersion = | ||
begin | ||
VsnInfo = os:cmd("fdbcli --version"), | ||
{match, [ProtocolStr]} = re:run(VsnInfo, "protocol ([a-f0-9]*)", [{capture, [1], list}]), | ||
ProtocolVsn = list_to_integer(ProtocolStr, 16), | ||
APIVersionBytes = (ProtocolVsn band 16#0000000FFF00000) bsr 20, | ||
integer_to_list(APIVersionBytes, 16) | ||
end. | ||
|
||
[{port_env, [ | ||
{ | ||
"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)", | ||
"CFLAGS", | ||
"$CFLAGS -I/usr/local/include -Ic_src/ -g -Wall -Werror -DFDB_API_VERSION=" ++ MaxAPIVersion | ||
}, | ||
{ | ||
"win32", | ||
"CFLAGS", | ||
"$CFLAGS /I\"c:/Program Files/foundationdb/include\" /O2 /DNDEBUG /DFDB_API_VERSION=" ++ MaxAPIVersion | ||
}, | ||
|
||
{ | ||
"(linux|solaris|freebsd|netbsd|openbsd|dragonfly|darwin|gnu)", | ||
"LDFLAGS", | ||
"$LDFLAGS -L/usr/local/lib -lfdb_c" | ||
}, | ||
{ | ||
"win32", | ||
"LDFLAGS", | ||
"$LDFLAGS /LIBPATH:\"c:/Program Files/foundationdb/lib/foundationdb\" fdb_c.lib" | ||
} | ||
]}] ++ CONFIG. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters