qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH 1/2] libcacard: gitignore updates
@ 2011-06-27 10:34 Alon Levy
  2011-06-27 10:34 ` [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes Alon Levy
  0 siblings, 1 reply; 4+ messages in thread
From: Alon Levy @ 2011-06-27 10:34 UTC (permalink / raw)
  To: qemu-devel

---
 .gitignore           |    4 ++++
 libcacard/.gitignore |    1 +
 2 files changed, 5 insertions(+), 0 deletions(-)
 create mode 100644 libcacard/.gitignore

diff --git a/.gitignore b/.gitignore
index 08013fc..7acafe7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -68,3 +68,7 @@ cscope.*
 tags
 TAGS
 *~
+*.lo
+*.la
+*.pc
+.libs
diff --git a/libcacard/.gitignore b/libcacard/.gitignore
new file mode 100644
index 0000000..a8f9841
--- /dev/null
+++ b/libcacard/.gitignore
@@ -0,0 +1 @@
+vscclient
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes
  2011-06-27 10:34 [Qemu-devel] [PATCH 1/2] libcacard: gitignore updates Alon Levy
@ 2011-06-27 10:34 ` Alon Levy
  2011-06-27 12:11   ` Christophe Fergeau
  0 siblings, 1 reply; 4+ messages in thread
From: Alon Levy @ 2011-06-27 10:34 UTC (permalink / raw)
  To: qemu-devel

Also add --pkgconfigdir and --includedir configure parameters.
---
 configure                 |   10 ++++++++++
 libcacard/Makefile        |   25 ++++++++++++++++++++++---
 libcacard/libcacard.pc.in |   13 +++++++++++++
 3 files changed, 45 insertions(+), 3 deletions(-)
 create mode 100644 libcacard/libcacard.pc.in

diff --git a/configure b/configure
index e523976..d08818f 100755
--- a/configure
+++ b/configure
@@ -146,6 +146,8 @@ datadir="\${prefix}/share/qemu"
 docdir="\${prefix}/share/doc/qemu"
 bindir="\${prefix}/bin"
 libdir="\${prefix}/lib"
+pkgconfigdir="\${prefix}/lib/pkgconfig"
+includedir="\${prefix}/include"
 sysconfdir="\${prefix}/etc"
 confsuffix="/qemu"
 slirp="yes"
@@ -539,6 +541,10 @@ for opt do
   ;;
   --libdir=*) libdir="$optarg"
   ;;
+  --pkgconfigdir=*) pkgconfigdir="$optarg"
+  ;;
+  --includedir=*) includedir="$optarg"
+  ;;
   --datadir=*) datadir="$optarg"
   ;;
   --docdir=*) docdir="$optarg"
@@ -2542,6 +2548,8 @@ echo "Install prefix    $prefix"
 echo "BIOS directory    `eval echo $datadir`"
 echo "binary directory  `eval echo $bindir`"
 echo "library directory `eval echo $libdir`"
+echo "pkgconfig directory `eval echo $pkgconfigdir`"
+echo "include directory `eval echo $includedir`"
 echo "config directory  `eval echo $sysconfdir`"
 if test "$mingw32" = "no" ; then
 echo "Manual directory  `eval echo $mandir`"
@@ -2635,6 +2643,8 @@ echo all: >> $config_host_mak
 echo "prefix=$prefix" >> $config_host_mak
 echo "bindir=$bindir" >> $config_host_mak
 echo "libdir=$libdir" >> $config_host_mak
+echo "pkgconfigdir=$pkgconfigdir" >> $config_host_mak
+echo "includedir=$includedir" >> $config_host_mak
 echo "mandir=$mandir" >> $config_host_mak
 echo "datadir=$datadir" >> $config_host_mak
 echo "sysconfdir=$sysconfdir" >> $config_host_mak
diff --git a/libcacard/Makefile b/libcacard/Makefile
index 9802c37..3a9e639 100644
--- a/libcacard/Makefile
+++ b/libcacard/Makefile
@@ -2,7 +2,10 @@
 -include $(SRC_PATH)/Makefile.objs
 -include $(SRC_PATH)/rules.mak
 
-$(call set-vpath, $(SRC_PATH):$(SRC_PATH)/libcacard)
+libcacard_srcpath=$(SRC_PATH)/libcacard
+libcacard_includedir=$(DESTDIR)$(includedir)/cacard
+
+$(call set-vpath, $(SRC_PATH):$(libcacard_srcpath))
 
 # objects linked against normal qemu binaries, not compiled with libtool
 QEMU_OBJS=$(addprefix ../,$(oslib-obj-y) qemu-malloc.o qemu-timer-common.o $(trace-obj-y))
@@ -36,7 +39,23 @@ else
 libcacard.la: $(libcacard.lib-y) $(QEMU_OBJS_LIB)
 	$(call quiet-command,libtool --mode=link --quiet --tag=CC $(CC) $(libcacard_libs) -lrt -rpath $(libdir) -o $@ $^,"  lt LINK $@")
 
-install-libcacard: libcacard.la
+libcacard.pc: $(libcacard_srcpath)/libcacard.pc.in
+	sed -e 's|@LIBDIR@|$(libdir)|' \
+		-e 's|@INCLUDEDIR@|$(libcacard_includedir)|' \
+	    -e 's|@VERSION@|$(shell cat $(SRC_PATH)/VERSION)|' \
+		-e 's|@PREFIX@|$(prefix)|' \
+		< $(libcacard_srcpath)/libcacard.pc.in > libcacard.pc
+
+.PHONY: install-libcacard
+
+install-libcacard: libcacard.pc libcacard.la
 	$(INSTALL_DIR) "$(DESTDIR)$(libdir)"
-	libtool --mode=install $(INSTALL_PROG) libcacard.la "$(DESTDIR)$(libdir)"
+	$(INSTALL_DIR) "$(DESTDIR)$(pkgconfigdir)"
+	$(INSTALL_DIR) "$(libcacard_includedir)"
+	libtool --mode=install $(INSTALL_PROG) libcacard.la "$(DESTDIR)$(libdir)";
+	libtool --mode=install $(INSTALL_PROG) libcacard.pc "$(DESTDIR)$(pkgconfigdir)"
+	for inc in *.h; do \
+		libtool --mode=install $(INSTALL_PROG) $(libcacard_srcpath)/$$inc "$(libcacard_includedir)"; \
+	done
+
 endif
diff --git a/libcacard/libcacard.pc.in b/libcacard/libcacard.pc.in
new file mode 100644
index 0000000..b6859b0
--- /dev/null
+++ b/libcacard/libcacard.pc.in
@@ -0,0 +1,13 @@
+prefix=@PREFIX@
+exec_prefix=${prefix}
+libdir=@LIBDIR@
+includedir=@INCLUDEDIR@
+
+Name: cacard
+Description: CA Card library
+Version: @VERSION@
+
+Requires:  nss
+Libs: -L${libdir} -lcacard
+Libs.private:
+Cflags: -I${includedir}
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes
  2011-06-27 10:34 ` [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes Alon Levy
@ 2011-06-27 12:11   ` Christophe Fergeau
  2011-06-27 16:38     ` Alon Levy
  0 siblings, 1 reply; 4+ messages in thread
From: Christophe Fergeau @ 2011-06-27 12:11 UTC (permalink / raw)
  To: Alon Levy; +Cc: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 941 bytes --]

