This is the mail archive of the kawa@sources.redhat.com mailing list for the Kawa project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Compiling kawa with cygwin


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]