Bounty Request: small sample autoconf-like app/lib

Hello,

This request might sounds weird, but I’m working on a small project
that will help with RubyInstaller internal structure, maintenance and
will help other projects when combined with tools like rake-compiler
to build stuff more properly.

The ones following me on GitHub might have noticed the project that
I’m working on, well, that one :slight_smile:

I’ve been looking into several projects that are autoconf-based and
most of them are huge. I need something fast and slim that can provide
me a series of building blocks for this. The idea of this sample
application is be part of a testing infrastructure.

This package should be able to generate a executable file (myapp.exe)
and a static library (libmylib.a) placed in bin and lib directory
after the normal configure, make, make install flow.

===

Requirements:

‘configure’ script should be able to support a --prefix option to
define the installation directory, e.g.:

$ sh configure --prefix=/installed/path

It also should be able to support --host, --target and --build options
for cross-compilation, but the only one for cross compilation is
–host and the value provided to it will be used to prefix GCC, AR,
RANLIB, LD and others later in the process, e.g.:

$ sh configure --prefix=/installed/path --host=i686-w64-mingw32

For the cases of --host not defined, you can use GNU config.guess
(http://savannah.gnu.org/projects/config) to determine the current
platform host.

Now, it is time for make. Invoking ‘make’ should use the configure
generated Makefile (could use sed + Makefile.in) and build myapp.exe,
libmylib.a. Please note that on non-Windows platforms is required to
generate myapp as executable, so you can use tricks like myapp$(EXE)
in the Makefile and have it define EXE=.exe or EXE= for non-Windows.

$ make

It is expected to work :slight_smile:

The last step is installation, e.g.:

$ make install

Is expected to copy over the generated myapp.exe, libmylib.a into the
prefix’s bin and lib directory respectively. It is also required it
copy mylib.h into prefix’s include directory.

The target structure should be:

bin/myapp{.exe}
include/mylib.h
lib/libmylib.a

The source files provided could be:

configure (plain sh script)
myapp.c
mylib.c
mylib.h
Makefile.in (possible template for use with sed by configure)

===

While I could have learned autoconf myself (with LOT of time), the
size of any of the packages I autoconf-based packages are huge
compared to what I need, making things really hard for me (everybody
knows that I’m lazy)

I hope someone more fluent on sh/make can take a stab on this and
perhaps help me out.

The conditions: be MIT licensed and be provided in a Git repository on
GitHub.

I have 50 USD dollars (plus Paypal fee) ready for the one that can
provide this.

What do you guys think? Let me know if you need further details before
starting to work on this.

Thank you for your time and if you know who could be interested in
this, spread the word!

Regards,

Luis L. wrote in post #995383:

Requirements:

‘configure’ script should be able to support a --prefix option to
define the installation directory, e.g.:

$ sh configure --prefix=/installed/path

Does it have to be a shell script? Could it be in ruby? Have you looked
at mkmf.rb?

On Wed, Apr 27, 2011 at 22:07, Luis L. [email protected] wrote:

While I could have learned autoconf myself (with LOT of time), the
size of any of the packages I autoconf-based packages are huge
compared to what I need, making things really hard for me (everybody
knows that I’m lazy)

I would suggest that you read

http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_automake_libtool

it’s a great book and it contains more or less all the information
that you will ever need on the autotools.

On Apr 27, 6:11pm, Brian C. [email protected] wrote:

The idea is that mimics as close as possible what autotools
‘configure’ provides.

Since the invocation to configure goes with ‘sh’ I think sticking to
sh will be closest as possible.

Now, configure script is just the initial part, the biggest part is
Makefile itself.

I found amhello as part of automake source samples and started to use
that for a cross-compilation executable, but it doesn’t provide the
other parts that I’ve mentioned are required.

mkmf will not provide standalone generation of libraries/programs. I
mean, you can but it doesn’t make things easy.

Also, I might want to do cross-compilation and that is something mkmf
can’t handle out of the box without lot of tweaking.

Luis L. wrote in post #995432:

The idea is that mimics as close as possible what autotools
‘configure’ provides.

Since the invocation to configure goes with ‘sh’ I think sticking to
sh will be closest as possible.

OK. It seems like you’re saying you want someone to rewrite autoconf for
you, with full cross-compilation and multi-platform support, and
presumably better documentation and examples than autoconf has
(otherwise you’d just be using autoconf), for 50 bucks?

Another idea is to try to borrow code from a different project which
already does cross-compilation. Openwrt is one which springs to mind.
That has a set of Makefiles which will build the whole cross-compilation
tool chain for you as well - admittedly the Makefiles are rather complex
though. And it doesn’t build Windows executables.

On Apr 28, 4:18am, Brian C. [email protected] wrote:

presumably better documentation and examples than autoconf has
(otherwise you’d just be using autoconf), for 50 bucks?

No, I’m not saying recreate autoconf, that is not the idea. I don’t
want to exploit anyone to do that for 50 bucks, is insane.

I wanted a “mock” script that could mimic what autoconf does, it
doesn’t need to support all the flavors, platforms or anything, it
just need to be able to respond to “configure” and the generated
Makefile works.

The Makefile.in part is not that hard, is just a matter of $(PREFIX)
in front of all the CC, LD and others. If prefix is empty, then the
local versions will be used.

I’ve managed to use something similar to what zlib does, the problem
with zlib’s configure does not work on MinGW, it uses a separate
makefile, so is not entirely cross platform.

I found that automake came with a same project named amhello, is small
(65K) and provides the executable part of my test, but it doesn’t
provide the library (lib/include) that will require for the other part
of the test.

Another idea is to try to borrow code from a different project which
already does cross-compilation. Openwrt is one which springs to mind.
That has a set of Makefiles which will build the whole cross-compilation
tool chain for you as well - admittedly the Makefiles are rather complex
though. And it doesn’t build Windows executables.

I’ve been investigating existing projects in that front for 2 months
already, I came to post this based on the lack of something that can
work under these scenarios.

So far, as mentioned about amhello does works and generate valid
binaries across platform, perhaps someone can extend it to generate
the library part?

On 04/27/2011 02:30 PM, Luis L. wrote:

On Wed, Apr 27, 2011 at 6:18 PM, Nikolai W. [email protected] wrote:

its a great book and it contains more or less all the information
that you will ever need on the autotools.

Thank you Nikolai,

Actually I remember reading it not long ago. Is not a matter of
completely not knowing, but is a matter of time constrains.

As I mentioned (and you kindly quoted): I’m, very lazy, everybody
knows that about me.

If I need to do something twice, I automate it.

While I can sit, read and learn the whole toolset, I rather prefer be
more proficient in other aspects.

But thank you for the link, perhaps someone interested in learning
this can take advantage of it.

Regards,

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs