#! /bin/sh

if test $# != 1; then
  echo usage: update-gtk-immodules host_triplet 1>&2
  exit 1
fi
 
umask 022
# Deriving /etc/gtk-2.0/$host location
#
# autoconf changes linux to linux-gnu
case "$1" in
  *linux) host="$1-gnu"
  ;;
  *) host=$1
  ;;
esac

# autoconf uses powerpc not ppc
host=`echo $host | sed "s/^ppc/powerpc/"`

case "$host" in
  alpha*|ia64*|powerpc64*|s390x*|x86_64*)
   /usr/bin/gtk-query-immodules-2.0-64 > /etc/gtk-2.0/$host/gtk.immodules
   ;;
  *)
   /usr/bin/gtk-query-immodules-2.0-32 > /etc/gtk-2.0/$host/gtk.immodules
   ;;
esac
