haskell - Use relative paths for extra-lib-dirs on cabal -


i have c library "myboo" has makefile. want make wrapper of library. don't want install /usr/local since "myboo" not major module. additionally recommended build "myboo" not dynamic library static library.

i make custom setup.py build "myboo";

main :: io () main = defaultmainwithhooks simpleuserhooks {            prebuild = \a b -> makelib b >> prebuild simpleuserhooks b            }  makelib :: args -> buildflags -> io () makelib _ flags =   let verbosity = fromflag $ buildverbosity flags   cflags <- lookupenv "cflags" >>= return . maybe "" id   setenv "cflags" $ "-fpic" ++ (' ' : cflags)   rawsystemexit verbosity "env" ["make", "--directory=myboo", "libmyboo.a"] 

and arrange myboo.cabal link haskell codes c library;

library   exposed-modules:     myboo   build-depends:       base >=4.7 && <4.8   hs-source-dirs:      src   default-language:    haskell2010   include-dirs: myboo   extra-libraries: myboo   extra-lib-dirs: myboo 

when run "cabal build", got following messages.

myboo-0.1.0.0: library-dirs: myboo relative path makes no sense (as there nothing relative to). can make paths relative package database using ${pkgroot}. (use --force override) 

if write "extra-lib-dirs: /absolute/path/to/working/dir/myboo", seems works well. it's not way because /absolute/... working directory.

how should fix above error messages? environment here;

% ghc --version glorious glasgow haskell compilation system, version 7.8.2 % cabal --version cabal-install version 1.20.0.2 using version 1.20.0.0 of cabal library % cat /etc/lsb-release distrib_id=ubuntu distrib_release=14.04 distrib_codename=trusty distrib_description="ubuntu 14.04 lts" 

you can write own setup.hs , setup distribution.simple.confhook. in hook function, modify distribution.packagedescription.extralibdirs include directory.

note need change build-type custom in cabal file.

here link setup.hs in did wrote.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -