#!/bin/sh
#
#  wrapper for finding libmozjs.so. See https://launchpad.net/bugs/542506
#  Copyright (C) 2010, Reinhard Tartler <siretart@ubuntu.com
#
#  This program is free software; you can redistribute it and/or modify
#  it under the terms of the GNU General Public License as published by
#  the Free Software Foundation; either version 2 of the License, or
#  (at your option) any later version.

for i in /usr/lib/xulrunner-2.0b* /usr/lib/xulrunner-2.0.0.* /usr/lib/xulrunner-2.0 /usr/lib/xulrunner-1.9.2.*; do 
    if [ -f ${i}/libmozjs.so ] ; then 
        mozjs_path=${i}
        break
    fi
done

LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}$mozjs_path
export LD_LIBRARY_PATH

exec `which gxine.real` "$@"
