Compiled FTGL for Chromium. How to static build?

discuss compiling applications for Puppy
Message
Author
User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

Compiled FTGL for Chromium. How to static build?

#1 Post by sunburnt »

I`m compiling Chromium into a mount dir., so I compiled FTGL files there in /lib.
The FTGL files are to go in the Chromium package. FTGL build has no *.a files.

I thought to add ( MntPt )/lib path to LD_LIBRARY_PATH so Chromium build would find it.
Seemed best for it to be where it will be used in the final build.

But when I run configure it says:

Code: Select all

configure: error: cannot find GLC or FTGL >= 2.1.3 (text renderer)
Where do I put it to have it in the build? What to do to point configure to it?

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#2 Post by Karl Godt »

I think it is something with

"-I/mnt/include -I/usr/local/include" ( Big "i" ) for CFLAGS=

and

"-L/mnt/lib -L/usr/local/lib" (Big "l" ) for LDFLAGS=

so

Code: Select all

./configure --built=i486-pc-linux-gnu --host=i486-pc-linux-gnu --target=i486-pc-linux-gnu CFLAGS="-I/mnt/include -static" LDFLAGS="-L/mnt/lib"
but never forget to put pkg-name-FTLG.pc into /usr/lib/pkgconfig directory with the right ( actual) pointing contents

LDFLAGS and CFLAGS are written into these .

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#3 Post by sunburnt »

Hi again Karl Godt; Some more clarification if possible...

-L will make the compiled app. look for the lib. that is in the make install dir.
So it should work okay as the lib is already in the dir. the app. is to be in.

Does -I make the lib get copied ( included ) into the target dir. at make install?
So it can be anywhere as it`s copied to the correct dir. in the build target dir.?
And then it essentially does what -L does to make the app. find the lib. there.
Or does it do something else? It seems like this is more what I`m trying to do.

Looked at the files in /usr/lib/pkgconfig, please explain:
LDFLAGS and CFLAGS are written into these ( files in /pkgconfig )..
Do I make a blank file for the FLAGS to be written to?
Or are these files in the source pkgs.?
Will they have to be modified by me to point to the correct places?

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#4 Post by Karl Godt »

http://www.lehman.cuny.edu/cgi-bin/man-cgi?pkg-config+1
http://people.freedesktop.org/~dbn/pkg-config-guide.html
http://en.wikipedia.org/wiki/Pkg-config
prefix=/usr/local
exec_prefix=${prefix}
libdir=${exec_prefix}/lib
includedir=${prefix}/include

Name: FTGL
Description: OpenGL frontend to Freetype 2
Version: 2.1.3~rc5
Libs: -L${libdir} -lftgl
Requires.private: freetype2
Libs.private: -lGLU -lGL -lm
Cflags: -I${includedir} -I${includedir}/FTGL
http://linux.windows9download.net/software-development/ftgl-124780.html

./configure

FTGL configured with the following settings:

Prefix: /usr/local
Binaries: /usr/local/bin
Configuration files: /usr/local/etc
Data files: /usr/local/share

CC = gcc
CXX = g++
CFLAGS = -g -O2 -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
CXXFLAGS = -g -O2
CPPFLAGS = -I${top_srcdir}/src -Wall -Wpointer-arith -Wcast-align -Wcast-qual -Wshadow -Wsign-compare

---
./configure complete, type 'make' to begin building

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#5 Post by Karl Godt »

And chromium i quit after too many svn co breaks :

Code: Select all

svn checkout http://chromium.googlecode.com/svn/trunk/ chromium-read-omly
gave me zillions of .wav files ... :twisted:

And thats the OS tarball it seems : 1,2GB
source tarball

.. giving up !

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#6 Post by sunburnt »

Karl Godt; I`m looking at your links, starting to get a picture. here.

It seems odd to keep build info in the O.S. ( /pkfconfig ), but it`s normal for Unixes I guess.
Can`t see that it would ever need to be referenced for anything.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#7 Post by Karl Godt »

I am running full 99% of the time . have no interest to screw anything .

Tried to build a lot of xorg drivers once on a separate partition .

Was ok having all includes and libs on the OS .

Building chromium OS of 1.2 GB is beyond my current skills i guess .

*

What i don't understand : do you want FTGL built statically or chromium ?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#8 Post by sunburnt »

I guess I should have said that it`s Chromium the game, not the O.S.
Sorry about that...

If I could impose on you a little Karl, I`m a total noob at compiling.
I`m still trying to get an idea of the big picture.

I want to make "relatively" self contained apps. in Squash files.
Much like Tiny Core Linux`s SCM files.

