LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   compiling 32bit programs in slackware64 (https://www.linuxquestions.org/questions/slackware-14/compiling-32bit-programs-in-slackware64-895642/)

animeresistance 08-04-2011 09:44 PM

compiling 32bit programs in slackware64
 
Hi there! :)

I'm trying to compile avahi, but i need it in 32 bit to install aldebaran's choregraphe 1.3.3 . I have a multilib slackware64, i had read alien bob's instructions on compiling 32 bit, looks easy. And i was wondering if this modified script is ok, or it needs something more.

Quote:

PRGNAM=avahi
VERSION=0.6.30
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

#Edicion variable ARCH

#ARCH=x86_64
ARCH=${ARCH:-x86_64}


if [ -z "$ARCH" ]; then
case "$( uname -m )" in
i?86) ARCH=i486 ;;
arm*) ARCH=arm ;;
*) ARCH=$( uname -m ) ;;
esac
fi

CWD=$(pwd)
TMP=${TMP:-/tmp/SBo}
PKG=$TMP/package-$PRGNAM
OUTPUT=${OUTPUT:-/tmp}

# Support for mono
if [ "${MONO:-no}" = "no" ]; then
MONO="--disable-mono"
else
MONO="--enable-mono"
fi

warn_accounts() {
echo " You must have an avahi user and group to run this script. "
echo " Something like this should suffice for most systems: "
echo " # groupadd -g 214 avahi"
echo " # useradd -u 214 -g 214 -c "Avahi" -d /dev/null -s /bin/false avahi"
exit 1
}

# Bail if user and/or group isn't valid on your system
if ! grep -q "^avahi:" /etc/passwd; then
warn_accounts
fi
if ! grep -q "^avahi:" /etc/group ; then
warn_accounts
fi

if [ "${ARCH}" = "i486" ]; then
SLKCFLAGS="-O2 -march=i486 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "i686" ]; then
SLKCFLAGS="-O2 -march=i686 -mtune=i686"
LIBDIRSUFFIX=""
elif [ "$ARCH" = "x86_64" ]; then
SLKCFLAGS="-O2 -fPIC"
LIBDIRSUFFIX=""
else
SLKCFLAGS="-O2"
LIBDIRSUFFIX=""
fi

set -e

rm -rf $PKG
mkdir -p $TMP $PKG $OUTPUT
cd $TMP
rm -rf $PRGNAM-$VERSION
tar xvf $CWD/$PRGNAM-$VERSION.tar.gz
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R a-s,u+w,go+r-w .

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
--prefix=/usr \
--libdir=/usr/lib${LIBDIRSUFFIX} \
--sysconfdir=/etc \
--localstatedir=/var \
--mandir=/usr/man \
--docdir=/usr/doc/$PRGNAM-$VERSION \
--disable-static \
--disable-monodoc \
--disable-autoipd \
--enable-python-dbus \
--enable-pygtk\
--enable-glib \
--enable-dbus \
--enable-python \
--enable-gtk \
--disable-gtk3 \
--enable-qt4 \
--disable-qt3 \
--enable-core-docs \
--enable-compat-howl \
--enable-compat-libdns_sd \
--with-dbus-sys=/etc/dbus-1/system.d \
--with-avahi-user=avahi \
--with-avahi-group=avahi \
--with-avahi-priv-access-group=netdev \
--with-distro=slackware \
--program-prefix= \
--program-suffix= \
--build=$ARCH-slackware-linux \
$MONO

make
make install DESTDIR=$PKG

find $PKG | xargs file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true

find $PKG/usr/man -type f -exec gzip -9 {} \;
for i in $(find $PKG/usr/man -type l); do ln -s $(readlink $i).gz $i.gz; rm $i; done

mv $PKG/etc/rc.d/rc.avahidaemon $PKG/etc/rc.d/rc.avahidaemon.new
mv $PKG/etc/rc.d/rc.avahidnsconfd $PKG/etc/rc.d/rc.avahidnsconfd.new
mv $PKG/etc/avahi/avahi-daemon.conf $PKG/etc/avahi/avahi-daemon.conf.new
mv $PKG/etc/dbus-1/system.d/avahi-dbus.conf \
$PKG/etc/dbus-1/system.d/avahi-dbus.conf.new

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a LICENSE docs/* $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild

mkdir -p $PKG/install
cat $CWD/slack-desc > $PKG/install/slack-desc
cat $CWD/doinst.sh > $PKG/install/doinst.sh

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}
Because Aldebaran's choregraphe installer says "wrong ELF class: ELFCLASS64" Wonder if i mixed the libraries :confused:

Any idea or comment is welcome:scratch:

ReaperX7 08-04-2011 10:01 PM

Try using "ARCH=i486 ./avahi.SlackBuild" with the vanilla SlackBuild script and see if it will build the 32-bit version that way. Only use "ARCH=x86_64" when you're doing a 64-bit build.

animeresistance 08-04-2011 10:36 PM

Hi ReaperX7

I tried to run the command you say, but it says "bash ./avahi.SlackBuild Permission denied" Wonder why, i'm running it with root user... :(

ReaperX7 08-04-2011 10:59 PM

Probably a permissions error. It's happens when you modify some files at times. Try running "chmod +x avahi.SlackBuild" and trying it again. Usually it's the permission to allow the file to be ran as an executable that gets weird and causes this. You can also Right Click it in the Desktop Environment, click the Permissions tab, and checking the box labeled "Executable".

animeresistance 08-05-2011 12:34 AM

Hi again ReaperX7.

I used the command "ARCH=i486 ./avahi.SlackBuild" with the vanilla SlackBuild script (i think the vanilla script is the original one from SlackBuilds) and it stops, an error message appears and says that C compiler cannot make executables.

The config.log says that the confdefs.h failed, that program generates a lot of data ..

Thanks for replying. I will continue looking tomorrow.

Any ideas, comments or suggestions are welcome.

Good night

phenixia2003 08-05-2011 03:11 AM

Hello,

Quote:

Originally Posted by animeresistance (Post 4434234)

I used the command "ARCH=i486 ./avahi.SlackBuild" with the vanilla SlackBuild script (i think the vanilla script is the original one from SlackBuilds) and it stops, an error message appears and says that C compiler cannot make executables.

The config.log says that the confdefs.h failed, that program generates a lot of data ..

Thanks for replying. I will continue looking tomorrow.

Any ideas, comments or suggestions are welcome.

Good night

As explained in Alien's wiki, when you need to compile 32-bit software, you first have to configure your shell environment using the command below:

Code:

. /etc/profile.d/32dev.sh
Cheers

--
SeB

animeresistance 08-05-2011 05:34 PM

Oh thanks ..

I read Alien Bob blog before, but i think i was too tired and frustated that i made a mistake, now it works.

Thanks a lot guys.

But how do i put the "solved" flag ?

animeresistance 08-05-2011 05:35 PM

i found it ... hehehehe ;)


All times are GMT -5. The time now is 05:49 AM.