Date: Mon, 21 Jan 2013 17:04:13 +0000 (UTC) From: Pietro Cerutti <gahr@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r310774 - in head/lang/seed7: . files Message-ID: <201301211704.r0LH4DUT085881@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: gahr Date: Mon Jan 21 17:04:13 2013 New Revision: 310774 URL: http://svnweb.freebsd.org/changeset/ports/310774 Log: - Update to 05_20130120 Changes: * Interpreter and compiler have been improved to support the option *l. This option allows adding a directory to the include library search path (e.g.: -l ../lib). * The compiler (s7c) has been improved to support the option -b. With -b the directory of the Seed7 runtime libraries can be specified (e.g.: -b ../bin). * The target s7c in the makefiles has been changed to take advantage of the options -l and -b. Now packages can compile the Seed7 compiler without a post install step. * Additional function variants of parseFile, parseStri and execute have been added to the library progs.s7i. The new functions allow a detailed specification of parse and execution options. * The library gzip.s7c has been improved to decode also blocks with fixed Huffman codes. This type of block is almost never used since dynamic Huffman codes compress better. * The parsing of bigInteger literals has been improved to support literals with bases other than 10 (e.g.: 16#FEDCBA98765434210_). * The integer and bigInteger functions str (conversion to string) have been changed to use lower case characters for digits larger than 9. Now str(48879, 16) returns "beef" instead of "BEEF". * The program make7.sd7 and the library make.s7i have been improved to support multiple targets and the option -C. * The Seed7 compiler has been improved to generate special inline code for the case that the C floating point division by zero does not result in Infinity, -Infinity or NaN (not a number). * The functions chkLiteral and chkBitLength as well as checks for shifts with negative shift count have been added to the program chkbig.sd7. * The function check_division as well as has checks for the operator /:= (in check_nan) have been added to the program chkflt.sd7. * The function check_str in chkint.sd7 has been improved to check the new behaviour of the function str with a give base. * The makefile mk_clang.mak has been added to support compilation with the clang C compiler. * The explanations of possible compilation errors in src/read_me.txt have been improved. * The functions interpreterPath and callOwnProgram have been removed from the libraries environment.s7i respectively shell.s7i. This functions were not used in any example program. * The support for the interpreter option -m (use less memory during the analyzing phase) has been removed. On many systems it was a noop anyway. * Result variables have been renamed in various libraries and example programs. * The functions find_include_file, print_lib_path, append_to_lib_path and init_lib_path have been moved from infile.c to the new file libpath.c. * The function gen_rtl_array has been defined in the new file arrutl.c. The function is used in the files cmdlib.c (functions cmd_pipe2, cmd_pty, cmd_start_process) and prglib.c (functions prg_exec, prg_fil_parse, prg_str_parse). * The interpreter/compiler improvements (option -l) and the new function variants in progs.s7i have been realized with changes in prg_comp.c, analyze.c, data.h, infile.c, infile.h, info.c, option.h and s7.c. * The functions prgExec, prgFilParse and prgStrParse in prg_comp.c have been improved to support additional parse and execution options. * The function interpr has been renamed to interpret and moved from exec.c to prg_comp.c. * The function copy_args has been moved from prclib.c to prg_comp.c. * In traceutl.c the function set_trace has been changed and the function set_trace2 has been removed. The functions mapTraceFlags, mapTraceFlags2 and set_protfile_name have been added. * The functions uBigMultiplyAndAdd and bigParseBased have been added to big_rtl.c: * In big_gmp.c the functions bigBitLength, bigLShift, bigRShift, bigLShiftAssign, bigRShiftAssign, bigParse, and bigToInt32 have been improved and bigParseBased has been added. * To support bigInteger literals with base the file numlit.c has been Added: head/lang/seed7/files/patch-mk_clang.mak (contents, props changed) head/lang/seed7/files/patch-prg_chk_all.sd7 (contents, props changed) Modified: head/lang/seed7/Makefile head/lang/seed7/distinfo Modified: head/lang/seed7/Makefile ============================================================================== --- head/lang/seed7/Makefile Mon Jan 21 17:01:34 2013 (r310773) +++ head/lang/seed7/Makefile Mon Jan 21 17:04:13 2013 (r310774) @@ -2,7 +2,7 @@ # $FreeBSD$ PORTNAME= seed7 -DISTVERSION= 05_20130105 +DISTVERSION= 05_20130120 CATEGORIES= lang MASTER_SITES= SF/${PORTNAME}/${PORTNAME}/${DISTNAME}/ DISTNAME= ${PORTNAME}_${DISTVERSION} @@ -24,7 +24,7 @@ MAKE_ENV+= S7_LIB_DIR=${S7_LIB_DIR} \ SEED7_LIBRARY=${SEED7_LIBRARY} \ C_COMPILER=${CC} \ CPLUSPLUS_COMPILER=${CPP} -ALL_TARGET= depend s7 +ALL_TARGET= depend s7 s7c SEED7_LIBRARY= ${PREFIX}/lib/${PORTNAME}/lib S7_LIB_DIR= ${PREFIX}/lib/${PORTNAME}/bin @@ -41,14 +41,21 @@ PORTDOCS= * BROKEN= does not compile .endif +.if ${OSVERSION} >= 1000024 || ${CC} == clang +MAKEFILE= mk_clang.mak +.else +MAKEFILE= makefile +.endif + post-patch: - ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g;' ${WRKSRC}/makefile + ${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g;' ${WRKSRC}/makefile ${WRKSRC}/mk_clang.mak ${REINPLACE_CMD} -e '/FLOATTYPE_DOUBLE/s|undef|define|' ${WRKSRC}/config.h - ${REINPLACE_CMD} -i '' -e 's|./s7|${PREFIX}/bin/s7|g' ${WRKSRC}/../prg/chk_all.sd7 +# ${REINPLACE_CMD} -i '' -e 's|./s7|${PREFIX}/bin/s7|g' ${WRKSRC}/../prg/chk_all.sd7 do-install: -# install interpreter +# install interpreter and compiler ${INSTALL_PROGRAM} ${WRKSRC}/../bin/s7 ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/../prg/s7c ${PREFIX}/bin # install seed7 library ${INSTALL} -d ${SEED7_LIBRARY} cd ${WRKSRC}/../lib && ${COPYTREE_SHARE} '*.s7i' ${SEED7_LIBRARY} @@ -57,10 +64,6 @@ do-install: .for s7_lib in ${S7_LIBS} ${INSTALL_DATA} ${WRKSRC}/../bin/${s7_lib} ${S7_LIB_DIR} .endfor -# compile the seed7 compiler (needs the libraries to be installed) - cd ${WRKSRC} && ${GMAKE} s7c - ${INSTALL_PROGRAM} ${WRKSRC}/../prg/s7c ${PREFIX}/bin/s7c - ${RM} ${WRKSRC}/../prg/tmp_s7c.c ${WRKSRC}/../prg/s7c # install PORTDOCS .if ${PORT_OPTIONS:MDOCS} ${INSTALL} -d ${DOCSDIR} @@ -72,9 +75,9 @@ do-install: cd ${WRKSRC}/../prg && ${COPYTREE_SHARE} '*.dna *.sd7 *.dat *.s7i' ${EXAMPLESDIR} .endif -regression-test: ${INSTALL_TARGET} +regression-test: build @echo "" @echo "Testing the ${PORTNAME} installation" - @(cd ${WRKSRC}/../prg && ${PREFIX}/bin/s7 chk_all) + @(cd ${WRKSRC}/../prg && ${WRKSRC}/../bin/s7 -l ${WRKSRC}/../lib chk_all build) .include <bsd.port.post.mk> Modified: head/lang/seed7/distinfo ============================================================================== --- head/lang/seed7/distinfo Mon Jan 21 17:01:34 2013 (r310773) +++ head/lang/seed7/distinfo Mon Jan 21 17:04:13 2013 (r310774) @@ -1,2 +1,2 @@ -SHA256 (seed7_05_20130105.tgz) = 72c166e1854acc4b424b512a44793c8f7ad392e710274a44aacbd2dcc9f5f28b -SIZE (seed7_05_20130105.tgz) = 1806154 +SHA256 (seed7_05_20130120.tgz) = ddf142b0f79e0ff2cd6d25472bf39f2389bf42f01686d2e6d25c9f6f267c8142 +SIZE (seed7_05_20130120.tgz) = 1821907 Added: head/lang/seed7/files/patch-mk_clang.mak ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/seed7/files/patch-mk_clang.mak Mon Jan 21 17:04:13 2013 (r310774) @@ -0,0 +1,29 @@ +--- mk_clang.mak.orig 2013-01-21 11:50:32.000000000 +0100 ++++ mk_clang.mak 2013-01-21 11:52:56.000000000 +0100 +@@ -10,7 +10,7 @@ + # CFLAGS = -O2 -g -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar -Wc++-compat + # CFLAGS = -O2 -g -x c++ -Wall -Wextra -Wswitch-default -Wswitch-enum -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar + # CFLAGS = -O2 -fomit-frame-pointer -Wall -Wextra -Wswitch-default -Wcast-qual -Waggregate-return -Wwrite-strings -Winline -Wconversion -Wshadow -Wpointer-arith -Wmissing-noreturn -Wno-multichar +-CFLAGS = -O2 -g -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv ++CFLAGS += -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv -I%%LOCALBASE%%/include + # CFLAGS = -O2 -g -x c++ -Wall -Winline -Wconversion -Wshadow -Wpointer-arith -ftrapv + # CFLAGS = -O2 -g -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith + # CFLAGS = -O2 -g -Wall -Winline -Wconversion -Wshadow -Wpointer-arith +@@ -18,7 +18,7 @@ + # CFLAGS = -O2 -g -pg -Wall -Wstrict-prototypes -Winline -Wconversion -Wshadow -Wpointer-arith + # CFLAGS = -O2 -fomit-frame-pointer -funroll-loops -Wall + # CFLAGS = -O2 -funroll-loops -Wall -pg +-LDFLAGS = ++LDFLAGS = -L%%LOCALBASE%%/lib + # LDFLAGS = -pg + # LDFLAGS = -pg -lc_p + SYSTEM_LIBS = -lm +@@ -37,7 +37,7 @@ + COMPILER_LIB = s7_comp.a + ALL_S7_LIBS = ../bin/$(COMPILER_LIB) ../bin/$(COMP_DATA_LIB) ../bin/$(DRAW_LIB) ../bin/$(CONSOLE_LIB) ../bin/$(SEED7_LIB) + # CC = g++ +-CC = clang ++CC ?= clang + GET_CC_VERSION_INFO = $(CC) --version > + + BIGINT_LIB_DEFINE = USE_BIG_RTL_LIBRARY Added: head/lang/seed7/files/patch-prg_chk_all.sd7 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/lang/seed7/files/patch-prg_chk_all.sd7 Mon Jan 21 17:04:13 2013 (r310774) @@ -0,0 +1,92 @@ +--- ../prg/chk_all.sd7.orig 2013-01-21 17:05:47.000000000 +0100 ++++ ../prg/chk_all.sd7 2013-01-21 17:04:54.000000000 +0100 +@@ -30,6 +30,11 @@ + const string: OBJECT_FILE_EXTENSION is configValue("OBJECT_FILE_EXTENSION"); + const string: EXECUTABLE_FILE_EXTENSION is configValue("EXECUTABLE_FILE_EXTENSION"); + ++var string: interpretProgram is "./s7 -q "; ++var string: interpretCompiler is "./s7 s7c "; ++var string: executeCompiler is "./s7c "; ++var string: s7compiler is "./s7c" & EXECUTABLE_FILE_EXTENSION; ++ + const string: chkint_output is "\n\ + \Integer literals with exponent work correct.\n\ + \Based integer literals work correct.\n\ +@@ -234,7 +239,7 @@ + begin + write(progName); + flush(OUT); +- interpretedOutput := cmdOutput("./s7 -q " & progName); ++ interpretedOutput := cmdOutput(interpretProgram & progName); + if interpretedOutput <> referenceOutput then + writeln; + writeln(" *** The interpreted " <& progName <& " does not work okay:"); +@@ -244,7 +249,7 @@ + if fileType(progName & EXECUTABLE_FILE_EXTENSION) <> FILE_ABSENT then + removeFile(progName & EXECUTABLE_FILE_EXTENSION); + end if; +- compilerOutput := cmdOutput("./s7 s7c " & progName); ++ compilerOutput := cmdOutput(interpretCompiler & progName); + if fileType(progName & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then + compiledOutput := cmdOutput("./" & progName); + if compiledOutput <> referenceOutput then +@@ -284,7 +289,7 @@ + end if; + okay := FALSE; + end if; +- if fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then ++ if fileType(s7compiler) = FILE_REGULAR then + if fileType("tmp_" & progName & ".c") = FILE_REGULAR then + if fileType("tmp1_" & progName & ".c") = FILE_REGULAR then + removeFile("tmp1_" & progName & ".c"); +@@ -294,7 +299,7 @@ + if fileType(progName & EXECUTABLE_FILE_EXTENSION) <> FILE_ABSENT then + removeFile(progName & EXECUTABLE_FILE_EXTENSION); + end if; +- compilerOutput := cmdOutput("./s7c " & progName); ++ compilerOutput := cmdOutput(executeCompiler & progName); + if fileType(progName & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then + if fileType("tmp1_" & progName & ".c") = FILE_REGULAR then + if not equalFiles("tmp_" & progName & ".c", "tmp1_" & progName & ".c") then +@@ -327,17 +332,31 @@ + + const proc: main is func + begin +- if fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then +- removeFile("s7c" & EXECUTABLE_FILE_EXTENSION); +- end if; +- write("compiling the compiler"); +- flush(OUT); +- ignore(cmdOutput("./s7 s7c s7c")); +- if not fileType("s7c" & EXECUTABLE_FILE_EXTENSION) = FILE_REGULAR then +- writeln; +- writeln(" *** Failed to compile the compiler"); ++ if length(argv(PROGRAM)) = 1 and argv(PROGRAM)[1] = "build" then ++ interpretProgram := "../bin/s7 -l ../lib -q "; ++ interpretCompiler := "../bin/s7 -l ../lib s7c -l ../lib -b ../bin "; ++ executeCompiler := "../bin/s7c -l ../lib -b ../bin "; ++ s7compiler := "../bin/s7c" & EXECUTABLE_FILE_EXTENSION; ++ write("checking for presence of " <& s7compiler); ++ if not fileType(s7compiler) = FILE_REGULAR then ++ writeln; ++ writeln(" *** No Seed7 compiler executable found"); ++ else ++ writeln(" - okay"); ++ end if; + else +- writeln(" - okay"); ++ if fileType(s7compiler) = FILE_REGULAR then ++ removeFile(s7compiler); ++ end if; ++ write("compiling the compiler"); ++ flush(OUT); ++ ignore(cmdOutput(interpretCompiler & "s7c")); ++ if not fileType(s7compiler) = FILE_REGULAR then ++ writeln; ++ writeln(" *** Failed to compile the compiler"); ++ else ++ writeln(" - okay"); ++ end if; + end if; + check("chkint", chkint_output); + check("chkflt", chkflt_output);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201301211704.r0LH4DUT085881>