LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   libtool and pango (https://www.linuxquestions.org/questions/linux-software-2/libtool-and-pango-323906/)

kernelhacker 05-16-2005 02:04 AM

libtool and pango
 
Hi,
I am compiling GTK2.0 suite for my custom linux installation which is going to eventually go to a BSD (temporary) installation. I am forced to install the software under /usr instead of /usr/local which is the normal place to do so.

I have (so far) compiled pkgconfig-0.15.0, jpeg-6b, libpng-1.2.8, tiff-v3.6.1, fontconfig-2.2.2, atk-1.9.0, freetype-2.1.9, expat-1.95.7 ( No unusual problems ) .

With the exception of fontconfig, all packages are compiled from source with no previous version to interfere. At each step of the package compilations, all new compiles successfully found their dependencies and linked correctly. (fontconfig successfully installed over the old installation, and appears to work).

All I have left to do is compile pango-1.8.1 and Gtk+-2.6.7.

Pango is the problem, and it doesn't appear to matter which system I compile it on.
(I get the same error on a BSD system or a slackware system -- BSD, Mac OS X).

It configures correctly, even detecting the freetype package I installed.

./configure --prefix=/usr

Quote:

Admins-Computer:~/Desktop/GTK/pango-1.8.1 root# ./configure --prefix=/usr
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets $(MAKE)... yes
checking for native Win32... no
checking for gcc... gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking for style of include used by make... GNU
checking dependency style of gcc... gcc3
checking for c++... c++
checking whether we are using the GNU C++ compiler... yes
checking whether c++ accepts -g... yes
checking dependency style of c++... gcc3
checking build system type... powerpc-apple-darwin7.7.0
checking host system type... powerpc-apple-darwin7.7.0
checking for a sed that does not truncate output... /usr/bin/sed
checking for egrep... grep -E
checking for ld used by gcc... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking for /usr/bin/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm -p
checking whether ln -s works... yes
checking how to recognise dependent libraries... pass_all
checking how to run the C preprocessor... gcc -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking how to run the C++ preprocessor... c++ -E
checking for g77... no
checking for f77... no
checking for xlf... no
checking for frt... no
checking for pgf77... no
checking for fort77... no
checking for fl32... no
checking for af77... no
checking for f90... no
checking for xlf90... no
checking for pgf90... no
checking for epcf90... no
checking for f95... no
checking for fort... no
checking for xlf95... no
checking for ifc... no
checking for efc... no
checking for pgf95... no
checking for lf95... no
checking for gfortran... no
checking whether we are using the GNU Fortran 77 compiler... no
checking whether accepts -g... no
checking the maximum length of command line arguments... 65536
checking command to parse /usr/bin/nm -p output from gcc object... ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking if gcc static flag works... yes
checking if gcc supports -fno-rtti -fno-exceptions... no
checking for gcc option to produce PIC... -fno-common
checking if gcc PIC flag -fno-common works... yes
checking if gcc supports -c -o file.o... yes
checking whether the gcc linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin7.7.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
configure: creating libtool
appending configuration tag "CXX" to libtool
checking for ld used by c++... /usr/bin/ld
checking if the linker (/usr/bin/ld) is GNU ld... no
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking for c++ option to produce PIC... -fno-common
checking if c++ PIC flag -fno-common works... yes
checking if c++ supports -c -o file.o... yes
checking whether the c++ linker (/usr/bin/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin7.7.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
appending configuration tag "F77" to libtool
checking for some Win32 platform... no
checking for perl5... no
checking for perl... perl
checking for X... yes
checking for pkg-config... /usr/bin/pkg-config
checking for fontconfig >= 1.0.1... yes
checking FONTCONFIG_CFLAGS...
checking FONTCONFIG_LIBS... -lfontconfig
checking for freetype-config... /usr/bin/freetype-config
checking for FT_Get_Next_Char in -lfreetype... yes
checking for glib-2.0 >= 2.5.7 gobject-2.0 gmodule-no-export-2.0... yes
checking GLIB_CFLAGS... -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include
checking GLIB_LIBS... -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv
checking Whether to build OpenType test programs... yes
checking modules to link statically...
checking for flockfile... yes
checking for strtok_r... yes
checking Whether to write dependencies into .pc files... no
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for unistd.h... (cached) yes
configure: creating ./config.status
config.status: creating Makefile
config.status: creating pango/Makefile
config.status: creating pango/mini-fribidi/Makefile
config.status: creating pango/opentype/Makefile
config.status: creating pango/pango.rc
config.status: creating pango/pangoft2.rc
config.status: creating pango/pangowin32.rc
config.status: creating modules/Makefile
config.status: creating modules/arabic/Makefile
config.status: creating modules/basic/Makefile
config.status: creating modules/hangul/Makefile
config.status: creating modules/hebrew/Makefile
config.status: creating modules/indic/Makefile
config.status: creating modules/syriac/Makefile
config.status: creating modules/thai/Makefile
config.status: creating modules/tibetan/Makefile
config.status: creating examples/Makefile
config.status: creating docs/Makefile
config.status: creating docs/version.xml
config.status: creating tools/Makefile
config.status: creating tests/Makefile
config.status: creating pango.pc
config.status: creating pangox.pc
config.status: creating pangowin32.pc
config.status: creating pangoft2.pc
config.status: creating pangoxft.pc
config.status: creating pango-uninstalled.pc
config.status: creating pangox-uninstalled.pc
config.status: creating pangowin32-uninstalled.pc
config.status: creating pangoft2-uninstalled.pc
config.status: creating pangoxft-uninstalled.pc
config.status: creating pango-zip.sh
config.status: creating tests/runtests.sh
config.status: creating config.h
config.status: executing depfiles commands
config.status: executing pango/module-defs.h commands
config.status: executing pango/module-defs-x.c commands
config.status: executing pango/module-defs-fc.c commands
config.status: executing pango/module-defs-win32.c commands
configuration:
backends: FreeType
Everything compiles correctly without problems during the make, however at the final step of linking with the gnu libtool script, I get the message:

Quote:

/bin/sh ../../libtool --mode=link gcc -g -O2 -Wall -o ottest ottest.o disasm.o libpango-ot.la -lfontconfig -lfreetype -lz
libtool: link: cannot find the library `/usr/local/lib/libfreetype.la'
This is a virgin install, so I know previous a installation could not have caused the problem.
It happens on my slackware installation too, so it can't be any of the tools which differ between the systems (e.g. the linker ld, or any of the low level tools/compiler)
The usr/local path does not even exist on my BSD system, so it shouldn't have been 'found' or preprogrammed into libtool.

If I do a symlink:
ln -s /usr /usr/local

and remake, the make succeeds but with odd warnings.
Quote:


... alot of boring, and perfect compilation was here ...

gcc -DHAVE_CONFIG_H -I. -I. -I../.. -DG_LOG_DOMAIN=\"Pango\" -DPANGO_ENABLE_ENGINE -DG_DISABLE_DEPRECATED -DG_DISABLE_CAST_CHECKS -I../.. -I../../pango -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -I/usr/include/freetype2 -g -O2 -Wall -MT arabic-ot.lo -MD -MP -MF .deps/arabic-ot.Tpo -c arabic-ot.c -fno-common -DPIC -o .libs/arabic-ot.o
/bin/sh ../../libtool --mode=link gcc -g -O2 -Wall -o pango-arabic-fc.la -rpath /usr/lib/pango/1.4.0/modules -export-dynamic -avoid-version -module arabic-fc.lo arabic-ot.lo ../../pango/libpangoft2-1.0.la -lfontconfig -lfreetype -lz ../../pango/libpango-1.0.la -lgobject-2.0 -lgmodule-2.0 -lglib-2.0 -lintl -liconv
libtool: link: warning: `/usr/lib//libfontconfig.la' seems to be moved
libtool: link: warning: `/usr/local/lib/libfreetype.la' seems to be moved
libtool: link: warning: `/usr/lib//libfreetype.la' seems to be moved
libtool: link: warning: `/usr/lib//libgobject-2.0.la' seems to be moved
libtool: link: warning: `/usr/lib//libgmodule-2.0.la' seems to be moved
libtool: link: warning: `/usr/lib//libglib-2.0.la' seems to be moved
libtool: link: warning: `/usr/lib//libintl.la' seems to be moved
After exploring for quite a bit of time, I discovered that the configure script itself was generating the paths which are erroneously trying to link to the 'usr/local/lib' path (as well as several other bogus paths which are not even on my system).
So, clearly there is a bug in the configure script itself for Pango.
It works fine when the /usr/local directory exists, but not when installing to the /usr directory.

Is anyone familiar with how configuration scripts generate the directories for linking/ and/or know of a good tutorial on debugging ./configure scripts?
I studied the libtool manual, and it is really not of much help in understanding how one might approach debugging the script.

Any other hints on how to attack the problem?

--Thanks in advance.

Harmaa Kettu 05-17-2005 11:23 AM

This should find the problem:
Code:

grep -rnH /usr/local /usr/lib/pkgconfig/*
grep -rnH /usr/local /usr/lib/*.la

Then just change every "/usr/local" in those files to "/usr".

kernelhacker 05-20-2005 01:58 PM

Thanks for the try, unfortuantely those greps produce no results.
The error appears to be in the configure script itself, which generates the make file to compile the Pango package in the /usr/ directory.
pkg-config is correct, and all previous libraries are installed exactly where pkgconfig says they are.

it is the .configure program included with the Pango package which has 'potential' directories hardcoded into it. For some reason the logic of the script is incorrectly 'locating' items in a directory which does not exist -- "/usr/local". It also has the bad habit of giving error messageswith the trailing slash such that the directories are of the form /usr/local// ...

I am just not a Bash script type of person. I know the rudiments, but am more comfortable with PHP, C, C++, Java than bash.
How does one go about debugging it? Is there an interactive debugger one might use or a way to determine which branches of logic and variables were actually modified?
Turning on the trace just prints the if statement with no indication of whether or not it was executed nor what values were assigned at each step of the script.

For example: here is the beginning of the section designed to locate the X11 headers;

Code:

# Standard set of common directories for X headers.
# Check X11 before X11Rn because it is often a symlink to the current release.
ac_x_header_dirs='
/usr/X11/include
/usr/X11R6/include
/usr/X11R5/include
/usr/X11R4/include

/usr/include/X11
/usr/include/X11R6
/usr/include/X11R5
/usr/include/X11R4

/usr/local/X11/include
/usr/local/X11R6/include
/usr/local/X11R5/include
/usr/local/X11R4/include

/usr/local/include/X11
/usr/local/include/X11R6
/usr/local/include/X11R5
/usr/local/include/X11R4

/usr/X386/include
/usr/x386/include
/usr/XFree86/include/X11

/usr/include
/usr/local/include
/usr/unsupported/include
/usr/athena/include
/usr/local/x11r5/include
/usr/lpp/Xamples/include

/usr/openwin/include
/usr/openwin/share/include'

if test "$ac_x_includes" = no; then
  # Guess where to find include files, by looking for Intrinsic.h.
  # First, try using that file with no special directory specified.
  cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h.  */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF

As the code progresses, it is supposed to test all of the possible directories for the X11 libraries.
There are several such code segments, for libfreetype, X11, etc.

I would like to be able to trace script execution, perhaps to a log file, such that every if statement evaluation was listed such that I know what the result was, and every assignment dumped so I know why the script is choosing /usr/local as a valid library directory for these libraries (and not for others).
I would like to make a diff file, and send it to the GTK group for inclusion in Pango so others don't have to mess with this again like I am.

kernelhacker 05-20-2005 02:39 PM

Wierd!

I just yanked the entire install of X11, and reinstalled it. The script now works without detecting /usr/local/lib which doesn't exist!
It added some .pc files, I think to /usr/lib/pkgconfig.

It still gives the wierd warnings about moved libs, and still has the // seperator, so I would like to finish tracing the problem out, but at least the install works now.

kernelhacker 05-21-2005 01:48 AM

I have full GTK operation under BSD. Wasn't too much harder than slackware from source.
This isn't a FINK install, but a sourcecode install.

Hints for others who follow and don't like FINK. Most of this is applicable to LINUX or BSD.
Linux users might want to do a ldconfig to insure that any new libraries which are installed are
in fact found. BSD users don't need to bother. Hopefully, this will give you ideas of what
might be wrong in your install even if this isn't your exact system.
Make sure to uninstall conflicting libraries, and only install the libraries you have to.

#Under Panther OSX (BSD unix), the following formula works pretty well.
# Install the X11 library from your system disk -- restore apps icon.
# It first installs the installer, so you need to get past that.
# Then install the developer tools package, and the X11 package.
# You have to find the tools installer on your hard drive once the packages are installed and
# start them. (Applications/installers/...).
# when compiling the later packages under OS X: there will be lots of warnings like:

# libtool: link: warning: `/usr/lib//libintl.la' seems to be moved

# and

# gcc: unrecognized options `-pthreads'

# ignore them, they don't hurt anything. I'm still trying to find out why the libtool one
# happens.

#I used the following packages, and installed them in the order given.
#I needed to install into the /usr directory, not /usr local. Use your own discretion.
#I have a lot of memory, so I use -j6 on the make for a little more speed.
#Get the packages, e.g. start with pkgconfig-0.15.0, unpack it, enter the directory,
#Obviously, become root, and quit being root at the appropriate places. I didn't include those.
#and then the commands that follow show how I installed each package.




#pkgconfig-0.15.0
./configure --prefix=/usr
make clean #if dirty do.
make -j6
make install
mv /usr/X11/lib/pkgconfig/* /usr/lib/pkgconfig # I like all .pc files in one place.
#I don't need to change the path variable that way. You may not wish to do that.




#gettext-0.14
./configure --disable-csharp --prefix=/usr
make clean
make -j6
make install
# gettext makes the libintl file, which is circularly dependant on the libiconv file
# already present on the system. If you don't remake iconv you will get warnings,
# but they can be ignored. I ignored the warnings.




#glib-2.6.4
./configure --prefix=/usr
make clean
make -j6
make install




#libpng-1.2.8
#tricky! Mac OSX already has zlib, so don't install it, unless you don't have it.
cp scripts/makefile.darwin makefile # or your system if it isn't a mac.
vi makefile # or use your favorite text editor.

# make the following changes to prefix, ZLIBLIB, ZLIBINC in the make file.
Code:

# where "make install" puts libpng.a, libpng12.dylib, png.h and pngconf.h
prefix=/usr

# Where the zlib library and include files are located
ZLIBLIB=/usr/lib
ZLIBINC=/usr/include
#ZLIBLIB=../zlib
#ZLIBINC=../zlib

#do a :wq and then.

make -j6
make install




#jpeg-6b
ln -s `which glibtool` ./libtool # Make sure the gnu libtool is used, not mac!
./configure --prefix=/usr --enable-shared
make clean
make -j6
make test
make install # if passes test, obviously!
make install-lib # it does not automatically install the library.




#tiff-v3.6.1
./configure --prefix=/usr
make clean
make
make install




#freetype-2.1.9
./configure # not much in the way of options, it installs where it wants to.
make clean
make -j6
make install




#expat-1.95.7
# expat is installed on OS X, but no .pc file, so reinstall was easier.
rm /usr/X11/lib/libexpat* # (perhaps you would like to move it instead...)
rm /usr/X11/include/expat.h # (to some backup whatever... )
make clean
make -j6
make install



#xft2.1.7 #a similar is installed in OS X, but outdated. Reinstall is a must.
# lots of deps are requred for this so I decided to fake the dep's .pc file for less work overall.
# rather than reinstall xrender, and render, and ...

rm /usr/X11/libs/libXft* #get rid of old Xft -- it is NO GOOD.
mv /usr/X11/include/X11/Xft . # this might not be the correct file, I didn't write it down.
rm -rf Xft
rm /usr/lib/pkgconfig/xft.pc

vi /usr/lib/pkgconfig/xrender.pc # or use your favorite word processor, text only!

Code:

prefix=/usr/X11
exec_prefix=/bin
libdir=${prefix}/lib
includedir=${prefix}/include

Name: Xrender
Description: X Render Library
Version: 1.2
Requires:
Cflags: -I${includedir}
Libs: -L${libdir} -lXrender -lX11

# save the file, [esc] followed by :wq [enter] from vi

./configure --prefix=/usr/X11
make clean
make -j6
make install
mv /usr/X11/lib/pkgconfig/xft.pc /usr/lib/pkgconfig/ # all .pc files in one place for me.




#pango-1.8.1
#This is a *&*&!@@@! if not right.
# Make clean seems very important if you need to redo anything that went before!
./configure --prefix=/usr
make -j6

#After ./configure the last line should say:
#configuration:
# backends: FreeType X Xft

# FreeType and Xft must *both* be there.
# else go back and figure out what went wrong.





#atk-1.9.0
./configure --prefix=/usr # debated this, should it be in X11 w/ gtk?
make clean
make -j6
make install




#gtk+2.6.7
./configure --prefix=/usr/X11
make clean
make -j6 # Go get coffee or whatever.
make -j6 cheks # lots more coffee. Take a walk.
make install
mv /usr/X11/lib/pkgconfig/* /usr/lib/pkgconfig/ # all in one place again.
cd tests
./testgtk # that should be it. all installed and a handy test will come

So NOW if I blow my system up, I can always come back here and do it nearly the right way the first time, and so can you. :)


All times are GMT -5. The time now is 08:36 PM.