Skip to contentSkip to conversation

configure: use $prefix/etc instead of /etc

PATCH Superseded Alex Ivanov 2 participants 5 messages Mar 19, 2019 – Mar 23, 2019 1 message not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 configure: use $prefix/etc instead of /etc

Use $sysconfdir as prefix for ALSA_LCONF_DIR by default. Otherwise install fails on non-FHS distros.

---
 configure.ac | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
configure.ac +18 -1
index 5b80585..7b8dd66 100644
@@ -219,6 +219,23 @@ AC_DEFINE_UNQUOTED(ALSA_DATA_DIR, "$alsadatadir", [directory containing ALSA dat
 ALSA_DATA_DIR="$alsadatadir"
 AC_SUBST(ALSA_DATA_DIR)
 
+dnl ALSA configuration directory
+AC_ARG_WITH(alsaconfdir,
+    AS_HELP_STRING([--with-alsaconfdir=dir],
+  [path where ALSA configuration files are stored]),
+    alsaconfdir="$withval", alsaconfdir="")
+if test -z "$alsaconfdir"; then
+    eval dir="$sysconfdir"
+    case "$dir" in
+    /*) ;;
+    *) dir="$dir"
+    esac
+    alsaconfdir="$dir/alsa"
+fi
+AC_DEFINE_UNQUOTED(ALSA_CONF_DIR, "$alsaconfdir", [directory containing ALSA configuration files])
+ALSA_CONF_DIR="$alsaconfdir"
+AC_SUBST(ALSA_CONF_DIR)
+
 dnl ALSA add-on global config directory
 AC_ARG_WITH(alsagconfdir,
     AS_HELP_STRING([--with-alsagconfdir=dir],
@@ -237,7 +254,7 @@ AC_ARG_WITH(alsalconfdir,
 	[path where ALSA local add-on config files are stored]),
     alsalconfdir="$withval", alsalconfdir="")
 if test -z "$alsalconfdir"; then
-    alsalconfdir="/etc/alsa/conf.d"
+    alsalconfdir="$ALSA_CONF_DIR/conf.d"
 fi
 AC_DEFINE_UNQUOTED(ALSA_LCONF_DIR, "$alsalconfdir", [directory containing local ALSA add-on config files])
 ALSA_LCONF_DIR="$alsalconfdir"
Signature · 1 line
2.19.2

A message that is not in the archive (sent off-list or not yet received): [email protected]

#2 lore raw
Quoted 23 lines · Alex Ivanov

Use $sysconfdir as prefix for ALSA_LCONF_DIR by default. Otherwise install fails on non-FHS distros.

---
 configure.ac | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)
configure.ac +6 -0
index 5b80585..7b8dd66 100644
@@ -219,6 +219,23 @@ AC_DEFINE_UNQUOTED(ALSA_DATA_DIR, "$alsadatadir", [directory containing ALSA dat
 ALSA_DATA_DIR="$alsadatadir"
 AC_SUBST(ALSA_DATA_DIR)
 
+dnl ALSA configuration directory
+AC_ARG_WITH(alsaconfdir,
+    AS_HELP_STRING([--with-alsaconfdir=dir],
+  [path where ALSA configuration files are stored]),
+    alsaconfdir="$withval", alsaconfdir="")
+if test -z "$alsaconfdir"; then

configure.ac AC_DEFINE_UNQUOTED(ALSA_DATA_DIR, "$alsadatadir", [directory containing ALSA dat · line 237

Quoted 10 lines
configure.ac +10 -0
+    eval dir="$sysconfdir"
+    case "$dir" in
+    /*) ;;
+    *) dir="$dir"
+    esac
+    alsaconfdir="$dir/alsa"
+fi
+AC_DEFINE_UNQUOTED(ALSA_CONF_DIR, "$alsaconfdir", [directory containing ALSA configuration files])
+ALSA_CONF_DIR="$alsaconfdir"
+AC_SUBST(ALSA_CONF_DIR)

Yet another option is way too confusing, IMO.

configure.ac AC_ARG_WITH(alsalconfdir, · line 257

Quoted 10 lines
configure.ac +2 -1
+
 dnl ALSA add-on global config directory
 AC_ARG_WITH(alsagconfdir,
     AS_HELP_STRING([--with-alsagconfdir=dir],
@@ -237,7 +254,7 @@ AC_ARG_WITH(alsalconfdir,
 	[path where ALSA local add-on config files are stored]),
     alsalconfdir="$withval", alsalconfdir="")
 if test -z "$alsalconfdir"; then
-    alsalconfdir="/etc/alsa/conf.d"
+    alsalconfdir="$ALSA_CONF_DIR/conf.d"

Let's add the $sysconfdir usage here instead of adding a new --with-*.

Care to resubmit with that change?

thanks,

Takashi

#3 lore raw

PATCH 1/1 configure: use /etc instead of /etc

Hi, Takashi.

Sure. Here we go.

---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +1 -1
index 5b80585..b52923c 100644
@@ -237,7 +237,7 @@ AC_ARG_WITH(alsalconfdir,
 	[path where ALSA local add-on config files are stored]),
     alsalconfdir="$withval", alsalconfdir="")
 if test -z "$alsalconfdir"; then
-    alsalconfdir="/etc/alsa/conf.d"
+    alsalconfdir="$sysconfdir/alsa/conf.d"
 fi
 AC_DEFINE_UNQUOTED(ALSA_LCONF_DIR, "$alsalconfdir", [directory containing local ALSA add-on config files])
 ALSA_LCONF_DIR="$alsalconfdir"
Signature · 1 line
2.19.2
#4 lore raw

Re: [PATCH] [-, JACK, plugin, 1/1] configure: use /etc instead of /etc

Quoted 6 lines · Alex Ivanov

Hi, Takashi.

Sure. Here we go.

Erm, please keep more context in the patch description.

Quoted 9 lines
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
configure.ac +0 -0
index 5b80585..b52923c 100644

configure.ac AC_ARG_WITH(alsalconfdir, · line 241

Quoted 6 lines
configure.ac +1 -1
@@ -237,7 +237,7 @@ AC_ARG_WITH(alsalconfdir,
 	[path where ALSA local add-on config files are stored]),
     alsalconfdir="$withval", alsalconfdir="")
 if test -z "$alsalconfdir"; then
-    alsalconfdir="/etc/alsa/conf.d"
+    alsalconfdir="$sysconfdir/alsa/conf.d"
 fi

I tested this change, and it resulted in a bad string
#define ALSA_LCONF_DIR "${prefix}/etc/alsa/conf.d"

Actually the same bug is found in other places, e.g.
#define ALSA_DATA_DIR "${prefix}/share/alsa"

Hmm.

Takashi

#5 lore raw

PATCH v3 1/1 configure: use /etc instead of /etc

Use $sysconfdir as prefix for ALSA_LCONF_DIR by default. Otherwise install fails on non-FHS distros.

---
 configure.ac | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
configure.ac +6 -1
index 5b80585..1be4a70 100644
@@ -237,7 +237,12 @@ AC_ARG_WITH(alsalconfdir,
 	[path where ALSA local add-on config files are stored]),
     alsalconfdir="$withval", alsalconfdir="")
 if test -z "$alsalconfdir"; then
-    alsalconfdir="/etc/alsa/conf.d"
+    eval dir="$sysconfdir"
+    case "$dir" in
+    /*) ;;
+    *) dir="$dir"
+    esac
+    alsalconfdir="$dir/alsa/conf.d"
 fi
 AC_DEFINE_UNQUOTED(ALSA_LCONF_DIR, "$alsalconfdir", [directory containing local ALSA add-on config files])
 ALSA_LCONF_DIR="$alsalconfdir"
Signature · 1 line
2.19.2