Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save AlainODea/6680233 to your computer and use it in GitHub Desktop.
Save AlainODea/6680233 to your computer and use it in GitHub Desktop.
Partial setup of GHC Cross-compiler for Ubuntu to Illumos
From 05960e888726b961ebe9c00c439f5158a46c0532 Mon Sep 17 00:00:00 2001
From: Muhaimin Ahsan <[email protected]>
Date: Thu, 26 Sep 2013 16:33:59 -0500
Subject: [PATCH] Include termios.h for solaris2 host. (Fixes #8366)
---
System/Console/Haskeline/Backend/Posix.hsc | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/System/Console/Haskeline/Backend/Posix.hsc b/System/Console/Haskeline/Backend/Posix.hsc
index a028629..8ed9067 100644
--- a/System/Console/Haskeline/Backend/Posix.hsc
+++ b/System/Console/Haskeline/Backend/Posix.hsc
@@ -48,7 +48,7 @@ import GHC.IOBase(haFD,FD)
import GHC.Handle (withHandle_)
#endif
-#if defined(USE_TERMIOS_H) || defined(__ANDROID__)
+#if defined(USE_TERMIOS_H) || defined(__ANDROID__) || defined(solaris2_HOST_OS)
#include <termios.h>
#endif
#include <sys/ioctl.h>
--
1.8.4
#!/bin/bash
export TARGET=x86_64-sun-solaris2.11
export PREFIX=$HOME/Documents/gcc/cross/$TARGET
export PATH=$PATH:$PREFIX/bin
export GCC=$PREFIX/bin/$TARGET-gcc
export LD=$PREFIX/bin/$TARGET-ld
export NM=$PREFIX/bin/$TARGET-nm
export OBJDUMP=$PREFIX/bin/$TARGET-objdump
cabal install happy alex haddock
sudo apt-get update
sudo apt-get install --assume-yes ghc libncurses5-dev \
mesa-common-dev freeglut3-dev libedit-dev
git clone git://github.com/ghc/ghc
pushd ghc
patch -d libraries/haskeline/ -p1 < \
../ghc-patches/0001-Include-termios.h-for-solaris2-host.-Fixes-8366.patch
cp $SYSROOT/opt/local/include/gmp.h libraries/integer-gmp/gmp/
cp mk/build.mk{.sample,}
echo "Stage1Only = YES" >> mk/build.mk
./sync-all --no-dph get
perl boot
./configure \
--host=x86_64-unknown-linux-gnu \
--build=x86_64-unknown-linux-gnu \
--target=x86_64-sun-solaris2 \
--with-gcc=$GCC \
--with-ld=$LD \
--with-nm=$NM \
--with-objdump=$OBJDUMP
#make -j $(nproc)
make
scp inplace/lib/bin/mkGmpDerivedConstants root@ns2:.
ssh root@ns2 "./mkGmpDerivedConstants" > \
libraries/integer-gmp/mkGmpDerivedConstants/dist/GmpDerivedConstants.h
make
popd
@AlainODea
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment