Subject: [Classpathx-crypto] Makefile

From: Nic Ferrier <[email-masked]>
Date: Sun, 16 Dec 2001 23:41:13 +0000

Just to let you know: I am working on this issue. I've been busy with
work (last week at my old contract, new contract this week!) and I
haven't had much time.

However, I did solve the central portability problem of my original
makefile: the path separator used (I had hard coded ':').

I've solved it by using a functional system (the GNU Make @(call)
construct allows a certain amount of functionalism).

It strikes me that if I solve the $(wildcard) problem then I won't
have to use the shell script trick and that might mean that a native
windows make might work.

I'm still working on it... I'll try and get it done this week... I'm
really sorry for the delay.

If you guys want to go ahead with an ANT based release then let me
know.

Nic

---

From: "Raif S. Naffah" <[email-masked]>
Date: Mon, 17 Dec 2001 18:54:40 +1100

>work (last week at my old contract, new contract this week!) and I

no worries. it's xmas anyway :-)

>construct allows a certain amount of functionalism).

we use a trick (see the Makefile.in), where we do:

(line #119):

# a workaround to allow using the same Makefile under both Unix and NT
ifeq (${OS},Windows_NT)
         PS:=;
else
         PS:=:
endif

and then use ${PS} everywhere we need to separate path-elements.

>If you guys want to go ahead with an ANT based release then let me

i'd suggest we do a release with ANT if we're going to standardise on ANT 
in classpathx projects.  if not, i'd rather wait and have a common 'way' 
for building; ie. make with ANT as an alternative.

if any other project/team-leader is willing to adopt ANT, i'm happy to help 
so we can harmonise the use of ANT across multiple projects.

>Nic

cheers;
rsn

---

From: "Nic Ferrier" <[email-masked]>
Date: Mon, 17 Dec 2001 11:15:02 -0000

> and then use ${PS} everywhere we need to separate path-elements.

Yes. I've fixed that by using this functional system.

> for building; ie. make with ANT as an alternative.

I'd rather not dictate the use ANT across the board... if we move to that
gradually that would be fine. I still prefer Autoconf/Make because that is
the GNU standard and because it handles native code better... given the
importance of GCJ in the "strategy" native code may become important.

Having said that I think ANT will become important as it matures and more
java programmers come to GNU from other environments.

> so we can harmonise the use of ANT across multiple projects.

Thanks Raif.

Nic

---

From: Olivier LF <[email-masked]>
Date: Mon, 17 Dec 2001 23:16:31 +1100

> # a workaround to allow using the same Makefile under both Unix and NT

Autoconf seems to take care of that. This is the code generated in the 
configure script:

# Rewrite early, but we need PATH_SEPARATOR.
# The user is always right.
if test "${PATH_SEPARATOR+set}" != set; then
  echo "#! $SHELL" >conftest.sh
  echo  "exit 0"   >>conftest.sh
  chmod +x conftest.sh
  if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then
    PATH_SEPARATOR=';'
  else
    PATH_SEPARATOR=:
  fi
  rm -f conftest.sh
fi

I rely on this in my autoconf/automake example for gnu-crypto.
However...
apparantly it doesn't work on cygwin. I suspect it is because I also
have to add double quotes all over the place, something like:

   jikes -classpath "pkg1@PS@pkg2" ...

to prevent the shell from resolving the semicolon as the "end of
command" character. It used to work on cygwin but I haven't try it for
few weeks.

However going back to the earlier Makefile discussion, I've cut and paste 
portions of the make process generated by automake/autoconf scripts for 
GCJ compilation and shared libraries. As you can see, it is not exactly 
trivial or intuitive. 
Do you really want to reinvent all of that while automake, a GNU tool 
Copyrighted by the FSF, is out there?

Olivier

Making all in source
make[1]: Entering directory `/home/olivier/tmp/crypt/source'
gcj -C --encoding=UTF-8 -fCLASSPATH=/home/olivier/program/cvs/classpathx/crypto/source -d . /home/olivier/program/cvs/classpathx/crypto/source/gnu/crypto/cipher/Anubis.java
...
...
make  all-am
make[2]: Entering directory `/home/olivier/tmp/crypt/source'
source='gnu/crypto/cipher/Anubis.java' object='gnu/crypto/cipher/Anubis.lo' libtool=yes \
depfile='.deps/gnu/crypto/cipher/Anubis.Plo' tmpdepfile='.deps/gnu/crypto/cipher/Anubis.TPlo' \
depmode=gcc3 /bin/sh /home/olivier/program/cvs/classpathx/crypto/depcomp \
/bin/sh ../libtool --mode=compile gcj --encoding=UTF-8 -fassume-compiled -fCLASSPATH=/home/olivier/program/cvs/classpathx/crypto/source -g -O2 -c -o gnu/crypto/cipher/Anubis.lo `test -f gnu/crypto/cipher/Anubis.java || echo '/home/olivier/program/cvs/classpathx/crypto/source/'`gnu/crypto/cipher/Anubis.java
rm -f gnu/crypto/cipher/.libs/Anubis.lo
gcj --encoding=UTF-8 -fassume-compiled -fCLASSPATH=/home/olivier/program/cvs/classpathx/crypto/source -g -O2 -c /home/olivier/program/cvs/classpathx/crypto/source/gnu/crypto/cipher/Anubis.java -MT gnu/crypto/cipher/Anubis.lo -MD -MP -MF .deps/gnu/crypto/cipher/Anubis.TPlo  -fPIC  -o gnu/crypto/cipher/Anubis.o
mv -f gnu/crypto/cipher/Anubis.o gnu/crypto/cipher/.libs/Anubis.lo
gcj --encoding=UTF-8 -fassume-compiled -fCLASSPATH=/home/olivier/program/cvs/classpathx/crypto/source -g -O2 -c /home/olivier/program/cvs/classpathx/crypto/source/gnu/crypto/cipher/Anubis.java -MT gnu/crypto/cipher/Anubis.lo -MD -MP -MF .deps/gnu/crypto/cipher/Anubis.TPlo -o gnu/crypto/cipher/Anubis.o >/dev/null 2>&1
mv -f gnu/crypto/cipher/.libs/Anubis.lo gnu/crypto/cipher/Anubis.lo
...
...
/bin/sh ../libtool --mode=link gcj --encoding=UTF-8 -fassume-compiled -fCLASSPATH=/home/olivier/program/cvs/classpathx/crypto/source -g -O2   -o lib-gnu-crypto.la -rpath /home/olivier/tmp/ooo/lib -version-info 1:0 gnu/crypto/cipher/Anubis.lo gnu/crypto/cipher/BaseCipher.lo gnu/crypto/cipher/CipherFactory.lo gnu/crypto/cipher/IBlockCipher.lo ... ... ... ...
mkdir .libs
rm -fr .libs/lib-gnu-crypto.la .libs/lib-gnu-crypto.* .libs/lib-gnu-crypto.*
gcc -shared  gnu/crypto/cipher/Anubis.lo gnu/crypto/cipher/BaseCipher.lo gnu/crypto/cipher/CipherFactory.lo ... ... ... ...  -lc  -Wl,-soname -Wl,lib-gnu-crypto.so.1 -o .libs/lib-gnu-crypto.so.1.0.0
(cd .libs && rm -f lib-gnu-crypto.so.1 && ln -s lib-gnu-crypto.so.1.0.0 lib-gnu-crypto.so.1)
(cd .libs && rm -f lib-gnu-crypto.so && ln -s lib-gnu-crypto.so.1.0.0 lib-gnu-crypto.so)
ar cru .libs/lib-gnu-crypto.a  gnu/crypto/cipher/Anubis.o gnu/crypto/cipher/BaseCipher.o ... ... ... ...
ranlib .libs/lib-gnu-crypto.a
creating lib-gnu-crypto.la
(cd .libs && rm -f lib-gnu-crypto.la && ln -s ../lib-gnu-crypto.la lib-gnu-crypto.la)

-- 
----------------------------------------------------------------------
Olivier Louchart-Fletcher
Email: [email-masked]

---

From: "Nic Ferrier" <[email-masked]>
Date: Mon, 17 Dec 2001 12:35:38 -0000

> Copyrighted by the FSF, is out there?

The trouble is automake (the version that widely installed) has some
issues... my bodged makefile is not actually that much work and therefore
I don't mind maintaining it until automake becomes a realistic option.

I wouldn't object to any project using automake as long as they maintain
it themselves.

But on the other hand my bodge makefile does the job (or can do the job)
quite well.

Nic