#!/bin/csh -f

# If libraries.install/bin/gtk-config exists, we use our private
# gnu libs. The includes for non-gtk libs are in the same place
# as gtk, so we don't do anything special for them.

# If libraries.install/bin/gtk-config exists the args to this 
# give the locations of system wide libraries (from the _DEF file)

# The upshot of this is that for dynamic builds libraries.install and
# everything below it will have been removed, so we use the gtk-config
# that lives in /usr/local/bin on griffin2 and /usr/bin on danah.
# For static builds, libraries.install will have been rebuilt, so we
# use the gtk-config that comes with that.

if ($1 == 'gtk2') then
    echo -n "-DGTK2 "
    if (-x libraries.install/bin/pkg-config) then
        echo -n " -I`pwd`/libraries.install/include "
        setenv PKG_CONFIG_PATH `pwd`/libraries.install/lib/pkgconfig
        libraries.install/bin/pkg-config --cflags $2 $3
else
        pkg-config --cflags $2 $3
        shift; shift; shift;
        echo -n $*
        echo -n " "
    endif
else
    if (-x libraries.install/bin/gtk-config) then
         echo -n " -Ilibraries.install/include "
	 libraries.install/bin/gtk-config --cflags
    else
         echo -n $*
         echo -n " "
         gtk-config --cflags
    endif
endif
