diff --git a/bootstrap b/bootstrap index 3cb1458..278c3e9 100755 --- a/bootstrap +++ b/bootstrap @@ -1,6 +1,9 @@ #! /bin/sh -aclocal \ -&& automake --gnu --add-missing \ -&& autoconf +set -x +aclocal -I config +libtoolize --force --copy +autoheader +automake --add-missing --copy --foreign +autoconf diff --git a/configure.in b/configure.in index 97d63ab..adee5ba 100644 --- a/configure.in +++ b/configure.in @@ -1,29 +1,36 @@ -AC_INIT(main.c) +AC_INIT(src/main.c) AM_INIT_AUTOMAKE(Scyther, 0.2, ccremers@win.tue.nl) -AC_CONFIG_SRCDIR([src/modelchecker.c]) - +AC_CONFIG_AUX_DIR(config) +AM_CONFIG_HEADER(config.h) +AC_CONFIG_SRCDIR(src) + +for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do + test -f $top_builddir/configure && break +done +AC_PROG_LIBTOOL + dnl find and test the C compiler AC_PROG_CC AC_LANG_C -AC_PROG_INSTALL +AC_PROG_INSTALL=$ac_aux_dir AC_PROG_MAKE_SET # Checks for header files. AC_HEADER_STDC AC_CHECK_HEADERS([limits.h malloc.h stddef.h stdlib.h strings.h unistd.h]) - # Checks for library functions. AC_FUNC_MALLOC AC_FUNC_REALLOC AC_CHECK_LIB(argtable2, arg_parse,,AC_MSG_ERROR(Scyther requires the argtable2 package (LGPL). Get it from http://argtable.sourceforge.net/)) AC_PROG_YACC -AM_PROG_LEX +AC_PROG_LEX +#AC_DECL_YYTEXT VERSION="0.0.1" -AC_SUBST(VERSION) -AC_CONFIG_AUX_DIR(config) +AC_SUBST(ac_aux_dir) +SUBDIRS = src dnl read Makefile.in and write Makefile -AC_OUTPUT(Makefile) +AC_OUTPUT(Makefile src/Makefile) diff --git a/src/Makefile b/src/Makefile deleted file mode 100644 index 28feff5..0000000 --- a/src/Makefile +++ /dev/null @@ -1,87 +0,0 @@ -# -# Scyther Makefile -# - -# -# DEBUG or optimization settings: uncomment a single line: -# -CFLAGS = -g3 -D DEBUG # default usage, for e.g. with valgrind -#CFLAGS = -g3 -D DEBUG -pg # for code profiling with gprof -#CFLAGS = -O3 -static -finline-functions -fomit-frame-pointer - -# -# Compiler and linkage -# -CC = gcc -# Note that these paths must include the path to the argtable library. -CPPFLAGS = -I/scratch/ccremers/include -I/usr/local/include -Wall -LDFLAGS = -L/scratch/ccremers/lib -L/usr/local/lib -LOADLIBS = -lfl -LDLIBS = -largtable2 -OPTIONS = ${CPPFLAGS} ${CFLAGS} ${LDFLAGS} - -# -# Module set for the modelchecker -# -MODULES=memory.o terms.o termlists.o symbols.o knowledge.o runs.o modelchecker.o \ -report.o debug.o mgu.o substitutions.o \ -match_basic.o \ -match_clp.o constraints.o \ -output.o latex.o \ -varbuf.o tracebuf.o attackminimize.o \ -tac.o parser.o compiler.o - -# -# Dependencies -# -MODELCHECKER = ${MODULES} main.o - -all: scyther tags - -${Target}.o: ${Target}.c - $(CC) $(OPTIONS) ${Target}.c -c - -scanner.c: scanner.l - flex scanner.l - cp lex.yy.c scanner.c - -tok.h: parser.c - -parser.c: parser.y - bison -d -v parser.y - cp parser.tab.c parser.c - cmp -s parser.tab.h tok.h || cp parser.tab.h tok.h - cmp -s parser.tab.h parser.h || cp parser.tab.h parser.h - -tags: *.c *.h - ctags *.c *.h - -modules: $(MODULES) - -scyther: scanner.o $(MODELCHECKER) - $(CC) $(OPTIONS) $(MODELCHECKER) -o scyther $(LOADLIBS) $(LDLIBS) - -ptestmain.o scanner.o : tok.h - -# -# Cleanup -# -clean: - rm -f *.o - rm -f scyther - rm -f scanner.c - rm -f parser.c - rm -f tok.h -# -# Clean and rebuild: 'make new' -# -new: - make clean - make all - -# -# Make doxygen reference manuals. (in ../refman) -# -refman: doxyconfig - doxygen doxyconfig - diff --git a/Makefile.am b/src/Makefile.am similarity index 90% rename from Makefile.am rename to src/Makefile.am index d2636d1..4493628 100644 --- a/Makefile.am +++ b/src/Makefile.am @@ -4,14 +4,13 @@ AM_CFLAGS = @CFLAGS@ bin_PROGRAMS = scyther scyther_SOURCES = main.c \ + scanner.l parser.y \ memory.c terms.c termlists.c symbols.c \ knowledge.c runs.c modelchecker.c \ report.c debug.c mgu.c substitutions.c \ match_basic.c match_clp.c constraints.c \ output.c latex.c varbuf.c tracebuf.c \ attackminimize.c tac.c \ - compiler.c \ - scanner.l parser.y + compiler.c scyther_LDADD = @LEXLIB@ - diff --git a/src/latex.c b/src/latex.c index 9dde12e..a0b9e37 100644 --- a/src/latex.c +++ b/src/latex.c @@ -912,7 +912,7 @@ attackDisplayLatex (System sys) /* put out computed widths */ - printf ("\\setlength{\\envinstdist}{0.5\\maxmscall}\n"); + printf ("\\setlength{\\envinstdist}{0.7\\maxmscall}\n"); printf ("\\setlength{\\instdist}{\\maxmscall}\n"); printf ("\\setlength{\\actionwidth}{\\maxmscaction}\n"); printf ("\\setlength{\\instwidth}{\\maxmscinst}\n"); diff --git a/src/main.c b/src/main.c index d514176..ff9bac7 100644 --- a/src/main.c +++ b/src/main.c @@ -36,7 +36,7 @@ #include "symbols.h" #include "pheading.h" #include "symbols.h" -#include "parser.h" +#include "parser.tab.h" #include "tac.h" #include "compiler.h" #include "latex.h" diff --git a/src/parser.y b/src/parser.y index 75b0b4b..52d3a91 100644 --- a/src/parser.y +++ b/src/parser.y @@ -1,6 +1,6 @@ %{ #include "pheading.h" -#include "scanner.c" +/* #include "lex.yy.c" */ #include "tac.h" struct tacnode* spdltac;