camlspotter committed 421481a

added pkg_config version checker and applied to libgif, but I am afraid libgif is not usually with pkg_config

Comments (0)

Files changed (2)

   if $(true_if_not_defined ARG_WANT_GIF)
-    if $(not $(pkg_config gif, libgif))
+    if $(not $(pkg_config_between_vers gif, libgif, 4.0.0, 5.0.0))
       HAVE_GIF = $(Check_header_library gif, gif_lib.h, DGifOpenFileName)
       if $(SUPPORT_GIF)
     ConfMsgResult(failed $(PATH_PKG_CONFIG) $(libname))
     value false
+# PATH_PKG_CONFIG must be well defined
+pkg_config_version(libname) =
+  value $(shell $(PATH_PKG_CONFIG) $(libname) --modversion) 
+pkg_config_between_vers(name, libname, min_ver, too_high_ver) =
+  if $(pkg_config $(name), $(libname))
+    ConfMsgChecking($(libname): $(min_ver) <= version < $(too_high_ver))
+    ver=$(pkg_config_version $(libname)) 
+    if $(and $(le $(cmp-versions $(min_ver), $(ver)), 0), $(lt $(cmp-versions $(ver), $(too_high_ver)), 0))
+      ConfMsgResult($(ver) ... yes)
+      value true
+      export
+    else
+      ConfMsgResult($(ver) ... no)
+      value false # do not export
+    export
+  else
+    value false
+  export
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.