Ticket #20: GHC-Haddock-Unicode.patch

File GHC-Haddock-Unicode.patch, 3.0 kB (added by batterseapower, 20 months ago)
  • rules/distdir-way-opts.mk

    From 6eb7391c34249993702a2516c1606531717dd1cf Mon Sep 17 00:00:00 2001
    From: Max Bolingbroke <batterseapower@hotmail.com>
    Date: Sun, 3 Feb 2013 18:05:25 +0000
    Subject: [PATCH 1/2] Fix construction of ALL_ALEX_OPTS and ALL_AS_OPTS
    
    ---
     rules/distdir-way-opts.mk | 4 ++--
     1 file changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/rules/distdir-way-opts.mk b/rules/distdir-way-opts.mk
    index 4d27bbf..f98d718 100644
    a b  
    228228 
    229229$1_$2_$3_ALL_AS_OPTS = \ 
    230230 $$(CONF_AS_OPTS) \ 
    231  $$(SRC_AS_OPTS) 
     231 $$(SRC_AS_OPTS) \ 
    232232 $$(WAY_$3_AS_OPTS) \ 
    233233 $$($1_AS_OPTS) \ 
    234234 $$($1_$2_AS_OPTS) \ 
     
    237237 
    238238$1_$2_$3_ALL_ALEX_OPTS = \ 
    239239 $$(CONF_ALEX_OPTS) \ 
    240  $$(SRC_ALEX_OPTS) 
     240 $$(SRC_ALEX_OPTS) \ 
    241241 $$(WAY_$3_ALEX_OPTS) \ 
    242242 $$($1_ALEX_OPTS) \ 
    243243 $$($1_$2_ALEX_OPTS) \ 
  • aclocal.m4

    -- 
    1.8.1.1
    
    
    From df3f9607f746c7540ad6d263d682b736b99cbe2f Mon Sep 17 00:00:00 2001
    From: Max Bolingbroke <batterseapower@hotmail.com>
    Date: Sun, 3 Feb 2013 18:05:54 +0000
    Subject: [PATCH 2/2] Insist on Alex 3 when building Haddock
    
    ---
     aclocal.m4      | 11 ++++++++---
     mk/config.mk.in |  9 ++++-----
     2 files changed, 12 insertions(+), 8 deletions(-)
    
    diff --git a/aclocal.m4 b/aclocal.m4
    index 0fe79cf..1fc8898 100644
    a b  
    849849 
    850850dnl 
    851851dnl Check for Alex and version.  If we're building GHC, then we need 
    852 dnl at least Alex version 2.0.1. 
     852dnl at least Alex version 2.1.1. 
    853853dnl 
    854854AC_DEFUN([FPTOOLS_ALEX], 
    855855[ 
     
    865865fi; 
    866866changequote([, ])dnl 
    867867]) 
     868FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[3.0], 
     869  [Alex3=YES],[Alex3=NO]) 
    868870if test ! -f compiler/cmm/CmmLex.hs || test ! -f compiler/parser/Lexer.hs 
    869871then 
    870872    FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.1.0], 
    871873      [AC_MSG_ERROR([Alex version 2.1.0 or later is required to compile GHC.])])[] 
    872     FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-ge],[3.0], 
    873       [Alex3=YES],[Alex3=NO]) 
     874fi 
     875if test ! -f utils/haddock/src/Haddock/Lex.hs 
     876then 
     877    FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[3.0], 
     878      [AC_MSG_ERROR([Alex version 3.0 or later is required to compile Haddock.])])[] 
    874879fi 
    875880AlexVersion=$fptools_cv_alex_version; 
    876881AC_SUBST(AlexVersion) 
  • mk/config.mk.in

    diff --git a/mk/config.mk.in b/mk/config.mk.in
    index 0048620..b111aa8 100644
    a b  
    857857ALEX_VERSION            = @AlexVersion@          
    858858Alex3                   = @Alex3@ 
    859859# 
    860 # Options to pass to Happy when we're going to compile the output with GHC 
     860# Options to pass to Alex when we're going to compile the output with GHC 
    861861# 
     862SRC_ALEX_OPTS = -g 
    862863ifeq "$(Alex3)" "YES" 
    863 # We aren't using the Unicode support in Alex 3.0 yet, in fact we do our own 
     864# The compiler isn't using the Unicode support in Alex 3.0 yet, in fact we do our own 
    864865# Unicode handling, so diable Alex's. 
    865 SRC_ALEX_OPTS           = -g --latin1 
    866 else 
    867 SRC_ALEX_OPTS           = -g 
     866compiler_ALEX_OPTS = --latin1 
    868867endif 
    869868 
    870869# Should we build haddock docs?