debian/0000755000000000000000000000000011760774331007177 5ustar debian/manpages0000644000000000000000000000001711760774331010713 0ustar debian/mwrap.1 debian/examples0000644000000000000000000000013311760774331010735 0ustar example/README example/Makefile example/eventq example/eventq2 example/foobar example/zlib debian/source/0000755000000000000000000000000011760774331010477 5ustar debian/source/format0000644000000000000000000000001411760774331011705 0ustar 3.0 (quilt) debian/clean0000644000000000000000000000026111760774331010203 0ustar testing/test_fortran1mex.cc testing/test_fortran2mex.c testing/test_include.m testing/test_includemex.cc testing/test_syntax.log mwrap.aux mwrap.fdb_latexmk mwrap.log mwrap.pdf debian/doc-base0000644000000000000000000000026711760774331010604 0ustar Document: mwrap Title: MWrap user guide Author: D. Bindel Abstract: This manual describes how to use MWrap Section: Programming Format: PDF Files: /usr/share/doc/mwrap/mwrap.pdf.gz debian/patches/0000755000000000000000000000000011760774331010626 5ustar debian/patches/fix-makefile.patch0000644000000000000000000000534211760774331014214 0ustar Description: Fix Makefile Add an install target, use the implicit rules Author: Nicolas Bourdaud Origin: vendor Forwarded: no Last-Update: 2012-05-11 --- a/Makefile +++ b/Makefile @@ -17,3 +17,7 @@ realclean: clean (cd src; make realclean) + +install: + mkdir -p $(DESTDIR)/usr/bin + install mwrap $(DESTDIR)/usr/bin --- a/make.inc +++ b/make.inc @@ -10,8 +10,8 @@ # Uncomment this line for C99 complex support TESTC99COMPLEX=test_c99_complex -CC= gcc -CXX= g++ +#CC= gcc +#CXX= g++ MEX= mex $(OOFLAG) # Use the following for 64-bit MEX --- a/src/Makefile +++ b/src/Makefile @@ -4,40 +4,31 @@ # === Primary targets === ../mwrap: mwrap.o lex.yy.o mwrap-ast.o mwrap-typecheck.o \ - mwrap-mgen.o mwrap-cgen.o mwrap-ast.h - $(CXX) -o ../mwrap mwrap.o mwrap-ast.o \ - mwrap-typecheck.o mwrap-mgen.o mwrap-cgen.o \ - lex.yy.o + mwrap-mgen.o mwrap-cgen.o + $(CXX) $(LDFLAGS) -o $@ $^ -mwrap.o: mwrap.cc lex.yy.c mwrap-ast.h - $(CXX) -c mwrap.cc +mwrap.o: mwrap.cc mwrap-ast.h mwrap.cc: mwrap.y $(BISON) -d -v mwrap.y -o mwrap.cc lex.yy.o: lex.yy.c - $(CC) -c lex.yy.c lex.yy.c: mwrap.l $(FLEX) mwrap.l mwrap-ast.o: mwrap-ast.cc mwrap-ast.h - $(CXX) -c -g mwrap-ast.cc mwrap-typecheck.o: mwrap-typecheck.cc mwrap-ast.h - $(CXX) -c -g mwrap-typecheck.cc mwrap-cgen.o: mwrap-cgen.cc mwrap-ast.h mwrap-support.h - $(CXX) -c -g mwrap-cgen.cc mwrap-mgen.o: mwrap-mgen.cc mwrap-ast.h - $(CXX) -c -g mwrap-mgen.cc mwrap-support.h: mwrap-support.c stringify ./stringify mex_header < mwrap-support.c > mwrap-support.h stringify: stringify.c - gcc -o stringify stringify.c # === Clean-up targets === @@ -49,4 +40,3 @@ realclean: clean rm -f lex.yy.c mwrap.cc mwrap.hh mwrap-support.h mwrap.pdf - --- a/testing/Makefile +++ b/testing/Makefile @@ -25,11 +25,11 @@ $(MEX) test_c99_complexmex.c test_syntax: - - ../mwrap -cppcomplex test_syntax.mw >& test_syntax.log + - ../mwrap -cppcomplex test_syntax.mw 2> test_syntax.log diff test_syntax.log test_syntax.ref test_typecheck: - - ../mwrap -cppcomplex test_typecheck.mw >& test_typecheck.log + - ../mwrap -cppcomplex test_typecheck.mw 2> test_typecheck.log diff test_typecheck.log test_typecheck.ref test_catch: @@ -63,9 +63,11 @@ $(MEX) test_includemex.cc clean: - rm -f *~ *.mex* *.o* test_typecheck.log + rm -f *~ *.mex* *.o* test_typecheck.log test_syntax.log rm -f test_fortran1.m test_fortran2.m test_transfers.m test_catch.m + rm -f test_fortran1mex.cc test_fortran2mex.c rm -f test_cpp_complex.m test_c99_complex.m rm -f test_transfersmex.cc test_catchmex.cc test_fortranmex.cc rm -f test_cpp_complexmex.cc test_c99_complexmex.c rm -f test_redirect.m test_redirect1.m + rm -f test_include.m test_includemex.cc debian/patches/fix-build-error.patch0000644000000000000000000000315111760774331014661 0ustar Description: Fix build error Author: Nicolas Bourdaud Origin: vendor Forwarded: no Last-Update: 2012-05-11 --- a/src/mwrap.y +++ b/src/mwrap.y @@ -15,7 +15,7 @@ extern "C" { int yylex(); int yywrap(); - int yyerror(char* s); + int yyerror(const char* s); } using std::string; @@ -33,7 +33,7 @@ static int func_id = 0; // Assign stub numbers static Func* funcs = 0; // AST - linked list of functions static Func* lastfunc = 0; // Last link in funcs list -static char* mexfunc = "mexfunction"; // Name of mex function +static const char* mexfunc = "mexfunction"; // Name of mex function static string current_ifname; // Current input file name @@ -230,7 +230,7 @@ return 1; } -int yyerror(char* s) +int yyerror(const char* s) { fprintf(stderr, "Parse error (%s:%d): %s\n", current_ifname.c_str(), linenum, s); @@ -265,7 +266,7 @@ init_scalar_types(); if (argc == 1) { - fprintf(stderr, help_string); + fputs(help_string, stderr); return 0; } else { for (j = 1; j < argc; ++j) { --- a/src/mwrap-cgen.cc +++ b/src/mwrap-cgen.cc @@ -1329,8 +1329,8 @@ void print_mex_file(FILE* fp, Func* f) { - fprintf(fp, mwrap_banner); - fprintf(fp, mex_header); + fputs(mwrap_banner, fp); + fputs(mex_header, fp); if (mw_use_c99_complex) mex_c99_complex(fp); @@ -1346,7 +1346,7 @@ } print_mex_stubs(fp, f); - fprintf(fp, mexBase); + fputs(mexBase, fp); print_mex_else_cases(fp, f); fprintf(fp, "}\n\n"); } debian/patches/series0000644000000000000000000000012611760774331012042 0ustar fix-makefile.patch fix-build-error.patch fix-doc-build.patch examples-makefiles.patch debian/patches/fix-doc-build.patch0000644000000000000000000000176011760774331014301 0ustar Description: Fix documentation generation Modify doc/mwrap.tex to use fancyhdr, create a target in Makefile to build mwrap.pdf and to clean it. Author: Nicolas Bourdaud Origin: vendor Forwarded: no Last-Update: 2012-05-17 --- a/doc/mwrap.tex +++ b/doc/mwrap.tex @@ -1,6 +1,6 @@ \documentclass[12pt]{article} \usepackage{amsmath} -\usepackage{fancyheadings} +\usepackage{fancyhdr} \setlength{\oddsidemargin}{0.0in} \setlength{\textwidth}{6.5in} @@ -17,8 +17,8 @@ \pagestyle{fancy} -\headrulewidth 1.5pt -\footrulewidth 1.5pt +\renewcommand{\headrulewidth}{1.5pt} +\renewcommand{\footrulewidth}{1.5pt} \chead{\mwrap} \lhead{} \rhead{} --- a/Makefile +++ b/Makefile @@ -1,5 +1,7 @@ include make.inc +all: bin mwrap.pdf + bin: (cd src; make) @@ -9,8 +11,12 @@ demo: (cd example; make) +mwrap.pdf: + latexmk -pdf doc/mwrap.tex + clean: rm -f mwrap + latexmk -C doc/mwrap.tex (cd src; make clean) (cd example; make clean) (cd testing; make clean) debian/patches/examples-makefiles.patch0000644000000000000000000000332411760774331015425 0ustar Description: Make examples Makefile installable This patch modifies the Makefile in examples in order to avoid them to rely on the source package hierachy, thus making them usable in examples in the binary package. Author: Nicolas Bourdaud Origin: vendor Forwarded: not-needed Last-Update: 2012-05-28 --- a/example/Makefile +++ b/example/Makefile @@ -3,11 +3,9 @@ (cd eventq; make) (cd eventq2; make) (cd zlib; make) - (cd fem; make) clean: (cd foobar; make clean) (cd eventq; make clean) (cd eventq2; make clean) (cd zlib; make clean) - (cd fem; make clean) --- a/example/eventq/Makefile +++ b/example/eventq/Makefile @@ -1,5 +1,5 @@ -include ../../make.inc -MW=../../mwrap +MEX ?= mkoctfile --mex +MW = mwrap all: pmex cmex hmex --- a/example/eventq2/Makefile +++ b/example/eventq2/Makefile @@ -1,5 +1,5 @@ -include ../../make.inc -MW=../../mwrap +MEX ?= mkoctfile --mex +MW = mwrap mex: $(MW) -mex eventq2mex -c eventq2mex.cc -mb eventq2.mw --- a/example/foobar/Makefile +++ b/example/foobar/Makefile @@ -1,5 +1,5 @@ -include ../../make.inc -MW=../../mwrap +MEX ?= mkoctfile --mex +MW = mwrap all: $(MW) -mex fbmex -m foobar.m foobar.mw --- a/example/zlib/Makefile +++ b/example/zlib/Makefile @@ -1,6 +1,6 @@ # See www.zlib.net -include ../../make.inc -MW=../../mwrap +MEX ?= mkoctfile --mex +MW = mwrap gzmex: $(MW) -mex gzmex -mb gzfile.mw --- /dev/null +++ b/example/README @@ -0,0 +1,5 @@ +These examples require to have a mex compiler installed. It can be provided +either by Octave (package liboctave-dev) or MATLAB. + +By default it will try to use the Octave compiler (mkoctfile --mex) but it +can be redefined to another one by setting the environment variable MEX. debian/rules0000755000000000000000000000006211760774331010255 0ustar #!/usr/bin/make -f # -*- makefile -*- %: dh $@ debian/changelog0000644000000000000000000000054711760774331011057 0ustar mwrap (0.33-1) unstable; urgency=low [ Nicolas Bourdaud ] * Initial release. (Closes: #673318) * Add Sébastien Villemot to uploaders list and enable DM-upload * Install examples [ Thomas Weber ] * Add Thomas Weber to Uploaders * Recommend 'octave' for the binary package -- Thomas Weber Tue, 29 May 2012 00:14:33 +0200 debian/compat0000644000000000000000000000000211760774331010375 0ustar 9 debian/mwrap.10000644000000000000000000000417111760774331010412 0ustar .TH MWRAP 1 2012 "mwrap" "MWRAP manpage" .SH NAME mwrap - Octave/MATLAB mex generator .SH SYNOPSIS .SY mwrap .OP \-mex \fIoutputmex\fP .OP \-m \fIoutput.m\fP .OP \-c \fIoutputmex.c\fP .OP \-mb .OP \-list .OP \-catch .OP \-c99complex .OP \-cppcomplex \fIinfile1\fP \fIinfile2\fP ... .br .SH DESCRIPTION .LP \fBmwrap\fP is an interface generation system in the spirit of SWIG or matwrap. From a set of augmented Octave/MATLAB script files, \fBmwrap\fP will generate a MEX gateway to desired C/C++ function calls and \.m function files to access that gateway. The details of converting to and from Octave's or MATLAB's data structures, and of allocating and freeing temporary storage, are hidden from the user. .SH OPTIONS .TP .B \-mex specifies the name of the MEX function that the generated functions will call. This name will generally be the same as the prefix for the C/C++ output file name. . .TP .B \-m specifies the name of the Octave/MATLAB script to be generated. . .TP .B \-c specifies the name of the C MEX file to be generated. The MEX file may contain stubs corresponding to several different generated files. . .TP .B \-mb redirect Octave/MATLAB function output to files named in the input. In this mode, the processor will change Octave/MATLAB function output files whenever it encounters a line beginning with @. If @ occurs alone on a line, the output will be turned off; if the line begins with @function, the line will be treated as the first line of a function, and the m-file name will be deduced from the function name; and otherwise, the characters after @ (up to the next set of white space) will be treated as a filename, and \fBmwrap\fP will try to write to that file. . .TP .B \-list print to the standard output the names of all files that would be generated from redirect output by the \-mb flag. . .TP .B \-catch surround library calls in try/catch blocks in order to intercept C++ exceptions. . .TP .B \-c99complex use the C99 complex floating point types as the default \fBdcomplex\fP and \fBfcomplex\fP types. . .TP .B \-cppcomplex use the C++ complex floating point types as the default \fBdcomplex\fP and \fBfcomplex\fP types. debian/copyright0000644000000000000000000000302511760774331011132 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: MWrap Upstream-Contact: David Bindel Source: http://www.cims.nyu.edu/~dbindel/mwrap/ Files: * Copyright: 2007-2011, David Bindel License: MIT Files: debian/* Copyright: 2012, Nicolas Bourdaud License: MIT License: MIT Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . You may distribute a work that contains part or all of the source code generated by mwrap under the terms of your choice. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. debian/watch0000644000000000000000000000011311760774331010223 0ustar version=3 http://www.cs.cornell.edu/~bindel/sw/mwrap/mwrap-([\d.]*).tar.gz debian/docs0000644000000000000000000000002611760774331010050 0ustar NEWS README mwrap.pdf debian/control0000644000000000000000000000210711760774331010602 0ustar Source: mwrap Section: devel Priority: extra Maintainer: Debian Octave Group Uploaders: Nicolas Bourdaud , Sébastien Villemot , Thomas Weber DM-Upload-Allowed: yes Build-Depends: debhelper (>= 9), bison, flex, liboctave-dev, latexmk Standards-Version: 3.9.3 Homepage: http://www.cims.nyu.edu/~dbindel/mwrap/ Vcs-Git: git://anonscm.debian.org/pkg-octave/mwrap.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=pkg-octave/mwrap.git Package: mwrap Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: octave Description: Octave/MATLAB mex generator MWrap is an interface generation system in the spirit of SWIG or matwrap. From a set of augmented Octave/MATLAB script files, MWrap will generate a MEX gateway to desired C/C++ function calls and Octave/MATLAB function files to access that gateway. The details of converting to and from Octave/MATLAB's data structures, and of allocating and freeing temporary storage, are hidden from the user.