aboutsummaryrefslogtreecommitdiff
path: root/lang/guile
diff options
context:
space:
mode:
authorKoop Mast <kwm@FreeBSD.org>2014-04-28 15:58:06 +0000
committerKoop Mast <kwm@FreeBSD.org>2014-04-28 15:58:06 +0000
commit4b2a51b2c6556f271b13ce9042a89437197b56cb (patch)
treedf4ba2c0ccd869e7483386316358f1af35ce885f /lang/guile
parentcf686a01526fc762b49aae5ab07171a14f15f89e (diff)
downloadports-4b2a51b2c6556f271b13ce9042a89437197b56cb.tar.gz
ports-4b2a51b2c6556f271b13ce9042a89437197b56cb.zip
This is a three-part for building guile with clang (or with any other
modern compiler): 1) Use -fwrap in CFLAGS, since guile depends on integer overflows. 2) Fix grep + sed logic in guile-snarf.in to be compatible with the output of clang's preprocessor. This is achieved by adding additional newlines before the ^^ delimiters, which guile-snarf depends on. 3) Similarly, in c-tokenize.c, clang's preprocessor outputs EOLs and hash marks in different places, confusing the lexer. Simply don't output them to fix the problem. While here strip binaries and libraries. Submitted by: dim@
Notes
Notes: svn path=/head/; revision=352517
Diffstat (limited to 'lang/guile')
-rw-r--r--lang/guile/Makefile3
-rw-r--r--lang/guile/files/patch-libguile_c-tokenize.c18
-rw-r--r--lang/guile/files/patch-libguile_guile-snarf.in12
3 files changed, 33 insertions, 0 deletions
diff --git a/lang/guile/Makefile b/lang/guile/Makefile
index f2db99314844..02dd70f78510 100644
--- a/lang/guile/Makefile
+++ b/lang/guile/Makefile
@@ -4,6 +4,7 @@
PORTNAME= guile
PORTVERSION= 1.8.8
+PORTREVISION= 1
CATEGORIES= lang scheme
MASTER_SITES= ${MASTER_SITE_GNU}
MASTER_SITE_SUBDIR= guile
@@ -19,6 +20,8 @@ GNU_CONFIGURE= yes
USE_LDCONFIG= yes
LDFLAGS+= -L${LOCALBASE}/lib
CPPFLAGS+= -I${LOCALBASE}/include
+CFLAGS+= -fwrapv
+INSTALL_TARGET= install-strip
GUILE_VER= 1.8
PLIST_SUB= GUILE_VER=${GUILE_VER}
diff --git a/lang/guile/files/patch-libguile_c-tokenize.c b/lang/guile/files/patch-libguile_c-tokenize.c
new file mode 100644
index 000000000000..338efe4f7699
--- /dev/null
+++ b/lang/guile/files/patch-libguile_c-tokenize.c
@@ -0,0 +1,18 @@
+--- libguile/c-tokenize.c 2010-12-13 20:24:04.000000000 +0100
++++ libguile/c-tokenize.c 2014-04-13 22:20:33.000000000 +0200
+@@ -898,13 +898,13 @@ case 3:
+ /* rule 3 can match eol */
+ YY_RULE_SETUP
+ #line 71 "./c-tokenize.lex"
+-{ OUT(eol); }
++{ /*OUT(eol);*/ }
+ YY_BREAK
+ case 4:
+ /* rule 4 can match eol */
+ YY_RULE_SETUP
+ #line 73 "./c-tokenize.lex"
+-{ OUT(hash); IS_NOT_COOKIE; }
++{ /*OUT(hash);*/ IS_NOT_COOKIE; }
+ YY_BREAK
+ case 5:
+ YY_RULE_SETUP
diff --git a/lang/guile/files/patch-libguile_guile-snarf.in b/lang/guile/files/patch-libguile_guile-snarf.in
new file mode 100644
index 000000000000..047fd8859ec2
--- /dev/null
+++ b/lang/guile/files/patch-libguile_guile-snarf.in
@@ -0,0 +1,12 @@
+--- libguile/guile-snarf.in 2010-12-13 18:24:40.000000000 +0100
++++ libguile/guile-snarf.in 2014-04-13 21:05:42.000000000 +0200
+@@ -51,7 +51,8 @@ modern_snarf ()
+ ## empty file.
+ echo "/* cpp arguments: $@ */" ;
+ ${cpp} -DSCM_MAGIC_SNARF_INITS -DSCM_MAGIC_SNARFER "$@" > ${temp} && cpp_ok_p=true
+- grep "^ *\^ *\^" ${temp} | sed -e "s/^ *\^ *\^//" -e "s/\^\ *:\ *\^.*/;/"
++ sed -e 's/\^ *\^/\
++^^/g' ${temp} | grep "^.*\^ *\^" | sed -e "s/^.*\^ *\^//" -e "s/\^\ *:\ *\^.*/;/"
+ }
+
+ ## main