]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Initial attempt to detect Watcom C compiler
authorYang Tse <yangsita@gmail.com>
Tue, 14 Oct 2008 04:09:07 +0000 (04:09 +0000)
committerYang Tse <yangsita@gmail.com>
Tue, 14 Oct 2008 04:09:07 +0000 (04:09 +0000)
ares/m4/cares-compilers.m4
m4/curl-compilers.m4

index e5a20cb86041e65a876e1683285e4a1c0a8d92e7..5d7f0e5ebd0e14ce80f8d636c9bdf78b8f1340ca 100644 (file)
@@ -45,6 +45,7 @@ AC_DEFUN([CARES_CHECK_COMPILER], [
   CARES_CHECK_COMPILER_SGI_MIPS_C
   CARES_CHECK_COMPILER_SUNPRO_C
   CARES_CHECK_COMPILER_TINY_C
+  CARES_CHECK_COMPILER_WATCOM_C
   #
   if test "$compiler_id" = "unknown"; then
   cat <<_EOF 1>&2
@@ -335,6 +336,39 @@ AC_DEFUN([CARES_CHECK_COMPILER_TINY_C], [
 ])
 
 
+dnl CARES_CHECK_COMPILER_WATCOM_C
+dnl -------------------------------------------------
+dnl Verify if compiler being used is Watcom C.
+
+AC_DEFUN([CARES_CHECK_COMPILER_WATCOM_C], [
+  AC_MSG_CHECKING([if compiler is Watcom C])
+  CURL_CHECK_DEF([__WATCOMC__], [], [silent])
+  if test "$curl_cv_have_def___WATCOMC__" = "yes"; then
+    AC_MSG_RESULT([yes])
+    CURL_CHECK_DEF([__UNIX__], [], [silent])
+    if test "$curl_cv_have_def___UNIX__" = "yes"; then
+      compiler_id="WATCOM_UNIX_C"
+      flags_dbg_all="-g1 -g1+ -g2 -g3"
+      flags_dbg_yes="-g2"
+      flags_dbg_off=""
+      flags_opt_all="-O0 -O1 -O2 -O3"
+      flags_opt_yes="-O2"
+      flags_opt_off="-O0"
+    else
+      compiler_id="WATCOM_WINDOWS_C"
+      flags_dbg_all=""
+      flags_dbg_yes=""
+      flags_dbg_off=""
+      flags_opt_all=""
+      flags_opt_yes=""
+      flags_opt_off=""
+    fi
+  else
+    AC_MSG_RESULT([no])
+  fi
+])
+
+
 dnl CARES_CONVERT_INCLUDE_TO_ISYSTEM
 dnl -------------------------------------------------
 dnl Changes standard include paths present in CFLAGS
@@ -567,6 +601,18 @@ AC_DEFUN([CARES_SET_COMPILER_BASIC_OPTS], [
         tmp_CFLAGS="$tmp_CFLAGS"
         ;;
         #
+      WATCOM_UNIX_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
+      WATCOM_WINDOWS_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
     esac
     #
     tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS`
@@ -890,6 +936,20 @@ AC_DEFUN([CARES_SET_COMPILER_WARNING_OPTS], [
         fi
         ;;
         #
+      WATCOM_UNIX_C)
+        #
+        if test "$want_warnings" = "yes"; then
+          dnl Issue all warnings
+          dnl tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded"
+        fi
+        ;;
+        #
+      WATCOM_WINDOWS_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
     esac
     #
     tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS`
index ba2e10ef63b7554efbd7978666adc79530c71af6..03d35cdf4a0b95d342d2a44bd93770d230c48f47 100644 (file)
@@ -51,6 +51,7 @@ AC_DEFUN([CURL_CHECK_COMPILER], [
   CURL_CHECK_COMPILER_SGI_MIPS_C
   CURL_CHECK_COMPILER_SUNPRO_C
   CURL_CHECK_COMPILER_TINY_C
+  CURL_CHECK_COMPILER_WATCOM_C
   #
   if test "$compiler_id" = "unknown"; then
   cat <<_EOF 1>&2
@@ -341,6 +342,39 @@ AC_DEFUN([CURL_CHECK_COMPILER_TINY_C], [
 ])
 
 
+dnl CURL_CHECK_COMPILER_WATCOM_C
+dnl -------------------------------------------------
+dnl Verify if compiler being used is Watcom C.
+
+AC_DEFUN([CURL_CHECK_COMPILER_WATCOM_C], [
+  AC_MSG_CHECKING([if compiler is Watcom C])
+  CURL_CHECK_DEF([__WATCOMC__], [], [silent])
+  if test "$curl_cv_have_def___WATCOMC__" = "yes"; then
+    AC_MSG_RESULT([yes])
+    CURL_CHECK_DEF([__UNIX__], [], [silent])
+    if test "$curl_cv_have_def___UNIX__" = "yes"; then
+      compiler_id="WATCOM_UNIX_C"
+      flags_dbg_all="-g1 -g1+ -g2 -g3"
+      flags_dbg_yes="-g2"
+      flags_dbg_off=""
+      flags_opt_all="-O0 -O1 -O2 -O3"
+      flags_opt_yes="-O2"
+      flags_opt_off="-O0"
+    else
+      compiler_id="WATCOM_WINDOWS_C"
+      flags_dbg_all=""
+      flags_dbg_yes=""
+      flags_dbg_off=""
+      flags_opt_all=""
+      flags_opt_yes=""
+      flags_opt_off=""
+    fi
+  else
+    AC_MSG_RESULT([no])
+  fi
+])
+
+
 dnl CURL_CONVERT_INCLUDE_TO_ISYSTEM
 dnl -------------------------------------------------
 dnl Changes standard include paths present in CFLAGS
@@ -573,6 +607,18 @@ AC_DEFUN([CURL_SET_COMPILER_BASIC_OPTS], [
         tmp_CFLAGS="$tmp_CFLAGS"
         ;;
         #
+      WATCOM_UNIX_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
+      WATCOM_WINDOWS_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
     esac
     #
     tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS`
@@ -896,6 +942,20 @@ AC_DEFUN([CURL_SET_COMPILER_WARNING_OPTS], [
         fi
         ;;
         #
+      WATCOM_UNIX_C)
+        #
+        if test "$want_warnings" = "yes"; then
+          dnl Issue all warnings
+          dnl tmp_CFLAGS="$tmp_CFLAGS -Wall -Wextra -Wpadded"
+        fi
+        ;;
+        #
+      WATCOM_WINDOWS_C)
+        #
+        dnl Placeholder
+        tmp_CFLAGS="$tmp_CFLAGS"
+        ;;
+        #
     esac
     #
     tmp_CPPFLAGS=`eval echo $tmp_CPPFLAGS`