LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 11-09-2006, 09:55 AM   #1
Gzou
Member
 
Registered: Apr 2006
Location: Quebec, Canada
Distribution: Xubuntu, Zenwalk, Slax, Gentoo
Posts: 39

Rep: Reputation: 16
Creating smallest GTK slax mo from source


Hello every Linux users ! I'm gzou

As the subject says, I have a few questions about how to create the smallest possible module of GTK (meaning GTK1 and GTK2 together) for the Live distribution SLAX. The module would be used to run programs such as gnumeric, gimp, abiword, firefox, etc. My questions are realted to slax, of course, bue also about what happens to file sizes when you compile for different architcturs

Here's my situation: I want to be able to run slax with custom-made modules on a 220 MB CD and putting as much as i can on it. I've already worked on the core and X modules, took off all the stuff I didn't want and made sure they still worked. I've also compiled almost all the software I want on the CD from source. (using checkinstall in combination with tgz2mo) Now i'm on to the reducing part, where I take out all the stuff I don't need.

I've tried just putting all my modules onto the CD and they all worked fine, the only problem was that I needed a 700 MB CD (thus the reducing part)

One of my freinds, who had similar ideas, gave me his GTK module as an example of what he did to reduce it. When I looked at it all there was were the /etc (containing GTK's config files) and /usr/lib directories. The total size of the 2 directories was 5.8 MB. When I tired to imitate him by taking out all except /etc and /usr/lib in my modules of GTK and GTK2, the total was 17 MB, and I recheked to make sure that there weren't any additional files that were in my GTK but not in his, and it still was 17 MB. So I started asking myself why the big difference in size ?

First thing that was apparent was the version numbers. his module contained GTK2.4.1, mine was 2.10.x (can't remember the last digit) but even if mine was drastically much more newer than his, it didn't quite seem to explain the difference in size

The other thing was how we created the modules. I compiled mine from source while he just took a bunch of tgz's and deb's and put them together. But then again, didn't satisfy me.

Third thing was how I compiled them. I compiled all my modules for the i386 artitechture (main reason was compatibility, and also to make sure that It would run on another really old computer that I've got in my room).

When I realised that I went and compared individual file sizes in both modules, and in most cases, My files were bigger than his. I also saw that the largest ones were the ELF executables. Then It clicked: maybe, since I compiled all the modules for i386, it somehow made the ELF files bigger. But I wasn't sure at all, this was just a hypothesis.

That's why I'm here, I've got a few main questions relating to all of this

1. Are their certain directories/files (like the documentation and var) that can be easily taken out to reduce size ? and, generally, which ones ?

2.Is the newer version of GTK that I compiled the reason for the bigger file size ?

3. Does compiling for i386 change the size of idividual files ?


I'm still a relatively new guy in linux, so that's why I came here to see if anyone around had any suggestions or answers to my questions.

I'd really appreciate the insight you can provide on this and thank you in advance !

Gzou.

P.S. : here's the list of the files in the lib directory and their size:

My freind's version (the smaller one):

116K gtk-2.0/2.4.0/engines
176K gtk-2.0/2.4.0/immodules
272K gtk-2.0/2.4.0/loaders
564K gtk-2.0/2.4.0
4.0K gtk-2.0/include
568K gtk-2.0
0 libgdk-1.2.so.0
200K libgdk-1.2.so.0.9.1
4.0K libgdk-x11-2.0.la
0 libgdk-x11-2.0.so
0 libgdk-x11-2.0.so.0
516K libgdk-x11-2.0.so.0.800.19
4.0K libgdk.la
0 libgdk.so
4.0K libgdk_imlib.la
0 libgdk_imlib.so
0 libgdk_imlib.so.1
140K libgdk_imlib.so.1.9.15
4.0K libgdk_pixbuf-2.0.la
0 libgdk_pixbuf-2.0.so
0 libgdk_pixbuf-2.0.so.0
84K libgdk_pixbuf-2.0.so.0.800.19
4.0K libgdk_pixbuf_xlib-2.0.la
0 libgdk_pixbuf_xlib-2.0.so
0 libgdk_pixbuf_xlib-2.0.so.0
56K libgdk_pixbuf_xlib-2.0.so.0.800.19
0 libgtk-1.2.so.0
1.2M libgtk-1.2.so.0.9.1
4.0K libgtk-x11-2.0.la
0 libgtk-x11-2.0.so
0 libgtk-x11-2.0.so.0
3.0M libgtk-x11-2.0.so.0.800.19
4.0K libgtk.la
0 libgtk.so
5.7M total

and my module, compiled from source for i386:
96K gtk-2.0/2.10.0/engines
344K gtk-2.0/2.10.0/immodules
524K gtk-2.0/2.10.0/loaders
964K gtk-2.0/2.10.0
4.0K gtk-2.0/include
968K gtk-2.0
0 libgdk-1.2.so.0
520K libgdk-1.2.so.0.9.1
4.0K libgdk-x11-2.0.la
0 libgdk-x11-2.0.so
0 libgdk-x11-2.0.so.0
1.5M libgdk-x11-2.0.so.0.1000.6
4.0K libgdk.la
0 libgdk.so
4.0K libgdk_pixbuf-2.0.la
0 libgdk_pixbuf-2.0.so
0 libgdk_pixbuf-2.0.so.0
216K libgdk_pixbuf-2.0.so.0.1000.6
4.0K libgdk_pixbuf_xlib-2.0.la
0 libgdk_pixbuf_xlib-2.0.so
0 libgdk_pixbuf_xlib-2.0.so.0
120K libgdk_pixbuf_xlib-2.0.so.0.1000.6
0 libgtk-1.2.so.0
3.4M libgtk-1.2.so.0.9.1
4.0K libgtk-x11-2.0.la
0 libgtk-x11-2.0.so
0 libgtk-x11-2.0.so.0
9.4M libgtk-x11-2.0.so.0.1000.6
4.0K libgtk.la
0 libgtk.so
16M total

hope this helps !
 
Old 11-09-2006, 10:05 AM   #2
verdeboy2k
Member
 
Registered: Jan 2004
Location: /dev/random
Distribution: Gentoo amd64, CrunchBang amd64
Posts: 350

Rep: Reputation: 32
just a thought? did you compile them with the -g (debug) flag? You could also optimize for size (-Os). Also did you remember to strip the binaries?
 
Old 11-09-2006, 11:16 AM   #3
Gzou
Member
 
Registered: Apr 2006
Location: Quebec, Canada
Distribution: Xubuntu, Zenwalk, Slax, Gentoo
Posts: 39

Original Poster
Rep: Reputation: 16
ummm, well, to be honest, I don't know what those options do ^^*

so, I should try doing

make -g -Os

right ? or are those options for the configure script ?

also, I don't know what stripping is, but I suppose that it reduces the size of the files, right ?

I'm sorry If I sound a bit dumb when asking these questions, I don't know that much about compiling
 
Old 11-09-2006, 12:08 PM   #4
95se
Member
 
Registered: Apr 2002
Location: Windsor, ON, CA
Distribution: Ubuntu
Posts: 740

Rep: Reputation: 32
Using 2.10 will make a very large difference. Google for Project Ridley and you'll see why. 2.10 was the first release which incorporated Project Ridley. Basically, Project Ridley is an attempt to consolidate a bunch of, previously external, libraries which should probably be in GTK+ into GTK+. So you not only got the added features/enhancements of GTK+, but a whole whack load of other libraries' code added to it. Definitely remove debugging symbols, optimize for size (-Os as above), and make use of strip to strip all the unnecessary symbols.
 
  


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
creating a distro based on slax linuxmandrake Slackware 4 09-20-2006 08:13 AM
SLAX scripts creating live CD based on SimplyMEPIS 3.4 w/ 2.6.15-1: "init not found" lefty.crupps Slackware 1 03-31-2006 07:15 PM
GTK source install doesn't give gtk-config Feebles Linux - Software 4 06-15-2005 12:51 PM
creating buttons in GTK+ geminigal Programming 1 05-11-2005 08:43 PM
Creating a Makefile-GTK The Yeti Lives Linux - Newbie 0 06-14-2003 06:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:44 AM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration