Skip to contentSkip to conversation

libsctp: add pkg-config support

PATCH Superseded [email protected] 2 participants 3 messages Feb 29, 2016 – Mar 3, 2016

Subsystems (2)

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 libsctp: add pkg-config support

From: Yegor Yefremov <[email protected]>

pkg-config is a helper tool used when compiling applications and libraries. This patch adds automatic generation and installation of libsctp.pc file, that provides libsctp's version, compiler and linker information.

---
 Makefile.am   |  5 +++++
 configure.ac  |  3 ++-
 libsctp.pc.in | 10 ++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 libsctp.pc.in
Makefile.am +5 -0
index 2c9c8c6..58cacf0 100644
@@ -9,6 +9,11 @@ EXTRA_DIST += ChangeLog AUTHORS COPYING COPYING.lib INSTALL \
 	README ROADMAP NEWS \
 	Makefile.vars Makefile.rules Makefile.dirs
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libsctp.pc
+EXTRA_DIST += libsctp.pc.in
+CLEANFILES = libsctp.pc
+
 # bin or src products may be required to generate stuff in test/
 SUBDIRS = man bin src doc
 
configure.ac +2 -1
index 778dac5..675fb96 100644
@@ -72,5 +72,6 @@ AC_CONFIG_FILES([lksctp-tools.spec
 		src/lib/Makefile
 		src/testlib/Makefile
 		src/withsctp/Makefile
-		doc/Makefile])
+		doc/Makefile
+		libsctp.pc])
 AC_OUTPUT
libsctp.pc.in new file +10 -0
new file mode 100644
index 0000000..b1eafaf
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: sctp
+Description: User-level SCTP API library
+Version: @VERSION@
+Libs: -L${libdir} -lsctp
+Cflags: -I${includedir}
Signature · 1 line
2.7.0
#1 lore raw
Quoted 19 lines · On Mon, Feb 29, 2016 at 12:25:42PM +0100, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

pkg-config is a helper tool used when compiling applications and libraries. This patch adds automatic generation and installation of libsctp.pc file, that provides libsctp's version, compiler and linker information.

---
 Makefile.am   |  5 +++++
 configure.ac  |  3 ++-
 libsctp.pc.in | 10 ++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 libsctp.pc.in
Makefile.am +0 -0
index 2c9c8c6..58cacf0 100644

Makefile.am EXTRA_DIST += ChangeLog AUTHORS COPYING COPYING.lib INSTALL \ · line 15

Quoted 7 lines
Makefile.am +4 -0
@@ -9,6 +9,11 @@ EXTRA_DIST += ChangeLog AUTHORS COPYING COPYING.lib INSTALL \
 	README ROADMAP NEWS \
 	Makefile.vars Makefile.rules Makefile.dirs
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libsctp.pc
+EXTRA_DIST += libsctp.pc.in
+CLEANFILES = libsctp.pc

After applying this patch, I'm getting:

+ automake --foreign --add-missing --copy
configure.ac:31: installing 'bin/compile'
configure.ac:22: installing 'bin/missing'
Makefile.am:15: warning: CLEANFILES multiply defined in condition TRUE
...
Makefile.vars:7: ... 'CLEANFILES' previously defined here
Makefile.am:1: 'Makefile.vars' included from here
src/apps/Makefile.am: installing 'bin/depcomp'

lksctp-tools]$ grep -w CLEANFILES Makefile.vars Makefile.am Makefile.vars:CLEANFILES =
Makefile.am:CLEANFILES = libsctp.pc

I checked some other projects and seems that setting it to clean this file is not a standard practice, specially with CLEANFILES because it will clean this file with 'make clean' while it's being generated by configure and not the make step. If you find it really necessary, it would be better to use DISTCLEANFILES instead.

Thanks,
Marcelo

Quoted 40 lines
Makefile.am +1 -0
+
 # bin or src products may be required to generate stuff in test/
 SUBDIRS = man bin src doc
 
configure.ac +2 -1
index 778dac5..675fb96 100644
@@ -72,5 +72,6 @@ AC_CONFIG_FILES([lksctp-tools.spec
 		src/lib/Makefile
 		src/testlib/Makefile
 		src/withsctp/Makefile
-		doc/Makefile])
+		doc/Makefile
+		libsctp.pc])
 AC_OUTPUT
libsctp.pc.in new file +10 -0
new file mode 100644
index 0000000..b1eafaf
@@ -0,0 +1,10 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: sctp
+Description: User-level SCTP API library
+Version: @VERSION@
+Libs: -L${libdir} -lsctp
+Cflags: -I${includedir}
Signature · 6 lines
2.7.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sctp" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
#2 lore raw
In reply to [email protected]

Hi Marcelo,

Quoted 39 lines · Marcelo Ricardo Leitner
Quoted 19 lines · On Mon, Feb 29, 2016 at 12:25:42PM +0100, [email protected] wrote:

From: Yegor Yefremov <[email protected]>

pkg-config is a helper tool used when compiling applications and libraries. This patch adds automatic generation and installation of libsctp.pc file, that provides libsctp's version, compiler and linker information.

---
 Makefile.am   |  5 +++++
 configure.ac  |  3 ++-
 libsctp.pc.in | 10 ++++++++++
 3 files changed, 17 insertions(+), 1 deletion(-)
 create mode 100644 libsctp.pc.in
Makefile.am +0 -0
index 2c9c8c6..58cacf0 100644

Makefile.am EXTRA_DIST += ChangeLog AUTHORS COPYING COPYING.lib INSTALL \ · line 15

Quoted 7 lines
Makefile.am +4 -0
@@ -9,6 +9,11 @@ EXTRA_DIST += ChangeLog AUTHORS COPYING COPYING.lib INSTALL \
      README ROADMAP NEWS \
      Makefile.vars Makefile.rules Makefile.dirs
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libsctp.pc
+EXTRA_DIST += libsctp.pc.in
+CLEANFILES = libsctp.pc

After applying this patch, I'm getting:

+ automake --foreign --add-missing --copy
configure.ac:31: installing 'bin/compile'
configure.ac:22: installing 'bin/missing'
Makefile.am:15: warning: CLEANFILES multiply defined in condition TRUE
...
Makefile.vars:7: ... 'CLEANFILES' previously defined here
Makefile.am:1: 'Makefile.vars' included from here
src/apps/Makefile.am: installing 'bin/depcomp'

Quoted 8 lines

lksctp-tools]$ grep -w CLEANFILES Makefile.vars Makefile.am Makefile.vars:CLEANFILES > Makefile.am:CLEANFILES = libsctp.pc

I checked some other projects and seems that setting it to clean this file is not a standard practice, specially with CLEANFILES because it will clean this file with 'make clean' while it's being generated by configure and not the make step. If you find it really necessary, it would be better to use DISTCLEANFILES instead.

Thanks for review. I've sent v2.

Yegor