[Cbe-oss-dev] [PATCH] libspe2: add pkg-config file to libspe2

Kazunori Asayama asayama at sm.sony.co.jp
Mon May 14 21:17:46 EST 2007


Luca Barbato <lu_zero at gentoo.org> wrote:
> Index: libspe2/libspe2.pc.in
> ===================================================================
> --- libspe2/libspe2.pc.in	(revision 0)
> +++ libspe2/libspe2.pc.in	(revision 0)
> @@ -0,0 +1,12 @@
> +prefix=@prefix@
> +exec_prefix=@exec_prefix@
> +libdir=@libdir@
> +includedir=@includedir@
> +
> +Name: @name@
> +Description: A wrapper library to adapt the JSRE SPU usage model to SPUFS 
> +Version: @version@
> +Requires: 
> +Conflicts: 
> +Libs: -L at libdir@ -lrt -lpthread 

I'm not familiar with *.pc files, but I guess this line should refer
to ${libdir} instead of @libdir@, and -lspe2 is missing.

> +Cflags: -I at includedir@

Ditto.

> Index: libspe2/Makefile
> ===================================================================
> --- libspe2/Makefile	(revision 38)
> +++ libspe2/Makefile	(working copy)
> @@ -34,6 +34,15 @@ PACKAGE_VER	:= $(FULLNAME)-$(RELEASE)
>  TARBALL		:= $(SOURCES)$(PACKAGE_VER).tar.gz
>  SOURCEFILES	:= $(TARBALL)
>  
> +edit = @sed \
> +	-e 's, at prefix\@,$(prefix),g' \
> +	-e 's, at exec_prefix\@,$(exec_prefix),g' \
> +	-e 's, at exec_prefix\@,$(exec_prefix),g' \

This line is redundant.

> +	-e 's, at libdir\@,$(libdir),g' \
> +	-e 's, at name\@,$(PACKAGE),g' \
> +	-e 's, at includedir\@,$(includedir),g' \
> +	-e 's, at version\@,$(VERSION),g'
> +

'@' is not a meta-character (we can just say '@' rather than '\@').

>  all:  $(libspe2_SO) $(libspe2_A) libspe12-all
>  
>  dist:  $(TARBALL)
> @@ -59,9 +68,11 @@ libspe12-all:
>  
>  install: libspe12-install
>  	$(INSTALL_DIR)     $(ROOT)$(libdir)
> +	$(INSTALL_DIR) 	   $(ROOT)$(libdir)/pkgconfig
>  	$(INSTALL_DATA)	   $(libspe2_A)			$(ROOT)$(libdir)/$(libspe2_A)
>  	$(INSTALL_PROGRAM) $(libspe2_SO)		$(ROOT)$(libdir)/$(libspe2_SO)
>  	$(INSTALL_LINK)	   $(libspe2_SO)		$(ROOT)$(libdir)/$(libspe2_SONAME)
> +	$(INSTALL_DATA)    libspe2.pc           $(ROOT)$(libdir)/pkgconfig
>  	$(INSTALL_LINK)	   $(libspe2_SONAME)	$(ROOT)$(libdir)/libspe2.so
>  	$(INSTALL_DIR)     $(ROOT)$(includedir)
>  	$(INSTALL_DATA)    libspe2.h            $(ROOT)$(includedir)/libspe2.h
> @@ -83,7 +94,12 @@ tests: tests/Makefile
>  tags:
>  	$(CTAGS) -R .
>  
> -$(libspe2_SO): $(libspe2_OBJS) base-all  event-all 
> +libspe2.pc: Makefile $(TOP)/libspe2.pc.in
> +	@rm -f $@ $@.tmp
> +	$(edit) $(TOP)/$@.in >$@.tmp
> +	@mv $@.tmp $@
> +
> +$(libspe2_SO): $(libspe2_OBJS) base-all  event-all libspe2.pc 
>  	$(CC) $(CFLAGS) -shared -o $@ $(libspe2_OBJS) spebase/*.o speevent/*.o -lrt -lpthread -Wl,--soname=${libspe2_SONAME}
>  
>  $(libspe2_A): $(libspe2_OBJS) base-all  event-all 
> @@ -183,6 +199,7 @@ clean: base-clean event-clean elfspe-cle
>  	rm -rf xml
>  	rm -rf html
>  	rm -rf latex
> +	rm -f libspe2.pc
>  	make -C tests clean
>  
>  base-clean: 

We also need to add 'libspe2.pc' to libspe2.spec as following.

Signed-off-by: Kazunori Asayama <asayama at sm.sony.co.jp>

--
Index: libspe2-public/libspe2.spec
===================================================================
--- libspe2-public.orig/libspe2.spec
+++ libspe2-public/libspe2.spec
@@ -191,6 +191,7 @@ rm -rf $RPM_BUILD_ROOT
 %{sysroot}%{_includedir}/*2*.h
 %{sysroot}%{_includedir}/cbea_map.h
 %{sysroot}%{_includedir2}/*.h
+%{sysroot}%{_libdir}/pkgconfig/libspe2.pc
 
 %if %{WITH_WRAPPER}
 %files -n libspe-devel



More information about the cbe-oss-dev mailing list