SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Just out of curiosity, why do you remove the Config.sh and Policy.sh scripts from the source tree?
As for the error, for some reason the configure script is looking for a C compiler called 'cc', when I believe that it *should* be looking for 'gcc'. Interesting error. I'm wondering if perl's source tree is OS independant, and you may need to tweak the configure script (or an environment variable) to get it to work properly.
Out of curiosity, why are you trying to build from source? I know slack packages exist for perl, and there is probably little to be gained out of compiling from source, other than the experience.
#!/bin/sh
# Build and install Perl on Slackware
# originally by: David Cantrell <david@slackware.com>
# maintained by: <volkerdi@slackware.com>
CWD=`pwd`
TMP=/tmp
PKG=$TMP/package-perl
VERSION=5.8.5
# IMPORTANT: also update -Dinc_version_list in ./configure below!
ARCH=${ARCH:-i486}
BUILD=2
# Additional required modules:
DBI=1.43
DBDMYSQL=2.9004
XMLPARSER=2.34
if [ "$ARCH" = "i386" ]; then
SLKCFLAGS="-O2 -march=i386 -mcpu=i686"
elif [ "$ARCH" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mcpu=i686"
elif [ "$ARCH" = "s390" ]; then
SLKCFLAGS="-O2"
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2"
fi
if [ -x /usr/bin/perl ]; then
echo "Perl detected."
echo
echo "It's a good idea to remove your existing perl first."
echo
sleep 15
fi
# Clear build location:
rm -rf $PKG
mkdir -p $PKG
# Extract the source code:
cd $TMP
rm -rf perl-$VERSION
tar xjvf $CWD/perl-$VERSION.tar.bz2
# Change into the source directory:
cd perl-$VERSION
# Adjust owner/perms to standard values:
chown -R root.root .
find . -perm 555 -exec chmod 755 {} \;
find . -perm 444 -exec chmod 644 {} \;
# It is often suggested that we add this to the ./Configure:
# -Dusethreads -Duseithreads \
# However, this option is considered experimental, and is not
# recommended for production systems. As such, we can't add
# to our default perl build. If you want the option anyway,
# just uncomment the lines below and rebuild perl.
#
# Update: while it's no longer considered experimental (and
# yes, other vendors do ship threaded perl by default), enabling
# threads causes a huge (>20%) performance hit, and I've seen
# other reports of instability. A few things "need" perl threads
# but usually that's simply because they were compiled against
# a threaded libperl... not any real need. IMHO, shipping a
# threaded perl by default would not be a good idea. It's only
# because everyone else does it that it's continually
# reconsidered here.
#USE_THREADS="-Dusethreads -Duseithreads"
# We no longer include suidperl. To quote the INSTALL file:
#
# Because of the buggy history of suidperl, and the difficulty
# of properly security auditing as large and complex piece of
# software as Perl, we cannot recommend using suidperl and the feature
# should be considered deprecated.
# Instead use for example 'sudo': http://www.courtesan.com/sudo/
# Configure perl:
./Configure -de \
-Dprefix=/usr \
-Dcccdlflags='-fPIC' \
-Dinstallprefix=/usr \
-Doptimize="$SLKCFLAGS" \
$USE_THREADS \
-Dinc_version_list='5.8.4 5.8.3 5.8.2 5.8.1 5.8.0' \
-Darchname=$ARCH-linux
# Build perl
make -j3
make test
# Install perl (needed to build modules):
make install
( cd /usr/bin
ln -sf perl$VERSION perl
ln -sf c2ph pstruct
ln -sf s2p psed
)
# Install perl package:
make install DESTDIR=$PKG
# Add additional modules:
( cd ext
( tar xzvf $CWD/DBI-${DBI}.tar.gz
cd DBI-${DBI}
chown -R root.root .
perl Makefile.PL
make
make test
make install
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/perl-$VERSION/DBI-${DBI}
cp -a README $PKG/usr/doc/perl-$VERSION/DBI-${DBI}
chmod 644 $PKG/usr/doc/perl-$VERSION/DBI-${DBI}/README
)
( tar xzvf $CWD/DBD-mysql-${DBDMYSQL}.tar.gz
cd DBD-mysql-${DBDMYSQL}
chown -R root.root .
perl Makefile.PL
make
make test
make install
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}
cp -a INSTALL.html README TODO $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}
chmod 644 $PKG/usr/doc/perl-$VERSION/DBD-mysql-${DBDMYSQL}/*
)
( tar xzvf $CWD/XML-Parser-${XMLPARSER}.tar.gz
cd XML-Parser-${XMLPARSER}
chown -R root.root .
perl Makefile.PL
make
make test
make install
make install DESTDIR=$PKG
mkdir -p $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}
cp -a README $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}
chmod 644 $PKG/usr/doc/perl-$VERSION/XML-Parser-${XMLPARSER}/*
)
)
# Strip everything:
( cd $PKG
find . | xargs file | grep "executable" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
find . | xargs file | grep "shared object" | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null
)
# There are also miniperl and microperl.
# I haven't had any requests for them, but would be willing
# to consider adding one or both to the package if anyone
# actually needs them for some reason.
#make microperl
# Symlinks that replace hard links
( cd $PKG/usr/bin
ln -sf perl$VERSION perl
ln -sf c2ph pstruct
ln -sf s2p psed )
# Install documentation
mkdir -p $PKG/usr/doc/perl-$VERSION
cp -a \
AUTHORS Artistic Copying INSTALL MANIFEST README README.Y2K README.cn README.jp README.ko README.micro README.tw Todo.micro \
$PKG/usr/doc/perl-$VERSION
# We follow LSB with symlinks in /usr/share:
( cd $PKG/usr/share
mv man .. )
( cd $PKG/usr/man/man1
mkdir foo
cp *.1 foo
rm *.1
mv foo/* .
rmdir foo
gzip -9 *
ln -sf c2ph.1.gz pstruct.1.gz
ln -sf s2p.1.gz psed.1.gz )
( cd $PKG/usr/man/man3
gzip -9 * )
chown -R root.bin $PKG/usr/bin
chmod 755 $PKG/usr/bin/*
chmod 644 $PKG/usr/man/man?/*
rmdir $PKG/usr/share
# Insert the slack-desc:
mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
# Build the package:
cd $PKG
makepkg -l y -c n $TMP/perl-$VERSION-$ARCH-$BUILD.tgz
Hope you can makeout what's wrong with your method...
2. i traced the problem to dependencies. to remedy this, i re-installed make. in addition, i installed binutils and kernel-headers. the source did compile thereafter.
3. on why compile from the source when a slack package is available. i use slack packages most of the time. in fact, aside from the base components, i installed everything using packages i downloaded from the slack website. but it helps to know how to compile from the source because (1) the foss community as a whole moves faster than slackware and slackware may not have the components we need in packages we can use with installpkg the moment we think of installing them and (2) perl is one of two scripting languages i am now using. there are bonuses to learning to compile it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.