-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Add support for --bindir and remember the relative locations of bindir and libdir vs prefix (ie: sysroot) #19065
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
Changes from all commits
e9a22fb
a8bb6cf
846a567
0612ce2
0cd38a8
1e2044e
09fdc1a
8a273a8
370101c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -116,7 +116,7 @@ $$(TBIN$(1)_T_$(2)_H_$(3))/$(4)$$(X_$(2)): \ | |
$$(foreach dep,$$(TOOL_DEPS_$(4)), \ | ||
$$(TLIB$(1)_T_$(2)_H_$(3))/stamp.$$(dep)) \ | ||
$$(TSREQ$(1)_T_$(2)_H_$(3)) \ | ||
| $$(TBIN$(1)_T_$(4)_H_$(3))/ | ||
| $$(TBIN$(1)_T_$(2)_H_$(3))/ | ||
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. I'm... not sure how this ever worked! |
||
@$$(call E, rustc: $$@) | ||
$$(STAGE$(1)_T_$(2)_H_$(3)) -o $$@ $$< --cfg $(4) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -285,6 +285,8 @@ then | |
CFG_LIBDIR_RELATIVE=bin | ||
fi | ||
|
||
CFG_BINDIR_RELATIVE=bin | ||
|
||
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ] | ||
then | ||
CFG_LD_PATH_VAR=PATH | ||
|
@@ -304,6 +306,7 @@ valopt prefix "/usr/local" "set installation prefix" | |
# NB This isn't quite the same definition as in `configure`. | ||
# just using 'lib' instead of CFG_LIBDIR_RELATIVE | ||
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries" | ||
valopt bindir "${CFG_PREFIX}/${CFG_BINDIR_RELATIVE}" "install binaries" | ||
valopt mandir "${CFG_PREFIX}/share/man" "install man pages in PATH" | ||
|
||
if [ $HELP -eq 1 ] | ||
|
@@ -424,6 +427,7 @@ need_ok "failed to create installed manifest" | |
|
||
# Now install, iterate through the new manifest and copy files | ||
while read p; do | ||
is_bin=false | ||
|
||
# Decide the destination of the file | ||
FILE_INSTALL_PATH="${CFG_PREFIX}/$p" | ||
|
@@ -434,6 +438,13 @@ while read p; do | |
FILE_INSTALL_PATH="${CFG_LIBDIR}/$pp" | ||
fi | ||
|
||
if echo "$p" | grep "^bin/" > /dev/null | ||
then | ||
is_bin=true | ||
pp=`echo $p | sed 's/^bin\///'` | ||
FILE_INSTALL_PATH="${CFG_BINDIR}/$pp" | ||
fi | ||
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. If I configure my bindir as 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. It will. I have some more fixes for this in testing. Should be updating this PR at some point soon. 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. using different libdirs between the configure command and the install command will also result in wierdness, a known bug. All the possible permutations here scare me. I think in an ideal world I would prefer that the build always uses a consistent directory layout, even on windows, and only change the layout on install, but that might require deeper changes. |
||
|
||
if echo "$p" | grep "^share/man/" > /dev/null | ||
then | ||
pp=`echo $p | sed 's/^share\/man\///'` | ||
|
@@ -451,7 +462,7 @@ while read p; do | |
|
||
# Install the file | ||
msg "${FILE_INSTALL_PATH}" | ||
if echo "$p" | grep "^bin/" > /dev/null | ||
if $is_bin | ||
then | ||
install -m755 "${CFG_SRC_DIR}/$p" "${FILE_INSTALL_PATH}" | ||
else | ||
|
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.
Both my linux machine and my OSX machine don't have this command, so it may not be common enough to require. There are some snippets in #16552 which may be useful, however.
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.
Ok, I'll look into alternatives to calculate the relative paths.