tools: invert-svg is a build-only tool.

It must be built with a native compiler and native libs only.
This commit is contained in:
Jehan 2016-06-12 04:25:53 +02:00
parent 500589e97c
commit 18b0468cc9
3 changed files with 25 additions and 10 deletions

View file

@ -2073,6 +2073,22 @@ if test "x$enable_vector_icons" = "xyes"; then
fi fi
fi fi
fi fi
if test "x$enable_vector_icons" = "xyes"; then
AX_PROG_CC_FOR_BUILD
# We must not use $PKG_CONFIG nor PKG_CHECK_* macros because we need
# to make sure we use the native pkg-config (in case we cross-compile).
if pkg-config --atleast-version=glib_required_version glib-2.0 &&
pkg-config gio-2.0; then
NATIVE_GLIB_LIBS=`pkg-config --libs gio-2.0 glib-2.0`
NATIVE_GLIB_CFLAGS=`pkg-config --cflags gio-2.0 glib-2.0`
else
enable_vector_icons="no (missing native glib > glib_required_version or gio)"
fi
fi
AC_SUBST(NATIVE_GLIB_LIBS)
AC_SUBST(NATIVE_GLIB_CFLAGS)
AM_CONDITIONAL(ENABLE_VECTOR_ICONS, test "x$enable_vector_icons" = "xyes") AM_CONDITIONAL(ENABLE_VECTOR_ICONS, test "x$enable_vector_icons" = "xyes")
if test "x$enable_vector_icons" = "xyes"; then if test "x$enable_vector_icons" = "xyes"; then

View file

@ -32,13 +32,13 @@ scalable/gimp-color-picker-white.svg: $(top_builddir)/icons/Symbolic/scalable/gi
mkdir -p scalable && $(top_builddir)/tools/invert-svg $< $@ mkdir -p scalable && $(top_builddir)/tools/invert-svg $< $@
# Rule for all other scalable icons. # Rule for all other scalable icons.
scalable/%.svg: ../Symbolic/scalable/%.svg ../../tools/invert-svg scalable/%.svg: ../Symbolic/scalable/%.svg $(top_builddir)/tools/invert-svg$(BUILD_EXEEXT)
mkdir -p scalable && \ mkdir -p scalable && \
$(top_builddir)/tools/invert-svg $< $@ $(top_builddir)/tools/invert-svg$(BUILD_EXEEXT) $< $@
24/%.svg: ../Symbolic/24/%.svg ../../tools/invert-svg 24/%.svg: $(top_srcdir)/icons/Symbolic/24/%.svg $(top_builddir)/tools/invert-svg$(BUILD_EXEEXT)
mkdir -p scalable && \ mkdir -p scalable && \
$(top_builddir)/tools/invert-svg $< $@ $(top_builddir)/tools/invert-svg$(BUILD_EXEEXT) $< $@
# We are basically repeating the same rule for every subdirectory, which # We are basically repeating the same rule for every subdirectory, which
# is very dirty. But this is the only way we found to have a rule # is very dirty. But this is the only way we found to have a rule

View file

@ -3,7 +3,7 @@
libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la libgimpbase = $(top_builddir)/libgimpbase/libgimpbase-$(GIMP_API_VERSION).la
if ENABLE_VECTOR_ICONS if ENABLE_VECTOR_ICONS
svg_icon_tools = invert-svg compute-svg-viewbox svg_icon_tools = compute-svg-viewbox
else else
svg_icon_tools = svg_icon_tools =
endif endif
@ -50,11 +50,8 @@ test_clipboard_LDADD = \
$(GTK_LIBS) $(GTK_LIBS)
if ENABLE_VECTOR_ICONS if ENABLE_VECTOR_ICONS
invert_svg_SOURCES = invert-svg.c invert-svg$(BUILD_EXEEXT): invert-svg.c
$(CC_FOR_BUILD) -o $@ $< $(NATIVE_GLIB_LIBS) $(NATIVE_GLIB_CFLAGS)
invert_svg_LDADD = \
$(GLIB_LIBS) \
$(GIO_LIBS)
compute_svg_viewbox_SOURCES = compute-svg-viewbox.c compute_svg_viewbox_SOURCES = compute-svg-viewbox.c
@ -63,6 +60,8 @@ compute_svg_viewbox_CFLAGS = \
compute_svg_viewbox_LDADD = \ compute_svg_viewbox_LDADD = \
$(SVG_LIBS) $(SVG_LIBS)
all: invert-svg$(BUILD_EXEEXT)
endif endif
AM_CPPFLAGS = \ AM_CPPFLAGS = \