File tree 4 files changed +50
-11
lines changed
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
550
550
if [ " $CFG_OSTYPE " = " pc-windows-gnu" ]
551
551
then
552
552
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
554
563
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
556
566
557
567
if [ $HELP -eq 1 ]
558
568
then
@@ -989,6 +999,15 @@ for h in $CFG_HOST
989
999
do
990
1000
for t in $CFG_TARGET
991
1001
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
+
992
1011
for i in 0 1 2 3
993
1012
do
994
1013
# host bin dir
Original file line number Diff line number Diff line change @@ -332,7 +332,15 @@ define SREQ
332
332
# Destinations of artifacts for the host compiler
333
333
HROOT$(1 ) _H_$(3 ) = $(3 ) /stage$(1 )
334
334
HBIN$(1 ) _H_$(3 ) = $$(HROOT$(1 ) _H_$(3 ) ) /bin
335
+ ifeq ($$(CFG_WINDOWSY_$(3 ) ) ,1)
335
336
HLIB$(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
336
344
337
345
# Destinations of artifacts for target architectures
338
346
TROOT$(1 ) _T_$(2 ) _H_$(3 ) = $$(HLIB$(1 ) _H_$(3 ) ) /rustlib/$(2 )
Original file line number Diff line number Diff line change 301
301
flag uninstall " only uninstall from the installation prefix"
302
302
opt verify 1 " verify that the installed binaries run correctly"
303
303
valopt 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`.
306
305
valopt 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
+
307
314
valopt mandir " ${CFG_PREFIX} /share/man" " install man pages in PATH"
308
315
309
316
if [ $HELP -eq 1 ]
@@ -428,9 +435,9 @@ while read p; do
428
435
# Decide the destination of the file
429
436
FILE_INSTALL_PATH=" ${CFG_PREFIX} /$p "
430
437
431
- if echo " $p " | grep " ^lib /" > /dev/null
438
+ if echo " $p " | grep " ^${CFG_LIBDIR_RELATIVE} /" > /dev/null
432
439
then
433
- pp=` echo $p | sed ' s/^lib\/// ' `
440
+ pp=` echo $p | sed " s%^ ${CFG_LIBDIR_RELATIVE} /%% " `
434
441
FILE_INSTALL_PATH=" ${CFG_LIBDIR} /$pp "
435
442
fi
436
443
Original file line number Diff line number Diff line change @@ -255,11 +255,16 @@ fn find_libdir(sysroot: &Path) -> String {
255
255
// to lib64/lib32. This would be more foolproof by basing the sysroot off
256
256
// of the directory where librustc is located, rather than where the rustc
257
257
// 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
+ }
263
268
}
264
269
265
270
#[ cfg( target_word_size = "64" ) ]
You can’t perform that action at this time.
0 commit comments