Skip to content

Commit 6ffb7f0

Browse files
committed
fix for PR#16552 implementation on windows: CFG_LIBDIR should be always set in configure variables
1 parent 22513fe commit 6ffb7f0

File tree

1 file changed

+14
-10
lines changed

1 file changed

+14
-10
lines changed

configure

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -546,22 +546,26 @@ CFG_TARGET=$(to_llvm_triple $CFG_TARGET)
546546
# there's no rpath. This is where the build system itself puts libraries;
547547
# --libdir is used to configure the installation directory.
548548
# FIXME: This needs to parameterized over target triples. Do it in platform.mk
549-
CFG_LIBDIR_RELATIVE=lib
550549
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ]
551550
then
552551
CFG_LIBDIR_RELATIVE=bin
553-
CFG_LIBDIR="${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}"
554552
else
555-
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (ignored on windows platform)"
553+
CFG_LIBDIR_RELATIVE=lib
554+
fi
556555

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
556+
valopt libdir "${CFG_PREFIX}/${CFG_LIBDIR_RELATIVE}" "install libraries (do not set it on windows platform)"
557+
558+
case "$CFG_LIBDIR" in
559+
"$CFG_PREFIX"/*) CAT_INC=2;;
560+
"$CFG_PREFIX"*) CAT_INC=1;;
561+
*)
562+
err "libdir must begin with the prefix. Use --prefix to set it accordingly.";;
563+
esac
564+
565+
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
563566

564-
CFG_LIBDIR_RELATIVE=`echo ${CFG_LIBDIR} | cut -c$((${#CFG_PREFIX}+${CAT_INC}))-`
567+
if [ "$CFG_OSTYPE" = "pc-windows-gnu" ] && [ "$CFG_LIBDIR_RELATIVE" != "bin" ]; then
568+
err "libdir on windows should be set to 'bin'"
565569
fi
566570

567571
if [ $HELP -eq 1 ]

0 commit comments

Comments
 (0)