#!/bin/sh
-TOPDIR="$(cd $(dirname $0); pwd)"
+TOPDIR="$(cd $(dirname $(which $0)); pwd)"
PKGADD=$TOPDIR/src/pkgadd
PKGMK_CONF=$TOPDIR/src/pkgmk.conf
$PKGADD -r $CLFS $@
+# we shoudl avoid .la files when crosscompiling, these files
+# contains the libdir variable hardcoded which is used by libtool
+[ $? -eq 0 ] && find $CLFS -type f -name '*.la' -delete
+
# End of file