summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2011-08-17 19:30:50 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2011-08-17 19:30:50 +0000
commit318f0f55146c127ae7404b606454d23fe9752d01 (patch)
treee2f25214b719578b31f91fd53ae8874b86450fb1 /configure.ac
parentc38cb9586377120b2aea5651b4df025cee315b60 (diff)
Merged revisions 332369 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10 ................ r332369 | tilghman | 2011-08-17 14:24:59 -0500 (Wed, 17 Aug 2011) | 17 lines Merged revisions 332355 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.8 ........ r332355 | tilghman | 2011-08-17 14:21:36 -0500 (Wed, 17 Aug 2011) | 10 lines Re-add support for spaces in pathnames, including now spaces in DESTDIR. This was initially added to 1.8 prior to release, primarily to support the standard paths on Mac OS X, but was partially reverted recently in Subversion, due to the lack of support for spaces in DESTDIR. This commit restores support for the standard paths on Mac OS X, and also includes support for spaces in DESTDIR. (closes issue ASTERISK-18290) Reported by: pabelanger Review: https://reviewboard.asterisk.org/r/1326/ ........ ................ git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@332388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac73
1 files changed, 72 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index bc945ab0e..df7a62d9f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -133,6 +133,78 @@ if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
fi
fi
+# $HOME is preferred as our substitute path, unless $HOME contains a space
+for i in ${HOME} /tmp; do
+ if test "${i}" = ""; then continue; fi
+ if test "${i}" = "/"; then continue; fi
+ __ac_path_has_spaces=`echo $HOME | grep ' '`
+ if test "$ac_path_has_spaces" = ""; then :; else continue; fi
+ __ac_substitute_path=${i}
+ break
+done
+
+AC_PROG_LN_S
+__sub_ordinal=1
+MAKE_PREINSTALL=""
+MAKE_POSTINSTALL=""
+
+# It may initially seem a trifle bit excessive to evaluate all of these paths.
+# However, consider that many of these may invoke another variable, such as
+# ${prefix}, by default, which is not resolved until compile time. If that
+# variable contains a space, then each of the dependent variables will also
+# contain a space and thus will need the special treatment.
+for stdpath in prefix exec_prefix datarootdir datadir includedir infodir libdir libexecdir localstatedir mandir sbindir sharedstatedir sysconfdir astetcdir astsbindir astlibdir astheaderdir astmandir astvarlibdir astspooldir astlogdir astvarrundir astdatadir astdbdir astkeydir; do
+ eval "__ac_path_sub=\${$stdpath}"
+ #echo "__ac_path_sub=$__ac_path_sub"
+ __ac_path_has_var=`sh -c "echo '$__ac_path_sub' | grep '{'"`
+ if test "$__ac_path_has_var" = ""; then :; else
+ __ac_path_sub=`echo $__ac_path_sub | sed 's/{/{MAKE_/'`
+ fi
+
+ __ac_path_has_spaces=`sh -c "echo '$__ac_path_sub' | grep ' '"`
+ if test "$__ac_path_has_spaces" = ""; then
+ eval "MAKE_$stdpath=\$__ac_path_sub"
+ else
+ # Substitute path for a path without a space
+ eval "MAKE_$stdpath=\"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\""
+ MAKE_POSTINSTALL="${MAKE_POSTINSTALL} rm -f \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+ MAKE_PREINSTALL="${MAKE_PREINSTALL} rm -f \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+ MAKE_PREINSTALL="${MAKE_PREINSTALL} ${LN_S} -f \"\$(DESTDIR)$__ac_path_sub\" \"$__ac_substitute_path/.asterisk_install_path_${__sub_ordinal}\";"
+ __sub_ordinal=$((${__sub_ordinal}+1))
+ fi
+done
+AC_SUBST(MAKE_PREINSTALL)
+AC_SUBST(MAKE_POSTINSTALL)
+AC_SUBST(MAKE_prefix)
+AC_SUBST(MAKE_exec_prefix)
+AC_SUBST(MAKE_datarootdir)
+AC_SUBST(MAKE_datadir)
+AC_SUBST(MAKE_includedir)
+AC_SUBST(MAKE_infodir)
+AC_SUBST(MAKE_libdir)
+AC_SUBST(MAKE_libexecdir)
+AC_SUBST(MAKE_localstatedir)
+AC_SUBST(MAKE_mandir)
+AC_SUBST(MAKE_sbindir)
+AC_SUBST(MAKE_sharedstatedir)
+AC_SUBST(MAKE_sysconfdir)
+AC_SUBST(MAKE_astetcdir)
+AC_SUBST(MAKE_astsbindir)
+AC_SUBST(MAKE_astlibdir)
+AC_SUBST(MAKE_astheaderdir)
+AC_SUBST(MAKE_astmandir)
+AC_SUBST(MAKE_astvarlibdir)
+AC_SUBST(MAKE_astspooldir)
+AC_SUBST(MAKE_astlogdir)
+AC_SUBST(MAKE_astvarrundir)
+AC_SUBST(MAKE_astdatadir)
+AC_SUBST(MAKE_astdbdir)
+AC_SUBST(MAKE_astkeydir)
+
+test "x$MAKE_prefix" = xNONE && MAKE_prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$MAKE_exec_prefix" = xNONE && MAKE_exec_prefix='${prefix}'
+
BUILD_PLATFORM=${build}
BUILD_CPU=${build_cpu}
BUILD_VENDOR=${build_vendor}
@@ -227,7 +299,6 @@ AC_PROG_CXXCPP
AST_PROG_LD # note, does not work on FreeBSD
AC_PROG_AWK
AC_PROG_INSTALL
-AC_PROG_LN_S
AC_PROG_RANLIB
AST_CHECK_GNU_MAKE
AC_PROG_EGREP