From 977eac590af652642b1f5506bb7c7f1ae172b58e Mon Sep 17 00:00:00 2001 From: Ray Strode Date: Fri, 7 Aug 2009 16:28:46 -0400 Subject: [PATCH] [configure] Add AS_AC_EXPAND for configured dirs 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 | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 8 ++++---- 2 files changed, 54 insertions(+), 4 deletions(-) create mode 100644 acinclude.m4 diff --git a/acinclude.m4 b/acinclude.m4 new file mode 100644 index 0000000..8bd95a8 --- /dev/null +++ b/acinclude.m4 @@ -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 + +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 +]) + diff --git a/configure.ac b/configure.ac index 4ef0f35..ce1b84f 100644 --- a/configure.ac +++ b/configure.ac @@ -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