summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2010-10-08 09:38:44 +0000
committerMike Frysinger <vapier@gentoo.org>2010-10-08 09:38:44 +0000
commitc2ba38ebf02cd7045adfab508c20a634cf5a70da (patch)
treee54baee9368a040f2fdf085e8d0bc5ad208f318c /dev-embedded
parentBump to 0.4.10. Bunch of 64-bit and SSE improvements amongst other fixes. (diff)
downloadgentoo-2-c2ba38ebf02cd7045adfab508c20a634cf5a70da.tar.gz
gentoo-2-c2ba38ebf02cd7045adfab508c20a634cf5a70da.tar.bz2
gentoo-2-c2ba38ebf02cd7045adfab508c20a634cf5a70da.zip
Version bump #270621 by Karl Hiramoto. Merge & clean up the sdcc-svn package and fix #251876 #255659 by Diego E. Pettenò in the process.
(Portage version: 2.2_rc86/cvs/Linux x86_64)
Diffstat (limited to 'dev-embedded')
-rw-r--r--dev-embedded/sdcc/ChangeLog14
-rw-r--r--dev-embedded/sdcc/files/sdcc-2.9.0-build.patch51
-rw-r--r--dev-embedded/sdcc/files/sdcc-2.9.0-gcc44.patch15
-rw-r--r--dev-embedded/sdcc/files/sdcc-2.9.0-getline.patch16
-rw-r--r--dev-embedded/sdcc/files/sdcc-2.9.0-headers.patch209
-rw-r--r--dev-embedded/sdcc/files/sdcc-9999-build.patch53
-rw-r--r--dev-embedded/sdcc/sdcc-2.9.0.ebuild97
-rw-r--r--dev-embedded/sdcc/sdcc-9999.ebuild85
8 files changed, 538 insertions, 2 deletions
diff --git a/dev-embedded/sdcc/ChangeLog b/dev-embedded/sdcc/ChangeLog
index 6424b8be27a8..00add45b246a 100644
--- a/dev-embedded/sdcc/ChangeLog
+++ b/dev-embedded/sdcc/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for dev-embedded/sdcc
-# Copyright 1999-2009 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/dev-embedded/sdcc/ChangeLog,v 1.42 2009/08/10 08:11:49 ssuominen Exp $
+# Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/dev-embedded/sdcc/ChangeLog,v 1.43 2010/10/08 09:38:44 vapier Exp $
+
+*sdcc-9999 (08 Oct 2010)
+*sdcc-2.9.0 (08 Oct 2010)
+
+ 08 Oct 2010; Mike Frysinger <vapier@gentoo.org> +sdcc-2.9.0.ebuild,
+ +files/sdcc-2.9.0-build.patch, +files/sdcc-2.9.0-gcc44.patch,
+ +files/sdcc-2.9.0-getline.patch, +files/sdcc-2.9.0-headers.patch,
+ +sdcc-9999.ebuild, +files/sdcc-9999-build.patch:
+ Version bump #270621 by Karl Hiramoto. Merge & clean up the sdcc-svn
+ package and fix #251876 #255659 by Diego E. Pettenò in the process.
10 Aug 2009; Samuli Suominen <ssuominen@gentoo.org> sdcc-2.8.0.ebuild,
+files/sdcc-2.8.0-gcc44.patch:
diff --git a/dev-embedded/sdcc/files/sdcc-2.9.0-build.patch b/dev-embedded/sdcc/files/sdcc-2.9.0-build.patch
new file mode 100644
index 000000000000..b944b00d83a5
--- /dev/null
+++ b/dev-embedded/sdcc/files/sdcc-2.9.0-build.patch
@@ -0,0 +1,51 @@
+fix parallel build issues
+
+--- sdcc/device/lib/Makefile.in
++++ sdcc/device/lib/Makefile.in
+@@ -347,37 +347,21 @@
+ cp -f $(PORT)/bin/*.* $(SDCCPORTDIR); \
+ fi
+
+-$(LIB_FILES): $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_SDCC)
+ ifeq ($(LIB_TYPE), SDCCLIB)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
++mklib = ../../bin/sdcclib -a $@ $^
+ else ifeq ($(LIB_TYPE), AR)
+- ar -Scq $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
+- ar -Scq $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT)
+- ar -Scq $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG)
+- ar -Scq $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
++mklib = ar -Scq $@ $^
+ else ifeq ($(LIB_TYPE), RANLIB)
+- ar -Scq $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libfloat.lib
+- ar -Scq $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libint.lib
+- ar -Scq $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/liblong.lib
+- ar -Scq $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libsdcc.lib
++mklib = ar -Scq $@ $^ && $(top_builddir)/bin/asranlib $@
+ else
+- rm -f $(SDCCPORTDIR)/libfloat.lib
+- for i in $(notdir $(basename $(OBJECTS_FLOAT))); do echo $$i >> $(SDCCPORTDIR)/libfloat.lib; done
+- cp $(OBJECTS_FLOAT) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/libint.lib
+- for i in $(notdir $(basename $(OBJECTS_INT))); do echo $$i >> $(SDCCPORTDIR)/libint.lib; done
+- cp $(OBJECTS_INT) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/liblong.lib
+- for i in $(notdir $(basename $(OBJECTS_LONG))); do echo $$i >> $(SDCCPORTDIR)/liblong.lib; done
+- cp $(OBJECTS_LONG) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/libsdcc.lib
+- for i in $(notdir $(basename $(OBJECTS_SDCC))); do echo $$i >> $(SDCCPORTDIR)/libsdcc.lib; done
+- cp $(OBJECTS_SDCC) $(SDCCPORTDIR)
++mklib = for i in $(notdir $(basename $^)); do echo $$i; done >> $@; cp $^ $(SDCCPORTDIR)
+ endif
+
++$(SDCCPORTDIR)/libfloat.lib: $(OBJECTS_FLOAT); $(mklib)
++$(SDCCPORTDIR)/libint.lib: $(OBJECTS_INT); $(mklib)
++$(SDCCPORTDIR)/liblong.lib: $(OBJECTS_LONG); $(mklib)
++$(SDCCPORTDIR)/libsdcc.lib: $(OBJECTS_SDCC); $(mklib)
++
+ clean_intermediate:
+ rm -f $(SDCCPORTDIR)/*.lst $(SDCCPORTDIR)/*.sym
+
diff --git a/dev-embedded/sdcc/files/sdcc-2.9.0-gcc44.patch b/dev-embedded/sdcc/files/sdcc-2.9.0-gcc44.patch
new file mode 100644
index 000000000000..fb4ac7918c51
--- /dev/null
+++ b/dev-embedded/sdcc/files/sdcc-2.9.0-gcc44.patch
@@ -0,0 +1,15 @@
+like fix already in upstream
+
+* sim/ucsim/cmd.src/cmdlex.cc: regenerated,
+ fix for parch #3038644: Fix for GCC-4.4 compile error
+
+--- trunk/sdcc/sim/ucsim/cmd.src/cmdlex.cc 2010/08/04 15:21:39 5910
++++ trunk/sdcc/sim/ucsim/cmd.src/cmdlex.cc 2010/08/04 17:17:09 5911
+@@ -85,6 +85,7 @@
+ #include <errno.h>
+ #include <cstdlib>
+ #include <cstring>
++#include <cstdio>
+ /* end standard C++ headers. */
+
+ #ifdef __cplusplus
diff --git a/dev-embedded/sdcc/files/sdcc-2.9.0-getline.patch b/dev-embedded/sdcc/files/sdcc-2.9.0-getline.patch
new file mode 100644
index 000000000000..f7ca6237cf57
--- /dev/null
+++ b/dev-embedded/sdcc/files/sdcc-2.9.0-getline.patch
@@ -0,0 +1,16 @@
+upstream has reworked their code, so just do a minimal hack for the older ver
+
+http://bugs.gentoo.org/270621
+
+--- sdcc/as/link/getline.h
++++ sdcc/as/link/getline.h
+@@ -30,6 +30,9 @@
+
+ #include <stdio.h>
+
++#undef getline /* just in case */
++#define getline sdcc_getline
++
+ #ifdef __cplusplus
+ extern "C"
+ {
diff --git a/dev-embedded/sdcc/files/sdcc-2.9.0-headers.patch b/dev-embedded/sdcc/files/sdcc-2.9.0-headers.patch
new file mode 100644
index 000000000000..58d10299aa8f
--- /dev/null
+++ b/dev-embedded/sdcc/files/sdcc-2.9.0-headers.patch
@@ -0,0 +1,209 @@
+fix from upstream for implicit decls
+
+--- trunk/sdcc/debugger/mcs51/sdcdb.c 2009/09/20 11:50:19 5517
++++ trunk/sdcc/debugger/mcs51/sdcdb.c 2010/04/14 16:18:37 5813
+@@ -34,6 +34,10 @@
+ #include <readline/readline.h>
+ #include <readline/history.h>
+ #endif /* HAVE_LIBREADLINE */
++#ifdef HAVE_UNISTD_H
++#include <unistd.h>
++#endif
++#include <sys/wait.h>
+
+ #ifdef SDCDB_DEBUG
+ int sdcdbDebug = 0;
+@@ -1609,7 +1609,7 @@ static void parseCmdLine (int argc, char **argv)
+ }
+
+ if (strncmp(argv[i],"-cd=",4) == 0) {
+- chdir(argv[i][4]);
++ chdir(&argv[i][4]);
+ continue;
+ }
+
+--- trunk/sdcc/debugger/mcs51/config.h.in
++++ trunk/sdcc/debugger/mcs51/config.h.in
+@@ -15,6 +15,10 @@
+
+ #undef HAVE_LIBREADLINE
+
++#undef HAVE_UNISTD_H
++
++#undef HAVE_SYS_WAIT_H
++
+ #endif
+
+ /* End of config.h */
+
+fix from upstream for collision between "link" in unistd.h and local "link"
+
+--- trunk/sdcc/debugger/mcs51/symtab.h 2006/09/16 14:10:20 4379
++++ trunk/sdcc/debugger/mcs51/symtab.h 2010/04/14 16:18:37 5813
+@@ -106,13 +106,13 @@
+ short num_elem; /* # of elems if type==array */
+ short ptr_const :1; /* pointer is constant */
+ short ptr_volatile:1; /* pointer is volatile */
+- struct link *tspec; /* pointer type specifier */
++ struct st_link *tspec; /* pointer type specifier */
+ } declarator ;
+
+ #define DECLARATOR 0
+ #define SPECIFIER 1
+
+-typedef struct link {
++typedef struct st_link {
+ unsigned class : 1 ; /* DECLARATOR or SPECIFIER */
+ unsigned tdef : 1 ; /* current link created by */
+ /* typedef if this flag is set*/
+@@ -121,8 +121,8 @@
+ declarator d ; /* if CLASS == DECLARATOR */
+ } select ;
+
+- struct link *next ; /* next element on the chain */
+-} link ;
++ struct st_link *next ; /* next element on the chain */
++} st_link ;
+
+ typedef struct symbol {
+ char *name ;
+@@ -136,8 +136,8 @@
+ unsigned addr ; /* address if the symbol */
+ unsigned eaddr ; /* end address for functions */
+ char addr_type ; /* which address space */
+- link *type ; /* start of type chain */
+- link *etype ; /* end of type chain */
++ st_link *type ; /* start of type chain */
++ st_link *etype ; /* end of type chain */
+ char scopetype ; /* 'G' global, 'F' - file, 'L' local */
+ char *sname ; /* if 'F' or 'L' then scope name */
+ char *rname ; /* real name i.e. mangled beyond recognition */
+@@ -242,6 +242,6 @@
+ DEFSETFUNC(moduleWithName);
+ DEFSETFUNC(moduleWithCName);
+ DEFSETFUNC(moduleWithAsmName);
+-unsigned int getSize (link *);
++unsigned int getSize (st_link *);
+
+ #endif
+
+--- a/sdcc/debugger/mcs51/symtab.c
++++ b/sdcc/debugger/mcs51/symtab.c
+@@ -31,7 +31,7 @@ DEFSETFUNC(symWithRName);
+ /*------------------------------------------------------------------*/
+ /* getSize - returns size of a type chain in bits */
+ /*------------------------------------------------------------------*/
+-unsigned int getSize ( link *p )
++unsigned int getSize ( st_link *p )
+ {
+ /* if nothing return 0 */
+ if ( ! p )
+@@ -127,8 +127,8 @@ static char *parseTypeInfo (symbol *sym, char *s)
+ /* bp now points to '}' ... go past it */
+ s = ++bp;
+ while (*s != ')') { /* till we reach the end */
+- link *type;
+- type = Safe_calloc(1,sizeof(link));
++ st_link *type;
++ type = Safe_calloc(1,sizeof(st_link));
+ if (*s == ',') s++;
+
+ /* is a declarator */
+--- a/sdcc/debugger/mcs51/cmd.c
++++ b/sdcc/debugger/mcs51/cmd.c
+@@ -327,8 +327,8 @@ static char *warranty=
+ "POSSIBILITY OF SUCH DAMAGES.\n";
+ #endif
+
+-static void printTypeInfo(link *);
+-static void printValAggregates (symbol *,link *,char,unsigned int,int);
++static void printTypeInfo(st_link *);
++static void printValAggregates (symbol *,st_link *,char,unsigned int,int);
+ static int printOrSetSymValue (symbol *sym, context *cctxt,
+ int flg, int dnum, int fmt,
+ char *rs, char *val, char cmp);
+@@ -2323,7 +2323,7 @@ int cmdListSrc (char *s, context *cctxt)
+ return 0;
+ }
+
+-static unsigned long getValBasic(symbol *sym, link *type, char *val)
++static unsigned long getValBasic(symbol *sym, st_link *type, char *val)
+ {
+ char *s;
+ union
+@@ -2347,7 +2347,7 @@ static unsigned long getValBasic(symbol *sym, link *type, char *val)
+ {
+ if (IS_INTEGRAL(type))
+ {
+- link *etype;
++ st_link *etype;
+ if ( type->next )
+ etype = type->next;
+ else
+@@ -2460,7 +2460,7 @@ static void printFmtInteger(char *deffmt,int fmt, long val,
+ /*-----------------------------------------------------------------*/
+ /* printValBasic - print value of basic types */
+ /*-----------------------------------------------------------------*/
+-static void printValBasic(symbol *sym, link *type,
++static void printValBasic(symbol *sym, st_link *type,
+ char mem, unsigned addr,int size, int fmt)
+ {
+ union {
+@@ -2484,7 +2484,7 @@ static void printValBasic(symbol *sym, link *type,
+ else
+ if (IS_INTEGRAL(type))
+ {
+- link *etype;
++ st_link *etype;
+ if ( type->next )
+ etype = type->next;
+ else
+@@ -2534,10 +2534,10 @@ static void printValFunc (symbol *sym, int fmt)
+ /*-----------------------------------------------------------------*/
+ /* printArrayValue - will print the values of array elements */
+ /*-----------------------------------------------------------------*/
+-static void printArrayValue (symbol *sym, link *type,
++static void printArrayValue (symbol *sym, st_link *type,
+ char space, unsigned int addr, int fmt)
+ {
+- link *elem_type = type->next;
++ st_link *elem_type = type->next;
+ int i;
+
+ fprintf(stdout,"{");
+@@ -2558,7 +2558,7 @@ static void printArrayValue (symbol *sym, link *type,
+ /*-----------------------------------------------------------------*/
+ /* printStructValue - prints structures elements */
+ /*-----------------------------------------------------------------*/
+-static void printStructValue (symbol *sym, link *type,
++static void printStructValue (symbol *sym, st_link *type,
+ char space, unsigned int addr, int fmt)
+ {
+ symbol *fields = SPEC_STRUCT(type)->fields;
+@@ -2581,7 +2581,7 @@ static void printStructValue (symbol *sym, link *type,
+ /*-----------------------------------------------------------------*/
+ /* printValAggregates - print value of aggregates */
+ /*-----------------------------------------------------------------*/
+-static void printValAggregates (symbol *sym, link *type,
++static void printValAggregates (symbol *sym, st_link *type,
+ char space,unsigned int addr, int fmt)
+ {
+
+@@ -2606,7 +2606,7 @@ static int printOrSetSymValue (symbol *sym, context *cctxt,
+ static char fmtChar[] = " todx ";
+ static int stack = 1;
+ symbol *fields;
+- link *type;
++ st_link *type;
+ unsigned int addr;
+ int size, n;
+ char *s, *s2;
+@@ -2808,7 +2808,7 @@ static void printStructInfo (structdef *sdef)
+ /*-----------------------------------------------------------------*/
+ /* printTypeInfo - print out the type information */
+ /*-----------------------------------------------------------------*/
+-static void printTypeInfo(link *p)
++static void printTypeInfo(st_link *p)
+ {
+ if (!p)
+ return ;
diff --git a/dev-embedded/sdcc/files/sdcc-9999-build.patch b/dev-embedded/sdcc/files/sdcc-9999-build.patch
new file mode 100644
index 000000000000..9af5080ecd9e
--- /dev/null
+++ b/dev-embedded/sdcc/files/sdcc-9999-build.patch
@@ -0,0 +1,53 @@
+fix parallel build issues
+
+--- sdcc/device/lib/Makefile.in
++++ sdcc/device/lib/Makefile.in
+@@ -349,40 +349,23 @@
+ cp -f $(PORT)/bin/*.* $(SDCCPORTDIR); \
+ fi
+
+-$(LIB_FILES): $(OBJECTS_FLOAT) $(OBJECTS_INT) $(OBJECTS_LONG) $(OBJECTS_SDCC)
+ ifeq ($(LIB_TYPE), SDCCLIB)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG)
+- ../../bin/sdcclib -a $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
++ mklib = ../../bin/sdcclib -a $@ $^
+ else
+ ifeq ($(LIB_TYPE), AR)
+- $(AR_S) -cq $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT)
+- $(AR_S) -cq $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT)
+- $(AR_S) -cq $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG)
+- $(AR_S) -cq $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC)
++ mklib = $(AR_S) -cq $@ $^
+ else
+ ifeq ($(LIB_TYPE), RANLIB)
+- $(AR_S) -cq $(SDCCPORTDIR)/libfloat.lib $(OBJECTS_FLOAT); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libfloat.lib
+- $(AR_S) -cq $(SDCCPORTDIR)/libint.lib $(OBJECTS_INT); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libint.lib
+- $(AR_S) -cq $(SDCCPORTDIR)/liblong.lib $(OBJECTS_LONG); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/liblong.lib
+- $(AR_S) -cq $(SDCCPORTDIR)/libsdcc.lib $(OBJECTS_SDCC); $(top_builddir)/bin/asranlib $(SDCCPORTDIR)/libsdcc.lib
++ mklib = $(AR_S) -cq $@ $^ && $(top_builddir)/bin/asranlib $@
+ else
+- rm -f $(SDCCPORTDIR)/libfloat.lib
+- for i in $(notdir $(basename $(OBJECTS_FLOAT))); do echo $$i >> $(SDCCPORTDIR)/libfloat.lib; done
+- cp $(OBJECTS_FLOAT) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/libint.lib
+- for i in $(notdir $(basename $(OBJECTS_INT))); do echo $$i >> $(SDCCPORTDIR)/libint.lib; done
+- cp $(OBJECTS_INT) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/liblong.lib
+- for i in $(notdir $(basename $(OBJECTS_LONG))); do echo $$i >> $(SDCCPORTDIR)/liblong.lib; done
+- cp $(OBJECTS_LONG) $(SDCCPORTDIR)
+- rm -f $(SDCCPORTDIR)/libsdcc.lib
+- for i in $(notdir $(basename $(OBJECTS_SDCC))); do echo $$i >> $(SDCCPORTDIR)/libsdcc.lib; done
+- cp $(OBJECTS_SDCC) $(SDCCPORTDIR)
++ mklib = for i in $(notdir $(basename $^)); do echo $$i; done >> $@ && cp $^ $(SDCCPORTDIR)
+ endif
+ endif
+ endif
++$(SDCCPORTDIR)/libfloat.lib: $(OBJECTS_FLOAT); $(mklib)
++$(SDCCPORTDIR)/libint.lib: $(OBJECTS_INT); $(mklib)
++$(SDCCPORTDIR)/liblong.lib: $(OBJECTS_LONG); $(mklib)
++$(SDCCPORTDIR)/libsdcc.lib: $(OBJECTS_SDCC); $(mklib)
+
+ clean_intermediate:
+ rm -f $(SDCCPORTDIR)/*.lst $(SDCCPORTDIR)/*.sym
diff --git a/dev-embedded/sdcc/sdcc-2.9.0.ebuild b/dev-embedded/sdcc/sdcc-2.9.0.ebuild
new file mode 100644
index 000000000000..a28c4e1cb6a1
--- /dev/null
+++ b/dev-embedded/sdcc/sdcc-2.9.0.ebuild
@@ -0,0 +1,97 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-embedded/sdcc/sdcc-2.9.0.ebuild,v 1.1 2010/10/08 09:38:44 vapier Exp $
+
+EAPI="2"
+
+inherit eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc"
+ inherit subversion autotools
+ docs_compile() { return 0; }
+else
+ SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
+ doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
+ KEYWORDS="~amd64 ~ppc ~x86"
+ docs_compile() { return 1; }
+fi
+
+DESCRIPTION="Small device C compiler (for various microprocessors)"
+HOMEPAGE="http://sdcc.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+boehm-gc doc"
+RESTRICT="strip"
+
+RDEPEND="sys-libs/ncurses
+ sys-libs/readline
+ >=dev-embedded/gputils-0.13.7
+ boehm-gc? ( dev-libs/boehm-gc )
+ !dev-embedded/sdcc-svn"
+DEPEND="${RDEPEND}"
+if docs_compile ; then
+ DEPEND+="
+ doc? (
+ >=app-office/lyx-1.3.4
+ dev-tex/latex2html
+ )"
+fi
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # Fix conflicting variable names between Gentoo and sdcc
+ find \
+ '(' -name 'Makefile*.in' -o -name configure ')' \
+ -exec sed -r -i \
+ -e 's:\<(PORTDIR|ARCH)\>:SDCC\1:g' \
+ {} + || die
+
+ epatch "${FILESDIR}"/${P}-gcc44.patch
+ epatch "${FILESDIR}"/${P}-getline.patch
+ epatch "${FILESDIR}"/${P}-headers.patch
+ epatch "${FILESDIR}"/${P}-build.patch
+
+ # We'll install doc manually
+ sed -i -e '/SDCC_DOC/d' Makefile.in || die
+ sed -i -e 's/all install-doc/all/' as/Makefile.in || die
+ sed -i -e 's/ doc//' sim/ucsim/packages_in.mk || die
+
+ [[ ${PV} == "9999" ]] && eautoreconf
+}
+
+src_configure() {
+ ac_cv_prog_STRIP=true \
+ econf \
+ $(use_enable boehm-gc libgc) \
+ $(docs_compile && use_enable doc || echo --disable-doc)
+}
+
+fsrc_compile() {
+ emake || die
+ if docs_compile && use doc ; then
+ cd doc
+ local d
+ for d in cdbfileformat sdccman test_suite_spec ; do
+ lyx -e html ${d} || die
+ done
+ fi
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc doc/*.txt doc/*/*.txt
+ find "${D}" -name .deps -exec rm -rf {} +
+
+ if use doc ; then
+ docs_compile || cd "${WORKDIR}"/doc
+ dohtml -r *
+ fi
+
+ # a bunch of archives (*.a) are built & installed by gputils
+ # for PIC processors, but they do not work with standard `ar`
+ # & `scanelf` utils and they're not for the host.
+ env RESTRICT="" prepstrip "${D%/}"/usr/bin
+}
diff --git a/dev-embedded/sdcc/sdcc-9999.ebuild b/dev-embedded/sdcc/sdcc-9999.ebuild
new file mode 100644
index 000000000000..926984d7b284
--- /dev/null
+++ b/dev-embedded/sdcc/sdcc-9999.ebuild
@@ -0,0 +1,85 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/dev-embedded/sdcc/sdcc-9999.ebuild,v 1.1 2010/10/08 09:38:44 vapier Exp $
+
+EAPI="2"
+
+inherit eutils
+
+if [[ ${PV} == "9999" ]] ; then
+ ESVN_REPO_URI="https://sdcc.svn.sourceforge.net/svnroot/sdcc/trunk/sdcc"
+ inherit subversion autotools
+ docs_compile() { return 0; }
+else
+ SRC_URI="mirror://sourceforge/sdcc/${PN}-src-${PV}.tar.bz2
+ doc? ( mirror://sourceforge/sdcc/${PN}-doc-${PV}.tar.bz2 )"
+ KEYWORDS="~amd64 ~ppc ~x86"
+ docs_compile() { return 1; }
+fi
+
+DESCRIPTION="Small device C compiler (for various microprocessors)"
+HOMEPAGE="http://sdcc.sourceforge.net/"
+
+LICENSE="GPL-2"
+SLOT="0"
+IUSE="+boehm-gc doc"
+RESTRICT="strip"
+
+RDEPEND="sys-libs/ncurses
+ sys-libs/readline
+ >=dev-embedded/gputils-0.13.7
+ boehm-gc? ( dev-libs/boehm-gc )
+ !dev-embedded/sdcc-svn"
+DEPEND="${RDEPEND}"
+if docs_compile ; then
+ DEPEND+="
+ doc? (
+ >=app-office/lyx-1.3.4
+ dev-tex/latex2html
+ )"
+fi
+
+S=${WORKDIR}/${PN}
+
+src_prepare() {
+ # Fix conflicting variable names between Gentoo and sdcc
+ find \
+ '(' -name 'Makefile*.in' -o -name configure ')' \
+ -exec sed -r -i \
+ -e 's:\<(PORTDIR|ARCH)\>:SDCC\1:g' \
+ {} + || die
+
+ epatch "${FILESDIR}"/${P}-build.patch
+
+ # We'll install doc manually
+ sed -i -e '/SDCC_DOC/d' Makefile.in || die
+ sed -i -e 's/ doc//' sim/ucsim/packages_in.mk || die
+
+ [[ ${PV} == "9999" ]] && eautoreconf
+
+ # workaround parallel build issues with lyx
+ mkdir -p "${HOME}"/.lyx
+}
+
+src_configure() {
+ ac_cv_prog_STRIP=true \
+ econf \
+ $(use_enable boehm-gc libgc) \
+ $(docs_compile && use_enable doc || echo --disable-doc)
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die
+ dodoc doc/*.txt doc/*/*.txt
+ find "${D}" -name .deps -exec rm -rf {} +
+
+ if use doc ; then
+ docs_compile || cd "${WORKDIR}"/doc
+ dohtml -r *
+ fi
+
+ # a bunch of archives (*.a) are built & installed by gputils
+ # for PIC processors, but they do not work with standard `ar`
+ # & `scanelf` utils and they're not for the host.
+ env RESTRICT="" prepstrip "${D%/}"/usr/bin
+}