#!/bin/csh 
#
# Usage:     libs-config  [-local local_libpath] [-libonly] glib_ver gtk_ver
#
# -libonly must come after -local if the latter is specified.
#
# Use either the pkg-config on the path or the one
# specified by the "-local" flag.
#
# In either case pkg-config is passed the glib and gtk versions.
#
# The -libonly flag causes the script to print only the lib directory path.
#

set pkg_config = 'pkg-config'

if ("$1" == '-local') then				    # quotes protect the "-" in -local
  set local_path = $2
  shift ; shift
  set pkg_config = $local_path/bin/$pkg_config
  setenv PKG_CONFIG_PATH $local_path/lib/pkgconfig
endif



if ("$1" == '-libonly') then
  shift
  $pkg_config --libs-only-L $2 | sed "s/-L//g"
else
  $pkg_config  --libs $2
  shift; shift
  echo -n " "
  echo -n $*
endif


exit 0
