Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

automake / autoconf question
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" ?


Report this thread to moderator Post Follow-up to this message
Old Post
Erwan Loisant
10-25-04 08:59 AM


Re: automake / autoconf question
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.

Report this thread to moderator Post Follow-up to this message
Old Post
Heiko
10-25-04 09:01 PM


Re: automake / autoconf question
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

Report this thread to moderator Post Follow-up to this message
Old Post
Måns Rullgård
10-25-04 09:01 PM


Re: automake / autoconf question
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

Report this thread to moderator Post Follow-up to this message
Old Post
Heiko
10-25-04 09:01 PM


Re: automake / autoconf question
It works. Thank you very much!


Report this thread to moderator Post Follow-up to this message
Old Post
Erwan Loisant
10-26-04 08:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

Unix Programming archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:41 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.