Re: Building classpath with ecj

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/04/2008, Michael Franz <mvfranz@xxxxxxxxx> wrote:
>
>
> On Mon, Apr 7, 2008 at 5:50 AM, Andrew John Hughes
> <gnu_andrew@xxxxxxxxxxxxxx> wrote:
> >
> >
> >
> > On 07/04/2008, Christian Thalinger <twisti@xxxxxxxxxxxxxxxxxxxxx> wrote:
> > > On Sun, 2008-04-06 at 15:47 -0700, mvfranz wrote:
> > >  > I would like to fix this in the ecj script for OS X, however I spent
> the
> > >  > afternoon trying to script something together that would strip -J
> parameters
> > >  > and pass them to the JVM that runs ecj.  I get this to work for some
> > >  > parameters but not others.  Sometimes quoting works sometimes it
> doesn't.
> > >  >
> > >  > Is there an installation of ecj that handles the -J parameters
> correctly?
> > >  > Anyone have bash scripts to handle this?
> > >
> > >
> > > I did this a while ago to bootstrap OpenJDK:
> > >
> > >  ARGS=""
> > >
> > >  for ARG in "$@"; do
> > >     OUT=`echo "$ARG" | grep "^-J"`
> > >     if [ "$OUT" = "" ]; then
> > >         ARGS="$ARGS $ARG"
> > >     fi
> > >  done
> > >
> > >  Maybe that helps.
> > >
> > >  - twisti
> > >
> > >
> > >
> >
> > That's ok if you just want to drop them.  Supporting them is a little
> > trickier, and involves chopping the -J and moving the rest of the
> > option prior to the classname.
> >
> >
> >
> > --
> > Andrew :-)
> >
>
> I am not interested in dropping them  - that is easy.  I want to split them
> up and pass them to correct process.
>
> JVM_ARGS=
> ARGS=
>
> while [ $# -gt 0 ] ; do
>     case "$1" in
>          -J*) jopt=${1#\-J} ; JVM_ARGS="$JVM_ARGS $jopt";;
>         *) ARGS="$ARGS $1" ;;
>     esac
>     shift
> done
>
> This works most of the time, unless the parameters are empty '' or have
> special values that need to have single quotes around them.
>  Blindly single quoting also has bad side effects on some arguments.
>
>
>
>

Exactly.  I found this difficult to do purely in Bash script too, so
went for the C option.
-- 
Andrew :-)

Support Free Java!
Contribute to GNU Classpath and the OpenJDK
http://www.gnu.org/software/classpath
http://openjdk.java.net

PGP Key: 94EFD9D8 (http://subkeys.pgp.net)
Fingerprint: F8EF F1EA 401E 2E60 15FA  7927 142C 2591 94EF D9D8


[Index of Archives]     [Linux Kernel]     [Linux Cryptography]     [Fedora]     [Fedora Directory]     [Red Hat Development]

  Powered by Linux