[PD-dev] [PATCH] headers into ${includedir}/pd/

IOhannes m zmoelnig zmoelnig at iem.at
Thu Aug 5 11:08:08 CEST 2010


in order to not pollute /usr/include/ with files like s_stuff.h and to prevent
name-clashes with other packages, headers should go into a special subdirectory.

"make install" installs headers into "${includedir}/pd"

to make this directory findeable, this also includes pkg-config support
---
 Makefile.am     |    4 ++++
 configure.ac    |    4 +++-
 pd.pc.in        |   22 ++++++++++++++++++++++
 src/Makefile.am |    5 ++++-
 4 files changed, 33 insertions(+), 2 deletions(-)
 create mode 100644 pd.pc.in

diff --git a/Makefile.am b/Makefile.am
index cbca131..26a8cb6 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -4,6 +4,10 @@ ACLOCAL_AMFLAGS = -I m4
 CFLAGS += @DEFS@
 EXTRA_SUBDIRS = 
 
+# pkg-config support
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = pd.pc
+
 if ASIO
 EXTRA_SUBDIRS += asio
 endif
diff --git a/configure.ac b/configure.ac
index 80e609f..95e578d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -226,7 +226,9 @@ AC_CONFIG_FILES([Makefile
                 portmidi/Makefile
                 tcl/Makefile
                 po/Makefile
-                src/Makefile])
+                src/Makefile
+                pd.pc
+                ])
 
 AC_OUTPUT
 
diff --git a/pd.pc.in b/pd.pc.in
new file mode 100644
index 0000000..2150dd0
--- /dev/null
+++ b/pd.pc.in
@@ -0,0 +1,22 @@
+# Pure data pkg-config file
+# LATER: shouldn't "--libs" output all flags for building an external?
+
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+###############################
+# variables
+# the default file-extension for externals (e.g. "l_i386")
+extension=@EXTENSION@
+# where to install externals
+externaldir=${libdir}/pd/extra
+
+###############################
+# core configuration
+Name: pd
+Description: Pure data externals
+Version: @PACKAGE_VERSION@
+Libs: 
+Cflags: -I${includedir}/pd -DPD
diff --git a/src/Makefile.am b/src/Makefile.am
index 4f85211..7b7a72a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -30,7 +30,10 @@ pd_SOURCES = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c \
     x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
     x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c x_list.c d_soundfile.c
 
-include_HEADERS = m_pd.h m_imp.h g_canvas.h s_stuff.h
+pd_includedir = ${includedir}/pd
+pd_include_HEADERS = m_pd.h m_imp.h g_canvas.h s_stuff.h
+# compatibility: m_pd.h also goes into ${includedir}/
+include_HEADERS = m_pd.h
 noinst_HEADERS = g_all_guis.h s_audio_alsa.h s_audio_pablio.h s_audio_paring.h
 
 
-- 
1.7.1




More information about the Pd-dev mailing list