f82650
#! /bin/sh
f82650
f82650
if test $# != 1; then
f82650
  echo usage: update-gtk-immodules host_triplet 1>&2
f82650
  exit 1
f82650
fi
f82650
 
f82650
umask 022
f82650
# Deriving /etc/gtk-2.0/$host location
f82650
#
f82650
# autoconf changes linux to linux-gnu
f82650
case "$1" in
f82650
  *linux) host="$1-gnu"
f82650
  ;;
f82650
  *) host=$1
f82650
  ;;
f82650
esac
f82650
f82650
# autoconf uses powerpc not ppc
f82650
host=`echo $host | sed "s/^ppc/powerpc/"`
f82650
# autoconf uses ibm-linux not redhat-linux (s390x)
f82650
host=`echo $host | sed "s/^s390\(x\)*-redhat/s390\1-ibm/"`
f82650
f82650
# We have had problems in the past with build systems
f82650
# changing host from i386 to i686 and appending/dropping
f82650
# the -gnu suffix, so try to match up the $host we got
f82650
# with whats actually there.
f82650
if [ ! -d /etc/gtk-2.0/$host ]; then
f82650
   case "$host" in
f82650
     i?86*)
f82650
         for d in $(ls -d /etc/gtk-2.0/i?86* 2>/dev/null); do
f82650
           host=$(basename $d)
f82650
           break
f82650
         done
f82650
     ;;
f82650
   esac
f82650
   [ -d /etc/gtk-2.0/$host ] || exit 0
f82650
fi
f82650
f82650
FILE=/etc/gtk-2.0/$host/gtk.immodules
f82650
f82650
case "$host" in
f82650
  alpha*|ia64*|powerpc64*|s390x*|x86_64*)
f82650
   /usr/bin/gtk-query-immodules-2.0-64 > $FILE
f82650
   ;;
f82650
  *)
f82650
   /usr/bin/gtk-query-immodules-2.0-32 > $FILE
f82650
   ;;
f82650
esac