On 2006-11-04 22:30-0500 Hazen Babcock wrote:

>
> Linking with the Tcl/Tk frameworks in the build tree (works):
>
> Linking C shared library libplplottcltkd.dylib
> cd /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/bindings/tcl && 
> /usr/local/bin/cmake -P CMakeFiles/plplottcltkd.dir/cmake_clean_target.cmake
> cd /Users/hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/bindings/tcl && 
> /usr/local/bin/cmake -E cmake_link_script CMakeFiles/ 
> plplottcltkd.dir/link.txt --verbose=1
> /usr/bin/gcc   -dynamiclib -headerpad_max_install_names -single_module -o 
> libplplottcltkd.9.2.0.dylib -install_name /Users/ 
> hbabcock/Documents/OpenSource/PLplot/plplot-CBS-1/bindings/tcl/ 
> libplplottcltkd.9.dylib "CMakeFiles/plplottcltkd.dir/tclAPI.o" 
> "CMakeFiles/plplottcltkd.dir/tclMain.o" "CMakeFiles/plplottcltkd.dir/ 
> Users/hbabcock/Documents/OpenSource/PLplot/plplot-cvs/bindings/tk/ 
> Pltk_Init.o" "CMakeFiles/plplottcltkd.dir/Users/hbabcock/Documents/ 
> OpenSource/PLplot/plplot-cvs/bindings/tk/plframe.o" "CMakeFiles/ 
> plplottcltkd.dir/Users/hbabcock/Documents/OpenSource/PLplot/plplot- 
> cvs/bindings/tk/plr.o" "CMakeFiles/plplottcltkd.dir/Users/hbabcock/ 
> Documents/OpenSource/PLplot/plplot-cvs/bindings/tk/tcpip.o" 
> "CMakeFiles/plplottcltkd.dir/Users/hbabcock/Documents/OpenSource/ 
> PLplot/plplot-cvs/bindings/tk/tkMain.o" -L/Users/hbabcock/Documents/ 
> OpenSource/PLplot/plplot-CBS-1/bindings/tcl -L/Users/hbabcock/ 
> Documents/OpenSource/PLplot/plplot-CBS-1/src -L/Users/hbabcock/ 
> Documents/OpenSource/PLplot/plplot-CBS-1/lib/csa -L/Users/hbabcock/ 
> Documents/OpenSource/PLplot/plplot-CBS-1/lib/nn -L/usr/X11R6/lib -L/ 
> usr/local/lib -ltclmatrixd -lplplotd -framework tcl -framework tk -L/ 
> usr/X11R6/lib -lSM -lICE -lX11 -lXext -lltdl -ldl -lm -lcsirocsa -lcsironn 
> -lqhull
>
>
> Linking with the Tcl/Tk frameworks in the install tree (doesn't work):
>
> iMac /usr/local/lib/pkgconfig : PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 
> pkg-config --cflags --libs plplotd-tcl
> -I/usr/local/include/plplot -I/System/Library/Frameworks/ 
> Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers 
> /System/Library/Frameworks/tcl.framework /System/Library/ 
> Frameworks/tk.framework /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/ 
> libXext.dylib /usr/lib/libltdl.dylib /usr/lib/libdl.dylib -L/usr/local/lib 
> -L/usr/X11R6/lib -lplplottcltkd -ltclmatrixd -lSM -lICE -lplplotd -lm 
> -lcsirocsa -lcsironn -lqhull
>
> [...]This also does not work (I edited the plplotd-tcl.pc to be closer to the 
> build tree linking command).
>
> iMac /usr/local/lib/pkgconfig : more plplotd-tcl.pc
> libdir=/usr/local/lib
> includedir=/usr/local/include/plplot
> drvdir=/usr/local/lib/plplot5.6.1/driversd
>
> Name: PLplot Tcl/Tk
> Description: Scientific plotting library (Tcl/Tk bindings, double precision)
> Requires: plplotd
> Version: 5.6.1
> Libs: -L${libdir} -lplplottcltkd -ltclmatrixd -framework tcl -framework tk 
> -L/usr/X11R6/lib -lSM -lICE /usr/X11R6/lib/libX11
> .dylib /usr/X11R6/lib/libXext.dylib
> Cflags: -I${includedir} -I/System/Library/Frameworks/Tcl.framework/Headers 
> -I/System/Library/Frameworks/Tk.framework/Headers
> -I/usr/include -I/usr/include -I/usr/include
>
> [...]iMac /usr/local/lib/pkgconfig : PKG_CONFIG_PATH=/usr/local/lib/pkgconfig 
> pkg-config --cflags --libs plplotd-tcl
> -I/usr/local/include/plplot -I/System/Library/Frameworks/ 
> Tcl.framework/Headers -I/System/Library/Frameworks/Tk.framework/Headers 
> -framework tk tcl /usr/X11R6/lib/libX11.dylib /usr/X11R6/lib/libXext.dylib 
> /usr/lib/libltdl.dylib /usr/lib/libdl.dylib -L/usr/local/lib -L/usr/X11R6/lib 
> -lplplottcltkd -ltclmatrixd -lSM -lICE -lplplotd -lm -lcsirocsa -lcsironn 
> -lqhull
>
> It looks like the problem might be that pkg-config decided to roll the 2 
> -frameworks into one (i.e. "-framework tcl -framework tk" became "-framework 
> tcl tk"). Assuming that this this is the problem, how does one prevent 
> pkg-config from being quite so clever?

It appears from comparison between the good and bad linking commands above
that the plplot-tcl.pc file should transform

/System/Library/Frameworks/tcl.framework ==> -framework tcl

and similarly for tk.

Also, all the direct specification of *.dylib libraries should be
transformed into the -L -l form.  (This is the form that worked for the good
linking command above. Also, my experience with Linux is pkg-config
handles specifying libraries with -L and -l options much better than using
the actual library name.)

The only potential problem with these changes is when you tried that first
transformation by hand editing plplot-tcl.pc, one of the essential
"-framework" strings was not emitted by pkg-config.  That's really peculiar.
Could you try the following simple example to see what you get on your system?

*****test.pc  (simplest possible example)
[EMAIL PROTECTED]> cat test.pc
Name:
Description:
Requires:
Version:
Libs: -framework tcl -framework tk
Cflags:

On my Linux system both -framework options are emitted properly by pkg-config:

[EMAIL PROTECTED]> PKG_CONFIG_PATH=. pkg-config --libs test
-framework tcl -framework tk

If you also get the right result for this simple case, then it's possible
that the *.dylib form of library name was confusing pkg-config in the more
complicated plplot-tcl.pc case. To test that possibility, I have gone ahead
and made the above two transformations (framework and *.dylib) in CVS. Will
you please give that changed version a try?

Alan
__________________________
Alan W. Irwin

Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).

Programming affiliations with the FreeEOS equation-of-state implementation
for stellar interiors (freeeos.sf.net); PLplot scientific plotting software
package (plplot.org); the Yorick front-end to PLplot (yplot.sf.net); the
Loads of Linux Links project (loll.sf.net); and the Linux Brochure Project
(lbproject.sf.net).
__________________________

Linux-powered Science
__________________________

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Plplot-devel mailing list
Plplot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-devel

Reply via email to