summaryrefslogtreecommitdiff
path: root/m4/acinclude.m4
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-12-06 17:15:04 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-12-06 17:15:04 +0000
commit98d13cf9aee4ba24fc7a9350b1ea4d9d2cd0a515 (patch)
treefd47494d1d5d9e0562d4247638d08ff80aa1cf3b /m4/acinclude.m4
parentf58e434731276b8c3d2e38168c7e5bc1c6c69522 (diff)
downloadATCD-98d13cf9aee4ba24fc7a9350b1ea4d9d2cd0a515.tar.gz
ChangeLogTag:Mon Dec 6 11:06:43 1999 Ossama Othman <othman@cs.wustl.edu>
Diffstat (limited to 'm4/acinclude.m4')
-rw-r--r--m4/acinclude.m431
1 files changed, 24 insertions, 7 deletions
diff --git a/m4/acinclude.m4 b/m4/acinclude.m4
index c9c5f11f2b2..d119a61d8b0 100644
--- a/m4/acinclude.m4
+++ b/m4/acinclude.m4
@@ -66,17 +66,21 @@ dnl Usage: ACE_TRY_COMPILE(COMPILER-FLAGS, INCLUDES, FUNCTION-BODY,
dnl [ACTION-IF-FOUND [,ACTION-IF-NOT-FOUND]])
AC_DEFUN(ACE_TRY_COMPILE, dnl
[
- ace_pre_try_CXXFLAGS="$CXXFLAGS"
- CXXFLAGS="$CXXFLAGS $1"
-
- ace_pre_try_CFLAGS="$CFLAGS"
- CFLAGS="$CFLAGS $1"
+ ifelse(AC_LANG, [CPLUSPLUS],
+ [
+ ace_pre_try_CXXFLAGS="$CXXFLAGS"
+ CXXFLAGS="$CXXFLAGS $1"
+ ],
+ [
+ ace_pre_try_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $1"
+ ])
AC_TRY_COMPILE($2, $3, $4, $5)
dnl Restore the C++ and C flags
- CXXFLAGS="$ace_pre_try_CXXFLAGS"
- CFLAGS="$ace_pre_try_CFLAGS"
+ ifelse(AC_LANG, [CPLUSPLUS],
+ [CXXFLAGS="$ace_pre_try_CXXFLAGS"],[CFLAGS="$ace_pre_try_CFLAGS"])
])
@@ -90,12 +94,22 @@ dnl header when doing an AC_TRY_COMPILE.
dnl Usage: ACE_USE_TEMP_FILE(TEMP-FILE-TO-CREATE, COMMANDS-THAT-WILL-USE-IT)
AC_DEFUN(ACE_USE_TEMP_FILE, dnl
[
+ test -d ./$1 && AC_MSG_ERROR([cannot create file: $acetmp is a directory])
test -f ${srcdir}/$1 && mv ${srcdir}/$1 ${srcdir}/$1.conf
touch ${srcdir}/$1
if test ${srcdir}/$1 != "./$1"; then
test -f ./$1 && mv ./$1 ./$1.conf
+ dnl Create all of the sub-directories (assume "mkdir -p" is not portable).
+ acetmp="."
+changequote(, )dnl
+ for ace_dir in `echo $1 | sed -e 's,/[^/][^/]*\$,,' -e 's,/, ,g'`; do
+changequote([, ])dnl
+ acetmp="$acetmp/$ace_dir"
+ test -f $acetmp && AC_MSG_ERROR([cannot create directory: $acetmp])
+ test -d $acetmp || mkdir $acetmp
+ done
touch ./$1
fi
@@ -111,6 +125,9 @@ AC_DEFUN(ACE_USE_TEMP_FILE, dnl
if test -f ./$1.conf; then
mv ./$1.conf ./$1
else
+ dnl Remove the file. Any sub-directories will not be removed
+ dnl since we have no way to tell if they existed prior to the
+ dnl creation of this file.
rm ./$1
fi
fi