Update examples
This commit is contained in:
16
testsuite/pkgconf/null/Makefile
Normal file
16
testsuite/pkgconf/null/Makefile
Normal file
@ -0,0 +1,16 @@
|
||||
all:
|
||||
@echo "test disabled"
|
||||
|
||||
#true_api::
|
||||
# ( cd api ;\
|
||||
# $(GHC) -Onot $(EXTRAFLAGS) -c $(API).hs ;\
|
||||
# $(RM) -f libHSapi.a ;\
|
||||
# $(AR) cq libHSapi.a API.o ;\
|
||||
# $(RANLIB) libHSapi.a ;\
|
||||
# $(LD) -r $(LD_X) $(WHOLE_ARCHIVE_FLAG) -o HSapi.o libHSapi.a ;\
|
||||
# rm API.o ;\
|
||||
# echo [] > package.conf ;\
|
||||
# env PREFIX=`pwd` $(GHC_PKG) -f package.conf -u < package.conf.in )
|
||||
# $(GHC) -package-conf ${TOP}/plugins.conf.inplace -package plugins \
|
||||
# -package-conf api/package.conf -package api \
|
||||
# -O $(EXTRAFLAGS) -c Null.hs
|
6
testsuite/pkgconf/null/Null.hs
Normal file
6
testsuite/pkgconf/null/Null.hs
Normal file
@ -0,0 +1,6 @@
|
||||
module Null ( resource ) where
|
||||
|
||||
import API
|
||||
|
||||
resource = plugin { a = 7 }
|
||||
|
10
testsuite/pkgconf/null/api/API.hs
Normal file
10
testsuite/pkgconf/null/api/API.hs
Normal file
@ -0,0 +1,10 @@
|
||||
{-# OPTIONS -fglasgow-exts #-}
|
||||
|
||||
module API where
|
||||
|
||||
data Null = Null { a, b :: Int }
|
||||
deriving Show
|
||||
|
||||
plugin :: Null
|
||||
plugin = Null { a = 42 , b = 1 }
|
||||
|
18
testsuite/pkgconf/null/api/package.conf.in
Normal file
18
testsuite/pkgconf/null/api/package.conf.in
Normal file
@ -0,0 +1,18 @@
|
||||
Package {
|
||||
name = "api",
|
||||
auto = False,
|
||||
|
||||
import_dirs = [ "${PREFIX}" ],
|
||||
library_dirs = [ "${PREFIX}" ],
|
||||
hs_libraries = [ "HSapi" ],
|
||||
|
||||
include_dirs = [],
|
||||
c_includes = [],
|
||||
source_dirs = [],
|
||||
extra_libraries = [],
|
||||
package_deps = [],
|
||||
extra_ghc_opts = [],
|
||||
extra_cc_opts = [],
|
||||
extra_ld_opts = []
|
||||
}
|
||||
|
0
testsuite/pkgconf/null/dont_test
Normal file
0
testsuite/pkgconf/null/dont_test
Normal file
12
testsuite/pkgconf/null/prog/Main.hs
Normal file
12
testsuite/pkgconf/null/prog/Main.hs
Normal file
@ -0,0 +1,12 @@
|
||||
{-# OPTIONS -cpp #-}
|
||||
|
||||
#include "../../../../config.h"
|
||||
|
||||
import System.Plugins
|
||||
import API
|
||||
|
||||
main = do
|
||||
let includes = TOP ++ "/testsuite/load/null/api"
|
||||
(_,v) <- load "../Null.o" ["."] ["../api/package.conf"] "resource"
|
||||
putStrLn ( show (a v) )
|
||||
|
Reference in New Issue
Block a user