Opened 5 years ago
Closed 5 years ago
#18722 closed defect (fixed)
./configure: Spaces in LD_LIBRARY_PATH should be : (colons) -> fixed after July 18 2019
| Reported by: | Lars Nordenström | Owned by: | |
|---|---|---|---|
| Component: | other | Version: | VirtualBox 6.0.8 |
| Keywords: | configure Qt LD_LIBRARY_PATH | Cc: | |
| Guest type: | other | Host type: | Linux |
Description
I have a separate locally build Qt, so when I configure I say
PKG_CONFIG_PATH=.../qt/pkgconfig LD_LIBRARY_PATH=.../qt/lib ./configure ...
On line 1525 of ./configure
LIBQT5="-L$LIBDIR5 $LIBQT5"
LIBQT5 is set to a value vith spaces in in (since LIBQT5 already has a value from pkgconfig in the line before).
LIBQT5 is then processed by strip_L and passed to test_execute_path. strip_L does not remove the embedded space.
The value is then used for LD_LIBRARY_PATH which now has a space as separator, not a colon.
Execution fails, causing configure to fail to recognize my local Qt installation.
My quick fix was (line 1529):
test_execute_path "`strip_L "$LIBQT5"|sed 's/ /:/g'`" nofatal ....
Source file is VirtualBox-6.0.8.tar.bz2
Change History (4)
comment:1 by , 5 years ago
comment:3 by , 5 years ago
| Summary: | ./configure: Spaces in LD_LIBRARY_PATH should be : (colons) → ./configure: Spaces in LD_LIBRARY_PATH should be : (colons) -> fixed after July 18 2019 |
|---|
No response, so I committed the change after checking that it does not break our own builds. It should be visible as r79836 in a few minutes.
comment:4 by , 5 years ago
| Resolution: | → fixed |
|---|---|
| Status: | new → closed |


Looks reasonable. What about the following patch based on your fix? And can I credit you in the change log if the patch works for you?
Index: configure =================================================================== --- configure (revision 131755) +++ configure (working copy) @@ -242,6 +242,11 @@ echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g' } +L_to_PATH() +{ + echo "$1"|$KBUILD_SED 's|-L\([^ ]\+\)|\1|g; s|^-[^L][^ ]*||g; s| -[^L][^ ]*||g; s|^ ||; s| *$||g; s| |:|g' +} + strip_I() { echo "$1"|$KBUILD_SED 's|-I\([^ ]\+\)|\1|g; s|^-[^I][^ ]*||g; s| -[^I][^ ]*||g; s|^ ||; s| *$||g' @@ -1532,7 +1537,7 @@ TOOLQT5=`pkg-config Qt5Core --variable=prefix` TOOLQT5BIN=`pkg-config Qt5Core --variable=host_bins` if test_compile "$LIBQT5 $LIBPTHREAD $FLGQT5" qt5 qt5 nofatal; then - test_execute_path "`strip_L "$LIBQT5"`" nofatal && foundqt5=3 # pkg-config + test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal && foundqt5=3 # pkg-config fi fi else @@ -1550,13 +1555,13 @@ LIBQT5="-L$q/lib -lQt5CoreVBox" TOOLQT5="$q" if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal && - test_execute_path "`strip_L "$LIBQT5"`" nofatal; then + test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then foundqt5=2 # internal break; fi LIBQT5="-L$q/lib -lQt5Core" if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal && - test_execute_path "`strip_L "$LIBQT5"`" nofatal; then + test_execute_path "`L_to_PATH "$LIBQT5"`" nofatal; then foundqt5=1 # no pkg-config, Qt directory break; fi @@ -1586,7 +1591,7 @@ EOF [ -n "$INCQT5" ] && I_INCQT5=`prefix_I "$INCQT5"` if test_compile "$LIBQT5 $LIBPTHREAD $I_INCQT5 $FLGQT5" qt5 qt5 nofatal; then - if test_execute_path "`strip_L "$LIBQT5"`"; then + if test_execute_path "`L_to_PATH "$LIBQT5"`"; then if [ "$OS" = "darwin" ]; then # Successful build & run the test application so add the necessary # params to AutoConfig.kmk: