]> git.proxmox.com Git - mirror_smartmontools-debian.git/blobdiff - configure.in
Imported Upstream version 5.38+svn2956
[mirror_smartmontools-debian.git] / configure.in
index 5c88a58c87d915f79f560fd4e7fecd51ae025e7e..e8ea75a66f016d346c07bc76b58291fad3529e77 100644 (file)
@@ -1,13 +1,13 @@
 #
-# $Id: configure.in 2890 2009-09-03 14:47:38Z samm2 $
+# $Id: configure.in 2927 2009-10-03 16:08:34Z chrfranke $
 #
 dnl Process this file with autoconf to produce a configure script.
 AC_PREREQ(2.50)
 AC_INIT(smartmontools, 5.39, smartmontools-support@lists.sourceforge.net)
 AC_CONFIG_SRCDIR(smartctl.cpp)
 
-smartmontools_configure_date=`date -u +"%Y/%m/%d %T %Z"`
-smartmontools_cvs_tag=`echo '$Id: configure.in 2890 2009-09-03 14:47:38Z samm2 $'`
+smartmontools_configure_date=`date -u +'%Y-%m-%d %T %Z'`
+smartmontools_cvs_tag=`echo '$Id: configure.in 2927 2009-10-03 16:08:34Z chrfranke $'`
 smartmontools_release_date=2008/03/10
 smartmontools_release_time="10:44:07 GMT"
 
@@ -34,8 +34,23 @@ AC_CANONICAL_HOST
 dnl Set flags which may affect AC_CHECK_*.
 case "${host}" in
        *-*-mingw*)
-               CPPFLAGS="$CPPFLAGS -mno-cygwin"
-               LDFLAGS="$LDFLAGS -mno-cygwin"
+               # If building on Cygwin and not cross-compiling add '-mno-cygwin'
+               # to select MinGW gcc. This does no longer work for gcc 4.x.
+               if test "${build}" = "${host}" && test -x /usr/bin/uname && \
+                  /usr/bin/uname | grep -i '^CYGWIN' >/dev/null; then
+                 AC_MSG_CHECKING([whether C and C++ compiler support -mno-cygwin])
+                 gcc_support_m_no_cygwin=no
+                 if $CC  -v -mno-cygwin >/dev/null 2>&1 && \
+                    $CXX -v -mno-cygwin >/dev/null 2>&1; then
+                   gcc_support_m_no_cygwin=yes
+                 fi
+                 AC_MSG_RESULT([$gcc_support_m_no_cygwin])
+                 if test "$gcc_support_m_no_cygwin" != "yes"; then
+                   AC_MSG_ERROR([$CC and $CXX do not support -mno-cygwin, see INSTALL file for details.])
+                 fi
+                 CPPFLAGS="$CPPFLAGS -mno-cygwin"
+                 LDFLAGS="$LDFLAGS -mno-cygwin"
+               fi
                CPPFLAGS="$CPPFLAGS -idirafter ${srcdir}/posix -idirafter ${srcdir}/os_win32"
                ;;
        *-*-freebsd*)