automake / autoconf question
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > automake / autoconf question




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    automake / autoconf question  
Erwan Loisant


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 07:48 AM

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 a follow-up to this message ]



    Re: automake / autoconf question  
Heiko


Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

Erwan 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 a follow-up to this message ]



    Re: automake / autoconf question  
Måns Rullgård


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

Heiko <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 a follow-up to this message ]



    Re: automake / autoconf question  
Heiko


Report This Message To A Moderator Edit/Delete Message


 
10-25-04 10:52 PM

Må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 a follow-up to this message ]



    Re: automake / autoconf question  
Erwan Loisant


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
10-26-04 07:47 AM

It works. Thank you very much!






[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 12:52 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register