1 dnl sxe-srctree.m4 -- Checks on source tree and build directory
3 AC_DEFUN([SXE_COMPUTE_BLDDIR], [dnl
4 ## Calculate canonical name for sxe_blddir (i.e. current directory).
5 ## PWD may already be the preferable absolute name for ".",
6 ## but we can't trust it - it is sometimes inaccurate.
9 if test -n "$PWD" -a $(cd $PWD && pwd) = "$absolute_pwd"; then
12 sxe_blddir="$absolute_pwd"
13 SXE_CANONICALISE_PATH([sxe_blddir])
15 ])dnl SXE_COMPUTE_BLDDIR
17 AC_DEFUN([SXE_COMPUTE_SRCDIR], [dnl
18 ## Make srcdir absolute, if not already. It is important to
19 ## avoid running the path through pwd unnecessary, since pwd can
20 ## give you automounter prefixes, which can go away.
21 ## so? we want to build at last from our srcdir -hrop
28 sxe_srcdir="$sxe_blddir"
31 sxe_srcdir=$(cd $srcdir && pwd)
32 SXE_CANONICALISE_PATH([sxe_srcdir])
35 ])dnl SXE_COMPUTE_BLDDIR
37 AC_DEFUN([SXE_CHECK_SRCDIR_HEALTH], [dnl
38 ## check whether both sxe_blddir and sxe_srcdir have been set
39 if test "${sxe_blddir-unset}" = "unset"; then
40 ## run the computation
43 if test "${sxe_srcdir-unset}" = "unset"; then
44 ## run the computation
48 ## check if source dir and build dir coincide
49 AC_MSG_CHECKING([if source tree coincides with the build tree])
50 if test "$sxe_blddir" = "$sxe_srcdir" -o \
51 -f "$sxe_blddir/sxemacs_version.m4"; then
53 srcdir_equals_blddir_p=yes
55 AC_MSG_RESULT([no. Good Boy!])
56 srcdir_equals_blddir_p=no
59 ## Check if the source directory already has a configured system in it.
60 if test "$srcdir_equals_blddir_p" = "no" -a \
61 -f "$sxe_srcdir/src/config.h" -o \
62 "$srcdir_equals_blddir_p" = "no" -a \
63 -e "$sxe_srcdir/.sxemacs.source.tree"; then
64 AC_MSG_WARN([The directory tree `$sxe_srcdir' is being used])
65 AC_MSG_WARN([as a build directory right now; it has been configured in its own])
66 AC_MSG_WARN([right. To configure in another directory as well, you MUST])
67 AC_MSG_WARN([use GNU make. If you do not have GNU make, then you must])
68 AC_MSG_WARN([now do `make distclean' in $sxe_srcdir,])
69 AC_MSG_WARN([and then run $progbasename again.])
72 ])dnl SXE_CHECK_SRCDIR_HEALTH
74 dnl sxe-srctree.m4 ends here