Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

[project @ 2005-09-20 09:47:48 by ross]

make the network package independent
  • Loading branch information...
commit f1bb2a9eae36f94643963966a5f6ce470648e61a 1 parent ab953f1
ross authored
View
2  Network.hs
@@ -54,8 +54,6 @@ module Network (
) where
-#include "ghcconfig.h"
-
import Network.BSD
import Network.Socket hiding ( accept, socketPort, recvFrom, sendTo, PortNumber )
import qualified Network.Socket as Socket ( accept )
View
2  Network/BSD.hsc
@@ -23,7 +23,7 @@
#include "HsNet.h"
-- NOTE: ##, we want this interpreted when compiling the .hs, not by hsc2hs.
-##include "../../base/include/Typeable.h"
+##include "Typeable.h"
#if defined(HAVE_READLINK) && !defined(PATH_MAX)
-- PATH_MAX is not defined on systems with unlimited path length.
View
9 Network/Socket.hsc
@@ -22,7 +22,7 @@
#include "HsNet.h"
-- NOTE: ##, we want this interpreted when compiling the .hs, not by hsc2hs.
-##include "../../base/include/Typeable.h"
+##include "Typeable.h"
#if defined(HAVE_WINSOCK_H) && !defined(cygwin32_HOST_OS)
#define WITH_WINSOCK 1
@@ -155,7 +155,12 @@ import Hugs.Prelude ( IOException(..), IOErrorType(..) )
import Hugs.IO ( openFd )
{-# CFILES cbits/HsNet.c #-}
-{-# CFILES cbits/initWinSock.c cbits/ancilData.c cbits/winSockErr.c #-}
+# if HAVE_STRUCT_MSGHDR_MSG_CONTROL || HAVE_STRUCT_MSGHDR_MSG_ACCRIGHTS
+{-# CFILES cbits/ancilData.c #-}
+# endif
+# if defined(HAVE_WINSOCK_H) && !defined(__CYGWIN__)
+{-# CFILES cbits/initWinSock.c cbits/winSockErr.c #-}
+# endif
#endif
import Data.Word ( Word8, Word16, Word32 )
View
3  configure.ac
@@ -5,7 +5,10 @@ AC_CONFIG_SRCDIR([include/HsNet.h])
AC_CONFIG_HEADERS([include/HsNetworkConfig.h])
+AC_C_CONST
+
dnl ** check for specific header (.h) files that we are interested in
+AC_CHECK_HEADERS([fcntl.h limits.h stdlib.h sys/types.h unistd.h winsock.h])
AC_CHECK_HEADERS([arpa/inet.h netdb.h netinet/in.h netinet/tcp.h sys/socket.h sys/uio.h sys/un.h])
AC_CHECK_FUNCS([readlink symlink])
View
2  include/HsNet.h
@@ -7,8 +7,6 @@
#ifndef HSNET_H
#define HSNET_H
-#include "ghcconfig.h"
-
#include "HsNetworkConfig.h"
/* ultra-evil... */
View
9 include/Typeable.h
@@ -0,0 +1,9 @@
+/* Cut down from base/include/Typeable.h */
+#ifndef TYPEABLE_H
+#define TYPEABLE_H
+
+#define INSTANCE_TYPEABLE0(tycon,tcname,str) \
+tcname = mkTyCon str; \
+instance Typeable tycon where { typeOf _ = mkTyConApp tcname [] }
+
+#endif
View
1  network.buildinfo.in
@@ -1,3 +1,4 @@
+ghc-options: -DCALLCONV=@CALLCONV@
cc-options: -DCALLCONV=@CALLCONV@
c-sources: @EXTRA_SRCS@
extra-libraries: @EXTRA_LIBS@
View
23 network.cabal
@@ -4,13 +4,20 @@ license: BSD3
license-file: LICENSE
maintainer: libraries@haskell.org
synopsis: Networking-related facilities
-build-depends: base, parsec
exposed-modules:
- Network.BSD,
- Network.CGI,
- Network.Socket,
- Network.URI,
- Network
-include-dirs: include, ../../ghc/includes
-includes: "HsNet.h"
+ Network Network.BSD Network.CGI Network.Socket Network.URI
+extra-source-files:
+ configure.ac configure
+ network.buildinfo.in include/HsNetworkConfig.h.in
+ include/HsNet.h include/Typeable.h
+ -- C sources not used on all systems
+ cbits/ancilData.c
+ cbits/asyncAccept.c cbits/initWinSock.c cbits/winSockErr.c
+extra-tmp-files:
+ config.log config.status autom4te.cache
+ network.buildinfo include/HsNetworkConfig.h
+build-depends: base, parsec
+extensions: CPP
+include-dirs: include
+includes: HsNet.h
c-sources: cbits/HsNet.c
Please sign in to comment.
Something went wrong with that request. Please try again.