Hello, I just installed jhc 0.7.1 and wanted to try cross-compilation (it works!). The manual tells me about some places I can put a targets.ini file. Unfortunately, it seems that no matter where I put it, it's ignored. This is what I have: ---- 8< ---- [win32] gcc=i586-mingw32msvc-gcc cflags+=-mwindows -mno-cygwin executable_extension=.exe merge=i686 ---- 8< ---- Basically, I just copied the example from the manual, but changed gcc to "i586-mingw32msvc-gcc" because that's what comes with Ubuntu Jaunty 64bit. See the error message below (sorry it's long). Is there something I can do to investigate what's failing? Creating a symlink as "i386-mingw32-gcc" works, by the way. Thanks, Paulo $ cat > hello.hs module Main where main = putStrLn "hello world" $ cat ~/.jhc/targets.ini # or ~/etc/jhc/targets.ini [win32] gcc=i586-mingw32msvc-gcc cflags+=-mwindows -mno-cygwin executable_extension=.exe merge=i686 {- Also tried putting it in /usr/local/etc/jhc-0.7/, even replacing the existing targets.ini -} $ jhc --cross -mwin32 -v hello.hs reading /usr/local/etc/jhc-0.7/targets.ini reading /usr/local/etc/jhc-0.7/targets-local.ini reading /home/[username]/etc/jhc/targets.ini reading /usr/local/etc/jhc-0.7/targets.ini reading /usr/local/etc/jhc-0.7/targets-local.ini reading /home/[username]/etc/jhc/targets.ini jhc --cross -mwin32 -v hello.hs jhc 0.7.1 (0.7.0-13) Finding Dependencies... Using Ho Cache: '/home/[username]/.jhc/cache' -- Base: base Exported: True Hash: 8c94a7b43fd3d66558ab3d1f2182abae Name: base-1.0 -- Base: haskell98 Exported: True Hash: ee7ca5091f963b5420ca56a56a176264 Name: haskell98-1.0 -- Base: jhc Exported: False Hash: fb645af1aa0971f3be17c34f7c0a032f Name: jhc-1.0 Main [hello.hs] <~/.jhc/cache/a61a65a6addfa4a2aa3c57618613f47a.ho> Fresh: <~/.jhc/cache/a61a65a6addfa4a2aa3c57618613f47a.ho> Typechecking... Compiling... Collected Compilation... PassStats -- typeAnalyzeMethods Type analyzed methods Jhc.Basics.concatMap \({})({}) Jhc.Monad.mapM_ \({Jhc.Prim.IO})({Jhc.Prim.Char})({Jhc.Basics.()}) Jhc.Basics.++ \({}) Jhc.Monad.>> \({Jhc.Prim.IO})({Jhc.Basics.()})({Jhc.Basics.()}) Jhc.Monad.>>= \({})({})({}) Jhc.Monad.return \({Jhc.Prim.IO})({Jhc.Basics.()}) Jhc.IO.runMain \({Jhc.Basics.()}) Instance@.iJhc.Monad.>>.Jhc.Prim.IO \({Jhc.Basics.()})({Jhc.Basics.()}) Instance@.iJhc.Monad.>>.default \({})({})({}) Instance@.iJhc.Monad.>>=.Jhc.Prim.IO \({})({}) Instance@.iJhc.Monad.>>=.Jhc.Prim.[] \({})({}) Instance@.iJhc.Monad.return.Jhc.Prim.IO \({Jhc.Basics.()}) Instance@.iJhc.Monad.return.Jhc.Prim.[] \({}) Instance@.iJhc.Monad.>>=.Jhc.Maybe.Maybe \({})({}) Instance@.iJhc.Monad.return.Jhc.Maybe.Maybe \({}) -- typeAnalyze-Main-AfterMethod -- Simplify-Main-One -- Simplify-Main-One -- Simplify-Main-One -- Simplify-Main-One -- Simplify-Main-One -- Simplify-Main-One -- Simplify-Main-One Total: Main-One {- Simplifications -} Writing "hs.out.exe_code.c" Running: i386-mingw32-gcc '-std=gnu99' -D_GNU_SOURCE '-falign-functions=4' -ffast-math -Wshadow -Wextra -Wall -Wno-unused-parameter -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -mwindows -mno-cygwin -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -mwindows -mno-cygwin -m32 -m32 -m32 -m32 -m32 -m32 -m32 -m32 -o hs.out.exe hs.out.exe_code.c -DNDEBUG -O3 -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer -fomit-frame-pointer /bin/sh: i386-mingw32-gcc: not found user error (C code did not compile.)
Hmm.. something strange seems to be going on. what does jhc -v -v -dini say? it should list all the files that are loaded. You should only need [win32] cc=i586-mingw32msvc-gcc in your file as it will merge all the loaded files. oh wait, did you put gcc=? I think that is a typo in the manual, it should be cc=. Let me know if that fixes it. John -- John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/
Hi John,
On Tue, Aug 25, 2009 at 12:29 AM, John Meacham
You should only need
[win32] cc=i586-mingw32msvc-gcc
in your file as it will merge all the loaded files.
oh wait, did you put gcc=? I think that is a typo in the manual, it should be cc=. Let me know if that fixes it.
John
Thanks, that did it! Yes, there's a typo in the manual then. See the cross-compilation section. Paulo
participants (2)
-
John Meacham -
Paulo Tanimoto