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