LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices

Reply
 
Search this Thread
Old 08-04-2011, 09:44 PM   #1
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 191

Rep: Reputation: 20
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

Any idea or comment is welcome
 
Old 08-04-2011, 10:01 PM   #2
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,218
Blog Entries: 15

Rep: Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832
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.
 
Old 08-04-2011, 10:36 PM   #3
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 191

Original Poster
Rep: Reputation: 20
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...
 
Old 08-04-2011, 10:59 PM   #4
ReaperX7
Senior Member
 
Registered: Jul 2011
Distribution: LFS-SVN, FreeBSD 10.0
Posts: 3,218
Blog Entries: 15

Rep: Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832Reputation: 832
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".
 
Old 08-05-2011, 12:34 AM   #5
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 191

Original Poster
Rep: Reputation: 20
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
 
Old 08-05-2011, 03:11 AM   #6
phenixia2003
Member
 
Registered: May 2006
Location: France
Distribution: Slackware
Posts: 291

Rep: Reputation: 166Reputation: 166
Hello,

Quote:
Originally Posted by animeresistance View Post

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
 
Old 08-05-2011, 05:34 PM   #7
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 191

Original Poster
Rep: Reputation: 20
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 ?
 
Old 08-05-2011, 05:35 PM   #8
animeresistance
Member
 
Registered: Feb 2004
Distribution: Slackware
Posts: 191

Original Poster
Rep: Reputation: 20
i found it ... hehehehe
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Fedora 13 32bit and then Linux Mint 32bit and then Ubuntu 10.04 32bit ciao303 Linux - Newbie 3 08-09-2010 11:03 PM
32bit programs on amd64 Mig21 Slackware 8 08-16-2009 04:55 PM
Do you require 32bit compatibility in Slackware64-current? samac Slackware 43 06-20-2009 02:47 PM
Installing 32bit programs on amd64 (lenny) war1025 Debian 2 03-29-2008 02:28 PM
g++: No 64bit programs compiled, 32bit instead? Grife Programming 2 07-23-2007 07:53 PM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration