[beast: 9/41] BUILD: add $beastdir / INSTALLPATH_BEASTDIR for /opt/<package> installation



commit 59c1d568eff8a85350462e819434ee41e31591af
Author: Tim Janik <timj gnu org>
Date:   Sun Jun 11 18:06:29 2017 +0200

    BUILD: add $beastdir / INSTALLPATH_BEASTDIR for /opt/<package> installation
    
    Signed-off-by: Tim Janik <timj gnu org>

 configure.ac        |   24 ++++++++++++++----------
 data/bse.pc.in      |    1 +
 pybeast/Makefile.am |    2 +-
 sfi/glib-extra.cc   |    4 ++--
 sfi/glib-extra.hh   |    2 +-
 5 files changed, 19 insertions(+), 14 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 4bdc672..9104b0f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,32 +82,36 @@ test "$TEST_SRCDIR" == "$TEST_BUILDDIR" || {
 # Define package directories per major/minor version
 bseincludedir="\${includedir}/bse-$MAJOR"
 bselibdir="\${libdir}/bse-$MAJOR.$MINOR.$MICRO"
-beastexecdir="\${libexecdir}/beast-$MAJOR.$MINOR.$MICRO"
 datadir="\${datarootdir}/beast"
 docdir="${datarootdir}/doc/beast" # "beast-$MAJOR"
-# Substitute directories in Makefiles
-AC_SUBST(bseincludedir)
-AC_SUBST(bselibdir)
-AC_SUBST(beastexecdir)
-AC_SUBST(datadir)
-AC_SUBST(docdir)
 # Provide directories for C++
 bak_prefix="$prefix"; bak_exec_prefix="$exec_prefix"; bak_libdir="$libdir"; bak_libexecdir="$libexecdir"
 bak_datarootdir="$datarootdir"; bak_datadir="$datadir"; bak_includedir="$includedir"
 test "x$prefix" = xNONE && prefix="$ac_default_prefix" ; test "x$exec_prefix" = xNONE && 
exec_prefix="$prefix"
 libdir=`eval echo "${libdir}"` ; libexecdir=`eval echo "${libexecdir}"` ; datarootdir=`eval echo 
"${datarootdir}"` ;
 datadir=`eval echo "${datadir}"`; bseincludedir=`eval echo "${bseincludedir}"`
-AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BSEINCLUDEDIR, ["`eval echo "${bseincludedir}"`"], [Sfidl standard 
include directory])
+case `eval echo "${exec_prefix}"` in
+  /usr|/usr/local)     beastdir="\${exec_prefix}/lib/beast-$MAJOR-$MINOR" ;;
+  *)                   beastdir="\${exec_prefix}/beast-$MAJOR-$MINOR" ;;
+esac
+bak_beastdir="$beastdir"
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BEASTDIR, ["`eval echo "${beastdir}"`"], [Beast program directory])
+AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BSEINCLUDEDIR, ["`eval echo "${bseincludedir}"`"], [Directory for 
libbse header files])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BINDIR, ["`eval echo "${bindir}"`"], [Directory to install and 
execute programs])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_LOCALEBASE, ["`eval echo ${localedir}`"], [Base directory for 
locale specific message catalogs])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_LADSPA, ["`eval echo ${libdir}/ladspa`"], [Searchpath for LADSPA 
plugins])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BSELIBDIR, ["`eval echo ${bselibdir}`"], [Directory to install 
plugins and drivers])
-AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_BEASTEXECDIR, ["`eval echo ${beastexecdir}`"], [Directory under 
whic to install Beast executable files])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_DATADIR, ["`eval echo ${datadir}`"], [Directory to install samples, 
effects, scripts, etc])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_DOCDIR, ["`eval echo ${docdir}`"], [Directory to install 
documentation])
 AC_DEFINE_UNQUOTED(CONFIGURE_INSTALLPATH_USER_DATA, ["~/beast"], [Searchpath for user owned Beast resources])
 prefix="$bak_prefix"; exec_prefix="$bak_exec_prefix"; libdir="$bak_libdir"; libexecdir="$bak_libexecdir"
-datarootdir="$bak_datarootdir"; datadir="$bak_datadir"; includedir="$bak_includedir"
+datarootdir="$bak_datarootdir"; datadir="$bak_datadir"; includedir="$bak_includedir"; 
beastdir="$bak_beastdir"
+# Substitute directories in Makefiles
+AC_SUBST(beastdir)
+AC_SUBST(bseincludedir)
+AC_SUBST(bselibdir)
+AC_SUBST(datadir)
+AC_SUBST(docdir)
 
 # == Check for git ==
 AC_MSG_CHECKING([for git repository])
diff --git a/data/bse.pc.in b/data/bse.pc.in
index 4fd115d..7e9c42d 100644
--- a/data/bse.pc.in
+++ b/data/bse.pc.in
@@ -1,5 +1,6 @@
 prefix=@prefix@
 exec_prefix=@exec_prefix@
+beastdir=@beastdir@
 libdir=@libdir@
 datarootdir=@datarootdir@
 datadir=@datadir@
diff --git a/pybeast/Makefile.am b/pybeast/Makefile.am
index b01ae92..583492a 100644
--- a/pybeast/Makefile.am
+++ b/pybeast/Makefile.am
@@ -1,5 +1,5 @@
 # BEAST & BSE
 include $(top_srcdir)/Makefile.decl
 
-pybeastdir     = ${beastexecdir}/pybeast
+pybeastdir     = ${beastdir}/pybeast
 pybeast_PYTHON = main.py
diff --git a/sfi/glib-extra.cc b/sfi/glib-extra.cc
index 9b48f8f..07a3b17 100644
--- a/sfi/glib-extra.cc
+++ b/sfi/glib-extra.cc
@@ -1064,8 +1064,8 @@ installpath (InstallpathType installpath_type)
     case INSTALLPATH_DATADIR_IMAGES:                    return installpath (INSTALLPATH_DATADIR) + "/images";
     case INSTALLPATH_DATADIR_KEYS:                      return installpath (INSTALLPATH_DATADIR) + "/keys";
     case INSTALLPATH_DATADIR_SKINS:                     return installpath (INSTALLPATH_DATADIR) + "/skins";
-    case INSTALLPATH_BEASTEXECDIR:                      return ovr ? installpath_topdir : 
CONFIGURE_INSTALLPATH_BEASTEXECDIR;
-    case INSTALLPATH_PYBEASTDIR:                        return installpath (INSTALLPATH_BEASTEXECDIR) + 
"/pybeast";
+    case INSTALLPATH_BEASTDIR:                          return ovr ? installpath_topdir : 
CONFIGURE_INSTALLPATH_BEASTDIR;
+    case INSTALLPATH_PYBEASTDIR:                        return installpath (INSTALLPATH_BEASTDIR) + 
"/pybeast";
     case INSTALLPATH_OBJDIR:                            return CONFIGURE_INSTALLPATH_OBJDIR;
     }
   return "";
diff --git a/sfi/glib-extra.hh b/sfi/glib-extra.hh
index 7e5ada0..3c7ee03 100644
--- a/sfi/glib-extra.hh
+++ b/sfi/glib-extra.hh
@@ -349,7 +349,7 @@ enum InstallpathType {
   INSTALLPATH_DATADIR_IMAGES,
   INSTALLPATH_DATADIR_KEYS,
   INSTALLPATH_DATADIR_SKINS,
-  INSTALLPATH_BEASTEXECDIR,
+  INSTALLPATH_BEASTDIR,
   INSTALLPATH_PYBEASTDIR,
   INSTALLPATH_OBJDIR,
 };


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]