added make file for compiling the C runtime for Android. The JIT compiler for Android is temporary disabled

This commit is contained in:
kr.angelov
2013-09-04 11:56:47 +00:00
parent a690fb7d6f
commit d62cf1363c
4 changed files with 31 additions and 0 deletions

View File

@@ -0,0 +1,14 @@
LOCAL_PATH := $(call my-dir)
include $(CLEAR_VARS)
jni_c_files := ../java/jpgf.c
pgf_c_files := data.c expr.c graphviz.c lexer.c linearizer.c literals.c parser.c parseval.c pgf.c printer.c reader.c reasoner.c
gu_c_files := assert.c choice.c dump.c exn.c fun.c in.c list.c map.c out.c read.c str.c type.c utf8.c write.c \
bits.c defs.c enum.c file.c hash.c intern.c log.c mem.c prime.c seq.c string.c ucs.c variant.c yaml.c
LOCAL_MODULE := jpgf
LOCAL_SRC_FILES := $(addprefix ../c/pgf/, $(pgf_c_files)) $(addprefix ../c/gu/, $(gu_c_files))
LOCAL_C_INCLUDES := ../c
include $(BUILD_SHARED_LIBRARY)

View File

@@ -0,0 +1,2 @@
APP_CFLAGS := -std=gnu99

View File

@@ -2,7 +2,11 @@
#include "expr.h"
#include "literals.h"
#include "reader.h"
#ifndef ANDROID
#include "jit.h"
#endif
#include <gu/defs.h>
#include <gu/map.h>
#include <gu/seq.h>
@@ -25,7 +29,9 @@ struct PgfReader {
GuPool* opool;
GuPool* tmp_pool;
GuSymTable* symtab;
#ifndef ANDROID
PgfJitState* jit_state;
#endif
};
typedef struct PgfReadTagExn PgfReadTagExn;
@@ -545,7 +551,9 @@ pgf_read_abscat(PgfReader* rdr, PgfAbstr* abstr, PgfCIdMap* abscats)
gu_buf_push(functions, PgfAbsFun*, absfun);
}
#ifndef ANDROID
pgf_jit_predicate(rdr->jit_state, abscats, abscat, functions);
#endif
return abscat;
}
@@ -1210,12 +1218,16 @@ pgf_new_reader(GuIn* in, GuPool* opool, GuPool* tmp_pool, GuExn* err)
rdr->symtab = gu_new_symtable(opool, tmp_pool);
rdr->err = err;
rdr->in = in;
#ifndef ANDROID
rdr->jit_state = pgf_jit_init(tmp_pool, rdr->opool);
#endif
return rdr;
}
void
pgf_reader_done(PgfReader* rdr, PgfPGF* pgf)
{
#ifndef ANDROID
pgf_jit_done(rdr->jit_state, &pgf->abstract);
#endif
}

View File

@@ -9,6 +9,9 @@ doc:
Test.class: Test.java
javac Test.java
libjpgf.jar: org/grammaticalframework/pgf/PGF.class
jar -cf libjpgf.jar org/grammaticalframework/pgf/*.class
org/grammaticalframework/pgf/PGF.class: org/grammaticalframework/pgf/PGF.java
javac Test.java