Code Comments
Programming Forum and web based access to our favorite programming groups.Hello. I am packaging a library I made, and I have a (I think) basic question on automake/autoconf. I am new to comp.unix.programmer and I hope my question is not off-topic. This is a C library, and I found good documentation on how to package it in a clean way. However I also have Ruby bindings (a scripting language) and to produce the Makefile of these bindings I need to launch a given command (actually "ruby extconf.rb". How can I modify my configure.in to say "in this directory, please launch the given command /then/ make" ?
Post Follow-up to this messageErwan Loisant wrote: > to produce the Makefile of these bindings I need to > launch a given command (actually "ruby extconf.rb". > > How can I modify my configure.in to say "in this directory, please > launch the given command /then/ make" ? AFAIK you can just put your ruby command in configure.in. Something like: AC_INIT([My Program], [0.2], [you@somewhere.com], [myprog]) AC_CONFIG_SRCDIR([main.c]) AC_PREREQ(2.57) AM_INIT_AUTOMAKE AC_CONFIG_HEADERS([config.h]) AC_PROG_CC AC_PROG_INSTALL cd ruby/bindings/directory ruby extconf.rb AC_CONFIG_FILES([Makefile]) AC_OUTPUT There's probably a more elegant way to do this, but for just one ruby-command I wouldn't bother if it works. Heiko P.S. Note this example is actually for a autoconf version > 2.5x, but this shouldn't make for your question.
Post Follow-up to this messageHeiko <heiko.noordhof_A_xs4all.nl> writes: > Erwan Loisant wrote: > > > AFAIK you can just put your ruby command in configure.in. Something like: > > AC_INIT([My Program], [0.2], [you@somewhere.com], [myprog]) > AC_CONFIG_SRCDIR([main.c]) > AC_PREREQ(2.57) > AM_INIT_AUTOMAKE > AC_CONFIG_HEADERS([config.h]) > AC_PROG_CC > AC_PROG_INSTALL > > cd ruby/bindings/directory > ruby extconf.rb Never change directories like that, do something like this instead: (cd ruby/bindings/directory && ruby extconf.rb) This will run the cd and ruby comands in a subshell, so the working directory of the configure script doesn't change. -- Måns Rullgård mru@inprovide.com
Post Follow-up to this messageMåns Rullgård wrote: > Heiko <heiko.noordhof_A_xs4all.nl> writes: > > > Never change directories like that, do something like this instead: > > (cd ruby/bindings/directory && ruby extconf.rb) > > This will run the cd and ruby comands in a subshell, so the working > directory of the configure script doesn't change. Oops... Thanks for pointing that out. Heiko
Post Follow-up to this message
Show a Printable Version
Email This Page to Someone!
Receive updates to this thread
Powered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.