Bounty Request: small sample autoconf-like app/lib

L

Luis Lavena

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 :)

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.

=3D=3D=3D

Requirements:

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

$ sh configure --prefix=3D/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=3D/installed/path --host=3Di686-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=3D.exe or EXE=3D for non-Windows.

$ make

It is expected to work :)

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)

=3D=3D=3D

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 GitH=
ub.

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,
--=20
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
 
B

Brian Candler

Luis Lavena 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?
 
N

Nikolai Weibull

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_aut=
omake_libtool

it=E2=80=99s a great book and it contains more or less all the information
that you will ever need on the autotools.
 
L

Luis Lavena

I would suggest that you read

http://www.freesoftwaremagazine.com/books/autotools_a_guide_to_autoconf_a= utomake_libtool

it=92s 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,
--=20
Luis Lavena
AREA 17
-
Perfection in design is achieved not when there is nothing more to add,
but rather when there is nothing more to take away.
Antoine de Saint-Exup=E9ry
 
L

Luis Lavena

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

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.
 
B

Brian Candler

Luis Lavena 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.
 
L

Luis Lavena

Luis Lavena wrote in post #995432:



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?

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?
 
J

Justin Collins

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,

Given your many contributions to the community, I think it's fine if you
want to let someone else handle this one :)

-Justin
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,767
Messages
2,569,570
Members
45,045
Latest member
DRCM

Latest Threads

Top