diff core/xz/xz.sh @ 91:c430ad34da57

core/xz: add NLS option and cleanup
author David Demelier <markand@malikania.fr>
date Thu, 07 Mar 2019 20:36:00 +0100
parents 84adb4e6e761
children e737b80da269
line wrap: on
line diff
--- a/core/xz/xz.sh	Thu Mar 07 20:30:00 2019 +0100
+++ b/core/xz/xz.sh	Thu Mar 07 20:36:00 2019 +0100
@@ -15,24 +15,32 @@
 # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
 #
 
+: ${CHOST:=$(uname -m)-linux-musl}
+: ${CBUILD:=$(uname -m)-linux-musl}
+: ${CC:=gcc}
+: ${CFLAGS:=-O2}
+
 source ./xz.info
 
-case $(uname -m) in
-x86_64)
-	CFLAGS="-O2 -fPIC"
-	;;
-*)
-	CFLAGS="-O2"
-	;;
-esac
+set -ex
 
-set -e
+if [ "${NLS:-yes}" = "no" ]; then
+	with_nls="--disable-nls"
+else
+	with_nls="--enable-nls"
+fi
 
 rm -rf $PKGNAME-$PKGVERSION
 tar xvaf $PKGNAME-$PKGVERSION.tar.gz
 pushd $PKGNAME-$PKGVERSION
 
-CFLAGS="$CFLAGS" ./configure --prefix=/usr --disable-static
+./configure \
+	--build=${CBUILD} \
+	--host=${CHOST} \
+	--prefix=/usr \
+	--disable-static \
+	--enable-shared \
+	${with_nls}
 make
 make install DESTDIR=$DESTDIR
 rm -f $DESTDIR/usr/lib/liblzma.la