summaryrefslogtreecommitdiff
path: root/configure.in
diff options
context:
space:
mode:
authoreban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-23 11:01:49 +0000
committereban <eban@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2002-09-23 11:01:49 +0000
commit849b1000b082186b17b851df8fb3b1654fd58cd3 (patch)
tree83dcdfcd9c137fbfb0a553a188886d057d499958 /configure.in
parent1eab34576a2578a0542d6c8b28a6538150818ead (diff)
* configure.in (RUBY_MINGW32): new macro. check for the MinGW
compiler envionment. * lib/mkmf.rb: refactoring. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2883 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'configure.in')
-rw-r--r--configure.in40
1 files changed, 33 insertions, 7 deletions
diff --git a/configure.in b/configure.in
index 4ed1081720..0f8272bb67 100644
--- a/configure.in
+++ b/configure.in
@@ -3,6 +3,35 @@ AC_INIT()
AC_PREREQ(2.50)
+AC_DEFUN(RUBY_MINGW32,
+[case "$host_os" in
+cygwin*)
+AC_CACHE_CHECK(for mingw32 environment, rb_cv_mingw32,
+[AC_TRY_CPP([
+#ifndef __MINGW32__
+# error
+#endif
+], rb_cv_mingw32=yes,rb_cv_mingw32=no)
+rm -f conftest*])
+test "$rb_cv_mingw32" = yes && target_os="mingw32"
+ ;;
+esac])
+
+AC_DEFUN(RUBY_CPPOUTFILE,
+[AC_CACHE_CHECK(whether ${CPP} accepts -o, rb_cv_cppoutfile,
+[cppflags=$CPPFLAGS
+CPPFLAGS='-o conftest.i'
+AC_TRY_CPP([], rb_cv_cppoutfile=yes, rb_cv_cppoutfile=no)
+if test "$rb_cv_cppoutfile" = yes; then
+ CPPOUTFILE=$CPPFLAGS
+else
+ CPPOUTFILE='> conftest.i'
+fi
+CPPFLAGS=$cppflags
+AC_SUBST(CPPOUTFILE)
+rm -f conftest*])
+])
+
rb_version=`grep RUBY_VERSION $srcdir/version.h`
MAJOR=`expr "$rb_version" : '#define RUBY_VERSION "\([0-9][0-9]*\)\.[0-9][0-9]*\.[0-9][0-9]*"'`
MINOR=`expr "$rb_version" : '#define RUBY_VERSION "[0-9][0-9]*\.\([0-9][0-9]*\)\.[0-9][0-9]*"'`
@@ -98,16 +127,13 @@ fi
AC_PROG_CC
AC_PROG_GCC_TRADITIONAL
-echo 'foo(){}' > conftest.c
-if ${CPP} -o conftest.i conftest.c >/dev/null 2>&1; then
- CPPOUTFILE='-o conftest.i'
-else
- CPPOUTFILE='> conftest.i'
-fi
-AC_SUBST(CPPOUTFILE)
+RUBY_CPPOUTFILE
+
OUTFLAG='-o '
AC_SUBST(OUTFLAG)
+RUBY_MINGW32
+
AC_PROG_YACC
AC_CHECK_TOOL(RANLIB, ranlib, :)
AC_CHECK_TOOL(AR, ar)