Include .service.in file for activation, and adapt the project
[mmediamanager.git] / acinclude.m4
blob3f8ce8f881fc66a0ab6acc700808bf6426b6b660
1 dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
2 dnl
3 dnl example
4 dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
5 dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
6 AC_DEFUN([AS_AC_EXPAND],
8   EXP_VAR=[$1]
9   FROM_VAR=[$2]
10   dnl first expand prefix and exec_prefix if necessary
11   prefix_save=$prefix
12   exec_prefix_save=$exec_prefix
13   dnl if no prefix given, then use /usr/local, the default prefix
14   if test "x$prefix" = "xNONE"; then
15      prefix=$ac_default_prefix
16   fi
17   dnl if no exec_prefix given, then use prefix
18   if test "x$exec_prefix" = "xNONE"; then
19      exec_prefix=$prefix
20    fi
21    full_var="$FROM_VAR"
22    dnl loop until it doesn't change anymore
23    while true; do
24       new_full_var="`eval echo $full_var`"
25       if test "x$new_full_var"="x$full_var"; then break; fi
26       full_var=$new_full_var
27    done
28    dnl clean up
29    full_var=$new_full_var
30    AC_SUBST([$1], "$full_var")
31    dnl restore prefix and exec_prefix
32    prefix=$prefix_save
33    exec_prefix=$exec_prefix_save