▲ | moralestapia 15 hours ago | |||||||||||||||||||||||||
>The purpose of a ./configure script is basically to run the compiler a bunch of times and check which runs succeeded. Wait is this true? (!) | ||||||||||||||||||||||||||
▲ | gdwatson 13 hours ago | parent | next [-] | |||||||||||||||||||||||||
Historically, different Unixes varied a lot more than they do today. Say you want your program to use the C library function foo on platforms where it’s available and the function bar where it isn’t: You can write both versions and choose between them based on a C preprocessor macro, and the program will use the best option available for the platform where it was compiled. But now the user has to set the preprocessor macro appropriately when he builds your program. Nobody wants to give the user a pop quiz on the intricacies of his C library every time he goes to install new software. So instead the developer writes a shell script that tries to compile a trivial program that uses function foo. If the script succeeds, it defines the preprocessor macro FOO_AVAILABLE, and the program will use foo; if it fails, it doesn’t define that macro, and the program will fall back to bar. That shell script grew into configure. A configure script for an old and widely ported piece of software can check for a lot of platform features. | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | klysm 14 hours ago | parent | prev | next [-] | |||||||||||||||||||||||||
The closer and deeper you look into the C toolchains the more grossed out you’ll be | ||||||||||||||||||||||||||
| ||||||||||||||||||||||||||
▲ | Am4TIfIsER0ppos 15 hours ago | parent | prev [-] | |||||||||||||||||||||||||
Yes. |