1*4882a593Smuzhiyunsrc/xml: use preg-gen xmli18n_tmp.h if specified 2*4882a593Smuzhiyun 3*4882a593SmuzhiyunIdeally, the programs needed at build-time should be built with 4*4882a593SmuzhiyunCC_FOR_BUILD, and not with CC_FOR_HOST. 5*4882a593Smuzhiyun 6*4882a593SmuzhiyunUnfortunately, this program wants to link against the gutenprint libs, 7*4882a593Smuzhiyunso we would also need to build them with CC_FOR_HOST, that is build them 8*4882a593Smuzhiyuntwice, once for build, once for host. 9*4882a593Smuzhiyun 10*4882a593SmuzhiyunInstead, in the Buildroot context, we first build gutenprint for the build 11*4882a593Smuzhiyunsystem, use that to generate the incriminated header, and then re-use that 12*4882a593Smuzhiyunheader to build the gutenprint for the host. 13*4882a593Smuzhiyun 14*4882a593SmuzhiyunIt is not possible to have such constructs in Makefile.am: 15*4882a593Smuzhiyun ifeq ($(FOO),) 16*4882a593Smuzhiyun bar: bla 17*4882a593Smuzhiyun cat $< >$@ 18*4882a593Smuzhiyun else 19*4882a593Smuzhiyun bar: 20*4882a593Smuzhiyun echo $(FOO) >$@ 21*4882a593Smuzhiyun endif 22*4882a593Smuzhiyun 23*4882a593Smuzhiyunas autoreconf will yell loudly that there is an 'endif' without an 'if'. 24*4882a593SmuzhiyunSigh... :-( 25*4882a593Smuzhiyun 26*4882a593SmuzhiyunSigned-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr> 27*4882a593Smuzhiyun 28*4882a593Smuzhiyundiff -durN gutenprint-5.2.9.orig/src/xml/Makefile.am gutenprint-5.2.9/src/xml/Makefile.am 29*4882a593Smuzhiyun--- gutenprint-5.2.9.orig/src/xml/Makefile.am 2011-03-30 02:43:24.000000000 +0200 30*4882a593Smuzhiyun+++ gutenprint-5.2.9/src/xml/Makefile.am 2013-03-24 17:08:08.435918773 +0100 31*4882a593Smuzhiyun@@ -52,10 +52,13 @@ 32*4882a593Smuzhiyun 33*4882a593Smuzhiyun 34*4882a593Smuzhiyun xmli18n-tmp.h: xml-stamp extract-strings 35*4882a593Smuzhiyun- -rm -f $@ $@.tmp 36*4882a593Smuzhiyun- ./extract-strings `cat xml-stamp | sed -e 's;^;$(srcdir)/;'` > $@.tmp 37*4882a593Smuzhiyun- mv $@.tmp $@ 38*4882a593Smuzhiyun- 39*4882a593Smuzhiyun+ if [ -z "$(BR2_USE_PREGEN_XMLI18N_TMP_H)" ]; then \ 40*4882a593Smuzhiyun+ rm -f $@ $@.tmp; \ 41*4882a593Smuzhiyun+ ./extract-strings `cat xml-stamp | sed -e 's;^;$(srcdir)/;'` > $@.tmp; \ 42*4882a593Smuzhiyun+ mv $@.tmp $@; \ 43*4882a593Smuzhiyun+ else \ 44*4882a593Smuzhiyun+ cp $(BR2_USE_PREGEN_XMLI18N_TMP_H) $@; \ 45*4882a593Smuzhiyun+ fi 46*4882a593Smuzhiyun 47*4882a593Smuzhiyun dist-hook: xmli18n-tmp.h xml-stamp 48*4882a593Smuzhiyun # xmli18n-tmp.h is needed by po/POTFILES.in at dist time 49