diff options
author | Rich Felker <dalias@aerifal.cx> | 2012-11-08 17:20:50 -0500 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2012-11-08 17:20:50 -0500 |
commit | 3d9e3a309f794faf0df53c00b15d406f14931938 (patch) | |
tree | ab939f1df5988e1ea3651096da4fc0a834fe88e6 | |
parent | efd4d87aa472523b07889af69874259db43b3c3c (diff) | |
download | musl-3d9e3a309f794faf0df53c00b15d406f14931938.tar.gz musl-3d9e3a309f794faf0df53c00b15d406f14931938.tar.bz2 musl-3d9e3a309f794faf0df53c00b15d406f14931938.tar.xz musl-3d9e3a309f794faf0df53c00b15d406f14931938.zip |
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.
-rwxr-xr-x | configure | 28 |
1 files changed, 12 insertions, 16 deletions
@@ -50,9 +50,8 @@ fnmatch () { eval "case \"\$2\" in $1) return 0 ;; *) return 1 ;; esac" ; } cmdexists () { type "$1" >/dev/null 2>&1 ; } trycc () { test -z "$CC" && cmdexists "$1" && CC=$1 ; } -setdir () { -if eval "test -z \"\${$1}\"" ; then eval "$1=\$2" -else eval "fnmatch '*/' \"\${$1}\"" && eval "$1=\${$1%/}" ; fi +stripdir () { +while eval "fnmatch '*/' \"\${$1}\"" ; do eval "$1=\${$1%/}" ; done } tryflag () { @@ -90,15 +89,15 @@ fi CFLAGS_C99FSE= CFLAGS_AUTO= LDFLAGS_AUTO= -prefix= -exec_prefix= -bindir= -libdir= -includedir= -syslibdir= +prefix=/usr/local/musl +exec_prefix='$(prefix)' +bindir='$(exec_prefix)/bin' +libdir='$(prefix)/lib' +includedir='$(prefix)/include' +syslibdir='/lib' target= debug=no -warnings= +warnings=no shared=yes static=yes @@ -135,12 +134,9 @@ LIBCC=*) LIBCC=${arg#*=} ;; esac done -setdir prefix /usr/local/musl -setdir exec_prefix '$(prefix)' -setdir bindir '$(exec_prefix)/bin' -setdir libdir '$(prefix)/lib' -setdir includedir '$(prefix)/include' -setdir syslibdir '/lib' +for i in prefix exec_prefix bindir libdir includedir syslibdir ; do +stripdir $i +done # # Get a temp filename we can use |