]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[configure] Add AS_AC_EXPAND for configured dirs
authorRay Strode <rstrode@redhat.com>
Fri, 7 Aug 2009 20:28:46 +0000 (16:28 -0400)
committerRay Strode <rstrode@redhat.com>
Fri, 7 Aug 2009 20:32:32 +0000 (16:32 -0400)
We want the .pc file to have the full expanded paths,
so it doesn't end up with unexpanded datarootdir, etc.

To achieve this we copy in the AS_AC_EXPAND macro
that thomasvs did a while ago.

acinclude.m4 [new file with mode: 0644]
configure.ac

diff --git a/acinclude.m4 b/acinclude.m4
new file mode 100644 (file)
index 0000000..8bd95a8
--- /dev/null
@@ -0,0 +1,50 @@
+dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])
+
index 4ef0f35bd60632794c8c9ffb25f3d2caa8b117c7..ce1b84fc5b092ad8f323a727b8dcd73cf13a03bc 100644 (file)
@@ -193,11 +193,11 @@ AC_CACHE_CHECK([for supported warning flags], plymouth_cv_warn_cflags, [
 WARN_CFLAGS="$plymouth_cv_warn_cflags"
 PLYMOUTH_CFLAGS="$PLYMOUTH_CFLAGS $WARN_CFLAGS"
 
-PLYMOUTH_THEME_PATH=$datadir/plymouth/themes
-AC_SUBST(PLYMOUTH_THEME_PATH)
+plymouththemedir=$datadir/plymouth/themes
+AS_AC_EXPAND(PLYMOUTH_THEME_PATH, $plymouththemedir)
 
-PLYMOUTH_PLUGIN_PATH=$libdir/plymouth/
-AC_SUBST(PLYMOUTH_PLUGIN_PATH)
+plymouthplugindir=$libdir/plymouth/
+AS_AC_EXPAND(PLYMOUTH_PLUGIN_PATH, $plymouthplugindir)
 
 AC_OUTPUT([Makefile
            src/libply/Makefile