diff --git a/src/AltData/Dynamic.hs b/AltData/Dynamic.hs similarity index 100% rename from src/AltData/Dynamic.hs rename to AltData/Dynamic.hs diff --git a/src/AltData/Typeable.hs b/AltData/Typeable.hs similarity index 99% rename from src/AltData/Typeable.hs rename to AltData/Typeable.hs index ef3957d..a14e335 100644 --- a/src/AltData/Typeable.hs +++ b/AltData/Typeable.hs @@ -126,6 +126,8 @@ unsafeCoerce = unsafeCoerce# -- -- equality of keys doesn't work for dynamically loaded code, so we -- revert back to canonical type names. +-- +-- could use packed strings here. -- data TypeRep = TypeRep !Key TyCon [TypeRep] diff --git a/src/Language/Hi/Binary.hs b/Language/Hi/Binary.hs similarity index 100% rename from src/Language/Hi/Binary.hs rename to Language/Hi/Binary.hs diff --git a/src/Language/Hi/FastMutInt.hs b/Language/Hi/FastMutInt.hs similarity index 100% rename from src/Language/Hi/FastMutInt.hs rename to Language/Hi/FastMutInt.hs diff --git a/src/Language/Hi/FastString.hs b/Language/Hi/FastString.hs similarity index 100% rename from src/Language/Hi/FastString.hs rename to Language/Hi/FastString.hs diff --git a/src/Language/Hi/Parser.hs b/Language/Hi/Parser.hs similarity index 99% rename from src/Language/Hi/Parser.hs rename to Language/Hi/Parser.hs index db19b19..f8d4538 100644 --- a/src/Language/Hi/Parser.hs +++ b/Language/Hi/Parser.hs @@ -48,7 +48,7 @@ import Language.Hi.Syntax import Language.Hi.Binary import Language.Hi.FastString -#include "../../../config.h" +#include "../../config.h" -- --------------------------------------------------------------------------- -- how to get there from here diff --git a/src/Language/Hi/PrimPacked.hs b/Language/Hi/PrimPacked.hs similarity index 100% rename from src/Language/Hi/PrimPacked.hs rename to Language/Hi/PrimPacked.hs diff --git a/src/Language/Hi/Syntax.hs b/Language/Hi/Syntax.hs similarity index 100% rename from src/Language/Hi/Syntax.hs rename to Language/Hi/Syntax.hs diff --git a/src/Language/Hi/hschooks.c b/Language/Hi/hschooks.c similarity index 100% rename from src/Language/Hi/hschooks.c rename to Language/Hi/hschooks.c diff --git a/src/Language/Hi/hschooks.h b/Language/Hi/hschooks.h similarity index 100% rename from src/Language/Hi/hschooks.h rename to Language/Hi/hschooks.h diff --git a/Makefile b/Makefile index c32e94a..6b122f7 100644 --- a/Makefile +++ b/Makefile @@ -7,14 +7,8 @@ all: build EvalHaskell.h -build:: - cd src ;\ - $(GHC) -o setup --make Setup.hs ;\ - ./setup configure --prefix=$(PREFIX) ;\ - ./setup build - EvalHaskell.h: build - cp src/System/Eval/Haskell_stub.h $@ + cp System/Eval/Haskell_stub.h $@ # # installing @@ -55,8 +49,7 @@ CLEAN_FILES += *.conf.*.old *~ clean: cd docs && $(MAKE) clean - cd src && ./setup clean 2> /dev/null || true - cd src && rm -rf dist Setup.hi Setup.o setup + runhaskell Setup.hs clean 2> /dev/null || true rm -rf $(CLEAN_FILES) find examples -name '*.a' -exec rm {} \; find examples -name '*~' -exec rm {} \; @@ -72,7 +65,7 @@ clean: rm -f EvalHaskell.h EXTRA_CLEANS+=*.conf.inplace* *.conf.in *.h autom4te.cache \ - config.h config.mk config.log config.status src/plugins.cabal + config.h config.mk config.log config.status distclean: clean rm -rf $(EXTRA_CLEANS) diff --git a/Setup.hs b/Setup.hs new file mode 100644 index 0000000..362b40c --- /dev/null +++ b/Setup.hs @@ -0,0 +1,2 @@ +import Distribution.Simple +main = defaultMainWithHooks defaultUserHooks diff --git a/src/System/Eval.hs b/System/Eval.hs similarity index 100% rename from src/System/Eval.hs rename to System/Eval.hs diff --git a/src/System/Eval/Haskell.hs b/System/Eval/Haskell.hs similarity index 100% rename from src/System/Eval/Haskell.hs rename to System/Eval/Haskell.hs diff --git a/src/System/Eval/Utils.hs b/System/Eval/Utils.hs similarity index 100% rename from src/System/Eval/Utils.hs rename to System/Eval/Utils.hs diff --git a/src/System/MkTemp.hs b/System/MkTemp.hs similarity index 100% rename from src/System/MkTemp.hs rename to System/MkTemp.hs diff --git a/src/System/Plugins.hs b/System/Plugins.hs similarity index 100% rename from src/System/Plugins.hs rename to System/Plugins.hs diff --git a/src/System/Plugins/Consts.hs b/System/Plugins/Consts.hs similarity index 97% rename from src/System/Plugins/Consts.hs rename to System/Plugins/Consts.hs index 3ab254b..7882f37 100644 --- a/src/System/Plugins/Consts.hs +++ b/System/Plugins/Consts.hs @@ -1,4 +1,3 @@ -{-# OPTIONS -cpp #-} -- -- Copyright (C) 2004 Don Stewart - http://www.cse.unsw.edu.au/~dons -- @@ -20,7 +19,7 @@ module System.Plugins.Consts where -#include "../../../config.h" +#include "../../config.h" #if __GLASGOW_HASKELL__ >= 604 diff --git a/src/System/Plugins/Env.hs b/System/Plugins/Env.hs similarity index 99% rename from src/System/Plugins/Env.hs rename to System/Plugins/Env.hs index cef8402..08fba1e 100644 --- a/src/System/Plugins/Env.hs +++ b/System/Plugins/Env.hs @@ -46,7 +46,7 @@ module System.Plugins.Env ( ) where -#include "../../../config.h" +#include "../../config.h" import System.Plugins.LoadTypes (Module) import System.Plugins.PackageAPI {- everything -} diff --git a/src/System/Plugins/Load.hs b/System/Plugins/Load.hs similarity index 99% rename from src/System/Plugins/Load.hs rename to System/Plugins/Load.hs index 2479cb4..ca3dfac 100644 --- a/src/System/Plugins/Load.hs +++ b/System/Plugins/Load.hs @@ -50,7 +50,7 @@ module System.Plugins.Load ( ) where -#include "../../../config.h" +#include "../../config.h" import System.Plugins.Make ( build ) import System.Plugins.Env diff --git a/src/System/Plugins/LoadTypes.hs b/System/Plugins/LoadTypes.hs similarity index 100% rename from src/System/Plugins/LoadTypes.hs rename to System/Plugins/LoadTypes.hs diff --git a/src/System/Plugins/Make.hs b/System/Plugins/Make.hs similarity index 100% rename from src/System/Plugins/Make.hs rename to System/Plugins/Make.hs diff --git a/src/System/Plugins/Package.hs b/System/Plugins/Package.hs similarity index 100% rename from src/System/Plugins/Package.hs rename to System/Plugins/Package.hs diff --git a/src/System/Plugins/PackageAPI.hs b/System/Plugins/PackageAPI.hs similarity index 98% rename from src/System/Plugins/PackageAPI.hs rename to System/Plugins/PackageAPI.hs index 4205e3d..3b65994 100644 --- a/src/System/Plugins/PackageAPI.hs +++ b/System/Plugins/PackageAPI.hs @@ -37,7 +37,7 @@ module System.Plugins.PackageAPI ( , updLibraryDirs ) where -#include "../../../config.h" +#include "../../config.h" #if CABAL == 1 || __GLASGOW_HASKELL__ >= 604 import Distribution.InstalledPackageInfo diff --git a/src/System/Plugins/ParsePkgConfCabal.y b/System/Plugins/ParsePkgConfCabal.y similarity index 100% rename from src/System/Plugins/ParsePkgConfCabal.y rename to System/Plugins/ParsePkgConfCabal.y diff --git a/src/System/Plugins/ParsePkgConfLite.hs b/System/Plugins/ParsePkgConfLite.hs similarity index 100% rename from src/System/Plugins/ParsePkgConfLite.hs rename to System/Plugins/ParsePkgConfLite.hs diff --git a/src/System/Plugins/ParsePkgConfLite.y b/System/Plugins/ParsePkgConfLite.y similarity index 100% rename from src/System/Plugins/ParsePkgConfLite.y rename to System/Plugins/ParsePkgConfLite.y diff --git a/src/System/Plugins/Parser.hs b/System/Plugins/Parser.hs similarity index 99% rename from src/System/Plugins/Parser.hs rename to System/Plugins/Parser.hs index 58714ac..a051464 100644 --- a/src/System/Plugins/Parser.hs +++ b/System/Plugins/Parser.hs @@ -24,7 +24,7 @@ module System.Plugins.Parser ( replaceModName ) where -#include "../../../config.h" +#include "../../config.h" import Data.List import Data.Char diff --git a/src/System/Plugins/Process.hs b/System/Plugins/Process.hs similarity index 100% rename from src/System/Plugins/Process.hs rename to System/Plugins/Process.hs diff --git a/src/System/Plugins/Utils.hs b/System/Plugins/Utils.hs similarity index 99% rename from src/System/Plugins/Utils.hs rename to System/Plugins/Utils.hs index 086cf01..8009fb8 100644 --- a/src/System/Plugins/Utils.hs +++ b/System/Plugins/Utils.hs @@ -57,7 +57,7 @@ module System.Plugins.Utils ( ) where -#include "../../../config.h" +#include "../../config.h" import System.Plugins.Env ( isLoaded ) import System.Plugins.Consts ( objSuf, hiSuf, tmpDir ) diff --git a/configure b/configure index 1f27a97..dee776d 100644 --- a/configure +++ b/configure @@ -271,7 +271,7 @@ PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= -ac_unique_file="src/System/Plugins.hs" +ac_unique_file="System/Plugins.hs" ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS build build_cpu build_vendor build_os PREFIX TOP GHC GLASGOW_HASKELL HASKELL_SRC TEX TEX2PAGE CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA LIBOBJS LTLIBOBJS' ac_subst_files='' @@ -2708,7 +2708,7 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # System.Process uses cmd or command.com shell on Windows, doen't use Cygwin or MSYS shell - ac_config_files="$ac_config_files config.mk src/plugins.cabal examples/makewith/io/TestIO.conf examples/makewith/unsafeio/Unsafe.conf" + ac_config_files="$ac_config_files config.mk examples/makewith/io/TestIO.conf examples/makewith/unsafeio/Unsafe.conf" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -3236,7 +3236,6 @@ do case "$ac_config_target" in # Handling of arguments. "config.mk" ) CONFIG_FILES="$CONFIG_FILES config.mk" ;; - "src/plugins.cabal" ) CONFIG_FILES="$CONFIG_FILES src/plugins.cabal" ;; "examples/makewith/io/TestIO.conf" ) CONFIG_FILES="$CONFIG_FILES examples/makewith/io/TestIO.conf" ;; "examples/makewith/unsafeio/Unsafe.conf" ) CONFIG_FILES="$CONFIG_FILES examples/makewith/unsafeio/Unsafe.conf" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; diff --git a/configure.ac b/configure.ac index 3320413..070d464 100644 --- a/configure.ac +++ b/configure.ac @@ -8,7 +8,7 @@ # only AC_DEFINES are visible in Haskell src # sanity test -AC_INIT(src/System/Plugins.hs) +AC_INIT(System/Plugins.hs) # Prepare to generate the config.h.in file AC_CONFIG_HEADERS([config.h]) @@ -137,6 +137,6 @@ AC_CHECK_FUNCS(arc4random) AC_PROG_INSTALL # System.Process uses cmd or command.com shell on Windows, doen't use Cygwin or MSYS shell -AC_CONFIG_FILES([config.mk src/plugins.cabal examples/makewith/io/TestIO.conf examples/makewith/unsafeio/Unsafe.conf]) +AC_CONFIG_FILES([config.mk examples/makewith/io/TestIO.conf examples/makewith/unsafeio/Unsafe.conf]) AC_OUTPUT diff --git a/plugins.cabal b/plugins.cabal new file mode 100644 index 0000000..b358e6d --- /dev/null +++ b/plugins.cabal @@ -0,0 +1,38 @@ +name: plugins +version: 0.9.10 +license: LGPL +License-file: LICENSE +author: Don Stewart +maintainer: dons@cse.unsw.edu.au +exposed-modules: + AltData.Dynamic, + AltData.Typeable, + Language.Hi.Binary, + Language.Hi.FastMutInt, + Language.Hi.FastString, + Language.Hi.Parser, + Language.Hi.PrimPacked, + Language.Hi.Syntax, + System.Eval, + System.Eval.Haskell, + System.Eval.Utils, + System.MkTemp, + System.Plugins, + System.Plugins.Consts, + System.Plugins.Env, + System.Plugins.Load, + System.Plugins.LoadTypes, + System.Plugins.Make, + System.Plugins.Package, + System.Plugins.PackageAPI, + System.Plugins.ParsePkgConfCabal, + System.Plugins.Parser, + System.Plugins.Process, + System.Plugins.Utils +c-sources: + Language/Hi/hschooks.c +includes: Linker.h +extensions: CPP, ForeignFunctionInterface +Build-Depends: base, haskell98, Cabal, haskell-src +ghc-options: -Wall -O -fvia-C -funbox-strict-fields -fno-warn-missing-signatures + diff --git a/src/plugins.cabal.in b/plugins.cabal.hsx similarity index 94% rename from src/plugins.cabal.in rename to plugins.cabal.hsx index 4bdcc91..3ededb1 100644 --- a/src/plugins.cabal.in +++ b/plugins.cabal.hsx @@ -32,6 +32,6 @@ exposed-modules: c-sources: Language/Hi/hschooks.c includes: Linker.h -Build-Depends: base, haskell98, Cabal, @HASKELL_SRC@ +Build-Depends: base, haskell98, Cabal, haskell-src-exts ghc-options: -Wall -O -fvia-C -funbox-strict-fields -fno-warn-missing-signatures diff --git a/src/Setup.hs b/src/Setup.hs deleted file mode 100644 index 9a994af..0000000 --- a/src/Setup.hs +++ /dev/null @@ -1,2 +0,0 @@ -import Distribution.Simple -main = defaultMain