summaryrefslogtreecommitdiffstats
path: root/aclocal/exeext.m4
blob: f922511a76831317531ec789546660ae076df2e0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
dnl Set the EXE extension
dnl
dnl 98/06/16 David Fiddes   	(D.J.Fiddes@hw.ac.uk)
dnl				Hacked from automake-1.3

# Check to see if we're running under Win32, without using
# AC_CANONICAL_*.  If so, set output variable EXEEXT to ".exe".
# Otherwise set it to "".

dnl RTEMS_EXEEXT()
dnl This knows we add .exe if we're building in the Cygwin32
dnl environment. But if we're not, then it compiles a test program
dnl to see if there is a suffix for executables.
AC_DEFUN(RTEMS_EXEEXT,
[AC_REQUIRE([RTEMS_CYGWIN32])
AC_MSG_CHECKING([for executable suffix])
AC_CACHE_VAL(rtems_cv_exeext,
[if test "$CYGWIN32" = yes; then
rtems_cv_exeext=.exe
else
cat > rtems_c_test.c << 'EOF'
int main() {
/* Nothing needed here */
}
EOF
${CC-cc} -o rtems_c_test $CFLAGS $CPPFLAGS $LDFLAGS rtems_c_test.c $LIBS 1>&5
rtems_cv_exeext=`echo rtems_c_test.* | grep -v rtems_c_test.c | sed -e s/rtems_c_test//`
rm -f rtems_c_test*])
test x"${rtems_cv_exeext}" = x && rtems_cv_exeext=no
fi
EXEEXT=""
test x"${rtems_cv_exeext}" != xno && EXEEXT=${rtems_cv_exeext}
AC_MSG_RESULT(${rtems_cv_exeext})
AC_SUBST(EXEEXT)])