File tree Expand file tree Collapse file tree 4 files changed +50
-11
lines changed Expand file tree Collapse file tree 4 files changed +50
-11
lines changed Original file line number Diff line number Diff line change @@ -550,9 +550,19 @@ CFG_LIBDIR_RELATIVE=lib
550550if [ " $CFG_OSTYPE " = " pc-windows-gnu" ]
551551then
552552 CFG_LIBDIR_RELATIVE=bin
553- fi
553+ CFG_LIBDIR=" ${CFG_PREFIX} /${CFG_LIBDIR_RELATIVE} "
554+ else
555+ valopt libdir " ${CFG_PREFIX} /${CFG_LIBDIR_RELATIVE} " " install libraries (ignored on windows platform)"
556+
557+ case " $CFG_LIBDIR " in
558+ " $CFG_PREFIX " /* ) CAT_INC=2;;
559+ " $CFG_PREFIX " * ) CAT_INC=1;;
560+ * )
561+ err " libdir must begin with the prefix. Use --prefix to set it accordingly." ;;
562+ esac
554563
555- valopt libdir " ${CFG_PREFIX} /${CFG_LIBDIR_RELATIVE} " " install libraries"
564+ CFG_LIBDIR_RELATIVE=` echo ${CFG_LIBDIR} | cut -c$(( ${# CFG_PREFIX} + ${CAT_INC} )) -`
565+ fi
556566
557567if [ $HELP -eq 1 ]
558568then
@@ -989,6 +999,15 @@ for h in $CFG_HOST
989999do
9901000 for t in $CFG_TARGET
9911001 do
1002+ # host lib dir stage0
1003+ make_dir $h /stage0/lib
1004+
1005+ # target bin dir stage0
1006+ make_dir $h /stage0/lib/rustlib/$t /bin
1007+
1008+ # target lib dir stage0
1009+ make_dir $h /stage0/lib/rustlib/$t /lib
1010+
9921011 for i in 0 1 2 3
9931012 do
9941013 # host bin dir
Original file line number Diff line number Diff line change @@ -332,7 +332,15 @@ define SREQ
332332# Destinations of artifacts for the host compiler
333333HROOT$(1 ) _H_$(3 ) = $(3 ) /stage$(1 )
334334HBIN$(1 ) _H_$(3 ) = $$(HROOT$(1 ) _H_$(3 ) ) /bin
335+ ifeq ($$(CFG_WINDOWSY_$(3 ) ) ,1)
335336HLIB$(1)_H_$(3) = $$(HROOT$(1 ) _H_$(3 ) ) /$$(CFG_LIBDIR_RELATIVE )
337+ else
338+ ifeq ($(1 ) ,0)
339+ HLIB$(1)_H_$(3) = $$(HROOT$(1 ) _H_$(3 ) ) /lib
340+ else
341+ HLIB$(1)_H_$(3) = $$(HROOT$(1 ) _H_$(3 ) ) /$$(CFG_LIBDIR_RELATIVE )
342+ endif
343+ endif
336344
337345# Destinations of artifacts for target architectures
338346TROOT$(1 ) _T_$(2 ) _H_$(3 ) = $$(HLIB$(1 ) _H_$(3 ) ) /rustlib/$(2 )
Original file line number Diff line number Diff line change 301301flag uninstall " only uninstall from the installation prefix"
302302opt verify 1 " verify that the installed binaries run correctly"
303303valopt prefix " /usr/local" " set installation prefix"
304- # NB This isn't quite the same definition as in `configure`.
305- # just using 'lib' instead of CFG_LIBDIR_RELATIVE
304+ # NB This is exactly the same definition as in `configure`.
306305valopt libdir " ${CFG_PREFIX} /${CFG_LIBDIR_RELATIVE} " " install libraries"
306+ case " $CFG_LIBDIR " in
307+ " $CFG_PREFIX " /* ) CAT_INC=2;;
308+ " $CFG_PREFIX " * ) CAT_INC=1;;
309+ * )
310+ err " libdir must begin with the prefix. Use --prefix to set it accordingly." ;;
311+ esac
312+ CFG_LIBDIR_RELATIVE=` echo ${CFG_LIBDIR} | cut -c$(( ${# CFG_PREFIX} + ${CAT_INC} )) -`
313+
307314valopt mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
308315
309316if [ $HELP -eq 1 ]
@@ -428,9 +435,9 @@ while read p; do
428435 # Decide the destination of the file
429436 FILE_INSTALL_PATH=" ${CFG_PREFIX} /$p "
430437
431- if echo " $p " | grep " ^lib /" > /dev/null
438+ if echo " $p " | grep " ^${CFG_LIBDIR_RELATIVE} /" > /dev/null
432439 then
433- pp=` echo $p | sed ' s/^lib\/// ' `
440+ pp=` echo $p | sed " s%^ ${CFG_LIBDIR_RELATIVE} /%% " `
434441 FILE_INSTALL_PATH=" ${CFG_LIBDIR} /$pp "
435442 fi
436443
Original file line number Diff line number Diff line change @@ -255,11 +255,16 @@ fn find_libdir(sysroot: &Path) -> String {
255255 // to lib64/lib32. This would be more foolproof by basing the sysroot off
256256 // of the directory where librustc is located, rather than where the rustc
257257 // binary is.
258-
259- if sysroot. join ( primary_libdir_name ( ) ) . join ( rustlibdir ( ) ) . exists ( ) {
260- return primary_libdir_name ( ) ;
261- } else {
262- return secondary_libdir_name ( ) ;
258+ //If --libdir is set during configuration to the value other than
259+ // "lib" (i.e. non-default), this value is used (see issue #16552).
260+
261+ match option_env ! ( "CFG_LIBDIR_RELATIVE" ) {
262+ Some ( libdir) if libdir != "lib" => return libdir. to_string ( ) ,
263+ _ => if sysroot. join ( primary_libdir_name ( ) ) . join ( rustlibdir ( ) ) . exists ( ) {
264+ return primary_libdir_name ( ) ;
265+ } else {
266+ return secondary_libdir_name ( ) ;
267+ }
263268 }
264269
265270 #[ cfg( target_word_size = "64" ) ]
You can’t perform that action at this time.
0 commit comments