Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Mon 28 Jul 2014, 18:59
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
How to compile urxvt? (and make it small!)
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Author Message
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Sun 28 Aug 2011, 08:56    Post subject:  How to compile urxvt? (and make it small!)  

How does Barry compile urxvt? My builds work, but are way too big!!

I have tried compiling different versions, from 9.05 to the latest, with various options enabled and disabled..

I have tried compiling it with most things disabled.. But I still have the same problem...
Barrys urxvt binary ends up about 265kb, mine is always over 1mb!!

So, how does barry get urxvt so small, when compiling it?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Sun 28 Aug 2011, 08:58    Post subject: Re: How to compile urxvt
Subject description: (and make it small!)
 

Just so you know, I want to compile it to add 256 colour support..

I would update the 1st post to have this information, but we STILL can't edit our posts in this sub section!! Sad

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2221

PostPosted: Sun 28 Aug 2011, 12:49    Post subject:  

With barry's build system, you'd have to search through his blog or download the complete sources (or maybe in woof somewhere) to find out what compile-time options he used. The again, he may have used a pet put together by some contributor -even years ago so we don't even know what the options were.

--enable-256-color is the option you need to use. On my KISS system, the xterm binary is 308K without doing any really extreme optimization. You are probably looking at the raw *unstripped* size. Simply stripping it may knock off most of the difference you see. BK's may also be compressed with upx. for some programs, stripping alone will take off 75%! of the raw size.

It took me about 5 seconds to find the full CLFAGS, LDLFAGS and configure options I used on KISS. But it's on another machine so not really convenient to paste the options here.
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Sun 28 Aug 2011, 15:34    Post subject:  

Thanks for the info... I should have stated, that Barrys 265kb binary is not upx'd, mine was twice as big, even when upx'd (600kb) ... I ran 'strip' on both binaries before comparing... Strip did not make much difference, about 40% if I remember correctly...

Oh well, I knew it would be hard to find the configure line he used... Or who else if it wasn't Barry... Rolling Eyes

Would still love a really light, 256 colour, UTF-8 enabled terminal...
(I like elinks..)

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
Dingo


Joined: 11 Dec 2007
Posts: 1415
Location: somewhere at the end of rainbow...

PostPosted: Sun 28 Aug 2011, 15:55    Post subject:  

try applying:
Code:
CFLAGS=" -pipe -combine -Os -ffunction-sections -fdata-sections -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants -mpreferred-stack-boundary=2 -march=i486 -mtune=i686 "

and stripping then
Code:
strip --strip-unneeded

_________________
replace .co.cc with .info to get access to stuff I posted in forum
dropbox 2GB free
OpenOffice for Puppy Linux
Back to top
View user's profile Send private message Visit poster's website 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Mon 29 Aug 2011, 07:15    Post subject:  

Dingo wrote:
try applying:
Code:
CFLAGS=" -pipe -combine -Os -ffunction-sections -fdata-sections -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants -mpreferred-stack-boundary=2 -march=i486 -mtune=i686 "

and stripping then
Code:
strip --strip-unneeded

Thanks for the info Dingo, I have done this, and still got 1012kb binary, after stripping.. 1012k seems to be the size, most of the time! I am gonna check the options available in the urxvt binary that I'm 'competing' with, and will retry .. I have disabled in-built PERL (--disable-perl) as well, I think that's right to do that..

Maybe I will try compiling it in another pup see how that goes..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Mon 29 Aug 2011, 10:09    Post subject:  

Hmm.. the strip command seems to be having a much greater effect than before, with a few different options.. I now get a nice small binary Smile.. And the --with-codesets="" seems to make a big difference..

I am really only looking to upgrade a few features to make elinks work nicer.. I basically want a UTF-8 enabled terminal (showing cyrillic, etc, without problems) that can ALSO show the 'VTE' or 'Linux, OS/2' frames in elinks..

At the moment, I've got UTF-8 and 256 colours, but cannot get urxvt to show any frames in elinks correctly, this is my last stumbling block.. Does anyone know what settings or options are resonsible for this? I am keen to get it done, because using 256 colours is nice, and doesn't seem to affect the size or speed much at all..

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Mon 29 Aug 2011, 10:11    Post subject:  

I should note that Barrys urxvt shows the frames OK, but no 256 colours..
_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Mon 29 Aug 2011, 10:14    Post subject:  

Here's the config line I used: (and others similar)...:

./configure CFLAGS=" -pipe -combine -Os -ffunction-sections -fdata-sections -momit-leaf-frame-pointer -fomit-frame-pointer -fmerge-all-constants -mpreferred-stack-boundary=2 -march=i486 -mtune=i686 " --prefix=/usr --sysconfdir=/etc --localstatedir=/var --build=i486-pc-linux-gnu --with-term=urxvt --enable-256-color --disable-unicode3 --enable-xft --enable-font-styles --disable-afterimage --disable-pixbuf --disable-transparency --disable-fading --disable-rxvt-scroll --disable-next-scroll --disable-xterm-scroll --disable-perl --disable-xim --enable-backspace-key --enable-delete-key --disable-resources --disable-swapscreen --disable-iso14755 --disable-frills --enable-keepscrolling --enable-selectionscrolling --enable-mousewheel --disable-slipwheeling --disable-smart-resize --disable-text-blink --disable-pointer-blank --disable-utmp --disable-wtmp --disable-lastlog --with-codesets="" --disable-combining --disable-assert

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Mon 29 Aug 2011, 11:58    Post subject:  

if you used slackware or the sbopkg tool
I posted in cutting edge section this package builds correctly automatically with these options

*the package wont build without pkgtool that is pre installed in txz_pup
its the heart of making packages from slackbuild scripts

Code:
#!/bin/sh

# Slackware build script for rxvt-unicode

# Written by Dugan Chen (dugan_c@fastmail.fm)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Maintained by Daniel LEVAI <leva@ecentrum.hu>, 2010, 2011

PRGNAM=rxvt-unicode
VERSION="9.12"
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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}

DOCS="COPYING Changes INSTALL README.FAQ README.configure"

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="64"
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.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Option to enable/disable the embedded perl interpreter
CONFIG_PERL=${CONFIG_PERL:-YES}

if [ "${CONFIG_PERL}" == 'YES' ];then
   _PERL_OPT='--enable-perl'
else
   _PERL_OPT='--disable-perl'
fi

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --enable-everything \
  --enable-unicode3 \
  --enable-combining \
  --enable-xft \
  --enable-font-styles \
  --enable-transparency \
  --enable-fading \
  --enable-frills \
  --disable-afterimage \
  --enable-pixbuf \
  --enable-rxvt-scroll \
  --enable-next-scroll \
  --enable-xterm-scroll \
  ${_PERL_OPT} \
  --enable-xim \
  --enable-iso14755 \
  --enable-keepscrolling \
  --enable-selectionscrolling \
  --enable-mousewheel \
  --enable-slipwheeling \
  --enable-smart-resize \
  --enable-text-blink \
  --enable-pointer-blank \
  --enable-utmp \
  --enable-wtmp \
  --enable-lastlog \
  --build=$ARCH-slackware-linux

make
mkdir -p $PKG/usr/share/terminfo
TERMINFO=$PKG/usr/share/terminfo 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

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

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
big_bass

Joined: 13 Aug 2007
Posts: 1747

PostPosted: Mon 29 Aug 2011, 12:00    Post subject:  

big_bass wrote:
if you used slackware or the sbopkg tool
I posted in cutting edge section this package builds correctly automatically with these options (it isnt small but you get the idea what you can use for options and then remove what you want ) and maintain a script to rebuild the package lite and share

*the package wont build without pkgtool that is pre installed in txz_pup
its the heart of making packages from slackbuild scripts

Code:
#!/bin/sh

# Slackware build script for rxvt-unicode

# Written by Dugan Chen (dugan_c@fastmail.fm)
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
# permitted provided that the following conditions are met:
#
# 1. Redistributions of this script must retain the above copyright
#    notice, this list of conditions and the following disclaimer.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ''AS IS'' AND ANY EXPRESS OR IMPLIED
# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

# Maintained by Daniel LEVAI <leva@ecentrum.hu>, 2010, 2011

PRGNAM=rxvt-unicode
VERSION="9.12"
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}

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}

DOCS="COPYING Changes INSTALL README.FAQ README.configure"

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="64"
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.bz2
cd $PRGNAM-$VERSION
chown -R root:root .
chmod -R u+w,go+r-w,a-s .

# Option to enable/disable the embedded perl interpreter
CONFIG_PERL=${CONFIG_PERL:-YES}

if [ "${CONFIG_PERL}" == 'YES' ];then
   _PERL_OPT='--enable-perl'
else
   _PERL_OPT='--disable-perl'
fi

CFLAGS="$SLKCFLAGS" \
CXXFLAGS="$SLKCFLAGS" \
./configure \
  --prefix=/usr \
  --libdir=/usr/lib${LIBDIRSUFFIX} \
  --sysconfdir=/etc \
  --localstatedir=/var \
  --mandir=/usr/man \
  --enable-everything \
  --enable-unicode3 \
  --enable-combining \
  --enable-xft \
  --enable-font-styles \
  --enable-transparency \
  --enable-fading \
  --enable-frills \
  --disable-afterimage \
  --enable-pixbuf \
  --enable-rxvt-scroll \
  --enable-next-scroll \
  --enable-xterm-scroll \
  ${_PERL_OPT} \
  --enable-xim \
  --enable-iso14755 \
  --enable-keepscrolling \
  --enable-selectionscrolling \
  --enable-mousewheel \
  --enable-slipwheeling \
  --enable-smart-resize \
  --enable-text-blink \
  --enable-pointer-blank \
  --enable-utmp \
  --enable-wtmp \
  --enable-lastlog \
  --build=$ARCH-slackware-linux

make
mkdir -p $PKG/usr/share/terminfo
TERMINFO=$PKG/usr/share/terminfo 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

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

mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a $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

cd $PKG
/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz}

_________________
debian wheezy ,linux mint, slackware I use them all and they all have good points
Mint would be best for general users though
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4280

PostPosted: Mon 29 Aug 2011, 23:17    Post subject:  

you can set the CFLAGS to whatever you want - it just ignores them ... you have to edit the makefiles after running configure

this type of "forced optimal setting" is quite irritating and why individuals like myself and entire distros write wrappers around gcc
... to filter out the crud
... then you end up with issues with the wrappers
... rinse and repeat

even with decent options and settings grokked in, urxvt is still a giant pile of C++ bloat compared to its C cousins (rxvt and the unicode compliant mrxvt)

the best way to make urxvt small is by compiling mrxvt and making a symlink

here is what mrxvt has:
1. Multi-tab support
2. Run time changeable per-tab titles / backgrounds / colors.
3. Session support for each tab
4. Input broadcasting to all tabs
5. Customizable keyboard shortcuts
6. Translucency and pseudo transparency support
7. JPEG / PNG / XPM background support
8. Off-focus background fading
9. Xft support.
10. Text shadow
11. Menubar / popup menus
12. XIM and multi-language (Chinese/Japanese/Korean) support.
13. Five different scroll bar styles
14. Small and fast.
15. Does not depend on GTK / Qt / Gnome / KDE.
16. Available on multiple platforms.
17. utmp/wtmp/lastlog logging


_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
amigo

Joined: 02 Apr 2007
Posts: 2221

PostPosted: Tue 30 Aug 2011, 02:55    Post subject:  

+1 mrxvt
Back to top
View user's profile Send private message 
sc0ttman


Joined: 16 Sep 2009
Posts: 2373
Location: UK

PostPosted: Tue 30 Aug 2011, 10:10    Post subject:  

amigo wrote:
+1 mrxvt

I will definitely have another look at mrxvt, which I had installed a while back, liked it but it was UGLY... and I have yet to find a package which can show *any* Cyrillic whatsoever .. But I'll get the source and give it a go myself... See what I can make...

Techno, I noticed that the CFLAGS make no difference at all to my builds -
... so are they actually ignored?

_________________
Akita Linux, VLC-GTK, Pup Search, Pup File Search
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4280

PostPosted: Tue 30 Aug 2011, 11:56    Post subject:  

sc0ttman wrote:
amigo wrote:
+1 mrxvt

I will definitely have another look at mrxvt, which I had installed a while back, liked it but it was UGLY... and I have yet to find a package which can show *any* Cyrillic whatsoever .. But I'll get the source and give it a go myself... See what I can make...

mrxvt is themeable and _can_ look quite nice
Quote:

Techno, I noticed that the CFLAGS make no difference at all to my builds -
... so are they actually ignored?
Yeah some projects (a growing number actually) like to impose their own default flags that override the ones in env. The only sure way to impose your own will, is to grok them out of the makefile (by hand or with a sed script) or to make a wrapper for gcc (it is hard to find every occurence with sed ... packages sometimes even extract flags from your perl or python compilation)

here is a stub for a gcc wrapper
Code:
#!/bin/sh
for arg  in $@ ; do
   case $arg in
      -O0|-O1|-O2|-O3)newargs=${newargs}" "-Os;;
      *)newargs=${newargs}" "${arg};;
   esac
done

case $newargs in
   " -l"*)newargs=${newargs}" "$yourldflags;;
esac

i486-t2-linux-gnu-gcc $yourcflags $newargs

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 2 [21 Posts]   Goto page: 1, 2 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Compiling
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.1193s ][ Queries: 12 (0.0081s) ][ GZIP on ]