
Andy Moran
With 3.4, changes were made to the -traditional version of the C preprocessor that make it incompatible with the way in which many of the Haskell modules in the GHC source tree reify make/build variables as Haskell strings.
Have we converged on a long-term solution for this problem? Is hscpp ready for the job?
I believe cpphs is in good shape. There has been one bug report, and no new feature requests, in the last 4 months since 0.8 was released, with 235 downloads of that version. Over a slightly longer period, it has been used internally by hmake and nhc98 in preference to cpp, with no visible problems. With the attached compatibility script, it is largely possible to use cpphs as a drop-in replacement for cpp. (The script just translates the command-line argument format.) e.g. ghc -cpp -pgmP cpphs.compat .... works as expected. The only real issue currently preventing ghc from adopting cpphs is ideological (GPL licensing). http://haskell.org/cpphs/ Regards, Malcolm ----file cpphs.compat---- #!/bin/sh # A minimal compatibility script to make cpphs accept the same # arguments as real cpp, wherever possible. # Set this variable as the path to your installed version of cpphs: CPPHS=/usr/local/bin/cpphs processArgs () { TRADITIONAL=no STRIP=yes INFILE="-" OUTFILE="-" while test "$1" != "" do case $1 in -D) shift; echo -D$1 ;; -D*) echo $1 ;; -U) shift; echo -U$1 ;; -U*) echo $1 ;; -I) shift; echo -I$1 ;; -I*) echo $1 ;; -o) shift; echo -O$1 ;; -o*) echo -O`echo $1 | cut -c3-` ;; -std*) ;; # ignore language spec -x) shift ;; # ignore language spec -ansi*) TRADITIONAL=no ;; -traditional*) TRADITIONAL=yes ;; -include) shift; echo $1 ;; -P) echo --noline ;; -C) STRIP=no ;; -CC) STRIP=no ;; -A) shift ;; # strip assertions --help) echo $1 ;; -version) echo -$1 ;; --version) echo $1 ;; -*) ;; # strip all other flags *) if [ "$INFILE" = "-" ] then INFILE=$1 else OUTFILE=$1 fi ;; esac if test "$1" != ""; then shift; fi done if [ "$TRADITIONAL" = "no" ]; then echo "--hashes"; fi if [ "$STRIP" = "yes" ]; then echo "--strip"; fi echo $INFILE if [ "$OUTFILE" != "-" ]; then echo "-O$OUTFILE"; fi } exec $CPPHS `processArgs "$@"`