added support for gecode library

This commit is contained in:
Denys Duchier
2011-08-08 15:21:36 +02:00
parent bdeea3b15e
commit d4d4dbaddf
27 changed files with 7026 additions and 1018 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,33 @@
GECODEDIR := $(shell g++ -q $(CPPFLAGS) $(CXXFLAGS) -H -E gecodedir.hh 2>&1 >/dev/null | grep gecode/kernel.hh | awk '{print $$2}' | sed 's|/kernel.hh||')
GECODECONFIG := $(GECODEDIR)/support/config.hpp
GECODEVERSION := $(shell cat $(GECODECONFIG) | egrep GECODE_VERSION | awk '{print $$3}' | sed 's/"//g')
PROTOTYPES = gecode-prototypes-$(GECODEVERSION).hh
ENUMS = gecode-enums-$(GECODEVERSION).py
all: $(PROTOTYPES) $(ENUMS)
$(PROTOTYPES): % : xml/namespaceGecode.xml extract-prototypes.xsl
cat notice.hh > $@
xsltproc extract-prototypes.xsl $< \
| sed 's/Gecode:://g' \
| sed 's/< /</g' \
| sed 's/ >/>/g' \
| sed 's/ \&/\&/g' \
| sed 's/, /,/g' \
| sed 's/forceinline //g' \
| sed 's/GECODE_INT_EXPORT //g' \
| sed 's/GECODE_SET_EXPORT //g' \
| grep -v '*' | sort >> $@
$(ENUMS): % : xml/namespaceGecode.xml extract-enums.xsl
cat notice.py > $@
xsltproc extract-enums.xsl $< >> $@
xml/namespaceGecode.xml: Doxyfile
doxygen Doxyfile
Doxyfile: Doxyfile.in
cat $< | sed "s#@GECODEDIR@#$(GECODEDIR)#" > $@
clean:
-rm -rf *~ gecode-prototypes-*.hh gecode-enums-*.py Doxyfile xml

View File

@@ -0,0 +1,2 @@
This directory contains support code for automatically extracting
prototypes from the local Gecode installation.

View File

@@ -0,0 +1,31 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" version="1.0"/>
<xsl:template match="/">
<xsl:text>ENUM_CLASSES = []
</xsl:text>
<xsl:for-each select="/doxygen/compounddef/sectiondef[@kind='enum']/memberdef">
<xsl:text>class </xsl:text>
<xsl:value-of select="name"/>
<xsl:text>(object):
</xsl:text>
<xsl:text> TYPE = '</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>'
ENUM = [</xsl:text>
<xsl:for-each select="enumvalue">
<xsl:if test="position()!=1"><xsl:text>,</xsl:text></xsl:if>
<xsl:text>'</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>'</xsl:text>
</xsl:for-each>
<xsl:text>]
ENUM_CLASSES.append(</xsl:text>
<xsl:value-of select="name"/>
<xsl:text>)
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,21 @@
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="text" version="1.0"/>
<xsl:template match="/">
<xsl:for-each select="/doxygen/compounddef/sectiondef[@kind='func']/memberdef[starts-with(@id,'group__TaskModel') and not(starts-with(name,'operator')) and name!='tiebreak' and name!='wait' and not(starts-with(@id,'group__TaskModelMiniModel'))]">
<xsl:value-of select="type"/>
<xsl:text> </xsl:text>
<xsl:value-of select="name"/>
<xsl:for-each select="param">
<xsl:if test="position()=1"><xsl:text>(</xsl:text></xsl:if>
<xsl:if test="position()!=1"><xsl:text>,</xsl:text></xsl:if>
<xsl:value-of select="type"/>
<xsl:for-each select="defval">
<xsl:text>=</xsl:text>
<xsl:value-of select="."/>
</xsl:for-each>
</xsl:for-each>
<xsl:text>);
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1 @@
#include "gecode/kernel.hh"

View File

@@ -0,0 +1,3 @@
// This file was automatically extracted from Gecode source files.
// It is subject to the same Copyright as the source files from which
// it is derived, and is distributed under the same Licensing conditions.

View File

@@ -0,0 +1,3 @@
# This file was automatically extracted from Gecode source files.
# It is subject to the same Copyright as the source files from which
# it is derived, and is distributed under the same Licensing conditions.