aboutsummaryrefslogtreecommitdiffstats
path: root/autoconf/m4/build_exeext.m4
diff options
context:
space:
mode:
authorDan Gohman <djg@cray.com>2007-07-18 16:29:46 +0000
committerDan Gohman <djg@cray.com>2007-07-18 16:29:46 +0000
commitf17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc (patch)
treeebb79ea1ee5e3bc1fdf38541a811a8b804f0679a /autoconf/m4/build_exeext.m4
downloadexternal_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.zip
external_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.tar.gz
external_llvm-f17a25c88b892d30c2b41ba7ecdfbdfb2b4be9cc.tar.bz2
It's not necessary to do rounding for alloca operations when the requested
alignment is equal to the stack alignment. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@40004 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'autoconf/m4/build_exeext.m4')
-rw-r--r--autoconf/m4/build_exeext.m442
1 files changed, 42 insertions, 0 deletions
diff --git a/autoconf/m4/build_exeext.m4 b/autoconf/m4/build_exeext.m4
new file mode 100644
index 0000000..5ea7d2e
--- /dev/null
+++ b/autoconf/m4/build_exeext.m4
@@ -0,0 +1,42 @@
+# Check for the extension used for executables on build platform.
+# This is necessary for cross-compiling where the build platform
+# may differ from the host platform.
+AC_DEFUN([AC_BUILD_EXEEXT],
+[
+AC_MSG_CHECKING([for executable suffix on build platform])
+AC_CACHE_VAL(ac_cv_build_exeext,
+[if test "$CYGWIN" = yes || test "$MINGW32" = yes; then
+ ac_cv_build_exeext=.exe
+else
+ ac_build_prefix=${build_alias}-
+
+ AC_CHECK_PROG(BUILD_CC, ${ac_build_prefix}gcc, ${ac_build_prefix}gcc)
+ if test -z "$BUILD_CC"; then
+ AC_CHECK_PROG(BUILD_CC, gcc, gcc)
+ if test -z "$BUILD_CC"; then
+ AC_CHECK_PROG(BUILD_CC, cc, cc, , , /usr/ucb/cc)
+ fi
+ fi
+ test -z "$BUILD_CC" && AC_MSG_ERROR([no acceptable cc found in \$PATH])
+ ac_build_link='${BUILD_CC-cc} -o conftest $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&AS_MESSAGE_LOG_FD'
+ rm -f conftest*
+ echo 'int main () { return 0; }' > conftest.$ac_ext
+ ac_cv_build_exeext=
+ if AC_TRY_EVAL(ac_build_link); then
+ for file in conftest.*; do
+ case $file in
+ *.c | *.o | *.obj) ;;
+ *) ac_cv_build_exeext=`echo $file | sed -e s/conftest//` ;;
+ esac
+ done
+ else
+ AC_MSG_ERROR([installation or configuration problem: compiler cannot create executables.])
+ fi
+ rm -f conftest*
+ test x"${ac_cv_build_exeext}" = x && ac_cv_build_exeext=blank
+fi])
+BUILD_EXEEXT=""
+test x"${ac_cv_build_exeext}" != xblank && BUILD_EXEEXT=${ac_cv_build_exeext}
+AC_MSG_RESULT(${ac_cv_build_exeext})
+ac_build_exeext=$BUILD_EXEEXT
+AC_SUBST(BUILD_EXEEXT)])