English 中文(简体)
Build system for a highly modular portable open source project [closed]
原标题:

We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.

Closed 7 years ago.

We have an Open Source software project in the very beginning. The program is thought to be highly modular: for example, the underlying database can be either sqlite, postgre, or berkley, depending on the preferences of the end-user.

Only one systematic approach I m confident with, is to use Autotools (GNU build system). I would like to know however, do exist any promising alternative to it? It must be Open Source and be highly portable. It should also avoid all shortages of Autotools system, e.g. lack of concurrency support (configure script is very slow).

最佳回答

You can very well build stuff concurrently with autotools. You just need to avoid doing recursive make for the stuff you want to build in parallel. The basic idea is to have a Makefile.am like:

bin_PROGRAMS =
noinst_LDLIBRARIES =
SUBDIRS = sub1 sub2 .
include here1/Makefile-files
include here2/Makefile-files

and here1/Makefile-files like:

bin_PROGRAMS += here1
noinst_LDLIBRARIES += libhere1.la
here1_SOURCES = here1/src1.c here1/src2.c here1/src3.c
libhere1_la_SOURCES = here1/lib1.c here1/lib2.c

Then the stuff in the subdirectories sub1/ and sub2/ will be built separately from the current directory and before it (even though the respective builds might do stuff in parallel with the same trick!), and then the current directory will start building the stuff in the current dir s Makefile.am and here[12]/Makefile-files in parallel.

E.g. libgphoto2 use that mechanism to build 50+ camera drivers in parallel after a few prerequesites have been built. This significantly speeds up the total build time.

OK, the configure script itself will not be sped up by this, but at least this will still do cross-compiling (unlike some of the alternative build systems). (You are listing portable as one of your requirements, and that often implies cross-compilation.)

问题回答

Consider also using CMAKE for highly modular projects.





相关问题
How to go Open Source & Get Community Support [closed]

I have developed a PHP framework (MVC ofcourse) and have named it EZPHP, it is almost finished and will be made public soon. My questions is that how do i make it open source project or what to do to ...

Comments & OpenSource software [closed]

This may sound like a foolish question or an observation, but i have seen that most of the times when one tries to look at the opensource code, there are no comments or just one or two lines at the ...

热门标签