-
Notifications
You must be signed in to change notification settings - Fork 1.1k
dev: support multiarch names (Debian based systems) #5626
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,16 +36,16 @@ end. | |
CouchJSPath = filename:join(["priv", CouchJSName]). | ||
Version = case os:getenv("COUCHDB_VERSION") of | ||
false -> | ||
string:strip(os:cmd("git describe --always"), right, $\n); | ||
string:trim(os:cmd("git describe --always")); | ||
Version0 -> | ||
string:strip(Version0, right) | ||
string:trim(Version0) | ||
end. | ||
|
||
GitSha = case os:getenv("COUCHDB_GIT_SHA") of | ||
false -> | ||
""; % release builds won\'t get a fallback | ||
GitSha0 -> | ||
string:strip(GitSha0, right) | ||
string:trim(GitSha0) | ||
end. | ||
|
||
CouchConfig = case filelib:is_file(os:getenv("COUCHDB_CONFIG")) of | ||
|
@@ -151,6 +151,25 @@ ProperConfig = case code:lib_dir(proper) of | |
_ -> [{d, 'WITH_PROPER'}] | ||
end. | ||
|
||
DpkgArchitectureCmd = "dpkg-architecture -q DEB_HOST_MULTIARCH". | ||
GenericMozJSIncludePaths = "-I/usr/include/mozjs-" ++ SMVsn ++ " -I/usr/local/include/mozjs-" ++ SMVsn. | ||
GenericMozJSLibPaths = "-L/usr/local/lib -L/opt/homebrew/lib". | ||
|
||
WithDpkgArchitecture = case os:find_executable("dpkg-architecture") of | ||
false -> false; | ||
_ -> true | ||
end. | ||
|
||
MozJSIncludePath = case WithDpkgArchitecture of | ||
false -> GenericMozJSIncludePaths; | ||
true -> GenericMozJSIncludePaths ++ " -I/usr/include/" ++ string:trim(os:cmd(DpkgArchitectureCmd)) ++ "/mozjs-" ++ SMVsn | ||
end. | ||
|
||
MozJSLibPath = case WithDpkgArchitecture of | ||
false -> GenericMozJSLibPaths; | ||
true -> GenericMozJSLibPaths ++ " -L/usr/lib/" ++ string:trim(os:cmd(DpkgArchitectureCmd)) | ||
end. | ||
|
||
% The include directories (parameters for the `-I` C compiler flag) are | ||
% considered in the `configure` script as a pre-check for their existence. | ||
% Please keep them in sync. | ||
|
@@ -195,45 +214,20 @@ end. | |
"-DXP_UNIX -I/usr/include/mozjs-86 -I/usr/local/include/mozjs-86 -I/opt/homebrew/include/mozjs-86/ -std=c++17 -Wno-invalid-offsetof", | ||
"-L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-86 -lm" | ||
}; | ||
{unix, _} when SMVsn == "91" -> | ||
{ | ||
"$CFLAGS -DXP_UNIX -I/usr/include/mozjs-91 -I/usr/local/include/mozjs-91 -I/opt/homebrew/include/mozjs-91/ -std=c++17 -Wno-invalid-offsetof", | ||
"$LDFLAGS -L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-91 -lm" | ||
}; | ||
{unix, _} when SMVsn == "102" -> | ||
{ | ||
"$CFLAGS -DXP_UNIX -I/usr/include/mozjs-102 -I/usr/local/include/mozjs-102 -I/opt/homebrew/include/mozjs-102/ -std=c++17 -Wno-invalid-offsetof", | ||
"$LDFLAGS -L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-102 -lm" | ||
}; | ||
{unix, _} when SMVsn == "115" -> | ||
{ | ||
"$CFLAGS -DXP_UNIX -I/usr/include/mozjs-115 -I/usr/local/include/mozjs-115 -I/opt/homebrew/include/mozjs-115/ -std=c++17 -Wno-invalid-offsetof", | ||
"$LDFLAGS -L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-115 -lm" | ||
}; | ||
{unix, _} when SMVsn == "128" -> | ||
{unix, _} when SMVsn == "91"; SMVsn == "102"; SMVsn == "115"; SMVsn == "128" -> | ||
Comment on lines
-198
to
+217
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Very nice cleanup! |
||
{ | ||
"$CFLAGS -DXP_UNIX -I/usr/include/mozjs-128 -I/usr/local/include/mozjs-128 -I/opt/homebrew/include/mozjs-128/ -std=c++17 -Wno-invalid-offsetof", | ||
"$LDFLAGS -L/usr/local/lib -L /opt/homebrew/lib/ -std=c++17 -lmozjs-128 -lm" | ||
"$CFLAGS -DXP_UNIX " ++ MozJSIncludePath ++ " -std=c++17 -Wno-invalid-offsetof", | ||
"$LDFLAGS " ++ MozJSLibPath ++ " -std=c++17 -lm -lmozjs-" ++ SMVsn | ||
}; | ||
{win32, _} when SMVsn == "91" -> | ||
{ | ||
"/std:c++17 /DXP_WIN", | ||
"$LDFLAGS mozjs-91.lib" | ||
}; | ||
{win32, _} when SMVsn == "102" -> | ||
{ | ||
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8", | ||
"$LDFLAGS mozjs-102.lib" | ||
}; | ||
{win32, _} when SMVsn == "115" -> | ||
{ | ||
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8", | ||
"$LDFLAGS mozjs-115.lib" | ||
}; | ||
{win32, _} when SMVsn == "128" -> | ||
{win32, _} when SMVsn == "102"; SMVsn == "115"; SMVsn == "128" -> | ||
{ | ||
"/std:c++17 /DXP_WIN /Zc:preprocessor /utf-8", | ||
"$LDFLAGS mozjs-128.lib" | ||
"$LDFLAGS mozjs-" ++ SMVsn ++ ".lib" | ||
} | ||
end. | ||
|
||
|
@@ -273,12 +267,12 @@ end. | |
|
||
IcuIncludePath = case WithBrew of | ||
false -> GenericIcuIncludePaths; | ||
true -> "-I" ++ string:strip(os:cmd(BrewIcuPrefixCmd), right, $\n) ++ "/include" | ||
true -> "-I" ++ string:trim(os:cmd(BrewIcuPrefixCmd)) ++ "/include" | ||
end. | ||
|
||
IcuLibPath = case WithBrew of | ||
false -> GenericIcuLibPaths; | ||
true -> "-L" ++ string:strip(os:cmd(BrewIcuPrefixCmd), right, $\n) ++ "/lib" | ||
true -> "-L" ++ string:trim(os:cmd(BrewIcuPrefixCmd)) ++ "/lib" | ||
end. | ||
|
||
IcuEnv = [{"DRV_CFLAGS", "$DRV_CFLAGS -DPIC -O2 -fno-common"}, | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is run unconditionally (on every OS), probably that is what causes
configure
to fail on macOS (and on other non-Debian systems).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but it wouldn't break the build here. The fail on macOS was through a missing path. It will be fixed in #5657.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh,
true
.