Shell script conditionals: what is this weird syntax?
Hi everybody,
today I had a problem with a configure script. When I ran ./configure --with-serf, I got "--with-serf requires an argument". This contradicts the manual, that says that without an argument it uses the default location (which is unknown to me). My first plan was to hack away the check for an argument, but I just can't figure out the syntax by looking at it... I am familiar with C. Code:
#! /bin/sh Now I did a little research and know fi ends an if-statement. That makes the whole chunk I posted even less readable :eek: |
Quote:
Configure scripts are generated using the GNU autotools. Because they are automatically generated, they're not always human-friendly to read. I've spent some time struggling with one or two in the past. So I'll offer some insight (such as it's worth), but I make no guarantees... First, understand what the configure script is doing. Basically, the configure script doesn't trust you, the user. If you specify an option for a feature, it will run a minimal test to verify the feature-support exists on the system. The vast majority of the code you pasted is precisely that: the configure script using "here" documents to create very small C programs that use a known serf library call, trying to compile that small program, and checking the return/exit code of the compiler. The line: Code:
cat confdefs.h - <<_ACEOF >conftest.$ac_ext Almost everything above that line deals with the serf options to the configure script. Now, if you want to just go rip out the conditional, then modify these lines: Code:
if test "$withval" = "yes" ; then Code:
if test "$withval" != "no" ; then It would seem to me that if would be easiest for you to do: Code:
locate serf.h Code:
find / -type f -name "serf.h" |
All times are GMT -5. The time now is 06:41 AM. |