summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2012-12-11 10:04:21 -0800
committerDan Nicholson <dbn.lists@gmail.com>2012-12-11 11:59:40 -0800
commitec11c93ef843c30d93d182ca940b78a052d0560c (patch)
treeeae399138c9b0c98b40d5f444c6d7181d0415bff
parentd1b7dd42d19c688bbb743cd83ccf2c518b75614c (diff)
downloadpkg-config-ec11c93ef843c30d93d182ca940b78a052d0560c.tar.gz
Explicitly set --exists as the default option
This happened basically by accident before when "pkg-config foo" was run because the code wouldn't find any options set and just fall through to the end after processing the package arguments. However, it would act differently in that Requires.private was only enabled with an explicit --exists.
-rwxr-xr-xcheck/check-missing6
-rw-r--r--main.c7
-rw-r--r--pkg-config.13
3 files changed, 12 insertions, 4 deletions
diff --git a/check/check-missing b/check/check-missing
index 719998a..bb5f79a 100755
--- a/check/check-missing
+++ b/check/check-missing
@@ -51,10 +51,10 @@ EXPECT_RETURN=0
RESULT="/usr/include/somedir"
run_test --variable includedir missing-requires-private
-# tests below are on an existing package, but with missing Requires; when
-# pkg-config outputs error, the actual error text isn't checked
+# tests below are on an existing package, but with missing Requires;
+# when pkg-config outputs error, the actual error text isn't checked
# package exists
-EXPECT_RETURN=0
+EXPECT_RETURN=1
RESULT=""
run_test missing-requires
diff --git a/main.c b/main.c
index 3c13f8e..e0e0e57 100644
--- a/main.c
+++ b/main.c
@@ -529,6 +529,13 @@ main (int argc, char **argv)
return 1;
}
+ /* If no output option was set, then --exists is the default. */
+ if (!output_opt_set)
+ {
+ debug_spew ("no output option set, defaulting to --exists\n");
+ want_exists = TRUE;
+ }
+
/* Error printing is determined as follows:
* - for --cflags, --libs, etc. it's on by default
* and --silence-errors can turn it off
diff --git a/pkg-config.1 b/pkg-config.1
index e91a949..530ddb2 100644
--- a/pkg-config.1
+++ b/pkg-config.1
@@ -193,7 +193,8 @@ constraint after each package name, for example:
.nf
$ pkg-config --exists 'glib-2.0 >= 1.3.4 libxml = 1.8.3'
.fi
-Remember to use \-\-print-errors if you want error messages.
+Remember to use \-\-print-errors if you want error messages. When no
+output options are supplied to \fIpkg-config\fP, \-\-exists is implied.
.TP
.I "--msvc-syntax"
This option is available only on Windows. It causes \fIpkg-config\fP