4 # This is a wrapper script used to help gerbv find its scheme init file
5 # when testing out gerbv prior to installation.
7 # If the first argument is "-gdb" then run gerbv inside the gdb
10 # Use --g-fatal-warnings to cause gtk-WARNING's to
17 $0 - tests out gerbv prior to installation
19 $0 [-gdb] [-h|--help] [--] [gerbv arguments]
23 -gdb - runs gerbv in the GDB debugger
25 -h|--help - displays this message and exits
27 -- - halts all further option processing all additional options
28 are passed down to gerbv.
35 for information on the gerbv options
41 while test $# -gt 0 ; do
59 echo "$0: Unknown option $1"
60 echo "See $0 --help for more information."
70 # We do this hack because if there is a libgerbv already installed in the
71 # same location as some of the libs like gtk, then we will pick up the
72 # installed libgerbv at runtime instead of the one we just built. This can
73 # lead to extreme frustration when trying to understand why changes to the code
74 # do not change the way the program works! This makes sure we pick up our
75 # newly built libgerbv first.
77 # This hack came from wcalc.
79 LIBGERBV_DIR
=@BUILDDIR@
/.libs
80 if test "X${LD_LIBRARY_PATH}" = "X" ; then
81 LD_LIBRARY_PATH
=${LIBGERBV_DIR}
83 LD_LIBRARY_PATH
=${LIBGERBV_DIR}:${LD_LIBRARY_PATH}
85 export LD_LIBRARY_PATH
86 echo "Set LD_LIBRARY_PATH to ${LD_LIBRARY_PATH}"
88 if test "X${LD_RUN_PATH}" = "X" ; then
89 LD_RUN_PATH
=${LIBGERBV_DIR}
91 LD_RUN_PATH
=${LIBGERBV_DIR}:${LD_RUN_PATH}
94 echo "Set LD_RUN_PATH to ${LD_RUN_PATH}"
96 if test "X${LD_PRELOAD}" = "X" ; then
97 LD_PRELOAD
=${LIBGERBV_DIR}/libgerbv.so
99 LD_PRELOAD
=${LIBGERBV_DIR}/libgerbv.so
:${LD_PRELOAD}
102 echo "Set LD_PRELOAD to ${LD_PRELOAD}"
104 GERBV
=@BUILDDIR@
/gerbv
106 mv -f ${GERBV} ${GERBV}.orig
108 -e 's;LD_LIBRARY_PATH="/;LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/;g' \
109 -e 's;LD_RUN_PATH="/;LD_RUN_PATH="${LD_RUN_PATH}:/;g' \
110 ${GERBV}.orig
> ${GERBV}
114 # End of shared lib hack
117 if test $do_gdb = yes ; then
118 # Create a temp directory in a safe manner that is only accessible by us.
119 # This will allow for safe use of temporary files.
120 tmpd
=${TMPDIR:-/tmp}/run_gerbv.$$
121 mkdir
-p -m 0700 $tmpd
123 if test $rc -ne 0 ; then
124 echo "$0: Unable to create temp directory $tmpd"
125 echo "Either the directory exists already or you do not have permissions"
129 tmpf
=${tmpd}/run_gerbv.gdb
130 echo set args
"$@" > $tmpf
131 echo set env GERBV_SCHEMEINIT @SRCDIR@
>> $tmpf
132 exec ..
/libtool
--mode=execute gdb
-x $tmpf ${GERBV}
136 GERBV_SCHEMEINIT
="@SRCDIR@"
137 export GERBV_SCHEMEINIT