Skip to content

Commit

Permalink
autoconf: Re-direct error messages if pkg-config cannot be found
Browse files Browse the repository at this point in the history
Else it will print something like

./configure: line 4426: --exists: command not found

which isn't really helpful, either.
  • Loading branch information
fabiangreffrath committed Nov 4, 2015
1 parent 0b0cae7 commit 2efd8ce
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ AC_SDL_MAIN_WORKAROUND([
AC_ARG_WITH([bashcompletiondir],
AS_HELP_STRING([--with-bashcompletiondir=DIR], [Bash completion directory]),
[],
[AS_IF([$($PKG_CONFIG --exists bash-completion)],
[AS_IF([$($PKG_CONFIG --exists bash-completion 2> /dev/null)],
[bashcompletiondir=$($PKG_CONFIG --variable=completionsdir bash-completion)],
[bashcompletiondir=${datadir}/bash-completion/completions])])

Expand Down

7 comments on commit 2efd8ce

@galtgendo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...so, let's reimplement PKG_CHECK_EXISTS, because.

@fragglet
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can suggest improvements without being aggressively sarcastic.

@fabiangreffrath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PKG_* macros are only available if pkg-config is installed. If it is not installed, running ./configure will fail and we did not (yet?) want to make pkg-config a mandatory dependency.

@chungy
Copy link
Contributor

@chungy chungy commented on 2efd8ce Dec 14, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think there'd be much harm in that.

@galtgendo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it is not installed, running ./configure will fail

Not really true, unless meant to mean "autoreconf will generate broken configure if the macro isn't
found".

However the part that irks me most here is that it deals with a cosmetic problem by dropping info that might have been useful (PKG_CHECK_EXISTS is pretty much trivial, but what it does is redirect the error messages to config.log).

@fabiangreffrath
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really true, unless meant to mean "autoreconf will generate broken configure if the macro isn't found".

Yeah, whatever.

However the part that irks me most here is that it deals with a cosmetic problem by dropping info that might have been useful

What is so useful about

bash: --exists: command not found

?

@galtgendo
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Honestly, that outright quote mining - you've skipped the preceding "if test -n "$PKG_CONFIG" &&"

Please sign in to comment.