technosaurus has been helping a lot. But compiling is still not working.

I have a bunch of Qs here: http://www.murga-linux.com/puppy/viewto ... 8&start=30

### The main Qs on my mind:

# Using precompiled binary libs. doesn`t seem to work much of the time.
__ Is there a trick to using binary libs.?

# The best setup for making self contained SqApps seems to be:

Have a dir. with lots of libs. ( compiled or binary ) for building packages.
Copy needed libs. to /(PathToInstallDir)/lib
Use: LDFLAGS=-L/(PathToInstallDir)/lib ; configure --prefix /(PathToInstallDir)
LDFLAGS should point configure to the libs. copied to the install dir.
--prefix makes sure they`re found in the final package when the app. is run.
The install dir. is then made into a Squash file.

### Does this sound like a good setup? Or am I wrong about this?

All help is appreciated. Thank you very much... Terry B.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#9 Post by Karl Godt »

Con you post a link to chromium the game, Terry ?

about the flags :

Code: Select all

FLAGS=$FLAGS;export FLAGS;./configure
if you use semicolons.

or

Code: Select all

FLAGS=$FLAGS ./configure
or

Code: Select all

./configure FLAGS=$FLAGS
about the prefix :
if you want a standalone like

Code: Select all

--prefix=/opt/chromium-version
with all the external included libs included in the /opt/chromium-directory ,
then i have to say, that i did not try to built such combination before .
Probably i would compile FTGL also with
--prefix=/opt/chromium-version
and all others too,
# make install them,

and build
chromium with

Code: Select all

./configure LDFLAGS="-L/opt/chromium-version/lib -L/opt/chromium-version/usr/lib -L/opt/chromium-version/usr/local/lib" CFLAGS="-I/opt/chromium-version/usr/include" --prefix=/opt/chromium-version
make
make install

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#10 Post by sunburnt »

Thank you so much for the complete code example. It helps a lot !

Chromium`s one of the dumb little game I got to develop SqApp build methods.
I don`t know if it`s really worth your time, it`s an arcade 2D space shooter.
http://linux.softpedia.com/get/GAMES-EN ... 9998.shtml
I got a number of games from there, some I`d really like to make work.
Some are Win. games in the Linux section, I assume they`re run by Wine.
I`ve tried Wine but never had much luck with it, once it trashed my partition.

# The SqApp setup I have mounts Squash files on: /SqApp/mnt/(PkgName)
The SqApp files have run scrips in them to mount & run, then unmount.
A setup script copies the run scripts to /SqApp/bin and icons to /SqApp/ico
and makes a few types of menu files. I made a stand alone menu in BaCon.

### If I could ask a few more Qs:

# Is there a trick to using binary libs.?
I`m using Puppy Lucid, so then using Ubuntu Lucid libs. is a good idea?

I guess Woof is supposed to be Ubuntu app. compatible, maybe it`s better.

# Are libs. and apps. built on glibc, musl, uclibc, etc, incompatible with libs.
and apps. built on any of the other Clibs? It could be a portability problem.

# A Q is... What to include in the build? X, xOrg stays out, but GTK+ has
new versions often, and many libs. have many versions ( lib. conflicts ).
OpenGL and Mesa ( games ) are both big I think, so they`re shared.
Obviously versions of apps. and libs. are sets, and any upgrade is global.

# I need really need complete tree files for the common apps... A BIG help.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#11 Post by Karl Godt »

Yep this chromium is something else .

only 1.6MB src ..

but :

configure: error: cannot find OpenAL & ALUT or SDL Mixer (sound)

hmmmm ... will have a look for these ...

About wine : i managed to install wine by copying wine from

lighthousepup-443 to lupu-511

but it was a little struggle to find everything and to get the $HOME/.wine directory right .

About Ubuntu libs : I can not complain until now ..
libxml-2.6.32 from debian was missing a function - fopen64 or so - needed by rox

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#12 Post by sunburnt »

Yes, It`s a real grab bag of lib. goodies.

