Re: Using mkmf.rb / extconf.rb and autoconf/automake together
by Rudi Cilibrasi » Fri, 21 May 2004 05:29:30 GMT
k 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.
In article < XXXX@XXXXX.COM > you wrote:
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)