[gimp-help-2/cygwin-windows-quirks] Adapt build system to Cygwin
- From: Ulf-D. Ehlert <ulfehlert src gnome org>
- To: svn-commits-list gnome org
- Subject: [gimp-help-2/cygwin-windows-quirks] Adapt build system to Cygwin
- Date: Tue, 23 Jun 2009 04:55:26 -0400 (EDT)
commit af8b7029c06e1e4f6f414eb5b82cc6842951d522
Author: Ulf-D. Ehlert <ulfehlert svn gnome org>
Date: Tue Jun 23 10:30:14 2009 +0200
Adapt build system to Cygwin
* configure.ac: identify Cygwin with autoconf macro
* Makefile.am: under Cygwin, use hardlinks rather than symlinks
for making image file links
Makefile.am | 24 +++++++++++++++++++++---
configure.ac | 11 +++++++++++
2 files changed, 32 insertions(+), 3 deletions(-)
---
diff --git a/Makefile.am b/Makefile.am
index c0c25b4..93c2487 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -469,7 +469,7 @@ include $(foreach LANG,$(PO_LANGS),xml/$(LANG)/.deps.mk)
# HIDE FROM AUTOMAKE #$(foreach LANG,$(PO_LANGS),$(eval $(call MAKE_XML_RULES,$(LANG))))
# TODO: test new image files structure;
-# how to ensure that $@ is up-to-date without forcing
+# problem: how to ensure that $@ is up-to-date without forcing
# rebuild (which will also force e.g. html-% to be rebuilt
# -- use (~1500) image files as prerequisites?
xml/%/images: FORCE
@@ -478,9 +478,16 @@ xml/%/images: FORCE
$(cmd) if test -d $@; then rm -rf $@/*; fi
$(cmd) test -d $@ || $(MKDIR_P) $@
$(cmd) $(echo_n) "*** Copying images ($*) ..."
+if CYGWIN
+# Cygwin
$(cmd) perl $(srcdir)/tools/make_image_links.pl -v \
- $(srcdir)/images/common $(srcdir)/images/C \
- xml/$*
+ --mode=hardlink,copy \
+ $(srcdir)/images/{common,C} $@
+else
+# Default (non-Cygwin)
+ $(cmd) perl $(srcdir)/tools/make_image_links.pl -v \
+ $(srcdir)/images/{common,C} $@
+endif
# Special case: en
@@ -576,9 +583,20 @@ html/%/index.html: xml/% $(HTML_STYLESHEETS) html/%/images
done
# TODO: check/enhance new image files structure
+if CYGWIN
+# Cygwin
+html/%/images: FORCE
+ $(cmd) test -h $@ && rm -f $@
+ $(cmd) test -d $@ && rm -rf $@/* || $(MKDIR_P) $@
+ $(cmd) perl $(srcdir)/tools/make_image_links.pl -v \
+ --mode=hardlink,copy \
+ $(srcdir)/images/{common,C} $@
+else
+# Default (non-Cygwin)
html/%/images: xml/%/images
$(cmd) test -d html/$* || $(MKDIR_P) html/$*
$(cmd) test -e $@ || $(LN_S) ../../$< $@
+endif
# The xrefs file is a side effect of the HTML build
html/%/gimp-xrefs.xml: html/%/index.html
diff --git a/configure.ac b/configure.ac
index c9ad58e..e714e61 100644
--- a/configure.ac
+++ b/configure.ac
@@ -12,6 +12,17 @@ m4_define([help_version], [help_major_version.help_minor_version.help_micro_vers
AC_INIT([GIMP-Help], [help_version])
+# Apparently this macro must be called before "AM_INIT_AUTOMAKE"
+AC_CANONICAL_BUILD
+case $build_os in
+ *cygwin*) IS_CYGWIN=yes;;
+ *) IS_CYGWIN=no;;
+esac
+# for use in Makefile.am
+AM_CONDITIONAL(CYGWIN, test $IS_CYGWIN = yes)
+# for use in Makefile
+#AC_SUBST(IS_CYGWIN)
+
AC_CONFIG_SRCDIR([src/gimp.xml])
AM_INIT_AUTOMAKE([1.6 dist-bzip2 -Wall -Wno-portability])
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]