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