2009-03-30 Tollef Fog Heen <tfheen@err.no>
+ * pkg.[ch], main.c, check/check-missing: Don't recurse Requires at
+ all unless we need to. Add check. Again, thanks to Loïc Minier
+ for most of the idea and the implementation.
+
* pkg.[ch], parse.[ch], main.c, check/Makefile.am,
check/check-missing, check/missing-requires-private.pc:
Skip Requires.private unless we need to look at them for cflags.
check-conflicts check-missing
EXTRA_DIST = $(TESTS) common simple.pc requires-test.pc public-dep.pc \
- private-dep.pc includedir.pc missing-requires-private.pc
+ private-dep.pc includedir.pc missing-requires-private.pc \
+ missing-requires.pc
EXPECT_RETURN=0
RESULT="/usr/include/somedir"
run_test
+
+# 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
+ARGS="missing-requires"
+EXPECT_RETURN=0
+RESULT=""
+run_test
+
+# Libs should fail
+ARGS="--silence-errors --libs missing-requires"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# Cflags should fail
+ARGS="--silence-errors --cflags missing-requires"
+EXPECT_RETURN=1
+RESULT=""
+run_test
+
+# get includedir var
+ARGS="--variable includedir missing-requires"
+EXPECT_RETURN=0
+RESULT="/usr/include/somedir"
+run_test
--- /dev/null
+prefix=/usr
+exec_prefix=${prefix}
+libdir=${exec_prefix}/lib
+includedir=${prefix}/include/somedir
+
+Name: Missing Requires test package
+Description: Dummy pkgconfig test package for testing with a missing Requires
+Version: 1.0.0
+Requires: pkg-non-existent-dep
+Libs: -L/missing-requires/lib -lmissing-requires
+Cflags: -I/missing-requires/include
+foodir: bar
(want_static_lib_list && (want_libs || want_l_libs || want_L_libs)))
enable_requires_private();
+ /* ignore Requires if no Cflags or Libs are requested */
+
+ if (!want_I_cflags && !want_other_cflags && !want_cflags &&
+ !want_libs && !want_l_libs && !want_L_libs)
+ disable_requires();
+
if (want_my_version)
{
printf ("%s\n", VERSION);
ignore_private_libs = TRUE;
}
+void
+enable_requires(void)
+{
+ ignore_requires = FALSE;
+}
+
+void
+disable_requires(void)
+{
+ ignore_requires = TRUE;
+}
void
enable_requires_private(void)
void enable_private_libs(void);
void disable_private_libs(void);
+void enable_requires(void);
+void disable_requires(void);
void enable_requires_private(void);
void disable_requires_private(void);