diff mbox

[v7] canfestival: new package

Message ID 1411492000260-80004.post@n4.nabble.com
State Not Applicable
Headers show

Commit Message

claurita Sept. 23, 2014, 5:06 p.m. UTC
I'd like to propose a little patch to add pkg-config support.
It's only a draft proposal, even if I'm using it. I hope it could be useful.
Claudio




--
View this message in context: http://buildroot-busybox.2317881.n4.nabble.com/PATCH-v7-canfestival-new-package-tp73727p80004.html
Sent from the Buildroot (busybox) mailing list archive at Nabble.com.

Comments

Thomas Petazzoni Sept. 23, 2014, 5:52 p.m. UTC | #1
Dear claurita,

On Tue, 23 Sep 2014 10:06:40 -0700 (PDT), claurita wrote:

> I'd like to propose a little patch to add pkg-config support.
> It's only a draft proposal, even if I'm using it. I hope it could be useful.

Thanks. But your patch is against canfestival itself, while you're
posting to the Buildroot mailing list. So you have two choices here:

 */ Submit your patch to the canfestival project directly.

 */ Add your patch inside Buildroot, in package/canfestival/, and then
    post a Buildroot patch adding your patch (yes, you'll have a patch
    adding a patch!)

Thanks,

Thomas Petazzoni
diff mbox

Patch

diff --git a/canfestival.pc.in b/canfestival.pc.in
new file mode 100644
index 0000000..08ecbe1
--- /dev/null
+++ b/canfestival.pc.in
@@ -0,0 +1,12 @@ 
+PREFIX = SUB_PREFIX
+TARGET = SUB_TARGET
+
+prefix=${DESTDIR}${PREFIX}
+libdir=${prefix}/lib
+includedir=${prefix}/include/canfestival
+
+Name: Canfestival
+Description: Canfestival CANOpen library 
+Version: 1
+Libs: -L${libdir} -lcanfestival -lcanfestival_${TARGET} -lrt -ldl -lpthread
+Cflags: -I${includedir}
diff --git a/configure b/configure
index b63b276..6d909d6 100755
--- a/configure
+++ b/configure
@@ -825,6 +825,7 @@  elif [ "$SUB_TARGET" = "unix" -a "$SUB_TIMERS_DRIVER" =
"kernel_xeno" ]; then
 
 elif [ "$SUB_TARGET" = "unix" ]; then
 	MAKEFILES=$MAKEFILES\
+\	canfestival.pc.in\
 \	examples/CANOpenShell/Makefile.in\
 \	examples/TestMasterSlave/Makefile.in\
 \	examples/TestMasterSlaveLSS/Makefile.in\
diff --git a/src/Makefile.in b/src/Makefile.in
index e709f4f..8bee33d 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -132,9 +132,10 @@  $(TARGET)_%.o: %.c
 	$(CC) $(CFLAGS) $(PROG_CFLAGS) ${PROGDEFINES} $(INCLUDES) -o $@ -c $<
 
 install: libcanfestival.a
-	mkdir -p $(DESTDIR)$(PREFIX)/lib/
+	mkdir -p $(DESTDIR)$(PREFIX)/lib/pkgconfig/
 	mkdir -p $(DESTDIR)$(PREFIX)/include/canfestival
 	cp libcanfestival.a $(DESTDIR)$(PREFIX)/lib/
+	cp ../canfestival.pc $(DESTDIR)$(PREFIX)/lib/pkgconfig/
 	cp ../include/*.h $(DESTDIR)$(PREFIX)/include/canfestival
 
 uninstall: