From: "Jan Beulich" Subject: [PATCH] fix libxl build issues Date: Mon, 20 Sep 2010 14:33:24 +0100 Message-ID: <4C977EC40200007800017BCD@vpn.id2.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part6548B3B4.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part6548B3B4.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Building in a tree with read-only source files failed because the flex/ bison generated files are left in place. All of the source files (instead of all of the object files) were depending on libxl.h (in particular forcing the needless re-generation of the flex/bison generated files). For _libxl_types.[ch] a single non-pattern rule was used. For non- pattern rules with multiple targets, other than for pattern ones, the body gets executed once for each target, causing problems when building with -j, >=3D 2. Convert this rule to a pattern one. The flex/bison generated headers pointlessly depended on the corresponding source files. Use multiple-target pattern rules instead. It would also have been nice if the minimal flex/bison versions needed to successfully build libxl were documented: neither flex 2.5.31 nor bison 2.1 (as found e.g. on SLE10) is sufficient. Signed-off-by: Jan Beulich --- 2010-09-20.orig/tools/libxl/Makefile 2010-09-20 14:23:28.0000000= 00 +0200 +++ 2010-09-20/tools/libxl/Makefile 2010-09-20 14:24:20.000000000 = +0200 @@ -42,18 +42,15 @@ XL_OBJS =3D xl.o xl_cmdimpl.o xl_cmdtable. all: $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \ $(AUTOSRCS) $(AUTOINCS) =20 -$(AUTOINCS): $(AUTOSRCS) - -#%_y.h: %_y.c -#%_l.h: %_l.c - $(LIBXLU_OBJS): $(AUTOINCS) =20 -%.c: %.y - $(BISON) --output=3D$@ $< - -%.c: %.l - $(FLEX) --header-file=3D$*.h --outfile=3D$@ $< +%.c %.h: %.y + @rm -f $*.[ch] + $(BISON) --output=3D$*.c $< + +%.c %.h: %.l + @rm -f $*.[ch] + $(FLEX) --header-file=3D$*.h --outfile=3D$*.c $< =20 genpath-target =3D $(call buildmakevars2file,_libxl_paths.h) $(eval $(genpath-target)) @@ -66,12 +63,12 @@ libxl_paths.c: _libxl_paths.h =20 libxl.h: _libxl_types.h =20 -$(LIBXL_OBJS:%.o=3D%.c) $(LIBXLU_OBJS:%.o=3D%.c) $(XL_OBJS:%.o=3D%.c): = libxl.h +$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): libxl.h =20 -_libxl_types.h _libxl_types.c: libxl.idl gentypes.py libxltypes.py - $(PYTHON) gentypes.py libxl.idl __libxl_types.h __libxl_types.c - mv __libxl_types.h _libxl_types.h - mv __libxl_types.c _libxl_types.c +_libxl_%.h _libxl_%.c: libxl.idl gen%.py libxl%.py + $(PYTHON) gen$*.py libxl.idl __libxl_$*.h __libxl_$*.c + mv __libxl_$*.h _libxl_$*.h + mv __libxl_$*.c _libxl_$*.c =20 libxenlight.so: libxenlight.so.$(MAJOR) ln -sf $< $@ --=__Part6548B3B4.0__= Content-Type: text/plain; name="libxlu-cfg-build.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="libxlu-cfg-build.patch" Building in a tree with read-only source files failed because the = flex/=0Abison generated files are left in place.=0A=0AAll of the source = files (instead of all of the object files) were=0Adepending on libxl.h (in = particular forcing the needless re-generation=0Aof the flex/bison = generated files).=0A=0AFor _libxl_types.[ch] a single non-pattern rule was = used. For non-=0Apattern rules with multiple targets, other than for = pattern ones, the=0Abody gets executed once for each target, causing = problems when building=0Awith -j, >=3D 2. Convert this rule to a = pattern one.=0A=0AThe flex/bison generated headers pointlessly depended on = the=0Acorresponding source files. Use multiple-target pattern rules = instead.=0A=0AIt would also have been nice if the minimal flex/bison = versions needed=0Ato successfully build libxl were documented: neither = flex 2.5.31 nor=0Abison 2.1 (as found e.g. on SLE10) is sufficient.=0A=0ASi= gned-off-by: Jan Beulich =0A=0A--- 2010-09-20.orig/too= ls/libxl/Makefile 2010-09-20 14:23:28.000000000 +0200=0A+++ = 2010-09-20/tools/libxl/Makefile 2010-09-20 14:24:20.000000000 +0200=0A@@ = -42,18 +42,15 @@ XL_OBJS =3D xl.o xl_cmdimpl.o xl_cmdtable.=0A all: = $(CLIENTS) libxenlight.so libxenlight.a libxlutil.so libxlutil.a \=0A = $(AUTOSRCS) $(AUTOINCS)=0A =0A-$(AUTOINCS): $(AUTOSRCS)=0A-=0A-#%_y.h: = %_y.c=0A-#%_l.h: %_l.c=0A-=0A $(LIBXLU_OBJS): $(AUTOINCS)=0A =0A-%.c: = %.y=0A- $(BISON) --output=3D$@ $<=0A-=0A-%.c: %.l=0A- $(FLEX) --header-fi= le=3D$*.h --outfile=3D$@ $<=0A+%.c %.h: %.y=0A+ @rm -f $*.[ch]=0A+ = $(BISON) --output=3D$*.c $<=0A+=0A+%.c %.h: %.l=0A+ @rm -f $*.[ch]=0A+ = $(FLEX) --header-file=3D$*.h --outfile=3D$*.c $<=0A =0A genpath-target =3D = $(call buildmakevars2file,_libxl_paths.h)=0A $(eval $(genpath-target))=0A@@= -66,12 +63,12 @@ libxl_paths.c: _libxl_paths.h=0A =0A libxl.h: _libxl_type= s.h=0A =0A-$(LIBXL_OBJS:%.o=3D%.c) $(LIBXLU_OBJS:%.o=3D%.c) $(XL_OBJS:%.o= =3D%.c): libxl.h=0A+$(LIBXL_OBJS) $(LIBXLU_OBJS) $(XL_OBJS): libxl.h=0A = =0A-_libxl_types.h _libxl_types.c: libxl.idl gentypes.py libxltypes.py=0A- = $(PYTHON) gentypes.py libxl.idl __libxl_types.h __libxl_types.c=0A- mv = __libxl_types.h _libxl_types.h=0A- mv __libxl_types.c _libxl_types.c= =0A+_libxl_%.h _libxl_%.c: libxl.idl gen%.py libxl%.py=0A+ $(PYTHON) = gen$*.py libxl.idl __libxl_$*.h __libxl_$*.c=0A+ mv __libxl_$*.h = _libxl_$*.h=0A+ mv __libxl_$*.c _libxl_$*.c=0A =0A libxenlight.so: = libxenlight.so.$(MAJOR)=0A ln -sf $< $@=0A --=__Part6548B3B4.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --=__Part6548B3B4.0__=--