Commit 164ab561 authored by Axel Simon's avatar Axel Simon

Merge branch 'experimental' of versioncontrolseidl.in.tum.de:jucs/gdsl-toolkit

parents df4567bc c18f91c4
......@@ -233,22 +233,22 @@ GDSL_ARM7 = \
$(srcdir)/specifications/arm7/arm7-pretty.ml
# $(srcdir)/specifications/arm7/arm7-asm.ml
#if X86_RREIL
if X86_RREIL
lib_LTLIBRARIES += libgdsl-x86-rreil.la
nodist_include_HEADERS += gdsl-x86-rreil.h
#libjgdsl_la_LIBADD += libgdsl-x86-rreil.la
#semantics_opt_LDADD += libgdsl-x86-rreil.la
CLEANFILES += gdsl-x86-rreil.c gdsl-x86-rreil.h
#endif
libgdsl_x86_rreil_la_SOURCES =
nodist_libgdsl_x86_rreil_la_SOURCES = gdsl-x86-rreil.c
libgdsl_x86_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_x86_rreil_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_x86_rreil_demo
endif
endif
libgdsl_x86_rreil_la_SOURCES =
nodist_libgdsl_x86_rreil_la_SOURCES = gdsl-x86-rreil.c
libgdsl_x86_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_x86_rreil_demo_SOURCES = gdsl-x86-rreil.c
gdsl_x86_rreil_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -256,21 +256,21 @@ GS_X86_RREIL = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM
gdsl-x86-rreil.c: $(GDSLC_DEP) $(GS_X86_RREIL)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_X86_RREIL)
#if X86
if X86
lib_LTLIBRARIES += libgdsl-x86.la
#decoder_cli_LDADD += libgdsl-x86.la
nodist_include_HEADERS += gdsl-x86.h
CLEANFILES += gdsl-x86.c gdsl-x86.h
#endif
libgdsl_x86_la_SOURCES =
nodist_libgdsl_x86_la_SOURCES = gdsl-x86.c
libgdsl_x86_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_x86_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_x86_demo
endif
endif
libgdsl_x86_la_SOURCES =
nodist_libgdsl_x86_la_SOURCES = gdsl-x86.c
libgdsl_x86_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_x86_demo_SOURCES = gdsl-x86.c
gdsl_x86_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -278,22 +278,22 @@ GS_X86 = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86)
gdsl-x86.c: $(GDSLC_DEP) $(GS_X86)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_X86)
#if AVR_RREIL
if AVR_RREIL
lib_LTLIBRARIES += libgdsl-avr-rreil.la
#libjgdsl_la_LIBADD += libgdsl-avr-rreil.la
#semantics_opt_LDADD += libgdsl-avr-rreil.la
nodist_include_HEADERS += gdsl-avr-rreil.h
CLEANFILES += gdsl-avr-rreil.c gdsl-avr-rreil.h
#endif
libgdsl_avr_rreil_la_SOURCES =
nodist_libgdsl_avr_rreil_la_SOURCES = gdsl-avr-rreil.c
libgdsl_avr_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_avr_rreil_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_avr_rreil_demo
endif
endif
libgdsl_avr_rreil_la_SOURCES =
nodist_libgdsl_avr_rreil_la_SOURCES = gdsl-avr-rreil.c
libgdsl_avr_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_avr_rreil_demo_SOURCES = gdsl-avr-rreil.c
gdsl_avr_rreil_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -301,21 +301,21 @@ GS_AVR_RREIL = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_AVR) $(GDSL_RREIL) $(GDSL_AVRSE
gdsl-avr-rreil.c: $(GDSLC_DEP) $(GS_AVR_RREIL)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_AVR_RREIL)
#if AVR
if AVR
lib_LTLIBRARIES += libgdsl-avr.la
#decoder_cli_LDADD += libgdsl-avr.la
nodist_include_HEADERS += gdsl-avr.h
CLEANFILES += gdsl-avr.c gdsl-avr.h
#endif
libgdsl_avr_la_SOURCES =
nodist_libgdsl_avr_la_SOURCES = gdsl-avr.c
libgdsl_avr_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_avr_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_avr_demo
endif
endif
libgdsl_avr_la_SOURCES =
nodist_libgdsl_avr_la_SOURCES = gdsl-avr.c
libgdsl_avr_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_avr_demo_SOURCES = gdsl-avr.c
gdsl_avr_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -323,22 +323,22 @@ GS_AVR = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_AVR)
gdsl-avr.c: $(GDSLC_DEP) $(GS_AVR)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_AVR)
#if MIPS_RREIL
if MIPS_RREIL
lib_LTLIBRARIES += libgdsl-mips-rreil.la
#libjgdsl_la_LIBADD += libgdsl-mips-rreil.la
#semantics_opt_LDADD += libgdsl-mips-rreil.la
nodist_include_HEADERS += gdsl-mips-rreil.h
CLEANFILES += gdsl-mips-rreil.c gdsl-mips-rreil.h
#endif
libgdsl_mips_rreil_la_SOURCES =
nodist_libgdsl_mips_rreil_la_SOURCES = gdsl-mips-rreil.c
libgdsl_mips_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_mips_rreil_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_mips_rreil_demo
endif
endif
libgdsl_mips_rreil_la_SOURCES =
nodist_libgdsl_mips_rreil_la_SOURCES = gdsl-mips-rreil.c
libgdsl_mips_rreil_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_mips_rreil_demo_SOURCES = gdsl-mips-rreil.c
gdsl_mips_rreil_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -346,21 +346,21 @@ GS_MIPS_RREIL = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_MIPS) $(GDSL_RREIL) $(GDSL_MIP
gdsl-mips-rreil.c: $(GDSLC_DEP) $(GS_MIPS_RREIL)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_MIPS_RREIL)
#if MIPS
if MIPS
lib_LTLIBRARIES += libgdsl-mips.la
#decoder_cli_LDADD += libgdsl-mips.la
nodist_include_HEADERS += gdsl-mips.h
CLEANFILES += gdsl-mips.c gdsl-mips.h
#endif
libgdsl_mips_la_SOURCES =
nodist_libgdsl_mips_la_SOURCES = gdsl-mips.c
libgdsl_mips_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_mips_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_mips_demo
endif
endif
libgdsl_mips_la_SOURCES =
nodist_libgdsl_mips_la_SOURCES = gdsl-mips.c
libgdsl_mips_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_mips_demo_SOURCES = gdsl-mips.c
gdsl_mips_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -368,21 +368,20 @@ GS_MIPS = $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_MIPS)
gdsl-mips.c: $(GDSLC_DEP) $(GS_MIPS)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_MIPS)
#if ARM7
if ARM7
lib_LTLIBRARIES += libgdsl-arm7.la
nodist_include_HEADERS += gdsl-arm7.h
CLEANFILES += gdsl-arm7.c gdsl-arm7.h
#endif
libgdsl_arm7_la_SOURCES =
nodist_libgdsl_arm7_la_SOURCES = gdsl-arm7.c
libgdsl_arm7_la_DEPENDENCIES = $(GDSLC_DEP)
if INSTALL_AUXBINS
bin_PROGRAMS += gdsl_arm7_demo
endif
if BUILD_AUXBINS
noinst_PROGRAMS += gdsl_arm7_demo
endif
endif
libgdsl_arm7_la_SOURCES =
nodist_libgdsl_arm7_la_SOURCES = gdsl-arm7.c
libgdsl_arm7_la_DEPENDENCIES = $(GDSLC_DEP)
gdsl_arm7_demo_SOURCES = gdsl-arm7.c
gdsl_arm7_demo_CFLAGS = -std=c99 -DWITHMAIN
......@@ -390,7 +389,6 @@ GS_ARM7 = $(GDSL_BASIS) $(GDSL_ARM7)
gdsl-arm7.c: $(GDSLC_DEP) $(GS_ARM7)
$(GDSLC) -o $(basename $@) $(GDSLFLAGS) $(GS_ARM7)
#if HAVE_RREIL
JSOURCES = src/Program.java \
src/gdsl/BareFrontend.java \
src/gdsl/translator/Translator.java \
......@@ -542,9 +540,7 @@ $(JAR): pre-build $(JSOURCES:%=libs/jgdsl/%)
ABS_DST=$$(pwd)/$(BPRE) && cd $(srcdir)/libs/jgdsl && javac -cp /usr/share/java/junit4.jar:. $(JSOURCES) -d $$ABS_DST/
jar -cf $@ $(JSOURCES:$(SPRE)/%.java=-C $(BPRE) %.class)
CLEANFILES += jgdsl.jar
#endif
CLEANFILES += gdslc jgdsl.jar
clean-local:
-rm -rf build/
......@@ -552,11 +548,15 @@ clean-local:
if INSTALL_AUXLIBS
if HAVE_GDSL_MULTIPLEX
if HAVE_RREIL
lib_LTLIBRARIES += libgdsl-multiplex.la
endif
endif
if HAVE_JGDSL
if HAVE_RREIL
lib_LTLIBRARIES += libjgdsl.la
endif
endif
if HAVE_MEMSTREAM
lib_LTLIBRARIES += libmemstream.la
endif
......@@ -564,17 +564,20 @@ endif
if BUILD_AUXLIBS
if HAVE_GDSL_MULTIPLEX
if HAVE_RREIL
noinst_LTLIBRARIES += libgdsl-multiplex.la
endif
endif
if HAVE_JGDSL
if HAVE_RREIL
noinst_LTLIBRARIES += libjgdsl.la
endif
endif
if HAVE_MEMSTREAM
noinst_LTLIBRARIES += libmemstream.la
endif
endif
#if HAVE_RREIL
libgdsl_multiplex_la_SOURCES = $(srcdir)/libs/gdsl-multiplex/src/gdsl_multiplex.c
libgdsl_multiplex_la_CFLAGS = -std=c99 -I$(srcdir)/libs/gdsl-multiplex/include
libgdsl_multiplex_la_LDFLAGS = -ldl
......@@ -583,15 +586,11 @@ if HAVE_MEMSTREAM
libgdsl_multiplex_la_CFLAGS += -include$(srcdir)/libs/memstream/include/memstream.h
libgdsl_multiplex_la_LIBADD += libmemstream.la
endif
#endif
#if HAVE_RREIL
libjgdsl_la_SOURCES = $(srcdir)/libs/jgdsl/src/gdsl_rreil_BuilderBackend.c $(srcdir)/libs/jgdsl/src/gdsl_Gdsl.c $(srcdir)/libs/jgdsl/src/gdsl_decoder_NativeInstruction.c $(srcdir)/libs/jgdsl/src/gdsl_asm_GeneralizerBackend.c $(srcdir)/libs/jgdsl/src/gdsl_Frontend.c $(srcdir)/libs/jgdsl/src/gdsl_BareFrontend.c $(srcdir)/libs/jgdsl/src/gdsl_ListFrontend.c $(srcdir)/libs/jgdsl/src/util.c
libjgdsl_la_CFLAGS = -std=c99 -I/usr/lib/jvm/java-7-openjdk-amd64/include -I$(srcdir)/libs/gdsl-multiplex/include
libjgdsl_la_LIBADD += libgdsl-multiplex.la
libjgdsl.la: jgdsl.jar
libjgdsl_la_LIBADD += libgdsl-multiplex.la jgdsl.jar
private_headers += $(srcdir)/libs/jgdsl/src/gdsl_rreil_BuilderBackend.h $(srcdir)/libs/jgdsl/src/gdsl_Gdsl.h $(srcdir)/libs/jgdsl/src/gdsl_decoder_Instruction.h $(srcdir)/libs/jgdsl/src/gdsl_Frontend.h $(srcdir)/libs/jgdsl/src/gdsl_BareFrontend.h $(srcdir)/libs/jgdsl/src/gdsl_ListFrontend.h $(srcdir)/libs/jgdsl/src/util.h
#endif
if HAVE_MEMSTREAM
libmemstream_la_SOURCES = $(srcdir)/libs/memstream/src/memstream.c
......@@ -619,18 +618,3 @@ private_headers += $(srcdir)/tools/x86-test-stats-runner/src/hash_array.h
#endif
EXTRA_DIST = LICENSE $(GDSL_BASIS) $(GDSL_ASM) $(GDSL_X86) $(GDSL_RREIL) $(GDSL_X86SEM) $(GDSL_AVR) $(GDSL_AVRSEM) $(GDSL_MIPS) $(GDSL_MIPSSEM) $(private_headers) $(RUNTIME) $(srcdir)/gdsl.h $(srcdir)/gdslc.mlb $(srcdir)/gdsl.cm $(GDSLC_SML_FILES) $(srcdir)/detail/ml/smlnj/unsealed.cm
#if X86_RREIL
install-data-hook:
ln -fs $(DESTDIR)$(libdir)/libgdsl-x86-rreil.so $(DESTDIR)$(libdir)/libgdsl-x86.so
#endif
#if AVR_RREIL
install-data-hook:
ln -fs $(DESTDIR)$(libdir)/libgdsl-avr-rreil.so $(DESTDIR)$(libdir)/libgdsl-avr.so
#endif
#if MIPS_RREIL
install-data-hook:
ln -fs $(DESTDIR)$(libdir)/libgdsl-mips-rreil.so $(DESTDIR)$(libdir)/libgdsl-mips.so
#endif
......@@ -54,39 +54,44 @@ AM_CONDITIONAL(LINUX, test "$LINUX" = "yes")
#AM_CONDITIONAL(HAVE_JNI_H, test "$HAVE_JNI_H" != "")
dnl conditionals for the various decoders, either with or without semantics
#FRONTENDS="x86 x86-rreil avr avr-rreil mips mips-rreil";
#AC_ARG_WITH([frontend],
# [AS_HELP_STRING(
# [--with-frontend=frontend],
# [one of: ]$FRONTENDS)],
# [], [with_frontend=x86-rreil])
#
#case $with_frontend in
# x86)
# AC_DEFINE([USE_X86],[1],[build x86 bare decoder])
# with_frontend=x86;;
# x86-rreil)
# AC_DEFINE([USE_X86_RREIL],[1],[build x86 decoder and RReil semantics])
# with_frontend=x86-rreil;;
# avr)
# AC_DEFINE([USE_AVR],[1],[build AVR bare decoder])
# with_frontend=avr;;
# avr-rreil)
# AC_DEFINE([USE_AVR_RREIL],[1],[build AVR decoder and RReil semantics])
# with_frontend=avr-rreil;;
# mips)
# AC_DEFINE([USE_MIPS],[1],[build MIPS bare decoder])
# with_frontend=mips;;
# mips-rreil)
# AC_DEFINE([USE_MIPS_RREIL],[1],[build MIPS decoder and RReil semantics])
# with_frontend=mips-rreil;;
# *) AC_MSG_FAILURE([invalid frontend, choose one of ]$FRONTENDS);;
#esac
#case $with_frontend in
# *-rreil) has_rreil=yes;;
# *) has_rreil=no;;
#esac
FRONTENDS="x86 x86-rreil avr avr-rreil mips mips-rreil arm7";
AC_ARG_WITH([frontend],
[AS_HELP_STRING(
[--with-frontend=frontend],
[one of: ]$FRONTENDS)],
[], [with_frontend=all])
case $with_frontend in
all)
with_frontend=all;;
x86)
AC_DEFINE([USE_X86],[1],[build x86 bare decoder])
with_frontend=x86;;
x86-rreil)
AC_DEFINE([USE_X86_RREIL],[1],[build x86 decoder and RReil semantics])
with_frontend=x86-rreil;;
avr)
AC_DEFINE([USE_AVR],[1],[build AVR bare decoder])
with_frontend=avr;;
avr-rreil)
AC_DEFINE([USE_AVR_RREIL],[1],[build AVR decoder and RReil semantics])
with_frontend=avr-rreil;;
mips)
AC_DEFINE([USE_MIPS],[1],[build MIPS bare decoder])
with_frontend=mips;;
mips-rreil)
AC_DEFINE([USE_MIPS_RREIL],[1],[build MIPS decoder and RReil semantics])
with_frontend=mips-rreil;;
arm7)
AC_DEFINE([USE_ARM7],[1],[build ARM7 bare decoder])
with_frontend=arm7;;
*) AC_MSG_FAILURE([invalid frontend, choose one of ]$FRONTENDS);;
esac
case $with_frontend in
*-rreil) has_rreil=yes;;
*) has_rreil=no;;
esac
#case $with_frontend in
# x86*) has_x86=yes;;
# *) has_x86=no;;
......@@ -131,13 +136,15 @@ AC_CHECK_HEADERS([gelf.h], [has_elf=yes], [has_elf=no])
AC_CHECK_HEADERS([jni.h], [has_jni=yes], [has_jni=no])
AC_CHECK_HEADERS([stdint-gcc.h], [has_stdint_gcc=yes], [has_stdint_gcc=no])
#AM_CONDITIONAL([X86_RREIL],[test x$with_frontend = xx86-rreil])
#AM_CONDITIONAL([X86],[test x$with_frontend = xx86])
#AM_CONDITIONAL([AVR_RREIL],[test x$with_frontend = xavr-rreil])
#AM_CONDITIONAL([AVR],[test x$with_frontend = xavr])
#AM_CONDITIONAL([MIPS_RREIL],[test x$with_frontend = xmips-rreil])
#AM_CONDITIONAL([MIPS],[test x$with_frontend = xmips])
#AM_CONDITIONAL([HAVE_RREIL],[test x$has_rreil = xyes])
AM_CONDITIONAL([X86_RREIL],[test x$with_frontend = xx86-rreil -o x$with_frontend = xall])
AM_CONDITIONAL([X86],[test x$with_frontend = xx86 -o x$with_frontend = xall])
AM_CONDITIONAL([AVR_RREIL],[test x$with_frontend = xavr-rreil -o x$with_frontend = xall])
AM_CONDITIONAL([AVR],[test x$with_frontend = xavr -o x$with_frontend = xall])
AM_CONDITIONAL([MIPS_RREIL],[test x$with_frontend = xmips-rreil -o x$with_frontend = xall])
AM_CONDITIONAL([MIPS],[test x$with_frontend = xmips -o x$with_frontend = xall])
AM_CONDITIONAL([ARM7],[test x$with_frontend = xarm7 -o x$with_frontend = xall])
AM_CONDITIONAL([HAVE_RREIL],[test x$has_rreil = xyes -o x$with_frontend = xall])
AM_CONDITIONAL([SINGLE],[test x$with_frontend != xall])
#AM_CONDITIONAL([HAVE_X86], [test x$has_x86 = xyes])
#AM_CONDITIONAL([HAVE_GNU_C11], [echo "int main(void) { return 0; }" | gcc -std=gnu11 -xc - -o /dev/null])
#AM_CONDITIONAL([HAVE_POSIX200809], [test `getconf _POSIX_VERSION` -ge 200809 >/dev/null 2>&1])
......@@ -206,12 +213,18 @@ AC_CONFIG_FILES([
Makefile
])
AM_COND_IF([HAVE_GDSL_MULTIPLEX], libjgdsl_msg=yes, libjgdsl_msg=no)
AM_COND_IF([HAVE_RREIL], libjgdsl_msg=$libjgdsl_msg, libjgdsl_msg="no; translator API missing")
AM_COND_IF([HAVE_GDSL_MULTIPLEX], libgdsl_multiplex_msg=yes, libgdsl_multiplex_msg=no)
AM_COND_IF([HAVE_RREIL], libgdsl_multiplex_msg=$libgdsl_multiplex_msg, libgdsl_multiplex_msg="no; translator API missing")
AC_OUTPUT()
cat <<EOF
GDSL toolkit configuration:
directory prefix: $prefix
C flags: $CFLAGS
frontend to build: $with_frontend
build auxiliary libraries: $enable_build_auxlibs
install auxiliary libraries: $enable_install_auxlibs
build auxiliary programs: $enable_build_auxbins
......@@ -219,8 +232,8 @@ GDSL toolkit configuration:
version: $VERSION
EOF
echo Libraries:
AS_ECHO_N " libgdsl-multiplex: "; AM_COND_IF([HAVE_GDSL_MULTIPLEX], echo yes, echo no)
AS_ECHO_N " libjgdsl: "; AM_COND_IF([HAVE_JGDSL], echo yes, echo no)
AS_ECHO_N " libgdsl-multiplex: "; echo $libjgdsl_msg
AS_ECHO_N " libjgdsl: "; echo $libgdsl_multiplex_msg
AS_ECHO_N " libmemstream: "; AM_COND_IF([HAVE_MEMSTREAM], echo yes, echo no)
echo
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment