Take the 2-minute tour ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

This debate has cropped up on a mailing list for a project I'm involved in. Unfortunately we're quite a small bunch at the moment, so I want to ask a wider audience.

We're writing a C library (for arbitrary precision arithmetic) and are investigating build systems. Currently we have a bash script in desperate need of work. I believe we can't use autotools etc due to licensing (bsd vs gpl). So I suggested we use a modern scripting language like python or perl.

The question is: is having something like perl or python around at build time an unrealistic dependency on Unix-like platforms these days?

share|improve this question
    
What exactly is that you want to do that can't be done using make? –  Pemdas Jan 12 '11 at 21:11
    
#including different headers which contain inline assembly optimised to various architectures (core2, nehalem, k8, k10...). –  Ninefingers Jan 12 '11 at 21:16
    
What can't you just do something like this. #if(PLATFORM == CORE2) ... #elsif(PLATFORM == K8)... #endif just make PLATFORM an environment variable. –  Pemdas Jan 12 '11 at 21:21
    
We have some x86 inline asm that reads the output of cpuid and we grab uname -m too, but remember, you can have i686/core2 etc... so it gets more complicated. We also need to support "generic" (from C) builds. Everything is written first in C, then we optimise it. –  Ninefingers Jan 12 '11 at 21:32
1  
I don't understand what you just said. I am pretty confident that you can do everything you need with preprocessor macros and makefiles. –  Pemdas Jan 12 '11 at 21:47

1 Answer 1

up vote 3 down vote accepted

You absolutely can use autotools, as there are absolutely no licensing restrictions on the configure scripts or any generated files.

That aside, I consider autotools to be quite broken technically in many ways, and prefer alternative solutions.

CMake is popular these days for C++ projects and works well irrespective of your language of choice. It generates makefiles in much the same way autotools does, but it can also generate build solutions for several IDEs and toolchains other than GNU. I use it in my own projects. KDE and several other major projects depend on it, so it's quite common to see on development systems.

SCons is popular in some circles, and many people seem to quite like it. It only requires Python, and the likelihood that you don't have python installed on a *nix system is quite slim these days.

Rake is another good make system, and depends only on Ruby.

It's safe to say that Python and Perl are everywhere (moreso Perl than Python). Depending on them is completely reasonable on any Linux or Unix environment. Indeed, bootstrapping a Linux distribution requires the presence of Perl, and getting to the point of a graphical environment all but necessitates the presence of Python.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.