diff --git a/Network/BSD.hsc b/Network/BSD.hsc
--- a/Network/BSD.hsc
+++ b/Network/BSD.hsc
@@ -1,4 +1,4 @@
-{-# OPTIONS -fglasgow-exts -cpp #-}
+{-# LANGUAGE CPP, ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Network.BSD
diff --git a/Network/Socket/Internal.hsc b/Network/Socket/Internal.hsc
--- a/Network/Socket/Internal.hsc
+++ b/Network/Socket/Internal.hsc
@@ -1,4 +1,4 @@
-{-# OPTIONS -fglasgow-exts -cpp #-}
+{-# LANGUAGE CPP, ForeignFunctionInterface #-}
 -----------------------------------------------------------------------------
 -- |
 -- Module      :  Network.Socket.Internal
diff --git a/Network/URI.hs b/Network/URI.hs
--- a/Network/URI.hs
+++ b/Network/URI.hs
@@ -1,4 +1,4 @@
-{-# OPTIONS_GHC -fglasgow-exts -cpp #-}
+{-# LANGUAGE CPP #-}
 --------------------------------------------------------------------------------
 -- |
 --  Module      :  Network.URI
@@ -1070,6 +1070,7 @@
         , uriQuery     = ""
         }
     where
+        diff :: Eq b => (a -> b) -> a -> a -> Bool
         diff sel u1 u2 = sel u1 /= sel u2
         -- Remove dot segments except the final segment
         removeBodyDotSegments p = removeDotSegments p1 ++ p2
diff --git a/configure b/configure
--- a/configure
+++ b/configure
@@ -3334,7 +3334,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -3355,7 +3355,7 @@
 else
   ac_cv_header_stdc=no
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 fi
 
@@ -4287,7 +4287,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 { echo "$as_me:$LINENO: checking for SO_PEERCRED and struct ucred in sys/socket.h" >&5
@@ -4976,7 +4976,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 { echo "$as_me:$LINENO: checking for sendfile in sys/socket.h" >&5
@@ -5002,7 +5002,7 @@
   { echo "$as_me:$LINENO: result: no" >&5
 echo "${ECHO_T}no" >&6; }
 fi
-rm -f conftest*
+rm -f -r conftest*
 
 
 
diff --git a/include/HsNetworkConfig.h b/include/HsNetworkConfig.h
--- a/include/HsNetworkConfig.h
+++ b/include/HsNetworkConfig.h
@@ -17,7 +17,7 @@
 
 /* Define to 1 if you have the declaration of `AI_NUMERICSERV', and to 0 if
    you don't. */
-#define HAVE_DECL_AI_NUMERICSERV 0
+#define HAVE_DECL_AI_NUMERICSERV 1
 
 /* Define to 1 if you have the declaration of `AI_V4MAPPED', and to 0 if you
    don't. */
diff --git a/network.cabal b/network.cabal
--- a/network.cabal
+++ b/network.cabal
@@ -1,12 +1,12 @@
 name:           network
-version:        2.2.1.7
+version:        2.2.1.8
 license:        BSD3
 license-file:   LICENSE
 maintainer:     Johan Tibell <johan.tibell@gmail.com>
 synopsis:       Networking-related facilities
 category:       Network
 build-type:     Configure
-cabal-version:  >=1.2
+cabal-version:  >=1.2.3
 extra-tmp-files:
                 config.log config.status autom4te.cache
                 network.buildinfo include/HsNetworkConfig.h
@@ -29,12 +29,13 @@
   build-depends: base < 5, parsec
 
   if flag(base4)
-      build-depends:    base>=4
+      build-depends:    base >= 4 && < 4.4
       cpp-options:      -DBASE4
   else
       build-depends:    base<4
 
-  extensions:   CPP
+  extensions:   CPP, DeriveDataTypeable, ForeignFunctionInterface,
+                TypeSynonymInstances
   include-dirs:         include
   includes:       HsNet.h
   install-includes:
