I usually see ./configure to build something. It looks a script produced by a tool. And today, I realized that I don’t know what that is.
What’s this? What’s the role of this script, and who does make this? And how can I make something like that?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Every system is different. For example, there are different compilers and compiler versions, the tools of your system might support certain flags (or not), you might have certain libraries installed or not, etc. pp. There a lots of things that are different on computers that might influence how to compile a project.
The
configurescript tries to figure out all these things and complain if prerequisites aren’t met (for example, when the compiler is missing or when a library is missing). It then generates a Makefile that is specific to your system, and just typingmakewill (hopefully) build the project correctly on your system.Prior to
configure, we had to hand-tune the Makefiles (often the tunable parts were offset into a separate Makefile). This meant that you needed to know a lot about your system and often that you needed to modify the Makefiles. It was a big hurdle, especially since almost every project did it differently. GNUautoconfandautomake(which parse theMakefile.amandconfigure.acfiles to generateMakefile.inandconfigurescripts) really simplified things here (especially if you’re doing exotic things like cross-compiling for which almost no project cares to add support; if you’re doingautoconf/automakein a clean manner than you get cross-compile support for free, for example).