#! /bin/bash

#  Copyright (C) 2005 Stanislav Brabec <sbrabec@suse.cz>, SuSE CR
#    
# This program is free software; you can redistribute it and/or   
# modify it under the terms of the GNU Lesser General Public License   
# (LGPL) version 2.1  
#   
# See http://www.gnu.org/copyleft/lesser.html 
#  
# This program is distributed in the hope that it will be useful,        
# but WITHOUT ANY WARRANTY; without even the implied warranty of        
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 

declare -a args
CMD='exec pkg-config gdk-pixbuf-2.0 "${args[@]}"'
for arg in "$@" ; do
    case "$arg" in
	gtk | gdk-pixbuf )
	    args[${#args[@]}]="$arg-2.0"
	    ;;
	glib | gmodule | gthread )
	    unset args[${#args[@]}]
	    ;;
	--version )
	    args[${#args[@]}]=--modversion
	    CMD='pkg-config gdk-pixbuf-2.0 "${args[@]}" | tail -n 1'
	    ;;
	--cflags )
	    if test -z "$GTK1_COMPAT_DISABLE_C_SUPPORT" ; then
		echo -n "`$PKG_CONFIG --cflags gtk1-compat` "
	    fi
	    args[${#args[@]}]=$arg
	    ;;
	* )
	    args[${#args[@]}]=$arg
	    ;;
    esac
done
#echo -e >&2 "\n*** gtk1-compat simulation: ***"
#echo >&2 "Command:     gtk-config $*"
#eval echo >&2 "Replaced by: $CMD"

eval $CMD
