if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "s390x" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
if [ ! -d $TMP ]; then
mkdir -p $TMP
fi
rm -rf $PKG
mkdir -p $PKG
cd $TMP
rm -rf m4-$VERSION
tar xjvf $CWD/m4-$VERSION.tar.bz2
cd m4-$VERSION
chown -R root:root .
find . -perm 777 -exec chmod 755 {} \;
find . -perm 664 -exec chmod 644 {} \;
CFLAGS="$SLKCFLAGS" \
/configure \
--prefix=/usr \
--mandir=/usr/man \
--infodir=/usr/info \
$ARCH-slackware-linux
make -j3 || exit 1
make install DESTDIR=$PKG
# Compress and if needed symlink the man pages:
if [ -d $PKG/usr/man ]; then
( cd $PKG/usr/man
for manpagedir in $(find . -type d -name "man*") ; do
( cd $manpagedir
for eachpage in $( find . -type l -maxdepth 1) ; do
ln -s $( readlink $eachpage ).gz $eachpage.gz
rm $eachpage
done
gzip -9 *.?
)
done
)
fi
# Compress info pages and purge "dir" file from the package:
if [ -d $PKG/usr/info ]; then
( cd $PKG/usr/info
rm -f dir
gzip -9 *
)
fi
# ye olde cruft
#
# ansi2knr is no longer part of the m4 sources.
# Geez, I'm gonna have to learn ANSI C now...
#
#( cd src ; make ansi2knr )
#gzip -9 $PKG/usr/info/m4.info.gz
#cat src/m4 > $PKG/usr/bin/m4
#chmod 755 $PKG/usr/bin/*