| 1 |
#!/bin/csh |
| 2 |
# |
| 3 |
# Usage: libs-config [-local local_libpath] [-libonly] glib_ver gtk_ver |
| 4 |
# |
| 5 |
# -libonly must come after -local if the latter is specified. |
| 6 |
# |
| 7 |
# Use either the pkg-config on the path or the one |
| 8 |
# specified by the "-local" flag. |
| 9 |
# |
| 10 |
# In either case pkg-config is passed the glib and gtk versions. |
| 11 |
# |
| 12 |
# The -libonly flag causes the script to print only the lib directory path. |
| 13 |
# |
| 14 |
|
| 15 |
set pkg_config = 'pkg-config' |
| 16 |
|
| 17 |
if ("$1" == '-local') then # quotes protect the "-" in -local |
| 18 |
set local_path = $2 |
| 19 |
shift ; shift |
| 20 |
set pkg_config = $local_path/bin/$pkg_config |
| 21 |
setenv PKG_CONFIG_PATH $local_path/lib/pkgconfig |
| 22 |
endif |
| 23 |
|
| 24 |
|
| 25 |
|
| 26 |
if ("$1" == '-libonly') then |
| 27 |
shift |
| 28 |
$pkg_config --libs-only-L $2 | sed "s/-L//g" |
| 29 |
else |
| 30 |
$pkg_config --libs $2 |
| 31 |
shift; shift |
| 32 |
echo -n " " |
| 33 |
echo -n $* |
| 34 |
endif |
| 35 |
|
| 36 |
|
| 37 |
exit 0 |