This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Compiling kawa with cygwin
- From: Per Bothner <per at bothner dot com>
- To: Weiqi Gao <weiqigao at networkusa dot net>
- Cc: kawa at sources dot redhat dot com
- Date: Wed, 20 Feb 2002 23:56:06 -0800
- Subject: Re: Compiling kawa with cygwin
- References: <000801c1ba99$e5493f70$0301a8c0@gao2001>
Weiqi Gao wrote:
> I tried to compile Kawa with Cygwin today. I've been using the pure
> Java version on Windows 2000 that is compiled with Ant, but I wanted the
> readline support. The changes needed to make the "./configure; make;
> make check; make install" sequence is almost trivial. But I don't know
> where is the best place to make the changes.
That's encouraging.
> 1. config.sub: (config.guess outputs i686-pc-cygwin).
I checked in a more recent version of config.sub, so that should
now be fixed.
> 2. The JDK (1.3.1_01)'s javac has trouble understanding UNIX style
> CLASSPATHs. So everywhere in the Makefile the construct
>
> CLASSPATH=$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH
One solution is to replace these by:
CLASSPATH=@CPATHSTART@$(JAVAROOT):$(srcdir)/$(JAVAROOT):$$CLASSPATH@CPATHEND@
and then use autoconf substitution to replace @CPATHSTART@ by
"`cygpath ..." and @CPATHEND@ by "`". in Windows The problem is you
can't have automake substitution in Make-rules, since Make-rules is
itself an automake substition. We could solve this my using automake
inclusion instead of autoconf file inclusion, though that requires
switching to a newer version of automake. I will try out automake 1.5
and see how it works.
An alternative is to have configure (when running under Windows) write
out a little shell script myjava.sh switch basically just invokes
cygpath and then calls java. We'd substitute myjava.sh for $(JAVA),
and also do similarly for javac.
> 3. For the KAWALIB variable in bin/Makefile, because it is used in C
> code, I have to pipe the output of cygpath through sed that turns \ into
> \\. Because of the many levels of processing and escaping, the line
> becomes
>
> WITHOUT_GCJ_DEFS = -DJAVA='"java"' -DKAWALIB=\"`cygpath --path
> --windows $(datadir)/java/kawa-$(VERSION).jar | sed
> 's/\\\\/\\\\\\\\/g'`\"
We can handle that at configure time; just add the necessary code
in configure.in to set a variable.
> 4. For some reason, the following command is executed while make is
> working in the bin directory
>
> gcc -g -O2 kawa.c -o kawa
>
> which is wrong. I have to add $(EXEEXT) to the kawa listed in the
> bin_PROGRAMS line to get the correct result.
This seems to be some automake behavior. I tried some experiments,
but ran into what seems to be bugs in automake 1.4. Another reason
to see how automake 1.5 works.
--
--Per Bothner
per@bothner.com http://www.bothner.com/per/