Hi,

On Mon, Jun 27, 2011 at 12:34:44PM +0200, Alon Levy wrote:
> Also add --pkgconfigdir and --includedir configure parameters.
> ---
>  configure                 |   10 ++++++++++
>  libcacard/Makefile        |   25 ++++++++++++++++++++++---
>  libcacard/libcacard.pc.in |   13 +++++++++++++
>  3 files changed, 45 insertions(+), 3 deletions(-)
>  create mode 100644 libcacard/libcacard.pc.in
> 
> diff --git a/configure b/configure
> index e523976..d08818f 100755
> --- a/configure
> +++ b/configure
> @@ -146,6 +146,8 @@ datadir="\${prefix}/share/qemu"
>  docdir="\${prefix}/share/doc/qemu"
>  bindir="\${prefix}/bin"
>  libdir="\${prefix}/lib"
> +pkgconfigdir="\${prefix}/lib/pkgconfig"

It would be more convenient if it was \${libdir}/pkgconfig and if it was
assigned a default value after --libdir has been parsed, though that would
look a bit out of place compared to how other values are set.

Christophe

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes
  2011-06-27 12:11   ` Christophe Fergeau
@ 2011-06-27 16:38     ` Alon Levy
  0 siblings, 0 replies; 4+ messages in thread
From: Alon Levy @ 2011-06-27 16:38 UTC (permalink / raw)
  To: Christophe Fergeau; +Cc: qemu-devel

On Mon, Jun 27, 2011 at 02:11:00PM +0200, Christophe Fergeau wrote:
> Hi,
> 
> On Mon, Jun 27, 2011 at 12:34:44PM +0200, Alon Levy wrote:
> > Also add --pkgconfigdir and --includedir configure parameters.
> > ---
> >  configure                 |   10 ++++++++++
> >  libcacard/Makefile        |   25 ++++++++++++++++++++++---
> >  libcacard/libcacard.pc.in |   13 +++++++++++++
> >  3 files changed, 45 insertions(+), 3 deletions(-)
> >  create mode 100644 libcacard/libcacard.pc.in
> > 
> > diff --git a/configure b/configure
> > index e523976..d08818f 100755
> > --- a/configure
> > +++ b/configure
> > @@ -146,6 +146,8 @@ datadir="\${prefix}/share/qemu"
> >  docdir="\${prefix}/share/doc/qemu"
> >  bindir="\${prefix}/bin"
> >  libdir="\${prefix}/lib"
> > +pkgconfigdir="\${prefix}/lib/pkgconfig"
> 
> It would be more convenient if it was \${libdir}/pkgconfig and if it was
> assigned a default value after --libdir has been parsed, though that would
> look a bit out of place compared to how other values are set.

ok, I'll drop --pkgconfigdir

> 
> Christophe

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-06-27 16:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-27 10:34 [Qemu-devel] [PATCH 1/2] libcacard: gitignore updates Alon Levy
2011-06-27 10:34 ` [Qemu-devel] [PATCH 2/2] libcacard: add pc file, install it + includes Alon Levy
2011-06-27 12:11   ` Christophe Fergeau
2011-06-27 16:38     ` Alon Levy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).