]> git.lyx.org Git - lyx.git/blob - config/hack-gcc
literate fix from Kayvan A. Sylvan
[lyx.git] / config / hack-gcc
1 #!/bin/sh 
2 # This is hack-gcc, an ugly hack to force gcc to recompile without
3 # optimization when an error occurs. It is meant as wrapper around gcc
4 # that works around compiler bugs when optimization is on . Do what
5 # you want with this code.  
6
7 # Author Jean-Marc Lasgouttes (Jean-Marc.Lasgouttes@inria.fr)
8
9 ARGS=`echo "$*" | sed -e 's/\"/\\\"/g`
10
11 if test "x$ARGS" = x ; then
12   echo "usage: $0 [gcc name] [normal gcc options]"
13   exit 0
14 fi
15
16 if eval "$ARGS" ; then
17   exit 0
18 else
19   echo "$0: an error occurred, retrying without optimization." >&2
20   eval `echo $ARGS | sed -e 's/-O[0-9]*//'`
21 fi