提交 3d9e3a30 编写于 作者: R Rich Felker

fix "configure --prefix=" and improve path/arg handling in configure

previously, empty string was treated as "use default". this is
apparently not compatible with standard configure semantics where an
empty prefix puts everything under /. the new logic should be a lot
cleaner and not suffer from such issues.
上级 efd4d87a
...@@ -50,9 +50,8 @@ fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } ...@@ -50,9 +50,8 @@ fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; }
cmdexists () { type "$1" >/dev/null 2>&1 ; } cmdexists () { type "$1" >/dev/null 2>&1 ; }
trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; }
setdir () { stripdir () {
if eval "test -z \"\${$1}\"" ; then eval "$1=\$2" while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done
else eval "fnmatch '*/' \"\${$1}\"" && eval "$1=\${$1%/}" ; fi
} }
tryflag () { tryflag () {
...@@ -90,15 +89,15 @@ fi ...@@ -90,15 +89,15 @@ fi
CFLAGS_C99FSE= CFLAGS_C99FSE=
CFLAGS_AUTO= CFLAGS_AUTO=
LDFLAGS_AUTO= LDFLAGS_AUTO=
prefix= prefix=/usr/local/musl
exec_prefix= exec_prefix='$(prefix)'
bindir= bindir='$(exec_prefix)/bin'
libdir= libdir='$(prefix)/lib'
includedir= includedir='$(prefix)/include'
syslibdir= syslibdir='/lib'
target= target=
debug=no debug=no
warnings= warnings=no
shared=yes shared=yes
static=yes static=yes
...@@ -135,12 +134,9 @@ LIBCC=*) LIBCC=${arg#*=} ;; ...@@ -135,12 +134,9 @@ LIBCC=*) LIBCC=${arg#*=} ;;
esac esac
done done
setdir prefix /usr/local/musl for i in prefix exec_prefix bindir libdir includedir syslibdir ; do
setdir exec_prefix '$(prefix)' stripdir $i
setdir bindir '$(exec_prefix)/bin' done
setdir libdir '$(prefix)/lib'
setdir includedir '$(prefix)/include'
setdir syslibdir '/lib'
# #
# Get a temp filename we can use # Get a temp filename we can use
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册