[m-rev.] diff: avoid warnings concerning named pipes on MinGW

Julien Fischer juliensf at csse.unimelb.edu.au
Thu Jul 14 17:53:16 AEST 2011


Branches: main, 11.07

configure.in:
 	Don't emit warnings about being unable to create named pipes on
 	MinGW, since MinGW doens't currently provide (working) support
 	for doing that.

Julien.

Index: configure.in
===================================================================
RCS file: /home/mercury/mercury1/repository/mercury/configure.in,v
retrieving revision 1.579
diff -u -r1.579 configure.in
--- configure.in	27 May 2011 06:54:43 -0000	1.579
+++ configure.in	14 Jul 2011 07:51:18 -0000
@@ -687,46 +687,64 @@

  MERCURY_MSG("looking for a way to create named pipes...")

-save_PATH="$PATH"
-PATH="$PATH:/etc:/usr/etc:/sbin"
+# Neither mkfifo or mknod exist in a working state on MinGW, so on that
+# platform we skip the following tests in order to avoid emitting extra
+# warnings.
+#
+case "$host" in
+    *mingw*)
+        MERCURY_MSG("named pipes not available for MinGW")
+        AC_DEFINE_UNQUOTED(MR_MKFIFO, "")
+        MKFIFO=none
+        MKNOD=""
+    ;;

-AC_PATH_PROG(MKFIFO,mkfifo)
-if test "$MKFIFO" != ""; then
-    # check that it really works
-    tmp=$TMPDIR/fifo$$
-    trap "rm -f $tmp" 1 2 3 13 15
-    if $MKFIFO $tmp && test -p $tmp; then
-        true
-    else
-        MKFIFO=""
-    fi
-    rm -f $tmp
-fi
-if test "$MKFIFO" = ""; then
-    AC_PATH_PROG(MKNOD,mknod)
-    if test "$MKNOD" != ""; then
-        # check that it really works
-        tmp=$TMPDIR/fifo$$
-        trap "rm -f $tmp" 1 2 3 13 15
-        if $MKNOD $tmp p && test -p $tmp; then
-            MKFIFO=mkfifo_using_mknod
+    *)
+
+        save_PATH="$PATH"
+        PATH="$PATH:/etc:/usr/etc:/sbin"
+
+        AC_PATH_PROG(MKFIFO,mkfifo)
+        if test "$MKFIFO" != ""; then
+            # check that it really works
+            tmp=$TMPDIR/fifo$$
+            trap "rm -f $tmp" 1 2 3 13 15
+            if $MKFIFO $tmp && test -p $tmp; then
+                true
+            else
+                MKFIFO=""
+            fi
+            rm -f $tmp
+        fi
+        if test "$MKFIFO" = ""; then
+            AC_PATH_PROG(MKNOD,mknod)
+            if test "$MKNOD" != ""; then
+                # check that it really works
+                tmp=$TMPDIR/fifo$$
+                trap "rm -f $tmp" 1 2 3 13 15
+                if $MKNOD $tmp p && test -p $tmp; then
+                    MKFIFO=mkfifo_using_mknod
+                else
+                    MKNOD=
+                fi
+            fi
+        fi
+        if test "$MKFIFO" = ""; then
+            AC_MSG_WARN(cannot find a working \`mkfifo' or \`mknod')
+            MKFIFO=none
+            AC_DEFINE_UNQUOTED(MR_MKFIFO, "")
          else
-            MKNOD=
+            AC_DEFINE_UNQUOTED(MR_MKFIFO, "$MKFIFO")
          fi
-    fi
-fi
-if test "$MKFIFO" = ""; then
-    AC_MSG_WARN(cannot find a working \`mkfifo' or \`mknod')
-    MKFIFO=none
-    AC_DEFINE_UNQUOTED(MR_MKFIFO, "")
-else
-    AC_DEFINE_UNQUOTED(MR_MKFIFO, "$MKFIFO")
-fi
+
+        PATH="$save_PATH"
+    ;;
+esac
+
  AC_SUBST(MKFIFO)
  test "$MKNOD" = "" && MKNOD=mknod
  AC_SUBST(MKNOD)

-PATH="$save_PATH"
  #-----------------------------------------------------------------------------#

  MERCURY_MSG("looking for a way to create temporary files...")

--------------------------------------------------------------------------
mercury-reviews mailing list
Post messages to:       mercury-reviews at csse.unimelb.edu.au
Administrative Queries: owner-mercury-reviews at csse.unimelb.edu.au
Subscriptions:          mercury-reviews-request at csse.unimelb.edu.au
--------------------------------------------------------------------------



More information about the reviews mailing list