configure, tools: actually use GIMP_PKGCONFIG_VERSION and...

... GIMP_TOOL_VERSION rather than hardcoding versions.
We may still have issues with "gtk+-3.0", but let's let this one slip
for now.
This commit is contained in:
Jehan
2018-06-15 17:10:21 +02:00
parent 10480ef7c6
commit 276d9b60b3
2 changed files with 17 additions and 9 deletions

View File

@ -136,6 +136,12 @@ AC_SUBST(GIMP_USER_VERSION)
AC_SUBST(GIMP_UNSTABLE) AC_SUBST(GIMP_UNSTABLE)
AC_SUBST(GIMP_FULL_NAME) AC_SUBST(GIMP_FULL_NAME)
# Version strings used in some source, though it seems unnecessary to
# declare them in the public API (libgimpbase/gimpversion.h).
AC_DEFINE(GIMP_PKGCONFIG_VERSION, "gimp_pkgconfig_version",
[libgimp pkg-config version])
AC_DEFINE(GIMP_TOOL_VERSION, "gimp_tool_version",
[GIMP tools version])
# These are used in the .pc files # These are used in the .pc files
GLIB_REQUIRED_VERSION=glib_required_version GLIB_REQUIRED_VERSION=glib_required_version

View File

@ -23,6 +23,8 @@
* platforms. * platforms.
*/ */
#include "config.h"
#include <stdlib.h> #include <stdlib.h>
#include <stdio.h> #include <stdio.h>
#include <string.h> #include <string.h>
@ -214,7 +216,7 @@ get_runtime_prefix (gchar slash)
exit (EXIT_FAILURE); exit (EXIT_FAILURE);
#else #else
/* On Unix assume the executable package is in the same prefix as the developer stuff */ /* On Unix assume the executable package is in the same prefix as the developer stuff */
return pkg_config ("--variable=prefix gimp-3.0"); return pkg_config ("--variable=prefix gimp-" GIMP_PKGCONFIG_VERSION);
#endif #endif
} }
@ -302,7 +304,7 @@ static void
usage (int exit_status) usage (int exit_status)
{ {
g_print ("\ g_print ("\
Usage: gimptool-2.0 [OPTION]...\n\ Usage: gimptool-" GIMP_TOOL_VERSION " [OPTION]...\n\
\n\ \n\
General options:\n\ General options:\n\
--help print this message\n\ --help print this message\n\
@ -355,7 +357,7 @@ not libgimpui, append -nogimpui.\n");
static gchar * static gchar *
get_includedir (void) get_includedir (void)
{ {
return pkg_config ("--variable=includedir gimp-3.0"); return pkg_config ("--variable=includedir gimp-" GIMP_PKGCONFIG_VERSION);
} }
static void static void
@ -370,7 +372,7 @@ do_includedir (void)
static gchar * static gchar *
get_cflags (void) get_cflags (void)
{ {
return pkg_config ("--cflags gimpui-3.0"); return pkg_config ("--cflags gimpui-" GIMP_PKGCONFIG_VERSION);
} }
static void static void
@ -385,7 +387,7 @@ do_cflags (void)
static gchar * static gchar *
get_cflags_noui (void) get_cflags_noui (void)
{ {
return pkg_config ("--cflags gimp-3.0"); return pkg_config ("--cflags gimp-" GIMP_PKGCONFIG_VERSION);
} }
static void static void
@ -400,7 +402,7 @@ do_cflags_noui (void)
static gchar * static gchar *
get_cflags_nogimpui (void) get_cflags_nogimpui (void)
{ {
return pkg_config ("--cflags gimp-3.0 gtk+-3.0"); return pkg_config ("--cflags gimp-" GIMP_PKGCONFIG_VERSION " gtk+-3.0");
} }
static void static void
@ -415,7 +417,7 @@ do_cflags_nogimpui (void)
static gchar * static gchar *
get_libs (void) get_libs (void)
{ {
return pkg_config ("--libs gimpui-3.0"); return pkg_config ("--libs gimpui-" GIMP_PKGCONFIG_VERSION);
} }
static void static void
@ -430,7 +432,7 @@ do_libs (void)
static gchar * static gchar *
get_libs_noui (void) get_libs_noui (void)
{ {
return pkg_config ("--libs gimp-3.0"); return pkg_config ("--libs gimp-" GIMP_PKGCONFIG_VERSION);
} }
static void static void
@ -445,7 +447,7 @@ do_libs_noui (void)
static gchar * static gchar *
get_libs_nogimpui (void) get_libs_nogimpui (void)
{ {
return pkg_config ("--libs gimp-3.0 gtk+-3.0"); return pkg_config ("--libs gimp-" GIMP_PKGCONFIG_VERSION " gtk+-3.0");
} }
static void static void