[PATCH weston sdk v2 2/8] autotools: Define paths in configure.ac

Quentin Glidic sardemff7+wayland at sardemff7.net
Mon Jul 1 08:03:02 PDT 2013


From: Quentin Glidic <sardemff7+git at sardemff7.net>

Signed-off-by: Quentin Glidic <sardemff7+git at sardemff7.net>
---
 configure.ac             | 26 ++++++++++++++++++++++++++
 man/Makefile.am          |  2 +-
 src/Makefile.am          |  4 ++--
 src/weston.pc.in         |  4 ++--
 src/xwayland/Makefile.am |  2 +-
 5 files changed, 32 insertions(+), 6 deletions(-)

diff --git a/configure.ac b/configure.ac
index 375360c..e710a75 100644
--- a/configure.ac
+++ b/configure.ac
@@ -35,6 +35,32 @@ LT_INIT([disable-static])
 AC_ARG_VAR([WESTON_NATIVE_BACKEND],
            [Set the native backend to use, if Weston is not running under Wayland nor X11. @<:@default=drm-backend.so@:>@])
 
+
+#
+# Directories
+#
+
+# package-specific dirs
+pkglibdir='${libdir}/'${PACKAGE}
+pkgincludedir='${includedir}/'${PACKAGE}
+pkgdatadir='${datadir}/'${PACKAGE}
+AC_SUBST([pkglibdir])
+AC_SUBST([pkgincludedir])
+AC_SUBST([pkgdatadir])
+
+# pkg-config files
+m4_ifdef([PKG_INSTALLDIR], [
+		PKG_INSTALLDIR()
+	], [
+		pkgconfigdir='${libdir}/pkgconfig'
+		AC_SUBST([pkgconfigdir])
+	])
+
+# weston specific dirs
+moduledir='${pkglibdir}/plugins'
+AC_SUBST([moduledir])
+
+
 PKG_PROG_PKG_CONFIG()
 
 AC_CHECK_FUNC([dlopen], [],
diff --git a/man/Makefile.am b/man/Makefile.am
index e4abd8c..37174e2 100644
--- a/man/Makefile.am
+++ b/man/Makefile.am
@@ -6,7 +6,7 @@ endif
 
 MAN_SUBSTS = \
 	-e 's|__weston_native_backend__|$(WESTON_NATIVE_BACKEND)|g' \
-	-e 's|__weston_modules_dir__|$(pkglibdir)|g' \
+	-e 's|__weston_modules_dir__|$(moduledir)|g' \
 	-e 's|__version__|$(PACKAGE_VERSION)|g'
 
 SUFFIXES = .1 .5 .7 .man
diff --git a/src/Makefile.am b/src/Makefile.am
index d06e773..630e740 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -84,7 +84,8 @@ endif
 
 endif # BUILD_WESTON_LAUNCH
 
-pkgconfigdir = $(libdir)/pkgconfig
+# *dir vars are defined in configure.ac
+
 pkgconfig_DATA = weston.pc
 
 westonincludedir = $(includedir)/weston
@@ -94,7 +95,6 @@ westoninclude_HEADERS =				\
 	../shared/matrix.h			\
 	../shared/config-parser.h
 
-moduledir = $(libdir)/weston
 module_LTLIBRARIES =				\
 	$(desktop_shell)			\
 	$(tablet_shell)				\
diff --git a/src/weston.pc.in b/src/weston.pc.in
index 5e61d3d..3c61c98 100644
--- a/src/weston.pc.in
+++ b/src/weston.pc.in
@@ -1,9 +1,9 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
 libdir=@libdir@
-includedir=@includedir@
 libexecdir=@libexecdir@
-pkglibexecdir=${libexecdir}/@PACKAGE@
+includedir=@includedir@
+pkglibexecdir=@pkglibexecdir@
 
 Name: Weston Plugin API
 Description: Header files for Weston plugin development
diff --git a/src/xwayland/Makefile.am b/src/xwayland/Makefile.am
index 82ad53d..a322cb7 100644
--- a/src/xwayland/Makefile.am
+++ b/src/xwayland/Makefile.am
@@ -6,7 +6,7 @@ AM_CPPFLAGS =					\
 	-DLIBEXECDIR='"$(libexecdir)"'		\
 	-DXSERVER_PATH='"@XSERVER_PATH@"'
 
-moduledir = @libdir@/weston
+# moduledir is defined in configure.ac
 module_LTLIBRARIES = xwayland.la
 
 xwayland = xwayland.la
-- 
1.8.3.1



More information about the wayland-devel mailing list