I`m trying to do sdl-ball and lbreakout, and neither of them will work also.
Interestingly I`ve gone to using Ubuntu Lucid binaries as I`m using Puppy Lucid.
And they have the same errors as the games I`ve compiled. I guess that`s good.

# Lbreakout error: error while loading shared libraries:
libSDL_mixer-1.2.so.0: cannot open shared object file: No such file or directory

# But here: echo $LD_LIBRARY_PATH
./lib:/lib:/usr/lib:/usr/X11R7/lib:/root/my-applications/lib

# And here`s the dir.: ls /root/my-applications/lib
libmikmod.so.2 libSDL_image-1.2.so.0.8.2 libSDL_ttf-2.0.so.0.6.3
libmikmod.so.2.0.4 libSDL_image-1.2.so.0.8.2_Deb libsmpeg-0.4.so.0
libSDL-1.2.so.0 libSDL_mixer-1.2.so.0 libsmpeg-0.4.so.0.1.4
libSDL-1.2.so.0.11.3 libSDL_mixer-1.2.so.0.2.6 libx264.so
libSDL_image-1.2.so.0 libSDL_ttf-2.0.so.0 libx264.so.65

### Notice of course that:: libSDL_mixer-1.2.so.0 is in the path.

So what the heck is going on here? I doubting the reliability of all of this.
Does ld.so.cache have to be run? Does $LD_LIBRARY_PATH work or not?

Tiny Core linux doesn`t use $LD_LIBRARY_PATH, you`re not supposed to use it.
But they do use $LD_LIBRARY_PATH to make their SCM files find the libs.
.
Last edited by sunburnt on Wed 30 May 2012, 07:38, edited 2 times in total.

jpeps
Posts: 3179
Joined: Sat 31 May 2008, 19:00

#13 Post by jpeps »

I think it will take more than LD_LIBRARY_PATH for many apps that require libs and other support files to be in particular locations. I'm assuming that you rebooted, ran ldconfig, etc. Are all the pkgconfig files correct?

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#14 Post by sunburnt »

Thanks jpeps; I ran ldconfig and it fixed it.
I`ve got links for /usr/share/games and /var/games

Now it says:

Code: Select all

ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:3326:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Input/output error
There`s a short list of these and then errors for sounds it can`t play of course.
As I see it, I have all the critical dirs. linked, so I`m stumped once again.

I think this Lbreakout game is very close to running the way I`ve got it rigged.

Forcing an app. to find it`s parts is tricky. Too bad they`re made this way.

Using binary libs. will work I think. Again, tricks to get the app. to use them.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#15 Post by Karl Godt »

Seems you run frugal and did too much alsaconf, which unloads the sound modules and loads them new .
Unloading often makes the kernel drivers do a mv or rm command to remove the /dev/snd* nodes, which can leave hidden "*.wh.*" files from the aufs driver in /dev or /dev/snd directory .

Code: Select all

find /initrd/pup_rw -name "*.wh.*" -delete
should delete at least the .wh. files ( not the .wh. dirs )

Another thing is in my observations, that the sound drivers mainly create nodes in /dev directory directly, some apps still might try to find them in /dev/snd directory .

I have altered my /etc/init.d/alsa to create them in both :
http://murga-linux.com/puppy/viewtopic. ... 847#536947

Code: Select all

D=`find /sys -type d -name "*sound*"`
POOL=''
for i in $D ; do
DEV=`find $i -type f -name "dev" -exec echo -n {}@ \; -exec cat {} \; | tr ':' '@' | tr ' ' '@' -exec echo \; `
POOL="$POOL $DEV"
 done

POOL=`echo $POOL | rev`

for i in $POOL ; do
     NODE=`echo $i | cut -f 3 -d '@'`
     NODE=`echo $NODE | rev`
     NODE=`basename $(dirname $(echo $NODE) )`
     MAJ=`echo $i | cut -f 2 -d '@'`
     MAJ=`echo $MAJ | rev`
     Min=`echo $i | cut -f 1 -d '@'`
     Min=`echo $Min| rev`
     echo "$NODE" "$MAJ" "$Min"
     rm /dev/$NODE  ### 2>/dev/null
     mknod /dev/$NODE c $MAJ $Min
     rm /dev/snd/$NODE  ### 2>/dev/null
     mknod /dev/snd/$NODE c $MAJ $Min
    done

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#16 Post by sunburnt »

I love code snips. Thanks Karl...

I was just thinking earlier that Puppy`s sound quit working. Hummmm......

Lots of white out files, not all are sound. Do I really want to delete them all?

### Perhaps just the ones in /dev and /dev/snd ?

Code: Select all

