Windows fixes and tidying up.
# Setting the GHC compile options
SRC_HC_OPTS += -recomp -cpp -fvia-C -fglasgow-exts $(GhcLibHcOpts) $(PACKAGE)
-ifneq "$(DLLized)" "YES"
-SRC_HC_OPTS += -static
-endif
ifdef USE_REPORT_PRELUDE
SRC_HC_OPTS += -DUSE_REPORT_PRELUDE=1
endif
-#
# Object and interface files have suffixes tagged with their ways
-#
ifneq "$(way)" ""
SRC_HC_OPTS += -hisuf $(way_)hi
endif
+# Special options
+PrelStorable_HC_OPTS = -monly-3-regs
+
#-----------------------------------------------------------------------------
# Dependency generation
ifeq "$(DLLized)" "YES"
HS_SRCS := $(filter-out PrelMain.lhs PrelHugs.lhs, $(HS_SRCS))
-endif
-
# PrelMain.dll_o isn't to be included in the final .a,
# but it needs to be generated
-ifeq "$(DLLized)" "YES"
all :: PrelMain.dll_o
endif
$(patsubst %.hsc, %.hs.c, $(HSC_SRCS)) \
$(patsubst %.hsc, %.hs.h, $(HSC_SRCS))
-#
-# If we're building the unregisterised way, it may well be for Hugs.
-# In that case, remember to bind the cbits objects into a single file
-# which hugs can load as an auxiliary object file when loading the Prelude.
-#
-ifeq "$(way)" "u"
-all :: libHSstd_cbits.u_o
-CLEAN_FILES += libHSstd_cbits.u_o
-libHSstd_cbits.u_o:
- $(RM) libHSstd_cbits.u_o
- ld -r -o libHSstd_cbits.u_o cbits/*.o
-endif
-
#-----------------------------------------------------------------------------
# Installation; need to install .hi files as well as libraries
#
% -----------------------------------------------------------------------------
-% $Id: PrelCError.lhs,v 1.4 2001/01/16 06:02:29 qrczak Exp $
+% $Id: PrelCError.lhs,v 1.5 2001/01/26 17:51:54 rrt Exp $
%
% (c) The FFI task force, 2000
%
C-specific Marshalling support: Handling of C "errno" error codes
\begin{code}
-{-# OPTIONS -fno-implicit-prelude #-}
+{-# OPTIONS -fno-implicit-prelude -#include "cbits/errno.h" #-}
-- this is were we get the CCONST_XXX definitions from that configure
-- calculated for us
-- "errno" type
-- ------------
+-- import of C function that gives address of errno
+--
+foreign import "ghcErrno" unsafe _errno :: Ptr CInt
+
-- Haskell representation for "errno" values
--
newtype Errno = Errno CInt
| otherwise = (OtherError,
"unexpected error (error code: "
++ show no ++")")
-
-foreign label "errno" _errno :: Ptr CInt
- -- FIXME: this routine should eventually be provided by the Haskell runtime
- -- and guarantee that the "errno" of the last operation performed by
- -- the current thread is returned
\end{code}
-- to compile on sparc-solaris. Blargh.
-- -----------------------------------------------------------------------------
--- $Id: Time.hsc,v 1.7 2001/01/26 16:16:19 rrt Exp $
+-- $Id: Time.hsc,v 1.8 2001/01/26 17:51:54 rrt Exp $
--
-- (c) The University of Glasgow, 1995-2001
--
# endif
# ifndef mingw32_TARGET_OS
foreign label tzname :: Ptr (Ptr CChar)
+# else
+foreign import "ghcTimezone" unsafe timezone :: Ptr CLong
+foreign import "ghcTzname" unsafe tzname :: Ptr (Ptr CChar)
+# def inline long *ghcTimezone(void) { return &_timezone; }
+# def inline char **ghcTzname(void) { return _tzname; }
# endif
zone x = do
dst <- (#peek struct tm,tm_isdst) x
#if HAVE_FTIME
type CTimeB = ()
+#ifndef mingw32_TARGET_OS
foreign import unsafe ftime :: Ptr CTimeB -> IO CInt
+#else
+foreign import unsafe ftime :: Ptr CTimeB -> IO ()
+#endif
#endif