Ok very good, I have just a few more questions:
I was referred to RMagick as a good example to follow, and it does use
autoconf but not automake. Does anybody know of one example ruby program
that uses autoconf and automake, as most Gnu utilities now do, in combination
with any of the standard Ruby installation methods? I would
like to see details of how people have interfaced the two, because it seems
nearly impossible to do elegantly.
I have read that the setup.rb script scans the directories such as bin/
and installs everything in these directories. Isn't this incompatible
with autoconf / automake? For example, in automake, I specify explicitly
what programs to compile, which files are in the source distribution, and
anything that is not listed is not used. Is there some way to tell the
setup.rb script to only install some of the files in the bin/ directory?
The exact case of this problem is visible in one of my packages that you
can download from
http://complearn.sourceforge.net/
Here, I solve the
#!/nobody/knows/where/to/find/ruby
script problem by using autoconf to first determine where Ruby is installed,
then using @RUBYBIN@ type autoconf substitutions to convert my shell
scripts that start with names like
maketree.in
and become (when translated and variable-substituted)
maketree
with the correct line on top. It seems the setup.rb script duplicates this
functionality to some extent. Unfortunately, since I keep my .in files
in the bin/ directory along with the "final" versions of my scripts, I
am afraid setup.rb would incorrectly install my files such as maketree.in
in the installation bin/ directory, and this is not what I want. I only
want 1/2 the files in there to be installed, and I want to say which ones
exactly.
An extension library's installation directory is fixed as
supplied by rbconfig.rb, and CC must match with ruby's one.
You need proper rbconfig.rb to cross-compile.
Thanks for these answers Nobu. I am afraid I still do not totally understand
the solution to my problems however.
My complearn project is written to build under Windows (MinGW) or Linux.
I have a shell script there, "scripts/makeall.zsh",
(
http://cvs.sourceforge.net/viewcvs.py/complearn/complearn/scripts/makeall.zsh?view=markup)
that builds a .tar.gz source
distribution, a Debian package, and a Windows version using the MinGW
cross-compiler and Inno Setup, then uses ncftpput to ftp send the new
version up to SourceForge. It works well enough now, but you will see I
needed to pre-generate a Makefile under Windows (using ruby extconf.rb now)
and then edit it by hand in order to get this to work correctly. This is
obviously going to be painful to maintain over time as Ruby and my project
change, because I will have to remodify this Makefile by hand.
I have read through the small documentation I can find on setup.rb and
still cannot understand what is the correct way for me to structure this
project, or even how to tell it not to use gcc but instead
CC = i586-mingw32msvc-gcc
when cross-compiling? Right now, I use a command like the following in
my "makeSetup.sh" shell script to build a Windows version under Linux:
../configure --enable-winbuild --prefix=@TOPDIR@/scripts/buildtmp
(from
http://cvs.sourceforge.net/viewcvs.py/complearn/complearn/scripts/makeSetup.sh.in?view=markup)
And then within my configure.ac:
(see
http://cvs.sourceforge.net/viewcvs.py/complearn/complearn/configure.ac?view=markup)
AC_ARG_ENABLE(winbuild, "Cross compile for windows MinGW/MSYS", winbuild=true,
winbuild=false)
....
if $winbuild ; then
cp ext/winbuild/Makefile.winbuild ext/Makefile
else
AC_CONFIG_COMMANDS([ext/Makefile],[cd $srcdir/ext ; $RUBYBIN extconf.rb ; echo
'distdir:' >> Makefile ], [RUBYBIN=$RUBYBIN])
fi
In other words, I only run my extconf.rb script if I am not cross-compiling.
The ext/winbuild/Makefile.winbuild is my hand-editted Makefile.
I want to be able to build all 3 of my packaging formats
(.tar.gz, Debian i386 package, Windows i386 self-installing executable) using
one shell script meant to run under Linux. Can you explain more about the
right way to do this? Or was this sort of thing never intended to work with
the Ruby configuration system? I am wondering what the right approach should
be in this case.
Thanks for all the help everybody,
Rudi
--Multipart_Wed_May_19_08:58:06_2004-1--