Apps :: More questions regarding compiling extensions



Hello again,

I want to include some library files in an extension.

What directory should I compile these for?

By default they compile to /usr/local/lib and /usr/local/include.

Will my application find these automatically?

Would I be better of making these libraries seperate extensions? (There are four- freetype, jpeg, zlib, libpng)

Thanks Phil

What kind (dsl/unc, tar.gz/uci) of extension? If dsl/unc, you should compile with a suitable prefix for such an extension -- /usr. The default compile path /usr/local should be used for things exclusive to a local host; that's why binary distributions like Debian and RedHat install to /usr.

Edit (oops): The other two kinds of extensions should be self-contained, so whatever libs you add will need to go into the same /opt/extname prefix when you compile.

As for the libs you listed, aren't they already in DSL?
http://damnsmalllinux.org/packages.html
(remember to keep it damn small and don't duplicate what's already in it)

For uci/tar.gz:

I've noticed that some applications, depending on how they are compiled, will automatically find their needed libraries if those libraries are 1) pointed to by CFLAGS/CPPFLAGS and LDFLAGS when the application is compiled, and 2) those variables point to directories included with the application.

Some applications don't deal with this, though.  I really couldn't say why some do and some don't...I just see it work sometimes.

When compiling lighttpd into /opt/lighttpd after installing pcre to the same directory, and setting LDFLAGS=-L/opt/lighttpd/lib, PATH=$PATH:/opt/lighttpd/bin and CFLAGS=-I/opt/lighttpd/include, the app will automatically find pcre at runtime. Otherwise it would require LD_LIBRARY_PATH=/opt/lighttpd/lib before running the program if pcre is enabled.

Other applications seem to require the LD_LIBRARY_PATH to include the directory of the library at runtime regardless of whether or not it was specified when the app was built.  I assume this is due to the way the Makefile was created.

With a more permanent system, such as a debian-type or maybe frugal, you could add a new general library directory into /etc/ld.so.conf and all apps would find all libs in there automatically, but you must of course run "sudo ldconfig" after installing a library..

For example, I have qt in /opt/qt and have a line "/opt/qt/lib" in my ld.so.conf. No trouble compiling/running qt apps.

Thanks guys for your help.

@lucky13: You are right, they look like they are built in. That makes my life alot simpler!

@mikshaw: I sort of understand what you mean but will have to work through it. My experience compiling at the moment is ./configure make make install!

The application I am working on (gnuplot) is compiled and running as a .tar.gz extension.

For simplicities sake, as a newbie, it seems that the simplest was to acheive what I want is to compile my library LibGD to /opt/gnuplot/lib and then recompile gnuplot telling it where the library is and rebuild my .tar.gz extension.

How does that sound?


regards phil

Next Page...
original here.