sh-4.1# find /initrd/pup_rw -name "*.wh.*"
/initrd/pup_rw/.wh..wh.aufs
/initrd/pup_rw/.wh..wh.plnk
/initrd/pup_rw/dev/snd/.wh.pcmC0D0p
/initrd/pup_rw/dev/snd/.wh.pcmC0D0c
/initrd/pup_rw/dev/snd/.wh.pcmC0D1p
/initrd/pup_rw/dev/snd/.wh.pcmC0D1c
/initrd/pup_rw/dev/snd/.wh.controlC0
/initrd/pup_rw/dev/snd/.wh.seq
/initrd/pup_rw/dev/snd/.wh.pcmC0D3p
/initrd/pup_rw/dev/snd/.wh.timer
/initrd/pup_rw/dev/.wh.sg4
/initrd/pup_rw/dev/.wh.adsp
/initrd/pup_rw/dev/.wh.dsp
/initrd/pup_rw/dev/.wh.mixer
/initrd/pup_rw/dev/.wh.sequencer2
/initrd/pup_rw/dev/.udev/links/inputx2fby-pathx2fplatform-pcspkr-event-spkr/.wh..wh..opq
/initrd/pup_rw/dev/.wh.audio
/initrd/pup_rw/dev/.wh.sequencer
/initrd/pup_rw/root/Startup/.wh.test_if_connected
/initrd/pup_rw/root/.packages/.wh.Packages-puppy-woof-official
/initrd/pup_rw/etc/.wh.windowmanager.openbox
/initrd/pup_rw/.wh..wh.orph
/initrd/pup_rw/usr/lib/xorg/modules/drivers/.wh.displaylink_drv.so
/initrd/pup_rw/usr/share/applications/.wh.flash-player-properties
/initrd/pup_rw/var/local/icons/.wh..wh..opq
/initrd/pup_rw/.wh.pinstall.sh

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#17 Post by Karl Godt »

/initrd/pup_rw/root/Startup/.wh.test_if_connected
/initrd/pup_rw/root/.packages/.wh.Packages-puppy-woof-official
/initrd/pup_rw/etc/.wh.windowmanager.openbox
/initrd/pup_rw/.wh..wh.orph
/initrd/pup_rw/usr/lib/xorg/modules/drivers/.wh.displaylink_drv.so
/initrd/pup_rw/usr/share/applications/.wh.flash-player-properties
/initrd/pup_rw/var/local/icons/.wh..wh..opq
/initrd/pup_rw/.wh.pinstall.s
Don't know fore sure if these .wh. are of use for anything . The kernel driver " aufs " is configurable to show them or not . I also configured mine to show them, would be a TODO if i configure a kernel not to show them , how that behaves .. running mainly full , so no need for aufs for me ..

If there is a .wh. file for a file, writing to the normal file might not work anymore . The file gets corrupted . I experienced that with the important configuration file /etc/rc.d/PUPSTATE .

I wanted to have a backup of PUPSTATE and made a line mv PUPSTATE PUPSTATE.prev in rc.shutdown, which created that .wh.PUPSTATE file . Next boot appeared to work normal, but /init of initrd.gz writes to PUPSTATE every time and that seemed to corrupt the file . cat and source on it would not work : I/O Error . fsck could not handle it . Had to umount the PUPSAVE-FILE.2fs and delete the .wh. file and comment my line in rc.shutdown .

Probably this is caused because i put my line in after umounting -r pupsave-file layer, but i am not sure about this .

If you don't need the driver displaylink_drv.so and flash works for you or you even like to have flasplayer.so blocked and don't need to read or write to /etc/windowmanager.openbox .............

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#18 Post by sunburnt »

Thanks Karl; I think I`ll try renaming the white files in /dev and /dev/snd.
They look to be sound files with names like: mixer, sequencer, audio, etc.

My girl friend asked if you were the famous Karel Gott.
But I said you spell your name differently. She`s a big fan of his.

User avatar
Karl Godt
Posts: 4199
Joined: Sun 20 Jun 2010, 13:52
Location: Kiel,Germany

#19 Post by Karl Godt »

Karel Gott was very famous here in the 70's and 80's


PUR Biene Maja Karel Gott Live auf Schalke



Not a musical talent here .

User avatar
sunburnt
Posts: 5090
Joined: Wed 08 Jun 2005, 23:11
Location: Arizona, U.S.A.

#20 Post by sunburnt »

Hey Karl; Renamed the whiteout files and no sound.
So I ran Alsa config. again and now it works!

I`m left wondering what the heck deleted the sound devices in the first place.

Many thanks my friend ! Terry B.

# I`ll keep you up on what I`ve got going with stand-alone apps.

Post Reply