pax_global_header00006660000000000000000000000064127120525570014520gustar00rootroot0000000000000052 comment=3a397a1bbde86793020a86cfd63b6679d5bd9019 GPX-2.5.2/000077500000000000000000000000001271205255700121645ustar00rootroot00000000000000GPX-2.5.2/.gitignore000066400000000000000000000003471271205255700141600ustar00rootroot00000000000000*.pyc *~ \#*\# dmg *.dmg *.gz *.zip *.o *.so *.svn .DS_Store *.sh gpx.exe osx_obj linux_obj win32_obj win64_obj cscope.out tags *.egg-info build dist machines stamp-h1 Makefile s3gdump config.log config.status autom4te.cache .deps GPX-2.5.2/.travis.yml000066400000000000000000000000301271205255700142660ustar00rootroot00000000000000language: c sudo: false GPX-2.5.2/AUTHORS.md000066400000000000000000000004521271205255700136340ustar00rootroot00000000000000# Authors GPX was originally written by Dr. Henry Thomas (aka Wingcommander) in April 2013 The following people have subsequently contributed to GPX's code base: * [DNewman](https://github.com/dcnewman) * [Mark Walker](https://github.com/markwal) * [Chow Loong Jin](https://github.com/hyperair) GPX-2.5.2/LICENSE000066400000000000000000000432541271205255700132010ustar00rootroot00000000000000 GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Lesser General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Lesser General Public License instead of this License. GPX-2.5.2/Makefile.am000066400000000000000000000047671271205255700142360ustar00rootroot00000000000000# Build GPX, build GPX distributions # Dan Newman, February 2015 # autotools by Mark Walker, April 2016 # # mkdir build -- create build folder, name it whatever you like # cd build # ../configure -- analyze your system to create the Makefiles # make -- compile gpx and utilities # sudo make install -- install gpx and utilities, defaults to /usr/local/bin # # for a cross compile, give the --host parameter to ../configure # ../configure host=i686-w64-mingw32 -- build a Makefile for win32 cross-compile # ../configure host=x86_64-w64-mingw32 -- build a Makefile for win64 cross-compile # # make dist -- create a source distribution archive # make bdist -- create a distribution archive that includes the built programs # make clean -- remove the build directories but retain distributions # make distclean -- remove the build directories and distributions EXTRA_DIST = examples scripts README.md src/shared SUBDIRS = src/gpx src/utils AM_CPPFLAGS = -Wall -I$(top_srcdir)/src/shared .PHONY : first debug release bdistdir bdist first debug release: all bdistdir = $(PACKAGE)-$(VERSION)-$(PLATFORM) remove_bdistdir = \ if test -d "$(bdistdir)"; then \ find "$(bdistdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(bdistdir)" \ || { sleep 5 && rm -rf "$(bdistdir)"; }; \ else :; fi BINARIES = $(builddir)/src/gpx/gpx$(EXEEXT) $(builddir)/src/utils/machines$(EXEEXT) $(builddir)/src/utils/s3gdump$(EXEEXT) $(builddir)/machine_inis: $(MKDIR_P) $(builddir)/machine_inis/ machines $(builddir)/machine_inis/ bdistdir: $(BINARIES) $(builddir)/machine_inis $(MKDIR_P) $(bdistdir) if HAVE_SIGNOSX list='$(BINARIES)'; \ for file in $$list; do \ $(SIGNOSX) $$file; \ done endif @list='$(BINARIES)'; \ for file in $$list; do \ cp $$file $(bdistdir); \ done cp -r $(srcdir)/examples $(bdistdir) cp -r $(builddir)/machine_inis $(bdistdir) cp -r $(srcdir)/scripts $(bdistdir) chmod -R a+rwx $(bdistdir) bdist-gzip: bdistdir tardir=$(bdistdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(bdistdir).tar.gz $(remove_bdistdir) bdist-xz: bdistdir tardir=$(bdistdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(bdistdir).tar.xz $(remove_bdistdir) bdist-zip: bdistdir -rm -f $(bdistdir).zip zip -rq $(bdistdir).zip $(bdistdir) $(remove_bdistdir) if HAVE_CREATEDMG bdist-dmg: bdistdir $(CREATEDMG) $(bdistdir) $(bdistdir).dmg $(remove_bdistdir) endif bdist: $(MAKE) $(AM_MAKEFLAGS) $(BDIST_TARGET) remove_bdistdir='@:' $(remove_bdistdir) GPX-2.5.2/Makefile.in000066400000000000000000000662701271205255700142440ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Build GPX, build GPX distributions # Dan Newman, February 2015 # autotools by Mark Walker, April 2016 # # mkdir build -- create build folder, name it whatever you like # cd build # ../configure -- analyze your system to create the Makefiles # make -- compile gpx and utilities # sudo make install -- install gpx and utilities, defaults to /usr/local/bin # # for a cross compile, give the --host parameter to ../configure # ../configure host=i686-w64-mingw32 -- build a Makefile for win32 cross-compile # ../configure host=x86_64-w64-mingw32 -- build a Makefile for win64 cross-compile # # make dist -- create a source distribution archive # make bdist -- create a distribution archive that includes the built programs # make clean -- remove the build directories but retain distributions # make distclean -- remove the build directories and distributions VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ subdir = . ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(top_srcdir)/configure \ $(am__configure_deps) $(am__DIST_COMMON) am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \ configure.lineno config.status.lineno mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/shared/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = SOURCES = DIST_SOURCES = RECURSIVE_TARGETS = all-recursive check-recursive cscopelist-recursive \ ctags-recursive dvi-recursive html-recursive info-recursive \ install-data-recursive install-dvi-recursive \ install-exec-recursive install-html-recursive \ install-info-recursive install-pdf-recursive \ install-ps-recursive install-recursive installcheck-recursive \ installdirs-recursive pdf-recursive ps-recursive \ tags-recursive uninstall-recursive am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive am__recursive_targets = \ $(RECURSIVE_TARGETS) \ $(RECURSIVE_CLEAN_TARGETS) \ $(am__extra_recursive_targets) AM_RECURSIVE_TARGETS = $(am__recursive_targets:-recursive=) TAGS CTAGS \ cscope distdir dist dist-all distcheck am__extra_recursive_targets = test-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags CSCOPE = cscope DIST_SUBDIRS = $(SUBDIRS) am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/compile \ $(top_srcdir)/build-aux/config.guess \ $(top_srcdir)/build-aux/config.sub \ $(top_srcdir)/build-aux/install-sh \ $(top_srcdir)/build-aux/missing \ $(top_srcdir)/src/shared/config.h.in build-aux/compile \ build-aux/config.guess build-aux/config.sub build-aux/depcomp \ build-aux/install-sh build-aux/missing DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) distdir = $(PACKAGE)-$(VERSION) top_distdir = $(distdir) am__remove_distdir = \ if test -d "$(distdir)"; then \ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(distdir)" \ || { sleep 5 && rm -rf "$(distdir)"; }; \ else :; fi am__post_remove_distdir = $(am__remove_distdir) am__relativize = \ dir0=`pwd`; \ sed_first='s,^\([^/]*\)/.*$$,\1,'; \ sed_rest='s,^[^/]*/*,,'; \ sed_last='s,^.*/\([^/]*\)$$,\1,'; \ sed_butlast='s,/*[^/]*$$,,'; \ while test -n "$$dir1"; do \ first=`echo "$$dir1" | sed -e "$$sed_first"`; \ if test "$$first" != "."; then \ if test "$$first" = ".."; then \ dir2=`echo "$$dir0" | sed -e "$$sed_last"`/"$$dir2"; \ dir0=`echo "$$dir0" | sed -e "$$sed_butlast"`; \ else \ first2=`echo "$$dir2" | sed -e "$$sed_first"`; \ if test "$$first2" = "$$first"; then \ dir2=`echo "$$dir2" | sed -e "$$sed_rest"`; \ else \ dir2="../$$dir2"; \ fi; \ dir0="$$dir0"/"$$first"; \ fi; \ fi; \ dir1=`echo "$$dir1" | sed -e "$$sed_rest"`; \ done; \ reldir="$$dir2" DIST_ARCHIVES = $(distdir).tar.gz GZIP_ENV = --best DIST_TARGETS = dist-gzip distuninstallcheck_listfiles = find . -type f -print am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$' distcleancheck_listfiles = find . -type f -print ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDIST_TARGET = @BDIST_TARGET@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CREATEDMG = @CREATEDMG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLATFORM = @PLATFORM@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGNOSX = @SIGNOSX@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ EXTRA_DIST = examples scripts README.md src/shared SUBDIRS = src/gpx src/utils AM_CPPFLAGS = -Wall -I$(top_srcdir)/src/shared bdistdir = $(PACKAGE)-$(VERSION)-$(PLATFORM) remove_bdistdir = \ if test -d "$(bdistdir)"; then \ find "$(bdistdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \ && rm -rf "$(bdistdir)" \ || { sleep 5 && rm -rf "$(bdistdir)"; }; \ else :; fi BINARIES = $(builddir)/src/gpx/gpx$(EXEEXT) $(builddir)/src/utils/machines$(EXEEXT) $(builddir)/src/utils/s3gdump$(EXEEXT) all: all-recursive .SUFFIXES: am--refresh: Makefile @: $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ echo ' cd $(srcdir) && $(AUTOMAKE) --foreign'; \ $(am__cd) $(srcdir) && $(AUTOMAKE) --foreign \ && exit 0; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ echo ' $(SHELL) ./config.status'; \ $(SHELL) ./config.status;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) $(SHELL) ./config.status --recheck $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) $(am__cd) $(srcdir) && $(AUTOCONF) $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) $(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS) $(am__aclocal_m4_deps): src/shared/config.h: src/shared/stamp-h1 @test -f $@ || rm -f src/shared/stamp-h1 @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) src/shared/stamp-h1 src/shared/stamp-h1: $(top_srcdir)/src/shared/config.h.in $(top_builddir)/config.status @rm -f src/shared/stamp-h1 cd $(top_builddir) && $(SHELL) ./config.status src/shared/config.h $(top_srcdir)/src/shared/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) ($(am__cd) $(top_srcdir) && $(AUTOHEADER)) rm -f src/shared/stamp-h1 touch $@ distclean-hdr: -rm -f src/shared/config.h src/shared/stamp-h1 # This directory's subdirectories are mostly independent; you can cd # into them and run 'make' without going through this Makefile. # To change the values of 'make' variables: instead of editing Makefiles, # (1) if the variable is set in 'config.status', edit 'config.status' # (which will cause the Makefiles to be regenerated when you run 'make'); # (2) otherwise, pass the desired values on the 'make' command line. $(am__recursive_targets): @fail=; \ if $(am__make_keepgoing); then \ failcom='fail=yes'; \ else \ failcom='exit 1'; \ fi; \ dot_seen=no; \ target=`echo $@ | sed s/-recursive//`; \ case "$@" in \ distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \ *) list='$(SUBDIRS)' ;; \ esac; \ for subdir in $$list; do \ echo "Making $$target in $$subdir"; \ if test "$$subdir" = "."; then \ dot_seen=yes; \ local_target="$$target-am"; \ else \ local_target="$$target"; \ fi; \ ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \ || eval $$failcom; \ done; \ if test "$$dot_seen" = "no"; then \ $(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \ fi; test -z "$$fail" test-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-recursive TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \ include_option=--etags-include; \ empty_fix=.; \ else \ include_option=--include; \ empty_fix=; \ fi; \ list='$(SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ test ! -f $$subdir/TAGS || \ set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \ fi; \ done; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-recursive CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscope: cscope.files test ! -s cscope.files \ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS) clean-cscope: -rm -f cscope.files cscope.files: clean-cscope cscopelist cscopelist: cscopelist-recursive cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags -rm -f cscope.out cscope.in.out cscope.po.out cscope.files distdir: $(DISTFILES) $(am__remove_distdir) test -d "$(distdir)" || mkdir "$(distdir)" @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done @list='$(DIST_SUBDIRS)'; for subdir in $$list; do \ if test "$$subdir" = .; then :; else \ $(am__make_dryrun) \ || test -d "$(distdir)/$$subdir" \ || $(MKDIR_P) "$(distdir)/$$subdir" \ || exit 1; \ dir1=$$subdir; dir2="$(distdir)/$$subdir"; \ $(am__relativize); \ new_distdir=$$reldir; \ dir1=$$subdir; dir2="$(top_distdir)"; \ $(am__relativize); \ new_top_distdir=$$reldir; \ echo " (cd $$subdir && $(MAKE) $(AM_MAKEFLAGS) top_distdir="$$new_top_distdir" distdir="$$new_distdir" \\"; \ echo " am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)"; \ ($(am__cd) $$subdir && \ $(MAKE) $(AM_MAKEFLAGS) \ top_distdir="$$new_top_distdir" \ distdir="$$new_distdir" \ am__remove_distdir=: \ am__skip_length_check=: \ am__skip_mode_fix=: \ distdir) \ || exit 1; \ fi; \ done -test -n "$(am__skip_mode_fix)" \ || find "$(distdir)" -type d ! -perm -755 \ -exec chmod u+rwx,go+rx {} \; -o \ ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \ ! -type d ! -perm -400 -exec chmod a+r {} \; -o \ ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \ || chmod -R a+r "$(distdir)" dist-gzip: distdir tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz $(am__post_remove_distdir) dist-bzip2: distdir tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2 $(am__post_remove_distdir) dist-lzip: distdir tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz $(am__post_remove_distdir) dist-xz: distdir tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz $(am__post_remove_distdir) dist-tarZ: distdir @echo WARNING: "Support for distribution archives compressed with" \ "legacy program 'compress' is deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z $(am__post_remove_distdir) dist-shar: distdir @echo WARNING: "Support for shar distribution archives is" \ "deprecated." >&2 @echo WARNING: "It will be removed altogether in Automake 2.0" >&2 shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz $(am__post_remove_distdir) dist-zip: distdir -rm -f $(distdir).zip zip -rq $(distdir).zip $(distdir) $(am__post_remove_distdir) dist dist-all: $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:' $(am__post_remove_distdir) # This target untars the dist file and tries a VPATH configuration. Then # it guarantees that the distribution is self-contained by making another # tarfile. distcheck: dist case '$(DIST_ARCHIVES)' in \ *.tar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\ *.tar.bz2*) \ bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\ *.tar.lz*) \ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\ *.tar.xz*) \ xz -dc $(distdir).tar.xz | $(am__untar) ;;\ *.tar.Z*) \ uncompress -c $(distdir).tar.Z | $(am__untar) ;;\ *.shar.gz*) \ GZIP=$(GZIP_ENV) gzip -dc $(distdir).shar.gz | unshar ;;\ *.zip*) \ unzip $(distdir).zip ;;\ esac chmod -R a-w $(distdir) chmod u+w $(distdir) mkdir $(distdir)/_build $(distdir)/_build/sub $(distdir)/_inst chmod a-w $(distdir) test -d $(distdir)/_build || exit 0; \ dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \ && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \ && am__cwd=`pwd` \ && $(am__cd) $(distdir)/_build/sub \ && ../../configure \ $(AM_DISTCHECK_CONFIGURE_FLAGS) \ $(DISTCHECK_CONFIGURE_FLAGS) \ --srcdir=../.. --prefix="$$dc_install_base" \ && $(MAKE) $(AM_MAKEFLAGS) \ && $(MAKE) $(AM_MAKEFLAGS) dvi \ && $(MAKE) $(AM_MAKEFLAGS) check \ && $(MAKE) $(AM_MAKEFLAGS) install \ && $(MAKE) $(AM_MAKEFLAGS) installcheck \ && $(MAKE) $(AM_MAKEFLAGS) uninstall \ && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \ distuninstallcheck \ && chmod -R a-w "$$dc_install_base" \ && ({ \ (cd ../.. && umask 077 && mkdir "$$dc_destdir") \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \ && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \ distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \ } || { rm -rf "$$dc_destdir"; exit 1; }) \ && rm -rf "$$dc_destdir" \ && $(MAKE) $(AM_MAKEFLAGS) dist \ && rm -rf $(DIST_ARCHIVES) \ && $(MAKE) $(AM_MAKEFLAGS) distcleancheck \ && cd "$$am__cwd" \ || exit 1 $(am__post_remove_distdir) @(echo "$(distdir) archives ready for distribution: "; \ list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \ sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x' distuninstallcheck: @test -n '$(distuninstallcheck_dir)' || { \ echo 'ERROR: trying to run $@ with an empty' \ '$$(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ $(am__cd) '$(distuninstallcheck_dir)' || { \ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \ exit 1; \ }; \ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left after uninstall:" ; \ if test -n "$(DESTDIR)"; then \ echo " (check DESTDIR support)"; \ fi ; \ $(distuninstallcheck_listfiles) ; \ exit 1; } >&2 distcleancheck: distclean @if test '$(srcdir)' = . ; then \ echo "ERROR: distcleancheck can only run from a VPATH build" ; \ exit 1 ; \ fi @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \ || { echo "ERROR: files left in build directory after distclean:" ; \ $(distcleancheck_listfiles) ; \ exit 1; } >&2 check-am: all-am check: check-recursive all-am: Makefile installdirs: installdirs-recursive installdirs-am: install: install-recursive install-exec: install-exec-recursive install-data: install-data-recursive uninstall: uninstall-recursive install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-recursive install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." clean: clean-recursive clean-am: clean-generic mostlyclean-am distclean: distclean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -f Makefile distclean-am: clean-am distclean-generic distclean-hdr distclean-tags dvi: dvi-recursive dvi-am: html: html-recursive html-am: info: info-recursive info-am: install-data-am: install-dvi: install-dvi-recursive install-dvi-am: install-exec-am: install-html: install-html-recursive install-html-am: install-info: install-info-recursive install-info-am: install-man: install-pdf: install-pdf-recursive install-pdf-am: install-ps: install-ps-recursive install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-recursive -rm -f $(am__CONFIG_DISTCLEAN_FILES) -rm -rf $(top_srcdir)/autom4te.cache -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-recursive mostlyclean-am: mostlyclean-generic pdf: pdf-recursive pdf-am: ps: ps-recursive ps-am: test: test-recursive test-am: test-local uninstall-am: .MAKE: $(am__recursive_targets) install-am install-strip .PHONY: $(am__recursive_targets) CTAGS GTAGS TAGS all all-am \ am--refresh check check-am clean clean-cscope clean-generic \ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \ distcheck distclean distclean-generic distclean-hdr \ distclean-tags distcleancheck distdir distuninstallcheck dvi \ dvi-am html html-am info info-am install install-am \ install-data install-data-am install-dvi install-dvi-am \ install-exec install-exec-am install-html install-html-am \ install-info install-info-am install-man install-pdf \ install-pdf-am install-ps install-ps-am install-strip \ installcheck installcheck-am installdirs installdirs-am \ maintainer-clean maintainer-clean-generic mostlyclean \ mostlyclean-generic pdf pdf-am ps ps-am tags tags-am test-am \ test-local uninstall uninstall-am .PRECIOUS: Makefile .PHONY : first debug release bdistdir bdist first debug release: all $(builddir)/machine_inis: $(MKDIR_P) $(builddir)/machine_inis/ machines $(builddir)/machine_inis/ bdistdir: $(BINARIES) $(builddir)/machine_inis $(MKDIR_P) $(bdistdir) @HAVE_SIGNOSX_TRUE@ list='$(BINARIES)'; \ @HAVE_SIGNOSX_TRUE@ for file in $$list; do \ @HAVE_SIGNOSX_TRUE@ $(SIGNOSX) $$file; \ @HAVE_SIGNOSX_TRUE@ done @list='$(BINARIES)'; \ for file in $$list; do \ cp $$file $(bdistdir); \ done cp -r $(srcdir)/examples $(bdistdir) cp -r $(builddir)/machine_inis $(bdistdir) cp -r $(srcdir)/scripts $(bdistdir) chmod -R a+rwx $(bdistdir) bdist-gzip: bdistdir tardir=$(bdistdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(bdistdir).tar.gz $(remove_bdistdir) bdist-xz: bdistdir tardir=$(bdistdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(bdistdir).tar.xz $(remove_bdistdir) bdist-zip: bdistdir -rm -f $(bdistdir).zip zip -rq $(bdistdir).zip $(bdistdir) $(remove_bdistdir) @HAVE_CREATEDMG_TRUE@bdist-dmg: bdistdir @HAVE_CREATEDMG_TRUE@ $(CREATEDMG) $(bdistdir) $(bdistdir).dmg @HAVE_CREATEDMG_TRUE@ $(remove_bdistdir) bdist: $(MAKE) $(AM_MAKEFLAGS) $(BDIST_TARGET) remove_bdistdir='@:' $(remove_bdistdir) # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: GPX-2.5.2/README.md000066400000000000000000000102461271205255700134460ustar00rootroot00000000000000# GPX GPX was created by Dr. Henry Thomas (aka Wingcommander) in April 2013 GPX is a post processing utility for converting gcode output from 3D slicing software like Cura, KISSlicer, S3DCreator and Slic3r to x3g files for standalone 3D printing on Makerbot Cupcake, ThingOMatic, and Replicator 1/2/2x printers - with support for both stock and sailfish firmwares. My hope is that is little utility will open up Makerbot 3D printers to a range of new and exciting sources and utilities for 3D printing input. # Installation ## Linux ``` sudo apt-get install gpx ``` ## Windows * Download a release .zip file from [GPX releases](https://github.com/markwal/GPX/releases) * Copy gpx.exe from the .zip file to somewhere on your path. *or* If you'd prefer an installer, you may want to install GPX via [GpxUi](https://markwal.github.io/GpxUi) ## Mac * Download a release .dmg file from [GPX releases](https://github.com/markwal/GPX/releases) * Open up the .dmg file and drag the gpx application to /Applications # Installing from source You need to have the GNU tools already installed and configured on your machine. For Windows, mingw or cygwin. For Linux, `sudo apt-get install build-essential`. For Mac, perhaps: Xcode menu > Preferences > Downloads > Command Line Tools. ``` git clone https://github.com/markwal/GPX cd GPX mkdir build cd build ../configure make sudo make install ``` # Copyright Copyright (c) 2013 WHPThomas, All rights reserved. Additional changes Copyright (c) 2014, 2015 DNewman, MWalker All rights reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. # Usage ``` gpx [-CFdgilpqrtvw] [-b BAUDRATE] [-c CONFIG] [-e EEPROM] [-f DIAMETER] [-m MACHINE] [-N h|t|ht] [-n SCALE] [-x X] [-y Y] [-z Z] IN [OUT] Options: -C Create temporary file with a copy of the machine configuration -F write X3G on-wire framing data to output file -N Disable writing of the X3G header (start build notice), tail (end build notice), or both -d simulated ditto printing -g Makerbot/ReplicatorG GCODE flavor -i enable stdin and stdout support for command line pipes -l log to file -p override build percentage -q quiet mode -r Reprap GCODE flavor -t truncate filename (DOS 8.3 format) -v verose mode -w rewrite 5d extrusion values CONFIG: the filename of a custom machine definition (ini file) EEPROM: the filename of an eeprom settings definition (ini file) DIAMETER: the actual filament diameter in the printer MACHINE: the predefined machine type some machine definitions have been updated with corrected steps per mm the original can be selected by prefixing o to the machine id (or1, or1d, or2, or2h, orx, ot7, ot7d) c3 = Cupcake Gen3 XYZ, Mk5/6 + Gen4 Extruder c4 = Cupcake Gen4 XYZ, Mk5/6 + Gen4 Extruder cp4 = Cupcake Pololu XYZ, Mk5/6 + Gen4 Extruder cpp = Cupcake Pololu XYZ, Mk5/6 + Pololu Extruder cxy = Core-XY with HBP - single extruder cxysz = Core-XY with HBP - single extruder, slow Z cr1 = Clone R1 Single with HBP cr1d = Clone R1 Dual with HBP r1 = Replicator 1 - single extruder r1d = Replicator 1 - dual extruder r2 = Replicator 2 (default) r2h = Replicator 2 with HBP r2x = Replicator 2X t6 = TOM Mk6 - single extruder t7 = TOM Mk7 - single extruder t7d = TOM Mk7 - dual extruder z = ZYYX - single extruder zd = ZYYX - dual extruder fcp = FlashForge Creator Pro SCALE: the coordinate system scale for the conversion (ABS = 1.0035) X,Y & Z: the coordinate system offsets for the conversion X = the x axis offset Y = the y axis offset Z = the z axis offset IN: the name of the sliced gcode input filename OUT: the name of the X3G output filename specify '--' to write to stdout Examples: gpx -p -m r2 my-sliced-model.gcode gpx -c custom-tom.ini example.gcode /volumes/things/example.x3g gpx -x 3 -y -3 offset-model.gcode ``` GPX-2.5.2/aclocal.m4000066400000000000000000001267711271205255700140420ustar00rootroot00000000000000# generated automatically by aclocal 1.15 -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])]) m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],, [m4_warning([this file was generated for autoconf 2.69. You have another version of autoconf. It may work, but is not guaranteed to. If you have problems, you may need to regenerate the build system entirely. To do so, use the procedure documented by the package, typically 'autoreconf'.])]) # Copyright (C) 2002-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_AUTOMAKE_VERSION(VERSION) # ---------------------------- # Automake X.Y traces this macro to ensure aclocal.m4 has been # generated from the m4 files accompanying Automake X.Y. # (This private macro should not be called outside this file.) AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version='1.15' dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to dnl require some minimum version. Point them to the right macro. m4_if([$1], [1.15], [], [AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl ]) # _AM_AUTOCONF_VERSION(VERSION) # ----------------------------- # aclocal traces this macro to find the Autoconf version. # This is a private macro too. Using m4_define simplifies # the logic in aclocal, which can simply ignore this definition. m4_define([_AM_AUTOCONF_VERSION], []) # AM_SET_CURRENT_AUTOMAKE_VERSION # ------------------------------- # Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced. # This function is AC_REQUIREd by AM_INIT_AUTOMAKE. AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION], [AM_AUTOMAKE_VERSION([1.15])dnl m4_ifndef([AC_AUTOCONF_VERSION], [m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))]) # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets # $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to # '$srcdir', '$srcdir/..', or '$srcdir/../..'. # # Of course, Automake must honor this variable whenever it calls a # tool from the auxiliary directory. The problem is that $srcdir (and # therefore $ac_aux_dir as well) can be either absolute or relative, # depending on how configure is run. This is pretty annoying, since # it makes $ac_aux_dir quite unusable in subdirectories: in the top # source directory, any form will work fine, but in subdirectories a # relative path needs to be adjusted first. # # $ac_aux_dir/missing # fails when called from a subdirectory if $ac_aux_dir is relative # $top_srcdir/$ac_aux_dir/missing # fails if $ac_aux_dir is absolute, # fails when called from a subdirectory in a VPATH build with # a relative $ac_aux_dir # # The reason of the latter failure is that $top_srcdir and $ac_aux_dir # are both prefixed by $srcdir. In an in-source build this is usually # harmless because $srcdir is '.', but things will broke when you # start a VPATH build or use an absolute $srcdir. # # So we could use something similar to $top_srcdir/$ac_aux_dir/missing, # iff we strip the leading $srcdir from $ac_aux_dir. That would be: # am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"` # and then we would define $MISSING as # MISSING="\${SHELL} $am_aux_dir/missing" # This will work as long as MISSING is not called from configure, because # unfortunately $(top_srcdir) has no meaning in configure. # However there are other variables, like CC, which are often used in # configure, and could therefore not use this "fixed" $ac_aux_dir. # # Another solution, used here, is to always expand $ac_aux_dir to an # absolute PATH. The drawback is that using absolute paths prevent a # configured tree to be moved without reconfiguration. AC_DEFUN([AM_AUX_DIR_EXPAND], [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` ]) # AM_CONDITIONAL -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_CONDITIONAL(NAME, SHELL-CONDITION) # ------------------------------------- # Define a conditional. AC_DEFUN([AM_CONDITIONAL], [AC_PREREQ([2.52])dnl m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])], [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl AC_SUBST([$1_TRUE])dnl AC_SUBST([$1_FALSE])dnl _AM_SUBST_NOTMAKE([$1_TRUE])dnl _AM_SUBST_NOTMAKE([$1_FALSE])dnl m4_define([_AM_COND_VALUE_$1], [$2])dnl if $2; then $1_TRUE= $1_FALSE='#' else $1_TRUE='#' $1_FALSE= fi AC_CONFIG_COMMANDS_PRE( [if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then AC_MSG_ERROR([[conditional "$1" was never defined. Usually this means the macro was only invoked conditionally.]]) fi])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be # written in clear, in which case automake, when reading aclocal.m4, # will think it sees a *use*, and therefore will trigger all it's # C support machinery. Also note that it means that autoscan, seeing # CC etc. in the Makefile, will ask for an AC_PROG_CC use... # _AM_DEPENDENCIES(NAME) # ---------------------- # See how the compiler implements dependency checking. # NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC". # We try a few techniques and use that to set a single cache variable. # # We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was # modified to invoke _AM_DEPENDENCIES(CC); we would have a circular # dependency, and given that the user is not expected to run this macro, # just rely on AC_PROG_CC. AC_DEFUN([_AM_DEPENDENCIES], [AC_REQUIRE([AM_SET_DEPDIR])dnl AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl AC_REQUIRE([AM_MAKE_INCLUDE])dnl AC_REQUIRE([AM_DEP_TRACK])dnl m4_if([$1], [CC], [depcc="$CC" am_compiler_list=], [$1], [CXX], [depcc="$CXX" am_compiler_list=], [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'], [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'], [$1], [UPC], [depcc="$UPC" am_compiler_list=], [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'], [depcc="$$1" am_compiler_list=]) AC_CACHE_CHECK([dependency style of $depcc], [am_cv_$1_dependencies_compiler_type], [if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_$1_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp` fi am__universal=false m4_case([$1], [CC], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac], [CXX], [case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac]) for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_$1_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_$1_dependencies_compiler_type=none fi ]) AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type]) AM_CONDITIONAL([am__fastdep$1], [ test "x$enable_dependency_tracking" != xno \ && test "$am_cv_$1_dependencies_compiler_type" = gcc3]) ]) # AM_SET_DEPDIR # ------------- # Choose a directory name for dependency files. # This macro is AC_REQUIREd in _AM_DEPENDENCIES. AC_DEFUN([AM_SET_DEPDIR], [AC_REQUIRE([AM_SET_LEADING_DOT])dnl AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl ]) # AM_DEP_TRACK # ------------ AC_DEFUN([AM_DEP_TRACK], [AC_ARG_ENABLE([dependency-tracking], [dnl AS_HELP_STRING( [--enable-dependency-tracking], [do not reject slow dependency extractors]) AS_HELP_STRING( [--disable-dependency-tracking], [speeds up one-time build])]) if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno]) AC_SUBST([AMDEPBACKSLASH])dnl _AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl AC_SUBST([am__nodep])dnl _AM_SUBST_NOTMAKE([am__nodep])dnl ]) # Generate code to set up dependency tracking. -*- Autoconf -*- # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_OUTPUT_DEPENDENCY_COMMANDS # ------------------------------ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS], [{ # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`AS_DIRNAME("$mf")` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`AS_DIRNAME(["$file"])` AS_MKDIR_P([$dirpart/$fdir]) # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ])# _AM_OUTPUT_DEPENDENCY_COMMANDS # AM_OUTPUT_DEPENDENCY_COMMANDS # ----------------------------- # This macro should only be invoked once -- use via AC_REQUIRE. # # This code is only required when automatic dependency tracking # is enabled. FIXME. This creates each '.P' file that we will # need in order to bootstrap the dependency handling code. AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS], [AC_CONFIG_COMMANDS([depfiles], [test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS], [AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"]) ]) # AM_EXTRA_RECURSIVE_TARGETS -*- Autoconf -*- # Copyright (C) 2012-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_EXTRA_RECURSIVE_TARGETS # -------------------------- # Define the list of user recursive targets. This macro exists only to # be traced by Automake, which will ensure that a proper definition of # user-defined recursive targets (and associated rules) is propagated # into all the generated Makefiles. # TODO: We should really reject non-literal arguments here... AC_DEFUN([AM_EXTRA_RECURSIVE_TARGETS], []) # Do all the work for Automake. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This macro actually does too much. Some checks are only needed if # your package does certain things. But this isn't really a big deal. dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O. m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC]) [_AM_PROG_CC_C_O ]) # AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE]) # AM_INIT_AUTOMAKE([OPTIONS]) # ----------------------------------------------- # The call with PACKAGE and VERSION arguments is the old style # call (pre autoconf-2.50), which is being phased out. PACKAGE # and VERSION should now be passed to AC_INIT and removed from # the call to AM_INIT_AUTOMAKE. # We support both call styles for the transition. After # the next Automake release, Autoconf can make the AC_INIT # arguments mandatory, and then we can depend on a new Autoconf # release and drop the old call support. AC_DEFUN([AM_INIT_AUTOMAKE], [AC_PREREQ([2.65])dnl dnl Autoconf wants to disallow AM_ names. We explicitly allow dnl the ones we care about. m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl AC_REQUIRE([AC_PROG_INSTALL])dnl if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl # test to see if srcdir already configured if test -f $srcdir/config.status; then AC_MSG_ERROR([source directory already configured; run "make distclean" there first]) fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi AC_SUBST([CYGPATH_W]) # Define the identity of the package. dnl Distinguish between old-style and new-style calls. m4_ifval([$2], [AC_DIAGNOSE([obsolete], [$0: two- and three-arguments forms are deprecated.]) m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl AC_SUBST([PACKAGE], [$1])dnl AC_SUBST([VERSION], [$2])], [_AM_SET_OPTIONS([$1])dnl dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT. m4_if( m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]), [ok:ok],, [m4_fatal([AC_INIT should be called with package and version arguments])])dnl AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl _AM_IF_OPTION([no-define],, [AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package]) AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl # Some tools Automake needs. AC_REQUIRE([AM_SANITY_CHECK])dnl AC_REQUIRE([AC_ARG_PROGRAM])dnl AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}]) AM_MISSING_PROG([AUTOCONF], [autoconf]) AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}]) AM_MISSING_PROG([AUTOHEADER], [autoheader]) AM_MISSING_PROG([MAKEINFO], [makeinfo]) AC_REQUIRE([AM_PROG_INSTALL_SH])dnl AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl AC_REQUIRE([AC_PROG_MKDIR_P])dnl # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # AC_SUBST([mkdir_p], ['$(MKDIR_P)']) # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. AC_REQUIRE([AC_PROG_AWK])dnl AC_REQUIRE([AC_PROG_MAKE_SET])dnl AC_REQUIRE([AM_SET_LEADING_DOT])dnl _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])], [_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])], [_AM_PROG_TAR([v7])])]) _AM_IF_OPTION([no-dependencies],, [AC_PROVIDE_IFELSE([AC_PROG_CC], [_AM_DEPENDENCIES([CC])], [m4_define([AC_PROG_CC], m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_CXX], [_AM_DEPENDENCIES([CXX])], [m4_define([AC_PROG_CXX], m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJC], [_AM_DEPENDENCIES([OBJC])], [m4_define([AC_PROG_OBJC], m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl AC_PROVIDE_IFELSE([AC_PROG_OBJCXX], [_AM_DEPENDENCIES([OBJCXX])], [m4_define([AC_PROG_OBJCXX], m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl ]) AC_REQUIRE([AM_SILENT_RULES])dnl dnl The testsuite driver may need to know about EXEEXT, so add the dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below. AC_CONFIG_COMMANDS_PRE(dnl [m4_provide_if([_AM_COMPILER_EXEEXT], [AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END AC_MSG_ERROR([Your 'rm' program is bad, sorry.]) fi fi dnl The trailing newline in this macro's definition is deliberate, for dnl backward compatibility and to allow trailing 'dnl'-style comments dnl after the AM_INIT_AUTOMAKE invocation. See automake bug#16841. ]) dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further dnl mangled by Autoconf and run in a shell conditional statement. m4_define([_AC_COMPILER_EXEEXT], m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])]) # When config.status generates a header, we must update the stamp-h file. # This file resides in the same directory as the config header # that is generated. The stamp files are numbered to have different names. # Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the # loop where config.status creates the headers, so we can generate # our stamp files there. AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK], [# Compute $1's index in $config_headers. _am_arg=$1 _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_SH # ------------------ # Define $install_sh. AC_DEFUN([AM_PROG_INSTALL_SH], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi AC_SUBST([install_sh])]) # Copyright (C) 2003-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # Check whether the underlying file-system supports filenames # with a leading dot. For instance MS-DOS doesn't. AC_DEFUN([AM_SET_LEADING_DOT], [rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null AC_SUBST([am__leading_dot])]) # Add --enable-maintainer-mode option to configure. -*- Autoconf -*- # From Jim Meyering # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAINTAINER_MODE([DEFAULT-MODE]) # ---------------------------------- # Control maintainer-specific portions of Makefiles. # Default is to disable them, unless 'enable' is passed literally. # For symmetry, 'disable' may be passed as well. Anyway, the user # can override the default with the --enable/--disable switch. AC_DEFUN([AM_MAINTAINER_MODE], [m4_case(m4_default([$1], [disable]), [enable], [m4_define([am_maintainer_other], [disable])], [disable], [m4_define([am_maintainer_other], [enable])], [m4_define([am_maintainer_other], [enable]) m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])]) AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) dnl maintainer-mode's default is 'disable' unless 'enable' is passed AC_ARG_ENABLE([maintainer-mode], [AS_HELP_STRING([--]am_maintainer_other[-maintainer-mode], am_maintainer_other[ make rules and dependencies not useful (and sometimes confusing) to the casual installer])], [USE_MAINTAINER_MODE=$enableval], [USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes])) AC_MSG_RESULT([$USE_MAINTAINER_MODE]) AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes]) MAINT=$MAINTAINER_MODE_TRUE AC_SUBST([MAINT])dnl ] ) # Check to see how 'make' treats includes. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MAKE_INCLUDE() # ----------------- # Check to see how make treats includes. AC_DEFUN([AM_MAKE_INCLUDE], [am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. AC_MSG_CHECKING([for style of include used by $am_make]) am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi AC_SUBST([am__include]) AC_SUBST([am__quote]) AC_MSG_RESULT([$_am_result]) rm -f confinc confmf ]) # Fake the existence of programs that GNU maintainers use. -*- Autoconf -*- # Copyright (C) 1997-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_MISSING_PROG(NAME, PROGRAM) # ------------------------------ AC_DEFUN([AM_MISSING_PROG], [AC_REQUIRE([AM_MISSING_HAS_RUN]) $1=${$1-"${am_missing_run}$2"} AC_SUBST($1)]) # AM_MISSING_HAS_RUN # ------------------ # Define MISSING if not defined so far and test if it is modern enough. # If it is, set am_missing_run to use it, otherwise, to nothing. AC_DEFUN([AM_MISSING_HAS_RUN], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([missing])dnl if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= AC_MSG_WARN(['missing' script is too old or missing]) fi ]) # Helper functions for option handling. -*- Autoconf -*- # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_MANGLE_OPTION(NAME) # ----------------------- AC_DEFUN([_AM_MANGLE_OPTION], [[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])]) # _AM_SET_OPTION(NAME) # -------------------- # Set option NAME. Presently that only means defining a flag for this option. AC_DEFUN([_AM_SET_OPTION], [m4_define(_AM_MANGLE_OPTION([$1]), [1])]) # _AM_SET_OPTIONS(OPTIONS) # ------------------------ # OPTIONS is a space-separated list of Automake options. AC_DEFUN([_AM_SET_OPTIONS], [m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])]) # _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET]) # ------------------------------------------- # Execute IF-SET if OPTION is set, IF-NOT-SET otherwise. AC_DEFUN([_AM_IF_OPTION], [m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])]) # Copyright (C) 1999-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_CC_C_O # --------------- # Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC # to automatically call this. AC_DEFUN([_AM_PROG_CC_C_O], [AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl AC_REQUIRE_AUX_FILE([compile])dnl AC_LANG_PUSH([C])dnl AC_CACHE_CHECK( [whether $CC understands -c and -o together], [am_cv_prog_cc_c_o], [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])]) # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i]) if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi AC_LANG_POP([C])]) # For backward compatibility. AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_RUN_LOG(COMMAND) # ------------------- # Run COMMAND, save the exit status in ac_status, and log it. # (This has been adapted from Autoconf's _AC_RUN_LOG macro.) AC_DEFUN([AM_RUN_LOG], [{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD (exit $ac_status); }]) # Check to make sure that the build environment is sane. -*- Autoconf -*- # Copyright (C) 1996-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SANITY_CHECK # --------------- AC_DEFUN([AM_SANITY_CHECK], [AC_MSG_CHECKING([whether build environment is sane]) # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[[\\\"\#\$\&\'\`$am_lf]]*) AC_MSG_ERROR([unsafe absolute working directory name]);; esac case $srcdir in *[[\\\"\#\$\&\'\`$am_lf\ \ ]]*) AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$[*]" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$[*]" != "X $srcdir/configure conftest.file" \ && test "$[*]" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken alias in your environment]) fi if test "$[2]" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$[2]" = conftest.file ) then # Ok. : else AC_MSG_ERROR([newly created file is older than distributed files! Check your system clock]) fi AC_MSG_RESULT([yes]) # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi AC_CONFIG_COMMANDS_PRE( [AC_MSG_CHECKING([that generated files are newer than configure]) if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi AC_MSG_RESULT([done])]) rm -f conftest.file ]) # Copyright (C) 2009-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_SILENT_RULES([DEFAULT]) # -------------------------- # Enable less verbose build rules; with the default set to DEFAULT # ("yes" being less verbose, "no" or empty being verbose). AC_DEFUN([AM_SILENT_RULES], [AC_ARG_ENABLE([silent-rules], [dnl AS_HELP_STRING( [--enable-silent-rules], [less verbose build output (undo: "make V=1")]) AS_HELP_STRING( [--disable-silent-rules], [verbose build output (undo: "make V=0")])dnl ]) case $enable_silent_rules in @%:@ ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);; esac dnl dnl A few 'make' implementations (e.g., NonStop OS and NextStep) dnl do not support nested variable expansions. dnl See automake bug#9928 and bug#10237. am_make=${MAKE-make} AC_CACHE_CHECK([whether $am_make supports nested variables], [am_cv_make_support_nested_variables], [if AS_ECHO([['TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi]) if test $am_cv_make_support_nested_variables = yes; then dnl Using '$V' instead of '$(V)' breaks IRIX make. AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AC_SUBST([AM_V])dnl AM_SUBST_NOTMAKE([AM_V])dnl AC_SUBST([AM_DEFAULT_V])dnl AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl AC_SUBST([AM_DEFAULT_VERBOSITY])dnl AM_BACKSLASH='\' AC_SUBST([AM_BACKSLASH])dnl _AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl ]) # Copyright (C) 2001-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # AM_PROG_INSTALL_STRIP # --------------------- # One issue with vendor 'install' (even GNU) is that you can't # specify the program used to strip binaries. This is especially # annoying in cross-compiling environments, where the build's strip # is unlikely to handle the host's binaries. # Fortunately install-sh will honor a STRIPPROG variable, so we # always use install-sh in "make install-strip", and initialize # STRIPPROG with the value of the STRIP variable (set by the user). AC_DEFUN([AM_PROG_INSTALL_STRIP], [AC_REQUIRE([AM_PROG_INSTALL_SH])dnl # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. dnl Don't test for $cross_compiling = yes, because it might be 'maybe'. if test "$cross_compiling" != no; then AC_CHECK_TOOL([STRIP], [strip], :) fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" AC_SUBST([INSTALL_STRIP_PROGRAM])]) # Copyright (C) 2006-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_SUBST_NOTMAKE(VARIABLE) # --------------------------- # Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in. # This macro is traced by Automake. AC_DEFUN([_AM_SUBST_NOTMAKE]) # AM_SUBST_NOTMAKE(VARIABLE) # -------------------------- # Public sister of _AM_SUBST_NOTMAKE. AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)]) # Check how to create a tarball. -*- Autoconf -*- # Copyright (C) 2004-2014 Free Software Foundation, Inc. # # This file is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # _AM_PROG_TAR(FORMAT) # -------------------- # Check how to create a tarball in format FORMAT. # FORMAT should be one of 'v7', 'ustar', or 'pax'. # # Substitute a variable $(am__tar) that is a command # writing to stdout a FORMAT-tarball containing the directory # $tardir. # tardir=directory && $(am__tar) > result.tar # # Substitute a variable $(am__untar) that extract such # a tarball read from stdin. # $(am__untar) < result.tar # AC_DEFUN([_AM_PROG_TAR], [# Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AC_SUBST([AMTAR], ['$${TAR-tar}']) # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none' m4_if([$1], [v7], [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'], [m4_case([$1], [ustar], [# The POSIX 1988 'ustar' format is defined with fixed-size fields. # There is notably a 21 bits limit for the UID and the GID. In fact, # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343 # and bug#13588). am_max_uid=2097151 # 2^21 - 1 am_max_gid=$am_max_uid # The $UID and $GID variables are not portable, so we need to resort # to the POSIX-mandated id(1) utility. Errors in the 'id' calls # below are definitely unexpected, so allow the users to see them # (that is, avoid stderr redirection). am_uid=`id -u || echo unknown` am_gid=`id -g || echo unknown` AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format]) if test $am_uid -le $am_max_uid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format]) if test $am_gid -le $am_max_gid; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) _am_tools=none fi], [pax], [], [m4_fatal([Unknown tar format])]) AC_MSG_CHECKING([how to create a $1 tar archive]) # Go ahead even if we have the value already cached. We do so because we # need to set the values for the 'am__tar' and 'am__untar' variables. _am_tools=${am_cv_prog_tar_$1-$_am_tools} for _am_tool in $_am_tools; do case $_am_tool in gnutar) for _am_tar in tar gnutar gtar; do AM_RUN_LOG([$_am_tar --version]) && break done am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"' am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"' am__untar="$_am_tar -xf -" ;; plaintar) # Must skip GNU tar: if it does not support --format= it doesn't create # ustar tarball either. (tar --version) >/dev/null 2>&1 && continue am__tar='tar chf - "$$tardir"' am__tar_='tar chf - "$tardir"' am__untar='tar xf -' ;; pax) am__tar='pax -L -x $1 -w "$$tardir"' am__tar_='pax -L -x $1 -w "$tardir"' am__untar='pax -r' ;; cpio) am__tar='find "$$tardir" -print | cpio -o -H $1 -L' am__tar_='find "$tardir" -print | cpio -o -H $1 -L' am__untar='cpio -i -H $1 -d' ;; none) am__tar=false am__tar_=false am__untar=false ;; esac # If the value was cached, stop now. We just wanted to have am__tar # and am__untar set. test -n "${am_cv_prog_tar_$1}" && break # tar/untar a dummy directory, and stop if the command works. rm -rf conftest.dir mkdir conftest.dir echo GrepMe > conftest.dir/file AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar]) rm -rf conftest.dir if test -s conftest.tar; then AM_RUN_LOG([$am__untar /dev/null 2>&1 && break fi done rm -rf conftest.dir AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool]) AC_MSG_RESULT([$am_cv_prog_tar_$1])]) AC_SUBST([am__tar]) AC_SUBST([am__untar]) ]) # _AM_PROG_TAR GPX-2.5.2/build-aux/000077500000000000000000000000001271205255700140565ustar00rootroot00000000000000GPX-2.5.2/build-aux/archive-name.sh000077500000000000000000000007571271205255700167650ustar00rootroot00000000000000#!/usr/bin/env bash # configure helper to make the platform bit of the binary archive name more # user friendly # # invoked from configure.ac AC_SUBST macro # $1 == $host_os $2 == $host_cpu platform=$1 if [[ "$platform" =~ darwin.* ]]; then platform="osx" elif [[ "$platform" == "mingw32" ]]; then if [[ "$2" == "i686" ]]; then platform="win32" else platform="win64" fi elif [[ "$platform" =~ .*linux.* ]]; then platform="linux" fi echo "$platform" GPX-2.5.2/build-aux/compile000077500000000000000000000162451271205255700154440ustar00rootroot00000000000000#! /bin/sh # Wrapper for compilers which do not understand '-c -o'. scriptversion=2012-10-14.11; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # This file is maintained in Automake, please report # bugs to or send patches to # . nl=' ' # We need space, tab and new line, in precisely that order. Quoting is # there to prevent tools from complaining about whitespace usage. IFS=" "" $nl" file_conv= # func_file_conv build_file lazy # Convert a $build file to $host form and store it in $file # Currently only supports Windows hosts. If the determined conversion # type is listed in (the comma separated) LAZY, no conversion will # take place. func_file_conv () { file=$1 case $file in / | /[!/]*) # absolute file, and not a UNC file if test -z "$file_conv"; then # lazily determine how to convert abs files case `uname -s` in MINGW*) file_conv=mingw ;; CYGWIN*) file_conv=cygwin ;; *) file_conv=wine ;; esac fi case $file_conv/,$2, in *,$file_conv,*) ;; mingw/*) file=`cmd //C echo "$file " | sed -e 's/"\(.*\) " *$/\1/'` ;; cygwin/*) file=`cygpath -m "$file" || echo "$file"` ;; wine/*) file=`winepath -w "$file" || echo "$file"` ;; esac ;; esac } # func_cl_dashL linkdir # Make cl look for libraries in LINKDIR func_cl_dashL () { func_file_conv "$1" if test -z "$lib_path"; then lib_path=$file else lib_path="$lib_path;$file" fi linker_opts="$linker_opts -LIBPATH:$file" } # func_cl_dashl library # Do a library search-path lookup for cl func_cl_dashl () { lib=$1 found=no save_IFS=$IFS IFS=';' for dir in $lib_path $LIB do IFS=$save_IFS if $shared && test -f "$dir/$lib.dll.lib"; then found=yes lib=$dir/$lib.dll.lib break fi if test -f "$dir/$lib.lib"; then found=yes lib=$dir/$lib.lib break fi if test -f "$dir/lib$lib.a"; then found=yes lib=$dir/lib$lib.a break fi done IFS=$save_IFS if test "$found" != yes; then lib=$lib.lib fi } # func_cl_wrapper cl arg... # Adjust compile command to suit cl func_cl_wrapper () { # Assume a capable shell lib_path= shared=: linker_opts= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. eat=1 case $2 in *.o | *.[oO][bB][jJ]) func_file_conv "$2" set x "$@" -Fo"$file" shift ;; *) func_file_conv "$2" set x "$@" -Fe"$file" shift ;; esac ;; -I) eat=1 func_file_conv "$2" mingw set x "$@" -I"$file" shift ;; -I*) func_file_conv "${1#-I}" mingw set x "$@" -I"$file" shift ;; -l) eat=1 func_cl_dashl "$2" set x "$@" "$lib" shift ;; -l*) func_cl_dashl "${1#-l}" set x "$@" "$lib" shift ;; -L) eat=1 func_cl_dashL "$2" ;; -L*) func_cl_dashL "${1#-L}" ;; -static) shared=false ;; -Wl,*) arg=${1#-Wl,} save_ifs="$IFS"; IFS=',' for flag in $arg; do IFS="$save_ifs" linker_opts="$linker_opts $flag" done IFS="$save_ifs" ;; -Xlinker) eat=1 linker_opts="$linker_opts $2" ;; -*) set x "$@" "$1" shift ;; *.cc | *.CC | *.cxx | *.CXX | *.[cC]++) func_file_conv "$1" set x "$@" -Tp"$file" shift ;; *.c | *.cpp | *.CPP | *.lib | *.LIB | *.Lib | *.OBJ | *.obj | *.[oO]) func_file_conv "$1" mingw set x "$@" "$file" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -n "$linker_opts"; then linker_opts="-link$linker_opts" fi exec "$@" $linker_opts exit 1 } eat= case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: compile [--help] [--version] PROGRAM [ARGS] Wrapper for compilers which do not understand '-c -o'. Remove '-o dest.o' from ARGS, run PROGRAM with the remaining arguments, and rename the output as expected. If you are trying to build a whole package this is not the right script to run: please start by reading the file 'INSTALL'. Report bugs to . EOF exit $? ;; -v | --v*) echo "compile $scriptversion" exit $? ;; cl | *[/\\]cl | cl.exe | *[/\\]cl.exe ) func_cl_wrapper "$@" # Doesn't return... ;; esac ofile= cfile= for arg do if test -n "$eat"; then eat= else case $1 in -o) # configure might choose to run compile as 'compile cc -o foo foo.c'. # So we strip '-o arg' only if arg is an object. eat=1 case $2 in *.o | *.obj) ofile=$2 ;; *) set x "$@" -o "$2" shift ;; esac ;; *.c) cfile=$1 set x "$@" "$1" shift ;; *) set x "$@" "$1" shift ;; esac fi shift done if test -z "$ofile" || test -z "$cfile"; then # If no '-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # '.c' file was seen then we are probably linking. That is also # ok. exec "$@" fi # Name of file we expect compiler to create. cofile=`echo "$cfile" | sed 's|^.*[\\/]||; s|^[a-zA-Z]:||; s/\.c$/.o/'` # Create the lock directory. # Note: use '[/\\:.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo "$cofile" | sed -e 's|[/\\:.-]|_|g'`.d while true; do if mkdir "$lockdir" >/dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir '$lockdir'; exit 1" 1 2 15 # Run the compile. "$@" ret=$? if test -f "$cofile"; then test "$cofile" = "$ofile" || mv "$cofile" "$ofile" elif test -f "${cofile}bj"; then test "${cofile}bj" = "$ofile" || mv "${cofile}bj" "$ofile" fi rmdir "$lockdir" exit $ret # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: GPX-2.5.2/build-aux/config.guess000077500000000000000000001235501271205255700164040ustar00rootroot00000000000000#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-03-23' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner. # # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD # # Please send patches with a ChangeLog entry to config-patches@gnu.org. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system \`$me' is run on. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi trap 'exit 1' 1 2 15 # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still # use `HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ; dummy=$tmp/dummy ; tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ; case $CC_FOR_BUILD,$HOST_CC,$CC in ,,) echo "int x;" > $dummy.c ; for c in cc gcc c89 c99 ; do if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then CC_FOR_BUILD="$c"; break ; fi ; done ; if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found ; fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac ; set_cc_for_build= ;' # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if (test -f /.attbin/uname) >/dev/null 2>&1 ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case "${UNAME_SYSTEM}" in Linux|GNU|GNU/*) # If the system lacks a compiler, then just pick glibc. # We could probably try harder. LIBC=gnu eval $set_cc_for_build cat <<-EOF > $dummy.c #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #else LIBC=gnu #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` ;; esac # Note: order is significant - the case branches are not exclusive. case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". sysctl="sysctl -n hw.machine_arch" UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \ /usr/sbin/$sysctl 2>/dev/null || echo unknown)` case "${UNAME_MACHINE_ARCH}" in armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; *) machine=${UNAME_MACHINE_ARCH}-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently, or will in the future. case "${UNAME_MACHINE_ARCH}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case "${UNAME_VERSION}" in Debian*) release='-gnu' ;; *) release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. echo "${machine}-${os}${release}" exit ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` echo ${UNAME_MACHINE_ARCH}-unknown-bitrig${UNAME_RELEASE} exit ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE} exit ;; *:ekkoBSD:*:*) echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE} exit ;; *:SolidBSD:*:*) echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE} exit ;; macppc:MirBSD:*:*) echo powerpc-unknown-mirbsd${UNAME_RELEASE} exit ;; *:MirBSD:*:*) echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE} exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case "$ALPHA_CPU_TYPE" in "EV4 (21064)") UNAME_MACHINE="alpha" ;; "EV4.5 (21064)") UNAME_MACHINE="alpha" ;; "LCA4 (21066/21068)") UNAME_MACHINE="alpha" ;; "EV5 (21164)") UNAME_MACHINE="alphaev5" ;; "EV5.6 (21164A)") UNAME_MACHINE="alphaev56" ;; "EV5.6 (21164PC)") UNAME_MACHINE="alphapca56" ;; "EV5.7 (21164PC)") UNAME_MACHINE="alphapca57" ;; "EV6 (21264)") UNAME_MACHINE="alphaev6" ;; "EV6.7 (21264A)") UNAME_MACHINE="alphaev67" ;; "EV6.8CB (21264C)") UNAME_MACHINE="alphaev68" ;; "EV6.8AL (21264B)") UNAME_MACHINE="alphaev68" ;; "EV6.8CX (21264D)") UNAME_MACHINE="alphaev68" ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE="alphaev69" ;; "EV7 (21364)") UNAME_MACHINE="alphaev7" ;; "EV7.9 (21364A)") UNAME_MACHINE="alphaev79" ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` # Reset EXIT trap before exiting to avoid spurious non-zero exit code. exitcode=$? trap '' 0 exit $exitcode ;; Alpha\ *:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # Should we change UNAME_MACHINE based on the output of uname instead # of the specific Alpha model? echo alpha-pc-interix exit ;; 21064:Windows_NT:50:3) echo alpha-dec-winnt3.5 exit ;; Amiga*:UNIX_System_V:4.0:*) echo m68k-unknown-sysv4 exit ;; *:[Aa]miga[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-amigaos exit ;; *:[Mm]orph[Oo][Ss]:*:*) echo ${UNAME_MACHINE}-unknown-morphos exit ;; *:OS/390:*:*) echo i370-ibm-openedition exit ;; *:z/VM:*:*) echo s390-ibm-zvmoe exit ;; *:OS400:*:*) echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} exit ;; arm*:riscos:*:*|arm*:RISCOS:*:*) echo arm-unknown-riscos exit ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) echo hppa1.1-hitachi-hiuxmpp exit ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. if test "`(/bin/universe) 2>/dev/null`" = att ; then echo pyramid-pyramid-sysv3 else echo pyramid-pyramid-bsd fi exit ;; NILE*:*:*:dcosx) echo pyramid-pyramid-svr4 exit ;; DRS?6000:unix:4.0:6*) echo sparc-icl-nx6 exit ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; s390x:SunOS:*:*) echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) echo i386-pc-auroraux${UNAME_RELEASE} exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) eval $set_cc_for_build SUN_ARCH="i386" # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH="x86_64" fi fi echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:*:*) case "`/usr/bin/arch -k`" in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like `4.1.3-JL'. echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'` exit ;; sun3*:SunOS:*:*) echo m68k-sun-sunos${UNAME_RELEASE} exit ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3 case "`/bin/arch`" in sun3) echo m68k-sun-sunos${UNAME_RELEASE} ;; sun4) echo sparc-sun-sunos${UNAME_RELEASE} ;; esac exit ;; aushp:SunOS:*:*) echo sparc-auspex-sunos${UNAME_RELEASE} exit ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) echo m68k-milan-mint${UNAME_RELEASE} exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) echo m68k-hades-mint${UNAME_RELEASE} exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) echo m68k-unknown-mint${UNAME_RELEASE} exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; powerpc:machten:*:*) echo powerpc-apple-machten${UNAME_RELEASE} exit ;; RISC*:Mach:*:*) echo mips-dec-mach_bsd4.3 exit ;; RISC*:ULTRIX:*:*) echo mips-dec-ultrix${UNAME_RELEASE} exit ;; VAX*:ULTRIX*:*:*) echo vax-dec-ultrix${UNAME_RELEASE} exit ;; 2020:CLIX:*:* | 2430:CLIX:*:*) echo clipper-intergraph-clix${UNAME_RELEASE} exit ;; mips:*:*:UMIPS | mips:*:*:RISCos) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`$dummy $dummyarg` && { echo "$SYSTEM_NAME"; exit; } echo mips-mips-riscos${UNAME_RELEASE} exit ;; Motorola:PowerMAX_OS:*:*) echo powerpc-motorola-powermax exit ;; Motorola:*:4.3:PL8-*) echo powerpc-harris-powermax exit ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) echo powerpc-harris-powermax exit ;; Night_Hawk:Power_UNIX:*:*) echo powerpc-harris-powerunix exit ;; m88k:CX/UX:7*:*) echo m88k-harris-cxux7 exit ;; m88k:*:4*:R4*) echo m88k-motorola-sysv4 exit ;; m88k:*:3*:R3*) echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ [ ${TARGET_BINARY_INTERFACE}x = x ] then echo m88k-dg-dgux${UNAME_RELEASE} else echo m88k-dg-dguxbcs${UNAME_RELEASE} fi else echo i586-dg-dgux${UNAME_RELEASE} fi exit ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) echo m88k-dolphin-sysv3 exit ;; M88*:*:R3*:*) # Delta 88k system running SVR3 echo m88k-motorola-sysv3 exit ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) echo m88k-tektronix-sysv3 exit ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) echo m68k-tektronix-bsd exit ;; *:IRIX*:*:*) echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'` exit ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id exit ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) echo i386-ibm-aix exit ;; ia64:AIX:*:*) if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${UNAME_MACHINE}-ibm-aix${IBM_REV} exit ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include main() { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` then echo "$SYSTEM_NAME" else echo rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then echo rs6000-ibm-aix3.2.4 else echo rs6000-ibm-aix3.2 fi exit ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if [ -x /usr/bin/oslevel ] ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE} fi echo ${IBM_ARCH}-ibm-aix${IBM_REV} exit ;; *:AIX:*:*) echo rs6000-ibm-aix exit ;; ibmrt:4.4BSD:*|romp-ibm:BSD:*) echo romp-ibm-bsd4.4 exit ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to exit ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) echo rs6000-bull-bosx exit ;; DPX/2?00:B.O.S.:*:*) echo m68k-bull-sysv3 exit ;; 9000/[34]??:4.3bsd:1.*:*) echo m68k-hp-bsd exit ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) echo m68k-hp-bsd4.4 exit ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` case "${UNAME_MACHINE}" in 9000/31? ) HP_ARCH=m68000 ;; 9000/[34]?? ) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case "${sc_kernel_bits}" in 32) HP_ARCH="hppa2.0n" ;; 64) HP_ARCH="hppa2.0w" ;; '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20 esac ;; esac fi if [ "${HP_ARCH}" = "" ]; then eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if [ ${HP_ARCH} = "hppa2.0w" ] then eval $set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH="hppa2.0w" else HP_ARCH="hppa64" fi fi echo ${HP_ARCH}-hp-hpux${HPUX_REV} exit ;; ia64:HP-UX:*:*) HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'` echo ia64-hp-hpux${HPUX_REV} exit ;; 3050*:HI-UX:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` && { echo "$SYSTEM_NAME"; exit; } echo unknown-hitachi-hiuxwe2 exit ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* ) echo hppa1.1-hp-bsd exit ;; 9000/8??:4.3bsd:*:*) echo hppa1.0-hp-bsd exit ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) echo hppa1.0-hp-mpeix exit ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* ) echo hppa1.1-hp-osf exit ;; hp8??:OSF1:*:*) echo hppa1.0-hp-osf exit ;; i*86:OSF1:*:*) if [ -x /usr/sbin/sysversion ] ; then echo ${UNAME_MACHINE}-unknown-osf1mk else echo ${UNAME_MACHINE}-unknown-osf1 fi exit ;; parisc*:Lites*:*:*) echo hppa1.1-hp-lites exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*[A-Z]90:*:*:*) echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*T3E:*:*:*) echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; CRAY*SV1:*:*:*) echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; *:UNICOS/mp:*:*) echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} exit ;; sparc*:BSD/OS:*:*) echo sparc-unknown-bsdi${UNAME_RELEASE} exit ;; *:BSD/OS:*:*) echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE} exit ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`/usr/bin/uname -p` case ${UNAME_PROCESSOR} in amd64) echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; *) echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;; esac exit ;; i*:CYGWIN*:*) echo ${UNAME_MACHINE}-pc-cygwin exit ;; *:MINGW64*:*) echo ${UNAME_MACHINE}-pc-mingw64 exit ;; *:MINGW*:*) echo ${UNAME_MACHINE}-pc-mingw32 exit ;; *:MSYS*:*) echo ${UNAME_MACHINE}-pc-msys exit ;; i*:windows32*:*) # uname -m includes "-pc" on this system. echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; *:Interix*:*) case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) echo ia64-unknown-interix${UNAME_RELEASE} exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; 8664:Windows_NT:*) echo x86_64-pc-mks exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we # UNAME_MACHINE based on the output of uname instead of i386? echo i586-pc-interix exit ;; i*:UWIN*:*) echo ${UNAME_MACHINE}-pc-uwin exit ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) echo x86_64-unknown-cygwin exit ;; p*:CYGWIN*:*) echo powerpcle-unknown-cygwin exit ;; prep*:SunOS:5.*:*) echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; *:GNU:*:*) # the GNU system echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-${LIBC}`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'` exit ;; *:GNU/*:*:*) # other systems with GNU libc and userland echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-${LIBC} exit ;; i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; aarch64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC="gnulibc1" ; fi echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arc:Linux:*:* | arceb:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; arm*:Linux:*:*) eval $set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-${LIBC} else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabi else echo ${UNAME_MACHINE}-unknown-linux-${LIBC}eabihf fi fi exit ;; avr32*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; cris:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; crisv32:Linux:*:*) echo ${UNAME_MACHINE}-axis-linux-${LIBC} exit ;; frv:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; hexagon:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:Linux:*:*) echo ${UNAME_MACHINE}-pc-linux-${LIBC} exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m32r*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU #undef ${UNAME_MACHINE} #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-${LIBC}"; exit; } ;; openrisc*:Linux:*:*) echo or1k-unknown-linux-${LIBC} exit ;; or32:Linux:*:* | or1k*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; padre:Linux:*:*) echo sparc-unknown-linux-${LIBC} exit ;; parisc64:Linux:*:* | hppa64:Linux:*:*) echo hppa64-unknown-linux-${LIBC} exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) echo hppa1.1-unknown-linux-${LIBC} ;; PA8*) echo hppa2.0-unknown-linux-${LIBC} ;; *) echo hppa-unknown-linux-${LIBC} ;; esac exit ;; ppc64:Linux:*:*) echo powerpc64-unknown-linux-${LIBC} exit ;; ppc:Linux:*:*) echo powerpc-unknown-linux-${LIBC} exit ;; ppc64le:Linux:*:*) echo powerpc64le-unknown-linux-${LIBC} exit ;; ppcle:Linux:*:*) echo powerpcle-unknown-linux-${LIBC} exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux-${LIBC} exit ;; sh64*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; tile*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-${LIBC} exit ;; x86_64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; xtensa*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-${LIBC} exit ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) # If we were able to find `uname', then EMX Unix compatibility # is probably installed. echo ${UNAME_MACHINE}-pc-os2-emx exit ;; i*86:XTS-300:*:STOP) echo ${UNAME_MACHINE}-unknown-stop exit ;; i*86:atheos:*:*) echo ${UNAME_MACHINE}-unknown-atheos exit ;; i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) echo ${UNAME_MACHINE}-pc-msdosdjgpp exit ;; i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*) UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL} else echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL} fi exit ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} exit ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 echo ${UNAME_MACHINE}-pc-sco$UNAME_REL else echo ${UNAME_MACHINE}-pc-sysv32 fi exit ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configury will decide that # this is a cross-build. echo i586-pc-msdosdjgpp exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; paragon:*:*:*) echo i860-intel-osf1 exit ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4 fi exit ;; mini*:CTIX:SYS*5:*) # "miniframe" echo m68010-convergent-sysv exit ;; mc68k:UNIX:SYSTEM5:3.51m) echo m68k-convergent-sysv exit ;; M680?0:D-NIX:5.3:*) echo m68k-diab-dnix exit ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; mc68030:UNIX_System_V:4.*:*) echo m68k-atari-sysv4 exit ;; TSUNAMI:LynxOS:2.*:*) echo sparc-unknown-lynxos${UNAME_RELEASE} exit ;; rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) echo mips-dde-sysv${UNAME_RELEASE} exit ;; RM*:ReliantUNIX-*:*:*) echo mips-sni-sysv4 exit ;; RM*:SINIX-*:*:*) echo mips-sni-sysv4 exit ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` echo ${UNAME_MACHINE}-sni-sysv4 else echo ns32k-sni-sysv fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort # says echo i586-unisys-sysv4 exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm echo hppa1.1-stratus-sysv4 exit ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. echo i860-stratus-sysv4 exit ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. echo ${UNAME_MACHINE}-stratus-vos exit ;; *:VOS:*:*) # From Paul.Green@stratus.com. echo hppa1.1-stratus-vos exit ;; mc68*:A/UX:*:*) echo m68k-apple-aux${UNAME_RELEASE} exit ;; news*:NEWS-OS:6*:*) echo mips-sony-newsos6 exit ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if [ -d /usr/nec ]; then echo mips-nec-sysv${UNAME_RELEASE} else echo mips-unknown-sysv${UNAME_RELEASE} fi exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. echo powerpc-apple-beos exit ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. echo i586-pc-beos exit ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. echo i586-pc-haiku exit ;; x86_64:Haiku:*:*) echo x86_64-unknown-haiku exit ;; SX-4:SUPER-UX:*:*) echo sx4-nec-superux${UNAME_RELEASE} exit ;; SX-5:SUPER-UX:*:*) echo sx5-nec-superux${UNAME_RELEASE} exit ;; SX-6:SUPER-UX:*:*) echo sx6-nec-superux${UNAME_RELEASE} exit ;; SX-7:SUPER-UX:*:*) echo sx7-nec-superux${UNAME_RELEASE} exit ;; SX-8:SUPER-UX:*:*) echo sx8-nec-superux${UNAME_RELEASE} exit ;; SX-8R:SUPER-UX:*:*) echo sx8r-nec-superux${UNAME_RELEASE} exit ;; Power*:Rhapsody:*:*) echo powerpc-apple-rhapsody${UNAME_RELEASE} exit ;; *:Rhapsody:*:*) echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE} exit ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown eval $set_cc_for_build if test "$UNAME_PROCESSOR" = unknown ; then UNAME_PROCESSOR=powerpc fi if test `echo "$UNAME_RELEASE" | sed -e 's/\..*//'` -le 10 ; then if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi fi elif test "$UNAME_PROCESSOR" = i386 ; then # Avoid executing cc on OS X 10.9, as it ships with a stub # that puts up a graphical alert prompting to install # developer tools. Any system running Mac OS X 10.7 or # later (Darwin 11 and later) is required to have a 64-bit # processor. This is not true of the ARM version of Darwin # that Apple uses in portable devices. UNAME_PROCESSOR=x86_64 fi echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} exit ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; NEO-?:NONSTOP_KERNEL:*:*) echo neo-tandem-nsk${UNAME_RELEASE} exit ;; NSE-*:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; NSR-?:NONSTOP_KERNEL:*:*) echo nsr-tandem-nsk${UNAME_RELEASE} exit ;; *:NonStop-UX:*:*) echo mips-compaq-nonstopux exit ;; BS2000:POSIX*:*:*) echo bs2000-siemens-sysv exit ;; DS/*:UNIX_System_V:*:*) echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE} exit ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "$cputype" = "386"; then UNAME_MACHINE=i386 else UNAME_MACHINE="$cputype" fi echo ${UNAME_MACHINE}-unknown-plan9 exit ;; *:TOPS-10:*:*) echo pdp10-unknown-tops10 exit ;; *:TENEX:*:*) echo pdp10-unknown-tenex exit ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) echo pdp10-dec-tops20 exit ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) echo pdp10-xkl-tops20 exit ;; *:TOPS-20:*:*) echo pdp10-unknown-tops20 exit ;; *:ITS:*:*) echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; V*) echo vax-dec-vms ; exit ;; esac ;; *:XENIX:*:SysV) echo i386-pc-xenix exit ;; i*86:skyos:*:*) echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//' exit ;; i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; i*86:AROS:*:*) echo ${UNAME_MACHINE}-pc-aros exit ;; x86_64:VMkernel:*:*) echo ${UNAME_MACHINE}-unknown-esx exit ;; esac cat >&2 < in order to provide the needed information to handle your system. config.guess timestamp = $timestamp uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = ${UNAME_MACHINE} UNAME_RELEASE = ${UNAME_RELEASE} UNAME_SYSTEM = ${UNAME_SYSTEM} UNAME_VERSION = ${UNAME_VERSION} EOF exit 1 # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: GPX-2.5.2/build-aux/config.sub000077500000000000000000001057751271205255700160600ustar00rootroot00000000000000#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2014 Free Software Foundation, Inc. timestamp='2014-09-11' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches with a ChangeLog entry to config-patches@gnu.org. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS $0 [OPTION] ALIAS Canonicalize a configuration name. Operation modes: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2014 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try \`$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" exit 1 ;; *local*) # First pass through any local machine types. echo $1 exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ linux-musl* | linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ knetbsd*-gnu* | netbsd*-gnu* | \ kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` ;; android-linux) os=-linux-android basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown ;; *) basic_machine=`echo $1 | sed 's/-[^-]*$//'` if [ $basic_machine != $1 ] then os=`echo $1 | sed 's/.*-/-/'` else os=; fi ;; esac ### Let's recognize common machines as not being operating systems so ### that things like config.sub decstation-3100 work. We also ### recognize some manufacturers as not being operating systems, so we ### can provide default operating systems below. case $os in -sun*os*) # Prevent following clause from handling this invalid input. ;; -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -apple | -axis | -knuth | -cray | -microblaze*) os= basic_machine=$1 ;; -bluegene*) os=-cnk ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 ;; -scout) ;; -wrs) os=-vxworks basic_machine=$1 ;; -chorusos*) os=-chorusos basic_machine=$1 ;; -chorusrdb) os=-chorusrdb basic_machine=$1 ;; -hiux*) os=-hiuxwe2 ;; -sco6) os=-sco5v6 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5) os=-sco3.2v5 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco4) os=-sco3.2v4 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2.[4-9]*) os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco3.2v[4-9]*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco5v6*) # Don't forget version if it is 3.2v4 or newer. basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -sco*) os=-sco3.2v2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -udk*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -isc) os=-isc2.2 basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -clix*) basic_machine=clipper-intergraph ;; -isc*) basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` ;; -lynx*178) os=-lynxos178 ;; -lynx*5) os=-lynxos5 ;; -lynx*) os=-lynxos ;; -ptx*) basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` ;; -windowsnt*) os=`echo $os | sed -e 's/windowsnt/winnt/'` ;; -psos*) os=-psos ;; -mint | -mint[0-9]*) basic_machine=m68k-atari os=-mint ;; esac # Decode aliases for certain CPU-COMPANY combinations. case $basic_machine in # Recognize the basic CPU types without company name. # Some are omitted here because they have special meanings below. 1750a | 580 \ | a29k \ | aarch64 | aarch64_be \ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ | am33_2.0 \ | arc | arceb \ | arm | arm[bl]e | arme[lb] | armv[2-8] | armv[3-8][lb] | armv7[arm] \ | avr | avr32 \ | be32 | be64 \ | bfin \ | c4x | c8051 | clipper \ | d10v | d30v | dlx | dsp16xx \ | epiphany \ | fido | fr30 | frv \ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | hexagon \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ | k1om \ | le32 | le64 \ | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | microblazeel | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ | mips16 \ | mips64 | mips64el \ | mips64octeon | mips64octeonel \ | mips64orion | mips64orionel \ | mips64r5900 | mips64r5900el \ | mips64vr | mips64vrel \ | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el \ | mips64vr5000 | mips64vr5000el \ | mips64vr5900 | mips64vr5900el \ | mipsisa32 | mipsisa32el \ | mipsisa32r2 | mipsisa32r2el \ | mipsisa32r6 | mipsisa32r6el \ | mipsisa64 | mipsisa64el \ | mipsisa64r2 | mipsisa64r2el \ | mipsisa64r6 | mipsisa64r6el \ | mipsisa64sb1 | mipsisa64sb1el \ | mipsisa64sr71k | mipsisa64sr71kel \ | mipsr5900 | mipsr5900el \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ | moxie \ | mt \ | msp430 \ | nds32 | nds32le | nds32be \ | nios | nios2 | nios2eb | nios2el \ | ns16k | ns32k \ | open8 | or1k | or1knd | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle \ | pyramid \ | riscv32 | riscv64 \ | rl78 | rx \ | score \ | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu \ | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ | ubicom32 \ | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ | we32k \ | x86 | xc16x | xstormy16 | xtensa \ | z8k | z80) basic_machine=$basic_machine-unknown ;; c54x) basic_machine=tic54x-unknown ;; c55x) basic_machine=tic55x-unknown ;; c6x) basic_machine=tic6x-unknown ;; m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | nvptx | picochip) basic_machine=$basic_machine-unknown os=-none ;; m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) ;; ms1) basic_machine=mt-unknown ;; strongarm | thumb | xscale) basic_machine=arm-unknown ;; xgate) basic_machine=$basic_machine-unknown os=-none ;; xscaleeb) basic_machine=armeb-unknown ;; xscaleel) basic_machine=armel-unknown ;; # We use `pc' rather than `unknown' # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) basic_machine=$basic_machine-pc ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; # Recognize the basic CPU types with company name. 580-* \ | a29k-* \ | aarch64-* | aarch64_be-* \ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* | arceb-* \ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | be32-* | be64-* \ | bfin-* | bs2000-* \ | c[123]* | c30-* | [cjt]90-* | c4x-* \ | c8051-* | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ | h8300-* | h8500-* \ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | hexagon-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ | k1om-* \ | le32-* | le64-* \ | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ | microblaze-* | microblazeel-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ | mips64octeon-* | mips64octeonel-* \ | mips64orion-* | mips64orionel-* \ | mips64r5900-* | mips64r5900el-* \ | mips64vr-* | mips64vrel-* \ | mips64vr4100-* | mips64vr4100el-* \ | mips64vr4300-* | mips64vr4300el-* \ | mips64vr5000-* | mips64vr5000el-* \ | mips64vr5900-* | mips64vr5900el-* \ | mipsisa32-* | mipsisa32el-* \ | mipsisa32r2-* | mipsisa32r2el-* \ | mipsisa32r6-* | mipsisa32r6el-* \ | mipsisa64-* | mipsisa64el-* \ | mipsisa64r2-* | mipsisa64r2el-* \ | mipsisa64r6-* | mipsisa64r6el-* \ | mipsisa64sb1-* | mipsisa64sb1el-* \ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ | mipsr5900-* | mipsr5900el-* \ | mipstx39-* | mipstx39el-* \ | mmix-* \ | mt-* \ | msp430-* \ | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* | nios2eb-* | nios2el-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | open8-* \ | or1k*-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ | pyramid-* \ | rl78-* | romp-* | rs6000-* | rx-* \ | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ | tahoe-* \ | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ | tile*-* \ | tron-* \ | ubicom32-* \ | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) basic_machine=$basic_machine-unknown ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 386bsd) basic_machine=i386-unknown os=-bsd ;; 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) basic_machine=m68000-att ;; 3b*) basic_machine=we32k-att ;; a29khif) basic_machine=a29k-amd os=-udi ;; abacus) basic_machine=abacus-unknown ;; adobe68k) basic_machine=m68010-adobe os=-scout ;; alliant | fx80) basic_machine=fx80-alliant ;; altos | altos3068) basic_machine=m68k-altos ;; am29k) basic_machine=a29k-none os=-bsd ;; amd64) basic_machine=x86_64-pc ;; amd64-*) basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; amdahl) basic_machine=580-amdahl os=-sysv ;; amiga | amiga-*) basic_machine=m68k-unknown ;; amigaos | amigados) basic_machine=m68k-unknown os=-amigaos ;; amigaunix | amix) basic_machine=m68k-unknown os=-sysv4 ;; apollo68) basic_machine=m68k-apollo os=-sysv ;; apollo68bsd) basic_machine=m68k-apollo os=-bsd ;; aros) basic_machine=i386-pc os=-aros ;; aux) basic_machine=m68k-apple os=-aux ;; balance) basic_machine=ns32k-sequent os=-dynix ;; blackfin) basic_machine=bfin-unknown os=-linux ;; blackfin-*) basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; bluegene*) basic_machine=powerpc-ibm os=-cnk ;; c54x-*) basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c55x-*) basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c6x-*) basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` ;; c90) basic_machine=c90-cray os=-unicos ;; cegcc) basic_machine=arm-unknown os=-cegcc ;; convex-c1) basic_machine=c1-convex os=-bsd ;; convex-c2) basic_machine=c2-convex os=-bsd ;; convex-c32) basic_machine=c32-convex os=-bsd ;; convex-c34) basic_machine=c34-convex os=-bsd ;; convex-c38) basic_machine=c38-convex os=-bsd ;; cray | j90) basic_machine=j90-cray os=-unicos ;; craynv) basic_machine=craynv-cray os=-unicosmp ;; cr16 | cr16-*) basic_machine=cr16-unknown os=-elf ;; crds | unos) basic_machine=m68k-crds ;; crisv32 | crisv32-* | etraxfs*) basic_machine=crisv32-axis ;; cris | cris-* | etrax*) basic_machine=cris-axis ;; crx) basic_machine=crx-unknown os=-elf ;; da30 | da30-*) basic_machine=m68k-da30 ;; decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) basic_machine=mips-dec ;; decsystem10* | dec10*) basic_machine=pdp10-dec os=-tops10 ;; decsystem20* | dec20*) basic_machine=pdp10-dec os=-tops20 ;; delta | 3300 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) basic_machine=m68k-motorola ;; delta88) basic_machine=m88k-motorola os=-sysv3 ;; dicos) basic_machine=i686-pc os=-dicos ;; djgpp) basic_machine=i586-pc os=-msdosdjgpp ;; dpx20 | dpx20-*) basic_machine=rs6000-bull os=-bosx ;; dpx2* | dpx2*-bull) basic_machine=m68k-bull os=-sysv3 ;; ebmon29k) basic_machine=a29k-amd os=-ebmon ;; elxsi) basic_machine=elxsi-elxsi os=-bsd ;; encore | umax | mmax) basic_machine=ns32k-encore ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson os=-ose ;; fx2800) basic_machine=i860-alliant ;; genix) basic_machine=ns32k-ns ;; gmicro) basic_machine=tron-gmicro os=-sysv ;; go32) basic_machine=i386-pc os=-go32 ;; h3050r* | hiux*) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; h8300hms) basic_machine=h8300-hitachi os=-hms ;; h8300xray) basic_machine=h8300-hitachi os=-xray ;; h8500hms) basic_machine=h8500-hitachi os=-hms ;; harris) basic_machine=m88k-harris os=-sysv3 ;; hp300-*) basic_machine=m68k-hp ;; hp300bsd) basic_machine=m68k-hp os=-bsd ;; hp300hpux) basic_machine=m68k-hp os=-hpux ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) basic_machine=m68000-hp ;; hp9k3[2-9][0-9]) basic_machine=m68k-hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) basic_machine=hppa1.0-hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) basic_machine=hppa1.1-hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp basic_machine=hppa1.1-hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) basic_machine=hppa1.1-hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) basic_machine=hppa1.0-hp ;; hppa-next) os=-nextstep3 ;; hppaosf) basic_machine=hppa1.1-hp os=-osf ;; hppro) basic_machine=hppa1.1-hp os=-proelf ;; i370-ibm* | ibm*) basic_machine=i370-ibm ;; i*86v32) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv32 ;; i*86v4*) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv4 ;; i*86v) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-sysv ;; i*86sol2) basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` os=-solaris2 ;; i386mach) basic_machine=i386-mach os=-mach ;; i386-vsta | vsta) basic_machine=i386-unknown os=-vsta ;; iris | iris4d) basic_machine=mips-sgi case $os in -irix*) ;; *) os=-irix4 ;; esac ;; isi68 | isi) basic_machine=m68k-isi os=-sysv ;; m68knommu) basic_machine=m68k-unknown os=-linux ;; m68knommu-*) basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; m88k-omron*) basic_machine=m88k-omron ;; magnum | m3230) basic_machine=mips-mips os=-sysv ;; merlin) basic_machine=ns32k-utek os=-sysv ;; microblaze*) basic_machine=microblaze-xilinx ;; mingw64) basic_machine=x86_64-pc os=-mingw64 ;; mingw32) basic_machine=i686-pc os=-mingw32 ;; mingw32ce) basic_machine=arm-unknown os=-mingw32ce ;; miniframe) basic_machine=m68000-convergent ;; *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) basic_machine=m68k-atari os=-mint ;; mips3*-*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` ;; mips3*) basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown ;; monitor) basic_machine=m68k-rom68k os=-coff ;; morphos) basic_machine=powerpc-unknown os=-morphos ;; moxiebox) basic_machine=moxie-unknown os=-moxiebox ;; msdos) basic_machine=i386-pc os=-msdos ;; ms1-*) basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` ;; msys) basic_machine=i686-pc os=-msys ;; mvs) basic_machine=i370-ibm os=-mvs ;; nacl) basic_machine=le32-unknown os=-nacl ;; ncr3000) basic_machine=i486-ncr os=-sysv4 ;; netbsd386) basic_machine=i386-unknown os=-netbsd ;; netwinder) basic_machine=armv4l-rebel os=-linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony os=-newsos ;; news1000) basic_machine=m68030-sony os=-newsos ;; news-3600 | risc-news) basic_machine=mips-sony os=-newsos ;; necv70) basic_machine=v70-nec os=-sysv ;; next | m*-next ) basic_machine=m68k-next case $os in -nextstep* ) ;; -ns2*) os=-nextstep2 ;; *) os=-nextstep3 ;; esac ;; nh3000) basic_machine=m68k-harris os=-cxux ;; nh[45]000) basic_machine=m88k-harris os=-cxux ;; nindy960) basic_machine=i960-intel os=-nindy ;; mon960) basic_machine=i960-intel os=-mon960 ;; nonstopux) basic_machine=mips-compaq os=-nonstopux ;; np1) basic_machine=np1-gould ;; neo-tandem) basic_machine=neo-tandem ;; nse-tandem) basic_machine=nse-tandem ;; nsr-tandem) basic_machine=nsr-tandem ;; op50n-* | op60c-*) basic_machine=hppa1.1-oki os=-proelf ;; openrisc | openrisc-*) basic_machine=or32-unknown ;; os400) basic_machine=powerpc-ibm os=-os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson os=-ose ;; os68k) basic_machine=m68k-none os=-os68k ;; pa-hitachi) basic_machine=hppa1.1-hitachi os=-hiuxwe2 ;; paragon) basic_machine=i860-intel os=-osf ;; parisc) basic_machine=hppa-unknown os=-linux ;; parisc-*) basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; pbd) basic_machine=sparc-tti ;; pbb) basic_machine=m68k-tti ;; pc532 | pc532-*) basic_machine=ns32k-pc532 ;; pc98) basic_machine=i386-pc ;; pc98-*) basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium | p5 | k5 | k6 | nexgen | viac3) basic_machine=i586-pc ;; pentiumpro | p6 | 6x86 | athlon | athlon_*) basic_machine=i686-pc ;; pentiumii | pentium2 | pentiumiii | pentium3) basic_machine=i686-pc ;; pentium4) basic_machine=i786-pc ;; pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumpro-* | p6-* | 6x86-* | athlon-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pentium4-*) basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ;; pn) basic_machine=pn-gould ;; power) basic_machine=power-ibm ;; ppc | ppcbe) basic_machine=powerpc-unknown ;; ppc-* | ppcbe-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppcle | powerpclittle | ppc-le | powerpc-little) basic_machine=powerpcle-unknown ;; ppcle-* | powerpclittle-*) basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64) basic_machine=powerpc64-unknown ;; ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ppc64le | powerpc64little | ppc64-le | powerpc64-little) basic_machine=powerpc64le-unknown ;; ppc64le-* | powerpc64little-*) basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ;; ps2) basic_machine=i386-ibm ;; pw32) basic_machine=i586-unknown os=-pw32 ;; rdos | rdos64) basic_machine=x86_64-pc os=-rdos ;; rdos32) basic_machine=i386-pc os=-rdos ;; rom68k) basic_machine=m68k-rom68k os=-coff ;; rm[46]00) basic_machine=mips-siemens ;; rtpc | rtpc-*) basic_machine=romp-ibm ;; s390 | s390-*) basic_machine=s390-ibm ;; s390x | s390x-*) basic_machine=s390x-ibm ;; sa29200) basic_machine=a29k-amd os=-udi ;; sb1) basic_machine=mipsisa64sb1-unknown ;; sb1el) basic_machine=mipsisa64sb1el-unknown ;; sde) basic_machine=mipsisa32-sde os=-elf ;; sei) basic_machine=mips-sei os=-seiux ;; sequent) basic_machine=i386-sequent ;; sh) basic_machine=sh-hitachi os=-hms ;; sh5el) basic_machine=sh5le-unknown ;; sh64) basic_machine=sh64-unknown ;; sparclite-wrs | simso-wrs) basic_machine=sparclite-wrs os=-vxworks ;; sps7) basic_machine=m68k-bull os=-sysv2 ;; spur) basic_machine=spur-unknown ;; st2000) basic_machine=m68k-tandem ;; stratus) basic_machine=i860-stratus os=-sysv4 ;; strongarm-* | thumb-*) basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` ;; sun2) basic_machine=m68000-sun ;; sun2os3) basic_machine=m68000-sun os=-sunos3 ;; sun2os4) basic_machine=m68000-sun os=-sunos4 ;; sun3os3) basic_machine=m68k-sun os=-sunos3 ;; sun3os4) basic_machine=m68k-sun os=-sunos4 ;; sun4os3) basic_machine=sparc-sun os=-sunos3 ;; sun4os4) basic_machine=sparc-sun os=-sunos4 ;; sun4sol2) basic_machine=sparc-sun os=-solaris2 ;; sun3 | sun3-*) basic_machine=m68k-sun ;; sun4) basic_machine=sparc-sun ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun ;; sv1) basic_machine=sv1-cray os=-unicos ;; symmetry) basic_machine=i386-sequent os=-dynix ;; t3e) basic_machine=alphaev5-cray os=-unicos ;; t90) basic_machine=t90-cray os=-unicos ;; tile*) basic_machine=$basic_machine-unknown os=-linux-gnu ;; tx39) basic_machine=mipstx39-unknown ;; tx39el) basic_machine=mipstx39el-unknown ;; toad1) basic_machine=pdp10-xkl os=-tops20 ;; tower | tower-32) basic_machine=m68k-ncr ;; tpf) basic_machine=s390x-ibm os=-tpf ;; udi29k) basic_machine=a29k-amd os=-udi ;; ultra3) basic_machine=a29k-nyu os=-sym1 ;; v810 | necv810) basic_machine=v810-nec os=-none ;; vaxv) basic_machine=vax-dec os=-sysv ;; vms) basic_machine=vax-dec os=-vms ;; vpp*|vx|vx-*) basic_machine=f301-fujitsu ;; vxworks960) basic_machine=i960-wrs os=-vxworks ;; vxworks68) basic_machine=m68k-wrs os=-vxworks ;; vxworks29k) basic_machine=a29k-wrs os=-vxworks ;; w65*) basic_machine=w65-wdc os=-none ;; w89k-*) basic_machine=hppa1.1-winbond os=-proelf ;; xbox) basic_machine=i686-pc os=-mingw32 ;; xps | xps100) basic_machine=xps100-honeywell ;; xscale-* | xscalee[bl]-*) basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` ;; ymp) basic_machine=ymp-cray os=-unicos ;; z8k-*-coff) basic_machine=z8k-unknown os=-sim ;; z80-*-coff) basic_machine=z80-unknown os=-sim ;; none) basic_machine=none-none os=-none ;; # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) basic_machine=hppa1.1-winbond ;; op50n) basic_machine=hppa1.1-oki ;; op60c) basic_machine=hppa1.1-oki ;; romp) basic_machine=romp-ibm ;; mmix) basic_machine=mmix-knuth ;; rs6000) basic_machine=rs6000-ibm ;; vax) basic_machine=vax-dec ;; pdp10) # there are many clones, so DEC is not a safe bet basic_machine=pdp10-unknown ;; pdp11) basic_machine=pdp11-dec ;; we32k) basic_machine=we32k-att ;; sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) basic_machine=sparc-sun ;; cydra) basic_machine=cydra-cydrome ;; orion) basic_machine=orion-highlevel ;; orion105) basic_machine=clipper-highlevel ;; mac | mpw | mac-mpw) basic_machine=m68k-apple ;; pmac | pmac-mpw) basic_machine=powerpc-apple ;; *-unknown) # Make sure to match an already-canonicalized machine name. ;; *) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 exit 1 ;; esac # Here we canonicalize certain aliases for manufacturers. case $basic_machine in *-digital*) basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` ;; *-commodore*) basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if [ x"$os" != x"" ] then case $os in # First match some system type aliases # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. -auroraux) os=-auroraux ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; -solaris) os=-solaris2 ;; -svr4*) os=-sysv4 ;; -unixware*) os=-sysv4.2uw ;; -gnu/linux*) os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` ;; # First accept the basic system types. # The portable systems comes first. # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ | -sym* | -kopensolaris* | -plan9* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ | -bitrig* | -openbsd* | -solidbsd* \ | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -msys* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -mingw32* | -mingw64* | -linux-gnu* | -linux-android* \ | -linux-newlib* | -linux-musl* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* | -moxiebox* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -tirtos*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) case $basic_machine in x86-* | i*86-*) ;; *) os=-nto$os ;; esac ;; -nto-qnx*) ;; -nto*) os=`echo $os | sed -e 's|nto|nto-qnx|'` ;; -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) ;; -mac*) os=`echo $os | sed -e 's|mac|macos|'` ;; -linux-dietlibc) os=-linux-dietlibc ;; -linux*) os=`echo $os | sed -e 's|linux|linux-gnu|'` ;; -sunos5*) os=`echo $os | sed -e 's|sunos5|solaris2|'` ;; -sunos6*) os=`echo $os | sed -e 's|sunos6|solaris3|'` ;; -opened*) os=-openedition ;; -os400*) os=-os400 ;; -wince*) os=-wince ;; -osfrose*) os=-osfrose ;; -osf*) os=-osf ;; -utek*) os=-bsd ;; -dynix*) os=-bsd ;; -acis*) os=-aos ;; -atheos*) os=-atheos ;; -syllable*) os=-syllable ;; -386bsd) os=-bsd ;; -ctix* | -uts*) os=-sysv ;; -nova*) os=-rtmk-nova ;; -ns2 ) os=-nextstep2 ;; -nsk*) os=-nsk ;; # Preserve the version number of sinix5. -sinix5.*) os=`echo $os | sed -e 's|sinix|sysv|'` ;; -sinix*) os=-sysv4 ;; -tpf*) os=-tpf ;; -triton*) os=-sysv3 ;; -oss*) os=-sysv3 ;; -svr4) os=-sysv4 ;; -svr3) os=-sysv3 ;; -sysvr4) os=-sysv4 ;; # This must come after -sysvr4. -sysv*) ;; -ose*) os=-ose ;; -es1800*) os=-ose ;; -xenix) os=-xenix ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) os=-mint ;; -aros*) os=-aros ;; -zvmoe) os=-zvmoe ;; -dicos*) os=-dicos ;; -nacl*) ;; -none) ;; *) # Get rid of the `-' at the beginning of $os. os=`echo $os | sed 's/[^-]*-//'` echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 exit 1 ;; esac else # Here we handle the default operating systems that come with various machines. # The value should be what the vendor currently ships out the door with their # machine or put another way, the most popular os provided with the machine. # Note that if you're going to try to match "-MANUFACTURER" here (say, # "-sun"), then you have to tell the case statement up towards the top # that MANUFACTURER isn't an operating system. Otherwise, code above # will signal an error saying that MANUFACTURER isn't an operating # system, and we'll never get to this point. case $basic_machine in score-*) os=-elf ;; spu-*) os=-elf ;; *-acorn) os=-riscix1.2 ;; arm*-rebel) os=-linux ;; arm*-semi) os=-aout ;; c4x-* | tic4x-*) os=-coff ;; c8051-*) os=-elf ;; hexagon-*) os=-elf ;; tic54x-*) os=-coff ;; tic55x-*) os=-coff ;; tic6x-*) os=-coff ;; # This must come before the *-dec entry. pdp10-*) os=-tops20 ;; pdp11-*) os=-none ;; *-dec | vax-*) os=-ultrix4.2 ;; m68*-apollo) os=-domain ;; i386-sun) os=-sunos4.0.2 ;; m68000-sun) os=-sunos3 ;; m68*-cisco) os=-aout ;; mep-*) os=-elf ;; mips*-cisco) os=-elf ;; mips*-*) os=-elf ;; or32-*) os=-coff ;; *-tti) # must be before sparc entry or we get the wrong os. os=-sysv3 ;; sparc-* | *-sun) os=-sunos4.1.1 ;; *-be) os=-beos ;; *-haiku) os=-haiku ;; *-ibm) os=-aix ;; *-knuth) os=-mmixware ;; *-wec) os=-proelf ;; *-winbond) os=-proelf ;; *-oki) os=-proelf ;; *-hp) os=-hpux ;; *-hitachi) os=-hiux ;; i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) os=-sysv ;; *-cbm) os=-amigaos ;; *-dg) os=-dgux ;; *-dolphin) os=-sysv3 ;; m68k-ccur) os=-rtu ;; m88k-omron*) os=-luna ;; *-next ) os=-nextstep ;; *-sequent) os=-ptx ;; *-crds) os=-unos ;; *-ns) os=-genix ;; i370-*) os=-mvs ;; *-next) os=-nextstep3 ;; *-gould) os=-sysv ;; *-highlevel) os=-bsd ;; *-encore) os=-bsd ;; *-sgi) os=-irix ;; *-siemens) os=-sysv4 ;; *-masscomp) os=-rtu ;; f30[01]-fujitsu | f700-fujitsu) os=-uxpv ;; *-rom68k) os=-coff ;; *-*bug) os=-coff ;; *-apple) os=-macos ;; *-atari*) os=-mint ;; *) os=-none ;; esac fi # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. vendor=unknown case $basic_machine in *-unknown) case $os in -riscix*) vendor=acorn ;; -sunos*) vendor=sun ;; -cnk*|-aix*) vendor=ibm ;; -beos*) vendor=be ;; -hpux*) vendor=hp ;; -mpeix*) vendor=hp ;; -hiux*) vendor=hitachi ;; -unos*) vendor=crds ;; -dgux*) vendor=dg ;; -luna*) vendor=omron ;; -genix*) vendor=ns ;; -mvs* | -opened*) vendor=ibm ;; -os400*) vendor=ibm ;; -ptx*) vendor=sequent ;; -tpf*) vendor=ibm ;; -vxsim* | -vxworks* | -windiss*) vendor=wrs ;; -aux*) vendor=apple ;; -hms*) vendor=hitachi ;; -mpw* | -macos*) vendor=apple ;; -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) vendor=atari ;; -vos*) vendor=stratus ;; esac basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` ;; esac echo $basic_machine$os exit # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: GPX-2.5.2/build-aux/depcomp000077500000000000000000000560161271205255700154430ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects scriptversion=2013-05-30.07; # UTC # Copyright (C) 1999-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . case $1 in '') echo "$0: No command. Try '$0 --help' for more information." 1>&2 exit 1; ;; -h | --h*) cat <<\EOF Usage: depcomp [--help] [--version] PROGRAM [ARGS] Run PROGRAMS ARGS to compile a file, generating dependencies as side-effects. Environment variables: depmode Dependency tracking mode. source Source file read by 'PROGRAMS ARGS'. object Object file output by 'PROGRAMS ARGS'. DEPDIR directory where to store dependencies. depfile Dependency file to output. tmpdepfile Temporary file to use when outputting dependencies. libtool Whether libtool is used (yes/no). Report bugs to . EOF exit $? ;; -v | --v*) echo "depcomp $scriptversion" exit $? ;; esac # Get the directory component of the given path, and save it in the # global variables '$dir'. Note that this directory component will # be either empty or ending with a '/' character. This is deliberate. set_dir_from () { case $1 in */*) dir=`echo "$1" | sed -e 's|/[^/]*$|/|'`;; *) dir=;; esac } # Get the suffix-stripped basename of the given path, and save it the # global variable '$base'. set_base_from () { base=`echo "$1" | sed -e 's|^.*/||' -e 's/\.[^.]*$//'` } # If no dependency file was actually created by the compiler invocation, # we still have to create a dummy depfile, to avoid errors with the # Makefile "include basename.Plo" scheme. make_dummy_depfile () { echo "#dummy" > "$depfile" } # Factor out some common post-processing of the generated depfile. # Requires the auxiliary global variable '$tmpdepfile' to be set. aix_post_process_depfile () { # If the compiler actually managed to produce a dependency file, # post-process it. if test -f "$tmpdepfile"; then # Each line is of the form 'foo.o: dependency.h'. # Do two passes, one to just change these to # $object: dependency.h # and one to simply output # dependency.h: # which is needed to avoid the deleted-header problem. { sed -e "s,^.*\.[$lower]*:,$object:," < "$tmpdepfile" sed -e "s,^.*\.[$lower]*:[$tab ]*,," -e 's,$,:,' < "$tmpdepfile" } > "$depfile" rm -f "$tmpdepfile" else make_dummy_depfile fi } # A tabulation character. tab=' ' # A newline character. nl=' ' # Character ranges might be problematic outside the C locale. # These definitions help. upper=ABCDEFGHIJKLMNOPQRSTUVWXYZ lower=abcdefghijklmnopqrstuvwxyz digits=0123456789 alpha=${upper}${lower} if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # Dependencies for sub/bar.o or sub/bar.obj go into sub/.deps/bar.Po. depfile=${depfile-`echo "$object" | sed 's|[^\\/]*$|'${DEPDIR-.deps}'/&|;s|\.\([^.]*\)$|.P\1|;s|Pobj$|Po|'`} tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Avoid interferences from the environment. gccflag= dashmflag= # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi cygpath_u="cygpath -u -f -" if test "$depmode" = msvcmsys; then # This is just like msvisualcpp but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvisualcpp fi if test "$depmode" = msvc7msys; then # This is just like msvc7 but w/o cygpath translation. # Just convert the backslash-escaped backslashes to single forward # slashes to satisfy depend.m4 cygpath_u='sed s,\\\\,/,g' depmode=msvc7 fi if test "$depmode" = xlc; then # IBM C/C++ Compilers xlc/xlC can output gcc-like dependency information. gccflag=-qmakedep=gcc,-MF depmode=gcc fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. ## Unfortunately, FreeBSD c89 acceptance of flags depends upon ## the command line argument order; so add the flags where they ## appear in depend2.am. Note that the slowdown incurred here ## affects only configure: in makefiles, %FASTDEP% shortcuts this. for arg do case $arg in -c) set fnord "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" "$arg" ;; *) set fnord "$@" "$arg" ;; esac shift # fnord shift # $arg done "$@" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## Note that this doesn't just cater to obsosete pre-3.x GCC compilers. ## but also to in-use compilers like IMB xlc/xlC and the HP C compiler. ## (see the conditional assignment to $gccflag above). ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). Also, it might not be ## supported by the other compilers which use the 'gcc' depmode. ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The second -e expression handles DOS-style file names with drive # letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the "deleted header file" problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. ## Some versions of gcc put a space before the ':'. On the theory ## that the space means something, we add a space to the output as ## well. hp depmode also adds that space, but also prefixes the VPATH ## to the object. Take care to not repeat it in the output. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e "s|.*$object$||" -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like '#:fec' to the end of the # dependency line. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' \ | tr "$nl" ' ' >> "$depfile" echo >> "$depfile" # The second pass generates a dummy entry for each header file. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" ;; xlc) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. In older versions, this file always lives in the # current directory. Also, the AIX compiler puts '$object:' at the # start of each line; $object doesn't have directory information. # Version 6 uses the directory in both cases. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.u tmpdepfile2=$base.u tmpdepfile3=$dir.libs/$base.u "$@" -Wc,-M else tmpdepfile1=$dir$base.u tmpdepfile2=$dir$base.u tmpdepfile3=$dir$base.u "$@" -M fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done aix_post_process_depfile ;; tcc) # tcc (Tiny C Compiler) understand '-MD -MF file' since version 0.9.26 # FIXME: That version still under development at the moment of writing. # Make that this statement remains true also for stable, released # versions. # It will wrap lines (doesn't matter whether long or short) with a # trailing '\', as in: # # foo.o : \ # foo.c \ # foo.h \ # # It will put a trailing '\' even on the last line, and will use leading # spaces rather than leading tabs (at least since its commit 0394caf7 # "Emit spaces for -MD"). "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each non-empty line is of the form 'foo.o : \' or ' dep.h \'. # We have to change lines of the first kind to '$object: \'. sed -e "s|.*:|$object :|" < "$tmpdepfile" > "$depfile" # And for each line of the second kind, we have to emit a 'dep.h:' # dummy dependency, to avoid the deleted-header problem. sed -n -e 's|^ *\(.*\) *\\$|\1:|p' < "$tmpdepfile" >> "$depfile" rm -f "$tmpdepfile" ;; ## The order of this option in the case statement is important, since the ## shell code in configure will try each of these formats in the order ## listed in this file. A plain '-MD' option would be understood by many ## compilers, so we must ensure this comes after the gcc and icc options. pgcc) # Portland's C compiler understands '-MD'. # Will always output deps to 'file.d' where file is the root name of the # source file under compilation, even if file resides in a subdirectory. # The object file name does not affect the name of the '.d' file. # pgcc 10.2 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using '\' : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... set_dir_from "$object" # Use the source, not the object, to determine the base name, since # that's sadly what pgcc will do too. set_base_from "$source" tmpdepfile=$base.d # For projects that build the same source file twice into different object # files, the pgcc approach of using the *source* file root name can cause # problems in parallel builds. Use a locking strategy to avoid stomping on # the same $tmpdepfile. lockdir=$base.d-lock trap " echo '$0: caught signal, cleaning up...' >&2 rmdir '$lockdir' exit 1 " 1 2 13 15 numtries=100 i=$numtries while test $i -gt 0; do # mkdir is a portable test-and-set. if mkdir "$lockdir" 2>/dev/null; then # This process acquired the lock. "$@" -MD stat=$? # Release the lock. rmdir "$lockdir" break else # If the lock is being held by a different process, wait # until the winning process is done or we timeout. while test -d "$lockdir" && test $i -gt 0; do sleep 1 i=`expr $i - 1` done fi i=`expr $i - 1` done trap - 1 2 13 15 if test $i -le 0; then echo "$0: failed to acquire lock after $numtries attempts" >&2 echo "$0: check lockdir '$lockdir'" >&2 exit 1 fi if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp2) # The "hp" stanza above does not work with aCC (C++) and HP's ia64 # compilers, which have integrated preprocessors. The correct option # to use with these is +Maked; it writes dependencies to a file named # 'foo.d', which lands next to the object file, wherever that # happens to be. # Much of this is similar to the tru64 case; see comments there. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then tmpdepfile1=$dir$base.d tmpdepfile2=$dir.libs/$base.d "$@" -Wc,+Maked else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d "$@" +Maked fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" do test -f "$tmpdepfile" && break done if test -f "$tmpdepfile"; then sed -e "s,^.*\.[$lower]*:,$object:," "$tmpdepfile" > "$depfile" # Add 'dependent.h:' lines. sed -ne '2,${ s/^ *// s/ \\*$// s/$/:/ p }' "$tmpdepfile" >> "$depfile" else make_dummy_depfile fi rm -f "$tmpdepfile" "$tmpdepfile2" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. 'cc -MD -o foo.o ...' puts the dependencies into 'foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in 'foo.d' instead, so we check for that too. # Subdirectories are respected. set_dir_from "$object" set_base_from "$object" if test "$libtool" = yes; then # Libtool generates 2 separate objects for the 2 libraries. These # two compilations output dependencies in $dir.libs/$base.o.d and # in $dir$base.o.d. We have to check for both files, because # one of the two compilations can be disabled. We should prefer # $dir$base.o.d over $dir.libs/$base.o.d because the latter is # automatically cleaned when .libs/ is deleted, while ignoring # the former would cause a distcleancheck panic. tmpdepfile1=$dir$base.o.d # libtool 1.5 tmpdepfile2=$dir.libs/$base.o.d # Likewise. tmpdepfile3=$dir.libs/$base.d # Compaq CCC V6.2-504 "$@" -Wc,-MD else tmpdepfile1=$dir$base.d tmpdepfile2=$dir$base.d tmpdepfile3=$dir$base.d "$@" -MD fi stat=$? if test $stat -ne 0; then rm -f "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" exit $stat fi for tmpdepfile in "$tmpdepfile1" "$tmpdepfile2" "$tmpdepfile3" do test -f "$tmpdepfile" && break done # Same post-processing that is required for AIX mode. aix_post_process_depfile ;; msvc7) if test "$libtool" = yes; then showIncludes=-Wc,-showIncludes else showIncludes=-showIncludes fi "$@" $showIncludes > "$tmpdepfile" stat=$? grep -v '^Note: including file: ' "$tmpdepfile" if test $stat -ne 0; then rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" # The first sed program below extracts the file names and escapes # backslashes for cygpath. The second sed program outputs the file # name when reading, but also accumulates all include files in the # hold buffer in order to output them again at the end. This only # works with sed implementations that can handle large buffers. sed < "$tmpdepfile" -n ' /^Note: including file: *\(.*\)/ { s//\1/ s/\\/\\\\/g p }' | $cygpath_u | sort -u | sed -n ' s/ /\\ /g s/\(.*\)/'"$tab"'\1 \\/p s/.\(.*\) \\/\1:/ H $ { s/.*/'"$tab"'/ G p }' >> "$depfile" echo >> "$depfile" # make sure the fragment doesn't end with a backslash rm -f "$tmpdepfile" ;; msvc7msys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for ':' # in the target name. This is to cope with DOS-style filenames: # a dependency such as 'c:/foo/bar' could be seen as target 'c' otherwise. "$@" $dashmflag | sed "s|^[$tab ]*[^:$tab ][^:][^:]*:[$tab ]*|$object: |" > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this sed invocation # correctly. Breaking it into two sed invocations is a workaround. tr ' ' "$nl" < "$tmpdepfile" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # X makedepend shift cleared=no eat=no for arg do case $cleared in no) set ""; shift cleared=yes ;; esac if test $eat = yes; then eat=no continue fi case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -arch) eat=yes ;; -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix=`echo "$object" | sed 's/^.*\././'` touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" # makedepend may prepend the VPATH from the source file name to the object. # No need to regex-escape $object, excess matching of '.' is harmless. sed "s|^.*\($object *:\)|\1|" "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process the last invocation # correctly. Breaking it into two sed invocations is a workaround. sed '1,2d' "$tmpdepfile" \ | tr ' ' "$nl" \ | sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' \ | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi # Remove '-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E \ | sed -n -e '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ -e '/^#line [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' \ | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the preprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test "X$1" != 'X--mode=compile'; do shift done shift fi IFS=" " for arg do case "$arg" in -o) shift ;; $object) shift ;; "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E 2>/dev/null | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::\1:p' | $cygpath_u | sort -u > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::'"$tab"'\1 \\:p' >> "$depfile" echo "$tab" >> "$depfile" sed < "$tmpdepfile" -n -e 's% %\\ %g' -e '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; msvcmsys) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 # Local Variables: # mode: shell-script # sh-indentation: 2 # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: GPX-2.5.2/build-aux/install-sh000077500000000000000000000345231271205255700160710ustar00rootroot00000000000000#!/bin/sh # install - install a program, script, or datafile scriptversion=2013-12-25.23; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # 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. # # 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 # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve the last data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -s $stripprog installed files. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -s) stripcmd=$stripprog;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename; won't work # if double slashes aren't ignored. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dst=$dstdir/`basename "$src"` dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # Create intermediate dirs using mode 755 as modified by the umask. # This is like FreeBSD 'install' as of 1997-10-28. umask=`umask` case $stripcmd.$umask in # Optimize common cases. *[2367][2367]) mkdir_umask=$umask;; .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;; *[0-7]) mkdir_umask=`expr $umask + 22 \ - $umask % 100 % 40 + $umask % 20 \ - $umask % 10 % 4 + $umask % 2 `;; *) mkdir_umask=$umask,go-w;; esac # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false case $umask in *[123567][0-7][0-7]) # POSIX mkdir -p sets u+wx bits regardless of umask, which # is incompatible with FreeBSD 'install' when (umask & 300) != 0. ;; *) tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0 if (umask $mkdir_umask && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. ls_ld_tmpdir=`ls -ld "$tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/d" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null fi trap '' 0;; esac;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # The umask is ridiculous, or mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask=$mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd -f "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: GPX-2.5.2/build-aux/missing000077500000000000000000000153301271205255700154570ustar00rootroot00000000000000#! /bin/sh # Common wrapper for a few potentially missing GNU programs. scriptversion=2013-10-28.13; # UTC # Copyright (C) 1996-2014 Free Software Foundation, Inc. # Originally written by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program. If not, see . # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try '$0 --help' for more information" exit 1 fi case $1 in --is-lightweight) # Used by our autoconf macros to check whether the available missing # script is modern enough. exit 0 ;; --run) # Back-compat with the calling convention used by older automake. shift ;; -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Run 'PROGRAM [ARGUMENT]...', returning a proper advice when this fails due to PROGRAM being missing or too old. Options: -h, --help display this help and exit -v, --version output version information and exit Supported PROGRAM values: aclocal autoconf autoheader autom4te automake makeinfo bison yacc flex lex help2man Version suffixes to PROGRAM as well as the prefixes 'gnu-', 'gnu', and 'g' are ignored when checking the name. Send bug reports to ." exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing $scriptversion (GNU Automake)" exit $? ;; -*) echo 1>&2 "$0: unknown '$1' option" echo 1>&2 "Try '$0 --help' for more information" exit 1 ;; esac # Run the given program, remember its exit status. "$@"; st=$? # If it succeeded, we are done. test $st -eq 0 && exit 0 # Also exit now if we it failed (or wasn't found), and '--version' was # passed; such an option is passed most likely to detect whether the # program is present and works. case $2 in --version|--help) exit $st;; esac # Exit code 63 means version mismatch. This often happens when the user # tries to use an ancient version of a tool on a file that requires a # minimum version. if test $st -eq 63; then msg="probably too old" elif test $st -eq 127; then # Program was missing. msg="missing on your system" else # Program was found and executed, but failed. Give up. exit $st fi perl_URL=http://www.perl.org/ flex_URL=http://flex.sourceforge.net/ gnu_software_URL=http://www.gnu.org/software program_details () { case $1 in aclocal|automake) echo "The '$1' program is part of the GNU Automake package:" echo "<$gnu_software_URL/automake>" echo "It also requires GNU Autoconf, GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/autoconf>" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; autoconf|autom4te|autoheader) echo "The '$1' program is part of the GNU Autoconf package:" echo "<$gnu_software_URL/autoconf/>" echo "It also requires GNU m4 and Perl in order to run:" echo "<$gnu_software_URL/m4/>" echo "<$perl_URL>" ;; esac } give_advice () { # Normalize program name to check for. normalized_program=`echo "$1" | sed ' s/^gnu-//; t s/^gnu//; t s/^g//; t'` printf '%s\n' "'$1' is $msg." configure_deps="'configure.ac' or m4 files included by 'configure.ac'" case $normalized_program in autoconf*) echo "You should only need it if you modified 'configure.ac'," echo "or m4 files included by it." program_details 'autoconf' ;; autoheader*) echo "You should only need it if you modified 'acconfig.h' or" echo "$configure_deps." program_details 'autoheader' ;; automake*) echo "You should only need it if you modified 'Makefile.am' or" echo "$configure_deps." program_details 'automake' ;; aclocal*) echo "You should only need it if you modified 'acinclude.m4' or" echo "$configure_deps." program_details 'aclocal' ;; autom4te*) echo "You might have modified some maintainer files that require" echo "the 'autom4te' program to be rebuilt." program_details 'autom4te' ;; bison*|yacc*) echo "You should only need it if you modified a '.y' file." echo "You may want to install the GNU Bison package:" echo "<$gnu_software_URL/bison/>" ;; lex*|flex*) echo "You should only need it if you modified a '.l' file." echo "You may want to install the Fast Lexical Analyzer package:" echo "<$flex_URL>" ;; help2man*) echo "You should only need it if you modified a dependency" \ "of a man page." echo "You may want to install the GNU Help2man package:" echo "<$gnu_software_URL/help2man/>" ;; makeinfo*) echo "You should only need it if you modified a '.texi' file, or" echo "any other file indirectly affecting the aspect of the manual." echo "You might want to install the Texinfo package:" echo "<$gnu_software_URL/texinfo/>" echo "The spurious makeinfo call might also be the consequence of" echo "using a buggy 'make' (AIX, DU, IRIX), in which case you might" echo "want to install GNU make:" echo "<$gnu_software_URL/make/>" ;; *) echo "You might have modified some files without having the proper" echo "tools for further handling them. Check the 'README' file, it" echo "often tells you about the needed prerequisites for installing" echo "this package. You may also peek at any GNU archive site, in" echo "case some other package contains this missing '$1' program." ;; esac } give_advice "$1" | sed -e '1s/^/WARNING: /' \ -e '2,$s/^/ /' >&2 # Propagate the correct exit status (expected to be 127 for a program # not found, 63 for a program that failed due to version mismatch). exit $st # Local variables: # eval: (add-hook 'write-file-hooks 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC" # time-stamp-end: "; # UTC" # End: GPX-2.5.2/configure000077500000000000000000005711341271205255700141060ustar00rootroot00000000000000#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.69 for gpx 2.5.2. # # Report bugs to . # # # Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # Use a proper internal environment variable to ensure we don't fall # into an infinite loop, continuously re-executing ourselves. if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then _as_can_reexec=no; export _as_can_reexec; # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 as_fn_exit 255 fi # We don't want this to propagate to other subprocesses. { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on \${1+\"\$@\"}, which # is contrary to our usage. Disable this feature. alias -g '\${1+\"\$@\"}'='\"\$@\"' setopt NO_GLOB_SUBST else case \`(set -o) 2>/dev/null\` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi " as_required="as_fn_return () { (exit \$1); } as_fn_success () { as_fn_return 0; } as_fn_failure () { as_fn_return 1; } as_fn_ret_success () { return 0; } as_fn_ret_failure () { return 1; } exitcode=0 as_fn_success || { exitcode=1; echo as_fn_success failed.; } as_fn_failure && { exitcode=1; echo as_fn_failure succeeded.; } as_fn_ret_success || { exitcode=1; echo as_fn_ret_success failed.; } as_fn_ret_failure && { exitcode=1; echo as_fn_ret_failure succeeded.; } if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi test x\$exitcode = x0 || exit 1 test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && test \"x\`expr \$as_lineno_1'\$as_run' + 1\`\" = \"x\$as_lineno_2'\$as_run'\"' || exit 1 test \$(( 1 + 1 )) = 2 || exit 1" if (eval "$as_required") 2>/dev/null; then : as_have_required=yes else as_have_required=no fi if test x$as_have_required = xyes && (eval "$as_suggested") 2>/dev/null; then : else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR as_found=false for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. as_found=: case $as_dir in #( /*) for as_base in sh bash ksh sh5; do # Try only shells that exist, to save several forks. as_shell=$as_dir/$as_base if { test -f "$as_shell" || test -f "$as_shell.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$as_shell"; } 2>/dev/null; then : CONFIG_SHELL=$as_shell as_have_required=yes if { $as_echo "$as_bourne_compatible""$as_suggested" | as_run=a "$as_shell"; } 2>/dev/null; then : break 2 fi fi done;; esac as_found=false done $as_found || { if { test -f "$SHELL" || test -f "$SHELL.exe"; } && { $as_echo "$as_bourne_compatible""$as_required" | as_run=a "$SHELL"; } 2>/dev/null; then : CONFIG_SHELL=$SHELL as_have_required=yes fi; } IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : export CONFIG_SHELL # We cannot yet assume a decent shell, so we have to provide a # neutralization value for shells without unset; and this also # works around shells that cannot unset nonexistent variables. # Preserve -v and -x to the replacement shell. BASH_ENV=/dev/null ENV=/dev/null (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV case $- in # (((( *v*x* | *x*v* ) as_opts=-vx ;; *v* ) as_opts=-v ;; *x* ) as_opts=-x ;; * ) as_opts= ;; esac exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} # Admittedly, this is quite paranoid, since all the known shells bail # out after a failed `exec'. $as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 exit 255 fi if test x$as_have_required = xno; then : $as_echo "$0: This script requires a shell more modern than all" $as_echo "$0: the shells that I found on your system." if test x${ZSH_VERSION+set} = xset ; then $as_echo "$0: In particular, zsh $ZSH_VERSION has bugs and should" $as_echo "$0: be upgraded to zsh 4.3.4 or later." else $as_echo "$0: Please tell bug-autoconf@gnu.org and $0: https://github.com/markwal/GPX/issues about your $0: system, including any error possibly output before this $0: message. Then install a modern shell, or manually run $0: the script under such a shell if you do have one." fi exit 1 fi fi fi SHELL=${CONFIG_SHELL-/bin/sh} export SHELL # Unset more variables known to interfere with behavior of common tools. CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS ## --------------------- ## ## M4sh Shell Functions. ## ## --------------------- ## # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits as_lineno_1=$LINENO as_lineno_1a=$LINENO as_lineno_2=$LINENO as_lineno_2a=$LINENO eval 'test "x$as_lineno_1'$as_run'" != "x$as_lineno_2'$as_run'" && test "x`expr $as_lineno_1'$as_run' + 1`" = "x$as_lineno_2'$as_run'"' || { # Blame Lee E. McMahon (1931-1989) for sed's syntax. :-) sed -n ' p /[$]LINENO/= ' <$as_myself | sed ' s/[$]LINENO.*/&-/ t lineno b :lineno N :loop s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/ t loop s/-\n.*// ' >$as_me.lineno && chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } # If we had to re-execute with $CONFIG_SHELL, we're ensured to have # already done that, so ensure we don't try to do so again and fall # in an infinite loop. This has already happened in practice. _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). . "./$as_me.lineno" # Exit status is that of the last command. exit } ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" test -n "$DJDIR" || exec 7<&0 &1 # Name of the host. # hostname on some systems (SVR3.2, old GNU/Linux) returns a bogus exit status, # so uname gets run too. ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` # # Initializations. # ac_default_prefix=/usr/local ac_clean_files= ac_config_libobj_dir=. LIBOBJS= cross_compiling=no subdirs= MFLAGS= MAKEFLAGS= # Identity of this package. PACKAGE_NAME='gpx' PACKAGE_TARNAME='gpx' PACKAGE_VERSION='2.5.2' PACKAGE_STRING='gpx 2.5.2' PACKAGE_BUGREPORT='https://github.com/markwal/GPX/issues' PACKAGE_URL='https://github.com/markwal/GPX' ac_unique_file="src/gpx/gpx.c" # Factoring default headers for most tests. ac_includes_default="\ #include #ifdef HAVE_SYS_TYPES_H # include #endif #ifdef HAVE_SYS_STAT_H # include #endif #ifdef STDC_HEADERS # include # include #else # ifdef HAVE_STDLIB_H # include # endif #endif #ifdef HAVE_STRING_H # if !defined STDC_HEADERS && defined HAVE_MEMORY_H # include # endif # include #endif #ifdef HAVE_STRINGS_H # include #endif #ifdef HAVE_INTTYPES_H # include #endif #ifdef HAVE_STDINT_H # include #endif #ifdef HAVE_UNISTD_H # include #endif" ac_subst_vars='am__EXEEXT_FALSE am__EXEEXT_TRUE LTLIBOBJS LIBOBJS POW_LIB CROSS_COMPILING_FALSE CROSS_COMPILING_TRUE HAVE_WINDOWS_H_FALSE HAVE_WINDOWS_H_TRUE EGREP GREP CPP HAVE_DIFF_FALSE HAVE_DIFF_TRUE DIFF HAVE_PYTHON_FALSE HAVE_PYTHON_TRUE PYTHON HAVE_CREATEDMG_FALSE HAVE_CREATEDMG_TRUE CREATEDMG HAVE_SIGNOSX_FALSE HAVE_SIGNOSX_TRUE SIGNOSX am__fastdepCC_FALSE am__fastdepCC_TRUE CCDEPMODE am__nodep AMDEPBACKSLASH AMDEP_FALSE AMDEP_TRUE am__quote am__include DEPDIR OBJEXT EXEEXT ac_ct_CC CPPFLAGS LDFLAGS CFLAGS CC BDIST_TARGET PLATFORM host_os host_vendor host_cpu host build_os build_vendor build_cpu build MAINT MAINTAINER_MODE_FALSE MAINTAINER_MODE_TRUE AM_BACKSLASH AM_DEFAULT_VERBOSITY AM_DEFAULT_V AM_V am__untar am__tar AMTAR am__leading_dot SET_MAKE AWK mkdir_p MKDIR_P INSTALL_STRIP_PROGRAM STRIP install_sh MAKEINFO AUTOHEADER AUTOMAKE AUTOCONF ACLOCAL VERSION PACKAGE CYGPATH_W am__isrc INSTALL_DATA INSTALL_SCRIPT INSTALL_PROGRAM target_alias host_alias build_alias LIBS ECHO_T ECHO_N ECHO_C DEFS mandir localedir libdir psdir pdfdir dvidir htmldir infodir docdir oldincludedir includedir runstatedir localstatedir sharedstatedir sysconfdir datadir datarootdir libexecdir sbindir bindir program_transform_name prefix exec_prefix PACKAGE_URL PACKAGE_BUGREPORT PACKAGE_STRING PACKAGE_VERSION PACKAGE_TARNAME PACKAGE_NAME PATH_SEPARATOR SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking enable_silent_rules enable_maintainer_mode enable_dependency_tracking ' ac_precious_vars='build_alias host_alias target_alias CC CFLAGS LDFLAGS LIBS CPPFLAGS CPP' # Initialize some variables set by options. ac_init_help= ac_init_version=false ac_unrecognized_opts= ac_unrecognized_sep= # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. # (The list follows the same order as the GNU Coding Standards.) bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' includedir='${prefix}/include' oldincludedir='/usr/include' docdir='${datarootdir}/doc/${PACKAGE_TARNAME}' infodir='${datarootdir}/info' htmldir='${docdir}' dvidir='${docdir}' pdfdir='${docdir}' psdir='${docdir}' libdir='${exec_prefix}/lib' localedir='${datarootdir}/locale' mandir='${datarootdir}/man' ac_prev= ac_dashdash= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval $ac_prev=\$ac_option ac_prev= continue fi case $ac_option in *=?*) ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;; *=) ac_optarg= ;; *) ac_optarg=yes ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case $ac_dashdash$ac_option in --) ac_dashdash=yes ;; -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_useropt=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--disable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=no ;; -docdir | --docdir | --docdi | --doc | --do) ac_prev=docdir ;; -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*) docdir=$ac_optarg ;; -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv) ac_prev=dvidir ;; -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*) dvidir=$ac_optarg ;; -enable-* | --enable-*) ac_useropt=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid feature name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "enable_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--enable-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval enable_$ac_useropt=\$ac_optarg ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht) ac_prev=htmldir ;; -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \ | --ht=*) htmldir=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localedir | --localedir | --localedi | --localed | --locale) ac_prev=localedir ;; -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*) localedir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst | --locals) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*) localstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c | -n) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd) ac_prev=pdfdir ;; -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*) pdfdir=$ac_optarg ;; -psdir | --psdir | --psdi | --psd | --ps) ac_prev=psdir ;; -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*) psdir=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst | --runs \ | --run | --ru | --r) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* | --runs=* \ | --run=* | --ru=* | --r=*) runstatedir=$ac_optarg ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_useropt=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--with-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=\$ac_optarg ;; -without-* | --without-*) ac_useropt=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_useropt" : ".*[^-+._$as_cr_alnum]" >/dev/null && as_fn_error $? "invalid package name: $ac_useropt" ac_useropt_orig=$ac_useropt ac_useropt=`$as_echo "$ac_useropt" | sed 's/[-+.]/_/g'` case $ac_user_opts in *" "with_$ac_useropt" "*) ;; *) ac_unrecognized_opts="$ac_unrecognized_opts$ac_unrecognized_sep--without-$ac_useropt_orig" ac_unrecognized_sep=', ';; esac eval with_$ac_useropt=no ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*) as_fn_error $? "unrecognized option: \`$ac_option' Try \`$0 --help' for more information" ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. case $ac_envvar in #( '' | [0-9]* | *[!_$as_cr_alnum]* ) as_fn_error $? "invalid variable name: \`$ac_envvar'" ;; esac eval $ac_envvar=\$ac_optarg export $ac_envvar ;; *) # FIXME: should be removed in autoconf 3.0. $as_echo "$as_me: WARNING: you should use --build, --host, --target" >&2 expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && $as_echo "$as_me: WARNING: invalid host type: $ac_option" >&2 : "${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo $ac_prev | sed 's/_/-/g'` as_fn_error $? "missing argument to $ac_option" fi if test -n "$ac_unrecognized_opts"; then case $enable_option_checking in no) ;; fatal) as_fn_error $? "unrecognized options: $ac_unrecognized_opts" ;; *) $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2 ;; esac fi # Check all directory arguments for consistency. for ac_var in exec_prefix prefix bindir sbindir libexecdir datarootdir \ datadir sysconfdir sharedstatedir localstatedir includedir \ oldincludedir docdir infodir htmldir dvidir pdfdir psdir \ libdir localedir mandir runstatedir do eval ac_val=\$$ac_var # Remove trailing slashes. case $ac_val in */ ) ac_val=`expr "X$ac_val" : 'X\(.*[^/]\)' \| "X$ac_val" : 'X\(.*\)'` eval $ac_var=\$ac_val;; esac # Be sure to have absolute directory names. case $ac_val in [\\/$]* | ?:[\\/]* ) continue;; NONE | '' ) case $ac_var in *prefix ) continue;; esac;; esac as_fn_error $? "expected an absolute directory name for --$ac_var: $ac_val" done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. # FIXME: To remove some day. build=$build_alias host=$host_alias target=$target_alias # FIXME: To remove some day. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null ac_pwd=`pwd` && test -n "$ac_pwd" && ac_ls_di=`ls -di .` && ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` || as_fn_error $? "working directory cannot be determined" test "X$ac_ls_di" = "X$ac_pwd_ls_di" || as_fn_error $? "pwd does not report name of working directory" # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then the parent directory. ac_confdir=`$as_dirname -- "$as_myself" || $as_expr X"$as_myself" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_myself" : 'X\(//\)[^/]' \| \ X"$as_myself" : 'X\(//\)$' \| \ X"$as_myself" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_myself" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` srcdir=$ac_confdir if test ! -r "$srcdir/$ac_unique_file"; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .." as_fn_error $? "cannot find sources ($ac_unique_file) in $srcdir" fi ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work" ac_abs_confdir=`( cd "$srcdir" && test -r "./$ac_unique_file" || as_fn_error $? "$ac_msg" pwd)` # When building in place, set srcdir=. if test "$ac_abs_confdir" = "$ac_pwd"; then srcdir=. fi # Remove unnecessary trailing slashes from srcdir. # Double slashes in file names in object file debugging info # mess up M-x gdb in Emacs. case $srcdir in */) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;; esac for ac_var in $ac_precious_vars; do eval ac_env_${ac_var}_set=\${${ac_var}+set} eval ac_env_${ac_var}_value=\$${ac_var} eval ac_cv_env_${ac_var}_set=\${${ac_var}+set} eval ac_cv_env_${ac_var}_value=\$${ac_var} done # # Report the --help message. # if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF \`configure' configures gpx 2.5.2 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... To assign environment variables (e.g., CC, CFLAGS...), specify them as VAR=VALUE. See below for descriptions of some of the useful variables. Defaults for the options are specified in brackets. Configuration: -h, --help display this help and exit --help=short display options specific to this package --help=recursive display the short help of all the included packages -V, --version display version information and exit -q, --quiet, --silent do not print \`checking ...' messages --cache-file=FILE cache test results in FILE [disabled] -C, --config-cache alias for \`--cache-file=config.cache' -n, --no-create do not create output files --srcdir=DIR find the sources in DIR [configure dir or \`..'] Installation directories: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [PREFIX] By default, \`make install' will install all the files in \`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify an installation prefix other than \`$ac_default_prefix' using \`--prefix', for instance \`--prefix=\$HOME'. For better control, use the options below. Fine tuning of the installation directories: --bindir=DIR user executables [EPREFIX/bin] --sbindir=DIR system admin executables [EPREFIX/sbin] --libexecdir=DIR program executables [EPREFIX/libexec] --sysconfdir=DIR read-only single-machine data [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] --localstatedir=DIR modifiable single-machine data [PREFIX/var] --runstatedir=DIR modifiable per-process data [LOCALSTATEDIR/run] --libdir=DIR object code libraries [EPREFIX/lib] --includedir=DIR C header files [PREFIX/include] --oldincludedir=DIR C header files for non-gcc [/usr/include] --datarootdir=DIR read-only arch.-independent data root [PREFIX/share] --datadir=DIR read-only architecture-independent data [DATAROOTDIR] --infodir=DIR info documentation [DATAROOTDIR/info] --localedir=DIR locale-dependent data [DATAROOTDIR/locale] --mandir=DIR man documentation [DATAROOTDIR/man] --docdir=DIR documentation root [DATAROOTDIR/doc/gpx] --htmldir=DIR html documentation [DOCDIR] --dvidir=DIR dvi documentation [DOCDIR] --pdfdir=DIR pdf documentation [DOCDIR] --psdir=DIR ps documentation [DOCDIR] _ACEOF cat <<\_ACEOF Program names: --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names System types: --build=BUILD configure for building on BUILD [guessed] --host=HOST cross-compile to build programs to run on HOST [BUILD] _ACEOF fi if test -n "$ac_init_help"; then case $ac_init_help in short | recursive ) echo "Configuration of gpx 2.5.2:";; esac cat <<\_ACEOF Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --enable-silent-rules less verbose build output (undo: "make V=1") --disable-silent-rules verbose build output (undo: "make V=0") --enable-maintainer-mode enable make rules and dependencies not useful (and sometimes confusing) to the casual installer --enable-dependency-tracking do not reject slow dependency extractors --disable-dependency-tracking speeds up one-time build Some influential environment variables: CC C compiler command CFLAGS C compiler flags LDFLAGS linker flags, e.g. -L if you have libraries in a nonstandard directory LIBS libraries to pass to the linker, e.g. -l CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory CPP C preprocessor Use these variables to override the choices made by `configure' or to help it to find libraries and programs with nonstandard names/locations. Report bugs to . gpx home page: . _ACEOF ac_status=$? fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue test -d "$ac_dir" || { cd "$srcdir" && ac_pwd=`pwd` && srcdir=. && test -d "$ac_dir"; } || continue ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix cd "$ac_dir" || { ac_status=$?; continue; } # Check for guested configure. if test -f "$ac_srcdir/configure.gnu"; then echo && $SHELL "$ac_srcdir/configure.gnu" --help=recursive elif test -f "$ac_srcdir/configure"; then echo && $SHELL "$ac_srcdir/configure" --help=recursive else $as_echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 fi || ac_status=$? cd "$ac_pwd" || { ac_status=$?; break; } done fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF gpx configure 2.5.2 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF exit fi ## ------------------------ ## ## Autoconf initialization. ## ## ------------------------ ## # ac_fn_c_try_compile LINENO # -------------------------- # Try to compile conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest.$ac_objext; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_compile # ac_fn_c_try_cpp LINENO # ---------------------- # Try to preprocess conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_cpp () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_cpp conftest.$ac_ext" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_cpp conftest.$ac_ext") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } > conftest.i && { test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" || test ! -s conftest.err }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_cpp # ac_fn_c_check_header_mongrel LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists, giving a warning if it cannot be compiled using # the include files in INCLUDES and setting the cache variable VAR # accordingly. ac_fn_c_check_header_mongrel () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if eval \${$3+:} false; then : { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } else # Is the header compilable? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 usability" >&5 $as_echo_n "checking $2 usability... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_header_compiler=yes else ac_header_compiler=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_compiler" >&5 $as_echo "$ac_header_compiler" >&6; } # Is the header present? { $as_echo "$as_me:${as_lineno-$LINENO}: checking $2 presence" >&5 $as_echo_n "checking $2 presence... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include <$2> _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : ac_header_preproc=yes else ac_header_preproc=no fi rm -f conftest.err conftest.i conftest.$ac_ext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_header_preproc" >&5 $as_echo "$ac_header_preproc" >&6; } # So? What about this header? case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in #(( yes:no: ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&5 $as_echo "$as_me: WARNING: $2: accepted by the compiler, rejected by the preprocessor!" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ;; no:yes:* ) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: present but cannot be compiled" >&5 $as_echo "$as_me: WARNING: $2: present but cannot be compiled" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: check for missing prerequisite headers?" >&5 $as_echo "$as_me: WARNING: $2: check for missing prerequisite headers?" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: see the Autoconf documentation" >&5 $as_echo "$as_me: WARNING: $2: see the Autoconf documentation" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&5 $as_echo "$as_me: WARNING: $2: section \"Present But Cannot Be Compiled\"" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $2: proceeding with the compiler's result" >&5 $as_echo "$as_me: WARNING: $2: proceeding with the compiler's result" >&2;} ( $as_echo "## ---------------------------------------------------- ## ## Report this to https://github.com/markwal/GPX/issues ## ## ---------------------------------------------------- ##" ) | sed "s/^/$as_me: WARNING: /" >&2 ;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=\$ac_header_compiler" fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } fi eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_mongrel # ac_fn_c_try_run LINENO # ---------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. Assumes # that executables *can* be run. ac_fn_c_try_run () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { ac_try='./conftest$ac_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then : ac_retval=0 else $as_echo "$as_me: program exited with status $ac_status" >&5 $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=$ac_status fi rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_run # ac_fn_c_check_header_compile LINENO HEADER VAR INCLUDES # ------------------------------------------------------- # Tests whether HEADER exists and can be compiled using the include files in # INCLUDES, setting the cache variable VAR accordingly. ac_fn_c_check_header_compile () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 #include <$2> _ACEOF if ac_fn_c_try_compile "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_header_compile # ac_fn_c_check_type LINENO TYPE VAR INCLUDES # ------------------------------------------- # Tests whether TYPE exists after having included INCLUDES, setting cache # variable VAR accordingly. ac_fn_c_check_type () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof ($2)) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $4 int main () { if (sizeof (($2))) return 0; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else eval "$3=yes" fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_type # ac_fn_c_find_intX_t LINENO BITS VAR # ----------------------------------- # Finds a signed integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_intX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for int$2_t" >&5 $as_echo_n "checking for int$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in int$2_t 'int' 'long int' \ 'long long int' 'short int' 'signed char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default enum { N = $2 / 2 - 1 }; int main () { static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else case $ac_type in #( int$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_intX_t # ac_fn_c_find_uintX_t LINENO BITS VAR # ------------------------------------ # Finds an unsigned integer type with width BITS, setting cache variable VAR # accordingly. ac_fn_c_find_uintX_t () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for uint$2_t" >&5 $as_echo_n "checking for uint$2_t... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else eval "$3=no" # Order is important - never check a type that is potentially smaller # than half of the expected target width. for ac_type in uint$2_t 'unsigned int' 'unsigned long int' \ 'unsigned long long int' 'unsigned short int' 'unsigned char'; do cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default int main () { static int test_array [1 - 2 * !((($ac_type) -1 >> ($2 / 2 - 1)) >> ($2 / 2 - 1) == 3)]; test_array [0] = 0; return test_array [0]; ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : case $ac_type in #( uint$2_t) : eval "$3=yes" ;; #( *) : eval "$3=\$ac_type" ;; esac fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if eval test \"x\$"$3"\" = x"no"; then : else break fi done fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_find_uintX_t # ac_fn_c_try_link LINENO # ----------------------- # Try to link conftest.$ac_ext, and return whether this succeeded. ac_fn_c_try_link () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack rm -f conftest.$ac_objext conftest$ac_exeext if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>conftest.err ac_status=$? if test -s conftest.err; then grep -v '^ *+' conftest.err >conftest.er1 cat conftest.er1 >&5 mv -f conftest.er1 conftest.err fi $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } && { test -z "$ac_c_werror_flag" || test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || test -x conftest$ac_exeext }; then : ac_retval=0 else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 ac_retval=1 fi # Delete the IPA/IPO (Inter Procedural Analysis/Optimization) information # created by the PGI compiler (conftest_ipa8_conftest.oo), as it would # interfere with the next link command; also delete a directory that is # left behind by Apple's compiler. We do this before executing the actions. rm -rf conftest.dSYM conftest_ipa8_conftest.oo eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno as_fn_set_status $ac_retval } # ac_fn_c_try_link # ac_fn_c_check_func LINENO FUNC VAR # ---------------------------------- # Tests whether FUNC exists, setting the cache variable VAR accordingly ac_fn_c_check_func () { as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2" >&5 $as_echo_n "checking for $2... " >&6; } if eval \${$3+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Define $2 to an innocuous variant, in case declares $2. For example, HP-UX 11i declares gettimeofday. */ #define $2 innocuous_$2 /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $2 (); below. Prefer to if __STDC__ is defined, since exists even on freestanding compilers. */ #ifdef __STDC__ # include #else # include #endif #undef $2 /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char $2 (); /* The GNU C library defines this for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined __stub_$2 || defined __stub___$2 choke me #endif int main () { return $2 (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : eval "$3=yes" else eval "$3=no" fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext fi eval ac_res=\$$3 { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 $as_echo "$ac_res" >&6; } eval $as_lineno_stack; ${as_lineno_stack:+:} unset as_lineno } # ac_fn_c_check_func cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by gpx $as_me 2.5.2, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ _ACEOF exec 5>>config.log { cat <<_ASUNAME ## --------- ## ## Platform. ## ## --------- ## hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` uname -m = `(uname -m) 2>/dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` /bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` /bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` /usr/bin/hostinfo = `(/usr/bin/hostinfo) 2>/dev/null || echo unknown` /bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` /bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` _ASUNAME as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. $as_echo "PATH: $as_dir" done IFS=$as_save_IFS } >&5 cat >&5 <<_ACEOF ## ----------- ## ## Core tests. ## ## ----------- ## _ACEOF # Keep a trace of the command line. # Strip out --no-create and --no-recursion so they do not pile up. # Strip out --silent because we don't want to record it for future runs. # Also quote any args containing shell meta-characters. # Make two passes to allow for proper duplicate-argument suppression. ac_configure_args= ac_configure_args0= ac_configure_args1= ac_must_keep_next=false for ac_pass in 1 2 do for ac_arg do case $ac_arg in -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) continue ;; *\'*) ac_arg=`$as_echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; esac case $ac_pass in 1) as_fn_append ac_configure_args0 " '$ac_arg'" ;; 2) as_fn_append ac_configure_args1 " '$ac_arg'" if test $ac_must_keep_next = true; then ac_must_keep_next=false # Got value, back to normal. else case $ac_arg in *=* | --config-cache | -C | -disable-* | --disable-* \ | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ | -with-* | --with-* | -without-* | --without-* | --x) case "$ac_configure_args0 " in "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; esac ;; -* ) ac_must_keep_next=true ;; esac fi as_fn_append ac_configure_args " '$ac_arg'" ;; esac done done { ac_configure_args0=; unset ac_configure_args0;} { ac_configure_args1=; unset ac_configure_args1;} # When interrupted or exit'd, cleanup temporary files, and complete # config.log. We remove comments because anyway the quotes in there # would cause problems or look ugly. # WARNING: Use '\'' to represent an apostrophe within the trap. # WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug. trap 'exit_status=$? # Save into config.log some information that might help in debugging. { echo $as_echo "## ---------------- ## ## Cache variables. ## ## ---------------- ##" echo # The following way of writing the cache mishandles newlines in values, ( for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #( *${as_nl}ac_space=\ *) sed -n \ "s/'\''/'\''\\\\'\'''\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p" ;; #( *) sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) echo $as_echo "## ----------------- ## ## Output variables. ## ## ----------------- ##" echo for ac_var in $ac_subst_vars do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo if test -n "$ac_subst_files"; then $as_echo "## ------------------- ## ## File substitutions. ## ## ------------------- ##" echo for ac_var in $ac_subst_files do eval ac_val=\$$ac_var case $ac_val in *\'\''*) ac_val=`$as_echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;; esac $as_echo "$ac_var='\''$ac_val'\''" done | sort echo fi if test -s confdefs.h; then $as_echo "## ----------- ## ## confdefs.h. ## ## ----------- ##" echo cat confdefs.h echo fi test "$ac_signal" != 0 && $as_echo "$as_me: caught signal $ac_signal" $as_echo "$as_me: exit $exit_status" } >&5 rm -f core *.core core.conftest.* && rm -f -r conftest* confdefs* conf$$* $ac_clean_files && exit $exit_status ' 0 for ac_signal in 1 2 13 15; do trap 'ac_signal='$ac_signal'; as_fn_exit 1' $ac_signal done ac_signal=0 # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -f -r conftest* confdefs.h $as_echo "/* confdefs.h */" > confdefs.h # Predefined preprocessor variables. cat >>confdefs.h <<_ACEOF #define PACKAGE_NAME "$PACKAGE_NAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_TARNAME "$PACKAGE_TARNAME" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_VERSION "$PACKAGE_VERSION" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_STRING "$PACKAGE_STRING" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" _ACEOF cat >>confdefs.h <<_ACEOF #define PACKAGE_URL "$PACKAGE_URL" _ACEOF # Let the site file select an alternate cache file if it wants to. # Prefer an explicitly selected file to automatically selected ones. ac_site_file1=NONE ac_site_file2=NONE if test -n "$CONFIG_SITE"; then # We do not want a PATH search for config.site. case $CONFIG_SITE in #(( -*) ac_site_file1=./$CONFIG_SITE;; */*) ac_site_file1=$CONFIG_SITE;; *) ac_site_file1=./$CONFIG_SITE;; esac elif test "x$prefix" != xNONE; then ac_site_file1=$prefix/share/config.site ac_site_file2=$prefix/etc/config.site else ac_site_file1=$ac_default_prefix/share/config.site ac_site_file2=$ac_default_prefix/etc/config.site fi for ac_site_file in "$ac_site_file1" "$ac_site_file2" do test "x$ac_site_file" = xNONE && continue if test /dev/null != "$ac_site_file" && test -r "$ac_site_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading site script $ac_site_file" >&5 $as_echo "$as_me: loading site script $ac_site_file" >&6;} sed 's/^/| /' "$ac_site_file" >&5 . "$ac_site_file" \ || { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "failed to load site script $ac_site_file See \`config.log' for more details" "$LINENO" 5; } fi done if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special files # actually), so we avoid doing that. DJGPP emulates it as a regular file. if test /dev/null != "$cache_file" && test -f "$cache_file"; then { $as_echo "$as_me:${as_lineno-$LINENO}: loading cache $cache_file" >&5 $as_echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . "$cache_file";; *) . "./$cache_file";; esac fi else { $as_echo "$as_me:${as_lineno-$LINENO}: creating cache $cache_file" >&5 $as_echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi # Check that the precious variables saved in the cache have kept the same # value. ac_cache_corrupted=false for ac_var in $ac_precious_vars; do eval ac_old_set=\$ac_cv_env_${ac_var}_set eval ac_new_set=\$ac_env_${ac_var}_set eval ac_old_val=\$ac_cv_env_${ac_var}_value eval ac_new_val=\$ac_env_${ac_var}_value case $ac_old_set,$ac_new_set in set,) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' was not set in the previous run" >&5 $as_echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then # differences in whitespace do not lead to failure. ac_old_val_w=`echo x $ac_old_val` ac_new_val_w=`echo x $ac_new_val` if test "$ac_old_val_w" != "$ac_new_val_w"; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: \`$ac_var' has changed since the previous run:" >&5 $as_echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} ac_cache_corrupted=: else { $as_echo "$as_me:${as_lineno-$LINENO}: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&5 $as_echo "$as_me: warning: ignoring whitespace changes in \`$ac_var' since the previous run:" >&2;} eval $ac_var=\$ac_old_val fi { $as_echo "$as_me:${as_lineno-$LINENO}: former value: \`$ac_old_val'" >&5 $as_echo "$as_me: former value: \`$ac_old_val'" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: current value: \`$ac_new_val'" >&5 $as_echo "$as_me: current value: \`$ac_new_val'" >&2;} fi;; esac # Pass precious variables to config.status. if test "$ac_new_set" = set; then case $ac_new_val in *\'*) ac_arg=$ac_var=`$as_echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; *) ac_arg=$ac_var=$ac_new_val ;; esac case " $ac_configure_args " in *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. *) as_fn_append ac_configure_args " '$ac_arg'" ;; esac fi done if $ac_cache_corrupted; then { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} { $as_echo "$as_me:${as_lineno-$LINENO}: error: changes in the environment can compromise the build" >&5 $as_echo "$as_me: error: changes in the environment can compromise the build" >&2;} as_fn_error $? "run \`make distclean' and/or \`rm $cache_file' and start over" "$LINENO" 5 fi ## -------------------- ## ## Main body of script. ## ## -------------------- ## ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_aux_dir= for ac_dir in build-aux "$srcdir"/build-aux; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then as_fn_error $? "cannot find install-sh, install.sh, or shtool in build-aux \"$srcdir\"/build-aux" "$LINENO" 5 fi # These three variables are undocumented and unsupported, # and are intended to be withdrawn in a future Autoconf release. # They can cause serious problems if a builder's source tree is in a directory # whose full name contains unusual characters. ac_config_guess="$SHELL $ac_aux_dir/config.guess" # Please don't use this var. ac_config_sub="$SHELL $ac_aux_dir/config.sub" # Please don't use this var. ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. am__api_version='1.15' # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # OS/2's system install, which has a completely different semantic # ./install, which can be erroneously created by make from ./install.sh. # Reject install programs that cannot install multiple files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a BSD-compatible install" >&5 $as_echo_n "checking for a BSD-compatible install... " >&6; } if test -z "$INSTALL"; then if ${ac_cv_path_install+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. # Account for people who put trailing slashes in PATH elements. case $as_dir/ in #(( ./ | .// | /[cC]/* | \ /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \ ?:[\\/]os2[\\/]install[\\/]* | ?:[\\/]OS2[\\/]INSTALL[\\/]* | \ /usr/ucb/* ) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : elif test $ac_prog = install && grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else rm -rf conftest.one conftest.two conftest.dir echo one > conftest.one echo two > conftest.two mkdir conftest.dir if "$as_dir/$ac_prog$ac_exec_ext" -c conftest.one conftest.two "`pwd`/conftest.dir" && test -s conftest.one && test -s conftest.two && test -s conftest.dir/conftest.one && test -s conftest.dir/conftest.two then ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c" break 3 fi fi fi done done ;; esac done IFS=$as_save_IFS rm -rf conftest.one conftest.two conftest.dir fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. Don't cache a # value for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. INSTALL=$ac_install_sh fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $INSTALL" >&5 $as_echo "$INSTALL" >&6; } # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5 $as_echo_n "checking whether build environment is sane... " >&6; } # Reject unsafe characters in $srcdir or the absolute working directory # name. Accept space and tab only in the latter. am_lf=' ' case `pwd` in *[\\\"\#\$\&\'\`$am_lf]*) as_fn_error $? "unsafe absolute working directory name" "$LINENO" 5;; esac case $srcdir in *[\\\"\#\$\&\'\`$am_lf\ \ ]*) as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;; esac # Do 'set' in a subshell so we don't clobber the current shell's # arguments. Must try -L first in case configure is actually a # symlink; some systems play weird games with the mod time of symlinks # (eg FreeBSD returns the mod time of the symlink's containing # directory). if ( am_has_slept=no for am_try in 1 2; do echo "timestamp, slept: $am_has_slept" > conftest.file set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null` if test "$*" = "X"; then # -L didn't work. set X `ls -t "$srcdir/configure" conftest.file` fi if test "$*" != "X $srcdir/configure conftest.file" \ && test "$*" != "X conftest.file $srcdir/configure"; then # If neither matched, then we have a broken ls. This can happen # if, for instance, CONFIG_SHELL is bash and it inherits a # broken ls alias from the environment. This has actually # happened. Such a system could not be considered "sane". as_fn_error $? "ls -t appears to fail. Make sure there is not a broken alias in your environment" "$LINENO" 5 fi if test "$2" = conftest.file || test $am_try -eq 2; then break fi # Just in case. sleep 1 am_has_slept=yes done test "$2" = conftest.file ) then # Ok. : else as_fn_error $? "newly created file is older than distributed files! Check your system clock" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } # If we didn't sleep, we still need to ensure time stamps of config.status and # generated files are strictly newer. am_sleep_pid= if grep 'slept: no' conftest.file >/dev/null 2>&1; then ( sleep 1 ) & am_sleep_pid=$! fi rm -f conftest.file test "$program_prefix" != NONE && program_transform_name="s&^&$program_prefix&;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s&\$&$program_suffix&;$program_transform_name" # Double any \ or $. # By default was `s,x,x', remove it if useless. ac_script='s/[\\$]/&&/g;s/;s,x,x,$//' program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"` # Expand $ac_aux_dir to an absolute path. am_aux_dir=`cd "$ac_aux_dir" && pwd` if test x"${MISSING+set}" != xset; then case $am_aux_dir in *\ * | *\ *) MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;; *) MISSING="\${SHELL} $am_aux_dir/missing" ;; esac fi # Use eval to expand $SHELL if eval "$MISSING --is-lightweight"; then am_missing_run="$MISSING " else am_missing_run= { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5 $as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;} fi if test x"${install_sh+set}" != xset; then case $am_aux_dir in *\ * | *\ *) install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;; *) install_sh="\${SHELL} $am_aux_dir/install-sh" esac fi # Installed binaries are usually stripped using 'strip' when the user # run "make install-strip". However 'strip' might not be the right # tool to use in cross-compilation environments, therefore Automake # will honor the 'STRIP' environment variable to overrule this program. if test "$cross_compiling" != no; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. set dummy ${ac_tool_prefix}strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$STRIP"; then ac_cv_prog_STRIP="$STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_STRIP="${ac_tool_prefix}strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi STRIP=$ac_cv_prog_STRIP if test -n "$STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $STRIP" >&5 $as_echo "$STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_STRIP"; then ac_ct_STRIP=$STRIP # Extract the first word of "strip", so it can be a program name with args. set dummy strip; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_STRIP+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_STRIP"; then ac_cv_prog_ac_ct_STRIP="$ac_ct_STRIP" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_STRIP="strip" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_STRIP=$ac_cv_prog_ac_ct_STRIP if test -n "$ac_ct_STRIP"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_STRIP" >&5 $as_echo "$ac_ct_STRIP" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_STRIP" = x; then STRIP=":" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac STRIP=$ac_ct_STRIP fi else STRIP="$ac_cv_prog_STRIP" fi fi INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for a thread-safe mkdir -p" >&5 $as_echo_n "checking for a thread-safe mkdir -p... " >&6; } if test -z "$MKDIR_P"; then if ${ac_cv_path_mkdir+:} false; then : $as_echo_n "(cached) " >&6 else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/opt/sfw/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in mkdir gmkdir; do for ac_exec_ext in '' $ac_executable_extensions; do as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext" || continue case `"$as_dir/$ac_prog$ac_exec_ext" --version 2>&1` in #( 'mkdir (GNU coreutils) '* | \ 'mkdir (coreutils) '* | \ 'mkdir (fileutils) '4.1*) ac_cv_path_mkdir=$as_dir/$ac_prog$ac_exec_ext break 3;; esac done done done IFS=$as_save_IFS fi test -d ./--version && rmdir ./--version if test "${ac_cv_path_mkdir+set}" = set; then MKDIR_P="$ac_cv_path_mkdir -p" else # As a last resort, use the slow shell script. Don't cache a # value for MKDIR_P within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the value is a relative name. MKDIR_P="$ac_install_sh -d" fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5 $as_echo "$MKDIR_P" >&6; } for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_AWK+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$AWK"; then ac_cv_prog_AWK="$AWK" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $AWK" >&5 $as_echo "$AWK" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$AWK" && break done { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi rm -rf .tst 2>/dev/null mkdir .tst 2>/dev/null if test -d .tst; then am__leading_dot=. else am__leading_dot=_ fi rmdir .tst 2>/dev/null # Check whether --enable-silent-rules was given. if test "${enable_silent_rules+set}" = set; then : enableval=$enable_silent_rules; fi case $enable_silent_rules in # ((( yes) AM_DEFAULT_VERBOSITY=0;; no) AM_DEFAULT_VERBOSITY=1;; *) AM_DEFAULT_VERBOSITY=1;; esac am_make=${MAKE-make} { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5 $as_echo_n "checking whether $am_make supports nested variables... " >&6; } if ${am_cv_make_support_nested_variables+:} false; then : $as_echo_n "(cached) " >&6 else if $as_echo 'TRUE=$(BAR$(V)) BAR0=false BAR1=true V=1 am__doit: @$(TRUE) .PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then am_cv_make_support_nested_variables=yes else am_cv_make_support_nested_variables=no fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5 $as_echo "$am_cv_make_support_nested_variables" >&6; } if test $am_cv_make_support_nested_variables = yes; then AM_V='$(V)' AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)' else AM_V=$AM_DEFAULT_VERBOSITY AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY fi AM_BACKSLASH='\' if test "`cd $srcdir && pwd`" != "`pwd`"; then # Use -I$(srcdir) only when $(srcdir) != ., so that make's output # is not polluted with repeated "-I." am__isrc=' -I$(srcdir)' # test to see if srcdir already configured if test -f $srcdir/config.status; then as_fn_error $? "source directory already configured; run \"make distclean\" there first" "$LINENO" 5 fi fi # test whether we have cygpath if test -z "$CYGPATH_W"; then if (cygpath --version) >/dev/null 2>/dev/null; then CYGPATH_W='cygpath -w' else CYGPATH_W=echo fi fi # Define the identity of the package. PACKAGE='gpx' VERSION='2.5.2' cat >>confdefs.h <<_ACEOF #define PACKAGE "$PACKAGE" _ACEOF cat >>confdefs.h <<_ACEOF #define VERSION "$VERSION" _ACEOF # Some tools Automake needs. ACLOCAL=${ACLOCAL-"${am_missing_run}aclocal-${am__api_version}"} AUTOCONF=${AUTOCONF-"${am_missing_run}autoconf"} AUTOMAKE=${AUTOMAKE-"${am_missing_run}automake-${am__api_version}"} AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"} MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"} # For better backward compatibility. To be removed once Automake 1.9.x # dies out for good. For more background, see: # # mkdir_p='$(MKDIR_P)' # We need awk for the "check" target (and possibly the TAP driver). The # system "awk" is bad on some platforms. # Always define AMTAR for backward compatibility. Yes, it's still used # in the wild :-( We should find a proper way to deprecate it ... AMTAR='$${TAR-tar}' # We'll loop over all known methods to create a tar archive until one works. _am_tools='gnutar pax cpio none' am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -' # POSIX will say in a future version that running "rm -f" with no argument # is OK; and we want to be able to make that assumption in our Makefile # recipes. So use an aggressive probe to check that the usage we want is # actually supported "in the wild" to an acceptable degree. # See automake bug#10828. # To make any issue more visible, cause the running configure to be aborted # by default if the 'rm' program in use doesn't match our expectations; the # user can still override this though. if rm -f && rm -fr && rm -rf; then : OK; else cat >&2 <<'END' Oops! Your 'rm' program seems unable to run without file operands specified on the command line, even when the '-f' option is present. This is contrary to the behaviour of most rm programs out there, and not conforming with the upcoming POSIX standard: Please tell bug-automake@gnu.org about your system, including the value of your $PATH and any error possibly output before this message. This can help us improve future automake versions. END if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then echo 'Configuration will proceed anyway, since you have set the' >&2 echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2 echo >&2 else cat >&2 <<'END' Aborting the configuration process, to ensure you take notice of the issue. You can download and install GNU coreutils to get an 'rm' implementation that behaves properly: . If you want to complete the configuration process using your problematic 'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM to "yes", and re-run configure. END as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether to enable maintainer-specific portions of Makefiles" >&5 $as_echo_n "checking whether to enable maintainer-specific portions of Makefiles... " >&6; } # Check whether --enable-maintainer-mode was given. if test "${enable_maintainer_mode+set}" = set; then : enableval=$enable_maintainer_mode; USE_MAINTAINER_MODE=$enableval else USE_MAINTAINER_MODE=no fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $USE_MAINTAINER_MODE" >&5 $as_echo "$USE_MAINTAINER_MODE" >&6; } if test $USE_MAINTAINER_MODE = yes; then MAINTAINER_MODE_TRUE= MAINTAINER_MODE_FALSE='#' else MAINTAINER_MODE_TRUE='#' MAINTAINER_MODE_FALSE= fi MAINT=$MAINTAINER_MODE_TRUE ac_config_headers="$ac_config_headers src/shared/config.h" # Checks for cross compiling and arbitrary platform specifics # Make sure we can run config.sub. $SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 || as_fn_error $? "cannot run $SHELL $ac_aux_dir/config.sub" "$LINENO" 5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking build system type" >&5 $as_echo_n "checking build system type... " >&6; } if ${ac_cv_build+:} false; then : $as_echo_n "(cached) " >&6 else ac_build_alias=$build_alias test "x$ac_build_alias" = x && ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"` test "x$ac_build_alias" = x && as_fn_error $? "cannot guess build type; you must specify one" "$LINENO" 5 ac_cv_build=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $ac_build_alias failed" "$LINENO" 5 fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_build" >&5 $as_echo "$ac_cv_build" >&6; } case $ac_cv_build in *-*-*) ;; *) as_fn_error $? "invalid value of canonical build" "$LINENO" 5;; esac build=$ac_cv_build ac_save_IFS=$IFS; IFS='-' set x $ac_cv_build shift build_cpu=$1 build_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: build_os=$* IFS=$ac_save_IFS case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac { $as_echo "$as_me:${as_lineno-$LINENO}: checking host system type" >&5 $as_echo_n "checking host system type... " >&6; } if ${ac_cv_host+:} false; then : $as_echo_n "(cached) " >&6 else if test "x$host_alias" = x; then ac_cv_host=$ac_cv_build else ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` || as_fn_error $? "$SHELL $ac_aux_dir/config.sub $host_alias failed" "$LINENO" 5 fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_host" >&5 $as_echo "$ac_cv_host" >&6; } case $ac_cv_host in *-*-*) ;; *) as_fn_error $? "invalid value of canonical host" "$LINENO" 5;; esac host=$ac_cv_host ac_save_IFS=$IFS; IFS='-' set x $ac_cv_host shift host_cpu=$1 host_vendor=$2 shift; shift # Remember, the first character of IFS is used to create $*, # except with old shells: host_os=$* IFS=$ac_save_IFS case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac PLATFORM=`$ac_aux_dir/archive-name.sh $host_os $host_cpu` case $PLATFORM in win*) BDIST_TARGET="bdist-zip" CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -static -static-libgcc -lpthread" ;; osx) BDIST_TARGET="bdist-dmg" ;; *) BDIST_TARGET="bdist-gzip" ;; esac # Checks for programs. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else ac_prog_rejected=no as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS if test $ac_prog_rejected = yes; then # We found a bogon in the path, so make sure we never use it. set dummy $ac_cv_prog_CC shift if test $# != 0; then # We chose a different compiler from the bogus one. # However, it has the same basename, so the bogon will be chosen # first if we set CC to just the basename; use the full file name. shift ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" fi fi fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl.exe do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CC"; then ac_cv_prog_CC="$CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CC" >&5 $as_echo "$CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl.exe do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_ac_ct_CC+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$ac_ct_CC"; then ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_CC" >&5 $as_echo "$ac_ct_CC" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi test -n "$ac_ct_CC" && break done if test "x$ac_ct_CC" = x; then CC="" else case $cross_compiling:$ac_tool_warned in yes:) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5 $as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;} ac_tool_warned=yes ;; esac CC=$ac_ct_CC fi fi fi test -z "$CC" && { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "no acceptable C compiler found in \$PATH See \`config.log' for more details" "$LINENO" 5; } # Provide some information about the compiler. $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler version" >&5 set X $ac_compile ac_compiler=$2 for ac_option in --version -v -V -qversion; do { { ac_try="$ac_compiler $ac_option >&5" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compiler $ac_option >&5") 2>conftest.err ac_status=$? if test -s conftest.err; then sed '10a\ ... rest of stderr output deleted ... 10q' conftest.err >conftest.er1 cat conftest.er1 >&5 fi rm -f conftest.er1 conftest.err $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } done cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files a.out a.out.dSYM a.exe b.out" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the C compiler works" >&5 $as_echo_n "checking whether the C compiler works... " >&6; } ac_link_default=`$as_echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` # The possible output files: ac_files="a.out conftest.exe conftest a.exe a_out.exe b.out conftest.*" ac_rmfiles= for ac_file in $ac_files do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; * ) ac_rmfiles="$ac_rmfiles $ac_file";; esac done rm -f $ac_rmfiles if { { ac_try="$ac_link_default" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link_default") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # Autoconf-2.13 could set the ac_cv_exeext variable to `no'. # So ignore a value of `no', otherwise this would lead to `EXEEXT = no' # in a Makefile. We should not override ac_cv_exeext if it was cached, # so that the user can short-circuit this test for compilers unknown to # Autoconf. for ac_file in $ac_files '' do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; [ab].out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no; then :; else ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` fi # We set ac_cv_exeext here because the later test for it is not # safe: cross compilers may not add the suffix if given an `-o' # argument, so we may need to know it at that point already. # Even if this section looks crufty: it has the advantage of # actually working. break;; * ) break;; esac done test "$ac_cv_exeext" = no && ac_cv_exeext= else ac_file='' fi if test -z "$ac_file"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error 77 "C compiler cannot create executables See \`config.log' for more details" "$LINENO" 5; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for C compiler default output file name" >&5 $as_echo_n "checking for C compiler default output file name... " >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_file" >&5 $as_echo "$ac_file" >&6; } ac_exeext=$ac_cv_exeext rm -f -r a.out a.out.dSYM a.exe conftest$ac_cv_exeext b.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of executables" >&5 $as_echo_n "checking for suffix of executables... " >&6; } if { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will # work properly (i.e., refer to `conftest.exe'), while it won't with # `rm'. for ac_file in conftest.exe conftest conftest.*; do test -f "$ac_file" || continue case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` break;; * ) break;; esac done else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of executables: cannot compile and link See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest conftest$ac_cv_exeext { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_exeext" >&5 $as_echo "$ac_cv_exeext" >&6; } rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include int main () { FILE *f = fopen ("conftest.out", "w"); return ferror (f) || fclose (f) != 0; ; return 0; } _ACEOF ac_clean_files="$ac_clean_files conftest.out" # Check that the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are cross compiling" >&5 $as_echo_n "checking whether we are cross compiling... " >&6; } if test "$cross_compiling" != yes; then { { ac_try="$ac_link" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_link") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; } if { ac_try='./conftest$ac_cv_exeext' { { case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_try") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot run C compiled programs. If you meant to cross compile, use \`--host'. See \`config.log' for more details" "$LINENO" 5; } fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $cross_compiling" >&5 $as_echo "$cross_compiling" >&6; } rm -f conftest.$ac_ext conftest$ac_cv_exeext conftest.out ac_clean_files=$ac_clean_files_save { $as_echo "$as_me:${as_lineno-$LINENO}: checking for suffix of object files" >&5 $as_echo_n "checking for suffix of object files... " >&6; } if ${ac_cv_objext+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { { ac_try="$ac_compile" case "(($ac_try" in *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; *) ac_try_echo=$ac_try;; esac eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\"" $as_echo "$ac_try_echo"; } >&5 (eval "$ac_compile") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 test $ac_status = 0; }; then : for ac_file in conftest.o conftest.obj conftest.*; do test -f "$ac_file" || continue; case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.dSYM ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac done else $as_echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "cannot compute suffix of object files: cannot compile See \`config.log' for more details" "$LINENO" 5; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_objext" >&5 $as_echo "$ac_cv_objext" >&6; } OBJEXT=$ac_cv_objext ac_objext=$OBJEXT { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether we are using the GNU C compiler" >&5 $as_echo_n "checking whether we are using the GNU C compiler... " >&6; } if ${ac_cv_c_compiler_gnu+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_compiler_gnu=yes else ac_compiler_gnu=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_c_compiler_gnu" >&5 $as_echo "$ac_cv_c_compiler_gnu" >&6; } if test $ac_compiler_gnu = yes; then GCC=yes else GCC= fi ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC accepts -g" >&5 $as_echo_n "checking whether $CC accepts -g... " >&6; } if ${ac_cv_prog_cc_g+:} false; then : $as_echo_n "(cached) " >&6 else ac_save_c_werror_flag=$ac_c_werror_flag ac_c_werror_flag=yes ac_cv_prog_cc_g=no CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes else CFLAGS="" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : else ac_c_werror_flag=$ac_save_c_werror_flag CFLAGS="-g" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_g=yes fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext ac_c_werror_flag=$ac_save_c_werror_flag fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_g" >&5 $as_echo "$ac_cv_prog_cc_g" >&6; } if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $CC option to accept ISO C89" >&5 $as_echo_n "checking for $CC option to accept ISO C89... " >&6; } if ${ac_cv_prog_cc_c89+:} false; then : $as_echo_n "(cached) " >&6 else ac_cv_prog_cc_c89=no ac_save_CC=$CC cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (p, i) char **p; int i; { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } /* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has function prototypes and stuff, but not '\xHH' hex character constants. These don't provoke an error unfortunately, instead are silently treated as 'x'. The following induces an error, until -std is added to get proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an array size at least. It's necessary to write '\x00'==0 to get something that's true only with -std. */ int osf4_cc_array ['\x00' == 0 ? 1 : -1]; /* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters inside strings and character constants. */ #define FOO(x) 'x' int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1]; int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main () { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \ -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" if ac_fn_c_try_compile "$LINENO"; then : ac_cv_prog_cc_c89=$ac_arg fi rm -f core conftest.err conftest.$ac_objext test "x$ac_cv_prog_cc_c89" != "xno" && break done rm -f conftest.$ac_ext CC=$ac_save_CC fi # AC_CACHE_VAL case "x$ac_cv_prog_cc_c89" in x) { $as_echo "$as_me:${as_lineno-$LINENO}: result: none needed" >&5 $as_echo "none needed" >&6; } ;; xno) { $as_echo "$as_me:${as_lineno-$LINENO}: result: unsupported" >&5 $as_echo "unsupported" >&6; } ;; *) CC="$CC $ac_cv_prog_cc_c89" { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_prog_cc_c89" >&5 $as_echo "$ac_cv_prog_cc_c89" >&6; } ;; esac if test "x$ac_cv_prog_cc_c89" != xno; then : fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5 $as_echo_n "checking whether $CC understands -c and -o together... " >&6; } if ${am_cv_prog_cc_c_o+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ int main () { ; return 0; } _ACEOF # Make sure it works both with $CC and with simple cc. # Following AC_PROG_CC_C_O, we do the test twice because some # compilers refuse to overwrite an existing .o file with -o, # though they will create one. am_cv_prog_cc_c_o=yes for am_i in 1 2; do if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5 ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); } \ && test -f conftest2.$ac_objext; then : OK else am_cv_prog_cc_c_o=no break fi done rm -f core conftest* unset am_i fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5 $as_echo "$am_cv_prog_cc_c_o" >&6; } if test "$am_cv_prog_cc_c_o" != yes; then # Losing compiler, so override with the script. # FIXME: It is wrong to rewrite CC. # But if we don't then we get into trouble of one sort or another. # A longer-term fix would be to have automake use am__CC in this case, # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)" CC="$am_aux_dir/compile $CC" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu DEPDIR="${am__leading_dot}deps" ac_config_commands="$ac_config_commands depfiles" am_make=${MAKE-make} cat > confinc << 'END' am__doit: @echo this is the am__doit target .PHONY: am__doit END # If we don't find an include directive, just comment out the code. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for style of include used by $am_make" >&5 $as_echo_n "checking for style of include used by $am_make... " >&6; } am__include="#" am__quote= _am_result=none # First try GNU make style include. echo "include confinc" > confmf # Ignore all kinds of additional output from 'make'. case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=include am__quote= _am_result=GNU ;; esac # Now try BSD make style include. if test "$am__include" = "#"; then echo '.include "confinc"' > confmf case `$am_make -s -f confmf 2> /dev/null` in #( *the\ am__doit\ target*) am__include=.include am__quote="\"" _am_result=BSD ;; esac fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $_am_result" >&5 $as_echo "$_am_result" >&6; } rm -f confinc confmf # Check whether --enable-dependency-tracking was given. if test "${enable_dependency_tracking+set}" = set; then : enableval=$enable_dependency_tracking; fi if test "x$enable_dependency_tracking" != xno; then am_depcomp="$ac_aux_dir/depcomp" AMDEPBACKSLASH='\' am__nodep='_no' fi if test "x$enable_dependency_tracking" != xno; then AMDEP_TRUE= AMDEP_FALSE='#' else AMDEP_TRUE='#' AMDEP_FALSE= fi depcc="$CC" am_compiler_list= { $as_echo "$as_me:${as_lineno-$LINENO}: checking dependency style of $depcc" >&5 $as_echo_n "checking dependency style of $depcc... " >&6; } if ${am_cv_CC_dependencies_compiler_type+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then # We make a subdir and do the tests there. Otherwise we can end up # making bogus files that we don't know about and never remove. For # instance it was reported that on HP-UX the gcc test will end up # making a dummy file named 'D' -- because '-MD' means "put the output # in D". rm -rf conftest.dir mkdir conftest.dir # Copy depcomp to subdir because otherwise we won't find it if we're # using a relative directory. cp "$am_depcomp" conftest.dir cd conftest.dir # We will build objects and dependencies in a subdirectory because # it helps to detect inapplicable dependency modes. For instance # both Tru64's cc and ICC support -MD to output dependencies as a # side effect of compilation, but ICC will put the dependencies in # the current directory while Tru64 will put them in the object # directory. mkdir sub am_cv_CC_dependencies_compiler_type=none if test "$am_compiler_list" = ""; then am_compiler_list=`sed -n 's/^#*\([a-zA-Z0-9]*\))$/\1/p' < ./depcomp` fi am__universal=false case " $depcc " in #( *\ -arch\ *\ -arch\ *) am__universal=true ;; esac for depmode in $am_compiler_list; do # Setup a source with many dependencies, because some compilers # like to wrap large dependency lists on column 80 (with \), and # we should not choose a depcomp mode which is confused by this. # # We need to recreate these files for each test, as the compiler may # overwrite some of them when testing with obscure command lines. # This happens at least with the AIX C compiler. : > sub/conftest.c for i in 1 2 3 4 5 6; do echo '#include "conftst'$i'.h"' >> sub/conftest.c # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with # Solaris 10 /bin/sh. echo '/* dummy */' > sub/conftst$i.h done echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf # We check with '-c' and '-o' for the sake of the "dashmstdout" # mode. It turns out that the SunPro C++ compiler does not properly # handle '-M -o', and we need to detect this. Also, some Intel # versions had trouble with output in subdirs. am__obj=sub/conftest.${OBJEXT-o} am__minus_obj="-o $am__obj" case $depmode in gcc) # This depmode causes a compiler race in universal mode. test "$am__universal" = false || continue ;; nosideeffect) # After this tag, mechanisms are not by side-effect, so they'll # only be used when explicitly requested. if test "x$enable_dependency_tracking" = xyes; then continue else break fi ;; msvc7 | msvc7msys | msvisualcpp | msvcmsys) # This compiler won't grok '-c -o', but also, the minuso test has # not run yet. These depmodes are late enough in the game, and # so weak that their functioning should not be impacted. am__obj=conftest.${OBJEXT-o} am__minus_obj= ;; none) break ;; esac if depmode=$depmode \ source=sub/conftest.c object=$am__obj \ depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \ $SHELL ./depcomp $depcc -c $am__minus_obj sub/conftest.c \ >/dev/null 2>conftest.err && grep sub/conftst1.h sub/conftest.Po > /dev/null 2>&1 && grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 && grep $am__obj sub/conftest.Po > /dev/null 2>&1 && ${MAKE-make} -s -f confmf > /dev/null 2>&1; then # icc doesn't choke on unknown options, it will just issue warnings # or remarks (even with -Werror). So we grep stderr for any message # that says an option was ignored or not supported. # When given -MP, icc 7.0 and 7.1 complain thusly: # icc: Command line warning: ignoring option '-M'; no argument required # The diagnosis changed in icc 8.0: # icc: Command line remark: option '-MP' not supported if (grep 'ignoring option' conftest.err || grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else am_cv_CC_dependencies_compiler_type=$depmode break fi fi done cd .. rm -rf conftest.dir else am_cv_CC_dependencies_compiler_type=none fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_CC_dependencies_compiler_type" >&5 $as_echo "$am_cv_CC_dependencies_compiler_type" >&6; } CCDEPMODE=depmode=$am_cv_CC_dependencies_compiler_type if test "x$enable_dependency_tracking" != xno \ && test "$am_cv_CC_dependencies_compiler_type" = gcc3; then am__fastdepCC_TRUE= am__fastdepCC_FALSE='#' else am__fastdepCC_TRUE='#' am__fastdepCC_FALSE= fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether ${MAKE-make} sets \$(MAKE)" >&5 $as_echo_n "checking whether ${MAKE-make} sets \$(MAKE)... " >&6; } set x ${MAKE-make} ac_make=`$as_echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'` if eval \${ac_cv_prog_make_${ac_make}_set+:} false; then : $as_echo_n "(cached) " >&6 else cat >conftest.make <<\_ACEOF SHELL = /bin/sh all: @echo '@@@%%%=$(MAKE)=@@@%%%' _ACEOF # GNU make sometimes prints "make[1]: Entering ...", which would confuse us. case `${MAKE-make} -f conftest.make 2>/dev/null` in *@@@%%%=?*=@@@%%%*) eval ac_cv_prog_make_${ac_make}_set=yes;; *) eval ac_cv_prog_make_${ac_make}_set=no;; esac rm -f conftest.make fi if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 $as_echo "yes" >&6; } SET_MAKE= else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } SET_MAKE="MAKE=${MAKE-make}" fi # Extract the first word of "sign-osx.sh", so it can be a program name with args. set dummy sign-osx.sh; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_SIGNOSX+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$SIGNOSX"; then ac_cv_prog_SIGNOSX="$SIGNOSX" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_SIGNOSX="sign-osx.sh" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi SIGNOSX=$ac_cv_prog_SIGNOSX if test -n "$SIGNOSX"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $SIGNOSX" >&5 $as_echo "$SIGNOSX" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$SIGNOSX"; then HAVE_SIGNOSX_TRUE= HAVE_SIGNOSX_FALSE='#' else HAVE_SIGNOSX_TRUE='#' HAVE_SIGNOSX_FALSE= fi # Extract the first word of "hdiutil", so it can be a program name with args. set dummy hdiutil; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_CREATEDMG+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$CREATEDMG"; then ac_cv_prog_CREATEDMG="$CREATEDMG" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CREATEDMG="hdiutil create -format UDZO -srcfolder" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi CREATEDMG=$ac_cv_prog_CREATEDMG if test -n "$CREATEDMG"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CREATEDMG" >&5 $as_echo "$CREATEDMG" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$CREATEDMG"; then HAVE_CREATEDMG_TRUE= HAVE_CREATEDMG_FALSE='#' else HAVE_CREATEDMG_TRUE='#' HAVE_CREATEDMG_FALSE= fi # Extract the first word of "python", so it can be a program name with args. set dummy python; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_PYTHON+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$PYTHON"; then ac_cv_prog_PYTHON="$PYTHON" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON="python" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi PYTHON=$ac_cv_prog_PYTHON if test -n "$PYTHON"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PYTHON" >&5 $as_echo "$PYTHON" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$PYTHON"; then HAVE_PYTHON_TRUE= HAVE_PYTHON_FALSE='#' else HAVE_PYTHON_TRUE='#' HAVE_PYTHON_FALSE= fi # Extract the first word of "diff", so it can be a program name with args. set dummy diff; ac_word=$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 $as_echo_n "checking for $ac_word... " >&6; } if ${ac_cv_prog_DIFF+:} false; then : $as_echo_n "(cached) " >&6 else if test -n "$DIFF"; then ac_cv_prog_DIFF="$DIFF" # Let the user override the test. else as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_DIFF="diff -b" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 fi done done IFS=$as_save_IFS fi fi DIFF=$ac_cv_prog_DIFF if test -n "$DIFF"; then { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DIFF" >&5 $as_echo "$DIFF" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } fi if test -n "$DIFF"; then HAVE_DIFF_TRUE= HAVE_DIFF_FALSE='#' else HAVE_DIFF_TRUE='#' HAVE_DIFF_FALSE= fi # Checks for libraries. # Checks for header files. ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking how to run the C preprocessor" >&5 $as_echo_n "checking how to run the C preprocessor... " >&6; } # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if ${ac_cv_prog_CPP+:} false; then : $as_echo_n "(cached) " >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $CPP" >&5 $as_echo "$CPP" >&6; } ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # Prefer to if __STDC__ is defined, since # exists even on freestanding compilers. # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #ifdef __STDC__ # include #else # include #endif Syntax error _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : else # Broken: fails on valid input. continue fi rm -f conftest.err conftest.i conftest.$ac_ext # OK, works on sane cases. Now check whether nonexistent headers # can be detected and how. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if ac_fn_c_try_cpp "$LINENO"; then : # Broken: success on invalid input. continue else # Passes both tests. ac_preproc_ok=: break fi rm -f conftest.err conftest.i conftest.$ac_ext done # Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. rm -f conftest.i conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else { { $as_echo "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;} as_fn_error $? "C preprocessor \"$CPP\" fails sanity check See \`config.log' for more details" "$LINENO" 5; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu { $as_echo "$as_me:${as_lineno-$LINENO}: checking for grep that handles long lines and -e" >&5 $as_echo_n "checking for grep that handles long lines and -e... " >&6; } if ${ac_cv_path_GREP+:} false; then : $as_echo_n "(cached) " >&6 else if test -z "$GREP"; then ac_path_GREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in *GNU*) ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'GREP' >> "conftest.nl" "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_GREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_GREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_GREP"; then as_fn_error $? "no acceptable grep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_GREP=$GREP fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_GREP" >&5 $as_echo "$ac_cv_path_GREP" >&6; } GREP="$ac_cv_path_GREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : $as_echo_n "(cached) " >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else if test -z "$EGREP"; then ac_path_EGREP_found=false # Loop through the user's path and test for each of PROGNAME-LIST as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in *GNU*) ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;; *) ac_count=0 $as_echo_n 0123456789 >"conftest.in" while : do cat "conftest.in" "conftest.in" >"conftest.tmp" mv "conftest.tmp" "conftest.in" cp "conftest.in" "conftest.nl" $as_echo 'EGREP' >> "conftest.nl" "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break as_fn_arith $ac_count + 1 && ac_count=$as_val if test $ac_count -gt ${ac_path_EGREP_max-0}; then # Best one so far, save it but keep looking for a better one ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_max=$ac_count fi # 10*(2^10) chars as input seems more than enough test $ac_count -gt 10 && break done rm -f conftest.in conftest.tmp conftest.nl conftest.out;; esac $ac_path_EGREP_found && break 3 done done done IFS=$as_save_IFS if test -z "$ac_cv_path_EGREP"; then as_fn_error $? "no acceptable egrep could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" "$LINENO" 5 fi else ac_cv_path_EGREP=$EGREP fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_path_EGREP" >&5 $as_echo "$ac_cv_path_EGREP" >&6; } EGREP="$ac_cv_path_EGREP" { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 $as_echo_n "checking for ANSI C header files... " >&6; } if ${ac_cv_header_stdc+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #include #include int main () { ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdc=yes else ac_cv_header_stdc=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -f conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : : else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include #if ((' ' & 0x0FF) == 0x020) # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) #else # define ISLOWER(c) \ (('a' <= (c) && (c) <= 'i') \ || ('j' <= (c) && (c) <= 'r') \ || ('s' <= (c) && (c) <= 'z')) # define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) #endif #define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) int main () { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) return 2; return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : else ac_cv_header_stdc=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdc" >&5 $as_echo "$ac_cv_header_stdc" >&6; } if test $ac_cv_header_stdc = yes; then $as_echo "#define STDC_HEADERS 1" >>confdefs.h fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_compile "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default " if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in fcntl.h float.h inttypes.h limits.h stdint.h stdlib.h string.h unistd.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1 _ACEOF fi done for ac_header in windows.h do : ac_fn_c_check_header_mongrel "$LINENO" "windows.h" "ac_cv_header_windows_h" "$ac_includes_default" if test "x$ac_cv_header_windows_h" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE_WINDOWS_H 1 _ACEOF HAVE_WINDOWS_H=yes fi done if test -n "$HAVE_WINDOWS_H"; then HAVE_WINDOWS_H_TRUE= HAVE_WINDOWS_H_FALSE='#' else HAVE_WINDOWS_H_TRUE='#' HAVE_WINDOWS_H_FALSE= fi if test "$cross_compiling" != no; then CROSS_COMPILING_TRUE= CROSS_COMPILING_FALSE='#' else CROSS_COMPILING_TRUE='#' CROSS_COMPILING_FALSE= fi # Checks for typedefs, structures, and compiler characteristics. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5 $as_echo_n "checking for stdbool.h that conforms to C99... " >&6; } if ${ac_cv_header_stdbool_h+:} false; then : $as_echo_n "(cached) " >&6 else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #ifndef bool "error: bool is not defined" #endif #ifndef false "error: false is not defined" #endif #if false "error: false is not 0" #endif #ifndef true "error: true is not defined" #endif #if true != 1 "error: true is not 1" #endif #ifndef __bool_true_false_are_defined "error: __bool_true_false_are_defined is not defined" #endif struct s { _Bool s: 1; _Bool t; } s; char a[true == 1 ? 1 : -1]; char b[false == 0 ? 1 : -1]; char c[__bool_true_false_are_defined == 1 ? 1 : -1]; char d[(bool) 0.5 == true ? 1 : -1]; /* See body of main program for 'e'. */ char f[(_Bool) 0.0 == false ? 1 : -1]; char g[true]; char h[sizeof (_Bool)]; char i[sizeof s.t]; enum { j = false, k = true, l = false * true, m = true * 256 }; /* The following fails for HP aC++/ANSI C B3910B A.05.55 [Dec 04 2003]. */ _Bool n[m]; char o[sizeof n == m * sizeof n[0] ? 1 : -1]; char p[-1 - (_Bool) 0 < 0 && -1 - (bool) 0 < 0 ? 1 : -1]; /* Catch a bug in an HP-UX C compiler. See http://gcc.gnu.org/ml/gcc-patches/2003-12/msg02303.html http://lists.gnu.org/archive/html/bug-coreutils/2005-11/msg00161.html */ _Bool q = true; _Bool *pq = &q; int main () { bool e = &s; *pq |= q; *pq |= ! q; /* Refer to every declared value, to avoid compiler optimizations. */ return (!a + !b + !c + !d + !e + !f + !g + !h + !i + !!j + !k + !!l + !m + !n + !o + !p + !q + !pq); ; return 0; } _ACEOF if ac_fn_c_try_compile "$LINENO"; then : ac_cv_header_stdbool_h=yes else ac_cv_header_stdbool_h=no fi rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_header_stdbool_h" >&5 $as_echo "$ac_cv_header_stdbool_h" >&6; } ac_fn_c_check_type "$LINENO" "_Bool" "ac_cv_type__Bool" "$ac_includes_default" if test "x$ac_cv_type__Bool" = xyes; then : cat >>confdefs.h <<_ACEOF #define HAVE__BOOL 1 _ACEOF fi ac_fn_c_find_intX_t "$LINENO" "16" "ac_cv_c_int16_t" case $ac_cv_c_int16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int16_t $ac_cv_c_int16_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "32" "ac_cv_c_int32_t" case $ac_cv_c_int32_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int32_t $ac_cv_c_int32_t _ACEOF ;; esac ac_fn_c_find_intX_t "$LINENO" "64" "ac_cv_c_int64_t" case $ac_cv_c_int64_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define int64_t $ac_cv_c_int64_t _ACEOF ;; esac ac_fn_c_check_type "$LINENO" "size_t" "ac_cv_type_size_t" "$ac_includes_default" if test "x$ac_cv_type_size_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define size_t unsigned int _ACEOF fi ac_fn_c_check_type "$LINENO" "ssize_t" "ac_cv_type_ssize_t" "$ac_includes_default" if test "x$ac_cv_type_ssize_t" = xyes; then : else cat >>confdefs.h <<_ACEOF #define ssize_t int _ACEOF fi ac_fn_c_find_uintX_t "$LINENO" "16" "ac_cv_c_uint16_t" case $ac_cv_c_uint16_t in #( no|yes) ;; #( *) cat >>confdefs.h <<_ACEOF #define uint16_t $ac_cv_c_uint16_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "32" "ac_cv_c_uint32_t" case $ac_cv_c_uint32_t in #( no|yes) ;; #( *) $as_echo "#define _UINT32_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint32_t $ac_cv_c_uint32_t _ACEOF ;; esac ac_fn_c_find_uintX_t "$LINENO" "8" "ac_cv_c_uint8_t" case $ac_cv_c_uint8_t in #( no|yes) ;; #( *) $as_echo "#define _UINT8_T 1" >>confdefs.h cat >>confdefs.h <<_ACEOF #define uint8_t $ac_cv_c_uint8_t _ACEOF ;; esac # Checks for library functions. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for working strtod" >&5 $as_echo_n "checking for working strtod... " >&6; } if ${ac_cv_func_strtod+:} false; then : $as_echo_n "(cached) " >&6 else if test "$cross_compiling" = yes; then : ac_cv_func_strtod=no else cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default #ifndef strtod double strtod (); #endif int main() { { /* Some versions of Linux strtod mis-parse strings with leading '+'. */ char *string = " +69"; char *term; double value; value = strtod (string, &term); if (value != 69 || term != (string + 4)) return 1; } { /* Under Solaris 2.4, strtod returns the wrong value for the terminating character under some conditions. */ char *string = "NaN"; char *term; strtod (string, &term); if (term != string && *(term - 1) == 0) return 1; } return 0; } _ACEOF if ac_fn_c_try_run "$LINENO"; then : ac_cv_func_strtod=yes else ac_cv_func_strtod=no fi rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ conftest.$ac_objext conftest.beam conftest.$ac_ext fi fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_func_strtod" >&5 $as_echo "$ac_cv_func_strtod" >&6; } if test $ac_cv_func_strtod = no; then case " $LIBOBJS " in *" strtod.$ac_objext "* ) ;; *) LIBOBJS="$LIBOBJS strtod.$ac_objext" ;; esac ac_fn_c_check_func "$LINENO" "pow" "ac_cv_func_pow" if test "x$ac_cv_func_pow" = xyes; then : fi if test $ac_cv_func_pow = no; then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for pow in -lm" >&5 $as_echo_n "checking for pow in -lm... " >&6; } if ${ac_cv_lib_m_pow+:} false; then : $as_echo_n "(cached) " >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lm $LIBS" cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ /* Override any GCC internal prototype to avoid an error. Use char because int might match the return type of a GCC builtin and then its argument prototype would still apply. */ #ifdef __cplusplus extern "C" #endif char pow (); int main () { return pow (); ; return 0; } _ACEOF if ac_fn_c_try_link "$LINENO"; then : ac_cv_lib_m_pow=yes else ac_cv_lib_m_pow=no fi rm -f core conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_m_pow" >&5 $as_echo "$ac_cv_lib_m_pow" >&6; } if test "x$ac_cv_lib_m_pow" = xyes; then : POW_LIB=-lm else { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cannot find library containing definition of pow" >&5 $as_echo "$as_me: WARNING: cannot find library containing definition of pow" >&2;} fi fi fi for ac_func in atexit memmove memset select sqrt strcasecmp strchr strdup strerror strrchr strtol nanosleep do : as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" if eval test \"x\$"$as_ac_var"\" = x"yes"; then : cat >>confdefs.h <<_ACEOF #define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 _ACEOF fi done ac_config_files="$ac_config_files Makefile src/gpx/Makefile src/utils/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, we kill variables containing newlines. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. ( for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do eval ac_val=\$$ac_var case $ac_val in #( *${as_nl}*) case $ac_var in #( *_cv_*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: cache variable $ac_var contains a newline" >&5 $as_echo "$as_me: WARNING: cache variable $ac_var contains a newline" >&2;} ;; esac case $ac_var in #( _ | IFS | as_nl) ;; #( BASH_ARGV | BASH_SOURCE) eval $ac_var= ;; #( *) { eval $ac_var=; unset $ac_var;} ;; esac ;; esac done (set) 2>&1 | case $as_nl`(ac_space=' '; set) 2>&1` in #( *${as_nl}ac_space=\ *) # `set' does not quote correctly, so add quotes: double-quote # substitution turns \\\\ into \\, and sed turns \\ into \. sed -n \ "s/'/'\\\\''/g; s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" ;; #( *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p" ;; esac | sort ) | sed ' /^ac_cv_env_/b end t clear :clear s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ t end s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ :end' >>confcache if diff "$cache_file" confcache >/dev/null 2>&1; then :; else if test -w "$cache_file"; then if test "x$cache_file" != "x/dev/null"; then { $as_echo "$as_me:${as_lineno-$LINENO}: updating cache $cache_file" >&5 $as_echo "$as_me: updating cache $cache_file" >&6;} if test ! -f "$cache_file" || test -h "$cache_file"; then cat confcache >"$cache_file" else case $cache_file in #( */* | ?:*) mv -f confcache "$cache_file"$$ && mv -f "$cache_file"$$ "$cache_file" ;; #( *) mv -f confcache "$cache_file" ;; esac fi fi else { $as_echo "$as_me:${as_lineno-$LINENO}: not updating unwritable cache $cache_file" >&5 $as_echo "$as_me: not updating unwritable cache $cache_file" >&6;} fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' DEFS=-DHAVE_CONFIG_H ac_libobjs= ac_ltlibobjs= U= for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue # 1. Remove the extension, and $U if already installed. ac_script='s/\$U\././;s/\.o$//;s/\.obj$//' ac_i=`$as_echo "$ac_i" | sed "$ac_script"` # 2. Prepend LIBOBJDIR. When used with automake>=1.10 LIBOBJDIR # will be set to the directory where LIBOBJS objects are built. as_fn_append ac_libobjs " \${LIBOBJDIR}$ac_i\$U.$ac_objext" as_fn_append ac_ltlibobjs " \${LIBOBJDIR}$ac_i"'$U.lo' done LIBOBJS=$ac_libobjs LTLIBOBJS=$ac_ltlibobjs { $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5 $as_echo_n "checking that generated files are newer than configure... " >&6; } if test -n "$am_sleep_pid"; then # Hide warnings about reused PIDs. wait $am_sleep_pid 2>/dev/null fi { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5 $as_echo "done" >&6; } if test -n "$EXEEXT"; then am__EXEEXT_TRUE= am__EXEEXT_FALSE='#' else am__EXEEXT_TRUE='#' am__EXEEXT_FALSE= fi if test -z "${MAINTAINER_MODE_TRUE}" && test -z "${MAINTAINER_MODE_FALSE}"; then as_fn_error $? "conditional \"MAINTAINER_MODE\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then as_fn_error $? "conditional \"AMDEP\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${am__fastdepCC_TRUE}" && test -z "${am__fastdepCC_FALSE}"; then as_fn_error $? "conditional \"am__fastdepCC\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_SIGNOSX_TRUE}" && test -z "${HAVE_SIGNOSX_FALSE}"; then as_fn_error $? "conditional \"HAVE_SIGNOSX\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_CREATEDMG_TRUE}" && test -z "${HAVE_CREATEDMG_FALSE}"; then as_fn_error $? "conditional \"HAVE_CREATEDMG\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_PYTHON_TRUE}" && test -z "${HAVE_PYTHON_FALSE}"; then as_fn_error $? "conditional \"HAVE_PYTHON\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_DIFF_TRUE}" && test -z "${HAVE_DIFF_FALSE}"; then as_fn_error $? "conditional \"HAVE_DIFF\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${HAVE_WINDOWS_H_TRUE}" && test -z "${HAVE_WINDOWS_H_FALSE}"; then as_fn_error $? "conditional \"HAVE_WINDOWS_H\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi if test -z "${CROSS_COMPILING_TRUE}" && test -z "${CROSS_COMPILING_FALSE}"; then as_fn_error $? "conditional \"CROSS_COMPILING\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi : "${CONFIG_STATUS=./config.status}" ac_write_fail=0 ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $CONFIG_STATUS" >&5 $as_echo "$as_me: creating $CONFIG_STATUS" >&6;} as_write_fail=0 cat >$CONFIG_STATUS <<_ASEOF || as_write_fail=1 #! $SHELL # Generated by $as_me. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. debug=false ac_cs_recheck=false ac_cs_silent=false SHELL=\${CONFIG_SHELL-$SHELL} export SHELL _ASEOF cat >>$CONFIG_STATUS <<\_ASEOF || as_write_fail=1 ## -------------------- ## ## M4sh Initialization. ## ## -------------------- ## # Be more Bourne compatible DUALCASE=1; export DUALCASE # for MKS sh if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then : emulate sh NULLCMD=: # Pre-4.2 versions of Zsh do word splitting on ${1+"$@"}, which # is contrary to our usage. Disable this feature. alias -g '${1+"$@"}'='"$@"' setopt NO_GLOB_SUBST else case `(set -o) 2>/dev/null` in #( *posix*) : set -o posix ;; #( *) : ;; esac fi as_nl=' ' export as_nl # Printing a long string crashes Solaris 7 /usr/bin/printf. as_echo='\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\' as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo as_echo=$as_echo$as_echo$as_echo$as_echo$as_echo$as_echo # Prefer a ksh shell builtin over an external printf program on Solaris, # but without wasting forks for bash or zsh. if test -z "$BASH_VERSION$ZSH_VERSION" \ && (test "X`print -r -- $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='print -r --' as_echo_n='print -rn --' elif (test "X`printf %s $as_echo`" = "X$as_echo") 2>/dev/null; then as_echo='printf %s\n' as_echo_n='printf %s' else if test "X`(/usr/ucb/echo -n -n $as_echo) 2>/dev/null`" = "X-n $as_echo"; then as_echo_body='eval /usr/ucb/echo -n "$1$as_nl"' as_echo_n='/usr/ucb/echo -n' else as_echo_body='eval expr "X$1" : "X\\(.*\\)"' as_echo_n_body='eval arg=$1; case $arg in #( *"$as_nl"*) expr "X$arg" : "X\\(.*\\)$as_nl"; arg=`expr "X$arg" : ".*$as_nl\\(.*\\)"`;; esac; expr "X$arg" : "X\\(.*\\)" | tr -d "$as_nl" ' export as_echo_n_body as_echo_n='sh -c $as_echo_n_body as_echo' fi export as_echo_body as_echo='sh -c $as_echo_body as_echo' fi # The user is always right. if test "${PATH_SEPARATOR+set}" != set; then PATH_SEPARATOR=: (PATH='/bin;/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 && { (PATH='/bin:/bin'; FPATH=$PATH; sh -c :) >/dev/null 2>&1 || PATH_SEPARATOR=';' } fi # IFS # We need space, tab and new line, in precisely that order. Quoting is # there to prevent editors from complaining about space-tab. # (If _AS_PATH_WALK were called with IFS unset, it would disable word # splitting by setting IFS to empty value.) IFS=" "" $as_nl" # Find who we are. Look in the path if we contain no directory separator. as_myself= case $0 in #(( *[\\/]* ) as_myself=$0 ;; *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR for as_dir in $PATH do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break done IFS=$as_save_IFS ;; esac # We did not find ourselves, most probably we were run as `sh COMMAND' # in which case we are not to be found in the path. if test "x$as_myself" = x; then as_myself=$0 fi if test ! -f "$as_myself"; then $as_echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2 exit 1 fi # Unset variables that we do not need and which cause bugs (e.g. in # pre-3.0 UWIN ksh). But do not cause bugs in bash 2.01; the "|| exit 1" # suppresses any "Segmentation fault" message there. '((' could # trigger a bug in pdksh 5.2.14. for as_var in BASH_ENV ENV MAIL MAILPATH do eval test x\${$as_var+set} = xset \ && ( (unset $as_var) || exit 1) >/dev/null 2>&1 && unset $as_var || : done PS1='$ ' PS2='> ' PS4='+ ' # NLS nuisances. LC_ALL=C export LC_ALL LANGUAGE=C export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH # as_fn_error STATUS ERROR [LINENO LOG_FD] # ---------------------------------------- # Output "`basename $0`: error: ERROR" to stderr. If LINENO and LOG_FD are # provided, also output the error to LOG_FD, referencing LINENO. Then exit the # script with STATUS, using 1 if that was 0. as_fn_error () { as_status=$1; test $as_status -eq 0 && as_status=1 if test "$4"; then as_lineno=${as_lineno-"$3"} as_lineno_stack=as_lineno_stack=$as_lineno_stack $as_echo "$as_me:${as_lineno-$LINENO}: error: $2" >&$4 fi $as_echo "$as_me: error: $2" >&2 as_fn_exit $as_status } # as_fn_error # as_fn_set_status STATUS # ----------------------- # Set $? to STATUS, without forking. as_fn_set_status () { return $1 } # as_fn_set_status # as_fn_exit STATUS # ----------------- # Exit the shell with STATUS, even in a "trap 0" or "set -e" context. as_fn_exit () { set +e as_fn_set_status $1 exit $1 } # as_fn_exit # as_fn_unset VAR # --------------- # Portably unset VAR. as_fn_unset () { { eval $1=; unset $1;} } as_unset=as_fn_unset # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take # advantage of any shell optimizations that allow amortized linear growth over # repeated appends, instead of the typical quadratic growth present in naive # implementations. if (eval "as_var=1; as_var+=2; test x\$as_var = x12") 2>/dev/null; then : eval 'as_fn_append () { eval $1+=\$2 }' else as_fn_append () { eval $1=\$$1\$2 } fi # as_fn_append # as_fn_arith ARG... # ------------------ # Perform arithmetic evaluation on the ARGs, and store the result in the # global $as_val. Take advantage of shells that can avoid forks. The arguments # must be portable across $(()) and expr. if (eval "test \$(( 1 + 1 )) = 2") 2>/dev/null; then : eval 'as_fn_arith () { as_val=$(( $* )) }' else as_fn_arith () { as_val=`expr "$@" || test $? -eq 1` } fi # as_fn_arith if expr a : '\(a\)' >/dev/null 2>&1 && test "X`expr 00001 : '.*\(...\)'`" = X001; then as_expr=expr else as_expr=false fi if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then as_basename=basename else as_basename=false fi if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then as_dirname=dirname else as_dirname=false fi as_me=`$as_basename -- "$0" || $as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ X"$0" : 'X\(//\)$' \| \ X"$0" : 'X\(/\)' \| . 2>/dev/null || $as_echo X/"$0" | sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/ q } /^X\/\(\/\/\)$/{ s//\1/ q } /^X\/\(\/\).*/{ s//\1/ q } s/.*/./; q'` # Avoid depending upon Character Ranges. as_cr_letters='abcdefghijklmnopqrstuvwxyz' as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' as_cr_Letters=$as_cr_letters$as_cr_LETTERS as_cr_digits='0123456789' as_cr_alnum=$as_cr_Letters$as_cr_digits ECHO_C= ECHO_N= ECHO_T= case `echo -n x` in #((((( -n*) case `echo 'xy\c'` in *c*) ECHO_T=' ';; # ECHO_T is single tab character. xy) ECHO_C='\c';; *) echo `echo ksh88 bug on AIX 6.1` > /dev/null ECHO_T=' ';; esac;; *) ECHO_N='-n';; esac rm -f conf$$ conf$$.exe conf$$.file if test -d conf$$.dir; then rm -f conf$$.dir/conf$$.file else rm -f conf$$.dir mkdir conf$$.dir 2>/dev/null fi if (echo >conf$$.file) 2>/dev/null; then if ln -s conf$$.file conf$$ 2>/dev/null; then as_ln_s='ln -s' # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else as_ln_s='cp -pR' fi else as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null # as_fn_mkdir_p # ------------- # Create "$as_dir" as a directory, including parents if necessary. as_fn_mkdir_p () { case $as_dir in #( -*) as_dir=./$as_dir;; esac test -d "$as_dir" || eval $as_mkdir_p || { as_dirs= while :; do case $as_dir in #( *\'*) as_qdir=`$as_echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #'( *) as_qdir=$as_dir;; esac as_dirs="'$as_qdir' $as_dirs" as_dir=`$as_dirname -- "$as_dir" || $as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$as_dir" : 'X\(//\)[^/]' \| \ X"$as_dir" : 'X\(//\)$' \| \ X"$as_dir" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$as_dir" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` test -d "$as_dir" && break done test -z "$as_dirs" || eval "mkdir $as_dirs" } || test -d "$as_dir" || as_fn_error $? "cannot create directory $as_dir" } # as_fn_mkdir_p if mkdir -p . 2>/dev/null; then as_mkdir_p='mkdir -p "$as_dir"' else test -d ./-p && rmdir ./-p as_mkdir_p=false fi # as_fn_executable_p FILE # ----------------------- # Test if FILE is an executable regular file. as_fn_executable_p () { test -f "$1" && test -x "$1" } # as_fn_executable_p as_test_x='test -x' as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" # Sed expression to map a string onto a valid variable name. as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" exec 6>&1 ## ----------------------------------- ## ## Main body of $CONFIG_STATUS script. ## ## ----------------------------------- ## _ASEOF test $as_write_fail = 0 && chmod +x $CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Save the log message, to keep $0 and so on meaningful, and to # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" This file was extended by gpx $as_me 2.5.2, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS $ $0 $@ on `(hostname || uname -n) 2>/dev/null | sed 1q` " _ACEOF case $ac_config_files in *" "*) set x $ac_config_files; shift; ac_config_files=$*;; esac case $ac_config_headers in *" "*) set x $ac_config_headers; shift; ac_config_headers=$*;; esac cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. config_files="$ac_config_files" config_headers="$ac_config_headers" config_commands="$ac_config_commands" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 ac_cs_usage="\ \`$as_me' instantiates files and other configuration actions from templates according to the current configuration. Unless the files and actions are specified as TAGs, all are instantiated by default. Usage: $0 [OPTION]... [TAG]... -h, --help print this help, then exit -V, --version print version number and configuration settings, then exit --config print configuration, then exit -q, --quiet, --silent do not print progress messages -d, --debug don't remove temporary files --recheck update $as_me by reconfiguring in the same conditions --file=FILE[:TEMPLATE] instantiate the configuration file FILE --header=FILE[:TEMPLATE] instantiate the configuration header FILE Configuration files: $config_files Configuration headers: $config_headers Configuration commands: $config_commands Report bugs to . gpx home page: ." _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ gpx config.status 2.5.2 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." ac_pwd='$ac_pwd' srcdir='$srcdir' INSTALL='$INSTALL' MKDIR_P='$MKDIR_P' AWK='$AWK' test -n "\$AWK" || AWK=awk _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # The default lists apply if the user does not specify any file. ac_need_defaults=: while test $# != 0 do case $1 in --*=?*) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'` ac_shift=: ;; --*=) ac_option=`expr "X$1" : 'X\([^=]*\)='` ac_optarg= ac_shift=: ;; *) ac_option=$1 ac_optarg=$2 ac_shift=shift ;; esac case $ac_option in # Handling of the options. -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) ac_cs_recheck=: ;; --version | --versio | --versi | --vers | --ver | --ve | --v | -V ) $as_echo "$ac_cs_version"; exit ;; --config | --confi | --conf | --con | --co | --c ) $as_echo "$ac_cs_config"; exit ;; --debug | --debu | --deb | --de | --d | -d ) debug=: ;; --file | --fil | --fi | --f ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; '') as_fn_error $? "missing file argument" ;; esac as_fn_append CONFIG_FILES " '$ac_optarg'" ac_need_defaults=false;; --header | --heade | --head | --hea ) $ac_shift case $ac_optarg in *\'*) ac_optarg=`$as_echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` ;; esac as_fn_append CONFIG_HEADERS " '$ac_optarg'" ac_need_defaults=false;; --he | --h) # Conflict between --help and --header as_fn_error $? "ambiguous option: \`$1' Try \`$0 --help' for more information.";; --help | --hel | -h ) $as_echo "$ac_cs_usage"; exit ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil | --si | --s) ac_cs_silent=: ;; # This is an error. -*) as_fn_error $? "unrecognized option: \`$1' Try \`$0 --help' for more information." ;; *) as_fn_append ac_config_targets " $1" ac_need_defaults=false ;; esac shift done ac_configure_extra_args= if $ac_cs_silent; then exec 6>/dev/null ac_configure_extra_args="$ac_configure_extra_args --silent" fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' export CONFIG_SHELL exec "\$@" fi _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 exec 5>>config.log { echo sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX ## Running $as_me. ## _ASBOX $as_echo "$ac_log" } >&5 _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # # INIT-COMMANDS # AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir" _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # Handling of arguments. for ac_config_target in $ac_config_targets do case $ac_config_target in "src/shared/config.h") CONFIG_HEADERS="$CONFIG_HEADERS src/shared/config.h" ;; "depfiles") CONFIG_COMMANDS="$CONFIG_COMMANDS depfiles" ;; "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;; "src/gpx/Makefile") CONFIG_FILES="$CONFIG_FILES src/gpx/Makefile" ;; "src/utils/Makefile") CONFIG_FILES="$CONFIG_FILES src/utils/Makefile" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac done # If the user did not use the arguments to specify the items to instantiate, # then the envvar interface is used. Set only those that are not. # We use the long form for the default assignment because of an extremely # bizarre bug on SunOS 4.1.3. if $ac_need_defaults; then test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands fi # Have a temporary directory for convenience. Make it in the build tree # simply because there is no reason against having it here, and in addition, # creating and moving files from /tmp can sometimes cause problems. # Hook for its removal unless debugging. # Note that there is a small window in which the directory will not be cleaned: # after its creation but before its name has been assigned to `$tmp'. $debug || { tmp= ac_tmp= trap 'exit_status=$? : "${ac_tmp:=$tmp}" { test ! -d "$ac_tmp" || rm -fr "$ac_tmp"; } && exit $exit_status ' 0 trap 'as_fn_exit 1' 1 2 13 15 } # Create a (secure) tmp directory for tmp files. { tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` && test -d "$tmp" } || { tmp=./conf$$-$RANDOM (umask 077 && mkdir "$tmp") } || as_fn_error $? "cannot create a temporary directory in ." "$LINENO" 5 ac_tmp=$tmp # Set up the scripts for CONFIG_FILES section. # No need to generate them if there are no CONFIG_FILES. # This happens for instance with `./config.status config.h'. if test -n "$CONFIG_FILES"; then ac_cr=`echo X | tr X '\015'` # On cygwin, bash can eat \r inside `` if the user requested igncr. # But we know of no other shell where ac_cr would be empty at this # point, so we can use a bashism as a fallback. if test "x$ac_cr" = x; then eval ac_cr=\$\'\\r\' fi ac_cs_awk_cr=`$AWK 'BEGIN { print "a\rb" }' /dev/null` if test "$ac_cs_awk_cr" = "a${ac_cr}b"; then ac_cs_awk_cr='\\r' else ac_cs_awk_cr=$ac_cr fi echo 'BEGIN {' >"$ac_tmp/subs1.awk" && _ACEOF { echo "cat >conf$$subs.awk <<_ACEOF" && echo "$ac_subst_vars" | sed 's/.*/&!$&$ac_delim/' && echo "_ACEOF" } >conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_num=`echo "$ac_subst_vars" | grep -c '^'` ac_delim='%!_!# ' for ac_last_try in false false false false false :; do . ./conf$$subs.sh || as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 ac_delim_n=`sed -n "s/.*$ac_delim\$/X/p" conf$$subs.awk | grep -c X` if test $ac_delim_n = $ac_delim_num; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_STATUS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done rm -f conf$$subs.sh cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 cat >>"\$ac_tmp/subs1.awk" <<\\_ACAWK && _ACEOF sed -n ' h s/^/S["/; s/!.*/"]=/ p g s/^[^!]*!// :repl t repl s/'"$ac_delim"'$// t delim :nl h s/\(.\{148\}\)..*/\1/ t more1 s/["\\]/\\&/g; s/^/"/; s/$/\\n"\\/ p n b repl :more1 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t nl :delim h s/\(.\{148\}\)..*/\1/ t more2 s/["\\]/\\&/g; s/^/"/; s/$/"/ p b :more2 s/["\\]/\\&/g; s/^/"/; s/$/"\\/ p g s/.\{148\}// t delim ' >$CONFIG_STATUS || ac_write_fail=1 rm -f conf$$subs.awk cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 _ACAWK cat >>"\$ac_tmp/subs1.awk" <<_ACAWK && for (key in S) S_is_set[key] = 1 FS = "" } { line = $ 0 nfields = split(line, field, "@") substed = 0 len = length(field[1]) for (i = 2; i < nfields; i++) { key = field[i] keylen = length(key) if (S_is_set[key]) { value = S[key] line = substr(line, 1, len) "" value "" substr(line, len + keylen + 3) len += length(value) + length(field[++i]) substed = 1 } else len += 1 + keylen } print line } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 if sed "s/$ac_cr//" < /dev/null > /dev/null 2>&1; then sed "s/$ac_cr\$//; s/$ac_cr/$ac_cs_awk_cr/g" else cat fi < "$ac_tmp/subs1.awk" > "$ac_tmp/subs.awk" \ || as_fn_error $? "could not setup config files machinery" "$LINENO" 5 _ACEOF # VPATH may cause trouble with some makes, so we remove sole $(srcdir), # ${srcdir} and @srcdir@ entries from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[ ]*/{ h s/// s/^/:/ s/[ ]*$/:/ s/:\$(srcdir):/:/g s/:\${srcdir}:/:/g s/:@srcdir@:/:/g s/^:*// s/:*$// x s/\(=[ ]*\).*/\1/ G s/\n// s/^[^=]*=[ ]*$// }' fi cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 fi # test -n "$CONFIG_FILES" # Set up the scripts for CONFIG_HEADERS section. # No need to generate them if there are no CONFIG_HEADERS. # This happens for instance with `./config.status Makefile'. if test -n "$CONFIG_HEADERS"; then cat >"$ac_tmp/defines.awk" <<\_ACAWK || BEGIN { _ACEOF # Transform confdefs.h into an awk script `defines.awk', embedded as # here-document in config.status, that substitutes the proper values into # config.h.in to produce config.h. # Create a delimiter string that does not exist in confdefs.h, to ease # handling of long lines. ac_delim='%!_!# ' for ac_last_try in false false :; do ac_tt=`sed -n "/$ac_delim/p" confdefs.h` if test -z "$ac_tt"; then break elif $ac_last_try; then as_fn_error $? "could not make $CONFIG_HEADERS" "$LINENO" 5 else ac_delim="$ac_delim!$ac_delim _$ac_delim!! " fi done # For the awk script, D is an array of macro values keyed by name, # likewise P contains macro parameters if any. Preserve backslash # newline sequences. ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]* sed -n ' s/.\{148\}/&'"$ac_delim"'/g t rset :rset s/^[ ]*#[ ]*define[ ][ ]*/ / t def d :def s/\\$// t bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3"/p s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2"/p d :bsnl s/["\\]/\\&/g s/^ \('"$ac_word_re"'\)\(([^()]*)\)[ ]*\(.*\)/P["\1"]="\2"\ D["\1"]=" \3\\\\\\n"\\/p t cont s/^ \('"$ac_word_re"'\)[ ]*\(.*\)/D["\1"]=" \2\\\\\\n"\\/p t cont d :cont n s/.\{148\}/&'"$ac_delim"'/g t clear :clear s/\\$// t bsnlc s/["\\]/\\&/g; s/^/"/; s/$/"/p d :bsnlc s/["\\]/\\&/g; s/^/"/; s/$/\\\\\\n"\\/p b cont ' >$CONFIG_STATUS || ac_write_fail=1 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 for (key in D) D_is_set[key] = 1 FS = "" } /^[\t ]*#[\t ]*(define|undef)[\t ]+$ac_word_re([\t (]|\$)/ { line = \$ 0 split(line, arg, " ") if (arg[1] == "#") { defundef = arg[2] mac1 = arg[3] } else { defundef = substr(arg[1], 2) mac1 = arg[2] } split(mac1, mac2, "(") #) macro = mac2[1] prefix = substr(line, 1, index(line, defundef) - 1) if (D_is_set[macro]) { # Preserve the white space surrounding the "#". print prefix "define", macro P[macro] D[macro] next } else { # Replace #undef with comments. This is necessary, for example, # in the case of _POSIX_SOURCE, which is predefined and required # on some systems where configure will not decide to define it. if (defundef == "undef") { print "/*", prefix defundef, macro, "*/" next } } } { print } _ACAWK _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 as_fn_error $? "could not setup config headers machinery" "$LINENO" 5 fi # test -n "$CONFIG_HEADERS" eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS" shift for ac_tag do case $ac_tag in :[FHLC]) ac_mode=$ac_tag; continue;; esac case $ac_mode$ac_tag in :[FHL]*:*);; :L* | :C*:*) as_fn_error $? "invalid tag \`$ac_tag'" "$LINENO" 5;; :[FH]-) ac_tag=-:-;; :[FH]*) ac_tag=$ac_tag:$ac_tag.in;; esac ac_save_IFS=$IFS IFS=: set x $ac_tag IFS=$ac_save_IFS shift ac_file=$1 shift case $ac_mode in :L) ac_source=$1;; :[FH]) ac_file_inputs= for ac_f do case $ac_f in -) ac_f="$ac_tmp/stdin";; *) # Look for the file first in the build tree, then in the source tree # (if the path is not absolute). The absolute path cannot be DOS-style, # because $ac_f cannot contain `:'. test -f "$ac_f" || case $ac_f in [\\/$]*) false;; *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";; esac || as_fn_error 1 "cannot find input file: \`$ac_f'" "$LINENO" 5;; esac case $ac_f in *\'*) ac_f=`$as_echo "$ac_f" | sed "s/'/'\\\\\\\\''/g"`;; esac as_fn_append ac_file_inputs " '$ac_f'" done # Let's still pretend it is `configure' which instantiates (i.e., don't # use $as_me), people would be surprised to read: # /* config.h. Generated by config.status. */ configure_input='Generated from '` $as_echo "$*" | sed 's|^[^:]*/||;s|:[^:]*/|, |g' `' by configure.' if test x"$ac_file" != x-; then configure_input="$ac_file. $configure_input" { $as_echo "$as_me:${as_lineno-$LINENO}: creating $ac_file" >&5 $as_echo "$as_me: creating $ac_file" >&6;} fi # Neutralize special characters interpreted by sed in replacement strings. case $configure_input in #( *\&* | *\|* | *\\* ) ac_sed_conf_input=`$as_echo "$configure_input" | sed 's/[\\\\&|]/\\\\&/g'`;; #( *) ac_sed_conf_input=$configure_input;; esac case $ac_tag in *:-:* | *:-) cat >"$ac_tmp/stdin" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; esac ;; esac ac_dir=`$as_dirname -- "$ac_file" || $as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$ac_file" : 'X\(//\)[^/]' \| \ X"$ac_file" : 'X\(//\)$' \| \ X"$ac_file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$ac_file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir="$ac_dir"; as_fn_mkdir_p ac_builddir=. case "$ac_dir" in .) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_dir_suffix=/`$as_echo "$ac_dir" | sed 's|^\.[\\/]||'` # A ".." for each directory in $ac_dir_suffix. ac_top_builddir_sub=`$as_echo "$ac_dir_suffix" | sed 's|/[^\\/]*|/..|g;s|/||'` case $ac_top_builddir_sub in "") ac_top_builddir_sub=. ac_top_build_prefix= ;; *) ac_top_build_prefix=$ac_top_builddir_sub/ ;; esac ;; esac ac_abs_top_builddir=$ac_pwd ac_abs_builddir=$ac_pwd$ac_dir_suffix # for backward compatibility: ac_top_builddir=$ac_top_build_prefix case $srcdir in .) # We are building in place. ac_srcdir=. ac_top_srcdir=$ac_top_builddir_sub ac_abs_top_srcdir=$ac_pwd ;; [\\/]* | ?:[\\/]* ) # Absolute name. ac_srcdir=$srcdir$ac_dir_suffix; ac_top_srcdir=$srcdir ac_abs_top_srcdir=$srcdir ;; *) # Relative name. ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix ac_top_srcdir=$ac_top_build_prefix$srcdir ac_abs_top_srcdir=$ac_pwd/$srcdir ;; esac ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix case $ac_mode in :F) # # CONFIG_FILE # case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;; esac ac_MKDIR_P=$MKDIR_P case $MKDIR_P in [\\/$]* | ?:[\\/]* ) ;; */*) ac_MKDIR_P=$ac_top_build_prefix$MKDIR_P ;; esac _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # If the template does not know about datarootdir, expand it. # FIXME: This hack should be removed a few years after 2.60. ac_datarootdir_hack=; ac_datarootdir_seen= ac_sed_dataroot=' /datarootdir/ { p q } /@datadir@/p /@docdir@/p /@infodir@/p /@localedir@/p /@mandir@/p' case `eval "sed -n \"\$ac_sed_dataroot\" $ac_file_inputs"` in *datarootdir*) ac_datarootdir_seen=yes;; *@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*) { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5 $as_echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;} _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_datarootdir_hack=' s&@datadir@&$datadir&g s&@docdir@&$docdir&g s&@infodir@&$infodir&g s&@localedir@&$localedir&g s&@mandir@&$mandir&g s&\\\${datarootdir}&$datarootdir&g' ;; esac _ACEOF # Neutralize VPATH when `$srcdir' = `.'. # Shell code in configure.ac might set extrasub. # FIXME: do we really want to maintain this feature? cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_sed_extra="$ac_vpsub $extrasub _ACEOF cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s|@configure_input@|$ac_sed_conf_input|;t t s&@top_builddir@&$ac_top_builddir_sub&;t t s&@top_build_prefix@&$ac_top_build_prefix&;t t s&@srcdir@&$ac_srcdir&;t t s&@abs_srcdir@&$ac_abs_srcdir&;t t s&@top_srcdir@&$ac_top_srcdir&;t t s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t s&@builddir@&$ac_builddir&;t t s&@abs_builddir@&$ac_abs_builddir&;t t s&@abs_top_builddir@&$ac_abs_top_builddir&;t t s&@INSTALL@&$ac_INSTALL&;t t s&@MKDIR_P@&$ac_MKDIR_P&;t t $ac_datarootdir_hack " eval sed \"\$ac_sed_extra\" "$ac_file_inputs" | $AWK -f "$ac_tmp/subs.awk" \ >$ac_tmp/out || as_fn_error $? "could not create $ac_file" "$LINENO" 5 test -z "$ac_datarootdir_hack$ac_datarootdir_seen" && { ac_out=`sed -n '/\${datarootdir}/p' "$ac_tmp/out"`; test -n "$ac_out"; } && { ac_out=`sed -n '/^[ ]*datarootdir[ ]*:*=/p' \ "$ac_tmp/out"`; test -z "$ac_out"; } && { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&5 $as_echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir' which seems to be undefined. Please make sure it is defined" >&2;} rm -f "$ac_tmp/stdin" case $ac_file in -) cat "$ac_tmp/out" && rm -f "$ac_tmp/out";; *) rm -f "$ac_file" && mv "$ac_tmp/out" "$ac_file";; esac \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 ;; :H) # # CONFIG_HEADER # if test x"$ac_file" != x-; then { $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" } >"$ac_tmp/config.h" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 if diff "$ac_file" "$ac_tmp/config.h" >/dev/null 2>&1; then { $as_echo "$as_me:${as_lineno-$LINENO}: $ac_file is unchanged" >&5 $as_echo "$as_me: $ac_file is unchanged" >&6;} else rm -f "$ac_file" mv "$ac_tmp/config.h" "$ac_file" \ || as_fn_error $? "could not create $ac_file" "$LINENO" 5 fi else $as_echo "/* $configure_input */" \ && eval '$AWK -f "$ac_tmp/defines.awk"' "$ac_file_inputs" \ || as_fn_error $? "could not create -" "$LINENO" 5 fi # Compute "$ac_file"'s index in $config_headers. _am_arg="$ac_file" _am_stamp_count=1 for _am_header in $config_headers :; do case $_am_header in $_am_arg | $_am_arg:* ) break ;; * ) _am_stamp_count=`expr $_am_stamp_count + 1` ;; esac done echo "timestamp for $_am_arg" >`$as_dirname -- "$_am_arg" || $as_expr X"$_am_arg" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$_am_arg" : 'X\(//\)[^/]' \| \ X"$_am_arg" : 'X\(//\)$' \| \ X"$_am_arg" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$_am_arg" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'`/stamp-h$_am_stamp_count ;; :C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5 $as_echo "$as_me: executing $ac_file commands" >&6;} ;; esac case $ac_file$ac_mode in "depfiles":C) test x"$AMDEP_TRUE" != x"" || { # Older Autoconf quotes --file arguments for eval, but not when files # are listed without --file. Let's play safe and only enable the eval # if we detect the quoting. case $CONFIG_FILES in *\'*) eval set x "$CONFIG_FILES" ;; *) set x $CONFIG_FILES ;; esac shift for mf do # Strip MF so we end up with the name of the file. mf=`echo "$mf" | sed -e 's/:.*$//'` # Check whether this is an Automake generated Makefile or not. # We used to match only the files named 'Makefile.in', but # some people rename them; so instead we look at the file content. # Grep'ing the first line is not enough: some people post-process # each Makefile.in and add a new line on top of each file to say so. # Grep'ing the whole file is not good either: AIX grep has a line # limit of 2048, but all sed's we know have understand at least 4000. if sed -n 's,^#.*generated by automake.*,X,p' "$mf" | grep X >/dev/null 2>&1; then dirpart=`$as_dirname -- "$mf" || $as_expr X"$mf" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$mf" : 'X\(//\)[^/]' \| \ X"$mf" : 'X\(//\)$' \| \ X"$mf" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$mf" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` else continue fi # Extract the definition of DEPDIR, am__include, and am__quote # from the Makefile without running 'make'. DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"` test -z "$DEPDIR" && continue am__include=`sed -n 's/^am__include = //p' < "$mf"` test -z "$am__include" && continue am__quote=`sed -n 's/^am__quote = //p' < "$mf"` # Find all dependency output files, they are included files with # $(DEPDIR) in their names. We invoke sed twice because it is the # simplest approach to changing $(DEPDIR) to its actual value in the # expansion. for file in `sed -n " s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do # Make sure the directory exists. test -f "$dirpart/$file" && continue fdir=`$as_dirname -- "$file" || $as_expr X"$file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ X"$file" : 'X\(//\)[^/]' \| \ X"$file" : 'X\(//\)$' \| \ X"$file" : 'X\(/\)' \| . 2>/dev/null || $as_echo X"$file" | sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/ q } /^X\(\/\/\)[^/].*/{ s//\1/ q } /^X\(\/\/\)$/{ s//\1/ q } /^X\(\/\).*/{ s//\1/ q } s/.*/./; q'` as_dir=$dirpart/$fdir; as_fn_mkdir_p # echo "creating $dirpart/$file" echo '# dummy' > "$dirpart/$file" done done } ;; esac done # for ac_tag as_fn_exit 0 _ACEOF ac_clean_files=$ac_clean_files_save test $ac_write_fail = 0 || as_fn_error $? "write failure creating $CONFIG_STATUS" "$LINENO" 5 # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: ac_config_status_args= test "$silent" = yes && ac_config_status_args="$ac_config_status_args --quiet" exec 5>/dev/null $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false exec 5>>config.log # Use ||, not &&, to avoid exiting from the if with $? = 1, which # would make configure fail if this is the last instruction. $ac_cs_success || as_fn_exit 1 fi if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: unrecognized options: $ac_unrecognized_opts" >&5 $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;} fi GPX-2.5.2/configure.ac000066400000000000000000000042621271205255700144560ustar00rootroot00000000000000# -*- Autoconf -*- # Process this file with autoconf to produce a configure script. AC_PREREQ([2.69]) AC_INIT([gpx], [2.5.2], [https://github.com/markwal/GPX/issues],,[https://github.com/markwal/GPX]) AC_CONFIG_AUX_DIR([build-aux]) AM_INIT_AUTOMAKE([foreign subdir-objects]) AM_MAINTAINER_MODE([disable]) AM_EXTRA_RECURSIVE_TARGETS([test]) AC_CONFIG_SRCDIR([src/gpx/gpx.c]) AC_CONFIG_HEADERS([src/shared/config.h]) # Checks for cross compiling and arbitrary platform specifics AC_CANONICAL_BUILD AC_CANONICAL_HOST AC_SUBST(PLATFORM, [`$ac_aux_dir/archive-name.sh $host_os $host_cpu`]) case $PLATFORM in win*) BDIST_TARGET="bdist-zip" CFLAGS="$CFLAGS -pthread" LDFLAGS="$LDFLAGS -static -static-libgcc -lpthread" ;; osx) BDIST_TARGET="bdist-dmg" ;; *) BDIST_TARGET="bdist-gzip" ;; esac AC_SUBST(BDIST_TARGET) # Checks for programs. AC_PROG_CC AC_PROG_MAKE_SET AC_CHECK_PROG([SIGNOSX], [sign-osx.sh], [sign-osx.sh]) AM_CONDITIONAL([HAVE_SIGNOSX], [test -n "$SIGNOSX"]) AC_CHECK_PROG([CREATEDMG], [hdiutil], [hdiutil create -format UDZO -srcfolder]) AM_CONDITIONAL([HAVE_CREATEDMG], [test -n "$CREATEDMG"]) AC_CHECK_PROG([PYTHON], [python], [python]) AM_CONDITIONAL([HAVE_PYTHON], [test -n "$PYTHON"]) AC_CHECK_PROG([DIFF], [diff], [diff -b]) AM_CONDITIONAL([HAVE_DIFF], [test -n "$DIFF"]) # Checks for libraries. # Checks for header files. AC_CHECK_HEADERS([fcntl.h float.h inttypes.h limits.h stdint.h stdlib.h string.h unistd.h]) AC_CHECK_HEADERS([windows.h], [HAVE_WINDOWS_H=yes]) AM_CONDITIONAL([HAVE_WINDOWS_H], [test -n "$HAVE_WINDOWS_H"]) AM_CONDITIONAL([CROSS_COMPILING], [test "$cross_compiling" != no]) # Checks for typedefs, structures, and compiler characteristics. AC_CHECK_HEADER_STDBOOL AC_TYPE_INT16_T AC_TYPE_INT32_T AC_TYPE_INT64_T AC_TYPE_SIZE_T AC_TYPE_SSIZE_T AC_TYPE_UINT16_T AC_TYPE_UINT32_T AC_TYPE_UINT8_T # Checks for library functions. AC_FUNC_STRTOD AC_CHECK_FUNCS([atexit memmove memset select sqrt strcasecmp strchr strdup strerror strrchr strtol nanosleep]) AC_CONFIG_FILES([Makefile src/gpx/Makefile src/utils/Makefile]) AC_OUTPUT GPX-2.5.2/examples/000077500000000000000000000000001271205255700140025ustar00rootroot00000000000000GPX-2.5.2/examples/example-machine.ini000066400000000000000000000052541271205255700175460ustar00rootroot00000000000000; ; example-machine.ini (custom machine definition) ; ; Thing-O-Matic Mk7 (dual) machine definition file ; ; To create your own machine definition for custom printers start ; with a corresponding machine definition file from ReplicatorG ; and customize from there ; ; http://github.com/makerbot/ReplicatorG/tree/master/machines ;************ MACHINE ************ [machine] ; specifies the nominal filament diameter (either 1.75 or 3.0) nominal_filament_diameter=1.75 ; spesifies the number of extruders on this machine extruder_count=2 ; sets the timeout for homing in seconds timeout=20 ;************ X AXIS ************ [x] ; sets the maximum feedrate for this axis in mm/minute max_feedrate=9600 ; sets the home feedrate for this axis in mm/minute home_feedrate=500 ; sets the number of steps per mm of movement for this axis ; Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) steps_per_mm=47.069852 ; sets the homing direction for this axis ; maximum = 1 ; minimum = 0 endstop=0 ;************ Y AXIS ************ [y] ; sets the maximum feedrate for this axis in mm/minute max_feedrate=9600 ; sets the home feedrate for this axis in mm/minute home_feedrate=500 ; sets the number of steps per mm of movement for this axis ; Pulley dia: 10.82mm / 1/8 step = 1/(10.82 * pi / 1600) steps_per_mm=47.069852 ; sets the homing direction for this axis ; maximum = 1 ; minimum = 0 endstop=0 ;************ Z AXIS ************ [z] ; sets the maximum feedrate for this axis in mm/minute max_feedrate=1000 ; sets the home feedrate for this axis in mm/minute home_feedrate=500 ; sets the number of steps per mm of movement for this axis ; TR-8x8 Z axis = 1/(8/1600) steps_per_mm=200 ; sets the homing direction for this axis ; maximum = 1 ; minimum = 0 endstop=1 ;************ RIGHT EXTUDER (A AXIS) ************ [a] ; sets the maximum feedrate for this axis in mm/minute max_feedrate=1600 ; sets the number of steps per mm of extrusion ; Steps/mm is calculated by dividing the 'drive gear steps per revolution' ; (in this case, equal to motor_steps) by the 'drive gear circumference' ; (drive gear diameter = 10.14) So we get: 1600/(PI * 0.14) = 50.235.... steps_per_mm=50.235478806907409 ; sets the number of steps per revolution motor_steps=1600 ; signals if this tool has a heated build platform has_heated_build_platform=0 ;************ LEFT EXTUDER (B AXIS) ************ [b] ; sets the maximum feedrate for this axis in mm/minute max_feedrate=1600 ; sets the number of steps per mm of extrusion steps_per_mm=50.235478806907409 ; sets the number of steps per revolution motor_steps=1600 ; signals if this tool has a heated build platform has_heated_build_platform=1 GPX-2.5.2/examples/example-pause-at-zpos.ini000066400000000000000000000005331271205255700206450ustar00rootroot00000000000000; ; example-pause-at-zpos.ini (macro script) ; [macro] slicer: 1.70mm filament: blue 1.72mm 230c #000FF filament: red 1.69mm 220c #FF0000 filament: white 1.75mm 210c #FFFFFF start: white ; start with white filament pause: 3.0 red ; pause @ zPos 3mm and change to red filament pause: 6.0 blue ; pause @ zPos 6mm and change to blue filament GPX-2.5.2/examples/example-temperature.ini000066400000000000000000000004621271205255700204730ustar00rootroot00000000000000; ; example-temperature.ini (macro script) ; [macro] slicer: 1.75mm filament: wood 1.75mm 240c #FFFFFF start: wood ; start with wood filament temperature: 1.0 180c temperature: 4.0 240c temperature: 5.0 180c temperature: 8.0 240c temperature: 9.0 180c temperature: 12.0 240c temperature: 13.0 180c GPX-2.5.2/examples/gpx.ini000066400000000000000000000051371271205255700153070ustar00rootroot00000000000000; ; gpx.ini ; ; gcode to x3g conversion configuration file ; ;************ POST PROCESSING OPTIONS ************ [printer] ; MACHINE TYPE ; ; specify the machine definition using a pre-defined built-in type identifier ; ; NOTE: settings are order dependent, so always start by settng the machine type ; ; c3 = Cupcake Gen3 XYZ, Mk5/6 + Gen4 Extruder ; c4 = Cupcake Gen4 XYZ, Mk5/6 + Gen4 Extruder ; cp4 = Cupcake Pololu XYZ, Mk5/6 + Gen4 Extruder ; cpp = Cupcake Pololu XYZ, Mk5/6 + Pololu Extruder ; cxy = Core-XY with HBP - single extruder ; cxysz = Core-XY with HBP - single extruder, slow Z ; r1 = Replicator 1 - single extruder ; r1d = Replicator 1 - dual extruder ; r2 = Replicator 2 (default) ; r2h = Replicator 2 with HBP ; r2x = Replicator 2X ; t6 = TOM Mk6 - single extruder ; t7 = TOM Mk7 - single extruder ; t7d = TOM Mk7 - dual extruder ; z = ZYYX - single extruder ; zd = ZYYX - dual extruder machine_type=r2 ; GCODE FLAVOR ; ; specify the gcode flavor ; ; reprap = M109 Set Extruder Temperature and Wait ; makerbot = M109 Set Build Platform Temperature (Same as M140) gcode_flavor=reprap ; BUILD TEMPERATURE ; ; override the gcode build plate temperature ; 0 = disabled build_platform_temperature=0 ; BUILD PROGRESS ; ; generate gcode for the build progress ; this should be enabled for slic3r and kisslicer ; 1 = enabled ; 0 = disabled build_progress=1 ; DITTO PRINTING ; ; print simultaniously with both nozzles ; 1 = enabled ; 0 = disabled ditto_printing=0 ; FILAMENT DIAMETER ; ; set this to the filament diameter setting used in the slicer ; 1.75 = default slicer_filament_diameter=1.75 ; SD CARD PATH ; ; if an SD card is inserted the x3g file will be written there ; uncomment to enable and substitute the name of your SD card volume ;sd_card_path=/Volumes/Things/ ;************ RIGHT EXTRUDER ************ [right] ; ACTUAL FILAMENT DIAMETER ; ; override gcode for the right filament diameter ; 1.75 = default ; 0 = disabled actual_filament_diameter=0 ; ACTIVE TEMPERATURE ; ; override gcode for the right active temperature ; 0 = disabled active_temperature=0 ; STANDBY TEMPERATURE ; ; override gcode for the right standby temperature ; 0 = disabled standby_temperature=0 ;************ LEFT EXTRUDER ************ [left] ; ACTUAL FILAMENT DIAMETER ; ; override gcode for the left filament diameter ; 1.75 = default ; 0 = disabled actual_filament_diameter=0 ; ACTIVE TEMPERATURE ; ; override gcode for the left active temperature ; 0 = disabled active_temperature=0 ; STANDBY TEMPERATURE ; ; override gcode for the left standby temperature ; 0 = disabled standby_temperature=0 GPX-2.5.2/examples/macro-example.gcode000066400000000000000000003471011271205255700175450ustar00rootroot00000000000000(**** CONFIGURATION MACROS ****) ;@printer r2 ;@enable progress (**** Wingcommander start.gcode for Replicator 2 ****) M70 P0 (KISSlicer Profiles for Sailfish) M103 (turn extruder off) M73 P0 (start build progress) M104 T0 S225 (set extruder temperature) (**** begin homing ****) G162 X Y F2500 (home XY axes maximum) G161 Z F1100 (home Z axis minimum) G92 Z-5 (set Z to -5) G1 Z0.0 (move Z to "0") G161 Z F100 (home Z axis minimum slowly) M132 X Y Z A B (load current position from EPROM for XYZAB axis) (**** end homing ****) G1 X145 Y75 Z30 F9000 (move to waiting position off build plate) M70 P1 (KISSlicer Profiles for Sailfish) G130 X20 Y20 Z20 A20 B20 (lower stepper Vrefs while heating) M6 T0 (wait for extruder to reach temperature) G130 X127 Y127 Z40 A127 B127 (set stepper motor Vref to defaults) G1 X145 Y75 Z0.5 (position nozzle) M108 R5.0 (set extruder to 5 RPM) M101 (start extruder) G4 P3500 (pre-prime extruder) G1 X140 Y70 Z0.2 F1100 (do a slow wipe...) G1 X140 Y70 Z0.5 F1100 (...and lift) M108 R0.0 (stop extruder) (**** PAUSE @ ZPOS MACROS ****) ;@slicer 1.70mm ;@filament white 1.75mm 230c #FFFFFF (white filament) ;@filament red 1.69mm 225c #FF0000 (red filament) ;@filament blue 1.72mm 225c #000FF (blue filament) ;@start white ;@pause 6.0 blue ;@pause 3.0 red ;@body (notify GPX body has started) (**** end of start.gcode ****) G92 E0 (**** Select Extruder.gcode ****) M104 T0 S225 G92 E0 M126 G1 X13.73 Y13.73 Z0.15 E0 F8400 G1 E2 F1200 M101 G1 X13.11 Y14.24 E2.0569 F2400 G1 X12.34 Y14.62 E2.1174 G1 X11.47 Y14.82 E2.1799 G1 X10.92 Y14.84 E2.2187 G1 X-8.93 Y14.84 E3.6183 G1 X-9.54 Y14.81 E3.6613 G1 X-10.36 Y14.61 E3.7202 G1 X-11.11 Y14.24 E3.7797 G1 X-11.73 Y13.73 E3.8364 G1 X-12.24 Y13.1 E3.8931 G1 X-12.62 Y12.34 E3.9535 G1 X-12.82 Y11.47 E4.016 G1 X-12.84 Y10.92 E4.0548 G1 X-12.84 Y-8.93 E5.4544 G1 X-12.81 Y-9.54 E5.4974 G1 X-12.61 Y-10.36 E5.5563 G1 X-12.24 Y-11.11 E5.6158 G1 X-11.73 Y-11.73 E5.6725 G1 X-11.1 Y-12.24 E5.7292 G1 X-10.34 Y-12.62 E5.7896 G1 X-9.47 Y-12.82 E5.8522 G1 X-8.92 Y-12.84 E5.891 G1 X10.93 Y-12.84 E7.2905 G1 X11.54 Y-12.81 E7.3335 G1 X12.36 Y-12.61 E7.3924 G1 X13.11 Y-12.24 E7.4519 G1 X13.73 Y-11.73 E7.5086 G1 X14.24 Y-11.1 E7.5654 G1 X14.62 Y-10.34 E7.6257 G1 X14.82 Y-9.47 E7.6883 G1 X14.84 Y-8.92 E7.7271 G1 X14.84 Y10.93 E9.1266 G1 X14.81 Y11.54 E9.1696 G1 X14.61 Y12.36 E9.2286 G1 X14.24 Y13.11 E9.288 G1 X13.73 Y13.73 E9.3444 M103 G1 E7.3444 F1200 G1 X13.11 Y14.24 E7.3444 F2400 G1 X12.34 Y14.62 E7.3444 G1 X11.47 Y14.82 E7.3444 G1 X10.92 Y14.84 E7.3444 G1 X9.02 Y14.84 E7.3444 G1 X10.39 Y10.39 E7.3444 F8400 G1 E9.3444 F1200 M101 G1 X-8.39 Y10.39 E10.0065 F2400 G1 X-8.39 Y-8.39 E10.6685 G1 X10.39 Y-8.39 E11.3306 G1 X10.39 Y10.39 E11.9927 M103 G1 X10.72 Y10.67 E11.9927 F8400 M101 G1 X10.79 Y10.79 E11.9976 F2400 G1 X-8.79 Y10.79 E12.6878 G1 X-8.79 Y-8.79 E13.3781 G1 X10.79 Y-8.79 E14.0683 G1 X10.79 Y10.79 E14.7585 G1 X10.67 Y10.72 E14.7635 M103 G1 X10.05 Y9.49 E14.7635 F8400 M101 G1 X9.55 Y9.99 E14.7886 F2400 G1 X8.98 Y9.99 E14.8085 G1 X9.99 Y8.98 E14.8588 G1 X9.99 Y8.41 E14.8788 G1 X8.41 Y9.99 E14.9573 G1 X7.85 Y9.99 E14.9772 G1 X9.99 Y7.85 E15.0839 G1 X9.99 Y7.28 E15.1038 G1 X7.28 Y9.99 E15.2387 G1 X6.72 Y9.99 E15.2587 G1 X9.99 Y6.72 E15.4218 G1 X9.99 Y6.15 E15.4417 G1 X6.15 Y9.99 E15.633 G1 X5.59 Y9.99 E15.6529 G1 X9.99 Y5.59 E15.8724 G1 X9.99 Y5.02 E15.8924 G1 X5.02 Y9.99 E16.14 G1 X4.46 Y9.99 E16.16 G1 X9.99 Y4.46 E16.4359 G1 X9.99 Y3.89 E16.4558 G1 X3.89 Y9.99 E16.7599 G1 X3.32 Y9.99 E16.7798 G1 X9.99 Y3.32 E17.1121 G1 X9.99 Y2.76 E17.132 G1 X2.76 Y9.99 E17.4925 G1 X2.19 Y9.99 E17.5124 G1 X9.99 Y2.19 E17.9011 G1 X9.99 Y1.63 E17.921 G1 X1.63 Y9.99 E18.3379 G1 X1.06 Y9.99 E18.3578 G1 X9.99 Y1.06 E18.8029 G1 X9.99 Y0.5 E18.8228 G1 X0.5 Y9.99 E19.2961 G1 X-0.07 Y9.99 E19.316 G1 X9.99 Y-0.07 E19.8175 G1 X9.99 Y-0.64 E19.8374 G1 X-0.64 Y9.99 E20.367 G1 X-1.2 Y9.99 E20.387 G1 X9.99 Y-1.2 E20.9448 G1 X9.99 Y-1.77 E20.9648 G1 X-1.77 Y9.99 E21.5508 G1 X-2.33 Y9.99 E21.5707 G1 X9.99 Y-2.33 E22.185 G1 X9.99 Y-2.9 E22.2049 G1 X-2.9 Y9.99 E22.8473 G1 X-3.46 Y9.99 E22.8673 G1 X9.99 Y-3.46 E23.5379 G1 X9.99 Y-4.03 E23.5578 G1 X-4.03 Y9.99 E24.2567 G1 X-4.6 Y9.99 E24.2766 G1 X9.99 Y-4.6 E25.0036 G1 X9.99 Y-5.16 E25.0236 G1 X-5.16 Y9.99 E25.7788 G1 X-5.73 Y9.99 E25.7987 G1 X9.99 Y-5.73 E26.5821 G1 X9.99 Y-6.29 E26.6021 G1 X-6.29 Y9.99 E27.4137 G1 X-6.86 Y9.99 E27.4336 G1 X9.99 Y-6.86 E28.2734 G1 X9.99 Y-7.42 E28.2934 G1 X-7.42 Y9.99 E29.1614 G1 X-7.99 Y9.99 E29.1813 G1 X9.99 Y-7.99 E30.0775 G1 X9.42 Y-7.99 E30.0974 G1 X-7.99 Y9.42 E30.9654 G1 X-7.99 Y8.86 E30.9854 G1 X8.86 Y-7.99 E31.8252 G1 X8.29 Y-7.99 E31.8451 G1 X-7.99 Y8.29 E32.6567 G1 X-7.99 Y7.73 E32.6767 G1 X7.73 Y-7.99 E33.4601 G1 X7.16 Y-7.99 E33.48 G1 X-7.99 Y7.16 E34.2352 G1 X-7.99 Y6.6 E34.2552 G1 X6.6 Y-7.99 E34.9822 G1 X6.03 Y-7.99 E35.0021 G1 X-7.99 Y6.03 E35.7009 G1 X-7.99 Y5.46 E35.7209 G1 X5.46 Y-7.99 E36.3915 G1 X4.9 Y-7.99 E36.4114 G1 X-7.99 Y4.9 E37.0539 G1 X-7.99 Y4.33 E37.0738 G1 X4.33 Y-7.99 E37.688 G1 X3.77 Y-7.99 E37.708 G1 X-7.99 Y3.77 E38.294 G1 X-7.99 Y3.2 E38.314 G1 X3.2 Y-7.99 E38.8718 G1 X2.64 Y-7.99 E38.8917 G1 X-7.99 Y2.64 E39.4214 G1 X-7.99 Y2.07 E39.4413 G1 X2.07 Y-7.99 E39.9428 G1 X1.5 Y-7.99 E39.9627 G1 X-7.99 Y1.5 E40.436 G1 X-7.99 Y0.94 E40.4559 G1 X0.94 Y-7.99 E40.901 G1 X0.37 Y-7.99 E40.9209 G1 X-7.99 Y0.37 E41.3378 G1 X-7.99 Y-0.19 E41.3577 G1 X-0.19 Y-7.99 E41.7464 G1 X-0.76 Y-7.99 E41.7663 G1 X-7.99 Y-0.76 E42.1268 G1 X-7.99 Y-1.32 E42.1467 G1 X-1.32 Y-7.99 E42.479 G1 X-1.89 Y-7.99 E42.4989 G1 X-7.99 Y-1.89 E42.803 G1 X-7.99 Y-2.46 E42.8229 G1 X-2.46 Y-7.99 E43.0988 G1 X-3.02 Y-7.99 E43.1187 G1 X-7.99 Y-3.02 E43.3664 G1 X-7.99 Y-3.59 E43.3864 G1 X-3.59 Y-7.99 E43.6058 G1 X-4.15 Y-7.99 E43.6258 G1 X-7.99 Y-4.15 E43.8171 G1 X-7.99 Y-4.72 E43.837 G1 X-4.72 Y-7.99 E44.0001 G1 X-5.28 Y-7.99 E44.02 G1 X-7.99 Y-5.28 E44.1549 G1 X-7.99 Y-5.85 E44.1749 G1 X-5.85 Y-7.99 E44.2816 G1 X-6.41 Y-7.99 E44.3015 G1 X-7.99 Y-6.41 E44.38 G1 X-7.99 Y-6.98 E44.4 G1 X-6.98 Y-7.99 E44.4503 G1 X-7.55 Y-7.99 E44.4702 G1 X-8.01 Y-7.53 E44.4932 M103 G1 E42.4932 F1200 G1 X-7.55 Y-7.99 E42.4932 F2400 G1 X-6.98 Y-7.99 E42.4932 G1 X-7.99 Y-6.98 E42.4932 G1 X-7.99 Y-6.41 E42.4932 G1 X-6.72 Y-7.68 E42.4932 G1 X-6.72 Y-7.68 Z0.25 E42.4932 F1200 (**** LAYER 0.25 ****) G92 E0 G1 X10.39 Y10.39 Z0.25 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F4800 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F4800 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z0.35 E17.5744 F1200 (**** LAYER 0.35 ****) G92 E0 G1 X10.39 Y10.39 Z0.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.05 Y9.49 E4.7095 F8400 M101 G1 X9.55 Y9.99 E4.7221 F4800 G1 X8.98 Y9.99 E4.732 G1 X9.99 Y8.98 E4.7572 G1 X9.99 Y8.41 E4.7672 G1 X8.41 Y9.99 E4.8064 G1 X7.85 Y9.99 E4.8164 G1 X9.99 Y7.85 E4.8697 G1 X9.99 Y7.28 E4.8797 G1 X7.28 Y9.99 E4.9472 G1 X6.72 Y9.99 E4.9571 G1 X9.99 Y6.72 E5.0387 G1 X9.99 Y6.15 E5.0486 G1 X6.15 Y9.99 E5.1443 G1 X5.59 Y9.99 E5.1543 G1 X9.99 Y5.59 E5.264 G1 X9.99 Y5.02 E5.274 G1 X5.02 Y9.99 E5.3978 G1 X4.46 Y9.99 E5.4078 G1 X9.99 Y4.46 E5.5457 G1 X9.99 Y3.89 E5.5557 G1 X3.89 Y9.99 E5.7077 G1 X3.32 Y9.99 E5.7177 G1 X9.99 Y3.32 E5.8838 G1 X9.99 Y2.76 E5.8938 G1 X2.76 Y9.99 E6.074 G1 X2.19 Y9.99 E6.084 G1 X9.99 Y2.19 E6.2783 G1 X9.99 Y1.63 E6.2883 G1 X1.63 Y9.99 E6.4967 G1 X1.06 Y9.99 E6.5067 G1 X9.99 Y1.06 E6.7292 G1 X9.99 Y0.5 E6.7392 G1 X0.5 Y9.99 E6.9758 G1 X-0.07 Y9.99 E6.9858 G1 X9.99 Y-0.07 E7.2365 G1 X9.99 Y-0.64 E7.2465 G1 X-0.64 Y9.99 E7.5113 G1 X-1.2 Y9.99 E7.5213 G1 X9.99 Y-1.2 E7.8002 G1 X9.99 Y-1.77 E7.8102 G1 X-1.77 Y9.99 E8.1032 G1 X-2.33 Y9.99 E8.1132 G1 X9.99 Y-2.33 E8.4203 G1 X9.99 Y-2.9 E8.4302 G1 X-2.9 Y9.99 E8.7515 G1 X-3.46 Y9.99 E8.7614 G1 X9.99 Y-3.46 E9.0967 G1 X9.99 Y-4.03 E9.1067 G1 X-4.03 Y9.99 E9.4561 G1 X-4.6 Y9.99 E9.4661 G1 X9.99 Y-4.6 E9.8296 G1 X9.99 Y-5.16 E9.8396 G1 X-5.16 Y9.99 E10.2172 G1 X-5.73 Y9.99 E10.2271 G1 X9.99 Y-5.73 E10.6188 G1 X9.99 Y-6.29 E10.6288 G1 X-6.29 Y9.99 E11.0346 G1 X-6.86 Y9.99 E11.0446 G1 X9.99 Y-6.86 E11.4645 G1 X9.99 Y-7.42 E11.4745 G1 X-7.42 Y9.99 E11.9085 G1 X-7.99 Y9.99 E11.9184 G1 X9.99 Y-7.99 E12.3665 G1 X9.42 Y-7.99 E12.3765 G1 X-7.99 Y9.42 E12.8105 G1 X-7.99 Y8.86 E12.8205 G1 X8.86 Y-7.99 E13.2404 G1 X8.29 Y-7.99 E13.2503 G1 X-7.99 Y8.29 E13.6561 G1 X-7.99 Y7.73 E13.6661 G1 X7.73 Y-7.99 E14.0578 G1 X7.16 Y-7.99 E14.0678 G1 X-7.99 Y7.16 E14.4454 G1 X-7.99 Y6.6 E14.4554 G1 X6.6 Y-7.99 E14.8189 G1 X6.03 Y-7.99 E14.8288 G1 X-7.99 Y6.03 E15.1783 G1 X-7.99 Y5.46 E15.1882 G1 X5.46 Y-7.99 E15.5235 G1 X4.9 Y-7.99 E15.5335 G1 X-7.99 Y4.9 E15.8547 G1 X-7.99 Y4.33 E15.8647 G1 X4.33 Y-7.99 E16.1718 G1 X3.77 Y-7.99 E16.1818 G1 X-7.99 Y3.77 E16.4748 G1 X-7.99 Y3.2 E16.4848 G1 X3.2 Y-7.99 E16.7637 G1 X2.64 Y-7.99 E16.7737 G1 X-7.99 Y2.64 E17.0385 G1 X-7.99 Y2.07 E17.0484 G1 X2.07 Y-7.99 E17.2992 G1 X1.5 Y-7.99 E17.3091 G1 X-7.99 Y1.5 E17.5458 G1 X-7.99 Y0.94 E17.5557 G1 X0.94 Y-7.99 E17.7783 G1 X0.37 Y-7.99 E17.7882 G1 X-7.99 Y0.37 E17.9967 G1 X-7.99 Y-0.19 E18.0066 G1 X-0.19 Y-7.99 E18.201 G1 X-0.76 Y-7.99 E18.2109 G1 X-7.99 Y-0.76 E18.3912 G1 X-7.99 Y-1.32 E18.4011 G1 X-1.32 Y-7.99 E18.5673 G1 X-1.89 Y-7.99 E18.5772 G1 X-7.99 Y-1.89 E18.7293 G1 X-7.99 Y-2.46 E18.7392 G1 X-2.46 Y-7.99 E18.8772 G1 X-3.02 Y-7.99 E18.8872 G1 X-7.99 Y-3.02 E19.011 G1 X-7.99 Y-3.59 E19.021 G1 X-3.59 Y-7.99 E19.1307 G1 X-4.15 Y-7.99 E19.1407 G1 X-7.99 Y-4.15 E19.2363 G1 X-7.99 Y-4.72 E19.2463 G1 X-4.72 Y-7.99 E19.3278 G1 X-5.28 Y-7.99 E19.3378 G1 X-7.99 Y-5.28 E19.4053 G1 X-7.99 Y-5.85 E19.4152 G1 X-5.85 Y-7.99 E19.4686 G1 X-6.41 Y-7.99 E19.4785 G1 X-7.99 Y-6.41 E19.5178 G1 X-7.99 Y-6.98 E19.5278 G1 X-6.98 Y-7.99 E19.5529 G1 X-7.55 Y-7.99 E19.5629 G1 X-8.01 Y-7.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y-7.99 E17.5744 F7200 G1 X-6.98 Y-7.99 E17.5744 G1 X-7.99 Y-6.98 E17.5744 G1 X-7.99 Y-6.41 E17.5744 G1 X-6.72 Y-7.68 E17.5744 G1 X-6.72 Y-7.68 Z0.45 E17.5744 F1200 (**** LAYER 0.45 ****) G92 E0 G1 X10.39 Y10.39 Z0.45 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F7200 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F7200 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z0.55 E17.5744 F1200 (**** LAYER 0.55 ****) G92 E0 G1 X10.39 Y10.39 Z0.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.05 Y9.49 E4.7095 F8400 M101 G1 X9.55 Y9.99 E4.7221 F4800 G1 X8.98 Y9.99 E4.732 G1 X9.99 Y8.98 E4.7572 G1 X9.99 Y8.41 E4.7672 G1 X8.41 Y9.99 E4.8064 G1 X7.85 Y9.99 E4.8164 G1 X9.99 Y7.85 E4.8697 G1 X9.99 Y7.28 E4.8797 G1 X7.28 Y9.99 E4.9472 G1 X6.72 Y9.99 E4.9571 G1 X9.99 Y6.72 E5.0387 G1 X9.99 Y6.15 E5.0486 G1 X6.15 Y9.99 E5.1443 G1 X5.59 Y9.99 E5.1543 G1 X9.99 Y5.59 E5.264 G1 X9.99 Y5.02 E5.274 G1 X5.02 Y9.99 E5.3978 G1 X4.46 Y9.99 E5.4078 G1 X9.99 Y4.46 E5.5457 G1 X9.99 Y3.89 E5.5557 G1 X3.89 Y9.99 E5.7077 G1 X3.32 Y9.99 E5.7177 G1 X9.99 Y3.32 E5.8838 G1 X9.99 Y2.76 E5.8938 G1 X2.76 Y9.99 E6.074 G1 X2.19 Y9.99 E6.084 G1 X9.99 Y2.19 E6.2783 G1 X9.99 Y1.63 E6.2883 G1 X1.63 Y9.99 E6.4967 G1 X1.06 Y9.99 E6.5067 G1 X9.99 Y1.06 E6.7292 G1 X9.99 Y0.5 E6.7392 G1 X0.5 Y9.99 E6.9758 G1 X-0.07 Y9.99 E6.9858 G1 X9.99 Y-0.07 E7.2365 G1 X9.99 Y-0.64 E7.2465 G1 X-0.64 Y9.99 E7.5113 G1 X-1.2 Y9.99 E7.5213 G1 X9.99 Y-1.2 E7.8002 G1 X9.99 Y-1.77 E7.8102 G1 X-1.77 Y9.99 E8.1032 G1 X-2.33 Y9.99 E8.1132 G1 X9.99 Y-2.33 E8.4203 G1 X9.99 Y-2.9 E8.4302 G1 X-2.9 Y9.99 E8.7515 G1 X-3.46 Y9.99 E8.7614 G1 X9.99 Y-3.46 E9.0967 G1 X9.99 Y-4.03 E9.1067 G1 X-4.03 Y9.99 E9.4561 G1 X-4.6 Y9.99 E9.4661 G1 X9.99 Y-4.6 E9.8296 G1 X9.99 Y-5.16 E9.8396 G1 X-5.16 Y9.99 E10.2172 G1 X-5.73 Y9.99 E10.2271 G1 X9.99 Y-5.73 E10.6188 G1 X9.99 Y-6.29 E10.6288 G1 X-6.29 Y9.99 E11.0346 G1 X-6.86 Y9.99 E11.0446 G1 X9.99 Y-6.86 E11.4645 G1 X9.99 Y-7.42 E11.4745 G1 X-7.42 Y9.99 E11.9085 G1 X-7.99 Y9.99 E11.9184 G1 X9.99 Y-7.99 E12.3665 G1 X9.42 Y-7.99 E12.3765 G1 X-7.99 Y9.42 E12.8105 G1 X-7.99 Y8.86 E12.8205 G1 X8.86 Y-7.99 E13.2404 G1 X8.29 Y-7.99 E13.2503 G1 X-7.99 Y8.29 E13.6561 G1 X-7.99 Y7.73 E13.6661 G1 X7.73 Y-7.99 E14.0578 G1 X7.16 Y-7.99 E14.0678 G1 X-7.99 Y7.16 E14.4454 G1 X-7.99 Y6.6 E14.4554 G1 X6.6 Y-7.99 E14.8189 G1 X6.03 Y-7.99 E14.8288 G1 X-7.99 Y6.03 E15.1783 G1 X-7.99 Y5.46 E15.1882 G1 X5.46 Y-7.99 E15.5235 G1 X4.9 Y-7.99 E15.5335 G1 X-7.99 Y4.9 E15.8547 G1 X-7.99 Y4.33 E15.8647 G1 X4.33 Y-7.99 E16.1718 G1 X3.77 Y-7.99 E16.1818 G1 X-7.99 Y3.77 E16.4748 G1 X-7.99 Y3.2 E16.4848 G1 X3.2 Y-7.99 E16.7637 G1 X2.64 Y-7.99 E16.7737 G1 X-7.99 Y2.64 E17.0385 G1 X-7.99 Y2.07 E17.0484 G1 X2.07 Y-7.99 E17.2992 G1 X1.5 Y-7.99 E17.3091 G1 X-7.99 Y1.5 E17.5458 G1 X-7.99 Y0.94 E17.5557 G1 X0.94 Y-7.99 E17.7783 G1 X0.37 Y-7.99 E17.7882 G1 X-7.99 Y0.37 E17.9967 G1 X-7.99 Y-0.19 E18.0066 G1 X-0.19 Y-7.99 E18.201 G1 X-0.76 Y-7.99 E18.2109 G1 X-7.99 Y-0.76 E18.3912 G1 X-7.99 Y-1.32 E18.4011 G1 X-1.32 Y-7.99 E18.5673 G1 X-1.89 Y-7.99 E18.5772 G1 X-7.99 Y-1.89 E18.7293 G1 X-7.99 Y-2.46 E18.7392 G1 X-2.46 Y-7.99 E18.8772 G1 X-3.02 Y-7.99 E18.8872 G1 X-7.99 Y-3.02 E19.011 G1 X-7.99 Y-3.59 E19.021 G1 X-3.59 Y-7.99 E19.1307 G1 X-4.15 Y-7.99 E19.1407 G1 X-7.99 Y-4.15 E19.2363 G1 X-7.99 Y-4.72 E19.2463 G1 X-4.72 Y-7.99 E19.3278 G1 X-5.28 Y-7.99 E19.3378 G1 X-7.99 Y-5.28 E19.4053 G1 X-7.99 Y-5.85 E19.4152 G1 X-5.85 Y-7.99 E19.4686 G1 X-6.41 Y-7.99 E19.4785 G1 X-7.99 Y-6.41 E19.5178 G1 X-7.99 Y-6.98 E19.5278 G1 X-6.98 Y-7.99 E19.5529 G1 X-7.55 Y-7.99 E19.5629 G1 X-8.01 Y-7.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y-7.99 E17.5744 F7200 G1 X-6.98 Y-7.99 E17.5744 G1 X-7.99 Y-6.98 E17.5744 G1 X-7.99 Y-6.41 E17.5744 G1 X-6.72 Y-7.68 E17.5744 G1 X-6.72 Y-7.68 Z0.65 E17.5744 F1200 (**** LAYER 0.65 ****) G92 E0 G1 X10.39 Y10.39 Z0.65 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F7200 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F7200 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z0.75 E17.5744 F1200 (**** LAYER 0.75 ****) G92 E0 G1 X10.39 Y10.39 Z0.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z0.85 E4.7095 F1200 (**** LAYER 0.85 ****) G92 E0 G1 X10.39 Y10.39 Z0.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z0.95 E5.389 F1200 (**** LAYER 0.95 ****) G92 E0 G1 X10.39 Y10.39 Z0.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z1.05 E4.7095 F1200 (**** LAYER 1.05 ****) G92 E0 G1 X10.39 Y10.39 Z1.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z1.15 E5.389 F1200 (**** LAYER 1.15 ****) G92 E0 G1 X10.39 Y10.39 Z1.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z1.25 E4.7095 F1200 (**** LAYER 1.25 ****) G92 E0 G1 X10.39 Y10.39 Z1.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z1.35 E5.389 F1200 (**** LAYER 1.35 ****) G92 E0 G1 X10.39 Y10.39 Z1.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z1.45 E4.7095 F1200 (**** LAYER 1.45 ****) G92 E0 G1 X10.39 Y10.39 Z1.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z1.55 E5.389 F1200 (**** LAYER 1.55 ****) G92 E0 G1 X10.39 Y10.39 Z1.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z1.65 E4.7095 F1200 (**** LAYER 1.65 ****) G92 E0 G1 X10.39 Y10.39 Z1.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z1.75 E5.389 F1200 (**** LAYER 1.75 ****) G92 E0 G1 X10.39 Y10.39 Z1.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z1.85 E4.7095 F1200 (**** LAYER 1.85 ****) G92 E0 G1 X10.39 Y10.39 Z1.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z1.95 E5.389 F1200 (**** LAYER 1.95 ****) G92 E0 G1 X10.39 Y10.39 Z1.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z2.05 E4.7095 F1200 (**** LAYER 2.05 ****) G92 E0 G1 X10.39 Y10.39 Z2.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z2.15 E5.389 F1200 (**** LAYER 2.15 ****) G92 E0 G1 X10.39 Y10.39 Z2.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z2.25 E4.7095 F1200 (**** LAYER 2.25 ****) G92 E0 G1 X10.39 Y10.39 Z2.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z2.35 E5.389 F1200 (**** LAYER 2.35 ****) G92 E0 G1 X10.39 Y10.39 Z2.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z2.45 E4.7095 F1200 (**** LAYER 2.45 ****) G92 E0 G1 X10.39 Y10.39 Z2.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z2.55 E5.389 F1200 (**** LAYER 2.55 ****) G92 E0 G1 X10.39 Y10.39 Z2.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z2.65 E4.7095 F1200 (**** LAYER 2.65 ****) G92 E0 G1 X10.39 Y10.39 Z2.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z2.75 E5.389 F1200 (**** LAYER 2.75 ****) G92 E0 G1 X10.39 Y10.39 Z2.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z2.85 E4.7095 F1200 (**** LAYER 2.85 ****) G92 E0 G1 X10.39 Y10.39 Z2.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z2.95 E5.389 F1200 (**** LAYER 2.95 ****) G92 E0 G1 X10.39 Y10.39 Z2.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z3.05 E4.7095 F1200 (**** LAYER 3.05 ****) G92 E0 G1 X10.39 Y10.39 Z3.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z3.15 E5.389 F1200 (**** LAYER 3.15 ****) G92 E0 G1 X10.39 Y10.39 Z3.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z3.25 E4.7095 F1200 (**** LAYER 3.25 ****) G92 E0 G1 X10.39 Y10.39 Z3.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z3.35 E5.389 F1200 (**** LAYER 3.35 ****) G92 E0 G1 X10.39 Y10.39 Z3.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z3.45 E4.7095 F1200 (**** LAYER 3.45 ****) G92 E0 G1 X10.39 Y10.39 Z3.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z3.55 E5.389 F1200 (**** LAYER 3.55 ****) G92 E0 G1 X10.39 Y10.39 Z3.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z3.65 E4.7095 F1200 (**** LAYER 3.65 ****) G92 E0 G1 X10.39 Y10.39 Z3.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z3.75 E5.389 F1200 (**** LAYER 3.75 ****) G92 E0 G1 X10.39 Y10.39 Z3.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z3.85 E4.7095 F1200 (**** LAYER 3.85 ****) G92 E0 G1 X10.39 Y10.39 Z3.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z3.95 E5.389 F1200 (**** LAYER 3.95 ****) G92 E0 G1 X10.39 Y10.39 Z3.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z4.05 E4.7095 F1200 (**** LAYER 4.05 ****) G92 E0 G1 X10.39 Y10.39 Z4.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z4.15 E5.389 F1200 (**** LAYER 4.15 ****) G92 E0 G1 X10.39 Y10.39 Z4.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z4.25 E4.7095 F1200 (**** LAYER 4.25 ****) G92 E0 G1 X10.39 Y10.39 Z4.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z4.35 E5.389 F1200 (**** LAYER 4.35 ****) G92 E0 G1 X10.39 Y10.39 Z4.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z4.45 E4.7095 F1200 (**** LAYER 4.45 ****) G92 E0 G1 X10.39 Y10.39 Z4.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z4.55 E5.389 F1200 (**** LAYER 4.55 ****) G92 E0 G1 X10.39 Y10.39 Z4.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z4.65 E4.7095 F1200 (**** LAYER 4.65 ****) G92 E0 G1 X10.39 Y10.39 Z4.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z4.75 E5.389 F1200 (**** LAYER 4.75 ****) G92 E0 G1 X10.39 Y10.39 Z4.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z4.85 E4.7095 F1200 (**** LAYER 4.85 ****) G92 E0 G1 X10.39 Y10.39 Z4.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z4.95 E5.389 F1200 (**** LAYER 4.95 ****) G92 E0 G1 X10.39 Y10.39 Z4.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z5.05 E4.7095 F1200 (**** LAYER 5.05 ****) G92 E0 G1 X10.39 Y10.39 Z5.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z5.15 E5.389 F1200 (**** LAYER 5.15 ****) G92 E0 G1 X10.39 Y10.39 Z5.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z5.25 E4.7095 F1200 (**** LAYER 5.25 ****) G92 E0 G1 X10.39 Y10.39 Z5.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z5.35 E5.389 F1200 (**** LAYER 5.35 ****) G92 E0 G1 X10.39 Y10.39 Z5.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z5.45 E4.7095 F1200 (**** LAYER 5.45 ****) G92 E0 G1 X10.39 Y10.39 Z5.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z5.55 E5.389 F1200 (**** LAYER 5.55 ****) G92 E0 G1 X10.39 Y10.39 Z5.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z5.65 E4.7095 F1200 (**** LAYER 5.65 ****) G92 E0 G1 X10.39 Y10.39 Z5.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z5.75 E5.389 F1200 (**** LAYER 5.75 ****) G92 E0 G1 X10.39 Y10.39 Z5.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z5.85 E4.7095 F1200 (**** LAYER 5.85 ****) G92 E0 G1 X10.39 Y10.39 Z5.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z5.95 E5.389 F1200 (**** LAYER 5.95 ****) G92 E0 G1 X10.39 Y10.39 Z5.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z6.05 E4.7095 F1200 (**** LAYER 6.05 ****) G92 E0 G1 X10.39 Y10.39 Z6.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z6.15 E5.389 F1200 (**** LAYER 6.15 ****) G92 E0 G1 X10.39 Y10.39 Z6.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z6.25 E4.7095 F1200 (**** LAYER 6.25 ****) G92 E0 G1 X10.39 Y10.39 Z6.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z6.35 E5.389 F1200 (**** LAYER 6.35 ****) G92 E0 G1 X10.39 Y10.39 Z6.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z6.45 E4.7095 F1200 (**** LAYER 6.45 ****) G92 E0 G1 X10.39 Y10.39 Z6.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z6.55 E5.389 F1200 (**** LAYER 6.55 ****) G92 E0 G1 X10.39 Y10.39 Z6.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z6.65 E4.7095 F1200 (**** LAYER 6.65 ****) G92 E0 G1 X10.39 Y10.39 Z6.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z6.75 E5.389 F1200 (**** LAYER 6.75 ****) G92 E0 G1 X10.39 Y10.39 Z6.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z6.85 E4.7095 F1200 (**** LAYER 6.85 ****) G92 E0 G1 X10.39 Y10.39 Z6.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z6.95 E5.389 F1200 (**** LAYER 6.95 ****) G92 E0 G1 X10.39 Y10.39 Z6.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z7.05 E4.7095 F1200 (**** LAYER 7.05 ****) G92 E0 G1 X10.39 Y10.39 Z7.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z7.15 E5.389 F1200 (**** LAYER 7.15 ****) G92 E0 G1 X10.39 Y10.39 Z7.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z7.25 E4.7095 F1200 (**** LAYER 7.25 ****) G92 E0 G1 X10.39 Y10.39 Z7.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z7.35 E5.389 F1200 (**** LAYER 7.35 ****) G92 E0 G1 X10.39 Y10.39 Z7.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z7.45 E4.7095 F1200 (**** LAYER 7.45 ****) G92 E0 G1 X10.39 Y10.39 Z7.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z7.55 E5.389 F1200 (**** LAYER 7.54999 ****) G92 E0 G1 X10.39 Y10.39 Z7.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z7.65 E4.7095 F1200 (**** LAYER 7.64999 ****) G92 E0 G1 X10.39 Y10.39 Z7.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z7.75 E5.389 F1200 (**** LAYER 7.74999 ****) G92 E0 G1 X10.39 Y10.39 Z7.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z7.85 E4.7095 F1200 (**** LAYER 7.84999 ****) G92 E0 G1 X10.39 Y10.39 Z7.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z7.95 E5.389 F1200 (**** LAYER 7.94999 ****) G92 E0 G1 X10.39 Y10.39 Z7.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z8.05 E4.7095 F1200 (**** LAYER 8.04999 ****) G92 E0 G1 X10.39 Y10.39 Z8.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z8.15 E5.389 F1200 (**** LAYER 8.14999 ****) G92 E0 G1 X10.39 Y10.39 Z8.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z8.25 E4.7095 F1200 (**** LAYER 8.25 ****) G92 E0 G1 X10.39 Y10.39 Z8.25 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z8.35 E5.389 F1200 (**** LAYER 8.35 ****) G92 E0 G1 X10.39 Y10.39 Z8.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z8.45 E4.7095 F1200 (**** LAYER 8.45 ****) G92 E0 G1 X10.39 Y10.39 Z8.45 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z8.55 E5.389 F1200 (**** LAYER 8.55 ****) G92 E0 G1 X10.39 Y10.39 Z8.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z8.65 E4.7095 F1200 (**** LAYER 8.65 ****) G92 E0 G1 X10.39 Y10.39 Z8.65 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z8.75 E5.389 F1200 (**** LAYER 8.75 ****) G92 E0 G1 X10.39 Y10.39 Z8.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z8.85 E4.7095 F1200 (**** LAYER 8.85 ****) G92 E0 G1 X10.39 Y10.39 Z8.85 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X10.19 Y7.93 E2.7095 F8400 M101 G1 X-5.93 Y-8.19 E3.5132 F7200 G1 X-1.4 Y-8.19 E3.6727 G1 X10.19 Y3.4 E4.2508 G1 X10.19 Y-1.12 E4.4103 G1 X3.12 Y-8.19 E4.7628 G1 X7.65 Y-8.19 E4.9223 G1 X10.19 Y-5.65 E5.0493 M103 G1 E3.0493 F1200 G1 X7.65 Y-8.19 E3.0493 F7200 G1 X6.25 Y-8.19 E3.0493 G1 X7.93 Y10.19 E3.0493 F8400 G1 E5.0493 F1200 M101 G1 X-8.19 Y-5.93 E5.8529 F7200 G1 X-8.19 Y-1.4 E6.0124 G1 X3.4 Y10.19 E6.5905 G1 X-1.12 Y10.19 E6.75 G1 X-8.19 Y3.12 E7.1026 G1 X-8.19 Y7.65 E7.2621 G1 X-5.65 Y10.19 E7.389 M103 G1 E5.389 F1200 G1 X-8.19 Y7.65 E5.389 F7200 G1 X-8.19 Y6.25 E5.389 G1 X-8.19 Y6.25 Z8.95 E5.389 F1200 (**** LAYER 8.95 ****) G92 E0 G1 X10.39 Y10.39 Z8.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.67 Y10.72 Z9.05 E4.7095 F1200 (**** LAYER 9.05 ****) G92 E0 G1 X10.39 Y10.39 Z9.05 E0 F8400 M101 G1 X-8.39 Y10.39 E0.331 F4800 G1 X-8.39 Y-8.39 E0.6621 G1 X10.39 Y-8.39 E0.9931 G1 X10.39 Y10.39 E1.3241 M103 G1 X10.72 Y10.67 E1.3241 F8400 M101 G1 X10.79 Y10.79 E1.3266 F2400 G1 X-8.79 Y10.79 E1.6717 G1 X-8.79 Y-8.79 E2.0168 G1 X10.79 Y-8.79 E2.3619 G1 X10.79 Y10.79 E2.7071 G1 X10.67 Y10.72 E2.7095 M103 G1 X7.65 Y10.19 E2.7095 F8400 M101 G1 X10.19 Y7.65 E2.8365 F7200 G1 X10.19 Y3.12 E2.996 G1 X3.12 Y10.19 E3.3485 G1 X-1.4 Y10.19 E3.508 G1 X10.19 Y-1.41 E4.0861 G1 X10.19 Y-5.93 E4.2456 G1 X-5.93 Y10.19 E5.0493 M103 G1 X-8.19 Y7.93 E5.0493 F8400 M101 G1 X7.93 Y-8.19 E5.8529 F7200 G1 X3.4 Y-8.19 E6.0124 G1 X-8.19 Y3.4 E6.5905 G1 X-8.19 Y-1.12 E6.75 G1 X-1.12 Y-8.19 E7.1026 G1 X-5.65 Y-8.19 E7.2621 G1 X-8.19 Y-5.65 E7.389 M103 G1 E5.389 F1200 G1 X-5.65 Y-8.19 E5.389 F7200 G1 X-4.25 Y-8.19 E5.389 G1 X-4.25 Y-8.19 Z9.15 E5.389 F1200 (**** LAYER 9.15 ****) G92 E0 G1 X10.39 Y10.39 Z9.15 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X7.65 Y10.19 E4.7095 F8400 M101 G1 X10.19 Y7.65 E4.773 F7200 G1 X10.19 Y3.12 E4.8527 G1 X3.12 Y10.19 E5.029 G1 X-1.4 Y10.19 E5.1088 G1 X10.19 Y-1.41 E5.3978 G1 X10.19 Y-5.93 E5.4776 G1 X-5.93 Y10.19 E5.8794 M103 G1 X-8.19 Y7.93 E5.8794 F8400 M101 G1 X7.93 Y-8.19 E6.2812 F7200 G1 X3.4 Y-8.19 E6.361 G1 X-8.19 Y3.4 E6.65 G1 X-8.19 Y-1.12 E6.7298 G1 X-1.12 Y-8.19 E6.906 G1 X-5.65 Y-8.19 E6.9858 G1 X-8.19 Y-5.65 E7.0493 M103 G1 E5.0493 F1200 G1 X-5.65 Y-8.19 E5.0493 F7200 G1 X-4.25 Y-8.19 E5.0493 G1 X-4.25 Y-8.19 Z9.25 E5.0493 F1200 (**** LAYER 9.25 ****) G92 E0 G1 X10.39 Y10.39 Z9.25 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.19 Y10.19 E4.7095 F8400 M101 G1 X-8.19 Y-8.19 E5.1677 F7200 G1 X-7.06 Y-8.19 E5.1877 G1 X10.19 Y9.06 E5.6177 G1 X10.19 Y7.93 E5.6376 G1 X-5.93 Y-8.19 E6.0395 G1 X-4.8 Y-8.19 E6.0594 G1 X10.19 Y6.8 E6.4331 G1 X10.19 Y5.67 E6.453 G1 X-3.67 Y-8.19 E6.7984 G1 X-2.54 Y-8.19 E6.8184 G1 X10.19 Y4.54 E7.1356 G1 X10.19 Y3.4 E7.1555 G1 X-1.4 Y-8.19 E7.4446 G1 X-0.27 Y-8.19 E7.4645 G1 X10.19 Y2.27 E7.7254 G1 X10.19 Y1.14 E7.7453 G1 X0.86 Y-8.19 E7.978 G1 X1.99 Y-8.19 E7.9979 G1 X10.19 Y0.01 E8.2024 G1 X10.19 Y-1.12 E8.2223 G1 X3.12 Y-8.19 E8.3986 G1 X4.25 Y-8.19 E8.4185 G1 X10.19 Y-2.25 E8.5666 G1 X10.19 Y-3.38 E8.5865 G1 X5.38 Y-8.19 E8.7064 G1 X6.51 Y-8.19 E8.7263 G1 X10.19 Y-4.51 E8.818 G1 X10.19 Y-5.65 E8.8379 G1 X7.65 Y-8.19 E8.9014 G1 X8.78 Y-8.19 E8.9213 G1 X10.19 Y-6.78 E8.9566 G1 X10.19 Y-7.91 E8.9766 G1 X9.91 Y-8.19 E8.9836 M103 G1 E6.9836 F1200 G1 X10.19 Y-7.91 E6.9836 F7200 G1 X10.19 Y-6.78 E6.9836 G1 X8.78 Y-8.19 E6.9836 G1 X7.65 Y-8.19 E6.9836 G1 X7.88 Y-7.96 E6.9836 G1 X-8.19 Y-7.06 E6.9836 F8400 G1 E8.9836 F1200 M101 G1 X9.06 Y10.19 E9.4137 F7200 G1 X7.93 Y10.19 E9.4336 G1 X-8.19 Y-5.93 E9.8354 G1 X-8.19 Y-4.8 E9.8554 G1 X6.8 Y10.19 E10.229 G1 X5.67 Y10.19 E10.2489 G1 X-8.19 Y-3.67 E10.5944 G1 X-8.19 Y-2.54 E10.6143 G1 X4.54 Y10.19 E10.9316 G1 X3.4 Y10.19 E10.9515 G1 X-8.19 Y-1.4 E11.2406 G1 X-8.19 Y-0.27 E11.2605 G1 X2.27 Y10.19 E11.5213 G1 X1.14 Y10.19 E11.5413 G1 X-8.19 Y0.86 E11.7739 G1 X-8.19 Y1.99 E11.7939 G1 X0.01 Y10.19 E11.9983 G1 X-1.12 Y10.19 E12.0183 G1 X-8.19 Y3.12 E12.1945 G1 X-8.19 Y4.25 E12.2145 G1 X-2.25 Y10.19 E12.3625 G1 X-3.38 Y10.19 E12.3825 G1 X-8.19 Y5.38 E12.5023 G1 X-8.19 Y6.51 E12.5223 G1 X-4.51 Y10.19 E12.614 G1 X-5.65 Y10.19 E12.6339 G1 X-8.19 Y7.65 E12.6974 G1 X-8.19 Y8.78 E12.7173 G1 X-6.78 Y10.19 E12.7526 G1 X-7.91 Y10.19 E12.7725 G1 X-8.19 Y9.91 E12.7796 M103 G1 E10.7796 F1200 G1 X-7.91 Y10.19 E10.7796 F7200 G1 X-6.78 Y10.19 E10.7796 G1 X-8.19 Y8.78 E10.7796 G1 X-8.19 Y7.65 E10.7796 G1 X-7.96 Y7.88 E10.7796 G1 X-7.96 Y7.88 Z9.35 E10.7796 F1200 (**** LAYER 9.35 ****) G92 E0 G1 X10.39 Y10.39 Z9.35 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X9.91 Y10.19 E4.7095 F8400 M101 G1 X10.19 Y9.91 E4.7166 F7200 G1 X10.19 Y8.78 E4.7365 G1 X8.78 Y10.19 E4.7718 G1 X7.65 Y10.19 E4.7918 G1 X10.19 Y7.65 E4.8552 G1 X10.19 Y6.51 E4.8752 G1 X6.51 Y10.19 E4.9668 G1 X5.38 Y10.19 E4.9868 G1 X10.19 Y5.38 E5.1066 G1 X10.19 Y4.25 E5.1266 G1 X4.25 Y10.19 E5.2746 G1 X3.12 Y10.19 E5.2946 G1 X10.19 Y3.12 E5.4708 G1 X10.19 Y1.99 E5.4908 G1 X1.99 Y10.19 E5.6952 G1 X0.86 Y10.19 E5.7152 G1 X10.19 Y0.86 E5.9478 G1 X10.19 Y-0.27 E5.9678 G1 X-0.27 Y10.19 E6.2286 G1 X-1.4 Y10.19 E6.2485 G1 X10.19 Y-1.4 E6.5376 G1 X10.19 Y-2.54 E6.5575 G1 X-2.54 Y10.19 E6.8748 G1 X-3.67 Y10.19 E6.8947 G1 X10.19 Y-3.67 E7.2401 G1 X10.19 Y-4.8 E7.2601 G1 X-4.8 Y10.19 E7.6337 G1 X-5.93 Y10.19 E7.6536 G1 X10.19 Y-5.93 E8.0555 G1 X10.19 Y-7.06 E8.0754 G1 X-7.06 Y10.19 E8.5054 G1 X-8.19 Y10.19 E8.5254 G1 X10.19 Y-8.19 E8.9836 G1 X9.06 Y-8.19 E9.0035 G1 X-8.19 Y9.06 E9.4336 G1 X-8.19 Y7.93 E9.4535 G1 X7.93 Y-8.19 E9.8553 G1 X6.8 Y-8.19 E9.8753 G1 X-8.19 Y6.8 E10.2489 G1 X-8.19 Y5.67 E10.2689 G1 X5.67 Y-8.19 E10.6143 G1 X4.54 Y-8.19 E10.6342 G1 X-8.19 Y4.54 E10.9515 G1 X-8.19 Y3.4 E10.9714 G1 X3.4 Y-8.19 E11.2605 G1 X2.27 Y-8.19 E11.2804 G1 X-8.19 Y2.27 E11.5412 G1 X-8.19 Y1.14 E11.5612 G1 X1.14 Y-8.19 E11.7938 G1 X0.01 Y-8.19 E11.8138 G1 X-8.19 Y0.01 E12.0182 G1 X-8.19 Y-1.12 E12.0382 G1 X-1.12 Y-8.19 E12.2144 G1 X-2.25 Y-8.19 E12.2344 G1 X-8.19 Y-2.25 E12.3824 G1 X-8.19 Y-3.38 E12.4024 G1 X-3.38 Y-8.19 E12.5223 G1 X-4.51 Y-8.19 E12.5422 G1 X-8.19 Y-4.51 E12.6339 G1 X-8.19 Y-5.65 E12.6538 G1 X-5.65 Y-8.19 E12.7173 G1 X-6.78 Y-8.19 E12.7372 G1 X-8.19 Y-6.78 E12.7725 G1 X-8.19 Y-7.91 E12.7924 G1 X-7.91 Y-8.19 E12.7995 M103 G1 E10.7995 F1200 G1 X-8.19 Y-7.91 E10.7995 F7200 G1 X-8.19 Y-6.78 E10.7995 G1 X-6.78 Y-8.19 E10.7995 G1 X-5.65 Y-8.19 E10.7995 G1 X-5.88 Y-7.96 E10.7995 G1 X-5.88 Y-7.96 Z9.45 E10.7995 F1200 (**** LAYER 9.45 ****) G92 E0 G1 X10.39 Y10.39 Z9.45 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.19 Y10.19 E4.7095 F8400 M101 G1 X-8.19 Y-8.19 E5.1677 F7200 G1 X-7.06 Y-8.19 E5.1877 G1 X10.19 Y9.06 E5.6177 G1 X10.19 Y7.93 E5.6376 G1 X-5.93 Y-8.19 E6.0395 G1 X-4.8 Y-8.19 E6.0594 G1 X10.19 Y6.8 E6.4331 G1 X10.19 Y5.67 E6.453 G1 X-3.67 Y-8.19 E6.7984 G1 X-2.54 Y-8.19 E6.8184 G1 X10.19 Y4.54 E7.1356 G1 X10.19 Y3.4 E7.1555 G1 X-1.4 Y-8.19 E7.4446 G1 X-0.27 Y-8.19 E7.4645 G1 X10.19 Y2.27 E7.7254 G1 X10.19 Y1.14 E7.7453 G1 X0.86 Y-8.19 E7.978 G1 X1.99 Y-8.19 E7.9979 G1 X10.19 Y0.01 E8.2024 G1 X10.19 Y-1.12 E8.2223 G1 X3.12 Y-8.19 E8.3986 G1 X4.25 Y-8.19 E8.4185 G1 X10.19 Y-2.25 E8.5666 G1 X10.19 Y-3.38 E8.5865 G1 X5.38 Y-8.19 E8.7064 G1 X6.51 Y-8.19 E8.7263 G1 X10.19 Y-4.51 E8.818 G1 X10.19 Y-5.65 E8.8379 G1 X7.65 Y-8.19 E8.9014 G1 X8.78 Y-8.19 E8.9213 G1 X10.19 Y-6.78 E8.9566 G1 X10.19 Y-7.91 E8.9766 G1 X9.91 Y-8.19 E8.9836 M103 G1 E6.9836 F1200 G1 X10.19 Y-7.91 E6.9836 F7200 G1 X10.19 Y-6.78 E6.9836 G1 X8.78 Y-8.19 E6.9836 G1 X7.65 Y-8.19 E6.9836 G1 X7.88 Y-7.96 E6.9836 G1 X-8.19 Y-7.06 E6.9836 F8400 G1 E8.9836 F1200 M101 G1 X9.06 Y10.19 E9.4137 F7200 G1 X7.93 Y10.19 E9.4336 G1 X-8.19 Y-5.93 E9.8354 G1 X-8.19 Y-4.8 E9.8554 G1 X6.8 Y10.19 E10.229 G1 X5.67 Y10.19 E10.2489 G1 X-8.19 Y-3.67 E10.5944 G1 X-8.19 Y-2.54 E10.6143 G1 X4.54 Y10.19 E10.9316 G1 X3.4 Y10.19 E10.9515 G1 X-8.19 Y-1.4 E11.2406 G1 X-8.19 Y-0.27 E11.2605 G1 X2.27 Y10.19 E11.5213 G1 X1.14 Y10.19 E11.5413 G1 X-8.19 Y0.86 E11.7739 G1 X-8.19 Y1.99 E11.7939 G1 X0.01 Y10.19 E11.9983 G1 X-1.12 Y10.19 E12.0183 G1 X-8.19 Y3.12 E12.1945 G1 X-8.19 Y4.25 E12.2145 G1 X-2.25 Y10.19 E12.3625 G1 X-3.38 Y10.19 E12.3825 G1 X-8.19 Y5.38 E12.5023 G1 X-8.19 Y6.51 E12.5223 G1 X-4.51 Y10.19 E12.614 G1 X-5.65 Y10.19 E12.6339 G1 X-8.19 Y7.65 E12.6974 G1 X-8.19 Y8.78 E12.7173 G1 X-6.78 Y10.19 E12.7526 G1 X-7.91 Y10.19 E12.7725 G1 X-8.19 Y9.91 E12.7796 M103 G1 E10.7796 F1200 G1 X-7.91 Y10.19 E10.7796 F7200 G1 X-6.78 Y10.19 E10.7796 G1 X-8.19 Y8.78 E10.7796 G1 X-8.19 Y7.65 E10.7796 G1 X-7.96 Y7.88 E10.7796 G1 X-7.96 Y7.88 Z9.55 E10.7796 F1200 (**** LAYER 9.55 ****) G92 E0 G1 X10.39 Y10.39 Z9.55 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.05 Y9.49 E4.7095 F8400 M101 G1 X9.55 Y9.99 E4.7221 F4800 G1 X8.98 Y9.99 E4.732 G1 X9.99 Y8.98 E4.7572 G1 X9.99 Y8.41 E4.7672 G1 X8.41 Y9.99 E4.8064 G1 X7.85 Y9.99 E4.8164 G1 X9.99 Y7.85 E4.8697 G1 X9.99 Y7.28 E4.8797 G1 X7.28 Y9.99 E4.9472 G1 X6.72 Y9.99 E4.9571 G1 X9.99 Y6.72 E5.0387 G1 X9.99 Y6.15 E5.0486 G1 X6.15 Y9.99 E5.1443 G1 X5.59 Y9.99 E5.1543 G1 X9.99 Y5.59 E5.264 G1 X9.99 Y5.02 E5.274 G1 X5.02 Y9.99 E5.3978 G1 X4.46 Y9.99 E5.4078 G1 X9.99 Y4.46 E5.5457 G1 X9.99 Y3.89 E5.5557 G1 X3.89 Y9.99 E5.7077 G1 X3.32 Y9.99 E5.7177 G1 X9.99 Y3.32 E5.8838 G1 X9.99 Y2.76 E5.8938 G1 X2.76 Y9.99 E6.074 G1 X2.19 Y9.99 E6.084 G1 X9.99 Y2.19 E6.2783 G1 X9.99 Y1.63 E6.2883 G1 X1.63 Y9.99 E6.4967 G1 X1.06 Y9.99 E6.5067 G1 X9.99 Y1.06 E6.7292 G1 X9.99 Y0.5 E6.7392 G1 X0.5 Y9.99 E6.9758 G1 X-0.07 Y9.99 E6.9858 G1 X9.99 Y-0.07 E7.2365 G1 X9.99 Y-0.64 E7.2465 G1 X-0.64 Y9.99 E7.5113 G1 X-1.2 Y9.99 E7.5213 G1 X9.99 Y-1.2 E7.8002 G1 X9.99 Y-1.77 E7.8102 G1 X-1.77 Y9.99 E8.1032 G1 X-2.33 Y9.99 E8.1132 G1 X9.99 Y-2.33 E8.4203 G1 X9.99 Y-2.9 E8.4302 G1 X-2.9 Y9.99 E8.7515 G1 X-3.46 Y9.99 E8.7614 G1 X9.99 Y-3.46 E9.0967 G1 X9.99 Y-4.03 E9.1067 G1 X-4.03 Y9.99 E9.4561 G1 X-4.6 Y9.99 E9.4661 G1 X9.99 Y-4.6 E9.8296 G1 X9.99 Y-5.16 E9.8396 G1 X-5.16 Y9.99 E10.2172 G1 X-5.73 Y9.99 E10.2271 G1 X9.99 Y-5.73 E10.6188 G1 X9.99 Y-6.29 E10.6288 G1 X-6.29 Y9.99 E11.0346 G1 X-6.86 Y9.99 E11.0446 G1 X9.99 Y-6.86 E11.4645 G1 X9.99 Y-7.42 E11.4745 G1 X-7.42 Y9.99 E11.9085 G1 X-7.99 Y9.99 E11.9184 G1 X9.99 Y-7.99 E12.3665 G1 X9.42 Y-7.99 E12.3765 G1 X-7.99 Y9.42 E12.8105 G1 X-7.99 Y8.86 E12.8205 G1 X8.86 Y-7.99 E13.2404 G1 X8.29 Y-7.99 E13.2503 G1 X-7.99 Y8.29 E13.6561 G1 X-7.99 Y7.73 E13.6661 G1 X7.73 Y-7.99 E14.0578 G1 X7.16 Y-7.99 E14.0678 G1 X-7.99 Y7.16 E14.4454 G1 X-7.99 Y6.6 E14.4554 G1 X6.6 Y-7.99 E14.8189 G1 X6.03 Y-7.99 E14.8288 G1 X-7.99 Y6.03 E15.1783 G1 X-7.99 Y5.46 E15.1882 G1 X5.46 Y-7.99 E15.5235 G1 X4.9 Y-7.99 E15.5335 G1 X-7.99 Y4.9 E15.8547 G1 X-7.99 Y4.33 E15.8647 G1 X4.33 Y-7.99 E16.1718 G1 X3.77 Y-7.99 E16.1818 G1 X-7.99 Y3.77 E16.4748 G1 X-7.99 Y3.2 E16.4848 G1 X3.2 Y-7.99 E16.7637 G1 X2.64 Y-7.99 E16.7737 G1 X-7.99 Y2.64 E17.0385 G1 X-7.99 Y2.07 E17.0484 G1 X2.07 Y-7.99 E17.2992 G1 X1.5 Y-7.99 E17.3091 G1 X-7.99 Y1.5 E17.5458 G1 X-7.99 Y0.94 E17.5557 G1 X0.94 Y-7.99 E17.7783 G1 X0.37 Y-7.99 E17.7882 G1 X-7.99 Y0.37 E17.9967 G1 X-7.99 Y-0.19 E18.0066 G1 X-0.19 Y-7.99 E18.201 G1 X-0.76 Y-7.99 E18.2109 G1 X-7.99 Y-0.76 E18.3912 G1 X-7.99 Y-1.32 E18.4011 G1 X-1.32 Y-7.99 E18.5673 G1 X-1.89 Y-7.99 E18.5772 G1 X-7.99 Y-1.89 E18.7293 G1 X-7.99 Y-2.46 E18.7392 G1 X-2.46 Y-7.99 E18.8772 G1 X-3.02 Y-7.99 E18.8872 G1 X-7.99 Y-3.02 E19.011 G1 X-7.99 Y-3.59 E19.021 G1 X-3.59 Y-7.99 E19.1307 G1 X-4.15 Y-7.99 E19.1407 G1 X-7.99 Y-4.15 E19.2363 G1 X-7.99 Y-4.72 E19.2463 G1 X-4.72 Y-7.99 E19.3278 G1 X-5.28 Y-7.99 E19.3378 G1 X-7.99 Y-5.28 E19.4053 G1 X-7.99 Y-5.85 E19.4152 G1 X-5.85 Y-7.99 E19.4686 G1 X-6.41 Y-7.99 E19.4785 G1 X-7.99 Y-6.41 E19.5178 G1 X-7.99 Y-6.98 E19.5278 G1 X-6.98 Y-7.99 E19.5529 G1 X-7.55 Y-7.99 E19.5629 G1 X-8.01 Y-7.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y-7.99 E17.5744 F7200 G1 X-6.98 Y-7.99 E17.5744 G1 X-7.99 Y-6.98 E17.5744 G1 X-7.99 Y-6.41 E17.5744 G1 X-6.72 Y-7.68 E17.5744 G1 X-6.72 Y-7.68 Z9.65 E17.5744 F1200 (**** LAYER 9.65 ****) G92 E0 G1 X10.39 Y10.39 Z9.65 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F7200 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F7200 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z9.75 E17.5744 F1200 (**** LAYER 9.75 ****) G92 E0 G1 X10.39 Y10.39 Z9.75 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.05 Y9.49 E4.7095 F8400 M101 G1 X9.55 Y9.99 E4.7221 F4800 G1 X8.98 Y9.99 E4.732 G1 X9.99 Y8.98 E4.7572 G1 X9.99 Y8.41 E4.7672 G1 X8.41 Y9.99 E4.8064 G1 X7.85 Y9.99 E4.8164 G1 X9.99 Y7.85 E4.8697 G1 X9.99 Y7.28 E4.8797 G1 X7.28 Y9.99 E4.9472 G1 X6.72 Y9.99 E4.9571 G1 X9.99 Y6.72 E5.0387 G1 X9.99 Y6.15 E5.0486 G1 X6.15 Y9.99 E5.1443 G1 X5.59 Y9.99 E5.1543 G1 X9.99 Y5.59 E5.264 G1 X9.99 Y5.02 E5.274 G1 X5.02 Y9.99 E5.3978 G1 X4.46 Y9.99 E5.4078 G1 X9.99 Y4.46 E5.5457 G1 X9.99 Y3.89 E5.5557 G1 X3.89 Y9.99 E5.7077 G1 X3.32 Y9.99 E5.7177 G1 X9.99 Y3.32 E5.8838 G1 X9.99 Y2.76 E5.8938 G1 X2.76 Y9.99 E6.074 G1 X2.19 Y9.99 E6.084 G1 X9.99 Y2.19 E6.2783 G1 X9.99 Y1.63 E6.2883 G1 X1.63 Y9.99 E6.4967 G1 X1.06 Y9.99 E6.5067 G1 X9.99 Y1.06 E6.7292 G1 X9.99 Y0.5 E6.7392 G1 X0.5 Y9.99 E6.9758 G1 X-0.07 Y9.99 E6.9858 G1 X9.99 Y-0.07 E7.2365 G1 X9.99 Y-0.64 E7.2465 G1 X-0.64 Y9.99 E7.5113 G1 X-1.2 Y9.99 E7.5213 G1 X9.99 Y-1.2 E7.8002 G1 X9.99 Y-1.77 E7.8102 G1 X-1.77 Y9.99 E8.1032 G1 X-2.33 Y9.99 E8.1132 G1 X9.99 Y-2.33 E8.4203 G1 X9.99 Y-2.9 E8.4302 G1 X-2.9 Y9.99 E8.7515 G1 X-3.46 Y9.99 E8.7614 G1 X9.99 Y-3.46 E9.0967 G1 X9.99 Y-4.03 E9.1067 G1 X-4.03 Y9.99 E9.4561 G1 X-4.6 Y9.99 E9.4661 G1 X9.99 Y-4.6 E9.8296 G1 X9.99 Y-5.16 E9.8396 G1 X-5.16 Y9.99 E10.2172 G1 X-5.73 Y9.99 E10.2271 G1 X9.99 Y-5.73 E10.6188 G1 X9.99 Y-6.29 E10.6288 G1 X-6.29 Y9.99 E11.0346 G1 X-6.86 Y9.99 E11.0446 G1 X9.99 Y-6.86 E11.4645 G1 X9.99 Y-7.42 E11.4745 G1 X-7.42 Y9.99 E11.9085 G1 X-7.99 Y9.99 E11.9184 G1 X9.99 Y-7.99 E12.3665 G1 X9.42 Y-7.99 E12.3765 G1 X-7.99 Y9.42 E12.8105 G1 X-7.99 Y8.86 E12.8205 G1 X8.86 Y-7.99 E13.2404 G1 X8.29 Y-7.99 E13.2503 G1 X-7.99 Y8.29 E13.6561 G1 X-7.99 Y7.73 E13.6661 G1 X7.73 Y-7.99 E14.0578 G1 X7.16 Y-7.99 E14.0678 G1 X-7.99 Y7.16 E14.4454 G1 X-7.99 Y6.6 E14.4554 G1 X6.6 Y-7.99 E14.8189 G1 X6.03 Y-7.99 E14.8288 G1 X-7.99 Y6.03 E15.1783 G1 X-7.99 Y5.46 E15.1882 G1 X5.46 Y-7.99 E15.5235 G1 X4.9 Y-7.99 E15.5335 G1 X-7.99 Y4.9 E15.8547 G1 X-7.99 Y4.33 E15.8647 G1 X4.33 Y-7.99 E16.1718 G1 X3.77 Y-7.99 E16.1818 G1 X-7.99 Y3.77 E16.4748 G1 X-7.99 Y3.2 E16.4848 G1 X3.2 Y-7.99 E16.7637 G1 X2.64 Y-7.99 E16.7737 G1 X-7.99 Y2.64 E17.0385 G1 X-7.99 Y2.07 E17.0484 G1 X2.07 Y-7.99 E17.2992 G1 X1.5 Y-7.99 E17.3091 G1 X-7.99 Y1.5 E17.5458 G1 X-7.99 Y0.94 E17.5557 G1 X0.94 Y-7.99 E17.7783 G1 X0.37 Y-7.99 E17.7882 G1 X-7.99 Y0.37 E17.9967 G1 X-7.99 Y-0.19 E18.0066 G1 X-0.19 Y-7.99 E18.201 G1 X-0.76 Y-7.99 E18.2109 G1 X-7.99 Y-0.76 E18.3912 G1 X-7.99 Y-1.32 E18.4011 G1 X-1.32 Y-7.99 E18.5673 G1 X-1.89 Y-7.99 E18.5772 G1 X-7.99 Y-1.89 E18.7293 G1 X-7.99 Y-2.46 E18.7392 G1 X-2.46 Y-7.99 E18.8772 G1 X-3.02 Y-7.99 E18.8872 G1 X-7.99 Y-3.02 E19.011 G1 X-7.99 Y-3.59 E19.021 G1 X-3.59 Y-7.99 E19.1307 G1 X-4.15 Y-7.99 E19.1407 G1 X-7.99 Y-4.15 E19.2363 G1 X-7.99 Y-4.72 E19.2463 G1 X-4.72 Y-7.99 E19.3278 G1 X-5.28 Y-7.99 E19.3378 G1 X-7.99 Y-5.28 E19.4053 G1 X-7.99 Y-5.85 E19.4152 G1 X-5.85 Y-7.99 E19.4686 G1 X-6.41 Y-7.99 E19.4785 G1 X-7.99 Y-6.41 E19.5178 G1 X-7.99 Y-6.98 E19.5278 G1 X-6.98 Y-7.99 E19.5529 G1 X-7.55 Y-7.99 E19.5629 G1 X-8.01 Y-7.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y-7.99 E17.5744 F7200 G1 X-6.98 Y-7.99 E17.5744 G1 X-7.99 Y-6.98 E17.5744 G1 X-7.99 Y-6.41 E17.5744 G1 X-6.72 Y-7.68 E17.5744 G1 X-6.72 Y-7.68 Z9.85 E17.5744 F1200 (**** LAYER 9.85 ****) G92 E0 G1 X10.39 Y10.39 Z9.85 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F7200 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F7200 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z9.95 E17.5744 F1200 (**** LAYER 9.95 ****) G92 E0 G1 X10.39 Y10.39 Z9.95 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 X10.05 Y9.49 E4.7095 F8400 M101 G1 X9.55 Y9.99 E4.7221 F4800 G1 X8.98 Y9.99 E4.732 G1 X9.99 Y8.98 E4.7572 G1 X9.99 Y8.41 E4.7672 G1 X8.41 Y9.99 E4.8064 G1 X7.85 Y9.99 E4.8164 G1 X9.99 Y7.85 E4.8697 G1 X9.99 Y7.28 E4.8797 G1 X7.28 Y9.99 E4.9472 G1 X6.72 Y9.99 E4.9571 G1 X9.99 Y6.72 E5.0387 G1 X9.99 Y6.15 E5.0486 G1 X6.15 Y9.99 E5.1443 G1 X5.59 Y9.99 E5.1543 G1 X9.99 Y5.59 E5.264 G1 X9.99 Y5.02 E5.274 G1 X5.02 Y9.99 E5.3978 G1 X4.46 Y9.99 E5.4078 G1 X9.99 Y4.46 E5.5457 G1 X9.99 Y3.89 E5.5557 G1 X3.89 Y9.99 E5.7077 G1 X3.32 Y9.99 E5.7177 G1 X9.99 Y3.32 E5.8838 G1 X9.99 Y2.76 E5.8938 G1 X2.76 Y9.99 E6.074 G1 X2.19 Y9.99 E6.084 G1 X9.99 Y2.19 E6.2783 G1 X9.99 Y1.63 E6.2883 G1 X1.63 Y9.99 E6.4967 G1 X1.06 Y9.99 E6.5067 G1 X9.99 Y1.06 E6.7292 G1 X9.99 Y0.5 E6.7392 G1 X0.5 Y9.99 E6.9758 G1 X-0.07 Y9.99 E6.9858 G1 X9.99 Y-0.07 E7.2365 G1 X9.99 Y-0.64 E7.2465 G1 X-0.64 Y9.99 E7.5113 G1 X-1.2 Y9.99 E7.5213 G1 X9.99 Y-1.2 E7.8002 G1 X9.99 Y-1.77 E7.8102 G1 X-1.77 Y9.99 E8.1032 G1 X-2.33 Y9.99 E8.1132 G1 X9.99 Y-2.33 E8.4203 G1 X9.99 Y-2.9 E8.4302 G1 X-2.9 Y9.99 E8.7515 G1 X-3.46 Y9.99 E8.7614 G1 X9.99 Y-3.46 E9.0967 G1 X9.99 Y-4.03 E9.1067 G1 X-4.03 Y9.99 E9.4561 G1 X-4.6 Y9.99 E9.4661 G1 X9.99 Y-4.6 E9.8296 G1 X9.99 Y-5.16 E9.8396 G1 X-5.16 Y9.99 E10.2172 G1 X-5.73 Y9.99 E10.2271 G1 X9.99 Y-5.73 E10.6188 G1 X9.99 Y-6.29 E10.6288 G1 X-6.29 Y9.99 E11.0346 G1 X-6.86 Y9.99 E11.0446 G1 X9.99 Y-6.86 E11.4645 G1 X9.99 Y-7.42 E11.4745 G1 X-7.42 Y9.99 E11.9085 G1 X-7.99 Y9.99 E11.9184 G1 X9.99 Y-7.99 E12.3665 G1 X9.42 Y-7.99 E12.3765 G1 X-7.99 Y9.42 E12.8105 G1 X-7.99 Y8.86 E12.8205 G1 X8.86 Y-7.99 E13.2404 G1 X8.29 Y-7.99 E13.2503 G1 X-7.99 Y8.29 E13.6561 G1 X-7.99 Y7.73 E13.6661 G1 X7.73 Y-7.99 E14.0578 G1 X7.16 Y-7.99 E14.0678 G1 X-7.99 Y7.16 E14.4454 G1 X-7.99 Y6.6 E14.4554 G1 X6.6 Y-7.99 E14.8189 G1 X6.03 Y-7.99 E14.8288 G1 X-7.99 Y6.03 E15.1783 G1 X-7.99 Y5.46 E15.1882 G1 X5.46 Y-7.99 E15.5235 G1 X4.9 Y-7.99 E15.5335 G1 X-7.99 Y4.9 E15.8547 G1 X-7.99 Y4.33 E15.8647 G1 X4.33 Y-7.99 E16.1718 G1 X3.77 Y-7.99 E16.1818 G1 X-7.99 Y3.77 E16.4748 G1 X-7.99 Y3.2 E16.4848 G1 X3.2 Y-7.99 E16.7637 G1 X2.64 Y-7.99 E16.7737 G1 X-7.99 Y2.64 E17.0385 G1 X-7.99 Y2.07 E17.0484 G1 X2.07 Y-7.99 E17.2992 G1 X1.5 Y-7.99 E17.3091 G1 X-7.99 Y1.5 E17.5458 G1 X-7.99 Y0.94 E17.5557 G1 X0.94 Y-7.99 E17.7783 G1 X0.37 Y-7.99 E17.7882 G1 X-7.99 Y0.37 E17.9967 G1 X-7.99 Y-0.19 E18.0066 G1 X-0.19 Y-7.99 E18.201 G1 X-0.76 Y-7.99 E18.2109 G1 X-7.99 Y-0.76 E18.3912 G1 X-7.99 Y-1.32 E18.4011 G1 X-1.32 Y-7.99 E18.5673 G1 X-1.89 Y-7.99 E18.5772 G1 X-7.99 Y-1.89 E18.7293 G1 X-7.99 Y-2.46 E18.7392 G1 X-2.46 Y-7.99 E18.8772 G1 X-3.02 Y-7.99 E18.8872 G1 X-7.99 Y-3.02 E19.011 G1 X-7.99 Y-3.59 E19.021 G1 X-3.59 Y-7.99 E19.1307 G1 X-4.15 Y-7.99 E19.1407 G1 X-7.99 Y-4.15 E19.2363 G1 X-7.99 Y-4.72 E19.2463 G1 X-4.72 Y-7.99 E19.3278 G1 X-5.28 Y-7.99 E19.3378 G1 X-7.99 Y-5.28 E19.4053 G1 X-7.99 Y-5.85 E19.4152 G1 X-5.85 Y-7.99 E19.4686 G1 X-6.41 Y-7.99 E19.4785 G1 X-7.99 Y-6.41 E19.5178 G1 X-7.99 Y-6.98 E19.5278 G1 X-6.98 Y-7.99 E19.5529 G1 X-7.55 Y-7.99 E19.5629 G1 X-8.01 Y-7.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y-7.99 E17.5744 F7200 G1 X-6.98 Y-7.99 E17.5744 G1 X-7.99 Y-6.98 E17.5744 G1 X-7.99 Y-6.41 E17.5744 G1 X-6.72 Y-7.68 E17.5744 G1 X-6.72 Y-7.68 Z10.05 E17.5744 F1200 (**** LAYER 10.05 ****) G92 E0 G1 X10.39 Y10.39 Z10.05 E0 F8400 G1 E2 F1200 M101 G1 X-8.39 Y10.39 E2.331 F4800 G1 X-8.39 Y-8.39 E2.6621 G1 X10.39 Y-8.39 E2.9931 G1 X10.39 Y10.39 E3.3241 M103 G1 X10.72 Y10.67 E3.3241 F8400 M101 G1 X10.79 Y10.79 E3.3266 F2400 G1 X-8.79 Y10.79 E3.6717 G1 X-8.79 Y-8.79 E4.0168 G1 X10.79 Y-8.79 E4.3619 G1 X10.79 Y10.79 E4.7071 G1 X10.67 Y10.72 E4.7095 M103 G1 E2.7095 F1200 G1 X10.72 Y10.67 E2.7095 F7200 G1 X10.79 Y10.79 E2.7095 G1 X5.93 Y10.79 E2.7095 G1 X10.05 Y-7.49 E2.7095 F8400 G1 E4.7095 F1200 M101 G1 X9.55 Y-7.99 E4.7221 F4800 G1 X8.98 Y-7.99 E4.732 G1 X9.99 Y-6.98 E4.7572 G1 X9.99 Y-6.41 E4.7672 G1 X8.41 Y-7.99 E4.8064 G1 X7.85 Y-7.99 E4.8164 G1 X9.99 Y-5.85 E4.8697 G1 X9.99 Y-5.28 E4.8797 G1 X7.28 Y-7.99 E4.9472 G1 X6.72 Y-7.99 E4.9571 G1 X9.99 Y-4.72 E5.0387 G1 X9.99 Y-4.15 E5.0486 G1 X6.15 Y-7.99 E5.1443 G1 X5.59 Y-7.99 E5.1543 G1 X9.99 Y-3.59 E5.264 G1 X9.99 Y-3.02 E5.274 G1 X5.02 Y-7.99 E5.3978 G1 X4.46 Y-7.99 E5.4078 G1 X9.99 Y-2.46 E5.5457 G1 X9.99 Y-1.89 E5.5557 G1 X3.89 Y-7.99 E5.7077 G1 X3.32 Y-7.99 E5.7177 G1 X9.99 Y-1.32 E5.8838 G1 X9.99 Y-0.76 E5.8938 G1 X2.76 Y-7.99 E6.074 G1 X2.19 Y-7.99 E6.084 G1 X9.99 Y-0.19 E6.2783 G1 X9.99 Y0.37 E6.2883 G1 X1.63 Y-7.99 E6.4967 G1 X1.06 Y-7.99 E6.5067 G1 X9.99 Y0.94 E6.7292 G1 X9.99 Y1.5 E6.7392 G1 X0.5 Y-7.99 E6.9758 G1 X-0.07 Y-7.99 E6.9858 G1 X9.99 Y2.07 E7.2365 G1 X9.99 Y2.64 E7.2465 G1 X-0.64 Y-7.99 E7.5113 G1 X-1.2 Y-7.99 E7.5213 G1 X9.99 Y3.2 E7.8002 G1 X9.99 Y3.77 E7.8102 G1 X-1.77 Y-7.99 E8.1032 G1 X-2.33 Y-7.99 E8.1132 G1 X9.99 Y4.33 E8.4203 G1 X9.99 Y4.9 E8.4302 G1 X-2.9 Y-7.99 E8.7515 G1 X-3.46 Y-7.99 E8.7614 G1 X9.99 Y5.46 E9.0967 G1 X9.99 Y6.03 E9.1067 G1 X-4.03 Y-7.99 E9.4561 G1 X-4.6 Y-7.99 E9.4661 G1 X9.99 Y6.6 E9.8296 G1 X9.99 Y7.16 E9.8396 G1 X-5.16 Y-7.99 E10.2172 G1 X-5.73 Y-7.99 E10.2271 G1 X9.99 Y7.73 E10.6188 G1 X9.99 Y8.29 E10.6288 G1 X-6.29 Y-7.99 E11.0346 G1 X-6.86 Y-7.99 E11.0446 G1 X9.99 Y8.86 E11.4645 G1 X9.99 Y9.42 E11.4745 G1 X-7.42 Y-7.99 E11.9085 G1 X-7.99 Y-7.99 E11.9184 G1 X9.99 Y9.99 E12.3665 G1 X9.42 Y9.99 E12.3765 G1 X-7.99 Y-7.42 E12.8105 G1 X-7.99 Y-6.86 E12.8205 G1 X8.86 Y9.99 E13.2404 G1 X8.29 Y9.99 E13.2503 G1 X-7.99 Y-6.29 E13.6561 G1 X-7.99 Y-5.73 E13.6661 G1 X7.73 Y9.99 E14.0578 G1 X7.16 Y9.99 E14.0678 G1 X-7.99 Y-5.16 E14.4454 G1 X-7.99 Y-4.6 E14.4554 G1 X6.6 Y9.99 E14.8189 G1 X6.03 Y9.99 E14.8288 G1 X-7.99 Y-4.03 E15.1783 G1 X-7.99 Y-3.46 E15.1882 G1 X5.46 Y9.99 E15.5235 G1 X4.9 Y9.99 E15.5335 G1 X-7.99 Y-2.9 E15.8547 G1 X-7.99 Y-2.33 E15.8647 G1 X4.33 Y9.99 E16.1718 G1 X3.77 Y9.99 E16.1818 G1 X-7.99 Y-1.77 E16.4748 G1 X-7.99 Y-1.2 E16.4848 G1 X3.2 Y9.99 E16.7637 G1 X2.64 Y9.99 E16.7737 G1 X-7.99 Y-0.64 E17.0385 G1 X-7.99 Y-0.07 E17.0484 G1 X2.07 Y9.99 E17.2992 G1 X1.5 Y9.99 E17.3091 G1 X-7.99 Y0.5 E17.5458 G1 X-7.99 Y1.06 E17.5557 G1 X0.94 Y9.99 E17.7783 G1 X0.37 Y9.99 E17.7882 G1 X-7.99 Y1.63 E17.9967 G1 X-7.99 Y2.19 E18.0066 G1 X-0.19 Y9.99 E18.201 G1 X-0.76 Y9.99 E18.2109 G1 X-7.99 Y2.76 E18.3912 G1 X-7.99 Y3.32 E18.4011 G1 X-1.32 Y9.99 E18.5673 G1 X-1.89 Y9.99 E18.5772 G1 X-7.99 Y3.89 E18.7293 G1 X-7.99 Y4.46 E18.7392 G1 X-2.46 Y9.99 E18.8772 G1 X-3.02 Y9.99 E18.8872 G1 X-7.99 Y5.02 E19.011 G1 X-7.99 Y5.59 E19.021 G1 X-3.59 Y9.99 E19.1307 G1 X-4.15 Y9.99 E19.1407 G1 X-7.99 Y6.15 E19.2363 G1 X-7.99 Y6.72 E19.2463 G1 X-4.72 Y9.99 E19.3278 G1 X-5.28 Y9.99 E19.3378 G1 X-7.99 Y7.28 E19.4053 G1 X-7.99 Y7.85 E19.4152 G1 X-5.85 Y9.99 E19.4686 G1 X-6.41 Y9.99 E19.4785 G1 X-7.99 Y8.41 E19.5178 G1 X-7.99 Y8.98 E19.5278 G1 X-6.98 Y9.99 E19.5529 G1 X-7.55 Y9.99 E19.5629 G1 X-8.01 Y9.53 E19.5744 M103 G1 E17.5744 F1200 G1 X-7.55 Y9.99 E17.5744 F7200 G1 X-6.98 Y9.99 E17.5744 G1 X-7.99 Y8.98 E17.5744 G1 X-7.99 Y8.41 E17.5744 G1 X-6.72 Y9.68 E17.5744 G1 X-6.72 Y9.68 Z10.25 E17.5744 F1200 (**** DeSelect Extruder.gcode ****) M127 (**** End.gcode ****) M73 P100 ( end build progress ) G0 Z155 F1000 ( send Z axis to bottom of machine ) M18 ( disable stepper ) M106 (turn on cooling fan) M104 S0 T0 ( cool down extruder ) G162 X Y F2500 ( home XY endstops ) M18 ( disable stepper motors ) M70 P5 ( We <3 Making Things!) M72 P1 ( play Ta-Da song ) (**** end of End.gcode ****) GPX-2.5.2/release.sh000077500000000000000000000024161271205255700141460ustar00rootroot00000000000000#!/bin/bash # This is the script to build most of the release archives that we publish to # github releases. It is intended to run on a linux system though a Mac might be # better since the idea is to cross-compile as many as possible and the Mac can # do all of the builds we currently release: mac, linux, mingw32, mingw64, but # for now, I don't have a Mac, so this script does the other three echo "------------------------------------------------------------------" echo "Linux build first" mkdir -p build cd build mkdir -p linux cd linux ../../configure --enable-maintainer-mode $args make make test make install make bdist archive=`ls gpx*.tar.gz` if [[ "${#archive[@]}" == "1" ]]; then mv $archive .. fi cd .. for plat in "win32" "win64"; do echo "------------------------------------------------------------------" echo "Building $plat" mkdir -p $plat cd $plat pwd case $plat in win32) args="-host i686-w64-mingw32" ;; win64) args="-host x86_64-w64-mingw32" ;; esac echo "Calling configure" ../../configure --enable-maintainer-mode $args make make bdist archive=`ls gpx*.zip` if [[ "${#archive[@]}" == "1" ]]; then mv $archive .. fi cd .. done GPX-2.5.2/scripts/000077500000000000000000000000001271205255700136535ustar00rootroot00000000000000GPX-2.5.2/scripts/gpx.py000077500000000000000000000012721271205255700150300ustar00rootroot00000000000000#Name: GPX #Info: GCode to x3g conversion post processor #Help: GPX #Depend: GCode #Type: postprocess #Param: gpxPath(str:/Applications/GPX) GPX path #Param: flags(str:-m r2) Flags import platform import os from Cura.util import profile from subprocess import call def getGpxAppName(): if platform.system() == 'Windows': if os.path.exists(gpxPath + '/gpx.exe'): return gpxPath + '/gpx.exe' return gpxPath + 'gpx.exe' if os.path.isfile(gpxPath + '/gpx'): return gpxPath + '/gpx' return gpxPath + 'gpx' x3gFile = profile.getPreference('lastFile') x3gFile = x3gFile[0:x3gFile.rfind('.')] + '.x3g' commandList = [getGpxAppName(), '-p', '-r', flags, filename, x3gFile] call(commandList) GPX-2.5.2/scripts/s3g-decompiler.py000077500000000000000000000362111271205255700170500ustar00rootroot00000000000000#!/usr/bin/python # # s3g-decompiler.py # # Created by Adam Mayer on Jan 25 2011 # Updated by Jetty, Dan Newman, and Henry Thomas 2011 - 2015 # # Originally from ReplicatorG sources /src/replicatorg/scripts # which are part of the ReplicatorG project - http://www.replicat.org # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software Foundation, # Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA import struct import sys import getopt showOffset = False byteOffset = 0 crc8_table = [ 0, 94, 188, 226, 97, 63, 221, 131, 194, 156, 126, 32, 163, 253, 31, 65, 157, 195, 33, 127, 252, 162, 64, 30, 95, 1, 227, 189, 62, 96, 130, 220, 35, 125, 159, 193, 66, 28, 254, 160, 225, 191, 93, 3, 128, 222, 60, 98, 190, 224, 2, 92, 223, 129, 99, 61, 124, 34, 192, 158, 29, 67, 161, 255, 70, 24, 250, 164, 39, 121, 155, 197, 132, 218, 56, 102, 229, 187, 89, 7, 219, 133, 103, 57, 186, 228, 6, 88, 25, 71, 165, 251, 120, 38, 196, 154, 101, 59, 217, 135, 4, 90, 184, 230, 167, 249, 27, 69, 198, 152, 122, 36, 248, 166, 68, 26, 153, 199, 37, 123, 58, 100, 134, 216, 91, 5, 231, 185, 140, 210, 48, 110, 237, 179, 81, 15, 78, 16, 242, 172, 47, 113, 147, 205, 17, 79, 173, 243, 112, 46, 204, 146, 211, 141, 111, 49, 178, 236, 14, 80, 175, 241, 19, 77, 206, 144, 114, 44, 109, 51, 209, 143, 12, 82, 176, 238, 50, 108, 142, 208, 83, 13, 239, 177, 240, 174, 76, 18, 145, 207, 45, 115, 202, 148, 118, 40, 171, 245, 23, 73, 8, 86, 180, 234, 105, 55, 213, 139, 87, 9, 235, 181, 54, 104, 138, 212, 149, 203, 41, 119, 244, 170, 72, 22, 233, 183, 85, 11, 136, 214, 52, 106, 43, 117, 151, 201, 74, 20, 246, 168, 116, 42, 200, 150, 21, 75, 169, 247, 182, 232, 10, 84, 215, 137, 107, 53] # CRC of payload should match CRC byte immediately after payload # Equivalently, CRC of payload and CRC byte should be 0x00 def crc8(bytes): val = 0; for b in bytearray(bytes): val = crc8_table[val ^ b] return val def axes_str(bitmask, high_bit=None): str = '' first = True if not high_bit is None: if bitmask & 0x80: str = high_bit[1] + ' ' else: str = high_bit[0] + ' ' for i in range(0,5): if bitmask & (1 << i): if not first: str += ', ' first = False str += 'XYZAB'[i] return str def Format(fmt, args): fmt_list = fmt.replace('%%', '~~').split('%') fmt_new = '' args_new = list(args) iargs = 0 if len(fmt_list) > 0: fmt_new = fmt_list[0] for l in fmt_list[1:]: if l[0] == 'a': args_new[iargs] = axes_str(args_new[iargs]) fmt_new += '%s' + l[1:] elif l[0] == 'A': args_new[iargs] = axes_str(args_new[iargs], ('Disable', 'Enable')) fmt_new += '%s' + l[1:] elif l[0] == 'b': args_new[iargs] = 'XYZAB'[args_new[iargs]] fmt_new += '%s' + l[1:] elif l[0] == 'O': if args_new[iargs] == 0: args_new[iargs] = "off" else: args_new[iargs] = "on" fmt_new += '%s' + l[1:] else: fmt_new += '%' + l iargs += 1 return fmt_new.replace('~~', '%%'), tuple(args_new) toolQueryTable = { 0: (" 0: contents = s3gFile.read(payloadLen) if len(contents) != payload: print "Error: file appears to be truncated; cannot parse" byteOffset += payload else: contents = "" return (index,command,contents) def printToolQuery(tuple): print "(10) Tool %i:" % (tuple[0]), # command - tuple[1] # data - tuple[2] try: (parse, disp) = toolQueryTable[tuple[1]] except KeyError: sys.stdout.write("Tool query not recognized %d\n" % tuple[1]) return True if type(parse) == type(""): packetLen = struct.calcsize(parse) if len(tuple[2]) != packetLen: sys.stdout.write("Malformed packet: packetLen %d, tuple len %d\n" % (packetLen, len(tuple[2]))) parsed = None else: parsed = struct.unpack(parse,tuple[2]) else: parsed = parse() if parsed is None: print disp elif type(disp) == type(""): print disp % parsed def parseDisplayMessageAction(): global s3gFile global byteOffset packetStr = s3gFile.read(4) if len(packetStr) < 4: raise "Error: file appears to be truncated; cannot parse" byteOffset += 4 (options,offsetX,offsetY,timeout) = struct.unpack(" 0: packetData = s3gFile.read(packetLen) if len(packetData) != packetLen: raise "Error: file appears to be truncated; cannot parse" byteOffset += packetLen parsed = struct.unpack(parse,packetData) else: parsed = "" else: parsed = parse() if type(disp) == type(""): fmt, args = Format(disp, parsed) print fmt % args elif disp is not None: disp(parsed) return True def usage(prog, exit_stat=0): str = 'Usage: %s [-o] input-x3g-file\n' % prog str += \ ' -o, --offsets\n' + \ ' Display the byte offset into the file for each command\n' if exit_stat != 0: sys.stderr.write(str) else: sys.stdout.write(str) sys.exit(exit_stat) try: opts, args = getopt.getopt(sys.argv[1:], 'ho', ['help', 'offsets']) except: usage(sys.argv[0], 1) if len(args) == 0: usage(sys.argv[0], 1) for opt, val in opts: if opt in ( '-h', '--help'): usage( sys.argv[0], 0 ) elif opt in ('-o', '--offsets'): showOffset = True s3gFile = open(args[0],'rb') lineNumber = 1 sys.stdout.write('Command count') if showOffset: sys.stdout.write(' [File byte offset]') sys.stdout.write(': (Command ID) Command description\n') while parseNextCommand(True): lineNumber = lineNumber + 1 s3gFile.close() GPX-2.5.2/slicerplugins/000077500000000000000000000000001271205255700150475ustar00rootroot00000000000000GPX-2.5.2/slicerplugins/cura15.06/000077500000000000000000000000001271205255700163735ustar00rootroot00000000000000GPX-2.5.2/slicerplugins/cura15.06/X3gWriter/000077500000000000000000000000001271205255700202315ustar00rootroot00000000000000GPX-2.5.2/slicerplugins/cura15.06/X3gWriter/X3gWriter.py000066400000000000000000000026721271205255700224500ustar00rootroot00000000000000# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from UM.Mesh.MeshWriter import MeshWriter from UM.Logger import Logger from UM.Application import Application from PyQt5.QtCore import QProcess import io class X3gWriter(MeshWriter): def __init__(self): super().__init__() self._gcode = None def write(self, file_name, storage_device, mesh_data): Logger.log("i", "In X3gWriter.write") if "x3g" in file_name: scene = Application.getInstance().getController().getScene() gcode_list = getattr(scene, "gcode_list") if gcode_list: # f = storage_device.openFile(file_name, "wt") Logger.log("i", "Writing X3g to file %s", file_name) p = QProcess() p.setReadChannel(1) p.setStandardOutputFile(file_name) p.start("gpx", ["-i"]) p.waitForStarted() for gcode in gcode_list: p.write(gcode) if (p.canReadLine()): Logger.log("i", "gpx: %s", p.readLine().data().decode('utf-8')) p.closeWriteChannel() if p.waitForFinished(): Logger.log("i", "gpx: %s", p.readAll().data().decode('utf-8')) p.close() # storage_device.closeFile(f) return True return False GPX-2.5.2/slicerplugins/cura15.06/X3gWriter/__init__.py000066400000000000000000000013021271205255700223360ustar00rootroot00000000000000# Copyright (c) 2015 Ultimaker B.V. # Cura is released under the terms of the AGPLv3 or higher. from . import X3gWriter from UM.i18n import i18nCatalog catalog = i18nCatalog("plugins") def getMetaData(): return { "type": "mesh_writer", "plugin": { "name": "X3g Writer", "author": "MarkWal", "version": "1.0", "description": catalog.i18nc("X3g Writer Plugin Description", "Writes X3g to files") }, "mesh_writer": { "extension": "x3g", "description": catalog.i18nc("X3g Writer File Description", "X3g File") } } def register(app): return { "mesh_writer": X3gWriter.X3gWriter() } GPX-2.5.2/src/000077500000000000000000000000001271205255700127535ustar00rootroot00000000000000GPX-2.5.2/src/defines/000077500000000000000000000000001271205255700143705ustar00rootroot00000000000000GPX-2.5.2/src/defines/defines.mk000066400000000000000000000035321271205255700163410ustar00rootroot00000000000000TARGET= # OS specific settings UNAME_OS := $(subst /,_,$(shell uname -s)) UNAME_ARCH := $(subst /,_,$(shell uname -p)) ifeq ($(TARGET), mingw64) CC = /opt/mingw64/cross_win64/bin/x86_64-w64-mingw32-gcc CC_FLAGS = LD_FLAGS = PLATFORM = win64 EXE = .exe OBJ = .o DEP = .d PYTHON = python CROSS = true else ifeq ($(TARGET), mingw32) CC = /opt/mingw32/cross_win32/bin/i686-w64-mingw32-gcc CC_FLAGS = LD_FLAGS = PLATFORM = win32 EXE = .exe OBJ = .o DEP = .d PYTHON = python CROSS = true else ifeq ($(UNAME_OS), Darwin) CC = cc CC_FLAGS = LD_FLAGS = PLATFORM = osx EXE = OBJ = .o DEP = .d PYTHON = python else ifeq ($(UNAME_OS), Linux) CC = cc CC_FLAGS = -Wstrict-prototypes -Wformat -Werror=format-security LD_FLAGS = PLATFORM = linux EXE = OBJ = .o DEP = .d PYTHON = python else ifeq ($(findstring MINGW32,$(UNAME_OS)), MINGW32) CC = gcc CC_FLAGS = -DHAS_NANOSLEEP LD_FLAGS = -static -static-libgcc PLATFORM = win32 EXE = .exe OBJ = .o DEP = .d PYTHON = else ifeq ($(findstring CYGWIN,$(UNAME_OS)), CYGWIN) CC = gcc CC_FLAGS = -DHAS_NANOSLEEP LD_FLAGS = -static -static-libgcc PLATFORM = win32 EXE = .exe OBJ = .o DEP = .d PYTHON = python else $(error Unsupported build platform $(UNAME_OS)) endif # Build directories SHAREDIR = $(SRCDIR)/shared PLANNERDIR = $(SRCDIR)/planner UTILSDIR = $(SRCDIR)/utils GPXDIR = $(SRCDIR)/gpx OBJDIR = $(PLATFORM)_obj INCDIR = -I$(SHAREDIR) -I$(GPXDIR) -I$(PLANNERDIR) ARCHIVE = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)-$(PLATFORM) ARCHDIR = $(OBJDIR)/$(ARCHIVE) MACHINEDIR = $(SRCDIR)/../machines ####### # # Since we may need to compile sources from other directories, # use make's VPATH functionality VPATH=./ $(SHAREDIR) # OS commands CD = cd CHMOD = chmod CP = cp DIFF = diff -b GZIP = gzip -9c MKDIR = mkdir -p RM = rm -f RMDIR = rm -rf TAR = tar cf ZIP = zip -r # End OS/Platform dependencies (hopefully) # ########## GPX-2.5.2/src/defines/rules.mk000066400000000000000000000016601271205255700160560ustar00rootroot00000000000000EXE_TARGET_OBJS = $(foreach objs, \ $(addsuffix _OBJS, $(EXE_TARGETS)), \ $(addprefix $(OBJDIR)/, $($(objs)))) LINK_TARGETS = $(addprefix $(OBJDIR)/, $(EXE_TARGETS)) all:: $(LINK_TARGETS) # Pull in auto-generated dependency information -include $(wildcard $(OBJDIR)/*.d) $(LINK_TARGETS):: $(EXE_TARGET_OBJS) $(CC) -g -o $@$(EXE) $(addprefix $(OBJDIR)/, $($(notdir $(addsuffix _OBJS, ${@})))) \ $(addprefix -l, $($(notdir $(addsuffix _LIBS, ${@})))) $(LD_FLAGS) # Really should have variables for the dependency switches, but # there's only so many hours in the day $(OBJDIR)/%$(OBJ):: %.c @test -d $(OBJDIR) || $(MKDIR) $(OBJDIR) $(CC) -g $(CC_FLAGS) $($(notdir $(addsuffix _DEFS, $(basename ${@})))) $(INCDIR) -c -o $@ $< $(CC) $(CC_FLAGS) $($(notdir $(addsuffix _DEFS, $(basename ${@})))) \ $(INCDIR) -MM -MF $(OBJDIR)/$*$(DEP) -MT $(OBJDIR)/$*$(OBJ) $(CC_FLAGS) $< clean:: -@$(RM) $(OBJDIR)/* -@$(RMDIR) $(OBJDIR) test:: GPX-2.5.2/src/gpx/000077500000000000000000000000001271205255700135515ustar00rootroot00000000000000GPX-2.5.2/src/gpx/Makefile.am000066400000000000000000000045441271205255700156140ustar00rootroot00000000000000# Build GPX, build GPX distributions # Dan Newman, February 2015 # AM_CPPFLAGS = -Wall -Wstrict-prototypes -Wformat -Werror=format-security -DSERIAL_SUPPORT -I$(top_srcdir)/src/shared bin_PROGRAMS = gpx gpx_SOURCES = gpx.c gpx-main.c ../shared/machine_config.c ../shared/opt.c vector.c vector.h gpx.h winsio.h if HAVE_WINDOWS_H gpx_SOURCES += winsio.c endif gpx_LDADD = -lm if HAVE_PYTHON if HAVE_DIFF test-local: $(builddir)/gpx$(EXEEXT) $(builddir)/gpx$(EXEEXT) -I -p -m r2x $(srcdir)/tests/lint.gcode $(builddir)/lint.x3g > $(builddir)/lint.log 2>&1 $(builddir)/gpx$(EXEEXT) -I -g -p -m r2x $(srcdir)/tests/lint.gcode $(builddir)/lint-g.x3g > $(builddir)/lint-g.log 2>&1 $(builddir)/gpx$(EXEEXT) -I -p -m r2x $(srcdir)/tests/issue13.gcode $(builddir)/issue13.x3g > $(builddir)/issue13.log 2>&1 $(builddir)/gpx$(EXEEXT) -I -g -p -m r2x $(srcdir)/tests/issue13.gcode $(builddir)/issue13-g.x3g > $(builddir)/issue13-g.log 2>&1 $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/lint.x3g > $(builddir)/lint.txt 2>&1 $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/lint-g.x3g > $(builddir)/lint-g.txt 2>&1 $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/issue13.x3g > $(builddir)/issue13.txt 2>&1 $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/issue13-g.x3g > $(builddir)/issue13-g.txt 2>&1 $(DIFF) $(srcdir)/tests/lint.txt $(builddir)/lint.txt $(DIFF) $(srcdir)/tests/lint-g.txt $(builddir)/lint-g.txt $(DIFF) $(srcdir)/tests/issue13.txt $(builddir)/issue13.txt $(DIFF) $(srcdir)/tests/issue13-g.txt $(builddir)/issue13-g.txt $(DIFF) $(srcdir)/tests/lint.x3g $(builddir)/lint.x3g $(DIFF) $(srcdir)/tests/lint.log $(builddir)/lint.log $(DIFF) $(srcdir)/tests/lint-g.x3g $(builddir)/lint-g.x3g $(DIFF) $(srcdir)/tests/lint-g.log $(builddir)/lint-g.log $(DIFF) $(srcdir)/tests/issue13.x3g $(builddir)/issue13.x3g $(DIFF) $(srcdir)/tests/issue13.log $(builddir)/issue13.log $(DIFF) $(srcdir)/tests/issue13-g.x3g $(builddir)/issue13-g.x3g $(DIFF) $(srcdir)/tests/issue13-g.log $(builddir)/issue13-g.log -@$(RM) $(builddir)/lint.x3g $(builddir)/lint.txt $(builddir)/lint.log -@$(RM) $(builddir)/lint-g.x3g $(builddir)/lint-g.txt $(builddir)/lint-g.log -@$(RM) $(builddir)/issue13.x3g $(builddir)/issue13.txt $(builddir)/issue13.log -@$(RM) $(builddir)/issue13-g.x3g $(builddir)/issue13-g.txt $(builddir)/issue13-g.log endif endif GPX-2.5.2/src/gpx/Makefile.in000066400000000000000000000534311271205255700156240ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Build GPX, build GPX distributions # Dan Newman, February 2015 # VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = gpx$(EXEEXT) @HAVE_WINDOWS_H_TRUE@am__append_1 = winsio.c subdir = src/gpx ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/shared/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__gpx_SOURCES_DIST = gpx.c gpx-main.c ../shared/machine_config.c \ ../shared/opt.c vector.c vector.h gpx.h winsio.h winsio.c am__dirstamp = $(am__leading_dot)dirstamp @HAVE_WINDOWS_H_TRUE@am__objects_1 = winsio.$(OBJEXT) am_gpx_OBJECTS = gpx.$(OBJEXT) gpx-main.$(OBJEXT) \ ../shared/machine_config.$(OBJEXT) ../shared/opt.$(OBJEXT) \ vector.$(OBJEXT) $(am__objects_1) gpx_OBJECTS = $(am_gpx_OBJECTS) gpx_DEPENDENCIES = AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/shared depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(gpx_SOURCES) DIST_SOURCES = $(am__gpx_SOURCES_DIST) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__extra_recursive_targets = test-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDIST_TARGET = @BDIST_TARGET@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CREATEDMG = @CREATEDMG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLATFORM = @PLATFORM@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGNOSX = @SIGNOSX@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -Wall -Wstrict-prototypes -Wformat -Werror=format-security -DSERIAL_SUPPORT -I$(top_srcdir)/src/shared gpx_SOURCES = gpx.c gpx-main.c ../shared/machine_config.c \ ../shared/opt.c vector.c vector.h gpx.h winsio.h \ $(am__append_1) gpx_LDADD = -lm all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/gpx/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/gpx/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) ../shared/$(am__dirstamp): @$(MKDIR_P) ../shared @: > ../shared/$(am__dirstamp) ../shared/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../shared/$(DEPDIR) @: > ../shared/$(DEPDIR)/$(am__dirstamp) ../shared/machine_config.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) ../shared/opt.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) gpx$(EXEEXT): $(gpx_OBJECTS) $(gpx_DEPENDENCIES) $(EXTRA_gpx_DEPENDENCIES) @rm -f gpx$(EXEEXT) $(AM_V_CCLD)$(LINK) $(gpx_OBJECTS) $(gpx_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../shared/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/machine_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/opt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpx-main.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/gpx.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/vector.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/winsio.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` test-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../shared/$(DEPDIR)/$(am__dirstamp) -rm -f ../shared/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @HAVE_DIFF_FALSE@test-local: @HAVE_PYTHON_FALSE@test-local: clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ../shared/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../shared/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: test: test-am test-am: test-local uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am test-am test-local uninstall \ uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@test-local: $(builddir)/gpx$(EXEEXT) @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(builddir)/gpx$(EXEEXT) -I -p -m r2x $(srcdir)/tests/lint.gcode $(builddir)/lint.x3g > $(builddir)/lint.log 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(builddir)/gpx$(EXEEXT) -I -g -p -m r2x $(srcdir)/tests/lint.gcode $(builddir)/lint-g.x3g > $(builddir)/lint-g.log 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(builddir)/gpx$(EXEEXT) -I -p -m r2x $(srcdir)/tests/issue13.gcode $(builddir)/issue13.x3g > $(builddir)/issue13.log 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(builddir)/gpx$(EXEEXT) -I -g -p -m r2x $(srcdir)/tests/issue13.gcode $(builddir)/issue13-g.x3g > $(builddir)/issue13-g.log 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/lint.x3g > $(builddir)/lint.txt 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/lint-g.x3g > $(builddir)/lint-g.txt 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/issue13.x3g > $(builddir)/issue13.txt 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(PYTHON) $(top_srcdir)/scripts/s3g-decompiler.py $(builddir)/issue13-g.x3g > $(builddir)/issue13-g.txt 2>&1 @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint.txt $(builddir)/lint.txt @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint-g.txt $(builddir)/lint-g.txt @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13.txt $(builddir)/issue13.txt @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13-g.txt $(builddir)/issue13-g.txt @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint.x3g $(builddir)/lint.x3g @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint.log $(builddir)/lint.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint-g.x3g $(builddir)/lint-g.x3g @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/lint-g.log $(builddir)/lint-g.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13.x3g $(builddir)/issue13.x3g @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13.log $(builddir)/issue13.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13-g.x3g $(builddir)/issue13-g.x3g @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ $(DIFF) $(srcdir)/tests/issue13-g.log $(builddir)/issue13-g.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ -@$(RM) $(builddir)/lint.x3g $(builddir)/lint.txt $(builddir)/lint.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ -@$(RM) $(builddir)/lint-g.x3g $(builddir)/lint-g.txt $(builddir)/lint-g.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ -@$(RM) $(builddir)/issue13.x3g $(builddir)/issue13.txt $(builddir)/issue13.log @HAVE_DIFF_TRUE@@HAVE_PYTHON_TRUE@ -@$(RM) $(builddir)/issue13-g.x3g $(builddir)/issue13-g.txt $(builddir)/issue13-g.log # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: GPX-2.5.2/src/gpx/gpx-main.c000066400000000000000000000630061271205255700154420ustar00rootroot00000000000000// // gpx-main.c // // Created by WHPThomas on 1/04/13. // // Copyright (c) 2013 WHPThomas, All rights reserved. // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include #include #include #include #if defined(SERIAL_SUPPORT) #if !defined(_WIN32) && !defined(_WIN64) #include #else #include "winsio.h" #endif #define USE_GPX_SIO_OPEN #else typedef long speed_t; #define B115200 115200 #define B57600 57600 #define NO_SERIAL_SUPPORT_MSG "Serial I/O and USB printing is not supported " \ "by this build of GPX" #endif #include "gpx.h" #include "machine_config.h" // Global variables static Gpx gpx; static FILE *file_in = NULL; static FILE *file_out = NULL; static FILE *file_out2 = NULL; static int sio_port = -1; static char temp_config_name[24]; // cleanup code in case we encounter an error that causes the program to exit static void exit_handler(void) { // close open files if(file_in != stdin && file_in != NULL) { fclose(file_in); file_in = NULL; } if(file_out != stdout && file_out != NULL) { if(ferror(file_out)) { perror("Error writing to output file"); } fclose(file_out); file_out = NULL; } if(file_out2 != NULL) { fclose(file_out2); file_out2 = NULL; } // 23 February 2015 // Assuming stdin=0, stdout=1, stderr=3 isn't always safe // Do not assume that sio_port > 2 means it needs to be // closed. Instead, if it isn't negative, then it needs // to be closed. if(sio_port >= 0) { close(sio_port); sio_port = -1; } if(temp_config_name[0]) { unlink(temp_config_name); temp_config_name[0] = '\0'; } } // display usage static void usage(int err) { FILE *fp = err ? stderr : stdout; err = err ? 1 : 0; #if defined(SERIAL_SUPPORT) #define SERIAL_MSG1 "s" #define SERIAL_MSG2 "[-b BAUDRATE] " #else #define SERIAL_MSG1 "" #define SERIAL_MSG2 "" #endif if (err) fputs(EOL, fp); fputs("GPX " PACKAGE_VERSION EOL, fp); fputs("Copyright (c) 2013 WHPThomas, All rights reserved." EOL, fp); fputs("Additional changes Copyright (c) 2014, 2015 DNewman, MWalker" EOL, fp); fputs("All rights reserved." EOL, fp); if (err) { fputs(EOL "For usage information: gpx -?" EOL, fp); return; } fputs(EOL "This program is free software; you can redistribute it and/or modify" EOL, fp); fputs("it under the terms of the GNU General Public License as published by" EOL, fp); fputs("the Free Software Foundation; either version 2 of the License, or" EOL, fp); fputs("(at your option) any later version." EOL, fp); fputs(EOL "This program is distributed in the hope that it will be useful," EOL, fp); fputs("but WITHOUT ANY WARRANTY; without even the implied warranty of" EOL, fp); fputs("MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the" EOL, fp); fputs("GNU General Public License for more details." EOL, fp); fputs(EOL "Usage:" EOL, fp); fputs("gpx [-CFIdgilpqr" SERIAL_MSG1 "tvw] " SERIAL_MSG2 "[-b BAUDRATE] [-c CONFIG] [-e EEPROM] [-f DIAMETER] [-m MACHINE] [-N h|t|ht] [-n SCALE] [-x X] [-y Y] [-z Z] IN [OUT]" EOL, fp); fputs(EOL "Options:" EOL, fp); fputs("\t-C\tcreate temporary file with a copy of the machine configuration" EOL, fp); fputs("\t-F\twrite X3G on-wire framing data to output file" EOL, fp); fputs("\t-I\tignore default .ini files" EOL, fp); fputs("\t-N\tdisable writing of the X3G header (start build notice)," EOL, fp); fputs("\t \ttail (end build notice), or both" EOL, fp); fputs("\t-d\tsimulated ditto printing" EOL, fp); fputs("\t-g\tMakerbot/ReplicatorG GCODE flavor" EOL, fp); fputs("\t-i\tenable stdin and stdout support for command line pipes" EOL, fp); fputs("\t-l\tlog to file" EOL, fp); fputs("\t-p\toverride build percentage" EOL, fp); fputs("\t-q\tquiet mode" EOL, fp); fputs("\t-r\tReprap GCODE flavor" EOL, fp); #if defined(SERIAL_SUPPORT) fputs("\t-s\tenable USB serial I/O and send x3G output to 3D printer" EOL, fp); #endif fputs("\t-t\ttruncate filename (DOS 8.3 format)" EOL, fp); fputs("\t-v\tverose mode" EOL, fp); fputs("\t-w\trewrite 5d extrusion values" EOL, fp); #if defined(SERIAL_SUPPORT) fputs(EOL "BAUDRATE: the baudrate for serial I/O (default is 115200)" EOL, fp); #endif fputs("CONFIG: the filename of a custom machine definition (ini file)" EOL, fp); fputs("EEPROM: the filename of an eeprom settings definition (ini file)" EOL, fp); fputs("DIAMETER: the actual filament diameter in the printer" EOL, fp); fputs(EOL "MACHINE: the predefined machine type" EOL, fp); fputs("\tsome machine definitions have been updated with corrected steps per mm" EOL, fp); fputs("\tthe original can be selected by prefixing o to the machine id" EOL, fp); fputs("\t(or1, or1d, or2, or2h, orx, ot7, ot7d)" EOL, fp); gpx_list_machines(fp); fputs(EOL "SCALE: the coordinate system scale for the conversion (ABS = 1.0035)" EOL, fp); fputs("X,Y & Z: the coordinate system offsets for the conversion" EOL, fp); fputs("\tX = the x axis offset" EOL, fp); fputs("\tY = the y axis offset" EOL, fp); fputs("\tZ = the z axis offset" EOL, fp); fputs(EOL "IN: the name of the sliced gcode input filename" EOL, fp); fputs("OUT: the name of the X3G output filename" #if defined(SERIAL_SUPPORT) "or the serial I/O port" #endif EOL, fp); fputs(" specify '--' to write to stdout" EOL, fp); fputs(EOL "Examples:" EOL, fp); fputs("\tgpx -p -m r2 my-sliced-model.gcode" EOL, fp); fputs("\tgpx -c custom-tom.ini example.gcode /volumes/things/example.x3g" EOL, fp); fputs("\tgpx -x 3 -y -3 offset-model.gcode" EOL, fp); #if defined(SERIAL_SUPPORT) fputs("\tgpx -m c4 -s sio-example.gcode /dev/tty.usbmodem" EOL EOL, fp); #endif } #if !defined(SERIAL_SUPPORT) // Should never be called in practice but code is less grotty (less #ifdef's) // if we simply provide this stub static void sio_open(const char *filename, speed_t baud_rate) { perror(NO_SERIAL_SUPPORT_MSG); exit(1); } #else #if !defined(_WIN32) && !defined(_WIN64) int gpx_sio_open(Gpx *gpx, const char *filename, speed_t baud_rate, int *sio_port) { struct termios tp; int port; if(sio_port) *sio_port = -1; // open and configure the serial port if((port = open(filename, O_RDWR | O_NOCTTY | O_NONBLOCK)) < 0) { perror("Error opening port"); return 0; } if(fcntl(port, F_SETFL, O_RDWR) < 0) { perror("Setting port descriptor flags"); return 0; } if(tcgetattr(port, &tp) < 0) { perror("Error getting port attributes"); return 0; } cfmakeraw(&tp); /* // 8N1 tp.c_cflag &= ~PARENB; tp.c_cflag &= ~CSTOPB; tp.c_cflag &= ~CSIZE; tp.c_cflag |= CS8; // no flow control tp.c_cflag &= ~CRTSCTS; // disable hang-up-on-close to avoid reset //tp.c_cflag &= ~HUPCL; // turn on READ & ignore ctrl lines tp.c_cflag |= CREAD | CLOCAL; // turn off s/w flow ctrl tp.c_cflag &= ~(IXON | IXOFF | IXANY); // make raw tp.c_cflag &= ~(ICANON | ECHO | ECHOE | ISIG); tp.c_cflag &= ~OPOST; // see: http://unixwiz.net/techtips/termios-vmin-vtime.html tp.c_cc[VMIN] = 0; tp.c_cc[VTIME] = 0; */ cfsetspeed(&tp, baud_rate); // cfsetispeed(&tp, baud_rate); // cfsetospeed(&tp, baud_rate); // let's ask the i/o system to block for up to a tenth of a second // waiting for at least 255 bytes or whatever we asked for (whichever // is least). tp.c_cc[VMIN] = 255; tp.c_cc[VTIME] = 1; if(tcsetattr(port, TCSANOW, &tp) < 0) { perror("Error setting port attributes"); return 0; } sleep(2); if(tcflush(port, TCIOFLUSH) < 0) { perror("Error flushing port"); return 0; } if(gpx->flag.verboseMode) fprintf(gpx->log, "Communicating via: %s" EOL, filename); if(sio_port) *sio_port = port; return 1; } #endif void sio_open(const char *filename, speed_t baud_rate) { if (!gpx_sio_open(&gpx, filename, baud_rate, &sio_port)) exit(-1); } #endif // SERIAL_SUPPORT int gpx_find_ini(Gpx *gpx, char *argv0) { char fbuf[1024]; char *home; int i; #if defined(_WIN32) || defined(_WIN64) // if present, read the %appdata%/local/GpxUi/gpx.ini home = getenv("LOCALAPPDATA"); if(home && home[0]) { snprintf(fbuf, sizeof(fbuf), "%s/GpxUi/gpx.ini", home); if(!access(fbuf, R_OK)) { i = gpx_load_config(gpx, fbuf); if(i >= 0) return i; } } #endif home = getenv("HOME"); if(home && home[0]) { snprintf(fbuf, sizeof(fbuf), "%s/.gpx.ini", home); if (!access(fbuf, R_OK)) { i = gpx_load_config(gpx, fbuf); if(i >= 0) return i; } } // if present, read the gpx.ini file from the program directory // TODO this doesn't really work on Windows because argv0 doesn't necessarily // have the full path // check for .exe extension const char *dot = strrchr(argv0, '.'); size_t len = 0; if(dot && !strcasecmp(dot, ".exe")) { len = dot - argv0; } else { len = strlen(argv0); } if(len + 5 > sizeof(fbuf)) return -1; memcpy(fbuf, argv0, len); strcpy(fbuf + len, ".ini"); return gpx_load_config(gpx, fbuf); } // GPX program entry point int main(int argc, char * const argv[]) { int c, i, rval = 1; int force_framing = 0; int ignore_default_ini = 0; int log_to_file = 0; int standard_io = 0; int serial_io = 0; int truncate_filename = 0; char *config = NULL; char *eeprom = NULL; double filament_diameter = 0; char *buildname = PACKAGE_STRING; char *filename; speed_t baud_rate = B115200; int make_temp_config = 0; // Blank the temporary config file name. If it isn't blank // on exit and an error has occurred, then it is deleted temp_config_name[0] = '\0'; // default to standard I/O file_in = stdin; file_out = stdout; // register cleanup function atexit(exit_handler); gpx_initialize(&gpx, 1); gpx.log = stderr; // we run through getopt twice, the first time is to figure out whether to load // the ini file from the default locations and whether to be verbose about it // we need to load the ini file before parsing the rest so that the command line // overrides the default ini in the standard case while ((c = getopt(argc, argv, "CFIN:b:c:de:gf:ilm:n:pqrstu:vwx:y:z:?")) != -1) { switch (c) { case 'I': ignore_default_ini = 1; break; case 'l': gpx.flag.verboseMode = 1; log_to_file = 1; break; case 'v': if(gpx.flag.verboseMode) gpx.flag.verboseSioMode = 1; gpx.flag.verboseMode = 1; break; } } optind = 1; if(!ignore_default_ini) { // READ GPX.INI i = gpx_find_ini(&gpx, argv[0]); if (i > 0) { fprintf(stderr, "(line %u) Configuration syntax error: unrecognised parameters" EOL, i); usage(1); goto done; } } // READ COMMAND LINE // get the command line options // Allow -s and -b so that we can give a more targetted // error message should they be attempted when the code // is compiled without serial I/O support. while ((c = getopt(argc, argv, "CFIN:b:c:de:gf:ilm:n:pqrstu:vwx:y:z:?")) != -1) { switch (c) { case 'C': // Write config data to a temp file // Write output to stdout make_temp_config = 1; break; case 'F': force_framing = ITEM_FRAMING_ENABLE; break; case 'I': break; // handled in first getopt loop case 'N': if(optarg[0] == 'h' || optarg[1] == 'h') gpx_set_start(&gpx, 0); if(optarg[0] == 't' || optarg[1] == 't') gpx_set_end(&gpx, 0); break; case 'b': #if !defined(SERIAL_SUPPORT) fprintf(stderr, NO_SERIAL_SUPPORT_MSG EOL); usage(1); goto done; #else i = atoi(optarg); switch(i) { case 4800: baud_rate=B4800; break; case 9600: baud_rate=B9600; break; #ifdef B14400 case 14400: baud_rate=B14400; break; #endif case 19200: baud_rate=B19200; break; #ifdef B28800 case 28800: baud_rate=B28800; break; #endif case 38400: baud_rate=B38400; break; case 57600: baud_rate=B57600; break; case 115200: baud_rate=B115200; break; default: fprintf(stderr, "Command line error: unsupported baud rate '%s'" EOL, optarg); usage(1); goto done; } if(gpx.flag.verboseMode) fprintf(stderr, "Setting baud rate to: %i bps" EOL, i); #endif // fall through case 's': #if !defined(SERIAL_SUPPORT) fprintf(stderr, NO_SERIAL_SUPPORT_MSG EOL); usage(1); goto done; #else serial_io = 1; gpx.flag.framingEnabled = 1; #endif break; case 'c': config = optarg; break; case 'd': gpx.flag.dittoPrinting = 1; break; case 'e': eeprom = optarg; break; case 'g': gpx.flag.reprapFlavor = 0; break; case 'f': filament_diameter = strtod(optarg, NULL); if(filament_diameter > 0.0001) { gpx.override[0].actual_filament_diameter = filament_diameter; gpx.override[1].actual_filament_diameter = filament_diameter; } break; case 'i': standard_io = 1; break; case 'l': break; // handled in first getopt loop case 'm': if(gpx_set_property(&gpx, "printer", "machine_type", optarg)) { usage(1); goto done; } break; case 'n': gpx.user.scale = strtod(optarg, NULL); break; case 'p': gpx.flag.buildProgress = 1; break; case 'q': gpx.flag.logMessages = 0; break; case 'r': gpx.flag.reprapFlavor = 1; break; case 't': truncate_filename = 1; break; case 'u': if(gpx_set_property(&gpx, "machine", "steps_per_mm", optarg)) { usage(1); goto done; } break; case 'v': break; // handled in first getopt loop case 'w': gpx.flag.rewrite5D = 1; break; case 'x': gpx.user.offset.x = strtod(optarg, NULL); break; case 'y': gpx.user.offset.y = strtod(optarg, NULL); break; case 'z': gpx.user.offset.z = strtod(optarg, NULL); break; case '?': usage(0); rval = SUCCESS; goto done; default: usage(1); goto done; } } argc -= optind; argv += optind; // LOG TO FILE if(log_to_file && argc > 0) { filename = (argc > 1 && !serial_io) ? argv[1] : argv[0]; // or use the input filename with a .log extension char *dot = strrchr(filename, '.'); if(dot) { long l = dot - filename; memcpy(gpx.buffer.out, filename, l); filename = gpx.buffer.out + l; } // or just append one if no .gcode extension is present else { size_t sl = strlen(filename); memcpy(gpx.buffer.out, filename, sl); filename = gpx.buffer.out + sl; } *filename++ = '.'; *filename++ = 'l'; *filename++ = 'o'; *filename++ = 'g'; *filename++ = '\0'; filename = gpx.buffer.out; if((gpx.log = fopen(filename, "w+")) == NULL) { gpx.log = stderr; perror("Error opening log"); } } // READ CONFIGURATION if(config) { i = gpx_load_config(&gpx, config); if (i < 0) { fprintf(stderr, "Command line error: cannot load configuration file '%s'" EOL, config); usage(1); goto done; } else if (i > 0) { fprintf(stderr, "(line %u) Configuration syntax error in %s: unrecognised paremeters" EOL, i, config); usage(1); goto done; } } if(make_temp_config) { FILE *temp_config = NULL; #if !defined(_WIN32) && !defined(_WIN64) int fd; strncpy(temp_config_name, "/tmp/gpx-XXXXXX.ini", sizeof(temp_config_name) - 1); fd = mkstemps(temp_config_name, 4); temp_config = (fd >= 0) ? fdopen(fd, "w") : NULL; #else strcpy(temp_config_name, "gpx-XXXXXX"); _mktemp(temp_config_name); strncat(temp_config_name, ".ini", sizeof(temp_config_name)-1); temp_config = fopen(temp_config_name, "w"); #endif if(temp_config) { config_dump(temp_config, &gpx.machine); fclose(temp_config); } else { perror("Error writing a temporary configuration file for " "the -C option"); goto done; } } if(baud_rate == B57600 && gpx.machine.id >= MACHINE_TYPE_REPLICATOR_1) { if(gpx.flag.verboseMode) fputs("WARNING: a 57600 bps baud rate will cause problems with Repicator 2/2X Mightyboards" EOL, gpx.log); } // OPEN FILES AND PORTS FOR INPUT AND OUTPUT if(standard_io) { if(serial_io) { if(argc > 0) { filename = argv[0]; sio_open(filename, baud_rate); } else { fputs("Command line error: port required for serial I/O" EOL, stderr); usage(1); goto done; } } #ifdef _WIN32 else { setmode(fileno(stdout), O_BINARY); } #endif } // open the input filename if one is provided else if(argc > 0) { filename = argv[0]; if(gpx.flag.verboseMode) fprintf(gpx.log, "Reading from: %s" EOL, filename); if((file_in = fopen(filename, "rw")) == NULL) { perror("Error opening input"); goto done; } // assign build name buildname = strrchr(filename, PATH_DELIM); #ifdef _WIN32 char *otherdelim = strrchr(filename, '/'); if (otherdelim > buildname) { buildname = otherdelim; } #endif if(buildname) { buildname++; } else { buildname = filename; } argc--; argv++; // use the output filename if one is provided if(argc > 0) { filename = argv[0]; // prefer output filename over input for the buildname char *s = strrchr(filename, PATH_DELIM); #ifdef _WIN32 otherdelim = strrchr(filename, '/'); if (otherdelim > s) s = otherdelim; #endif s = strdup(s ? s+1 : filename); if (s) buildname = s; } else { if(serial_io) { fputs("Command line error: port required for serial I/O" EOL, stderr); usage(1); goto done; } // or use the input filename with a .x3g extension char *ext = strrchr(filename, '.'); size_t l = ext ? ext - filename : strlen(filename); memcpy(gpx.buffer.out, filename, l); filename = gpx.buffer.out; ext = filename + l; if(truncate_filename) { // truncate, replace all non alnum with '_' and uppercase char *s = gpx.buffer.out; for(i = 0; s < ext && i < 8; i++) { char c = *s; if(isalnum(c)) { *s++ = toupper(c); } else { *s++ = '_'; } } strcpy(s, ".X3G"); } else { strcpy(ext, ".x3g"); } } // trim build name extension char *dot = strrchr(buildname, '.'); if(dot) *dot = 0; if(serial_io) { sio_open(filename, baud_rate); } else { if(filename[0] != '-' || filename[1] != '-' || filename[2] != '\0') { if((file_out = fopen(filename, "wb")) == NULL) { perror("Error creating output"); goto done; } if(gpx.flag.verboseMode) fprintf(gpx.log, "Writing to: %s" EOL, filename); // write a second copy to the SD Card if(gpx.sdCardPath) { long sl = strlen(gpx.sdCardPath); if(sl > 0 && gpx.sdCardPath[sl - 1] == PATH_DELIM) { gpx.sdCardPath[--sl] = 0; } char *leaf = strrchr(filename, PATH_DELIM); if (!leaf) leaf = filename; else leaf++; // strdup because we could be pointing into gpx.buffer.out // and we're about to use that to prepend the sdCardPath leaf = strdup(leaf); if(leaf == NULL) { fputs("Insufficient memory" EOL, stderr); goto done; } memcpy(gpx.buffer.out, gpx.sdCardPath, sl); gpx.buffer.out[sl++] = PATH_DELIM; strcpy(gpx.buffer.out + sl, filename); free(leaf); file_out2 = fopen(gpx.buffer.out, "wb"); if(file_out2 && gpx.flag.verboseMode) fprintf(gpx.log, "Writing to: %s" EOL, gpx.buffer.out); } } } } else { fputs("Command line error: provide an input file or enable standard I/O" EOL, stderr); usage(1); goto done; } if(log_to_file) { if(gpx.flag.buildProgress) fputs("Build progress: enabled" EOL, gpx.log); if(gpx.flag.dittoPrinting) fputs("Ditto printing: enabled" EOL, gpx.log); if(serial_io) fputs("Serial IO: enabled" EOL, gpx.log); fprintf(gpx.log, "GCode flavor: %s" EOL, gpx.flag.reprapFlavor ? "Reprap" : "Makerbot"); if(gpx.flag.rewrite5D) fputs("Rewrite 5D: enabled" EOL, gpx.log); } /* at this point we have read the command line, set the machine definition and both the input and output files or ports are open, so its time to parse the gcode input and convert it to x3g output. */ if(make_temp_config) gpx_set_preamble(&gpx, temp_config_name); if(serial_io) { // READ CONFIG AND WRITE EEPROM SETTINGS if(eeprom) { if(gpx.flag.verboseMode) fprintf(gpx.log, "Loading eeprom config: %s" EOL, eeprom); i = eeprom_load_config(&gpx, eeprom); if (i < 0) { fprintf(stderr, "Command line error: cannot load eeprom configuration file '%s'" EOL, eeprom); usage(1); goto done; } else if (i > 0) { fprintf(stderr, "(line %u) Eeprom configuration syntax error in %s: unrecognised paremeters" EOL, i, eeprom); usage(1); goto done; } rval = SUCCESS; goto done; } else { // READ INPUT AND SEND OUTPUT TO PRINTER gpx_start_convert(&gpx, buildname, force_framing, 0); rval = gpx_convert_and_send(&gpx, file_in, sio_port, force_framing, 0); gpx_end_convert(&gpx); } } else { // READ INPUT AND CONVERT TO OUTPUT gpx_start_convert(&gpx, buildname, force_framing, 0); rval = gpx_convert(&gpx, file_in, file_out, file_out2); gpx_end_convert(&gpx); } done: if (temp_config_name[0]) { if (rval != SUCCESS) unlink(temp_config_name); temp_config_name[0] = '\0'; } return(rval); } GPX-2.5.2/src/gpx/gpx.c000066400000000000000000007106061271205255700145250ustar00rootroot00000000000000// // gpx.c // // Created by WHPThomas on 1/04/13. // // Copyright (c) 2013 WHPThomas, All rights reserved. // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include #include #include #include #include #include #include #include #include #include #include "portable_endian.h" #include "gpx.h" #define A 0 #define B 1 #define SHOW(FN) if(gpx->flag.logMessages) {FN;} #define VERBOSE(FN) if(gpx->flag.verboseMode && gpx->flag.logMessages) {FN;} #define VERBOSESIO(FN) if(gpx->flag.verboseSioMode) {FN;} #define CALL(FN) if((rval = FN) != SUCCESS) return rval // Machine definitions #ifndef MACHINE_ARRAY #define MACHINE_ARRAY #endif #define MACHINE_ALIAS_ARRAY #include "std_machines.h" #include "classic_machines.h" #include "std_eeprommaps.h" #undef MACHINE_ARRAY void short_sleep(long nsec) { #ifdef HAVE_NANOSLEEP // some old mingw32 compiler, in particular the cross compiler still in use // on MacOS, lack nanosleep struct timespec ts = {0, nsec}; nanosleep(&ts, NULL); #else usleep(nsec / 1000); #endif } void long_sleep(time_t sec) { #ifdef HAVE_NANOSLEEP struct timespec ts = {sec, 0}; nanosleep(&ts, NULL); #else usleep(sec * 1000); #endif } // Define some elapsed times in terms of nanoseconds #define NS_100MS (100000000L) #define NS_10MS (10000000L) // send a result to the result handler or log it if there isn't one static int gcodeResult(Gpx *gpx, const char *fmt, ...) { int result = 0; va_list args; va_start(args, fmt); if(gpx->resultHandler != NULL) { result = gpx->resultHandler(gpx, gpx->callbackData, fmt, args); } else if(gpx->flag.logMessages) { result = vfprintf(gpx->log, fmt, args); } va_end(args); return result; } static void show_current_pos(Gpx *gpx) { gcodeResult(gpx, "X:%0.2f Y:%0.2f Z:%0.2f A:%0.2f B:%0.2f\n", gpx->current.position.x, gpx->current.position.y, gpx->current.position.z, gpx->current.position.a, gpx->current.position.b); } void gpx_list_machines(FILE *fp) { Machine **ptr = machines; while(*ptr) { fprintf(fp, "\t%-3s = %s" EOL, (*ptr)->type, (*ptr)->desc); ptr++; } MachineAlias **pma = machine_aliases; for (; *pma; pma++) { fprintf(fp, "\t%-3s = %s" EOL, (*pma)->alias, (*pma)->desc); } } #define MACHINE_IS(m) strcasecmp(machine, m) == 0 Machine *gpx_find_machine(const char *machine) { Machine **all_machines[] = {machines, wrong_machines, NULL}; Machine ***ptr_all; Machine **ptr; // check the aliases MachineAlias **pma; for (pma = machine_aliases; *pma; pma++) { if(MACHINE_IS((*pma)->alias)) { machine = (*pma)->type; break; } } // check the machine list for (ptr_all = all_machines; *ptr_all != NULL; ptr_all++) { for (ptr = *ptr_all; *ptr; ptr++) { if(MACHINE_IS((*ptr)->type)) return *ptr; } } // Machine not found return NULL; } static int ini_parse(Gpx* gpx, const char* filename, int (*handler)(Gpx*, const char*, const char*, char*)); int gpx_set_property(Gpx *gpx, const char* section, const char* property, char* value); int gpx_set_machine(Gpx *gpx, const char *machine_type, int init) { Machine *machine = gpx_find_machine(machine_type); if(machine == NULL) return ERROR; // only load/clobber the on-board machine definition if the one specified is differenti // or if we're initializing if(init || gpx->machine.id != machine->id) { memcpy(&gpx->machine, machine, sizeof(Machine)); VERBOSE( fprintf(gpx->log, "Loading machine definition: %s" EOL, machine->desc) ); if(gpx->iniPath != NULL) { // if there's a gpx->iniPath + "/" + machine->type + ".ini" load it // here recursively char machineIni[1024]; machineIni[0] = 0; int i = snprintf(machineIni, sizeof(machineIni), "%s/%s.ini", gpx->iniPath, machine->type); if(i > 0 && i < sizeof(machineIni)) { if(access(machineIni, R_OK) == SUCCESS) { VERBOSE( fprintf(gpx->log, "Using custom machine definition from: %s" EOL, machineIni) ); ini_parse(gpx, machineIni, gpx_set_property); } else if(errno != ENOENT) VERBOSE( fprintf(gpx->log, "Unable to load custom machine definition errno = %d\n", errno) ); } } } else { VERBOSE( fputs("Ignoring duplicate machine definition: -m ", gpx->log) ); VERBOSE( fputs(machine_type, gpx->log) ); VERBOSE( fputs(EOL, gpx->log) ); } // update known position mask gpx->axis.mask = gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK;; return SUCCESS; } // PRIVATE FUNCTION PROTOTYPES static double get_home_feedrate(Gpx *gpx, int flag); static int pause_at_zpos(Gpx *gpx, float z_positon); // initialization of global variables // 02 - Get available buffer size char buffer_size_query[] = { 0xD5, // start byte 1, // length 2, // query command 0 // crc }; static unsigned char calculate_crc(unsigned char *addr, long len); void gpx_initialize(Gpx *gpx, int firstTime) { int i; if(!gpx) return; gpx->buffer.ptr = gpx->buffer.out; // we default to using pipes // initialise machine if(firstTime) gpx_set_machine(gpx, "r2", 1); // initialise command gpx->command.x = 0.0; gpx->command.y = 0.0; gpx->command.z = 0.0; gpx->command.a = 0.0; gpx->command.b = 0.0; gpx->command.e = 0.0; gpx->command.f = 0.0; gpx->command.p = 0.0; gpx->command.r = 0.0; gpx->command.s = 0.0; gpx->command.g = 0.0; gpx->command.m = 0.0; gpx->command.t = 0.0; gpx->command.comment = ""; gpx->command.flag = 0; // initialize target position gpx->target.position.x = 0.0; gpx->target.position.y = 0.0; gpx->target.position.z = 0.0; gpx->target.position.a = 0.0; gpx->target.position.b = 0.0; gpx->target.extruder = 0; // initialize current position gpx->current.position.x = 0.0; gpx->current.position.y = 0.0; gpx->current.position.z = 0.0; gpx->current.position.a = 0.0; gpx->current.position.b = 0.0; gpx->current.feedrate = get_home_feedrate(gpx, XYZ_BIT_MASK); gpx->current.extruder = 0; gpx->current.offset = 0; gpx->current.percent = 0; gpx->current.speed_factor = 100; // actually, gpx doesn't know A and B except that at the start of an SD // print they're always reset to zero. The first absolute move already // assumed any unspecified extruder was 0. So while this isn't yet correct // it makes the output most like the old GPX prior to fixing issue markwal/GPX#1 gpx->axis.positionKnown = gpx->machine.extruder_count == 1 ? A_IS_SET : (A_IS_SET|B_IS_SET); gpx->axis.mask = gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK;; // initialize the accumulated rounding error gpx->excess.a = 0.0; gpx->excess.b = 0.0; // initialize the G10 offsets for(i = 0; i < 7; i++) { gpx->offset[i].x = 0.0; gpx->offset[i].y = 0.0; gpx->offset[i].z = 0.0; } // initialize the command line offset if(firstTime) { gpx->user.offset.x = 0.0; gpx->user.offset.y = 0.0; gpx->user.offset.z = 0.0; gpx->user.scale = 1.0; } for(i = 0; i < 2; i++) { gpx->tool[i].motor_enabled = 0; #if ENABLE_SIMULATED_RPM gpx->tool[i].rpm = 0; #endif gpx->tool[i].nozzle_temperature = 0; gpx->tool[i].build_platform_temperature = 0; gpx->override[i].actual_filament_diameter = 0; gpx->override[i].filament_scale = 1.0; gpx->override[i].packing_density = 1.0; gpx->override[i].standby_temperature = 0; gpx->override[i].active_temperature = 0; gpx->override[i].build_platform_temperature = 0; gpx->override[i].extrusion_factor = 100; } if(firstTime) { gpx->filament[0].colour = "_null_"; gpx->filament[0].diameter = 0.0; gpx->filament[0].temperature = 0; gpx->filament[0].LED = 0; gpx->filamentLength = 1; } if(firstTime) { gpx->commandAtIndex = 0; gpx->commandAtLength = 0; } gpx->commandAtZ = 0.0; // SETTINGS if(firstTime) { gpx->sdCardPath = NULL; gpx->iniPath = NULL; gpx->buildName = NULL; gpx->selectedFilename = NULL; gpx->preamble = NULL; gpx->nostart = 0; gpx->noend = 0; gpx->eepromMappingVector = NULL; } if(gpx->eepromMappingVector != NULL) { free(gpx->eepromMappingVector); gpx->eepromMappingVector = NULL; } gpx->eepromMap = NULL; gpx->flag.relativeCoordinates = 0; gpx->flag.extruderIsRelative = 0; if(firstTime) { gpx->flag.reprapFlavor = 1; // reprap flavor is enabled by default gpx->flag.dittoPrinting = 0; gpx->flag.buildProgress = 0; gpx->flag.verboseMode = 0; gpx->flag.logMessages = 1; // logging is enabled by default gpx->flag.rewrite5D = 0; gpx->flag.sioConnected = 0; gpx->flag.M106AlwaysValve = 0; gpx->flag.onlyExplicitToolChange = 0; } // STATE gpx->flag.programState = 0; gpx->flag.doPauseAtZPos = 0; gpx->flag.pausePending = 0; gpx->flag.macrosEnabled = 0; if(firstTime) { gpx->flag.loadMacros = 1; gpx->flag.runMacros = 1; } if(firstTime) gpx->flag.framingEnabled = 0; gpx->longestDDA = 0; gpx->layerHeight = 0.34; gpx->lineNumber = 1; // STATISTICS gpx->accumulated.a = 0.0; gpx->accumulated.b = 0.0; gpx->accumulated.time = 0.0; gpx->accumulated.bytes = 0; if(firstTime) { gpx->total.length = 0.0; gpx->total.time = 0.0; gpx->total.bytes = 0; } // CALLBACK gpx->callbackHandler = NULL; gpx->callbackData = NULL; gpx->resultHandler = NULL; gpx->sio = NULL; // LOGGING if(firstTime) gpx->log = stderr; // CANNED COMMANDS buffer_size_query[3] = calculate_crc((unsigned char *)buffer_size_query + 2, 1); } // PRINT STATE #define start_program() gpx->flag.programState = RUNNING_STATE #define end_program() gpx->flag.programState = ENDED_STATE #define program_is_ready() gpx->flag.programState < RUNNING_STATE #define program_is_running() gpx->flag.programState < ENDED_STATE // IO FUNCTIONS static void write_8(Gpx *gpx, unsigned char value) { *gpx->buffer.ptr++ = value; } static unsigned char read_8(Gpx *gpx) { return *gpx->buffer.ptr++; } static void write_16(Gpx *gpx, uint16_t value) { union { uint16_t s; unsigned char b[2]; } u; u.s = htole16(value); *gpx->buffer.ptr++ = u.b[0]; *gpx->buffer.ptr++ = u.b[1]; } static uint16_t read_16(Gpx *gpx) { union { uint16_t s; unsigned char b[2]; } u; u.b[0] = *gpx->buffer.ptr++; u.b[1] = *gpx->buffer.ptr++; return le16toh(u.s); } static void write_32(Gpx *gpx, uint32_t value) { union { uint32_t i; unsigned char b[4]; } u; u.i = htole32(value); *gpx->buffer.ptr++ = u.b[0]; *gpx->buffer.ptr++ = u.b[1]; *gpx->buffer.ptr++ = u.b[2]; *gpx->buffer.ptr++ = u.b[3]; } static uint32_t read_32(Gpx *gpx) { union { uint32_t i; unsigned char b[4]; } u; u.b[0] = *gpx->buffer.ptr++; u.b[1] = *gpx->buffer.ptr++; u.b[2] = *gpx->buffer.ptr++; u.b[3] = *gpx->buffer.ptr++; return le32toh(u.i); } static void write_fixed_16(Gpx *gpx, float value) { unsigned char b = (unsigned char)value; *gpx->buffer.ptr++ = b; *gpx->buffer.ptr++ = (unsigned char)(int)((value - b)*256.0); } static float read_fixed_16(Gpx *gpx) { unsigned char b[2]; b[0] = *gpx->buffer.ptr++; b[1] = *gpx->buffer.ptr++; gcodeResult(gpx, "(line %u) read_fixed_16 %u, %u" EOL, gpx->lineNumber, (unsigned)b[0], (unsigned)b[1]); return ((float)b[0]) + ((float)b[1])/256.0; } static void write_float(Gpx *gpx, float value) { union { float f; uint32_t i; unsigned char b[4]; } u; u.f = value; u.i = htole32(u.i); *gpx->buffer.ptr++ = u.b[0]; *gpx->buffer.ptr++ = u.b[1]; *gpx->buffer.ptr++ = u.b[2]; *gpx->buffer.ptr++ = u.b[3]; } static float read_float(Gpx *gpx) { union { float f; uint32_t i; unsigned char b[4]; } u; u.b[0] = *gpx->buffer.ptr++; u.b[1] = *gpx->buffer.ptr++; u.b[2] = *gpx->buffer.ptr++; u.b[3] = *gpx->buffer.ptr++; u.i = le32toh(u.i); return u.f; } static long write_bytes(Gpx *gpx, char *data, long length) { long l = length; while(l--) { *gpx->buffer.ptr++ = *data++; } return length; } static long read_bytes(Gpx *gpx, char *data, long length) { long l = length; while(l--) { *data++ = *gpx->buffer.ptr++; } return length; } static long write_string(Gpx *gpx, const char *string, long length) { long l = length; while(l--) { *gpx->buffer.ptr++ = *string++; } *gpx->buffer.ptr++ = '\0'; return length; } // FRAMING static unsigned char calculate_crc(unsigned char *addr, long len) { unsigned char data, crc = 0; while(len--) { data = *addr++; // 8-bit iButton/Maxim/Dallas CRC loop unrolled crc = crc ^ data; // 1 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 2 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 3 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 4 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 5 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 6 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 7 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; // 8 if (crc & 0x01) crc = (crc >> 1) ^ 0x8C; else crc >>= 1; } return crc; } static void begin_frame(Gpx *gpx) { gpx->buffer.ptr = gpx->buffer.out; if(gpx->flag.framingEnabled) { gpx->buffer.out[0] = 0xD5; // synchronization byte gpx->buffer.ptr += 2; } } static int end_frame(Gpx *gpx) { if(gpx->flag.framingEnabled) { unsigned char *start = (unsigned char *)gpx->buffer.out + 2; unsigned char *end = (unsigned char *)gpx->buffer.ptr; size_t payload_length = end - start; gpx->buffer.out[1] = (unsigned char)payload_length; *gpx->buffer.ptr++ = calculate_crc(start, payload_length); } size_t length = gpx->buffer.ptr - gpx->buffer.out; gpx->accumulated.bytes += length; if(gpx->callbackHandler) { return gpx->callbackHandler(gpx, gpx->callbackData, gpx->buffer.out, length); } return SUCCESS; } // set the build name for start_build static void set_build_name(Gpx *gpx, char *buildName) { if(gpx->buildName) free(gpx->buildName); gpx->buildName = NULL; if(buildName) gpx->buildName = strdup(buildName); } // 5D VECTOR FUNCTIONS // compute the filament scaling factor static void set_filament_scale(Gpx *gpx, unsigned extruder_id, double filament_diameter) { double actual_radius = filament_diameter / 2; double nominal_radius = gpx->machine.nominal_filament_diameter / 2; gpx->override[extruder_id].filament_scale = (nominal_radius * nominal_radius) / (actual_radius * actual_radius); } // return the magnitude (length) of the 5D vector static double magnitude(int flag, Ptr5d vector) { double acc = 0.0; if(flag & X_IS_SET) { acc = vector->x * vector->x; } if(flag & Y_IS_SET) { acc += vector->y * vector->y; } if(flag & Z_IS_SET) { acc += vector->z * vector->z; } if(flag & A_IS_SET) { acc += vector->a * vector->a; } if(flag & B_IS_SET) { acc += vector->b * vector->b; } return sqrt(acc); } // return the largest axis in the vector static double largest_axis(int flag, Ptr5d vector) { double length, result = 0.0; if(flag & X_IS_SET) { result = fabs(vector->x); } if(flag & Y_IS_SET) { length = fabs(vector->y); if(result < length) result = length; } if(flag & Z_IS_SET) { length = fabs(vector->z); if(result < length) result = length; } if(flag & A_IS_SET) { length = fabs(vector->a); if(result < length) result = length; } if(flag & B_IS_SET) { length = fabs(vector->b); if(result < length) result = length; } return result; } // calculate the dda for the longest axis for the current machine definition static int get_longest_dda(Gpx *gpx) { // 7 February 2015 // The DDA here is the microseconds/step. So a larger value is slower. // We want the largest value, not the smallest value. (Bug in original GPX) // calculate once int longestDDA = gpx->longestDDA; if(longestDDA == 0) { longestDDA = (int)(60 * 1000000.0 / (gpx->machine.x.max_feedrate * gpx->machine.x.steps_per_mm)); int axisDDA = (int)(60 * 1000000.0 / (gpx->machine.y.max_feedrate * gpx->machine.y.steps_per_mm)); if(longestDDA > axisDDA) longestDDA = axisDDA; axisDDA = (int)(60 * 1000000.0 / (gpx->machine.z.max_feedrate * gpx->machine.z.steps_per_mm)); if(longestDDA > axisDDA) longestDDA = axisDDA; gpx->longestDDA = longestDDA; } return longestDDA; } // return the maximum home feedrate static double get_home_feedrate(Gpx *gpx, int flag) { double feedrate = 0.0; if(flag & X_IS_SET) { feedrate = gpx->machine.x.home_feedrate; } if(flag & Y_IS_SET && feedrate < gpx->machine.y.home_feedrate) { feedrate = gpx->machine.y.home_feedrate; } if(flag & Z_IS_SET && feedrate < gpx->machine.z.home_feedrate) { feedrate = gpx->machine.z.home_feedrate; } return feedrate; } // return the maximum safe feedrate static double get_safe_feedrate(Gpx *gpx, int flag, Ptr5d delta) { double feedrate = gpx->current.feedrate * ((double)gpx->current.speed_factor / 100); if(feedrate == 0.0) { feedrate = gpx->machine.x.max_feedrate; if(feedrate < gpx->machine.y.max_feedrate) { feedrate = gpx->machine.y.max_feedrate; } if(feedrate < gpx->machine.z.max_feedrate) { feedrate = gpx->machine.z.max_feedrate; } if(feedrate < gpx->machine.a.max_feedrate) { feedrate = gpx->machine.a.max_feedrate; } if(feedrate < gpx->machine.b.max_feedrate) { feedrate = gpx->machine.b.max_feedrate; } } double distance = magnitude(flag & XYZ_BIT_MASK, delta); if(flag & X_IS_SET && (feedrate * delta->x / distance) > gpx->machine.x.max_feedrate) { feedrate = gpx->machine.x.max_feedrate * distance / delta->x; } if(flag & Y_IS_SET && (feedrate * delta->y / distance) > gpx->machine.y.max_feedrate) { feedrate = gpx->machine.y.max_feedrate * distance / delta->y; } if(flag & Z_IS_SET && (feedrate * delta->z / distance) > gpx->machine.z.max_feedrate) { feedrate = gpx->machine.z.max_feedrate * distance / delta->z; } if(distance == 0) { if(flag & A_IS_SET && feedrate > gpx->machine.a.max_feedrate) { feedrate = gpx->machine.a.max_feedrate; } if(flag & B_IS_SET && feedrate > gpx->machine.b.max_feedrate) { feedrate = gpx->machine.b.max_feedrate; } } else { if(flag & A_IS_SET && (feedrate * delta->a / distance) > gpx->machine.a.max_feedrate) { feedrate = gpx->machine.a.max_feedrate * distance / delta->a; } if(flag & B_IS_SET && (feedrate * delta->b / distance) > gpx->machine.b.max_feedrate) { feedrate = gpx->machine.b.max_feedrate * distance / delta->b; } } return feedrate; } // convert mm to steps using the current machine definition // IMPORTANT: this command changes the global excess value which accumulates the rounding remainder static Point5d mm_to_steps(Gpx *gpx, Ptr5d mm, Ptr2d excess) { double value; Point5d result; result.x = round(mm->x * gpx->machine.x.steps_per_mm); result.y = round(mm->y * gpx->machine.y.steps_per_mm); result.z = round(mm->z * gpx->machine.z.steps_per_mm); if(excess) { // accumulate rounding remainder value = (mm->a * gpx->machine.a.steps_per_mm) + excess->a; result.a = round(value); // changes to excess excess->a = value - result.a; value = (mm->b * gpx->machine.b.steps_per_mm) + excess->b; result.b = round(value); // changes to excess excess->b = value - result.b; } else { result.a = round(mm->a * gpx->machine.a.steps_per_mm); result.b = round(mm->b * gpx->machine.b.steps_per_mm); } return result; } static Point5d delta_mm(Gpx *gpx) { Point5d deltaMM; // compute the relative distance traveled along each axis if(gpx->command.flag & X_IS_SET) deltaMM.x = gpx->target.position.x - gpx->current.position.x; else deltaMM.x = 0; if(gpx->command.flag & Y_IS_SET) deltaMM.y = gpx->target.position.y - gpx->current.position.y; else deltaMM.y = 0; if(gpx->command.flag & Z_IS_SET) deltaMM.z = gpx->target.position.z - gpx->current.position.z; else deltaMM.z = 0; if(gpx->command.flag & A_IS_SET) deltaMM.a = (gpx->target.position.a - gpx->current.position.a) * gpx->override[A].extrusion_factor / 100; else deltaMM.a = 0; if(gpx->command.flag & B_IS_SET) deltaMM.b = (gpx->target.position.b - gpx->current.position.b) * gpx->override[B].extrusion_factor / 100; else deltaMM.b = 0; return deltaMM; } static Point5d delta_steps(Gpx *gpx,Point5d deltaMM) { Point5d deltaSteps; // Convert the relative distance traveled along each axis from units of mm to steps if(gpx->command.flag & X_IS_SET) deltaSteps.x = round(fabs(deltaMM.x) * gpx->machine.x.steps_per_mm); else deltaSteps.x = 0; if(gpx->command.flag & Y_IS_SET) deltaSteps.y = round(fabs(deltaMM.y) * gpx->machine.y.steps_per_mm); else deltaSteps.y = 0; if(gpx->command.flag & Z_IS_SET) deltaSteps.z = round(fabs(deltaMM.z) * gpx->machine.z.steps_per_mm); else deltaSteps.z = 0; if(gpx->command.flag & A_IS_SET) deltaSteps.a = round(fabs(deltaMM.a) * gpx->machine.a.steps_per_mm); else deltaSteps.a = 0; if(gpx->command.flag & B_IS_SET) deltaSteps.b = round(fabs(deltaMM.b) * gpx->machine.b.steps_per_mm); else deltaSteps.b = 0; return deltaSteps; } // X3G QUERIES #define COMMAND_OFFSET 2 #define EXTRUDER_ID_OFFSET 3 #define QUERY_COMMAND_OFFSET 4 #define EEPROM_LENGTH_OFFSET 5 // 00 - Get version static int get_version(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 0); // uint16: host version write_16(gpx, HOST_VERSION); return end_frame(gpx); } /* 01 - Initialize firmware to boot state This is treated as a NOOP in the Sailfish firmware. */ static int initialize_firmware(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 1); return end_frame(gpx); } // 02 - Get available buffer size static int get_buffer_size(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 2); return end_frame(gpx); } // 03 - Clear buffer (same as 07 and 17) int clear_buffer(Gpx *gpx) { begin_frame(gpx); gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; write_8(gpx, 3); return end_frame(gpx); } // 07 - Abort immediately int abort_immediately(Gpx *gpx) { begin_frame(gpx); gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; write_8(gpx, 7); return end_frame(gpx); } // 08 - Pause/Resume int pause_resume(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 8); return end_frame(gpx); } // 10 - Extruder Query Commands // Query 00 - Query firmware version information static int get_extruder_version(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 0); // uint8: Length of the extruder command payload (N) write_8(gpx, 2); // uint16: host version write_16(gpx, HOST_VERSION); return end_frame(gpx); } // Query 02 - Get extruder temperature static int get_extruder_temperature(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 2); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 22 - Is extruder ready int is_extruder_ready(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 22); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 30 - Get build platform temperature static int get_build_platform_temperature(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 30); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 32 - Get extruder target temperature static int get_extruder_target_temperature(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 32); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 33 - Get build platform target temperature static int get_build_platform_target_temperature(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 33); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 35 - Is build platform ready? int is_build_platform_ready(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 35); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 36 - Get extruder status static int get_extruder_status(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 36); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // Query 37 - Get PID state static int get_PID_state(Gpx *gpx, unsigned extruder_id) { begin_frame(gpx); write_8(gpx, 10); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Query command to send to the extruder write_8(gpx, 37); // uint8: Length of the extruder command payload (N) write_8(gpx, 0); return end_frame(gpx); } // 11 - Is ready int is_ready(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 11); return end_frame(gpx); } // 12 - Read from EEPROM int read_eeprom(Gpx *gpx, unsigned address, unsigned length) { SHOW( fprintf(gpx->log, "Reading EEPROM address %u length %u\n", address, length) ); begin_frame(gpx); write_8(gpx, 12); // uint16: EEPROM memory offset to begin reading from write_16(gpx, address); // uint8: Number of bytes to read, N. write_8(gpx, length); return end_frame(gpx); } // 13 - Write to EEPROM int write_eeprom(Gpx *gpx, unsigned address, char *data, unsigned length) { SHOW( fprintf(gpx->log, "Writing EEPROM address %u length %u\n", address, length) ); begin_frame(gpx); write_8(gpx, 13); // uint16: EEPROM memory offset to begin writing to write_16(gpx, address); // uint8: Number of bytes to write write_8(gpx, length); // N bytes: Data to write to EEPROM write_bytes(gpx, data, length); return end_frame(gpx); } // 14 - Capture to file static int capture_to_file(Gpx *gpx, char *filename) { begin_frame(gpx); write_8(gpx, 14); /* 1+N bytes: Filename to write to, in ASCII, terminated with a null character. N can be 1-12 bytes long, not including the null character. */ write_string(gpx, filename, strlen(filename)); return end_frame(gpx); } // 15 - End capture to file static int end_capture_to_file(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 15); return end_frame(gpx); } // 16 - Play back capture static int play_back_capture(Gpx *gpx, char *filename) { begin_frame(gpx); write_8(gpx, 16); /* 1+N bytes: Filename to write to, in ASCII, terminated with a null character. N can be 1-12 bytes long, not including the null character. */ write_string(gpx, filename, strlen(filename)); return end_frame(gpx); } static int select_filename(Gpx *gpx, char *filename) { if(gpx->selectedFilename != NULL) { free(gpx->selectedFilename); gpx->selectedFilename = NULL; } gpx->selectedFilename = strdup(filename); if(gpx->selectedFilename == NULL) return EOSERROR; if(gpx->callbackHandler) return gpx->callbackHandler(gpx, gpx->callbackData, gpx->buffer.out, 0); return SUCCESS; } // 17 - Reset static int reset(Gpx *gpx) { begin_frame(gpx); gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; write_8(gpx, 17); return end_frame(gpx); } // 18 - Get next filename int get_next_filename(Gpx *gpx, unsigned restart) { begin_frame(gpx); write_8(gpx, 18); // uint8: 0 if file listing should continue, 1 to restart listing. write_8(gpx, restart); return end_frame(gpx); } // 20 - Get build name static int get_build_name(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 20); return end_frame(gpx); } // 21 - Get extended position int get_extended_position(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 21); return end_frame(gpx); } // 22 - Extended stop int extended_stop(Gpx *gpx, unsigned halt_steppers, unsigned clear_queue) { unsigned flag = 0; if(halt_steppers) flag |= 0x1; if(clear_queue) flag |= 0x2; gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; begin_frame(gpx); write_8(gpx, 22); /* uint8: Bitfield indicating which subsystems to shut down. If bit 0 is set, halt all stepper motion. If bit 1 is set, clear the command queue. */ write_8(gpx, flag); return end_frame(gpx); } // 23 - Get motherboard status int get_motherboard_status(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 23); return end_frame(gpx); } // 24 - Get build statistics int get_build_statistics(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 24); return end_frame(gpx); } // 27 - Get advanced version number int get_advanced_version_number(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 27); // uint16: Host version write_16(gpx, HOST_VERSION); return end_frame(gpx); } // X3G COMMANDS // 131 - Find axes minimums // 132 - Find axes maximums static int home_axes(Gpx *gpx, unsigned axes, unsigned direction) { Point5d unitVector; double feedrate = gpx->command.flag & F_IS_SET ? gpx->current.feedrate : get_home_feedrate(gpx, gpx->command.flag); double longestAxis = 0.0; assert(direction <= 1); // compute the slowest feedrate if(axes & X_IS_SET) { if(gpx->machine.x.home_feedrate < feedrate) { feedrate = gpx->machine.x.home_feedrate; } unitVector.x = 1; longestAxis = gpx->machine.x.steps_per_mm; // confirm machine compatibility if(direction != gpx->machine.x.endstop) { gcodeResult(gpx, "(line %u) Semantic warning: X axis homing to %s endstop" EOL, gpx->lineNumber, direction ? "maximum" : "minimum"); } } if(axes & Y_IS_SET) { if(gpx->machine.y.home_feedrate < feedrate) { feedrate = gpx->machine.y.home_feedrate; } unitVector.y = 1; if(longestAxis < gpx->machine.y.steps_per_mm) { longestAxis = gpx->machine.y.steps_per_mm; } if(direction != gpx->machine.y.endstop) { gcodeResult(gpx, "(line %u) Semantic warning: Y axis homing to %s endstop" EOL, gpx->lineNumber, direction ? "maximum" : "minimum"); } } if(axes & Z_IS_SET) { if(gpx->machine.z.home_feedrate < feedrate) { feedrate = gpx->machine.z.home_feedrate; } unitVector.z = 1; if(longestAxis < gpx->machine.z.steps_per_mm) { longestAxis = gpx->machine.z.steps_per_mm; } if(direction != gpx->machine.z.endstop) { gcodeResult(gpx, "(line %u) Semantic warning: Z axis homing to %s endstop" EOL, gpx->lineNumber, direction ? "maximum" : "minimum"); } } // unit vector distance in mm double distance = magnitude(axes, &unitVector); // move duration in microseconds = distance / feedrate * 60,000,000 double microseconds = distance / feedrate * 60000000.0; // time between steps for longest axis = microseconds / longestStep unsigned step_delay = (unsigned)round(microseconds / longestAxis); gpx->accumulated.time += distance / feedrate * 60; begin_frame(gpx); write_8(gpx, direction == ENDSTOP_IS_MIN ? 131 :132); // uint8: Axes bitfield. Axes whose bits are set will be moved. write_8(gpx, axes); // uint32: Feedrate, in microseconds between steps on the max delta. (DDA) write_32(gpx, step_delay); // uint16: Timeout, in seconds. write_16(gpx, gpx->machine.timeout); return end_frame(gpx); } // 133 - delay int delay(Gpx *gpx, unsigned milliseconds) { begin_frame(gpx); write_8(gpx, 133); // uint32: delay, in milliseconds write_32(gpx, milliseconds); return end_frame(gpx); } // 134 - Change extruder offset // This is important to use on dual-head Replicators, because the machine needs to know // the current toolhead in order to apply a calibration offset. static int change_extruder_offset(Gpx *gpx, unsigned extruder_id) { assert(extruder_id < gpx->machine.extruder_count); begin_frame(gpx); write_8(gpx, 134); // uint8: ID of the extruder to switch to write_8(gpx, extruder_id); return end_frame(gpx); } // 135 - Wait for extruder ready static int wait_for_extruder(Gpx *gpx, unsigned extruder_id, unsigned timeout) { assert(extruder_id < gpx->machine.extruder_count); begin_frame(gpx); write_8(gpx, 135); // uint8: ID of the extruder to wait for write_8(gpx, extruder_id); // uint16: delay between query packets sent to the extruder, in ms (nominally 100 ms) write_16(gpx, 100); // uint16: Timeout before continuing without extruder ready, in seconds (nominally 1 minute) write_16(gpx, timeout); return end_frame(gpx); } // 136 - extruder action command // Action 03 - Set extruder target temperature int set_nozzle_temperature(Gpx *gpx, unsigned extruder_id, unsigned temperature) { assert(extruder_id < gpx->machine.extruder_count); double tDelta = (double)temperature - (double)gpx->tool[extruder_id].nozzle_temperature - AMBIENT_TEMP; if(tDelta > 0.0) { gpx->accumulated.time += tDelta * NOZZLE_TIME; } begin_frame(gpx); write_8(gpx, 136); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Action command to send to the extruder write_8(gpx, 3); // uint8: Length of the extruder command payload (N) write_8(gpx, 2); // int16: Desired target temperature, in Celsius write_16(gpx, temperature); return end_frame(gpx); } // Action 12 - Enable / Disable fan static int set_fan(Gpx *gpx, unsigned extruder_id, unsigned state) { assert(extruder_id < gpx->machine.extruder_count); begin_frame(gpx); write_8(gpx, 136); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Action command to send to the extruder write_8(gpx, 12); // uint8: Length of the extruder command payload (N) write_8(gpx, 1); // uint8: 1 to enable, 0 to disable write_8(gpx, state); return end_frame(gpx); } // Action 13 - Enable / Disable extra output (blower fan) /* WARNING: If you are using Gen 4 electronics (e.g. a Thing-o-Matic or a heavily modified Cupcake), THEN DO NOT USE M126 / M127. It can trigger a bug in the Gen 4 Extruder Controller firmware that will cause the HBP temperature to go wild. Note that the Extruder Controller is a separate uprocessor on a separate board. It has it's own firmware. It's not clear if the bug is firmware-only or if there is a problem with electronics as well (e.g. the HBP FET sees some residual current from the EXTRA FET and its Vgs/Igs threshold is met and it activates). But, there's no fix for the bug since no one has invested the time in diagnosing this Extruder Controller issue. - dnewman 22/11/2013 */ static int set_valve(Gpx *gpx, unsigned extruder_id, unsigned state) { assert(extruder_id < gpx->machine.extruder_count); if(gpx->machine.id >= MACHINE_TYPE_REPLICATOR_1) { begin_frame(gpx); write_8(gpx, 136); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Action command to send to the extruder write_8(gpx, 13); // uint8: Length of the extruder command payload (N) write_8(gpx, 1); // uint8: 1 to enable, 0 to disable write_8(gpx, state); return end_frame(gpx); } else if(gpx->flag.logMessages) { gcodeResult(gpx, "(line %u) Semantic warning: ignoring M126/M127 with Gen 4 extruder electronics" EOL, gpx->lineNumber); } return SUCCESS; } // Action 27 - Enable / Disable Automated Build Platform (ABP) // Note: MBI usurped command code 27 when they introduced the // "advanced version" command. So, this is the OLD // X3G command 27. static int set_abp(Gpx *gpx, unsigned extruder_id, unsigned state) { assert(extruder_id < gpx->machine.extruder_count); if(gpx->machine.id < MACHINE_TYPE_REPLICATOR_1) { begin_frame(gpx); write_8(gpx, 136); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Action command to send to the extruder write_8(gpx, 27); // uint8: Length of the extruder command payload (N) write_8(gpx, 1); // uint8: 1 to enable, 0 to disable write_8(gpx, state); return end_frame(gpx); } else if(gpx->flag.logMessages) { gcodeResult(gpx, "(line %u) Semantic warning: command to toggle the Automated Build Platform's conveyor (ABP); not supported on non-Gen 3 and Gen 4 electronics" EOL, gpx->lineNumber); } return SUCCESS; } // Action 31 - Set build platform target temperature int set_build_platform_temperature(Gpx *gpx, unsigned extruder_id, unsigned temperature) { assert(extruder_id < gpx->machine.extruder_count); double tDelta = (double)temperature - (double)gpx->tool[extruder_id].build_platform_temperature - AMBIENT_TEMP; if(tDelta > 0.0) { gpx->accumulated.time += tDelta * HBP_TIME; } begin_frame(gpx); write_8(gpx, 136); // uint8: ID of the extruder to query write_8(gpx, extruder_id); // uint8: Action command to send to the extruder write_8(gpx, 31); // uint8: Length of the extruder command payload (N) write_8(gpx, 2); // int16: Desired target temperature, in Celsius write_16(gpx, temperature); return end_frame(gpx); } // 137 - Enable / Disable axes steppers static int set_steppers(Gpx *gpx, unsigned axes, unsigned state) { unsigned bitfield = axes & AXES_BIT_MASK; if(state) { bitfield |= 0x80; } begin_frame(gpx); write_8(gpx, 137); // uint8: Bitfield codifying the command (see below) write_8(gpx, bitfield); return end_frame(gpx); } // 139 - Queue absolute point static int queue_absolute_point(Gpx *gpx) { double feedrate; long longestDDA = gpx->longestDDA ? gpx->longestDDA : get_longest_dda(gpx); Point5d steps = mm_to_steps(gpx, &gpx->target.position, &gpx->excess); feedrate = gpx->current.feedrate * ((double)gpx->current.speed_factor / 100); // 7 February 2015 // Fix issue #12 whereby an unaccelerated move may move far too fast if (feedrate > 0) { // Seconds for the move is steps-needed / steps-per-mm / feedrate // DDA is then 60 * 1000000 * seconds / steps-needed // Thus DDA is 60 * 1000000 * steps-needed / (steps-per-mm * feedrate) / steps-needed // DDA = 60 * 1000000 / (steps-per-mm * feedrate) if (steps.x) { long DDA = (long)(60.0 * 1000000.0 / (gpx->machine.x.steps_per_mm * feedrate)); if (DDA > longestDDA) longestDDA = DDA; } if (steps.y) { long DDA = (long)(60.0 * 1000000.0 / (gpx->machine.y.steps_per_mm * feedrate)); if (DDA > longestDDA) longestDDA = DDA; } if (steps.z) { long DDA = (long)(60.0 * 1000000.0 / (gpx->machine.z.steps_per_mm * feedrate)); if (DDA > longestDDA) longestDDA = DDA; } if (steps.a) { long DDA = (long)(60.0 * 1000000.0 / (gpx->machine.a.steps_per_mm * feedrate)); if (DDA > longestDDA) longestDDA = DDA; } if (steps.b) { long DDA = (long)(60.0 * 1000000.0 / (gpx->machine.b.steps_per_mm * feedrate)); if (DDA > longestDDA) longestDDA = DDA; } } // Safety measure: don't send a DDA interval of 0 -- that's telling // the bot to step as fast as it possibly can if (longestDDA <= 0) longestDDA = 200; begin_frame(gpx); write_8(gpx, 139); // int32: X coordinate, in steps write_32(gpx, (int)steps.x); // int32: Y coordinate, in steps write_32(gpx, (int)steps.y); // int32: Z coordinate, in steps write_32(gpx, (int)steps.z); // int32: A coordinate, in steps write_32(gpx, -(int)steps.a); // int32: B coordinate, in steps write_32(gpx, -(int)steps.b); // uint32: Feedrate, in microseconds between steps on the max delta. (DDA) write_32(gpx, (int)longestDDA); // reset current position gpx->axis.positionKnown = gpx->axis.mask; return end_frame(gpx); } // 140 - Set extended position int set_position(Gpx *gpx) { Point5d steps = mm_to_steps(gpx, &gpx->current.position, NULL); begin_frame(gpx); write_8(gpx, 140); // int32: X position, in steps write_32(gpx, (int)steps.x); // int32: Y position, in steps write_32(gpx, (int)steps.y); // int32: Z position, in steps write_32(gpx, (int)steps.z); // int32: A position, in steps write_32(gpx, (int)steps.a); // int32: B position, in steps write_32(gpx, (int)steps.b); return end_frame(gpx); } // 141 - Wait for build platform ready static int wait_for_build_platform(Gpx *gpx, unsigned extruder_id, int timeout) { assert(extruder_id < gpx->machine.extruder_count); begin_frame(gpx); write_8(gpx, 141); // uint8: ID of the extruder platform to wait for write_8(gpx, extruder_id); // uint16: delay between query packets sent to the extruder, in ms (nominally 100 ms) write_16(gpx, 100); // uint16: Timeout before continuing without extruder ready, in seconds (nominally 1 minute) write_16(gpx, timeout); return end_frame(gpx); } // 142 - Queue extended point, new style #if ENABLE_SIMULATED_RPM static int queue_new_point(Gpx *gpx, unsigned milliseconds) { Point5d target; // the function is only called by dwell, which is by definition stationary, // so set zero relative position change target.x = 0; target.y = 0; target.z = 0; target.a = 0; target.b = 0; // if we have a G4 dwell and either the a or b motor is on, 'simulate' a 5D extrusion distance if(gpx->tool[A].motor_enabled && gpx->tool[A].rpm) { double maxrpm = gpx->machine.a.max_feedrate * gpx->machine.a.steps_per_mm / gpx->machine.a.motor_steps; double rpm = gpx->tool[A].rpm > maxrpm ? maxrpm : gpx->tool[A].rpm; double minutes = milliseconds / 60000.0; // minute * revolution/minute double numRevolutions = minutes * (gpx->tool[A].motor_enabled > 0 ? rpm : -rpm); // steps/revolution * mm/steps double mmPerRevolution = gpx->machine.a.motor_steps * (1 / gpx->machine.a.steps_per_mm); target.a = -(numRevolutions * mmPerRevolution); gpx->command.flag |= A_IS_SET; gpx->accumulated.a += fabs(target.a); } if(gpx->tool[B].motor_enabled && gpx->tool[B].rpm) { double maxrpm = gpx->machine.b.max_feedrate * gpx->machine.b.steps_per_mm / gpx->machine.b.motor_steps; double rpm = gpx->tool[B].rpm > maxrpm ? maxrpm : gpx->tool[B].rpm; double minutes = milliseconds / 60000.0; // minute * revolution/minute double numRevolutions = minutes * (gpx->tool[B].motor_enabled > 0 ? rpm : -rpm); // steps/revolution * mm/steps double mmPerRevolution = gpx->machine.b.motor_steps * (1 / gpx->machine.b.steps_per_mm); target.b = -(numRevolutions * mmPerRevolution); gpx->command.flag |= B_IS_SET; gpx->accumulated.b += fabs(target.a); } Point5d steps = mm_to_steps(gpx, &target, &gpx->excess); gpx->accumulated.time += (milliseconds / 1000.0) * ACCELERATION_TIME; begin_frame(gpx); write_8(gpx, 142); // int32: X coordinate, in steps write_32(gpx, (int)steps.x); // int32: Y coordinate, in steps write_32(gpx, (int)steps.y); // int32: Z coordinate, in steps write_32(gpx, (int)steps.z); // int32: A coordinate, in steps write_32(gpx, (int)steps.a); // int32: B coordinate, in steps write_32(gpx, (int)steps.b); // uint32: Duration of the movement, in microseconds write_32(gpx, milliseconds * 1000.0); // uint8: Axes bitfield to specify which axes are relative. Any axis with a bit set should make a relative movement. write_8(gpx, AXES_BIT_MASK); return end_frame(gpx); } #endif // 143 - Store home positions static int store_home_positions(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 143); // uint8: Axes bitfield to specify which axes' positions to store. // Any axis with a bit set should have its position stored. write_8(gpx, gpx->command.flag & AXES_BIT_MASK); return end_frame(gpx); } // 144 - Recall home positions static int recall_home_positions(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 144); // uint8: Axes bitfield to specify which axes' positions to recall. // Any axis with a bit set should have its position recalled. write_8(gpx, gpx->command.flag & AXES_BIT_MASK); return end_frame(gpx); } // 145 - Set digital potentiometer value static int set_pot_value(Gpx *gpx, unsigned axis, unsigned value) { assert(axis <= 4); begin_frame(gpx); write_8(gpx, 145); // uint8: axis value (valid range 0-4) which axis pot to set write_8(gpx, axis); // uint8: value (valid range 0-255) write_8(gpx, value); return end_frame(gpx); } // 146 - Set RGB LED value static int set_LED(Gpx *gpx, unsigned red, unsigned green, unsigned blue, unsigned blink) { begin_frame(gpx); write_8(gpx, 146); // uint8: red value (all pix are 0-255) write_8(gpx, red); // uint8: green write_8(gpx, green); // uint8: blue write_8(gpx, blue); // uint8: blink rate (0-255 valid) write_8(gpx, blink); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } static int set_LED_RGB(Gpx *gpx, unsigned rgb, unsigned blink) { begin_frame(gpx); write_8(gpx, 146); // uint8: red value (all pix are 0-255) write_8(gpx, (rgb >> 16) & 0xFF); // uint8: green write_8(gpx, (rgb >> 8) & 0xFF); // uint8: blue write_8(gpx, rgb & 0xFF); // uint8: blink rate (0-255 valid) write_8(gpx, blink); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } // 147 - Set Beep static int set_beep(Gpx *gpx, unsigned frequency, unsigned milliseconds) { begin_frame(gpx); write_8(gpx, 147); // uint16: frequency write_16(gpx, frequency); // uint16: buzz length in ms write_16(gpx, milliseconds); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } // 148 - Pause for button #define BUTTON_CENTER 0x01 #define BUTTON_RIGHT 0x02 #define BUTTON_LEFT 0x04 #define BUTTON_DOWN 0x08 #define BUTTON_UP 0x10 #define BUTTON_RESET 0x20 // Button options #define READY_ON_TIMEOUT 0x01 // change to ready state on timeout #define RESET_ON_TIMEOUT 0x02 // reset on timeout #define CLEAR_ON_PRESS 0x04 // clear screen on button press static int wait_for_button(Gpx *gpx, int button, unsigned timeout, int button_options) { begin_frame(gpx); write_8(gpx, 148); // uint8: Bit field of buttons to wait for write_8(gpx, button); // uint16: Timeout, in seconds. A value of 0 indicates that the command should not time out. write_16(gpx, timeout); // uint8: Options bitfield write_8(gpx, button_options); return end_frame(gpx); } // 149 - Display message to LCD static int display_message(Gpx *gpx, char *message, unsigned vPos, unsigned hPos, unsigned timeout, int wait_for_button) { assert(vPos < 4); assert(hPos < 20); int rval; long bytesSent = 0; unsigned bitfield = 0; unsigned seconds = 0; unsigned maxLength = hPos ? 20 - hPos : 20; // clip string so it fits in 4 x 20 lcd display buffer long length = strlen(message); if(vPos || hPos) { if(length > maxLength) length = maxLength; bitfield |= 0x01; //do not clear flag } else { if(length > 80) length = 80; } while(bytesSent < length) { if(bytesSent + maxLength >= length) { seconds = timeout; bitfield |= 0x02; // last message in group if(wait_for_button) { bitfield |= 0x04; } } if(bytesSent > 0) { bitfield |= 0x01; //do not clear flag } begin_frame(gpx); write_8(gpx, 149); // uint8: Options bitfield (see below) write_8(gpx, bitfield); // uint8: Horizontal position to display the message at (commonly 0-19) write_8(gpx, hPos); // uint8: Vertical position to display the message at (commonly 0-3) write_8(gpx, vPos); // uint8: Timeout, in seconds. If 0, this message will left on the screen write_8(gpx, seconds); // 1+N bytes: Message to write to the screen, in ASCII, terminated with a null character. long rowLength = length - bytesSent; bytesSent += write_string(gpx, message + bytesSent, rowLength < maxLength ? rowLength : maxLength); CALL( end_frame(gpx) ); } return SUCCESS; } // 150 - Set Build Percentage int set_build_progress(Gpx *gpx, unsigned percent) { if(percent > 100) percent = 100; gpx->current.percent = percent; begin_frame(gpx); write_8(gpx, 150); // uint8: percent (0-100) write_8(gpx, percent); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } // 151 - Queue Song static int queue_song(Gpx *gpx, unsigned song_id) { // song ID 0: error tone with 4 cycles // song ID 1: done tone // song ID 2: error tone with 2 cycles assert(song_id <= 2); begin_frame(gpx); write_8(gpx, 151); // uint8: songID: select from a predefined list of songs write_8(gpx, song_id); return end_frame(gpx); } // 152 - Reset to factory defaults static int factory_defaults(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 152); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } // 153 - Build start notification static int start_build(Gpx *gpx, const char * filename) { size_t len; begin_frame(gpx); write_8(gpx, 153); // uint32: 0 (reserved for future use) write_32(gpx, 0); // 1+N bytes: Name of the build, in ASCII, null terminated // 32 bytes max in a payload // 4 bytes used for "reserved" // 1 byte used for NUL terminator // that leaves 27 bytes for the build name // (But the LCD actually has far less room) // We'll just truncate at 24 if(!filename) filename = PACKAGE_STRING; len = strlen(filename); if(len > 24) len = 24; write_string(gpx, filename, len); return end_frame(gpx); } // 154 - Build end notification int end_build(Gpx *gpx) { begin_frame(gpx); write_8(gpx, 154); // uint8: 0 (reserved for future use) write_8(gpx, 0); return end_frame(gpx); } // 155 - Queue extended point x3g // IMPORTANT: this command updates the parser state static int queue_ext_point(Gpx *gpx, double feedrate, Ptr5d delta, int relative) { /* If we don't know our previous position on a command axis, we can't calculate the feedrate or distance correctly, so we use an unaccelerated command with a fixed DDA. */ // Unless we're in relative mode in which case we'll issue a relative move // Or if one of the unknown axes was not specified by this command in which // case we don't know where to tell 139 to go, so we'll use a 0 relative move on // those axes here (see markwal/GPX#1) unsigned mask = gpx->command.flag & gpx->axis.mask; unsigned stillUnknown = (~(gpx->axis.positionKnown | mask)) & gpx->axis.mask; if((gpx->axis.positionKnown & mask) != mask && !relative && !stillUnknown) { return queue_absolute_point(gpx); } Point5d deltaMM; if (stillUnknown || relative) deltaMM = *delta; else deltaMM = delta_mm(gpx); Point5d deltaSteps = delta_steps(gpx, deltaMM); // check that we have actually moved on at least one axis when the move is // rounded down to the nearest step if(magnitude(gpx->command.flag, &deltaSteps) > 0) { double distance = magnitude(gpx->command.flag & XYZ_BIT_MASK, &deltaMM); // are we moving and extruding? if(gpx->flag.rewrite5D && (gpx->command.flag & (A_IS_SET|B_IS_SET)) && distance > 0.0001) { double filament_radius, packing_area, packing_scale; if(A_IS_SET && deltaMM.a > 0.0001) { if(gpx->override[A].actual_filament_diameter > 0.0001) { filament_radius = gpx->override[A].actual_filament_diameter / 2; packing_area = M_PI * filament_radius * filament_radius * gpx->override[A].packing_density; } else { filament_radius = gpx->machine.nominal_filament_diameter / 2; packing_area = M_PI * filament_radius * filament_radius * gpx->machine.nominal_packing_density; } packing_scale = gpx->machine.nozzle_diameter * gpx->layerHeight / packing_area; if(deltaMM.a > 0) { deltaMM.a = distance * packing_scale; } else { deltaMM.a = -(distance * packing_scale); } deltaMM.a *= ((double)gpx->override[A].extrusion_factor / 100); if(gpx->axis.positionKnown & A_IS_SET) gpx->target.position.a = gpx->current.position.a + deltaMM.a; deltaSteps.a = round(fabs(deltaMM.a) * gpx->machine.a.steps_per_mm); } if(B_IS_SET && deltaMM.b > 0.0001) { if(gpx->override[B].actual_filament_diameter > 0.0001) { filament_radius = gpx->override[B].actual_filament_diameter / 2; packing_area = M_PI * filament_radius * filament_radius * gpx->override[A].packing_density; } else { filament_radius = gpx->machine.nominal_filament_diameter / 2; packing_area = M_PI * filament_radius * filament_radius * gpx->machine.nominal_packing_density; } packing_scale = gpx->machine.nozzle_diameter * gpx->layerHeight / packing_area; if(deltaMM.b > 0) { deltaMM.b = distance * packing_scale; } else { deltaMM.b = -(distance * packing_scale); } deltaMM.b *= ((double)gpx->override[B].extrusion_factor / 100); if(gpx->axis.positionKnown & B_IS_SET) gpx->target.position.b = gpx->current.position.b + deltaMM.b; deltaSteps.b = round(fabs(deltaMM.b) * gpx->machine.b.steps_per_mm); } } Point5d target = relative ? *delta : gpx->target.position; if (stillUnknown) { if (stillUnknown & X_IS_SET) target.x = 0; if (stillUnknown & Y_IS_SET) target.y = 0; if (stillUnknown & Z_IS_SET) target.z = 0; } target.a = -deltaMM.a; target.b = -deltaMM.b; gpx->accumulated.a += deltaMM.a; gpx->accumulated.b += deltaMM.b; deltaMM.x = fabs(deltaMM.x); deltaMM.y = fabs(deltaMM.y); deltaMM.z = fabs(deltaMM.z); deltaMM.a = fabs(deltaMM.a); deltaMM.b = fabs(deltaMM.b); feedrate = get_safe_feedrate(gpx, gpx->command.flag, &deltaMM); double minutes = distance / feedrate; if(minutes == 0) { distance = 0; if(gpx->command.flag & A_IS_SET) { distance = deltaMM.a; } if(gpx->command.flag & B_IS_SET && distance < deltaMM.b) { distance = deltaMM.b; } minutes = distance / feedrate; } //convert feedrate to mm/sec feedrate /= 60.0; #if ENABLE_SIMULATED_RPM // if either a or b is 0, but their motor is on and turning, 'simulate' a 5D extrusion distance if(deltaMM.a == 0.0 && gpx->tool[A].motor_enabled && gpx->tool[A].rpm) { double maxrpm = gpx->machine.a.max_feedrate * gpx->machine.a.steps_per_mm / gpx->machine.a.motor_steps; double rpm = gpx->tool[A].rpm > maxrpm ? maxrpm : gpx->tool[A].rpm; // minute * revolution/minute double numRevolutions = minutes * (gpx->tool[A].motor_enabled > 0 ? rpm : -rpm); // steps/revolution * mm/steps double mmPerRevolution = gpx->machine.a.motor_steps * (1 / gpx->machine.a.steps_per_mm); // set distance deltaMM.a = numRevolutions * mmPerRevolution; deltaSteps.a = round(fabs(deltaMM.a) * gpx->machine.a.steps_per_mm); target.a = -deltaMM.a; } else { // disable RPM as soon as we begin 5D printing gpx->tool[A].rpm = 0; } if(deltaMM.b == 0.0 && gpx->tool[B].motor_enabled && gpx->tool[B].rpm) { double maxrpm = gpx->machine.b.max_feedrate * gpx->machine.b.steps_per_mm / gpx->machine.b.motor_steps; double rpm = gpx->tool[B].rpm > maxrpm ? maxrpm : gpx->tool[B].rpm; // minute * revolution/minute double numRevolutions = minutes * (gpx->tool[B].motor_enabled > 0 ? rpm : -rpm); // steps/revolution * mm/steps double mmPerRevolution = gpx->machine.b.motor_steps * (1 / gpx->machine.b.steps_per_mm); // set distance deltaMM.b = numRevolutions * mmPerRevolution; deltaSteps.b = round(fabs(deltaMM.b) * gpx->machine.b.steps_per_mm); target.b = -deltaMM.b; } else { // disable RPM as soon as we begin 5D printing gpx->tool[B].rpm = 0; } #endif Point5d steps = mm_to_steps(gpx, &target, &gpx->excess); // Total time required for the motion in units of microseconds double usec = (60000000.0L * minutes); // Time interval between steps along the axis with the highest step count // total-time / highest-step-count // Has units of microseconds per step double dda_interval = usec / largest_axis(gpx->command.flag, &deltaSteps); // Convert dda_interval into dda_rate (dda steps per second on the longest axis) // steps-per-microsecond * 1000000 us/s = 1000000 * (1 / dda_interval) double dda_rate = 1000000.0L / dda_interval; gpx->accumulated.time += (minutes * 60) * ACCELERATION_TIME; begin_frame(gpx); write_8(gpx, 155); // int32: X coordinate, in steps write_32(gpx, (int)steps.x); // int32: Y coordinate, in steps write_32(gpx, (int)steps.y); // int32: Z coordinate, in steps write_32(gpx, (int)steps.z); // int32: A coordinate, in steps write_32(gpx, (int)steps.a); // int32: B coordinate, in steps write_32(gpx, (int)steps.b); // uint32: DDA Feedrate, in steps/s write_32(gpx, (unsigned)dda_rate); // uint8: Axes bitfield to specify which axes are relative. Any axis with a bit set should make a relative movement. write_8(gpx, relative ? AXES_BIT_MASK : stillUnknown|A_IS_SET|B_IS_SET); // float (single precision, 32 bit): mm distance for this move. normal of XYZ if any of these axes are active, and AB for extruder only moves write_float(gpx, (float)distance); // uint16: feedrate in mm/s, multiplied by 64 to assist fixed point calculation on the bot write_16(gpx, (unsigned)(feedrate * 64.0)); return end_frame(gpx); } return SUCCESS; } // 156 - Set segment acceleration static int set_acceleration(Gpx *gpx, int state) { begin_frame(gpx); write_8(gpx, 156); // uint8: 1 to enable, 0 to disable write_8(gpx, state); return end_frame(gpx); } // 157 - Stream Version static int stream_version(Gpx *gpx) { if(gpx->machine.id >= MACHINE_TYPE_REPLICATOR_1) { begin_frame(gpx); write_8(gpx, 157); // uint8: x3g version high byte write_8(gpx, STREAM_VERSION_HIGH); // uint8: x3g version low byte write_8(gpx, STREAM_VERSION_LOW); // uint8: not implemented write_8(gpx, 0); // uint32: not implemented write_32(gpx, 0); // uint16: bot type: PID for the intended bot is sent // Repliator 2/2X (Might Two) if(gpx->machine.id >= MACHINE_TYPE_REPLICATOR_2) { write_16(gpx, 0xB015); } // Replicator (Might One) else { write_16(gpx, 0xD314); } // uint16: not implemented write_16(gpx, 0); // uint32: not implemented write_32(gpx, 0); // uint32: not implemented write_32(gpx, 0); // uint8: not implemented write_8(gpx, 0); return end_frame(gpx); } return SUCCESS; } // 158 - Pause @ zPos static int pause_at_zpos(Gpx *gpx, float z_positon) { begin_frame(gpx); write_8(gpx, 158); // uint8: pause at Z coordinate or 0.0 to disable write_float(gpx, z_positon); return end_frame(gpx); } // COMMAND @ ZPOS FUNCTIONS // find an existing filament definition static int find_filament(Gpx *gpx, char *filament_id) { int i, index = -1; int l = gpx->filamentLength; // a brute force search is generally fastest for low n for(i = 0; i < l; i++) { if(strcmp(filament_id, gpx->filament[i].colour) == 0) { index = i; break; } } return index; } // add a new filament definition static int add_filament(Gpx *gpx, char *filament_id, double diameter, unsigned temperature, unsigned LED) { int index = find_filament(gpx, filament_id); if(index < 0) { if(gpx->filamentLength < FILAMENT_MAX) { index = gpx->filamentLength++; gpx->filament[index].colour = strdup(filament_id); gpx->filament[index].diameter = diameter; gpx->filament[index].temperature = temperature; gpx->filament[index].LED = LED; } else { gcodeResult(gpx, "(line %u) Buffer overflow: too many @filament definitions (maximum = %i)" EOL, gpx->lineNumber, FILAMENT_MAX - 1); index = 0; } } return index; } // append a new command at z function static int add_command_at(Gpx *gpx, double z, char *filament_id, unsigned nozzle_temperature, unsigned build_platform_temperature) { int rval; int index = filament_id ? find_filament(gpx, filament_id) : 0; if(index < 0) { gcodeResult(gpx, "(line %u) Semantic error: @pause macro with undefined filament name '%s', use a @filament macro to define it" EOL, gpx->lineNumber, filament_id); index = 0; } // insert command if(gpx->commandAtLength < COMMAND_AT_MAX) { if(gpx->flag.loadMacros) { int i = gpx->commandAtLength; if(z <= gpx->commandAtZ) { // make a space while(i > 0 && z <= gpx->commandAt[i - 1].z) { gpx->commandAt[i] = gpx->commandAt[i - 1]; i--; } gpx->commandAt[i].z = z; gpx->commandAt[i].filament_index = index; gpx->commandAt[i].nozzle_temperature = nozzle_temperature; gpx->commandAt[i].build_platform_temperature = build_platform_temperature; gpx->commandAtZ = gpx->commandAt[gpx->commandAtLength].z; VERBOSE( gcodeResult(gpx, "Inserted index=%d ", i) ); } // append command else { gpx->commandAt[i].z = z; gpx->commandAt[i].filament_index = index; gpx->commandAt[i].nozzle_temperature = nozzle_temperature; gpx->commandAt[i].build_platform_temperature = build_platform_temperature; gpx->commandAtZ = z; VERBOSE( gcodeResult(gpx, "Appended index=%d ", i) ); } if(gpx->flag.verboseMode && gpx->flag.logMessages) { gcodeResult(gpx, "Command @ %0.2lf: ", z); if(nozzle_temperature == 0 && build_platform_temperature == 0) gcodeResult(gpx, "Pause\n"); else gcodeResult(gpx, "Set temperature; nozzle=%u, bed=%u\n", nozzle_temperature, build_platform_temperature); } // nonzero temperature signals a temperature change, not a pause @ zPos // so if its the first pause @ zPos que it up if(nozzle_temperature == 0 && build_platform_temperature == 0 && gpx->commandAtLength == 0) { if(gpx->flag.macrosEnabled) { CALL( pause_at_zpos(gpx, z) ); VERBOSE( gcodeResult(gpx, "Sent pause @ %0.2lf\n", z) ); } else { gpx->flag.pausePending = 1; } } gpx->commandAtLength++; } } else { gcodeResult(gpx, "(line %u) Buffer overflow: too many @pause definitions (maximum = %i)" EOL, gpx->lineNumber, COMMAND_AT_MAX); } return SUCCESS; } // EEPROM MACRO FUNCTIONS int write_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; write_8(gpx, value); CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 1) ); return SUCCESS; } int read_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char *value) { int rval; CALL( read_eeprom(gpx, address, 2) ); gpx->buffer.ptr = sio->response.eeprom.buffer; *value = read_8(gpx); return SUCCESS; } int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; write_16(gpx, value); CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 2) ); return SUCCESS; } int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short *value) { int rval; CALL( read_eeprom(gpx, address, 2) ); gpx->buffer.ptr = sio->response.eeprom.buffer; *value = read_16(gpx); return SUCCESS; } int write_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; write_fixed_16(gpx, value); CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 2) ); return SUCCESS; } int read_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float *value) { int rval; CALL( read_eeprom(gpx, address, 2) ); gpx->buffer.ptr = sio->response.eeprom.buffer; *value = read_fixed_16(gpx); return SUCCESS; } int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; write_32(gpx, value); CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 4) ); return SUCCESS; } int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value) { int rval; CALL( read_eeprom(gpx, address, 4) ); gpx->buffer.ptr = sio->response.eeprom.buffer; *value = read_32(gpx); return SUCCESS; } int write_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float value) { int rval; gpx->buffer.ptr = sio->response.eeprom.buffer; write_float(gpx, value); CALL( write_eeprom(gpx, address, sio->response.eeprom.buffer, 4) ); return SUCCESS; } int read_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float *value) { int rval; CALL( read_eeprom(gpx, address, 4) ); gpx->buffer.ptr = sio->response.eeprom.buffer; *value = read_float(gpx); return SUCCESS; } const char *get_firmware_variant(unsigned int variant_id) { const char *variant = "Unknown"; switch(variant_id) { case 0x01: variant = "Makerbot"; break; case 0x80: variant = "Sailfish"; break; } return variant; } // load a built-in eeprom map based on the firmware variant and version int load_eeprom_map(Gpx *gpx) { int rval = SUCCESS; if(!gpx->flag.sioConnected || gpx->sio == NULL) { gcodeResult(gpx, "(line %u) Serial not connected: can't detect which eeprom map without asking the bot" EOL, gpx->lineNumber); return ERROR; } CALL( get_advanced_version_number(gpx) ); int i; EepromMap *pem = eepromMaps; for(i = 0; i < eepromMapCount; i++, pem++) { if(gpx->sio->response.firmware.variant == pem->variant && gpx->sio->response.firmware.version >= pem->versionMin && gpx->sio->response.firmware.version <= pem->versionMax) { gpx->eepromMap = pem; gcodeResult(gpx, "EEPROM map loaded for firmware %s version %d.\n", get_firmware_variant(pem->variant), gpx->sio->response.firmware.version); return SUCCESS; } } gcodeResult(gpx, "(line %u) Unable to find a matching eeprom map for firmware %s version = %u\n", gpx->lineNumber, get_firmware_variant(gpx->sio->response.firmware.variant), gpx->sio->response.firmware.version); return ERROR; } // find an eeprom mapping entry from the builtin mapping table static int find_builtin_eeprom_mapping(Gpx *gpx, char *name) { if(gpx->eepromMap == NULL) return -1; int iem; EepromMapping *pem = gpx->eepromMap->eepromMappings; for(iem = 0; iem < gpx->eepromMap->eepromMappingCount; iem++, pem++) { if(strcmp(name, pem->id) == 0) return iem; } return -1; } // find an existing EEPROM mapping static int find_eeprom_mapping(Gpx *gpx, char *name) { if(gpx->eepromMappingVector == NULL) return -1; int iem; EepromMapping *pem = vector_get(gpx->eepromMappingVector, 0); for(iem = 0; iem < gpx->eepromMappingVector->c; iem++, pem++) { if(strcmp(name, pem->id) == 0) return iem; } return -1; } static void init_eeprom_mapping(EepromMapping *pem) { memset(pem, 0, sizeof(*pem)); } // add an eeprom mapping static int add_eeprom_mapping(Gpx *gpx, char *name, EepromType et, unsigned address, int len) { if(gpx->eepromMappingVector == NULL) { gpx->eepromMappingVector = vector_create(sizeof(EepromMapping), 10, 10); if(gpx->eepromMappingVector == NULL) return -1; } int iem = find_eeprom_mapping(gpx, name); if(iem >= 0) { // update the existing EepromMapping *pem = vector_get(gpx->eepromMappingVector, iem); pem->address = address; pem->et = et; pem->len = len; return iem; } EepromMapping em; init_eeprom_mapping(&em); em.id = strdup(name); if(em.id == NULL) return -1; em.address = address; em.et = et; em.len = len; return vector_append(gpx->eepromMappingVector, &em); } EepromMapping *find_any_eeprom_mapping(Gpx *gpx, char *name) { if(!gpx->flag.sioConnected || gpx->sio == NULL) { gcodeResult(gpx, "(line %u) Error: eeprom operation without serial connection\n", gpx->lineNumber); return NULL; } EepromMapping *pem = NULL; int iem = find_eeprom_mapping(gpx, name); if(iem >= 0) { pem = vector_get(gpx->eepromMappingVector, iem); } else if((iem = find_builtin_eeprom_mapping(gpx, name)) >= 0) { if(gpx->eepromMap == NULL) { gcodeResult(gpx, "(line %u) Unexpected error: find_builtin_eeprom_mapping returned an invalid index %d.\n", gpx->lineNumber, iem); return NULL; } pem = &gpx->eepromMap->eepromMappings[iem]; } if(pem == NULL) { gcodeResult(gpx, "(line %u) Error: eeprom mapping '%s' not defined\n", gpx->lineNumber, name); } return pem; } // read an eeprom value from a defined mapping static int read_eeprom_name(Gpx *gpx, char *name) { int rval = SUCCESS; EepromMapping *pem = find_any_eeprom_mapping(gpx, name); if(pem == NULL) return ERROR; const char *unit = pem->unit != NULL ? pem->unit : ""; switch(pem->et) { case et_bitfield: case et_boolean: case et_byte: { unsigned char b; CALL( read_eeprom_8(gpx, gpx->sio, pem->address, &b) ); gcodeResult(gpx, "EEPROM byte %s @ 0x%x is %u %s (0x%x)\n", pem->id, pem->address, (unsigned)b, unit, (unsigned)b); break; } case et_ushort: { unsigned short us; CALL( read_eeprom_16(gpx, gpx->sio, pem->address, &us) ); gcodeResult(gpx, "EEPROM value %s @ 0x%x is %u %s (0x%x)\n", pem->id, pem->address, us, unit, us); break; } case et_fixed: { float n; CALL( read_eeprom_fixed_16(gpx, gpx->sio, pem->address, &n) ); gcodeResult(gpx, "EEPROM float %s @ 0x%x is %g %s\n", pem->id, pem->address, n, unit); break; } case et_long: case et_ulong: { unsigned long ul; CALL( read_eeprom_32(gpx, gpx->sio, pem->address, &ul) ); if(pem->et == et_long) { gcodeResult(gpx, "EEPROM value %s @ 0x%x is %d %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); } else { gcodeResult(gpx, "EEPROM value %s @ 0x%x is %u %s (0x%lx)\n", pem->id, pem->address, ul, unit, ul); } break; } case et_float: { float n; CALL( read_eeprom_float(gpx, gpx->sio, pem->address, &n) ); gcodeResult(gpx, "EEPROM float %s @ 0x%x is %g %s\n", pem->id, pem->address, unit, n); break; } case et_string: memset(gpx->sio->response.eeprom.buffer, 0, sizeof(gpx->sio->response.eeprom.buffer)); int len = pem->len; if(len > sizeof(gpx->sio->response.eeprom.buffer)) len = sizeof(gpx->sio->response.eeprom.buffer); CALL( read_eeprom(gpx, pem->address, len) ); gcodeResult(gpx, "EEPROM string %s @ 0x%x is %s\n", pem->id, pem->address, gpx->sio->response.eeprom.buffer); break; default: gcodeResult(gpx, "(line %u) Error: type of %s not supported by @eread\n", gpx->lineNumber, pem->id); break; } return SUCCESS; } // write an eeprom value via a defined mapping static int write_eeprom_name(Gpx *gpx, char *name, char *string_value, unsigned long hex, float value) { int rval = SUCCESS; EepromMapping *pem = find_any_eeprom_mapping(gpx, name); if(pem == NULL) return ERROR; if((string_value != NULL) + (hex != 0) + (value != 0.0) > 1) { gcodeResult(gpx, "(line %u) Error: only one value expected for @ewrite macro\n", gpx->lineNumber); return ERROR; } if(pem->et != et_string) { if(string_value != NULL) { gcodeResult(gpx, "(line %u) Error: string value unexpected for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } if(value != 0.0) hex = (unsigned long)value; } switch(pem->et) { case et_bitfield: case et_boolean: case et_byte: { if(hex > 255) { gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } unsigned char b = (unsigned char)hex; CALL( write_eeprom_8(gpx, gpx->sio, pem->address, b) ); gcodeResult(gpx, "EEPROM wrote 8-bits, %u to address 0x%x\n", (unsigned)b, pem->address); break; } case et_ushort: { if(hex > 65535) { gcodeResult(gpx, "(line %u) Error: parameter out of range for eeprom setting %s\n", gpx->lineNumber, pem->id); return ERROR; } unsigned short us = (unsigned short)hex; CALL( write_eeprom_16(gpx, gpx->sio, pem->address, us) ); gcodeResult(gpx, "EEPROM wrote 16-bits, %u to address 0x%x\n", us, pem->address); break; } case et_fixed: { if(value == 0.0) value = (float)hex; CALL( write_eeprom_fixed_16(gpx, gpx->sio, pem->address, value) ); gcodeResult(gpx, "EEPROM wrote fixed point 16-bits, %f to address 0x%x\n", value, pem->address); break; } case et_long: case et_ulong: CALL( write_eeprom_32(gpx, gpx->sio, pem->address, hex) ); gcodeResult(gpx, "EEPROM wrote 32-bits, %lu to address 0x%x\n", hex, pem->address); break; case et_float: gcodeResult(gpx, "(line %u) Error: writing float type to eeprom not yet supported.\n", gpx->lineNumber); break; case et_string: if(pem->len <= 0) { gcodeResult(gpx, "(line %u) Error: can't write a string to zero length eeprom mapping\n", gpx->lineNumber); break; } if(strlen(string_value) >= pem->len) string_value[pem->len - 1] = 0; CALL( write_eeprom(gpx, pem->address, string_value, strlen(string_value) + 1) ); gcodeResult(gpx, "EEPROM wrote %d bytes to address 0x%x\n", strlen(string_value) + 1, pem->address); break; default: gcodeResult(gpx, "(line %u) Error: type of %s not supported by @ewrite\n", gpx->lineNumber, pem->id); break; } return SUCCESS; } // DISPLAY TAG static int display_tag(Gpx *gpx) { int rval; CALL( display_message(gpx, PACKAGE_STRING, 0, 0, 2, 0) ); return SUCCESS; } // TARGET POSITION // calculate target position static int calculate_target_position(Gpx *gpx, Ptr5d delta, int *relative) { int rval; // G10 ofset Point3d userOffset = gpx->offset[gpx->current.offset]; double userScale = 1.0; // we try to calculate a new absolute target even if we're in relative mode // only resort to relative x,y,z if we don't know where we are. delta->x = delta->y = delta->z = delta->a = delta->b = 0; *relative = 0; if(gpx->flag.macrosEnabled) { // plus command line offset userOffset.x += gpx->user.offset.x; userOffset.y += gpx->user.offset.y; userOffset.z += gpx->user.offset.z; // multiply by command line scale userScale = gpx->user.scale; } // CALCULATE TARGET POSITION // x gpx->target.position.x = gpx->current.position.x; if(gpx->command.flag & X_IS_SET) { if(gpx->flag.relativeCoordinates) { delta->x = gpx->command.x * userScale; gpx->target.position.x += delta->x; *relative = !!(gpx->axis.positionKnown & X_IS_SET); } else { gpx->target.position.x = (gpx->command.x + userOffset.x) * userScale; delta->x = gpx->target.position.x - gpx->current.position.x; } } // y gpx->target.position.y = gpx->current.position.y; if(gpx->command.flag & Y_IS_SET) { if(gpx->flag.relativeCoordinates) { delta->y = gpx->command.y * userScale; gpx->target.position.y += delta->y; *relative = !!(gpx->axis.positionKnown & Y_IS_SET); } else { gpx->target.position.y = (gpx->command.y + userOffset.y) * userScale; delta->y = gpx->target.position.y - gpx->current.position.y; } } // z gpx->target.position.z = gpx->current.position.z; if(gpx->command.flag & Z_IS_SET) { if(gpx->flag.relativeCoordinates) { delta->z = gpx->command.z * userScale; gpx->target.position.z += delta->z; *relative = !!(gpx->axis.positionKnown & Z_IS_SET); } else { gpx->target.position.z = (gpx->command.z + userOffset.z) * userScale; delta->z = gpx->target.position.z - gpx->current.position.z; } } // a gpx->target.position.a = gpx->current.position.a; if(gpx->command.flag & A_IS_SET) { double a = (gpx->override[A].filament_scale == 1.0) ? gpx->command.a : (gpx->command.a * gpx->override[A].filament_scale); if(gpx->flag.relativeCoordinates || gpx->flag.extruderIsRelative) { delta->a = a; gpx->target.position.a += a; } else { gpx->target.position.a = a; delta->a = gpx->target.position.a - gpx->current.position.a; } } // b gpx->target.position.b = gpx->current.position.b; if(gpx->command.flag & B_IS_SET) { double b = (gpx->override[B].filament_scale == 1.0) ? gpx->command.b : (gpx->command.b * gpx->override[B].filament_scale); if(gpx->flag.relativeCoordinates || gpx->flag.extruderIsRelative) { delta->b = b; gpx->target.position.b += b; } else { gpx->target.position.b = b; delta->b = gpx->target.position.b - gpx->current.position.b; } } // update current feedrate if(gpx->command.flag & F_IS_SET) { gpx->current.feedrate = gpx->command.f; } // DITTO PRINTING if(gpx->flag.dittoPrinting) { if(gpx->command.flag & A_IS_SET) { delta->b = delta->a; if(gpx->axis.positionKnown & A_IS_SET) { gpx->target.position.b = gpx->target.position.a; gpx->axis.positionKnown |= A_IS_SET; } gpx->command.flag |= B_IS_SET; } else if(gpx->command.flag & B_IS_SET) { delta->a = delta->b; if(gpx->axis.positionKnown & B_IS_SET) { gpx->target.position.a = gpx->target.position.b; gpx->axis.positionKnown |= A_IS_SET; } gpx->command.flag |= A_IS_SET; } } // CHECK FOR COMMAND @ Z POS // check if there are more commands on the stack if(gpx->flag.macrosEnabled && gpx->flag.runMacros && gpx->commandAtIndex < gpx->commandAtLength) { // check if the next command will cross the z threshold if(gpx->commandAt[gpx->commandAtIndex].z <= gpx->target.position.z) { // is this a temperature change macro? if(gpx->commandAt[gpx->commandAtIndex].nozzle_temperature || gpx->commandAt[gpx->commandAtIndex].build_platform_temperature) { unsigned nozzle_temperature = gpx->commandAt[gpx->commandAtIndex].nozzle_temperature; unsigned build_platform_temperature = gpx->commandAt[gpx->commandAtIndex].build_platform_temperature; // make sure the temperature has changed if(nozzle_temperature) { if((gpx->current.extruder == A || gpx->tool[A].nozzle_temperature) && gpx->tool[A].nozzle_temperature != nozzle_temperature) { CALL( set_nozzle_temperature(gpx, A, nozzle_temperature) ); gpx->tool[A].nozzle_temperature = gpx->override[A].active_temperature = nozzle_temperature; VERBOSE( fprintf(gpx->log, "(@zPos %0.2f) Nozzle[A] temperature %uc" EOL, gpx->commandAt[gpx->commandAtIndex].z, nozzle_temperature) ); } if((gpx->current.extruder == B || gpx->tool[B].nozzle_temperature) && gpx->tool[B].nozzle_temperature != nozzle_temperature) { CALL( set_nozzle_temperature(gpx, B, nozzle_temperature) ); gpx->tool[B].nozzle_temperature = gpx->override[B].active_temperature = nozzle_temperature; VERBOSE( fprintf(gpx->log, "(@zPos %0.2f) Nozzle[B] temperature %uc" EOL, gpx->commandAt[gpx->commandAtIndex].z, nozzle_temperature) ); } } if(build_platform_temperature) { if(gpx->machine.a.has_heated_build_platform && gpx->tool[A].build_platform_temperature && gpx->tool[A].build_platform_temperature != build_platform_temperature) { CALL( set_build_platform_temperature(gpx, A, build_platform_temperature) ); gpx->tool[A].build_platform_temperature = gpx->override[A].build_platform_temperature = build_platform_temperature; VERBOSE( fprintf(gpx->log, "(@zPos %0.2f) Build platform[A] temperature %uc" EOL, gpx->commandAt[gpx->commandAtIndex].z, build_platform_temperature) ); } else if(gpx->machine.b.has_heated_build_platform && gpx->tool[B].build_platform_temperature && gpx->tool[B].build_platform_temperature != build_platform_temperature) { CALL( set_build_platform_temperature(gpx, B, build_platform_temperature) ); gpx->tool[B].build_platform_temperature = gpx->override[B].build_platform_temperature = build_platform_temperature; VERBOSE( fprintf(gpx->log, "(@zPos %0.2f) Build platform[B] temperature %uc" EOL, gpx->commandAt[gpx->commandAtIndex].z, build_platform_temperature) ); } } gpx->commandAtIndex++; } // no its a pause macro else if(gpx->commandAt[gpx->commandAtIndex].z <= gpx->target.position.z) { int index = gpx->commandAt[gpx->commandAtIndex].filament_index; VERBOSE( fprintf(gpx->log, "(@zPos %0.2f) %s", gpx->commandAt[gpx->commandAtIndex].z, gpx->filament[index].colour) ); // override filament diameter double filament_diameter = gpx->filament[index].diameter; if(filament_diameter > 0.0001) { VERBOSE( fprintf(gpx->log, ", %0.2fmm", filament_diameter) ); if(gpx->flag.dittoPrinting) { set_filament_scale(gpx, B, filament_diameter); set_filament_scale(gpx, A, filament_diameter); } else { set_filament_scale(gpx, gpx->current.extruder, filament_diameter); } } unsigned temperature = gpx->filament[index].temperature; // override nozzle temperature if(temperature) { VERBOSE( fprintf(gpx->log, ", %uc", temperature) ); if(gpx->tool[gpx->current.extruder].nozzle_temperature != temperature) { if(gpx->flag.dittoPrinting) { CALL( set_nozzle_temperature(gpx, B, temperature) ); CALL( set_nozzle_temperature(gpx, A, temperature)); gpx->tool[A].nozzle_temperature = gpx->tool[B].nozzle_temperature = temperature; } else { CALL( set_nozzle_temperature(gpx, gpx->current.extruder, temperature) ); gpx->tool[gpx->current.extruder].nozzle_temperature = temperature; } } } // override LED colour if(gpx->filament[index].LED) { CALL( set_LED_RGB(gpx, gpx->filament[index].LED, 0) ); } gpx->commandAtIndex++; if(gpx->commandAtIndex < gpx->commandAtLength) { gpx->flag.doPauseAtZPos = COMMAND_QUE_MAX; } VERBOSE( fputs(EOL, gpx->log) ); } } } return SUCCESS; } static void update_current_position(Gpx *gpx) { // the current position to tracks where the print head currently is if(gpx->target.position.z != gpx->current.position.z) { // calculate layer height gpx->layerHeight = fabs(gpx->target.position.z - gpx->current.position.z); // check upper bounds if(gpx->layerHeight > (gpx->machine.nozzle_diameter * 0.85)) { gpx->layerHeight = gpx->machine.nozzle_diameter * 0.85; } } gpx->current.position = gpx->target.position; if(!gpx->flag.relativeCoordinates) gpx->axis.positionKnown |= (gpx->command.flag & gpx->axis.mask); } // TOOL CHANGE static int do_tool_change(Gpx *gpx, int timeout) { int rval; // set the temperature of current tool to standby (if standby is different to active) if(gpx->override[gpx->current.extruder].standby_temperature && gpx->override[gpx->current.extruder].standby_temperature != gpx->tool[gpx->current.extruder].nozzle_temperature) { unsigned temperature = gpx->override[gpx->current.extruder].standby_temperature; CALL( set_nozzle_temperature(gpx, gpx->current.extruder, temperature) ); gpx->tool[gpx->current.extruder].nozzle_temperature = temperature; } // set the temperature of selected tool to active (if active is different to standby) if(gpx->override[gpx->target.extruder].active_temperature && gpx->override[gpx->target.extruder].active_temperature != gpx->tool[gpx->target.extruder].nozzle_temperature) { unsigned temperature = gpx->override[gpx->target.extruder].active_temperature; CALL( set_nozzle_temperature(gpx, gpx->target.extruder, temperature) ); gpx->tool[gpx->target.extruder].nozzle_temperature = temperature; // wait for nozzle to head up // CALL( wait_for_extruder(gpx, gpx->target.extruder, timeout) ); } // switch any active G10 offset (G54 or G55) if(gpx->current.offset == gpx->current.extruder + 1) { gpx->current.offset = gpx->target.extruder + 1; } // change current toolhead in order to apply the calibration offset CALL( change_extruder_offset(gpx, gpx->target.extruder) ); // MBI's firmware and Sailfish 7.7 and earlier effect a tool change // by adding the tool offset to the next move command. That has two // undesirable effects: // // 1. It changes the slope in the XY plane of the move, and // 2. Since the firmwares do not recompute the distance, the acceleration // behavior is wrong. // // Item 2 is particularly foul in some instances causing thumps, // lurches, or other odd behaviors as things move at the wrong speed // (either too fast or too slow). // // Chow Loong Jin's simple solution solves both of these by queuing // an *unaccelerated* move to the current position. Since it is // unaccelerated, there's no need for proper distance calcs and the // firmware's failure to re-calc that info has no impact. And since // the motion is to the current position all that occurs is a simple // travel move that does the tool offset. The next useful motion // command does not have its slope perturbed and will occur with the // proper acceleration profile. // // Only gotcha here is that we may only do this when the position is // well defined. For example, we cannot do this for a tool change // immediately after a 'recall home offsets' command. if(gpx->axis.mask == (gpx->axis.positionKnown & gpx->axis.mask)) { gpx->target.position = gpx->current.position; VERBOSE( gcodeResult(gpx, "(line %u) queuing an absolute point to ", gpx->lineNumber) ); VERBOSE( show_current_pos(gpx) ); CALL( queue_absolute_point(gpx) ); } // set current extruder so changes in E are expressed as changes to A or B gpx->current.extruder = gpx->target.extruder; return SUCCESS; } // FUTURE allow long names for types? like 'bitfield' EepromType eepromTypeFromTypeName(char *type_name) { if(strlen(type_name) != 1) return et_null; switch(type_name[0]) { case 'B': return et_byte; case 'H': return et_ushort; case 'i': return et_long; case 'I': return et_ulong; case 'f': return et_fixed; case 's': return et_string; } return et_null; } // PARSER PRE-PROCESSOR // return the length of the given file in bytes static long get_filesize(FILE *file) { long filesize = -1; fseek(file, 0L, SEEK_END); filesize = ftell(file); fseek(file, 0L, SEEK_SET); return filesize; } // clean up the gcode command for processing static char *normalize_word(char* p) { // we expect a letter followed by a digit // [ a-zA-Z] [ +-]? [ 0-9]+ ('.' [ 0-9]*)? char *s = p + 1; char *e = p; while(isspace(*s)) s++; if(*s == '+' || *s == '-') { *e++ = *s++; } while(1) { // skip spaces if(isspace(*s)) { s++; } // append digits else if(isdigit(*s)) { *e++ = *s++; } else { break; } } if(*s == '.') { *e++ = *s++; while(1) { // skip spaces if(isspace(*s)) { s++; } // append digits else if(isdigit(*s)) { *e++ = *s++; } else { break; } } } *e = 0; return s; } // clean up the gcode comment for processing static char *normalize_comment(char *p) { // strip white space from the end of comment char *e = p + strlen(p); while (e > p && isspace((unsigned char)(*--e))) *e = '\0'; // strip white space from the beginning of comment. while(isspace(*p)) p++; return p; } // MACRO PARSER /* format ;@ mm c # () MACRO:= ';' '@' COMMAND COMMENT EOL COMMAND:= PRINTER | ENABLE | FILAMENT | EXTRUDER | SLICER | START | PAUSE | FLAVOR | BUILD COMMENT:= S+ '(' [^)]* ')' S+ PRINTER:= ('printer' | 'machine' | 'slicer') (TYPE | PACKING_DENSITY | DIAMETER | TEMP | RGB )+ TYPE:= S+ ('c3' | 'c4' | 'cp4' | 'cpp' | 'cxy' | 'cxysz' | 't6' | 't7' | 't7d' | 'r1' | 'r1d' | 'r2' | 'r2h' | 'r2x' | 'z' | 'zd' ) PACKING_DENSITY:= S+ DIGIT+ ('.' DIGIT+)? DIAMETER:= S+ DIGIT+ ('.' DIGIT+)? 'm' 'm'? TEMP:= S+ DIGIT+ 'c' RGB:= S+ '#' HEX HEX HEX HEX HEX HEX ; LED colour ENABLE:= 'enable' (DITTO | PROGRESS) DITTO:= S+ 'ditto' ; Simulated ditto printing PROGRESS:= S+ 'progress' ; Override build progress FILAMENT:= 'filament' FILAMENT_ID (DIAMETER | TEMP | RGB)+ FILAMENT_ID:= S+ ALPHA+ ALPHA_NUMERIC* EXTRUDER:= ('right' | 'left') (FILAMENT_ID | DIAMETER | TEMP)+ SLICER:= 'slicer' DIAMETER ; Nominal filament diameter START:= 'start' (FILAMENT_ID | TEMPERATURE) PAUSE:= 'pause' (ZPOS | FILAMENT_ID | TEMPERATURE)+ ZPOS:= S+ DIGIT+ ('.' DIGIT+)? BUILD:= 'build' BUILD_NAME BUILD_NAME:= S+ ALPHA ALPHA_NUMERIC* FLAVOR:= 'flavor' GCODE_FLAVOR GCODE_FLAVOR:= S+ ('makerbot' | 'reprap') */ #define MACRO_IS(token) (strcmp(token, macro) == 0) #define NAME_IS(n) (strcasecmp(name, n) == 0) static int parse_macro(Gpx *gpx, const char* macro, char *p) { int rval; char *name = NULL; char *string_param = NULL; double z = 0.0; double diameter = 0.0; unsigned nozzle_temperature = 0; unsigned build_platform_temperature = 0; unsigned LED = 0; while(*p != 0) { // trim any leading white space while(isspace(*p)) p++; if(isalpha(*p)) { if(name == NULL || (!MACRO_IS("eeprom") && !MACRO_IS("ewrite"))) name = p; else string_param = p; while(*p && (isalnum(*p) || *p == '_')) p++; if(*p) *p++ = 0; } else if(isdigit(*p)) { char *t = p; while(*p && !isspace(*p)) p++; if(*(p - 1) == 'm') { diameter = strtod(t, NULL); } else if(*(p - 1) == 'c') { unsigned temperature = atoi(t); if(temperature > HBP_MAX) { nozzle_temperature = temperature; } else { build_platform_temperature = temperature; } } else { z = strtod(t, NULL); } if(*p) *p++ = 0; } else if(*p == '"') { string_param = ++p; while(*p && *p != '"') p++; if(*p) *p++ = 0; } else if(*p == '#') { char *t = ++p; while(*p && !isspace(*p)) p++; if(*p) *p++ = 0; LED = (unsigned)strtol(t, NULL, 16); } else if(*p == '(') { char *t = strchr(p + 1, ')'); if(t) { *t = 0; p = t + 1; } else { *p = 0; } } else { gcodeResult(gpx, "(line %u) Syntax error: unrecognised macro parameter" EOL, gpx->lineNumber); break; } } // ;@printer mm c # if(MACRO_IS("machine") || MACRO_IS("printer") || MACRO_IS("slicer")) { if(name) { if(gpx_set_machine(gpx, name, 0)) { gcodeResult(gpx, "(line %u) Semantic error: @%s macro with unrecognised type '%s'" EOL, gpx->lineNumber, macro, name); } gpx->override[A].packing_density = gpx->machine.nominal_packing_density; gpx->override[B].packing_density = gpx->machine.nominal_packing_density; } if(z > 0.0001) { gpx->machine.nominal_packing_density = z; } if(diameter > 0.0001) gpx->machine.nominal_filament_diameter = diameter; if(build_platform_temperature) { if(gpx->machine.a.has_heated_build_platform) gpx->override[A].build_platform_temperature = build_platform_temperature; else if(gpx->machine.b.has_heated_build_platform) gpx->override[B].build_platform_temperature = build_platform_temperature; else { gcodeResult(gpx, "(line %u) Semantic warning: @%s macro cannot override non-existant heated build platform" EOL, gpx->lineNumber, macro); } } if(LED) { CALL( set_LED_RGB(gpx, LED, 0) ); } } // ;@enable ditto // ;@enable progress // ;@enable explicit_tool_change else if(MACRO_IS("enable")) { if(name) { if(NAME_IS("ditto")) { if(gpx->machine.extruder_count == 1) { gcodeResult(gpx, "(line %u) Semantic warning: ditto printing cannot access non-existant second extruder" EOL, gpx->lineNumber); gpx->flag.dittoPrinting = 0; } else { gpx->flag.dittoPrinting = 1; } } else if(NAME_IS("progress")) gpx->flag.buildProgress = 1; else if(NAME_IS("explicit_tool_change")) gpx->flag.onlyExplicitToolChange = 1; else { gcodeResult(gpx, "(line %u) Semantic error: @enable macro with unrecognised parameter '%s'" EOL, gpx->lineNumber, name); } } else { gcodeResult(gpx, "(line %u) Syntax error: @enable macro with missing parameter" EOL, gpx->lineNumber); } } // ;@disable ditto // ;@disable progress // ;@disable explicit_tool_change else if(MACRO_IS("disable")) { if(name) { if(NAME_IS("ditto")) gpx->flag.dittoPrinting = 0; else if(NAME_IS("progress")) gpx->flag.buildProgress = 0; else if(NAME_IS("explicit_tool_change")) gpx->flag.onlyExplicitToolChange = 0; else { gcodeResult(gpx, "(line %u) Semantic error: @disable macro with unrecognised parameter '%s'" EOL, gpx->lineNumber, name); } } else { gcodeResult(gpx, "(line %u) Syntax error: @disable macro with missing parameter" EOL, gpx->lineNumber); } } // ;@filament mm c # else if(MACRO_IS("filament")) { if(name) { add_filament(gpx, name, diameter, nozzle_temperature, LED); } else { gcodeResult(gpx, "(line %u) Semantic error: @filament macro with missing name" EOL, gpx->lineNumber); } } // ;@right mm c else if(MACRO_IS("right")) { if(name) { int index = find_filament(gpx, name); if(index > 0) { if(gpx->filament[index].diameter > 0.0001) set_filament_scale(gpx, A, gpx->filament[index].diameter); if(gpx->filament[index].temperature) gpx->override[A].active_temperature = gpx->filament[index].temperature; return SUCCESS; } } if(z > 0.0001) gpx->override[A].packing_density = z; if(diameter > 0.0001) set_filament_scale(gpx, A, diameter); if(nozzle_temperature) gpx->override[A].active_temperature = nozzle_temperature; } // ;@left mm c else if(MACRO_IS("left")) { if(name) { int index = find_filament(gpx, name); if(index > 0) { if(gpx->filament[index].diameter > 0.0001) set_filament_scale(gpx, B, gpx->filament[index].diameter); if(gpx->filament[index].temperature) gpx->override[B].active_temperature = gpx->filament[index].temperature; return SUCCESS; } } if(z > 0.0001) gpx->override[A].packing_density = z; if(diameter > 0.0001) set_filament_scale(gpx, B, diameter); if(nozzle_temperature) gpx->override[B].active_temperature = nozzle_temperature; } // ;@pause else if(MACRO_IS("pause")) { if(z > 0.0001) { CALL( add_command_at(gpx, z, name, 0, 0) ); } else if(diameter > 0.0001) { CALL( add_command_at(gpx, diameter, name, 0, 0) ); } else { gcodeResult(gpx, "(line %u) Semantic error: @pause macro with missing zPos" EOL, gpx->lineNumber); } } // ;@temp c // ;@temperature c else if(MACRO_IS("temp") || MACRO_IS("temperature")) { if(nozzle_temperature || build_platform_temperature) { if(z > 0.0001) { CALL( add_command_at(gpx, z, NULL, nozzle_temperature, build_platform_temperature) ); } else if(diameter > 0.0001) { CALL( add_command_at(gpx, diameter, NULL, nozzle_temperature, build_platform_temperature) ); } else { gcodeResult(gpx, "(line %u) Semantic error: @%s macro with missing zPos" EOL, gpx->lineNumber, macro); } } else { gcodeResult(gpx, "(line %u) Semantic error: @%s macro with missing temperature" EOL, gpx->lineNumber, macro); } } // ;@start c else if(MACRO_IS("start")) { if(nozzle_temperature || build_platform_temperature) { if(nozzle_temperature) { VERBOSE( fprintf(gpx->log, "(@start) Nozzle temperature %uc" EOL, nozzle_temperature) ); if(gpx->tool[A].nozzle_temperature && gpx->tool[A].nozzle_temperature != nozzle_temperature) { if(program_is_running()) { CALL( set_nozzle_temperature(gpx, A, nozzle_temperature) ); } gpx->tool[A].nozzle_temperature = gpx->override[A].active_temperature = nozzle_temperature; } else { gpx->override[A].active_temperature = nozzle_temperature; } if(gpx->tool[B].nozzle_temperature && gpx->tool[B].nozzle_temperature != nozzle_temperature) { if(program_is_running()) { CALL( set_nozzle_temperature(gpx, B, nozzle_temperature) ); } gpx->tool[B].nozzle_temperature = gpx->override[B].active_temperature = nozzle_temperature; } else { gpx->override[B].active_temperature = nozzle_temperature; } } if(build_platform_temperature) { VERBOSE( fprintf(gpx->log, "(@start) Build platform temperature %uc" EOL, build_platform_temperature) ); if(gpx->machine.a.has_heated_build_platform && gpx->tool[A].build_platform_temperature && gpx->tool[A].build_platform_temperature != build_platform_temperature) { if(program_is_running()) { CALL( set_build_platform_temperature(gpx, A, build_platform_temperature) ); } gpx->tool[A].build_platform_temperature = gpx->override[A].build_platform_temperature = build_platform_temperature; } else if(gpx->machine.b.has_heated_build_platform && gpx->tool[B].build_platform_temperature && gpx->tool[B].build_platform_temperature != build_platform_temperature) { if(program_is_running()) { CALL( set_build_platform_temperature(gpx, B, build_platform_temperature) ); } gpx->tool[B].build_platform_temperature = gpx->override[B].build_platform_temperature = build_platform_temperature; } } } else if(name) { int index = find_filament(gpx, name); if(index > 0) { VERBOSE( fprintf(gpx->log, "(@start) %s", name) ); if(gpx->filament[index].diameter > 0.0001) { VERBOSE( fprintf(gpx->log, ", %0.2fmm", gpx->filament[index].diameter) ); if(gpx->flag.dittoPrinting) { set_filament_scale(gpx, B, gpx->filament[index].diameter); set_filament_scale(gpx, A, gpx->filament[index].diameter); } else { set_filament_scale(gpx, gpx->current.extruder, gpx->filament[index].diameter); } } if(gpx->filament[index].LED) { CALL( set_LED_RGB(gpx, gpx->filament[index].LED, 0) ); } nozzle_temperature = gpx->filament[index].temperature; if(nozzle_temperature) { VERBOSE( fprintf(gpx->log, ", %uc", nozzle_temperature) ); if(gpx->tool[A].nozzle_temperature && gpx->tool[A].nozzle_temperature != nozzle_temperature) { if(program_is_running()) { CALL( set_nozzle_temperature(gpx, A, nozzle_temperature) ); } gpx->tool[A].nozzle_temperature = gpx->override[A].active_temperature = nozzle_temperature; } else { gpx->override[A].active_temperature = nozzle_temperature; } if(gpx->tool[B].nozzle_temperature && gpx->tool[B].nozzle_temperature != nozzle_temperature) { if(program_is_running()) { CALL( set_nozzle_temperature(gpx, B, nozzle_temperature) ); } gpx->tool[B].nozzle_temperature = gpx->override[B].active_temperature = nozzle_temperature; } else { gpx->override[B].active_temperature = nozzle_temperature; } } VERBOSE( fputs(EOL, gpx->log) ); } else { gcodeResult(gpx, "(line %u) Semantic error: @start with undefined filament name '%s', use a @filament macro to define it" EOL, gpx->lineNumber, name ? name : ""); } } } // ;@build else if(MACRO_IS("build")) { set_build_name(gpx, string_param ? string_param : name); } // ;@flavor else if(MACRO_IS("flavor")) { if(NAME_IS("reprap")) gpx->flag.reprapFlavor = 1; else if(NAME_IS("makerbot")) gpx->flag.reprapFlavor = 0; else { gcodeResult(gpx, "(line %u) Macro error: unrecognised GCODE flavor '%s'" EOL, gpx->lineNumber, name); } } // ;@body else if(MACRO_IS("body")) { if(gpx->flag.pausePending && gpx->flag.runMacros) { CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) ); gpx->flag.pausePending = 0; VERBOSE( gcodeResult(gpx, "Issued next pause @ %0.2lf\n", z) ); } gpx->flag.macrosEnabled = 1; } // ;@clear_cancel else if(MACRO_IS("clear_cancel")) { // allow caller to sync driver with gcode stream gcodeResult(gpx, "@clear_cancel"); } // ;@header // ;@footer else if(MACRO_IS("header") && MACRO_IS("footer")) { // REVIEW can't be both header and footer at the same time, so I don't // think this can ever be executed, what was it supposed to be for? gpx->flag.macrosEnabled = 0; } // ;@load_eeprom_map // Load the appropriate built-in eeprom map for the firmware flavor and version else if(MACRO_IS("load_eeprom_map")) { if(name) { // FUTURE parameter to allow run-time loading of non-built-in maps gcodeResult(gpx, "(line %u) Error: custom eeprommap's not supported by this version of gpx" EOL, gpx->lineNumber); } else { load_eeprom_map(gpx); } } // ;@eeprom # // Add a single eeprom mapping of to address of type with length // only applies to et_string else if(MACRO_IS("eeprom")) { if(name && string_param) { EepromType et = eepromTypeFromTypeName(string_param); if(et == et_null) { gcodeResult(gpx, "(line %u) Error: @eeprom macro unknown type name %s\n", gpx->lineNumber, string_param); } else { int len = 0; if(et == et_string) len = (int)z; add_eeprom_mapping(gpx, name, et, LED, len); } } else { gcodeResult(gpx, "(line %u) Semantic error: @eeprom macro with missing name or typename" EOL, gpx->lineNumber); } } // ;@eread // Read eeprom setting defined by earlier @eeprom macro else if(MACRO_IS("eread")) { if(name) { read_eeprom_name(gpx, name); } else { gcodeResult(gpx, "(line %u) Semantic error: @eread macro with missing name" EOL, gpx->lineNumber); } } // ;@ewrite // Write eeprom setting defined by earlier @eeprom macro else if(MACRO_IS("ewrite")) { if(name) { write_eeprom_name(gpx, name, string_param, LED, z); } else { gcodeResult(gpx, "(line %u) Error: @ewrite macro with missing name" EOL, gpx->lineNumber); } } // ;@debug else if(MACRO_IS("debug")) { // ;@debug pos // Output current position if(NAME_IS("pos")) { gcodeResult(gpx, "gpx position "); show_current_pos(gpx); char axes_names[] = "XYZAB"; char s[sizeof(axes_names)], *p = s; int i; for (i = 0; i < sizeof(axes_names); i++) { if(gpx->axis.positionKnown & (1 << i)) *p++ = axes_names[i]; } *p++ = 0; gcodeResult(gpx, "positions known: %s\n", s); } // @debug axes // Output current machine settings for each axxes else if(NAME_IS("axes")) { gcodeResult(gpx, "steps_per_mm, max_feedrate, max_acceleration, max_speed_change, home_feedrate, length, endstop\n"); Axis *a = &gpx->machine.x; char *s = "X"; gcodeResult(gpx, "%s: %.10g, %g, %g, %g, %g, %g, %u\n", s, a->steps_per_mm, a->max_feedrate, a->max_accel, a->max_speed_change, a->home_feedrate, a->length, a->endstop); a = &gpx->machine.y; s = "Y"; gcodeResult(gpx, "%s: %.10g, %g, %g, %g, %g, %g, %u\n", s, a->steps_per_mm, a->max_feedrate, a->max_accel, a->max_speed_change, a->home_feedrate, a->length, a->endstop); a = &gpx->machine.z; s = "Z"; gcodeResult(gpx, "%s: %.10g, %g, %g, %g, %g, %g, %u\n", s, a->steps_per_mm, a->max_feedrate, a->max_accel, a->max_speed_change, a->home_feedrate, a->length, a->endstop); gcodeResult(gpx, "steps_per_mm, max_feedrate, max_acceleration, max_speed_change, motor_steps, has_heated_build_platform\n"); Extruder *e = &gpx->machine.a; s = "A"; gcodeResult(gpx, "%s: %.10g, %g, %g, %g, %g, %u\n", s, e->steps_per_mm, e->max_feedrate, e->max_accel, e->max_speed_change, e->motor_steps, e->has_heated_build_platform); e = &gpx->machine.b; s = "B"; gcodeResult(gpx, "%s: %.10g, %g, %g, %g, %g, %u\n", s, e->steps_per_mm, e->max_feedrate, e->max_accel, e->max_speed_change, e->motor_steps, e->has_heated_build_platform); } // @debug progress // Output internal state relating to progress reporting else if(NAME_IS("progress")) { char *s; switch (gpx->flag.programState) { case READY_STATE: s = "READY_STATE"; break; case RUNNING_STATE: s = "RUNNING_STATE"; break; case ENDED_STATE: s = "ENDED_STATE"; break; default: s = "UNKNOWN"; break; } gcodeResult(gpx, "buildName: %s\n", gpx->buildName); gcodeResult(gpx, "buildProgress: %s\n", gpx->flag.buildProgress ? "True" : "False"); gcodeResult(gpx, "programState: %s\n", s); gcodeResult(gpx, "macrosEnabled: %s\n", gpx->flag.macrosEnabled ? "True" : "False"); gcodeResult(gpx, "runMacros: %s\n", gpx->flag.runMacros ? "True" : "False"); gcodeResult(gpx, "current.percent: %d\%\n", gpx->current.percent); gcodeResult(gpx, "total.time: %lf\n", gpx->total.time); } else if(NAME_IS("overheat")) { return 0x8B; } } return SUCCESS; } /* SIMPLE .INI FILE PARSER ini.c is released under the New BSD license (see LICENSE.txt). Go to the project home page for more info: http://code.google.com/p/inih/ Parse given INI-style file. May have [section]s, name=value pairs (whitespace stripped), and comments starting with ';' (semicolon). Section is "" if name=value pair parsed before any section heading. name:value pairs are also supported as a concession to Python's ConfigParser. For each name=value pair parsed, call handler function with given user pointer as well as section, name, and value (data only valid for duration of handler call). Handler should return 0 on success, nonzero on error. Returns 0 on success, line number of first error on parse error (doesn't stop on first error), -1 on file open error. */ #define INI_SECTION_MAX 64 #define INI_NAME_MAX 64 /* Nonzero to allow multi-line value parsing, in the style of Python's ConfigParser. If allowed, ini_parse() will call the handler with the same name for each subsequent line parsed. */ #ifndef INI_ALLOW_MULTILINE #define INI_ALLOW_MULTILINE 1 #endif /* Nonzero to allow a UTF-8 BOM sequence (0xEF 0xBB 0xBF) at the start of the file. See http://code.google.com/p/inih/issues/detail?id=21 */ #ifndef INI_ALLOW_BOM #define INI_ALLOW_BOM 1 #endif /* Strip whitespace chars off end of given string, in place. Return s. */ static char* rstrip(char* s) { char* p = s + strlen(s); while (p > s && isspace((unsigned char)(*--p))) *p = '\0'; return s; } /* Return pointer to first non-whitespace char in given string. */ static char* lskip(const char* s) { while (*s && isspace((unsigned char)(*s))) s++; return (char*)s; } /* Return pointer to first char c or ';' comment in given string, or pointer to null at end of string if neither found. ';' must be prefixed by a whitespace character to register as a comment. */ static char* find_char_or_comment(const char* s, char c) { int was_whitespace = 0; while (*s && *s != c && !(was_whitespace && *s == ';')) { was_whitespace = isspace((unsigned char)(*s)); s++; } return (char*)s; } /* Version of strncpy that ensures dest (size bytes) is null-terminated. */ static char* strncpy0(char* dest, const char* src, size_t size) { strncpy(dest, src, size); dest[size - 1] = '\0'; return dest; } /* See documentation in header file. */ static int ini_parse_file(Gpx* gpx, FILE* file, int (*handler)(Gpx*, const char*, const char*, char*)) { /* Uses a fair bit of stack (use heap instead if you need to) */ char section[INI_SECTION_MAX] = ""; char prev_name[INI_NAME_MAX] = ""; char* start; char* end; char* name; char* value; int error = 0; gpx->lineNumber = 0; /* Scan through file line by line */ while(fgets(gpx->buffer.in, BUFFER_MAX, file) != NULL) { gpx->lineNumber++; start = gpx->buffer.in; #if INI_ALLOW_BOM if(gpx->lineNumber == 1 && (unsigned char)start[0] == 0xEF && (unsigned char)start[1] == 0xBB && (unsigned char)start[2] == 0xBF) { start += 3; } #endif start = lskip(rstrip(start)); if(*start == ';' || *start == '#') { /* Per Python ConfigParser, allow '#' comments at start of line */ } #if INI_ALLOW_MULTILINE else if(*prev_name && *start && start > gpx->buffer.in) { /* Non-black line with leading whitespace, treat as continuation of previous name's value (as per Python ConfigParser). */ if(handler(gpx, section, prev_name, start) && !error) error = gpx->lineNumber; } #endif else if(*start == '[') { /* A "[section]" line */ end = find_char_or_comment(start + 1, ']'); if(*end == ']') { *end = '\0'; strncpy0(section, start + 1, sizeof(section)); *prev_name = '\0'; } else if(!error) { /* No ']' found on section line */ error = gpx->lineNumber; } } else if(*start && *start != ';') { /* Not a comment, must be a name[=:]value pair */ end = find_char_or_comment(start, '='); if(*end != '=') { end = find_char_or_comment(start, ':'); } if(*end == '=' || *end == ':') { *end = '\0'; name = rstrip(start); value = lskip(end + 1); end = find_char_or_comment(value, '\0'); if(*end == ';') *end = '\0'; rstrip(value); /* Valid name[=:]value pair found, call handler */ strncpy0(prev_name, name, sizeof(prev_name)); if(handler(gpx, section, name, value) && !error) error = gpx->lineNumber; } else if(!error) { /* No '=' or ':' found on name[=:]value line */ error = gpx->lineNumber; } } } return error; } /* See documentation in header file. */ static int ini_parse(Gpx* gpx, const char* filename, int (*handler)(Gpx*, const char*, const char*, char*)) { FILE* file; int error; unsigned ln = gpx->lineNumber; file = fopen(filename, "r"); if(!file) return ERROR; error = ini_parse_file(gpx, file, handler); gpx->lineNumber = ln; fclose(file); return error; } // Custom machine definition ini handler #define SECTION_IS(s) strcasecmp(section, s) == 0 #define PROPERTY_IS(n) strcasecmp(property, n) == 0 #define VALUE_IS(v) strcasecmp(value, v) == 0 int gpx_set_property_inner(Gpx *gpx, const char* section, const char* property, char* value); int gpx_set_property(Gpx *gpx, const char* section, const char* property, char* value) { char c, *inptr, *outptr, *ptr, *tmp, *tmp0, *tmpend; int iret; // If there is no section name or the section name has no comma, then // just set the property if(!section || !(ptr = strchr(section, ','))) return gpx_set_property_inner(gpx, section, property, value); // Section name has a comma // Strip LWSP and call gpx_set_property_inner() once for each section tmp0 = strdup(section); if(!tmp0) { SHOW( fprintf(gpx->log, "Configuration error: insufficient virtual memory" EOL) ) return gpx->lineNumber; } // Remove all LWSP outptr = inptr = tmp0; while((c = *inptr++)) if(!isspace(c)) *outptr++ = c; *outptr = '\0'; // Note the end of the resulting string tmpend = tmp0 + strlen(tmp0); tmp = tmp0; iret = SUCCESS; loop: // Find the next token. We could use strtok(_r) but it's not on all systems ptr = strchr(tmp, ','); if(ptr) *ptr = '\0'; if((iret = gpx_set_property_inner(gpx, tmp, property, value))) goto done; // Advance to the next section tmp = ptr ? ptr + 1 : tmpend; // If there's more left, then repeat if(tmp < tmpend) goto loop; done: if(tmp0) free(tmp0); return iret; } int gpx_parse_steps_per_mm_all_axes(Gpx *gpx, char *parm); int gpx_set_property_inner(Gpx *gpx, const char* section, const char* property, char* value) { int rval; if(SECTION_IS("") || SECTION_IS("macro")) { if(PROPERTY_IS("slicer") || PROPERTY_IS("filament") || PROPERTY_IS("pause") || PROPERTY_IS("start") || PROPERTY_IS("temp") || PROPERTY_IS("temperature")) { CALL( parse_macro(gpx, property, value) ); } else if(PROPERTY_IS("verbose")) { gpx->flag.verboseMode = atoi(value); } else goto SECTION_ERROR; } else if(SECTION_IS("printer") || SECTION_IS("slicer")) { if(PROPERTY_IS("ditto_printing")) gpx->flag.dittoPrinting = atoi(value); else if(PROPERTY_IS("build_progress")) gpx->flag.buildProgress = atoi(value); else if(PROPERTY_IS("packing_density")) gpx->machine.nominal_packing_density = strtod(value, NULL); else if(PROPERTY_IS("recalculate_5d")) gpx->flag.rewrite5D = atoi(value); else if(PROPERTY_IS("nominal_filament_diameter") || PROPERTY_IS("slicer_filament_diameter") || PROPERTY_IS("filament_diameter")) { gpx->machine.nominal_filament_diameter = strtod(value, NULL); } else if(PROPERTY_IS("machine_type")) { // only load/clobber the on-board machine definition if the one specified is different if(gpx_set_machine(gpx, value, 0)) { gcodeResult(gpx, "(line %u) Configuration error: unrecognised machine type '%s'" EOL, gpx->lineNumber, value); return gpx->lineNumber; } gpx->override[A].packing_density = gpx->machine.nominal_packing_density; gpx->override[B].packing_density = gpx->machine.nominal_packing_density; } else if(PROPERTY_IS("gcode_flavor")) { // use on-board machine definition if(VALUE_IS("reprap")) gpx->flag.reprapFlavor = 1; else if(VALUE_IS("makerbot")) gpx->flag.reprapFlavor = 0; else { gcodeResult(gpx, "(line %u) Configuration error: unrecognised GCODE flavor '%s'" EOL, gpx->lineNumber, value); return gpx->lineNumber; } } else if(PROPERTY_IS("build_platform_temperature")) { if(gpx->machine.a.has_heated_build_platform) gpx->override[A].build_platform_temperature = atoi(value); if(gpx->machine.b.has_heated_build_platform) gpx->override[B].build_platform_temperature = atoi(value); } else if(PROPERTY_IS("sd_card_path")) { gpx->sdCardPath = strdup(value); } else if(PROPERTY_IS("verbose")) { gpx->flag.verboseMode = atoi(value); } else if(PROPERTY_IS("machine_description") || PROPERTY_IS("nozzle_diameter") || PROPERTY_IS("toolhead_offset_x") || PROPERTY_IS("toolhead_offset_y") || PROPERTY_IS("toolhead_offset_z") || PROPERTY_IS("jkn_k") || PROPERTY_IS("jkn_k2") || PROPERTY_IS("nozzle_diameter") || PROPERTY_IS("extruder_count") || PROPERTY_IS("timeout")) { } else goto SECTION_ERROR; } else if(SECTION_IS("x")) { if(PROPERTY_IS("max_feedrate")) gpx->machine.x.max_feedrate = strtod(value, NULL); else if(PROPERTY_IS("home_feedrate")) gpx->machine.x.home_feedrate = strtod(value, NULL); else if(PROPERTY_IS("steps_per_mm")) gpx->machine.x.steps_per_mm = strtod(value, NULL); else if(PROPERTY_IS("endstop")) gpx->machine.x.endstop = atoi(value); else if(PROPERTY_IS("max_acceleration") || PROPERTY_IS("max_speed_change") || PROPERTY_IS("length")) { } else goto SECTION_ERROR; } else if(SECTION_IS("y")) { if(PROPERTY_IS("max_feedrate")) gpx->machine.y.max_feedrate = strtod(value, NULL); else if(PROPERTY_IS("home_feedrate")) gpx->machine.y.home_feedrate = strtod(value, NULL); else if(PROPERTY_IS("steps_per_mm")) gpx->machine.y.steps_per_mm = strtod(value, NULL); else if(PROPERTY_IS("endstop")) gpx->machine.y.endstop = atoi(value); else if(PROPERTY_IS("max_acceleration") || PROPERTY_IS("max_speed_change") || PROPERTY_IS("length")) { } else goto SECTION_ERROR; } else if(SECTION_IS("z")) { if(PROPERTY_IS("max_feedrate")) gpx->machine.z.max_feedrate = strtod(value, NULL); else if(PROPERTY_IS("home_feedrate")) gpx->machine.z.home_feedrate = strtod(value, NULL); else if(PROPERTY_IS("steps_per_mm")) gpx->machine.z.steps_per_mm = strtod(value, NULL); else if(PROPERTY_IS("endstop")) gpx->machine.z.endstop = atoi(value); else if(PROPERTY_IS("max_acceleration") || PROPERTY_IS("max_speed_change") || PROPERTY_IS("length")) { } else goto SECTION_ERROR; } else if(SECTION_IS("a")) { if(PROPERTY_IS("max_feedrate")) gpx->machine.a.max_feedrate = strtod(value, NULL); else if(PROPERTY_IS("steps_per_mm")) gpx->machine.a.steps_per_mm = strtod(value, NULL); else if(PROPERTY_IS("motor_steps")) gpx->machine.a.motor_steps = strtod(value, NULL); else if(PROPERTY_IS("has_heated_build_platform")) gpx->machine.a.has_heated_build_platform = atoi(value); else if(PROPERTY_IS("max_acceleration") || PROPERTY_IS("max_speed_change")) { } else goto SECTION_ERROR; } else if(SECTION_IS("right")) { if(PROPERTY_IS("active_temperature") || PROPERTY_IS("nozzle_temperature")) gpx->override[A].active_temperature = atoi(value); else if(PROPERTY_IS("standby_temperature")) gpx->override[A].standby_temperature = atoi(value); else if(PROPERTY_IS("build_platform_temperature")) gpx->override[A].build_platform_temperature = atoi(value); else if(PROPERTY_IS("actual_filament_diameter")) gpx->override[A].actual_filament_diameter = strtod(value, NULL); else if(PROPERTY_IS("packing_density")) gpx->override[A].packing_density = strtod(value, NULL); else goto SECTION_ERROR; } else if(SECTION_IS("b")) { if(PROPERTY_IS("max_feedrate")) gpx->machine.b.max_feedrate = strtod(value, NULL); else if(PROPERTY_IS("steps_per_mm")) gpx->machine.b.steps_per_mm = strtod(value, NULL); else if(PROPERTY_IS("motor_steps")) gpx->machine.b.motor_steps = strtod(value, NULL); else if(PROPERTY_IS("has_heated_build_platform")) gpx->machine.b.has_heated_build_platform = atoi(value); else if(PROPERTY_IS("max_acceleration") || PROPERTY_IS("max_speed_change")) { } else goto SECTION_ERROR; } else if(SECTION_IS("left")) { if(PROPERTY_IS("active_temperature") || PROPERTY_IS("nozzle_temperature")) gpx->override[B].active_temperature = atoi(value); else if(PROPERTY_IS("standby_temperature")) gpx->override[B].standby_temperature = atoi(value); else if(PROPERTY_IS("build_platform_temperature")) gpx->override[B].build_platform_temperature = atoi(value); else if(PROPERTY_IS("actual_filament_diameter")) gpx->override[B].actual_filament_diameter = strtod(value, NULL); else if(PROPERTY_IS("packing_density")) gpx->override[B].packing_density = strtod(value, NULL); else goto SECTION_ERROR; } else if(SECTION_IS("machine")) { if(PROPERTY_IS("nominal_filament_diameter") || PROPERTY_IS("slicer_filament_diameter")) gpx->machine.nominal_filament_diameter = strtod(value, NULL); else if(PROPERTY_IS("packing_density")) gpx->machine.nominal_packing_density = strtod(value, NULL); else if(PROPERTY_IS("nozzle_diameter")) gpx->machine.nozzle_diameter = strtod(value, NULL); else if(PROPERTY_IS("extruder_count")) { gpx->machine.extruder_count = atoi(value); gpx->axis.mask = gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK;; } else if(PROPERTY_IS("timeout")) gpx->machine.timeout = atoi(value); else if(PROPERTY_IS("steps_per_mm")) { gpx_parse_steps_per_mm_all_axes(gpx, value); } else goto SECTION_ERROR; } else { gcodeResult(gpx, "(line %u) Configuration error: unrecognised section [%s]" EOL, gpx->lineNumber, section); return gpx->lineNumber; } return SUCCESS; SECTION_ERROR: gcodeResult(gpx, "(line %u) Configuration error: [%s] section contains unrecognised property %s = %s" EOL, gpx->lineNumber, section, property, value); return gpx->lineNumber; } // parse a steps per mm parameter of the form x88.9y88.9z94.5a102.4b105.7 int gpx_parse_steps_per_mm_all_axes(Gpx *gpx, char *parm) { if(parm == NULL) return SUCCESS; char *s = parm; char axis = *s; while(*s++) { if (isdigit(*s)) { double steps = strtod(s, &s); switch(tolower(axis)) { case 'x': gpx->machine.x.steps_per_mm = steps; break; case 'y': gpx->machine.y.steps_per_mm = steps; break; case 'z': gpx->machine.z.steps_per_mm = steps; break; case 'a': gpx->machine.a.steps_per_mm = steps; break; case 'b': gpx->machine.b.steps_per_mm = steps; break; default: gcodeResult(gpx, "(line %u) Configuration error: steps per mm parameter (%s) contains unrecognized axis '%c'\n", gpx->lineNumber, parm, axis); } } axis = *s; } return SUCCESS; } int gpx_load_config(Gpx *gpx, const char *filename) { VERBOSE( fprintf(gpx->log, "Loading config: %s\n", filename) ); if(gpx->iniPath != NULL) { free(gpx->iniPath); gpx->iniPath = NULL; } char *t = strdup(filename); if(t != NULL) { gpx->iniPath = strdup(dirname(t)); free(t); } int rval = ini_parse(gpx, filename, gpx_set_property); if(rval == 0) VERBOSE( fprintf(gpx->log, "Loaded config: %s\n", filename) ); return rval; } void gpx_register_callback(Gpx *gpx, int (*callbackHandler)(Gpx*, void*, char*, size_t), void *callbackData) { gpx->callbackHandler = callbackHandler; gpx->callbackData = callbackData; } static int process_options(Gpx *gpx, int item_code, va_list ap) { if(!gpx) { SHOW( fprintf(gpx->log, "GPX programming error; NULL context " "passed to process_options(); aborting " EOL) ); return ERROR; } while (item_code) { switch (item_code) { case ITEM_FRAMING_ENABLE : gpx->flag.framingEnabled = 1; break; case ITEM_FRAMING_DISABLE : gpx->flag.framingEnabled = 0; break; default : // Unrecognized item code; error SHOW( fprintf(gpx->log, "GPX programming error; invalid " "item code %d used; aborting " EOL, item_code) ); return ERROR; } item_code = va_arg(ap, int); } return SUCCESS; } void gpx_start_convert(Gpx *gpx, char *buildName, int item_code, ...) { if(item_code) { va_list ap; int retstat; va_start(ap, item_code); retstat = process_options(gpx, item_code, ap); va_end(ap); if(retstat != SUCCESS) return; } if(buildName) set_build_name(gpx, buildName); if(gpx->flag.dittoPrinting && gpx->machine.extruder_count == 1) { SHOW( fputs("Configuration error: ditto printing cannot access non-existant second extruder" EOL, gpx->log) ); gpx->flag.dittoPrinting = 0; } // CALCULATE FILAMENT SCALING if(gpx->override[A].actual_filament_diameter > 0.0001 && gpx->override[A].actual_filament_diameter != gpx->machine.nominal_filament_diameter) { set_filament_scale(gpx, A, gpx->override[A].actual_filament_diameter); } if(gpx->override[B].actual_filament_diameter > 0.0001 && gpx->override[B].actual_filament_diameter != gpx->machine.nominal_filament_diameter) { set_filament_scale(gpx, B, gpx->override[B].actual_filament_diameter); } } // M105: Get Extruder Temperature static int get_extruder_temperature_extended(Gpx *gpx) { int rval; CALL(get_build_statistics(gpx)); CALL(get_extruder_temperature(gpx, 0)); CALL(get_extruder_target_temperature(gpx, 0)); if(gpx->machine.extruder_count > 1) { CALL(get_extruder_temperature(gpx, 1)); CALL(get_extruder_target_temperature(gpx, 1)); } if(gpx->machine.a.has_heated_build_platform) { CALL(get_build_platform_temperature(gpx, 0)); CALL(get_build_platform_target_temperature(gpx, 0)); } else if(gpx->machine.b.has_heated_build_platform) { CALL(get_build_platform_temperature(gpx, 1)); CALL(get_build_platform_target_temperature(gpx, 1)); } return SUCCESS; } int gpx_convert_line(Gpx *gpx, char *gcode_line) { int i, rval; int next_line = 0; int command_emitted = 0; // reset flag state gpx->command.flag = 0; char *digits; char *p = gcode_line; // current parser location while(isspace(*p)) p++; VERBOSESIO( if(gpx->flag.sioConnected) fprintf(gpx->log, "gcode_line: %s\n", gcode_line); ) // check for line number if(*p == 'n' || *p == 'N') { digits = p; p = normalize_word(p); if(*p == 0) { gcodeResult(gpx, "(line %u) Syntax error: line number command word 'N' is missing digits" EOL, gpx->lineNumber); next_line = gpx->lineNumber + 1; } else { next_line = gpx->lineNumber = atoi(digits); } } else { next_line = gpx->lineNumber + 1; } // parse command words in command line while(*p != 0) { if(isalpha(*p)) { int c = *p; digits = p; p = normalize_word(p); switch(c) { // PARAMETERS // Xnnn X coordinate, usually to move to case 'x': case 'X': gpx->command.x = strtod(digits, NULL); gpx->command.flag |= X_IS_SET; break; // Ynnn Y coordinate, usually to move to case 'y': case 'Y': gpx->command.y = strtod(digits, NULL); gpx->command.flag |= Y_IS_SET; break; // Znnn Z coordinate, usually to move to case 'z': case 'Z': gpx->command.z = strtod(digits, NULL); gpx->command.flag |= Z_IS_SET; break; // Annn Length of extrudate in mm. case 'a': case 'A': gpx->command.a = strtod(digits, NULL); gpx->command.flag |= A_IS_SET; break; // Bnnn Length of extrudate in mm. case 'b': case 'B': gpx->command.b = strtod(digits, NULL); gpx->command.flag |= B_IS_SET; break; // Ennn Length of extrudate in mm. case 'e': case 'E': gpx->command.e = strtod(digits, NULL); gpx->command.flag |= E_IS_SET; break; // Fnnn Feedrate in mm per minute. case 'f': case 'F': gpx->command.f = strtod(digits, NULL); gpx->command.flag |= F_IS_SET; break; // Pnnn Command parameter, such as a time in milliseconds case 'p': case 'P': gpx->command.p = strtod(digits, NULL); gpx->command.flag |= P_IS_SET; break; // Rnnn Command Parameter, such as RPM case 'r': case 'R': gpx->command.r = strtod(digits, NULL); gpx->command.flag |= R_IS_SET; break; // Snnn Command parameter, such as temperature case 's': case 'S': gpx->command.s = strtod(digits, NULL); gpx->command.flag |= S_IS_SET; break; // COMMANDS // Gnnn GCode command, such as move to a point case 'g': case 'G': gpx->command.g = atoi(digits); gpx->command.flag |= G_IS_SET; break; // Mnnn RepRap-defined command case 'm': case 'M': gpx->command.m = atoi(digits); gpx->command.flag |= M_IS_SET; if(gpx->command.m == 23 || gpx->command.m == 28) { char *s = p + 1; while(*s && *s != '*') s++; if(*s) *s++ = 0; gpx->command.arg = normalize_comment(p + 1); gpx->command.flag |= ARG_IS_SET; p = s; } break; // Tnnn Select extruder nnn. case 't': case 'T': gpx->command.t = atoi(digits); gpx->command.flag |= T_IS_SET; break; // Nnnn Line number case 'n': case 'N': // this line's number was already stripped off, so this should // be a parameter to an M110 which GPX does not currently implement // so we'll silently ignore if((gpx->command.flag & M_IS_SET) && gpx->command.m == 110) break; // fallthrough default: gcodeResult(gpx, "(line %u) Syntax warning: unrecognised command word '%c'" EOL, gpx->lineNumber, c); } } else if(*p == ';') { if(*(p + 1) == '@') { char *s = p + 2; if(isalpha(*s)) { char *macro = s; // skip any no space characters while(*s && !isspace(*s)) s++; // null terminate if(*s) *s++ = 0; CALL( parse_macro(gpx, macro, normalize_comment(s)) ); *p = 0; break; } } // Comment gpx->command.comment = normalize_comment(p + 1); gpx->command.flag |= COMMENT_IS_SET; *p = 0; break; } else if(*p == '(') { if(*(p + 1) == '@') { char *s = p + 2; if(isalpha(*s)) { char *macro = s; char *e = strrchr(p + 1, ')'); // skip any no space characters while(*s && !isspace(*s)) s++; // null terminate if(*s) *s++ = 0; if(e) *e = 0; CALL( parse_macro(gpx, macro, normalize_comment(s)) ); *p = 0; break; } } // Comment char *s = strchr(p + 1, '('); char *e = strchr(p + 1, ')'); // check for nested comment if(s && e && s < e) { gcodeResult(gpx, "(line %u) Syntax warning: nested comment detected" EOL, gpx->lineNumber); e = strrchr(p + 1, ')'); } if(e) { *e = 0; gpx->command.comment = normalize_comment(p + 1); gpx->command.flag |= COMMENT_IS_SET; p = e + 1; } else { gcodeResult(gpx, "(line %u) Syntax warning: comment is missing closing ')'" EOL, gpx->lineNumber); gpx->command.comment = normalize_comment(p + 1); gpx->command.flag |= COMMENT_IS_SET; *p = 0; break; } } else if(*p == '*') { // Checksum *p = 0; break; } else if(iscntrl(*p)) { break; } else { gcodeResult(gpx, "(line %u) Syntax error: unrecognised gcode '%s'" EOL, gpx->lineNumber, p); break; } } // revert tool selection to current extruder (Makerbot Tn is not sticky) if(!gpx->flag.reprapFlavor || gpx->flag.onlyExplicitToolChange) gpx->target.extruder = gpx->current.extruder; // change the extruder selection (in the virtual tool carosel) if(gpx->command.flag & T_IS_SET && !gpx->flag.dittoPrinting) { unsigned tool_id = (unsigned)gpx->command.t; if(tool_id < gpx->machine.extruder_count) { gpx->target.extruder = tool_id; } else { gcodeResult(gpx, "(line %u) Semantic warning: T%u cannot select non-existant extruder" EOL, gpx->lineNumber, tool_id); } } // we treat E as short hand for A or B being set, depending on the state of the gpx->current.extruder if(gpx->command.flag & E_IS_SET) { if(gpx->current.extruder == 0) { // a = e gpx->command.flag |= A_IS_SET; gpx->command.a = gpx->command.e; } else { // b = e gpx->command.flag |= B_IS_SET; gpx->command.b = gpx->command.e; } } // INTERPRET COMMAND Point5d delta; int relative; if(gpx->command.flag & G_IS_SET) { switch(gpx->command.g) { // G0 - Rapid Positioning case 0: { double feedrate = 0.0; CALL( calculate_target_position(gpx, &delta, &relative) ); if(!(gpx->command.flag & F_IS_SET)) { if(gpx->command.flag & X_IS_SET) delta.x = fabs(delta.x); if(gpx->command.flag & Y_IS_SET) delta.y = fabs(delta.y); if(gpx->command.flag & Z_IS_SET) delta.z = fabs(delta.z); double length = magnitude(gpx->command.flag & XYZ_BIT_MASK, (Ptr5d)&delta); double candidate; feedrate = DBL_MAX; if(gpx->command.flag & X_IS_SET && delta.x != 0.0) { feedrate = gpx->machine.x.max_feedrate * length / delta.x; } if(gpx->command.flag & Y_IS_SET && delta.y != 0.0) { candidate = gpx->machine.y.max_feedrate * length / delta.y; if(feedrate > candidate) { feedrate = candidate; } } if(gpx->command.flag & Z_IS_SET && delta.z != 0.0) { candidate = gpx->machine.z.max_feedrate * length / delta.z; if(feedrate > candidate) { feedrate = candidate; } } if(feedrate == DBL_MAX) { feedrate = gpx->machine.x.max_feedrate; } } CALL( queue_ext_point(gpx, feedrate, &delta, relative) ); update_current_position(gpx); command_emitted++; break; } // G1 - Coordinated Motion case 1: CALL( calculate_target_position(gpx, &delta, &relative) ); CALL( queue_ext_point(gpx, 0.0, &delta, relative) ); update_current_position(gpx); command_emitted++; break; // G2 - Clockwise Arc // G3 - Counter Clockwise Arc // G4 - Dwell case 4: if(gpx->command.flag & P_IS_SET) { #if ENABLE_SIMULATED_RPM if(gpx->tool[gpx->current.extruder].motor_enabled && gpx->tool[gpx->current.extruder].rpm) { CALL( calculate_target_position(gpx, &delta, &relative) ); CALL( queue_new_point(gpx, gpx->command.p) ); command_emitted++; } else #endif { CALL( delay(gpx, gpx->command.p) ); command_emitted++; } } else { gcodeResult(gpx, "(line %u) Syntax error: G4 is missing delay parameter, use Pn where n is milliseconds" EOL, gpx->lineNumber); } break; // G10 - Create Coordinate System Offset from the Absolute one case 10: if(gpx->command.flag & P_IS_SET && gpx->command.p >= 1.0 && gpx->command.p <= 6.0) { i = (int)gpx->command.p; if(gpx->command.flag & X_IS_SET) gpx->offset[i].x = gpx->command.x; if(gpx->command.flag & Y_IS_SET) gpx->offset[i].y = gpx->command.y; if(gpx->command.flag & Z_IS_SET) gpx->offset[i].z = gpx->command.z; // set standby temperature if(gpx->command.flag & R_IS_SET) { unsigned temperature = (unsigned)gpx->command.r; if(temperature > NOZZLE_MAX) temperature = NOZZLE_MAX; switch(i) { case 1: gpx->override[A].standby_temperature = temperature; break; case 2: gpx->override[B].standby_temperature = temperature; break; } } // set tool temperature if(gpx->command.flag & S_IS_SET) { unsigned temperature = (unsigned)gpx->command.s; if(temperature > NOZZLE_MAX) temperature = NOZZLE_MAX; switch(i) { case 1: gpx->override[A].active_temperature = temperature; break; case 2: gpx->override[B].active_temperature = temperature; break; } } } else { gcodeResult(gpx, "(line %u) Syntax error: G10 is missing coordiante system, use Pn where n is 1-6" EOL, gpx->lineNumber); } break; // G21 - Use Milimeters as Units (IGNORED) // G71 - Use Milimeters as Units (IGNORED) case 21: case 71: break; // G28 - Home given axes to machine defined endstop case 28: { unsigned endstop_max = 0; unsigned endstop_min = 0; // none means all if((gpx->command.flag & gpx->axis.mask) == 0) gpx->command.flag |= XYZ_BIT_MASK; if(gpx->command.flag & F_IS_SET) gpx->current.feedrate = gpx->command.f; if(gpx->command.flag & X_IS_SET) { if(gpx->machine.x.endstop) { endstop_max |= X_IS_SET; } else { endstop_min |= X_IS_SET; } } if(gpx->command.flag & Y_IS_SET) { if(gpx->machine.y.endstop) { endstop_max |= Y_IS_SET; } else { endstop_min |= Y_IS_SET; } } if(gpx->command.flag & Z_IS_SET) { if(gpx->machine.z.endstop) { endstop_max |= Z_IS_SET; } else { endstop_min |= Z_IS_SET; } } // home xy before z if(gpx->machine.x.endstop) { if(endstop_max) { CALL( home_axes(gpx, endstop_max, ENDSTOP_IS_MAX) ); } if(endstop_min) { CALL( home_axes(gpx, endstop_min, ENDSTOP_IS_MIN) ); } } else { if(endstop_min) { CALL( home_axes(gpx, endstop_min, ENDSTOP_IS_MIN) ); } if(endstop_max) { CALL( home_axes(gpx, endstop_max, ENDSTOP_IS_MAX) ); } } command_emitted++; gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; break; } // G53 - Set absolute coordinate system case 53: gpx->current.offset = 0; break; // G54 - Use coordinate system from G10 P1 case 54: gpx->current.offset = 1; break; // G55 - Use coordinate system from G10 P2 case 55: gpx->current.offset = 2; break; // G56 - Use coordinate system from G10 P3 case 56: gpx->current.offset = 3; break; // G57 - Use coordinate system from G10 P4 case 57: gpx->current.offset = 4; break; // G58 - Use coordinate system from G10 P5 case 58: gpx->current.offset = 5; break; // G59 - Use coordinate system from G10 P6 case 59: gpx->current.offset = 6; break; // G90 - Absolute Positioning case 90: gpx->flag.relativeCoordinates = 0; break; // G91 - Relative Positioning case 91: gpx->flag.relativeCoordinates = 1; break; // G92 - Define current position on axes case 92: { double userScale = gpx->flag.macrosEnabled ? gpx->user.scale : 1.0; if(gpx->command.flag & X_IS_SET) gpx->current.position.x = gpx->command.x * userScale; if(gpx->command.flag & Y_IS_SET) gpx->current.position.y = gpx->command.y * userScale; if(gpx->command.flag & Z_IS_SET) gpx->current.position.z = gpx->command.z * userScale; if(gpx->command.flag & A_IS_SET) gpx->current.position.a = gpx->command.a; if(gpx->command.flag & B_IS_SET) gpx->current.position.b = gpx->command.b; if(((gpx->axis.positionKnown | gpx->command.flag) & gpx->axis.mask) != gpx->axis.mask) { // there's a problem with MakerBot's version of G92 (140 set extended position) in that // it must take all coordinates, so if a G92 specifies a subset, the other coordinates // are set as a side effect to whatever GPX thinks is "current" whether it knows or not gcodeResult(gpx, "(line %u) warning G92 emulation unable to determine all coordinates to set via x3g:140 set extended position\n", gpx->lineNumber); gcodeResult(gpx, "current position defined as "); show_current_pos(gpx); } CALL( set_position(gpx) ); command_emitted++; // flag axes that are known gpx->axis.positionKnown |= (gpx->command.flag & gpx->axis.mask); break; } // G130 - Set given axes potentiometer Value case 130: if(gpx->command.flag & X_IS_SET) { CALL( set_pot_value(gpx, 0, gpx->command.x < 0 ? 0 : gpx->command.x > 255 ? 255 : (unsigned)gpx->command.x) ); } if(gpx->command.flag & Y_IS_SET) { CALL( set_pot_value(gpx, 1, gpx->command.y < 0 ? 0 : gpx->command.y > 255 ? 255 : (unsigned)gpx->command.y) ); } if(gpx->command.flag & Z_IS_SET) { CALL( set_pot_value(gpx, 2, gpx->command.z < 0 ? 0 : gpx->command.z > 255 ? 255 : (unsigned)gpx->command.z) ); } if(gpx->command.flag & A_IS_SET) { CALL( set_pot_value(gpx, 3, gpx->command.a < 0 ? 0 : gpx->command.a > 255 ? 255 : (unsigned)gpx->command.a) ); } if(gpx->command.flag & B_IS_SET) { CALL( set_pot_value(gpx, 4, gpx->command.b < 0 ? 0 : gpx->command.b > 255 ? 255 : (unsigned)gpx->command.b) ); } break; // G161 - Home given axes to minimum case 161: if(gpx->command.flag & F_IS_SET) gpx->current.feedrate = gpx->command.f; CALL( home_axes(gpx, gpx->command.flag & XYZ_BIT_MASK, ENDSTOP_IS_MIN) ); command_emitted++; // clear homed axes gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; break; // G162 - Home given axes to maximum case 162: if(gpx->command.flag & F_IS_SET) gpx->current.feedrate = gpx->command.f; CALL( home_axes(gpx, gpx->command.flag & XYZ_BIT_MASK, ENDSTOP_IS_MAX) ); command_emitted++; // clear homed axes gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask); gpx->excess.a = 0; gpx->excess.b = 0; break; default: gcodeResult(gpx, "(line %u) Syntax warning: unsupported gcode command 'G%u'" EOL, gpx->lineNumber, gpx->command.g); } } else if(gpx->command.flag & M_IS_SET) { switch(gpx->command.m) { // M0 - Marlin pause case 0: break; // M1 - ANSI pause, Marlin pause case 1: pause_resume(gpx); break; // M2 - Program end case 2: if(program_is_running()) { end_program(); CALL( set_build_progress(gpx, 100) ); CALL( end_build(gpx) ); } return END_OF_FILE; // M6 - Automatic tool change (AND) // M116 - Wait for extruder AND build platfrom to reach (or exceed) temperature case 6: case 116: { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; if(!gpx->flag.dittoPrinting && #if !ENABLE_TOOL_CHANGE_ON_WAIT gpx->command.m == 6 && #endif gpx->target.extruder != gpx->current.extruder) { CALL( do_tool_change(gpx, timeout) ); command_emitted++; } // wait for heated build platform if(gpx->machine.a.has_heated_build_platform && gpx->tool[A].build_platform_temperature > 0) { CALL( wait_for_build_platform(gpx, A, timeout) ); command_emitted++; } else if(gpx->machine.b.has_heated_build_platform && gpx->tool[B].build_platform_temperature > 0) { CALL( wait_for_build_platform(gpx, B, timeout) ); command_emitted++; } // wait for extruder if(gpx->flag.dittoPrinting || (gpx->command.m == 116 && !(gpx->command.flag & T_IS_SET))) { if(gpx->tool[B].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, B, timeout) ); } if(gpx->tool[A].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, A, timeout) ); if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } command_emitted++; } else { if(gpx->tool[gpx->target.extruder].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, gpx->target.extruder, timeout) ); command_emitted++; if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } } break; } // M17 - Enable axes steppers case 17: if(gpx->command.flag & AXES_BIT_MASK) { CALL( set_steppers(gpx, gpx->command.flag & AXES_BIT_MASK, 1) ); command_emitted++; if(gpx->command.flag & A_IS_SET) gpx->tool[A].motor_enabled = 1; if(gpx->command.flag & B_IS_SET) gpx->tool[B].motor_enabled = 1; } else { CALL( set_steppers(gpx, gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK, 1) ); command_emitted++; gpx->tool[A].motor_enabled = 1; if(gpx->machine.extruder_count == 2) gpx->tool[B].motor_enabled = 1; } break; // M18 - Disable axes steppers case 18: if(gpx->command.flag & AXES_BIT_MASK) { CALL( set_steppers(gpx, gpx->command.flag & AXES_BIT_MASK, 0) ); command_emitted++; if(gpx->command.flag & A_IS_SET) gpx->tool[A].motor_enabled = 0; if(gpx->command.flag & B_IS_SET) gpx->tool[B].motor_enabled = 0; } else { CALL( set_steppers(gpx, gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK, 0) ); command_emitted++; gpx->tool[A].motor_enabled = 0; if(gpx->machine.extruder_count == 2) gpx->tool[B].motor_enabled = 0; } break; // M20 - List SD card case 20: // fallthrough // M21 - Init SD card case 21: CALL( get_next_filename(gpx, 1) ); break; // M22 - Release SD card case 22: break; // M23 - Select SD file case 23: if(gpx->command.flag & ARG_IS_SET) CALL( select_filename(gpx, gpx->command.arg) ); break; // M24 - Start/resume SD print case 24: if(gpx->flag.sd_paused) { CALL( pause_resume(gpx) ); gpx->flag.sd_paused = 0; } else if(gpx->selectedFilename != NULL) { CALL( play_back_capture(gpx, gpx->selectedFilename) ); } break; // M25 - Pause SD print case 25: if(!gpx->flag.sd_paused) { CALL( pause_resume(gpx) ); gpx->flag.sd_paused = 1; } break; // M26 - Set SD position case 26: // s3g doesn't have a set SD position // looks like software uses the sequence M25\nM26 S0 to cancel // the print so that the next M24 will start over VERBOSE( {if(gpx->command.flag & S_IS_SET && gpx->command.s > 0) fprintf(gpx->log, "Only reset to sd position 0 is supported: M26 S0" EOL);} ) break; // M27 - Report SD print status case 27: CALL( get_build_statistics(gpx) ); CALL( get_extended_position(gpx) ); break; // M28 - Begin write to SD card case 28: if(gpx->command.flag & ARG_IS_SET) { CALL( capture_to_file(gpx, gpx->command.arg) ); } break; // M29 - Stop writing to SD card case 29: CALL( end_capture_to_file(gpx) ); break; // M30 - Delete file from SD card case 30: break; // M31 - Output time since last M109 or SD card start to serial case 31: break; // M70 - Display message on LCD case 70: if(gpx->command.flag & COMMENT_IS_SET) { unsigned vPos = gpx->command.flag & Y_IS_SET ? (unsigned)gpx->command.y : 0; if(vPos > 3) vPos = 3; unsigned hPos = gpx->command.flag & X_IS_SET ? (unsigned)gpx->command.x : 0; if(hPos > 19) hPos = 19; int timeout = gpx->command.flag & P_IS_SET ? gpx->command.p : 0; CALL( display_message(gpx, gpx->command.comment, vPos, hPos, timeout, 0) ); command_emitted++; } else { gcodeResult(gpx, "(line %u) Syntax error: M70 is missing message text, use (text) where text is message" EOL, gpx->lineNumber); } break; // M71 - Display message and wait for button press case 71: { char *message = gpx->command.flag & COMMENT_IS_SET ? gpx->command.comment : "Press M to continue"; unsigned vPos = gpx->command.flag & Y_IS_SET ? (unsigned)gpx->command.y : 0; if(vPos > 3) vPos = 3; unsigned hPos = gpx->command.flag & X_IS_SET ? (unsigned)gpx->command.x : 0; if(hPos > 19) hPos = 19; int timeout = gpx->command.flag & P_IS_SET ? gpx->command.p : 0; CALL( display_message(gpx, message, vPos, hPos, timeout, 1) ); command_emitted++; break; } // M72 - Queue a song or play a tone case 72: if(gpx->command.flag & P_IS_SET) { unsigned song_id = (unsigned)gpx->command.p; if(song_id > 2) song_id = 2; CALL( queue_song(gpx, song_id) ); command_emitted++; } else { gcodeResult(gpx, "(line %u) Syntax warning: M72 is missing song number, use Pn where n is 0-2" EOL, gpx->lineNumber); } break; // M73 - Manual set build percentage case 73: if(gpx->command.flag & P_IS_SET) { unsigned percent = (unsigned)gpx->command.p; if(percent > 100) percent = 100; if(program_is_ready() && percent < 100) { start_program(); if(!gpx->nostart) { CALL( start_build(gpx, gpx->buildName) ); } CALL( set_build_progress(gpx, percent) ); // start extruder in a known state CALL( change_extruder_offset(gpx, gpx->current.extruder) ); } else if(program_is_running()) { if(percent == 100) { // disable macros in footer gpx->flag.macrosEnabled = 0; end_program(); CALL( set_build_progress(gpx, 100) ); if(!gpx->noend) { CALL( end_build(gpx) ); } } else { // enable macros in object body if(!gpx->flag.macrosEnabled && percent > 0) { if(gpx->flag.pausePending && gpx->flag.runMacros) { CALL( pause_at_zpos(gpx, gpx->commandAt[0].z) ); gpx->flag.pausePending = 0; VERBOSE( gcodeResult(gpx, "Issued next pause @ %0.2lf\n", gpx->commandAt[0].z) ); } gpx->flag.macrosEnabled = 1; } if(gpx->current.percent < percent && (percent == 1 || gpx->total.time == 0.0 || gpx->flag.buildProgress == 0)) { CALL( set_build_progress(gpx, percent) ); } } } } else { gcodeResult(gpx, "(line %u) Syntax warning: M73 is missing build percentage, use Pn where n is 0-100" EOL, gpx->lineNumber); } break; // M82 - set extruder to absolute mode case 82: gpx->flag.extruderIsRelative = 0; break; // M83 - set extruder to relative mode case 83: gpx->flag.extruderIsRelative = 1; break; // M84 - Disable steppers until next move case 84: CALL( set_steppers(gpx, gpx->machine.extruder_count == 1 ? (XYZ_BIT_MASK | A_IS_SET) : AXES_BIT_MASK, 0) ); command_emitted++; gpx->tool[A].motor_enabled = 0; if(gpx->machine.extruder_count == 2) gpx->tool[B].motor_enabled = 0; break; // M101 - Turn extruder on, forward // M102 - Turn extruder on, reverse case 101: case 102: if(gpx->flag.dittoPrinting) { CALL( set_steppers(gpx, A_IS_SET|B_IS_SET, 1) ); command_emitted++; gpx->tool[A].motor_enabled = gpx->tool[B].motor_enabled = gpx->command.m == 101 ? 1 : -1; } else { CALL( set_steppers(gpx, gpx->target.extruder == 0 ? A_IS_SET : B_IS_SET, 1) ); command_emitted++; gpx->tool[gpx->target.extruder].motor_enabled = gpx->command.m == 101 ? 1 : -1; } break; // M103 - Turn extruder off case 103: if(gpx->flag.dittoPrinting) { CALL( set_steppers(gpx, A_IS_SET|B_IS_SET, 0) ); command_emitted++; gpx->tool[A].motor_enabled = gpx->tool[B].motor_enabled = 0; } else { CALL( set_steppers(gpx, gpx->target.extruder == 0 ? A_IS_SET : B_IS_SET, 0) ); command_emitted++; gpx->tool[gpx->target.extruder].motor_enabled = 0; } break; // M104 - Set extruder temperature case 104: if(gpx->command.flag & S_IS_SET) { unsigned temperature = (unsigned)gpx->command.s; if(temperature > NOZZLE_MAX) temperature = NOZZLE_MAX; if(gpx->flag.dittoPrinting) { if(temperature && gpx->override[gpx->current.extruder].active_temperature) { temperature = gpx->override[gpx->current.extruder].active_temperature; } CALL( set_nozzle_temperature(gpx, B, temperature) ); CALL( set_nozzle_temperature(gpx, A, temperature) ); command_emitted++; gpx->tool[A].nozzle_temperature = gpx->tool[B].nozzle_temperature = temperature; } else { if(temperature && gpx->override[gpx->target.extruder].active_temperature) { temperature = gpx->override[gpx->target.extruder].active_temperature; } CALL( set_nozzle_temperature(gpx, gpx->target.extruder, temperature) ); command_emitted++; gpx->tool[gpx->target.extruder].nozzle_temperature = temperature; } } else { gcodeResult(gpx, "(line %u) Syntax error: M104 is missing temperature, use Sn where n is 0-280" EOL, gpx->lineNumber); } break; // M105 - Get extruder temperature case 105: CALL(get_extruder_temperature_extended(gpx)); break; // M106 - Turn heatsink cooling fan on // M106 - Turn ABP conveyor on // 3 November 2014 // // In Gen 4 electronics, turn the ABP conveyor on // In MightyBoard electronics, turn the heatsink fan on case 106: if(gpx->machine.id >= MACHINE_TYPE_REPLICATOR_1) { int state = (gpx->command.flag & S_IS_SET) ? ((unsigned)gpx->command.s ? 1 : 0) : 1; if(gpx->flag.reprapFlavor || gpx->flag.M106AlwaysValve) { // Toggle valve if(gpx->flag.dittoPrinting) { CALL( set_valve(gpx, B, state) ); CALL( set_valve(gpx, A, state) ); command_emitted++; } else { CALL( set_valve(gpx, gpx->target.extruder, state) ); command_emitted++; } } else { // Toggle heatsink fan if(gpx->flag.dittoPrinting) { CALL( set_fan(gpx, B, state) ); CALL( set_fan(gpx, A, state) ); command_emitted++; } else { CALL( set_fan(gpx, gpx->target.extruder, state) ); command_emitted++; } } } else { // Enable ABP CALL( set_abp(gpx, gpx->target.extruder, 1) ); command_emitted++; } break; // M107 - Turn cooling fan off // M107 - Turn ABP conveyor off // 3 November 2014 // // In Gen 4 electronics, turn the ABP conveyor off // In MightyBoard electronics, turn the heatsink fan off case 107: if(gpx->machine.id >= MACHINE_TYPE_REPLICATOR_1) { int state = (gpx->command.flag & S_IS_SET) ? ((unsigned)gpx->command.s ? 1 : 0) : 0; if(gpx->flag.reprapFlavor || gpx->flag.M106AlwaysValve) { // Toggle valve if(gpx->flag.dittoPrinting) { CALL( set_valve(gpx, B, state) ); CALL( set_valve(gpx, A, state) ); command_emitted++; } else { CALL( set_valve(gpx, gpx->target.extruder, state) ); command_emitted++; } } else { // Set the heatsink fan off if(gpx->flag.dittoPrinting) { CALL( set_fan(gpx, B, state) ); CALL( set_fan(gpx, A, state) ); command_emitted++; } else { CALL( set_fan(gpx, gpx->target.extruder, state) ); command_emitted++; } } } else { // Disable ABP CALL( set_abp(gpx, gpx->target.extruder, 0) ); command_emitted++; } break; // M108 - Set extruder motor 5D 'simulated' RPM // toolchange for ReplicatorG case 108: #if ENABLE_SIMULATED_RPM if(gpx->command.flag & R_IS_SET) { if(gpx->flag.dittoPrinting) { gpx->tool[A].rpm = gpx->tool[B].rpm = gpx->command.r; } else { gpx->tool[gpx->target.extruder].rpm = gpx->command.r; } } else #endif if(gpx->command.flag & T_IS_SET) { if(!gpx->flag.dittoPrinting && gpx->target.extruder != gpx->current.extruder) { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; CALL( do_tool_change(gpx, timeout) ); command_emitted++; } } #if ENABLE_SIMULATED_RPM else { gcodeResult(gpx, "(line %u) Syntax error: M108 is missing motor RPM, use Rn where n is 0-5" EOL, gpx->lineNumber); } #endif break; // M112 - Emergency stop case 112: // In Marlin this appears to be emergency!, emergency!, which // according to reprap.org/wiki/G-code is supposed to shutdown // the bot. Closest thing we have in s3g/x3g is "abort immediately" // which is the same as "reset" and "clear command buffer". // In SailFish, it clears the command buffer, cancels SD printing // if any, and turns off the steppers and heaters. So at the moment // this is the closest thing gcode has for controlled cancel. // weird. // We only pay attention to this when connected to the bot, why would // you just put it in an offline file? if(gpx->flag.sioConnected) CALL( abort_immediately(gpx) ); break; // M109 - Set extruder temperature and wait case 109: if(gpx->flag.reprapFlavor) { if(gpx->command.flag & S_IS_SET) { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; unsigned temperature = (unsigned)gpx->command.s; if(temperature > NOZZLE_MAX) temperature = NOZZLE_MAX; if(gpx->flag.dittoPrinting) { unsigned tempB = temperature; // set extruder temperatures if(temperature) { if(gpx->override[B].active_temperature) { tempB = gpx->override[B].active_temperature; } if(gpx->override[A].active_temperature) { temperature = gpx->override[A].active_temperature; } } CALL( set_nozzle_temperature(gpx, B, tempB) ); CALL( set_nozzle_temperature(gpx, A, temperature) ); gpx->tool[B].nozzle_temperature = tempB; gpx->tool[A].nozzle_temperature = temperature; // wait for extruders to reach (or exceed) temperature if(gpx->tool[B].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, B, timeout) ); } if(gpx->tool[A].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, A, timeout) ); if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } command_emitted++; } else { #if ENABLE_TOOL_CHANGE_ON_WAIT // because there is a wait we do a tool change if(gpx->target.extruder != gpx->current.extruder) { CALL( do_tool_change(gpx, timeout) ); } #endif // set extruder temperature if(temperature && gpx->override[gpx->target.extruder].active_temperature) { temperature = gpx->override[gpx->target.extruder].active_temperature; } CALL( set_nozzle_temperature(gpx, gpx->target.extruder, temperature) ); gpx->tool[gpx->target.extruder].nozzle_temperature = temperature; // wait for extruder to reach (or exceed) temperature if(gpx->tool[gpx->target.extruder].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, gpx->target.extruder, timeout) ); if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } command_emitted++; } } else { gcodeResult(gpx, "(line %u) Syntax error: M109 is missing temperature, use Sn where n is 0-280" EOL, gpx->lineNumber); } break; } // fall through to M140 for Makerbot/ReplicatorG flavor // M140 - Set build platform temperature case 140: if(gpx->machine.a.has_heated_build_platform || gpx->machine.b.has_heated_build_platform) { if(gpx->command.flag & S_IS_SET) { unsigned temperature = (unsigned)gpx->command.s; unsigned tool_id = gpx->machine.a.has_heated_build_platform ? A : B; if(gpx->command.flag & T_IS_SET) { tool_id = gpx->target.extruder; } if(tool_id ? gpx->machine.b.has_heated_build_platform : gpx->machine.a.has_heated_build_platform) { if(temperature && gpx->override[tool_id].build_platform_temperature) { temperature = gpx->override[tool_id].build_platform_temperature; } CALL( set_build_platform_temperature(gpx, tool_id, temperature) ); command_emitted++; gpx->tool[tool_id].build_platform_temperature = temperature; } else { gcodeResult(gpx, "(line %u) Semantic warning: M%u cannot select non-existant heated build platform T%u" EOL, gpx->lineNumber, gpx->command.m, tool_id); } } else { gcodeResult(gpx, "(line %u) Syntax error: M%u is missing temperature, use Sn where n is 0-130" EOL, gpx->lineNumber, gpx->command.m); } } else { gcodeResult(gpx, "(line %u) Semantic warning: M%u cannot select non-existant heated build platform" EOL, gpx->lineNumber, gpx->command.m); } break; // M110 - Set current line number case 110: break; // M111 - Set debug level case 111: break; // M114 - Get current position case 114: CALL( get_extended_position(gpx) ); break; // M126 - Turn blower fan on (valve open) case 126: { int state = (gpx->command.flag & S_IS_SET) ? ((unsigned)gpx->command.s ? 1 : 0) : 1; if(gpx->flag.dittoPrinting) { CALL( set_valve(gpx, B, state) ); CALL( set_valve(gpx, A, state) ); command_emitted++; } else { CALL( set_valve(gpx, gpx->target.extruder, state) ); command_emitted++; } break; } // M127 - Turn blower fan off (valve close) case 127: if(gpx->flag.dittoPrinting) { CALL( set_valve(gpx, B, 0) ); CALL( set_valve(gpx, A, 0) ); command_emitted++; } else { CALL( set_valve(gpx, gpx->target.extruder, 0) ); command_emitted++; } break; // M131 - Store Current Position to EEPROM case 131: if(gpx->command.flag & AXES_BIT_MASK) { CALL( store_home_positions(gpx) ); command_emitted++; } else { gcodeResult(gpx, "(line %u) Syntax error: M131 is missing axes, use X Y Z A B" EOL, gpx->lineNumber); } break; // M132 - Load Current Position from EEPROM case 132: if(gpx->command.flag & AXES_BIT_MASK) { CALL( recall_home_positions(gpx) ); command_emitted++; // clear loaded axes gpx->axis.positionKnown &= ~(gpx->command.flag & gpx->axis.mask);; gpx->excess.a = 0; gpx->excess.b = 0; // since we always emit relative extruder moves, let's pretend // that M132 always returns 0 for the extruders, this will prevent // confusion later when the gcode only uses E and we continue // to think we don't know where the other extruder is if(gpx->command.flag & A_IS_SET) { gpx->axis.positionKnown |= A_IS_SET; gpx->current.position.a = 0; } if(gpx->command.flag & B_IS_SET) { gpx->axis.positionKnown |= B_IS_SET; gpx->current.position.b = 0; } } else { gcodeResult(gpx, "(line %u) Syntax error: M132 is missing axes, use X Y Z A B" EOL, gpx->lineNumber); } break; // M133 - Wait for extruder case 133: { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; // changing the if(gpx->flag.dittoPrinting) { if(gpx->tool[B].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, B, timeout) ); } if(gpx->tool[A].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, A, timeout) ); if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } command_emitted++; } else { #if ENABLE_TOOL_CHANGE_ON_WAIT // because there is a wait we do a tool change if(gpx->target.extruder != gpx->current.extruder) { CALL( do_tool_change(gpx, timeout) ); } #endif // any tool changes have already occured if(gpx->tool[gpx->target.extruder].nozzle_temperature > 0) { CALL( wait_for_extruder(gpx, gpx->target.extruder, timeout) ); if(gpx->flag.verboseMode) { CALL( display_tag(gpx) ); } } command_emitted++; } break; } // M134 // M190 - Wait for build platform to reach (or exceed) temperature // Cura intends M190 to mean *set* and wait case 134: case 190: { if(gpx->machine.a.has_heated_build_platform || gpx->machine.b.has_heated_build_platform) { if(gpx->command.flag & S_IS_SET) { unsigned temperature = (unsigned)gpx->command.s; unsigned tool_id = gpx->machine.a.has_heated_build_platform ? A : B; if(gpx->command.flag & T_IS_SET) { tool_id = gpx->target.extruder; } if(tool_id ? gpx->machine.b.has_heated_build_platform : gpx->machine.a.has_heated_build_platform) { if(temperature && gpx->override[tool_id].build_platform_temperature) { temperature = gpx->override[tool_id].build_platform_temperature; } CALL( set_build_platform_temperature(gpx, tool_id, temperature) ); command_emitted++; gpx->tool[tool_id].build_platform_temperature = temperature; } else { gcodeResult(gpx, "(line %u) Semantic warning: M%u cannot select non-existant heated build platform T%u" EOL, gpx->lineNumber, gpx->command.m, tool_id); } } int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; unsigned tool_id = gpx->machine.a.has_heated_build_platform ? A : B; if(gpx->command.flag & T_IS_SET) { tool_id = gpx->target.extruder; } if(tool_id ? gpx->machine.b.has_heated_build_platform : gpx->machine.a.has_heated_build_platform && gpx->tool[tool_id].build_platform_temperature > 0) { CALL( wait_for_build_platform(gpx, tool_id, timeout) ); command_emitted++; } else { gcodeResult(gpx, "(line %u) Semantic warning: M%u cannot select non-existant heated build platform T%u" EOL, gpx->lineNumber, gpx->command.m, tool_id); } } else { gcodeResult(gpx, "(line %u) Semantic warning: M%u cannot select non-existant heated build platform" EOL, gpx->lineNumber, gpx->command.m); } break; } // M135 - Change tool case 135: if(!gpx->flag.dittoPrinting && gpx->target.extruder != gpx->current.extruder) { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; CALL( do_tool_change(gpx, timeout) ); command_emitted++; } break; // M136 - Build start notification case 136: if(program_is_ready()) { start_program(); if(!gpx->nostart) { CALL( start_build(gpx, gpx->buildName) ); } CALL( set_build_progress(gpx, 0) ); // start extruder in a known state CALL( change_extruder_offset(gpx, gpx->current.extruder) ); } break; // M137 - Build end notification case 137: if(program_is_running()) { // disable macros in footer gpx->flag.macrosEnabled = 0; end_program(); CALL( set_build_progress(gpx, 100) ); CALL( end_build(gpx) ); } break; // M220 - Set speed factor override percentage case 220: if((gpx->command.flag & S_IS_SET) && gpx->command.s > 0) gpx->current.speed_factor = (unsigned)gpx->command.s; break; // M221 - Set extrude factor override percentage case 221: if((gpx->command.flag & S_IS_SET) && gpx->command.s > 0) { unsigned tool_id = gpx->current.extruder; if(gpx->command.flag & T_IS_SET) tool_id = gpx->target.extruder; gpx->override[tool_id].extrusion_factor = (unsigned)gpx->command.s; } break; // M300 - Set Beep (SP) case 300: { unsigned frequency = 300; if(gpx->command.flag & S_IS_SET) frequency = (unsigned)gpx->command.s & 0xFFFF; unsigned milliseconds = 1000; if(gpx->command.flag & P_IS_SET) milliseconds = (unsigned)gpx->command.p & 0xFFFF; CALL( set_beep(gpx, frequency, milliseconds) ); command_emitted++; break; } // M320 - Acceleration on for subsequent instructions case 320: CALL( set_acceleration(gpx, 1) ); command_emitted++; break; // M321 - Acceleration off for subsequent instructions case 321: CALL( set_acceleration(gpx, 0) ); command_emitted++; break; // M322 - Pause @ zPos case 322: if(gpx->command.flag & Z_IS_SET) { float conditional_z = gpx->offset[gpx->current.offset].z; if(gpx->flag.macrosEnabled) { conditional_z += gpx->user.offset.z; } if(gpx->flag.relativeCoordinates && !(gpx->axis.positionKnown & Z_IS_SET)) { gcodeResult(gpx, "(line %u) Pause at zPos ignored because relative positioning is set and current Z position is unknown.\n", gpx->lineNumber); } else { double z = gpx->flag.relativeCoordinates ? (gpx->current.position.z + gpx->command.z) : (gpx->command.z + conditional_z); CALL( pause_at_zpos(gpx, z) ); VERBOSE( gcodeResult(gpx, "Issued pause @ %0.2lf\n", z) ); } } else { gcodeResult(gpx, "(line %u) Syntax warning: M322 is missing Z axis" EOL, gpx->lineNumber); } command_emitted++; break; // M420 - Set RGB LED value (REB - P) case 420: { unsigned red = 0; if(gpx->command.flag & R_IS_SET) red = (unsigned)gpx->command.r & 0xFF; unsigned green = 0; if(gpx->command.flag & E_IS_SET) green = (unsigned)gpx->command.e & 0xFF; unsigned blue = 0; if(gpx->command.flag & B_IS_SET) blue = (unsigned)gpx->command.b & 0xFF; unsigned blink = 0; if(gpx->command.flag & P_IS_SET) blink = (unsigned)gpx->command.p & 0xFF; CALL( set_LED(gpx, red, green, blue, blink) ); command_emitted++; break; } // M500 - Write paramters to EEPROM // M501 - Read parameters from EEPROM // M502 - Revert to default "factory settings" // M503 - Print/log current settings default: gcodeResult(gpx, "(line %u) Syntax warning: unsupported mcode command 'M%u'" EOL, gpx->lineNumber, gpx->command.m); } } // X,Y,Z,A,B,E,F else if(gpx->command.flag & (AXES_BIT_MASK | F_IS_SET)) { if(!(gpx->command.flag & COMMENT_IS_SET)) { CALL( calculate_target_position(gpx, &delta, &relative) ); CALL( queue_ext_point(gpx, 0.0, &delta, relative) ); update_current_position(gpx); command_emitted++; } } // Tn else if(gpx->command.flag & T_IS_SET && !gpx->flag.dittoPrinting && gpx->target.extruder != gpx->current.extruder) { int timeout = gpx->command.flag & P_IS_SET ? (int)gpx->command.p : MAX_TIMEOUT; CALL( do_tool_change(gpx, timeout) ); command_emitted++; } // check for pending pause @ zPos if(gpx->flag.doPauseAtZPos) { gpx->flag.doPauseAtZPos--; // issue next pause @ zPos after command buffer is flushed if(gpx->flag.doPauseAtZPos == 0) { CALL( pause_at_zpos(gpx, gpx->commandAt[gpx->commandAtIndex].z) ); } } // update progress if(gpx->total.time > 0.0001 && gpx->accumulated.time > 0.0001 && gpx->flag.buildProgress && command_emitted) { unsigned percent = (unsigned)round(100.0 * gpx->accumulated.time / gpx->total.time); if(percent > gpx->current.percent) { if(program_is_ready()) { start_program(); if(!gpx->nostart) { CALL( start_build(gpx, gpx->buildName) ); } CALL( set_build_progress(gpx, 0) ); // start extruder in a known state CALL( change_extruder_offset(gpx, gpx->current.extruder) ); } else if(percent < 100 && program_is_running()) { if(gpx->current.percent) { CALL( set_build_progress(gpx, percent) ); } // force 1% else { CALL( set_build_progress(gpx, 1) ); } } command_emitted = 0; } } gpx->lineNumber = next_line; return SUCCESS; } typedef struct tFile { FILE *in; FILE *out; FILE *out2; } File; static int file_handler(Gpx *gpx, File *file, char *buffer, size_t length) { if(length) { ssize_t bytes = fwrite(buffer, 1, length, file->out); if(bytes != length) return ERROR; if(file->out2) { bytes = fwrite(buffer, 1, length, file->out2); if(bytes != length) return ERROR; } } return SUCCESS; } int gpx_convert(Gpx *gpx, FILE *file_in, FILE *file_out, FILE *file_out2) { int i, rval; File file; file.in = stdin; file.out = stdout; file.out2 = NULL; int logMessages = gpx->flag.logMessages; if(file_in && file_in != stdin) { // Multi-pass file.in = file_in; i = 0; gpx->flag.runMacros = 0; gpx->callbackHandler = NULL; gpx->callbackData = NULL; } else { // Single-pass i = 1; gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))file_handler;; gpx->callbackData = &file; } if(file_out) { file.out = file_out; } file.out2 = file_out2; for(;;) { int overflow = 0; if(gpx->preamble) start_build(gpx, gpx->preamble); while(fgets(gpx->buffer.in, BUFFER_MAX, file.in) != NULL) { // detect input buffer overflow and ignore overflow input if(overflow) { if(strlen(gpx->buffer.in) != BUFFER_MAX - 1) { overflow = 0; } continue; } if(strlen(gpx->buffer.in) == BUFFER_MAX - 1) { overflow = 1; // ignore run-on comments, this is actually a little too permissive // since technically we should ignore ';' contained within a // parenthetical comment if(!strchr(gpx->buffer.in, ';')) gcodeResult(gpx, "(line %u) Buffer overflow: input exceeds %u character limit, remaining characters in line will be ignored" EOL, gpx->lineNumber, BUFFER_MAX); } rval = gpx_convert_line(gpx, gpx->buffer.in); // normal exit if(rval == END_OF_FILE) break; // error if(rval < 0) return rval; } if(program_is_running()) { end_program(); if(!gpx->noend) { CALL( set_build_progress(gpx, 100) ); CALL( end_build(gpx) ); } } // Ending gcode should disable the heaters and stepper motors // This line of code here in GPX was making it such that people // could not convert gcode utility scripts to x3g with GPX. For // instance, a script for build plate leveling which wanted to // home the axes and then leave Z enabled // CALL( set_steppers(gpx, AXES_BIT_MASK, 0) ); gpx->total.length = gpx->accumulated.a + gpx->accumulated.b; gpx->total.time = gpx->accumulated.time; gpx->total.bytes = gpx->accumulated.bytes; if(++i > 1) break; // rewind for second pass fseek(file.in, 0L, SEEK_SET); gpx_initialize(gpx, 0); gpx->flag.loadMacros = 0; gpx->flag.runMacros = 1; gpx->flag.pausePending = (gpx->commandAtLength > 0); //gpx->flag.logMessages = 0; gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))file_handler; gpx->callbackData = &file; } gpx->flag.logMessages = logMessages;; return SUCCESS; } char *sd_status[] = { "operation successful", "SD Card not present", "SD Card initialization failed", "partition table could not be read", "filesystem could not be opened", "root directory could not be opened", "SD Card is locked", "file not found", "general error", "changed working dir", "volume too big", "CRC failure", "SD Card read error", "SD operating at low speeds", "unknown status" }; char *get_sd_status(unsigned int status) { return sd_status[status < 14 ? status : 14]; } char *build_status[] = { "no build initialized (boot state)", "build running", "build finished normally", "build paused", "build cancelled", "build sleeping", "unknown status" }; char *get_build_status(unsigned int status) { return build_status[status < 6 ? status : 6]; } static void read_extruder_query_response(Gpx *gpx, Sio *sio, unsigned command, char *buffer) { unsigned extruder_id = buffer[EXTRUDER_ID_OFFSET]; switch(command) { // Query 00 - Query firmware version information case 0: // uint16: Firmware Version sio->response.firmware.version = read_16(gpx); VERBOSE( fprintf(gpx->log, "Extruder T%u firmware v%u.%u" EOL, extruder_id, sio->response.firmware.version / 100, sio->response.firmware.version % 100) ); break; // Query 02 - Get extruder temperature case 2: // int16: Current temperature, in Celsius sio->response.temperature = read_16(gpx); VERBOSE( fprintf(gpx->log, "Extruder T%u temperature: %uc" EOL, extruder_id, sio->response.temperature) ); break; // Query 22 - Is extruder ready case 22: // uint8: 1 if ready, 0 otherwise. sio->response.isReady = read_8(gpx); VERBOSE( fprintf(gpx->log, "Extruder T%u is%sready" EOL, extruder_id, sio->response.isReady ? " " : " not ") ); break; // Query 30 - Get build platform temperature case 30: // int16: Current temperature, in Celsius sio->response.temperature = read_16(gpx); VERBOSE( fprintf(gpx->log, "Build platform T%u temperature: %uc" EOL, extruder_id, sio->response.temperature) ); break; // Query 32 - Get extruder target temperature case 32: // int16: Current temperature, in Celsius sio->response.temperature = read_16(gpx); VERBOSE( fprintf(gpx->log, "Extruder T%u target temperature: %uc" EOL, extruder_id, sio->response.temperature) ); break; // Query 33 - Get build platform target temperature case 33: // int16: Current temperature, in Celsius sio->response.temperature = read_16(gpx); VERBOSE( fprintf(gpx->log, "Build platform T%u target temperature: %uc" EOL, extruder_id, sio->response.temperature) ); break; // Query 35 - Is build platform ready? case 35: // uint8: 1 if ready, 0 otherwise. sio->response.isReady = read_8(gpx); VERBOSE( fprintf(gpx->log, "Build platform T%u is%sready" EOL, extruder_id, sio->response.isReady ? " " : " not ") ); break; // Query 36 - Get extruder status case 36: // uint8: Bitfield containing status information sio->response.extruder.bitfield = read_8(gpx); if(gpx->flag.verboseMode && gpx->flag.logMessages) { fprintf(gpx->log, "Extruder T%u status" EOL, extruder_id); if(sio->response.extruder.flag.ready) fputs("Target temperature reached" EOL, gpx->log); if(sio->response.extruder.flag.notPluggedIn) fputs("The extruder or build plate is not plugged in" EOL, gpx->log); if(sio->response.extruder.flag.softwareCutoff) fputs("Above maximum allowable temperature recorded: heater shutdown for safety" EOL, gpx->log); if(sio->response.extruder.flag.temperatureDropping) fputs("Heater temperature dropped below target temperature" EOL, gpx->log); if(sio->response.extruder.flag.buildPlateError) fputs("An error was detected with the build plate heater or sensor" EOL, gpx->log); if(sio->response.extruder.flag.extruderError) fputs("An error was detected with the extruder heater or sensor" EOL, gpx->log); } break; // Query 37 - Get PID state case 37: // int16: Extruder heater error term sio->response.pid.extruderError = read_16(gpx); // int16: Extruder heater delta term sio->response.pid.extruderDelta = read_16(gpx); // int16: Extruder heater last output sio->response.pid.extruderOutput = read_16(gpx); // int16: Platform heater error term sio->response.pid.buildPlateError = read_16(gpx); // int16: Platform heater delta term sio->response.pid.buildPlateDelta = read_16(gpx); // int16: Platform heater last output sio->response.pid.buildPlateOutput = read_16(gpx); break; default: abort(); } } void hexdump(FILE *out, char *p, size_t len) { while (len--) fprintf(out, "%02x ", (unsigned)(unsigned char)*p++); fflush(out); } static void read_query_response(Gpx *gpx, Sio *sio, unsigned command, char *buffer) { gpx->buffer.ptr = gpx->buffer.in + 3; switch(command) { // 00 - Query firmware version information case 0: // uint16: Firmware Version sio->response.firmware.version = read_16(gpx); VERBOSE( fprintf(gpx->log, "Motherboard firmware v%u.%u" EOL, sio->response.firmware.version / 100, sio->response.firmware.version % 100) ); break; // 02 - Get available buffer size case 2: // uint32: Number of bytes availabe in the command buffer sio->response.bufferSize = read_32(gpx); break; // 10 - Extruder query command case 10: { unsigned query_command = buffer[QUERY_COMMAND_OFFSET]; read_extruder_query_response(gpx, sio, query_command, buffer); break; } // 11 - Is ready case 11: // uint8: 1 if ready, 0 otherwise. sio->response.isReady = read_8(gpx); VERBOSE( fprintf(gpx->log, "Printer is%sready" EOL, sio->response.isReady ? " " : " not ") ); break; // 12 - Read from EEPROM case 12: // N bytes: Data read from the EEPROM sio->response.eeprom.length = buffer[EEPROM_LENGTH_OFFSET]; read_bytes(gpx, sio->response.eeprom.buffer, sio->response.eeprom.length); break; // 13 - Write to EEPROM case 13: // uint8: Number of bytes successfully written to the EEPROM sio->response.eeprom.length = read_8(gpx); break; // 14 - Capture to file case 14: // uint8: SD response code sio->response.sd.status = read_8(gpx); VERBOSE( fprintf(gpx->log, "Capture to file: %s" EOL, get_sd_status(sio->response.sd.status)) ); break; // 15 - End capture to file case 15: // uint32: Number of bytes captured to file. sio->response.sd.length = read_32(gpx); VERBOSE( fprintf(gpx->log, "Capture to file ended: %u bytes written" EOL, sio->response.sd.length) ); break; // 16 - Play back capture case 16: // uint8: SD response code sio->response.sd.status = read_8(gpx); VERBOSE( fprintf(gpx->log, "Play back captured file: %d, %s" EOL, sio->response.sd.status, get_sd_status(sio->response.sd.status)) ); break; // 18 - Get next filename case 18: // uint8: SD Response code. sio->response.sd.status = read_8(gpx); /* 1+N bytes: Name of the next file, in ASCII, terminated with a null character. If the operation was unsuccessful, this will be a null character */ strncpy0(sio->response.sd.filename, gpx->buffer.ptr, 65); VERBOSE( fprintf(gpx->log, "Get next filename: '%s' %s" EOL, sio->response.sd.filename, get_sd_status(sio->response.sd.status)) ); break; // 20 - Get build name case 20: // 1+N bytes: A null terminated string representing the filename of the current build. strncpy0(sio->response.sd.filename, gpx->buffer.ptr, 65); VERBOSE( fprintf(gpx->log, "Get build name: '%s'" EOL, sio->response.sd.filename) ); break; // 21 - Get extended position case 21: // int32: X position, in steps sio->response.position.x = read_32(gpx); // int32: Y position, in steps sio->response.position.y = read_32(gpx); // int32: Z position, in steps sio->response.position.z = read_32(gpx); // int32: A position, in steps sio->response.position.a = read_32(gpx); // int32: B position, in steps sio->response.position.b = read_32(gpx); // uint16: bitfield corresponding to the endstop status: sio->response.position.endstop.bitfield = read_16(gpx); if(gpx->flag.verboseMode && gpx->flag.logMessages) { fputs("Current position" EOL, gpx->log); fprintf(gpx->log, "X = %0.2fmm%s%s" EOL, (double)sio->response.position.x / gpx->machine.x.steps_per_mm, sio->response.position.endstop.flag.xMax ? ", at max endstop" : "", sio->response.position.endstop.flag.xMin ? ", at min endstop" : ""); fprintf(gpx->log, "Y = %0.2fmm%s%s" EOL, (double)sio->response.position.y / gpx->machine.y.steps_per_mm, sio->response.position.endstop.flag.yMax ? ", at max endstop" : "", sio->response.position.endstop.flag.yMin ? ", at min endstop" : ""); fprintf(gpx->log, "Z = %0.2fmm%s%s" EOL, (double)sio->response.position.z / gpx->machine.z.steps_per_mm, sio->response.position.endstop.flag.zMax ? ", at max endstop" : "", sio->response.position.endstop.flag.zMin ? ", at min endstop" : ""); fprintf(gpx->log, "A = %0.2fmm%s%s" EOL, (double)sio->response.position.a / gpx->machine.a.steps_per_mm, sio->response.position.endstop.flag.aMax ? ", at max endstop" : "", sio->response.position.endstop.flag.aMin ? ", at min endstop" : ""); fprintf(gpx->log, "B = %0.2fmm%s%s" EOL, (double)sio->response.position.b / gpx->machine.b.steps_per_mm, sio->response.position.endstop.flag.bMax ? ", at max endstop" : "", sio->response.position.endstop.flag.bMin ? ", at min endstop" : ""); } break; // 22 - Extended stop case 22: // int8: 0 (reserved for future use) read_8(gpx); VERBOSE( fputs("Build stopped" EOL, gpx->log) ); break; // 23 - Get motherboard status case 23: // uint8: bitfield containing status information sio->response.motherboard.bitfield = read_8(gpx); if(gpx->flag.verboseMode && gpx->flag.logMessages) { fputs("Motherboard status" EOL, gpx->log); if(sio->response.motherboard.flag.preheat) fputs("Onboard preheat active" EOL, gpx->log); if(sio->response.motherboard.flag.manualMode) fputs("Manual move active" EOL, gpx->log); if(sio->response.motherboard.flag.onboardScript) fputs("Running onboard script" EOL, gpx->log); if(sio->response.motherboard.flag.onboardProcess) fputs("Running onboard process" EOL, gpx->log); if(sio->response.motherboard.flag.waitForButton) fputs("Waiting for buttons press" EOL, gpx->log); if(sio->response.motherboard.flag.buildCancelling) fputs("Build cancelling" EOL, gpx->log); if(sio->response.motherboard.flag.heatShutdown) fputs("Heaters were shutdown after 30 minutes of inactivity" EOL, gpx->log); if(sio->response.motherboard.flag.powerError) fputs("Error detected in system power" EOL, gpx->log); } break; // 24 - Get build statistics case 24: // uint8 : Build status sio->response.build.status = read_8(gpx); // uint8 : Hours elapsed on print sio->response.build.hours = read_8(gpx); // uint8 : Minutes elapsed on print (add hours for total time) sio->response.build.minutes = read_8(gpx); // uint32: Line number (number of commands processed) sio->response.build.lineNumber = read_32(gpx); // uint32: Reserved for future use read_32(gpx); VERBOSE( fprintf(gpx->log, "(line %u) Build status: %s, %u hours, %u minutes" EOL, sio->response.build.lineNumber, get_build_status(sio->response.build.status), sio->response.build.hours, sio->response.build.minutes) ); break; // 27 - Get advanced version number case 27: // uint16_t Firmware version sio->response.firmware.version = read_16(gpx); // uint16_t Internal version read_16(gpx); // uint8_t Software variant (0x01 MBI Official, 0x80 Sailfish) sio->response.firmware.variant = read_8(gpx); // uint8_t Reserved for future use read_8(gpx); // uint16_t Reserved for future use read_16(gpx); if(gpx->flag.verboseMode && gpx->flag.logMessages) { fprintf(gpx->log, "%s firmware v%u.%u" EOL, get_firmware_variant(sio->response.firmware.variant), sio->response.firmware.version / 100, sio->response.firmware.version % 100); } break; } } #if defined(_WIN32) || defined(_WIN64) // windows has more simultaneous timeout values, so we don't need select // for the first byte #define readport read #else size_t readport(int port, char *buffer, size_t bytes) { fd_set fds; struct timeval tv; int rval; FD_ZERO(&fds); FD_SET(port, &fds); tv.tv_sec = 1; tv.tv_usec = 0; // wait up to one second for the first byte rval = select(port + 1, &fds, NULL, NULL, &tv); if(rval <= 0) return rval; // wait up to 1/10th intercharacter (from VTIME) return read(port, buffer, bytes); } #endif int port_handler(Gpx *gpx, Sio *sio, char *buffer, size_t length) { int rval = SUCCESS; if(length) { size_t bytes; int retry_count = 0; do { VERBOSESIO( fprintf(gpx->log, "port_handler write: %lu" EOL, (unsigned long)length) ); VERBOSESIO( hexdump(gpx->log, buffer, length) ); // send the packet if((bytes = write(sio->port, buffer, length)) == -1) { return EOSERROR; } else if(bytes != length) { return ESIOWRITE; } sio->bytes_out += length; VERBOSESIO( fprintf(gpx->log, EOL "port_handler read:" EOL) ); for(;;) { // read start byte if((bytes = readport(sio->port, gpx->buffer.in, 1)) == -1) { return EOSERROR; } else if(bytes != 1) { VERBOSESIO( fprintf(gpx->log, EOL "want 1 bytes = %u" EOL, (unsigned)bytes) ); if(bytes == 0) return ESIOTIMEOUT; return ESIOREAD; } VERBOSESIO( hexdump(gpx->log, gpx->buffer.in, bytes) ); // loop until we get a valid start byte if((unsigned char)gpx->buffer.in[0] == 0xD5) break; } size_t payload_length = 0; do { // read length if((bytes = readport(sio->port, gpx->buffer.in + 1, 1)) == -1) { return EOSERROR; } else if(bytes != 1) { VERBOSESIO( fprintf(gpx->log, EOL "want 1 bytes = %u" EOL, (unsigned)bytes) ); return ESIOREAD; } VERBOSESIO( hexdump(gpx->log, gpx->buffer.in, bytes) ); payload_length = gpx->buffer.in[1]; } while ((unsigned char)gpx->buffer.in[1] == 0xd5); // recieve payload if((bytes = readport(sio->port, gpx->buffer.in + 2, payload_length + 1)) == -1) { return EOSERROR; } VERBOSESIO( hexdump(gpx->log, gpx->buffer.in + 2, bytes) ); VERBOSESIO( fprintf(gpx->log, EOL) ); if(bytes != payload_length + 1) { VERBOSESIO( fprintf(gpx->log, EOL "want %u bytes = %u" EOL, (unsigned)payload_length + 1, (unsigned)bytes) ); return ESIOREAD; } // check CRC unsigned crc = (unsigned char)gpx->buffer.in[2 + payload_length]; if(crc != calculate_crc((unsigned char*)gpx->buffer.in + 2, payload_length)) { fprintf(gpx->log, "(retry %u) Input CRC mismatch: packet discarded" EOL, retry_count); rval = ESIOCRC; goto L_RETRY; } // check response code rval = (int)(unsigned char)gpx->buffer.in[2]; switch(rval) { // 0x80 - Generic Packet error, packet discarded (retry) case 0x80: VERBOSE( fprintf(gpx->log, "(retry %u) Generic Packet error: packet discarded" EOL, retry_count) ); break; // 0x81 - Success case 0x81: { unsigned command = (unsigned)buffer[COMMAND_OFFSET]; if((command & 0x80) == 0) { read_query_response(gpx, sio, command, buffer); } return SUCCESS; } // 0x82 - Action buffer overflow, entire packet discarded case 0x82: if(!sio->flag.retryBufferOverflow) goto L_ABORT; // first, harass the bot in a tight loop in case we're // doing lots of short movements. On the one hand, we're // making it worse by making the bot take time on serial // i/o. On the other we want to make sure we send the next // command into the buffer as soon as possible so we don't // get a zit because of a sleep on our side // // twenty times, check for room every 10ms int i; for(i = 0; i < 20; i++) { short_sleep(NS_10MS); // query buffer size CALL( port_handler(gpx, sio, buffer_size_query, 4) ); // if we now have room, let's go again if (sio->response.bufferSize >= length) goto L_REPEATSEND; } if(sio->flag.shortRetryBufferOverflowOnly) { rval = 0x82; // recursion cleared it, put it back goto L_ABORT; } // now, wait until we've got room for the command, checking // every 1/10 second do { short_sleep(NS_100MS); // query buffer size buffer_size_query[3] = calculate_crc((unsigned char *)buffer_size_query + 2, 1); CALL( port_handler(gpx, sio, buffer_size_query, 4) ); // loop until buffer has space for the next command } while(sio->response.bufferSize < length); L_REPEATSEND: // we just did all the waiting we needed, skip the 2 second timeout continue; // 0x83 - CRC mismatch, packet discarded. (retry) case 0x83: VERBOSE( fprintf(gpx->log, "(retry %u) Output CRC mismatch: packet discarded" EOL, retry_count) ); break; // 0x84 - Query packet too big, packet discarded case 0x84: VERBOSE( fprintf(gpx->log, "(retry %u) Query packet too big: packet discarded" EOL, retry_count) ); goto L_ABORT; // 0x85 - Command not supported/recognized case 0x85: VERBOSE( fprintf(gpx->log, "(retry %u) Command not supported or recognized" EOL, retry_count) ); goto L_ABORT; // 0x87 - Downstream timeout case 0x87: VERBOSE( fprintf(gpx->log, "(retry %u) Downstream timeout" EOL, retry_count) ); goto L_ABORT; // 0x88 - Tool lock timeout (retry) case 0x88: VERBOSE( fprintf(gpx->log, "(retry %u) Tool lock timeout" EOL, retry_count) ); break; // 0x89 - Cancel build (retry) case 0x89: VERBOSE( fprintf(gpx->log, "(retry %u) Cancel build" EOL, retry_count) ); // I think this means the build was cancelled from the LCD // panel or the bot overheated, we should bail out. Is // there a way to confirm the cancel? goto L_ABORT; // 0x8A - Bot is building from SD case 0x8A: VERBOSE( fprintf(gpx->log, "(retry %u) Bot is Building from SD card" EOL, retry_count) ); goto L_ABORT; // 0x8B - Bot is shutdown due to overheating case 0x8B: VERBOSE( fprintf(gpx->log, "(retry %u) Bot is shutdown due to overheating" EOL, retry_count) ); goto L_ABORT; // 0x8C - Packet timeout error, packet discarded (retry) case 0x8C: VERBOSE( fprintf(gpx->log, "(retry %u) Packet timeout error: packet discarded" EOL, retry_count) ); break; } L_RETRY: // wait for 2 seconds long_sleep(2); } while(++retry_count < 5); } L_ABORT: return rval; } int gpx_convert_and_send(Gpx *gpx, FILE *file_in, int sio_port, int item_code, ...) { int i, rval; Sio sio; sio.in = stdin; sio.port = -1; sio.bytes_out = 0; sio.bytes_in = 0; sio.flag.retryBufferOverflow = 1; sio.flag.shortRetryBufferOverflowOnly = 0; int logMessages = gpx->flag.logMessages; if(file_in && file_in != stdin) { // Multi-pass sio.in = file_in; i = 0; gpx->flag.logMessages = 0; gpx->flag.framingEnabled = 0; gpx->callbackHandler = NULL; gpx->callbackData = NULL; } else { // Single-pass i = 1; gpx->flag.framingEnabled = 1; gpx->flag.sioConnected = 1; gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))port_handler;; gpx->callbackData = &sio; gpx->sio = &sio; } if(item_code) { va_list ap; int retstat; va_start(ap, item_code); retstat = process_options(gpx, item_code, ap); va_end(ap); if(retstat != SUCCESS) return retstat; } if(sio_port >= 0) { sio.port = sio_port; } for(;;) { int overflow = 0; while(fgets(gpx->buffer.in, BUFFER_MAX, sio.in) != NULL) { // detect input buffer overflow and ignore overflow input if(overflow) { if(strlen(gpx->buffer.in) != BUFFER_MAX - 1) { overflow = 0; } continue; } if(strlen(gpx->buffer.in) == BUFFER_MAX - 1) { overflow = 1; gcodeResult(gpx, "(line %u) Buffer overflow: input exceeds %u character limit, remaining characters in line will be ignored" EOL, gpx->lineNumber, BUFFER_MAX); } rval = gpx_convert_line(gpx, gpx->buffer.in); // normal exit if(rval > 0) break; // error if(rval < 0) return rval; } if(program_is_running()) { end_program(); if(!gpx->noend) { CALL( set_build_progress(gpx, 100) ); CALL( end_build(gpx) ); } } // Ending gcode should disable the heaters and stepper motors // This line of code here in GPX was making it such that people // could not convert gcode utility scripts to x3g with GPX. For // instance, a script for build plate leveling which wanted to // home the axes and then leave Z enabled // CALL( set_steppers(gpx, AXES_BIT_MASK, 0) ); gpx->total.length = gpx->accumulated.a + gpx->accumulated.b; gpx->total.time = gpx->accumulated.time; gpx->total.bytes = gpx->accumulated.bytes; if(++i > 1) break; // rewind for second pass fseek(sio.in, 0L, SEEK_SET); gpx_initialize(gpx, 0); gpx->flag.logMessages = 1; gpx->flag.framingEnabled = 1; gpx->callbackHandler = (int (*)(Gpx*, void*, char*, size_t))port_handler;; gpx->callbackData = &sio; gpx->sio = &sio; gpx->flag.sioConnected = 1; } gpx->flag.logMessages = logMessages;; return SUCCESS; } void gpx_end_convert(Gpx *gpx) { if(gpx->flag.verboseMode && gpx->flag.logMessages) { long seconds = round(gpx->accumulated.time); long minutes = seconds / 60; long hours = minutes / 60; minutes %= 60; seconds %= 60; fprintf(gpx->log, "Extrusion length: %#0.3f metres" EOL, round(gpx->accumulated.a + gpx->accumulated.b) / 1000); fputs("Estimated print time: ", gpx->log); if(hours) fprintf(gpx->log, "%lu hours ", hours); if(minutes) fprintf(gpx->log, "%lu minutes ", minutes); fprintf(gpx->log, "%lu seconds" EOL, seconds); fprintf(gpx->log, "X3G output filesize: %lu bytes" EOL, gpx->accumulated.bytes); } } // EEPROM static int eeprom_set_property(Gpx *gpx, const char* section, const char* property, char* value) { int rval; unsigned int address = (unsigned int)strtol(property, NULL, 0); if(gpx->sio == NULL) { gcodeResult(gpx, "(line %u) Error: eeprom_set_property only supported when connected via serial" EOL, gpx->lineNumber); return ERROR; } if(SECTION_IS("byte")) { unsigned char b = (unsigned char)strtol(value, NULL, 0); CALL( write_eeprom_8(gpx, gpx->sio, address, b) ); } else if(SECTION_IS("integer")) { unsigned int i = (unsigned int)strtol(value, NULL, 0); CALL( write_eeprom_32(gpx, gpx->sio, address, i) ); } else if(SECTION_IS("hex") || SECTION_IS("hexadecimal")) { unsigned int h = (unsigned int)strtol(value, NULL, 16); unsigned length = (unsigned)strlen(value) / 2; if(length > 4) length = 4; gpx->buffer.ptr = gpx->sio->response.eeprom.buffer; write_32(gpx, h); CALL( write_eeprom(gpx, address, gpx->sio->response.eeprom.buffer, length) ); } else if(SECTION_IS("float")) { float f = strtof(value, NULL); CALL( write_eeprom_float(gpx, gpx->sio, address, f) ); } else if(SECTION_IS("string")) { unsigned length = (unsigned)strlen(value); CALL( write_eeprom(gpx, address, value, length) ); } else { gcodeResult(gpx, "(line %u) Configuration error: unrecognised section [%s]" EOL, gpx->lineNumber, section); return gpx->lineNumber; } return SUCCESS; } int eeprom_load_config(Gpx *gpx, const char *filename) { return ini_parse(gpx, filename, eeprom_set_property); } void gpx_set_preamble(Gpx *gpx, const char *preamble) { if(gpx) gpx->preamble = preamble; } void gpx_set_start(Gpx *gpx, int head) { if(gpx) gpx->nostart = head ? 0 : 1; } void gpx_set_end(Gpx *gpx, int tail) { if(gpx) gpx->noend = tail ? 0 : 1; } GPX-2.5.2/src/gpx/gpx.h000066400000000000000000000414431271205255700145260ustar00rootroot00000000000000// // gpx.h // // Created by WHPThomas on 1/04/13. // // Copyright (c) 2013 WHPThomas, All rights reserved. // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __gpx_h__ #define __gpx_h__ #ifdef __cplusplus extern "C" { #endif #include #include #include #include "vector.h" #include "config.h" #define HOST_VERSION 50 #define END_OF_FILE 1 #define SUCCESS 0 #define ERROR -1 #define ESIOWRITE -2 #define ESIOREAD -3 #define ESIOFRAME -4 #define ESIOCRC -5 // EOSERROR means error code is in errno #define EOSERROR -6 #define ESIOTIMEOUT -7 // Item codes for passing control options #define ITEM_FRAMING_ENABLE 1 #define ITEM_FRAMING_DISABLE 2 #define STREAM_VERSION_HIGH 0 #define STREAM_VERSION_LOW 0 #define COMMAND_QUE_MAX 20 // Nonzero to 'simulate' RPM using 5D, zero to disable #define ENABLE_SIMULATED_RPM 1 // Nonzero to trigger tool changes on wait, zero to disable #define ENABLE_TOOL_CHANGE_ON_WAIT 0 // BOUNDS CHECKING VARIABLES #define NOZZLE_MAX 280 #define NOZZLE_TIME 0.6 #define HBP_MAX 130 #define HBP_TIME 6 #define AMBIENT_TEMP 24 #define ACCELERATION_TIME 1.15 #define MAX_TIMEOUT 0xFFFF #if !defined(SPEED_T_DEFINED) #if defined(_WIN32) || defined(_WIN64) typedef long speed_t; #define SPEED_T_DEFINED #endif #endif #ifdef _WIN32 # define PATH_DELIM '\\' # define EOL "\r\n" #else # define PATH_DELIM '/' # define EOL "\n" #endif // x3g axes bitfields #define X_IS_SET 0x1 #define Y_IS_SET 0x2 #define Z_IS_SET 0x4 #define A_IS_SET 0x8 #define B_IS_SET 0x10 #define XYZ_BIT_MASK 0x7 #define AXES_BIT_MASK 0x1F #define E_IS_SET 0x20 #define F_IS_SET 0x40 #define P_IS_SET 0x100 #define R_IS_SET 0x400 #define S_IS_SET 0x800 // commands #define G_IS_SET 0x1000 #define M_IS_SET 0x2000 #define T_IS_SET 0x4000 #define COMMENT_IS_SET 0x8000 #define ARG_IS_SET 0x10000 typedef struct tPoint2d { double a; double b; } Point2d, *Ptr2d; typedef struct tPoint3d { double x; double y; double z; } Point3d, *Ptr3d; typedef struct tPoint5d { double x; double y; double z; double a; double b; } Point5d, *Ptr5d; typedef struct tCommand { // parameters double x; double y; double z; double a; double b; double e; double f; double p; double r; double s; // commands unsigned g; unsigned m; unsigned t; // comments char *comment; // state int flag; // argument char *arg; } Command, *PtrCommand; // tool id #define MAX_TOOL_ID 1 #define BUILD_PLATE_ID 2 // state #define READY_STATE 0 #define RUNNING_STATE 1 #define ENDED_STATE 2 #include "machine.h" #include "eeprominfo.h" typedef struct tTool { unsigned motor_enabled; #if ENABLE_SIMULATED_RPM unsigned rpm; #endif unsigned nozzle_temperature; unsigned build_platform_temperature; } Tool; typedef struct tOverride { double actual_filament_diameter; double filament_scale; double packing_density; unsigned standby_temperature; unsigned active_temperature; unsigned build_platform_temperature; unsigned extrusion_factor; // set by M221 } Override; typedef struct tFilament { char *colour; double diameter; unsigned temperature; unsigned LED; } Filament; #define FILAMENT_MAX 32 typedef struct tCommandAt { double z; unsigned filament_index; unsigned nozzle_temperature; unsigned build_platform_temperature; } CommandAt; #define COMMAND_AT_MAX 128 #define BUFFER_MAX 1023 // GPX CONTEXT typedef struct tGpx Gpx; typedef struct tSio Sio; struct tGpx { // IO struct { char in[BUFFER_MAX + 1]; char out[BUFFER_MAX + 1]; char *ptr; } buffer; // DATA Machine machine; // machine definition Command command; // the gcode command line struct { Point5d position; // the target position the extruder will move to (including G10 offsets) int extruder; // the target extruder (on the virtual tool carosel) } target; struct { Point5d position; // the current position of the extruder in 5D space double feedrate; // the current feed rate int extruder; // the currently selected extruder being used by the bot int offset; // current G10 offset unsigned percent; // current percent progress unsigned speed_factor; // set by M220 } current; struct { unsigned int positionKnown; // axis bitfields for known positions of the extruder unsigned int mask; } axis; Point2d excess; // the accumulated rounding error in mm to step conversion Point3d offset[7]; // G10 offsets struct { Point3d offset; // command line offset double scale; // command line scale } user; Tool tool[2]; // tool state Override override[2]; // gcode override Filament filament[FILAMENT_MAX]; int filamentLength; CommandAt commandAt[COMMAND_AT_MAX]; int commandAtIndex; int commandAtLength; double commandAtZ; // vector (dynamic array) of eeprom mappings defined by @eeprom macro vector *eepromMappingVector; // builtin eeprom map EepromMap *eepromMap; const char *preamble; int nostart, noend; // SETTINGS char *sdCardPath; char *buildName; char *iniPath; struct { unsigned relativeCoordinates:1; // signals relative or absolute coordinates unsigned extruderIsRelative:1; // signals relative or absolute coordinates for extruder unsigned reprapFlavor:1; // reprap gcode flavor unsigned dittoPrinting:1; // enable ditto printing unsigned buildProgress:1; // override build percent unsigned verboseMode:1; // verbose output unsigned logMessages:1; // enable stderr message logging unsigned verboseSioMode:1; // extra verbose for serial packets back and forth unsigned rewrite5D:1; // calculate 5D E values rather than scaling them unsigned M106AlwaysValve:1; // force M106 to reprap flavor even in makerbot mode unsigned onlyExplicitToolChange:1; // no implicit tool change when Tn used as a parameter // STATE unsigned programState:8; // gcode program state used to trigger start and end code sequences unsigned doPauseAtZPos:8; // signals that a pause is ready to be unsigned pausePending:1; // signals a pause is pending before the macro script has started unsigned macrosEnabled:1; // M73 P1 or ;@body encountered signalling body start (so we don't pause during homing) unsigned loadMacros:1; // used by the multi-pass converter to maintain state unsigned runMacros:1; // used by the multi-pass converter to maintain state unsigned framingEnabled:1; // enable framming of packets with header and crc unsigned sioConnected:1; // connected to the bot unsigned sd_paused:1; // printing from sd paused } flag; double layerHeight; // the current layer height unsigned lineNumber; // the current line number int longestDDA; char *selectedFilename; // parameter from M23 - allocated, so free before replace // STATISTICS struct { double a; double b; double time; unsigned long bytes; } accumulated; struct { double length; double time; unsigned long bytes; } total; // CALLBACK int (*callbackHandler)(Gpx *gpx, void *callbackData, char *buffer, size_t length); void *callbackData; int (*resultHandler)(Gpx *gpx, void *callbackData, const char *fmt, va_list ap); struct tSio *sio; // LOGGING FILE *log; }; struct tSio { FILE *in; int port; unsigned bytes_out; unsigned bytes_in; struct { unsigned retryBufferOverflow: 1; unsigned shortRetryBufferOverflowOnly : 1; } flag; union { struct { unsigned short version; unsigned char variant; } firmware; unsigned int bufferSize; unsigned short temperature; unsigned int isReady; union { unsigned char bitfield; struct { unsigned char ready: 1; // The extruder has reached target temperature unsigned char notPluggedIn: 1; // The tool or platform is not plugged in. unsigned char softwareCutoff: 1; // Temperature was recorded above maximum allowable. unsigned char notHeating: 1; // Heater is not heating up as expected. unsigned char temperatureDropping: 1; // Heater temperature dropped below target temp. unsigned char reserved: 1; unsigned char buildPlateError: 1; // An error was detected with the platform heater. unsigned char extruderError: 1; // An error was detected with the extruder heater. } flag; } extruder; struct { char buffer[31]; unsigned char length; } eeprom; struct { short extruderError; short extruderDelta; short extruderOutput; short buildPlateError; short buildPlateDelta; short buildPlateOutput; } pid; struct { unsigned int length; char filename[65]; unsigned char status; } sd; struct { int x; int y; int z; int a; int b; union { unsigned short bitfield; struct { unsigned short xMin: 1; // X min switch pressed unsigned short xMax: 1; // X max switch pressed unsigned short yMin: 1; // Y min switch pressed unsigned short yMax: 1; // Y max switch pressed unsigned short zMin: 1; // Z min switch pressed unsigned short zMax: 1; // Z max switch pressed unsigned short aMin: 1; // A min switch pressed unsigned short aMax: 1; // A max switch pressed unsigned short bMin: 1; // B min switch pressed unsigned short bMax: 1; // B max switch pressed } flag; } endstop; } position; union { unsigned char bitfield; struct { unsigned char preheat: 1; // Onboard preheat active unsigned char manualMode: 1; // Manual move mode active unsigned char onboardScript: 1; // Bot is running an onboard script unsigned char onboardProcess: 1; // Bot is running an onboard process unsigned char waitForButton: 1; // Bot is waiting for button press unsigned char buildCancelling: 1; // Watchdog reset flag was set at restart unsigned char heatShutdown: 1; // Heaters were shutdown after 30 minutes of inactivity unsigned char powerError: 1; // An error was detected with the system power. } flag; } motherboard; struct { unsigned lineNumber; unsigned char status; unsigned char hours; unsigned char minutes; } build; } response; }; // 23 - Get build statistics: build state values // From sailfish sources (Host.hh) enum BuildState { BUILD_NONE = 0, BUILD_RUNNING = 1, BUILD_FINISHED_NORMALLY = 2, BUILD_PAUSED = 3, BUILD_CANCELED = 4, BUILD_CANCELLING = 5, }; void gpx_initialize(Gpx *gpx, int firstTime); int gpx_set_machine(Gpx *gpx, const char *machine, int init); int gpx_set_property(Gpx *gpx, const char* section, const char* property, char* value); int gpx_load_config(Gpx *gpx, const char *filename); #ifdef USE_GPX_SIO_OPEN int gpx_sio_open(Gpx *gpx, const char *filename, speed_t baud_rate, int *sio_port); #endif int port_handler(Gpx *gpx, Sio *sio, char *buffer, size_t length); void gpx_register_callback(Gpx *gpx, int (*callbackHandler)(Gpx *gpx, void *callbackData, char *buffer, size_t length), void *callbackData); void gpx_start_convert(Gpx *gpx, char *buildName, int item_code, ...); int gpx_convert_line(Gpx *gpx, char *gcode_line); int gpx_convert(Gpx *gpx, FILE *file_in, FILE *file_out, FILE *file_out2); int gpx_convert_and_send(Gpx *gpx, FILE *file_in, int sio_port, int item_code, ...); void gpx_end_convert(Gpx *gpx); void gpx_list_machines(FILE *fp); int eeprom_load_config(Gpx *gpx, const char *filename); void gpx_set_preamble(Gpx *gpx, const char *preamble); void gpx_set_start(Gpx *gpx, int head); void gpx_set_end(Gpx *gpx, int tail); int get_next_filename(Gpx *gpx, unsigned restart); int get_advanced_version_number(Gpx *gpx); char *get_build_status(unsigned int status); int is_extruder_ready(Gpx *gpx, unsigned extruder_id); int is_build_platform_ready(Gpx *gpx, unsigned extruder_id); int get_build_statistics(Gpx *gpx); int get_motherboard_status(Gpx *gpx); int is_ready(Gpx *gpx); char *get_sd_status(unsigned int status); Machine *gpx_find_machine(const char *machine); int abort_immediately(Gpx *gpx); int set_build_platform_temperature(Gpx *gpx, unsigned extruder_id, unsigned temperature); int set_nozzle_temperature(Gpx *gpx, unsigned extruder_id, unsigned temperature); int delay(Gpx *gpx, unsigned milliseconds); int clear_buffer(Gpx *gpx); int get_extended_position(Gpx *gpx); int pause_resume(Gpx *gpx); int extended_stop(Gpx *gpx, unsigned halt_steppers, unsigned clear_queue); int set_position(Gpx *gpx); int set_build_progress(Gpx *gpx, unsigned percent); int end_build(Gpx *gpx); int load_eeprom_map(Gpx *gpx); int read_eeprom(Gpx *gpx, unsigned address, unsigned length); int write_eeprom(Gpx *gpx, unsigned address, char *data, unsigned length); int write_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char value); int read_eeprom_8(Gpx *gpx, Sio *sio, unsigned address, unsigned char *value); int write_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short value); int read_eeprom_16(Gpx *gpx, Sio *sio, unsigned address, unsigned short *value); int write_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float value); int read_eeprom_fixed_16(Gpx *gpx, Sio *sio, unsigned address, float *value); int write_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long value); int read_eeprom_32(Gpx *gpx, Sio *sio, unsigned address, unsigned long *value); int write_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float value); int read_eeprom_float(Gpx *gpx, Sio *sio, unsigned address, float *value); #ifdef __eeprominfo_h__ EepromMapping *find_any_eeprom_mapping(Gpx *, char *name); #endif #ifdef __cplusplus } #endif #endif /* __gpx_h__ */ GPX-2.5.2/src/gpx/tests/000077500000000000000000000000001271205255700147135ustar00rootroot00000000000000GPX-2.5.2/src/gpx/tests/customeeprom.gcode000066400000000000000000000003351271205255700204410ustar00rootroot00000000000000(@eeprom PROFILE_PREHEAT_PLATFORM_TEMP #0018 H) (@eeprom ENDSTOP_INVERSION #0004 B) (@eeprom PREHEAT_PLATFORM_TEMP #015C H) (@eread PROFILE_PREHEAT_PLATFORM_TEMP) (@eread ENDSTOP_INVERSION) (@eread PREHEAT_PLATFORM_TEMP) GPX-2.5.2/src/gpx/tests/eepromtest.gcode000066400000000000000000000014741271205255700201130ustar00rootroot00000000000000(@loadmap) (@eread LED_CUSTOM_COLOR_R) (@eread LED_CUSTOM_COLOR_G) (@eread LED_CUSTOM_COLOR_B) (@ewrite LED_CUSTOM_COLOR_R 0x0) (@ewrite LED_CUSTOM_COLOR_G 0x7f) (@ewrite LED_CUSTOM_COLOR_B 0x0) (@eread T0_COOLING_SETPOINT_C) (@eread T0_EXTRUDER_P_TERM) (@eread T0_EXTRUDER_I_TERM) (@eread T0_EXTRUDER_D_TERM) (@eread MAX_ACCELERATION_AXIS_X) (@eread MAX_ACCELERATION_AXIS_Y) (@eread MAX_ACCELERATION_AXIS_Z) (@eread MAX_ACCELERATION_AXIS_A) (@eread MAX_ACCELERATION_AXIS_B) (@eread JKN_ADVANCE_K) (@eread JKN_ADVANCE_K2) (@eread PREHEAT_PREHEAT_RIGHT_TEMP) (@eread PREHEAT_PREHEAT_LEFT_TEMP) (@eread PREHEAT_PREHEAT_PLATFORM_TEMP) (@eread MACHINE_NAME) (@eread MAX_SPEED_CHANGE_X) (@eread MAX_SPEED_CHANGE_Y) (@eread MAX_SPEED_CHANGE_Z) (@eread MAX_SPEED_CHANGE_A) (@eread MAX_SPEED_CHANGE_B) (@eread ENDSTOP_INVERSION) GPX-2.5.2/src/gpx/tests/issue13-g.log000066400000000000000000000000001271205255700171240ustar00rootroot00000000000000GPX-2.5.2/src/gpx/tests/issue13-g.txt000066400000000000000000000053151271205255700172000ustar00rootroot00000000000000Command count: (Command ID) Command description 1: (153) Start build notification, steps 0, name "issue13-g" 2: (150) Set build percentage 0%, reserved 0 3: (134) Switch to Tool 0 4: (140) Define position as (0, 0, 0, 0, 0) 5: (136) Tool 0: (31) Set build platform temperature to 100 C 6: (150) Set build percentage 1%, reserved 0 7: (136) Tool 0: (3) Set target temperature to 0 C 8: (150) Set build percentage 80%, reserved 0 9: (136) Tool 1: (3) Set target temperature to 210 C 10: (150) Set build percentage 99%, reserved 0 11: (141) Wait until platform 0 is ready, 100 ms between polls, 65535 s timeout 12: (155) Move to (0, 0, 0, 96, 0), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 13: (134) Switch to Tool 1 14: (139) Absolute move to (0, 0, 0, 96, 0) with DDA 346 15: (155) Move to (1308, -1049, 0, 0, 0), DDA rate 4159, A, B relative, distance 18.865799 mm, feedrate*64 3840 steps/s 16: (155) Move to (1308, -1049, 84, 0, 0), DDA rate 4000, A, B relative, distance 0.210000 mm, feedrate*64 640 steps/s 17: (155) Move to (1308, -1049, 84, 0, 96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 18: (155) Move to (-825, 825, 84, 0, 0), DDA rate 4006, A, B relative, distance 31.943174 mm, feedrate*64 3840 steps/s 19: (155) Move to (-825, 825, 204, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 20: (155) Move to (-825, 825, 204, 0, -96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 21: (155) Move to (-825, 825, 204, 0, 96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 22: (136) Tool 0: (31) Set build platform temperature to 74 C 23: (155) Move to (-825, 825, 324, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 24: (155) Move to (-825, 825, 324, 0, -96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 25: (155) Move to (-825, -825, 324, 0, -101), DDA rate 4000, A, B relative, distance 18.559999 mm, feedrate*64 2880 steps/s 26: (155) Move to (791, 752, 324, 0, -2), DDA rate 2862, A, B relative, distance 25.401812 mm, feedrate*64 2880 steps/s 27: (155) Move to (791, 752, 324, 0, 96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 28: (155) Move to (-825, 825, 324, 0, 0), DDA rate 5329, A, B relative, distance 18.194263 mm, feedrate*64 3840 steps/s 29: (155) Move to (-825, 825, 444, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 30: (155) Move to (-825, 825, 444, 0, -96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 31: (150) Set build percentage 100%, reserved 0 32: (154) End build notification, options 0x00 EOF GPX-2.5.2/src/gpx/tests/issue13-g.x3g000066400000000000000000000011601271205255700170540ustar00rootroot00000000000000issue13-gdPcd` ?`Z?(AT= W>T` ?9TA9>9 ?9` ?J9D>9D ?DzA@ D. 6A@ D` ?9DڍA9>9 ?dGPX-2.5.2/src/gpx/tests/issue13.gcode000066400000000000000000000011221271205255700172060ustar00rootroot00000000000000G90 M83 M73 P0; enable build progress G21; set units to mm G90; set positioning to absolute G92 X0 Y0 Z0 A0 B0 M140 S100 T0 M104 S0 T0 M104 S210 T1 M6 G1 E-1 F1800 ; layer 1, Z = 0.21 M135 T1 ; tool H0.3 W0.48 G1 X14.72 Y-11.8 F3600 G1 Z0.21 F600 G1 E-1 F1800 ; layer 2, Z = 0.51 G1 X-9.28 Y9.28 F3600 G1 Z0.51 F600 G1 E1 F1800 G1 E-1 F1800 ; layer 3, Z = 0.81 M140 S74 T0 G1 X-9.28 Y9.28 F3600 G1 Z0.81 F600 G1 E1 F1800 G1 X-9.28 Y-9.28 E1.0474 F2700 G1 X8.896 Y8.465 E0.0244 G1 E-1 F1800 ; layer 4, Z = 1.11 G1 X-9.28 Y9.28 E0 F3600 G1 Z1.11 E0 F600 G1 E1 F1800 M73 P100 ; end build progress GPX-2.5.2/src/gpx/tests/issue13.log000066400000000000000000000000001271205255700167000ustar00rootroot00000000000000GPX-2.5.2/src/gpx/tests/issue13.txt000066400000000000000000000054251271205255700167560ustar00rootroot00000000000000Command count: (Command ID) Command description 1: (153) Start build notification, steps 0, name "issue13" 2: (150) Set build percentage 0%, reserved 0 3: (134) Switch to Tool 0 4: (140) Define position as (0, 0, 0, 0, 0) 5: (136) Tool 0: (31) Set build platform temperature to 100 C 6: (150) Set build percentage 1%, reserved 0 7: (136) Tool 0: (3) Set target temperature to 0 C 8: (150) Set build percentage 80%, reserved 0 9: (136) Tool 1: (3) Set target temperature to 210 C 10: (150) Set build percentage 99%, reserved 0 11: (134) Switch to Tool 1 12: (139) Absolute move to (0, 0, 0, 0, 0) with DDA 37 13: (141) Wait until platform 0 is ready, 100 ms between polls, 65535 s timeout 14: (135) Wait until Tool 1 is ready, 100 ms between polls, 65535 s timeout 15: (155) Move to (0, 0, 0, 0, 96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 16: (155) Move to (1308, -1049, 0, 0, 0), DDA rate 4159, A, B relative, distance 18.865799 mm, feedrate*64 3840 steps/s 17: (155) Move to (1308, -1049, 84, 0, 0), DDA rate 4000, A, B relative, distance 0.210000 mm, feedrate*64 640 steps/s 18: (155) Move to (1308, -1049, 84, 0, 97), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 19: (155) Move to (-825, 825, 84, 0, 0), DDA rate 4006, A, B relative, distance 31.943174 mm, feedrate*64 3840 steps/s 20: (155) Move to (-825, 825, 204, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 21: (155) Move to (-825, 825, 204, 0, -97), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 22: (155) Move to (-825, 825, 204, 0, 97), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 23: (136) Tool 0: (31) Set build platform temperature to 74 C 24: (155) Move to (-825, 825, 324, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 25: (155) Move to (-825, 825, 324, 0, -97), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 26: (155) Move to (-825, -825, 324, 0, -101), DDA rate 4000, A, B relative, distance 18.559999 mm, feedrate*64 2880 steps/s 27: (155) Move to (791, 752, 324, 0, -2), DDA rate 2862, A, B relative, distance 25.401812 mm, feedrate*64 2880 steps/s 28: (155) Move to (791, 752, 324, 0, 96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 29: (155) Move to (-825, 825, 324, 0, 0), DDA rate 5329, A, B relative, distance 18.194263 mm, feedrate*64 3840 steps/s 30: (155) Move to (-825, 825, 444, 0, 0), DDA rate 3999, A, B relative, distance 0.300000 mm, feedrate*64 640 steps/s 31: (155) Move to (-825, 825, 444, 0, -96), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 32: (150) Set build percentage 100%, reserved 0 33: (154) End build notification, options 0x00 EOF GPX-2.5.2/src/gpx/tests/issue13.x3g000066400000000000000000000011641271205255700166340ustar00rootroot00000000000000issue13dPc%dd` ??(AT= W>Ta ?9TA9>9 ?9a ?J9D>9D ?DzA@ D. 6A@ D` ?9DڍA9>9 ?dGPX-2.5.2/src/gpx/tests/issuemarkwal1.gcode000066400000000000000000000000371271205255700205060ustar00rootroot00000000000000G28 X Y Z M132 X Y Z A B G1 Z5 GPX-2.5.2/src/gpx/tests/lint-g.log000066400000000000000000000004321271205255700166070ustar00rootroot00000000000000(line 27) Syntax warning: nested comment detected (line 123) warning G92 emulation unable to determine all coordinates to set via x3g:140 set extended position current position defined as X:30.00 Y:30.00 Z:30.00 A:0.00 B:0.00 (line 27) Syntax warning: nested comment detected GPX-2.5.2/src/gpx/tests/lint-g.txt000066400000000000000000000226521271205255700166550ustar00rootroot00000000000000Command count: (Command ID) Command description 1: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M103 - extruder off" 2: (137) Disable A stepper motors 3: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - start build" 4: (153) Start build notification, steps 0, name "lint-g" 5: (150) Set build percentage 0%, reserved 0 6: (134) Switch to Tool 0 7: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G0 - rapid move" 8: (139) Absolute move to (889, 889, 4000, -96, 0) with DDA 269 9: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G0 - rapid move-f" 10: (155) Move to (-889, -889, -4000, -96, 0), DDA rate 3849, A, B relative, distance 34.641018 mm, feedrate*64 1066 steps/s 11: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G1 - coord move" 12: (155) Move to (889, 889, 4000, -96, 0), DDA rate 3849, A, B relative, distance 34.641018 mm, feedrate*64 1066 steps/s 13: (150) Set build percentage 1%, reserved 0 14: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G1 - coord move-f" 15: (155) Move to (889, 889, 4000, -97, 0), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 16: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G4 - dwell" 17: (133) Dwell for 1000 milliseconds 18: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G10 - set offsets" 19: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G21 - metric units" 20: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G28 - home to max" 21: (132) Home maximum on X, Y, feedrate 382 us/step, timeout 20 s 22: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G54 - use G10 P1" 23: (139) Absolute move to (889, 889, 4000, -578, 0) with DDA 337 24: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G55 - use G10 P2" 25: (155) Move to (1778, 1778, 8000, -97, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 26: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G56 - use G10 P3" 27: (155) Move to (2667, 2667, 12000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 28: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G57 - use G10 P4" 29: (155) Move to (3556, 3556, 16000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 30: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G58 - use G10 P5" 31: (155) Move to (4444, 4444, 20000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 32: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G59 - use G10 P6" 33: (155) Move to (5333, 5333, 24000, -97, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 34: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G53 - machine zero" 35: (155) Move to (0, 0, 0, -96, 0), DDA rate 7698, A, B relative, distance 103.923050 mm, feedrate*64 2133 steps/s 36: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G91 - relative" 37: (155) Move to (889, 889, 4000, 1059, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 38: (150) Set build percentage 2%, reserved 0 39: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G90 - absolute" 40: (155) Move to (0, 0, 0, -1252, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 41: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G92 - define pos" 42: (140) Define position as (2667, 2667, 12000, 0, 0) 43: (155) Move to (0, 0, 0, 0, 0), DDA rate 7698, A, B relative, distance 51.961525 mm, feedrate*64 2133 steps/s 44: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - set pots" 45: (145) Set X axis digipot to 20 46: (145) Set Y axis digipot to 20 47: (145) Set Z axis digipot to 20 48: (145) Set A axis digipot to 20 49: (145) Set B axis digipot to 20 50: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - home xy max" 51: (132) Home maximum on X, Y, feedrate 382 us/step, timeout 20 s 52: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - home xy min" 53: (131) Home minimum on Z, feedrate 136 us/step, timeout 20 s 54: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M104 - set temp" 55: (136) Tool 0: (3) Set target temperature to 230 C 56: (150) Set build percentage 18%, reserved 0 57: (136) Tool 1: (3) Set target temperature to 230 C 58: (150) Set build percentage 34%, reserved 0 59: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M6 - wait for tool" 60: (135) Wait until Tool 0 is ready, 100 ms between polls, 65535 s timeout 61: (134) Switch to Tool 1 62: (135) Wait until Tool 1 is ready, 100 ms between polls, 65535 s timeout 63: (135) Wait until Tool 1 is ready, 100 ms between polls, 65535 s timeout 64: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M17 - steppers on" 65: (137) Enable X, Y, Z, A, B stepper motors 66: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M18 - steppers off" 67: (137) Disable X, Y, Z, A, B stepper motors 68: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T0 - tool change" 69: (134) Switch to Tool 0 70: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T1 - tool change" 71: (134) Switch to Tool 1 72: (149) Display message, options 0x00, position (0, 0), timeout 0 s, message "This is a really lar" 73: (149) Display message, options 0x01, position (0, 0), timeout 0 s, message "ge message that will" 74: (149) Display message, options 0x01, position (0, 0), timeout 0 s, message " take up quite a few" 75: (149) Display message, options 0x03, position (0, 0), timeout 20 s, message " rows to display on " 76: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M71 - wait for input" 77: (149) Display message, options 0x06, position (0, 0), timeout 0 s, message "Press the M Button" 78: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M72 - play song" 79: (151) Queue song 0 80: (151) Queue song 1 81: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - progress" 82: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M101 - extruder on-f" 83: (137) Enable B stepper motors 84: (137) Enable A stepper motors 85: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M102 - extruder on-r" 86: (137) Enable B stepper motors 87: (137) Enable A stepper motors 88: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M103 - extruder off" 89: (137) Disable B stepper motors 90: (137) Disable A stepper motors 91: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M104 - set temp" 92: (136) Tool 1: (3) Set target temperature to 240 C 93: (136) Tool 0: (3) Set target temperature to 230 C 94: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M108 - set rpm" 95: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M109 - hbp temp" 96: (136) Tool 0: (31) Set build platform temperature to 110 C 97: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M126 - blower on" 98: (136) Tool 1: (13) Toggle blower fan 1 99: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M127 - blower off" 100: (136) Tool 1: (13) Toggle blower fan 0 101: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M131 - store EEPROM" 102: (143) Store home position for X, Y, Z, A, B 103: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M132 - load EEPROM" 104: (144) Recall home position for X, Y, Z, A, B 105: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M140 - hbp temp" 106: (136) Tool 0: (31) Set build platform temperature to 100 C 107: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M300 - set beep" 108: (147) Set buzzer frequency 4000, duration 100 ms, effect 0 109: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M320 - acc on" 110: (156) Set segment acceleration on 111: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M21 - acc off" 112: (156) Set segment acceleration off 113: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M322 - pause@z" 114: (158) Pause @ Z position 10.000000 115: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M420 - set LED" 116: (146) Set RGB LED (0xff, 0x00, 0x00), blink rate 0, effect 0 117: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T1 - set tool" 118: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T0 - set tool" 119: (134) Switch to Tool 0 120: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - end build" 121: (150) Set build percentage 100%, reserved 0 122: (154) End build notification, options 0x00 123: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "after the end" 124: (8) Pause EOF GPX-2.5.2/src/gpx/tests/lint-g.x3g000066400000000000000000000036041271205255700165330ustar00rootroot00000000000000M103 - extruder offM73 - start buildlint-gG0 - rapid moveyy G0 - rapid move-f` g B*G1 - coord moveyy g B*G1 - coord move-fyy ?G4 - dwellG10 - set offsetsG21 - metric unitsG28 - home to max~G54 - use G10 P1yyQG55 - use G10 P2@gAUG56 - use G10 P3k k .gAUG57 - use G10 P4 >gAUG58 - use G10 P5\\ NgAUG59 - use G10 P6]gAUG53 - machine zeroBUG91 - relativeyy#gAUG90 - absolutegAUG92 - define posk k .OBUG130 - set potsG130 - home xy max~G130 - home xy minM104 - set temp"M6 - wait for tooldddM17 - steppers onM18 - steppers offT0 - tool changeT1 - tool changeThis is a really large message that will take up quite a few rows to display on M71 - wait for inputPress the M ButtonM72 - play songM73 - progressM101 - extruder on-fM102 - extruder on-rM103 - extruder offM104 - set tempM108 - set rpmM109 - hbp tempnM126 - blower on M127 - blower off M131 - store EEPROMM132 - load EEPROMM140 - hbp tempdM300 - set beepdM320 - acc onM21 - acc offM322 - pause@z AM420 - set LEDT1 - set toolT0 - set toolM73 - end builddafter the endGPX-2.5.2/src/gpx/tests/lint.gcode000066400000000000000000000125151271205255700166700ustar00rootroot00000000000000; ; ling.gcode (unit test for gpx) ; ; Created by WHPThomas on 1/04/13. ; ; Copyright (c) 2013 WHPThomas. ; ; ; This program is free software; you can redistribute it and/or modify ; it under the terms of the GNU General Public License as published by ; the Free Software Foundation; either version 2 of the License, or ; (at your option) any later version. ; ; This program is distributed in the hope that it will be useful, ; but WITHOUT ANY WARRANTY; without even the implied warranty of ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ; GNU General Public License for more details. ; ; You should have received a copy of the GNU General Public License ; along with this program; if not, write to the Free Software Foundation, ; Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ; @machine r2x ; PREFIX (*(* THIS IS A NESTED COMMENT *)*) M70 (M103 - extruder off) M103 (turn extruder off) M70 (M73 - start build) M73 P0 (start build progress) ;G21 (units to mm) G90 (set positioning to absolute) ; G0 - Rapid Positioning M70 (G0 - rapid move) G0 X10 Y10 Z10 E1 M70 (G0 - rapid move-f) G0 X-10 Y-10 Z-10 E2 F1000 ; G1 - Coordinated Motion M70 (G1 - coord move) G1 X10 Y10 Z10 E3 M70 (G1 - coord move-f) G1 X10 Y10 Z10 E4 F2000 ; G2 - Clockwise Arc ; G3 - Counter Clockwise Arc ; G4 - Dwell M70 (G4 - dwell) G4 P1000 ; G10 - Create Coordinate System Offset from the Absolute one M70 (G10 - set offsets) G10 P1 X10 Y10 Z10 G10 P2 X20 Y20 Z20 G10 P3 X30 Y30 Z30 G10 P4 X40 Y40 Z40 G10 P5 X50 Y50 Z50 G10 P6 X60 Y60 Z60 ; G21 - Use Milimeters as Units ; G71 - Use Milimeters as Units M70 (G21 - metric units) G21 G71 ; G28 - Home given axes to maximum M70 (G28 - home to max) G28 X Y ; G54 - Use coordinate system from G10 P1 M70 (G54 - use G10 P1) G54 G1 X0 Y0 Z0 E6 ; G55 - Use coordinate system from G10 P2 M70 (G55 - use G10 P2) G55 G1 X0 Y0 Z0 E7 ; G56 - Use coordinate system from G10 P3 M70 (G56 - use G10 P3) G56 G1 X0 Y0 Z0 E8 ; G57 - Use coordinate system from G10 P4 M70 (G57 - use G10 P4) G57 G1 X0 Y0 Z0 E9 ; G58 - Use coordinate system from G10 P5 M70 (G58 - use G10 P5) G58 G1 X0 Y0 Z0 E10 ; G59 - Use coordinate system from G10 P6 M70 (G59 - use G10 P6) G59 G1 X0 Y0 Z0 E11 ; G53 - Set absolute coordinate system M70 (G53 - machine zero) G53 G1 X0 Y0 Z0 E12 ; G91 - Relative Positioning M70 (G91 - relative) G90 G1 X10 Y10 Z10 E1 ; G90 - Absolute Positioning M70 (G90 - absolute) G90 G1 X0 Y0 Z0 E14 ; G92 - Define current position on axes M70 (G92 - define pos) G92 X30 Y30 Z30 E0 G1 X0 Y0 Z0 E0 ; G97 - Spindle speed rate ;M70 (G97 - spindle speed) ;G97 S50 ; G130 - Set given axes potentiometer Value M70 (G130 - set pots) G130 X20 Y20 Z20 A20 B20 ; G161 - Home given axes to minimum M70 (G130 - home xy max) G162 X Y F2500 (home XY axes maximum) ; G162 - Home given axes to maximum M70 (G130 - home xy min) G161 Z F1100 (home Z axis minimum) ; M0 - Unconditional Halt, not supported on SD? ; M1 - Optional Halt, not supported on SD? ; M2 - "End program M70 (M104 - set temp) M104 S230 T0 M104 S230 T1 ; M6 - Wait for toolhead to come up to reach (or exceed) temperature M70 (M6 - wait for tool) M6 T0 M6 T1 M6 ; M7 - Coolant A on (flood coolant) ;M70 (M7 - flood coolant) ;M7 ; M8 - Coolant B on (mist coolant) ;M70 (M8 - mist coolant) ;M8 ; M9 - All Coolant Off ;M70 (M9 - coolant off) ;M9 ; M10 - Close Clamp ;M70 (M10 - close clamp) ;M10 ; M11 - Open Clamp ;M70 (M11 - open clamp) ;M11 ; M17 - Enable axes steppers M70 (M17 - steppers on) M17 X Y Z A B ; M18 - Disable axes steppers M70 (M18 - steppers off) M18 X Y Z A B ; We're actually on Tool 1 right now... M70 (T0 - tool change) T0 M70 (T1 - tool change) T1 ; M70 - Display Message On Machine M70 P20 (This is a really large message that will take up quite a few rows to display on the makerbot LCD screen) ; M71 - Display Message, Wait For User Button Press M70 (M71 - wait for input) M71 (Press the M Button) ; M72 - Play a Tone or Song M70 (M72 - play song) M72 P0 M72 P1 ; M73 - Manual Set Build % M70 (M73 - progress) M73 P10 (build progress) ; M101 - Turn Extruder On, Forward M70 (M101 - extruder on-f) M101 T1 M101 T0 ; M102 - Turn Extruder On, Reverse M70 (M102 - extruder on-r) M102 T1 M102 T0 ; M103 - Turn Extruder Off M70 (M103 - extruder off) M103 T1 M103 T0 ; M104 - Set Temperature M70 (M104 - set temp) M104 T1 S240 M104 T0 S230 ; M108 - Set Extruder's Max Speed (R = RPM) M70 (M108 - set rpm) M108 T1 R5.0 M108 T0 R3.0 ; M109 - Set Build Platform Temperature M70 (M109 - hbp temp) M109 S110 ; M126 - Valve Open M70 (M126 - blower on) M126 ; M127 - Valve Close M70 (M127 - blower off) M127 ; M131 - Store Current Position to EEPROM M70 (M131 - store EEPROM) M131 X Y Z A B ; M132 - Load Current Position from EEPROM M70 (M132 - load EEPROM) M132 X Y Z A B ; M140 - Set Build Platform Temperature M70 (M140 - hbp temp) M140 T0 S100 ; M300 - Set Beep M70 (M300 - set beep) M300 S4000 P100 ; M320 - Acceleration on for subsequent instructions M70 (M320 - acc on) M320 ; M321 - Acceleration off for subsequent instructions M70 (M21 - acc off) M321 ; M322 - Pause @ zPos M70 (M322 - pause@z) M322 Z10 ; M420 - Set RGB LED value M70 (M420 - set LED) M420 R255 E0 B0 P0 ; T1 - Set Current Tool 1 M70 (T1 - set tool) T1 ; T0 - Set Current Tool 0 M70 (T0 - set tool) T0 ;POSTFIX M70 (M73 - end build) M73 P100 (end build progress) M70 (after the end) M1 (pause) GPX-2.5.2/src/gpx/tests/lint.log000066400000000000000000000004321271205255700163630ustar00rootroot00000000000000(line 27) Syntax warning: nested comment detected (line 123) warning G92 emulation unable to determine all coordinates to set via x3g:140 set extended position current position defined as X:30.00 Y:30.00 Z:30.00 A:0.00 B:0.00 (line 27) Syntax warning: nested comment detected GPX-2.5.2/src/gpx/tests/lint.txt000066400000000000000000000227541271205255700164340ustar00rootroot00000000000000Command count: (Command ID) Command description 1: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M103 - extruder off" 2: (137) Disable A stepper motors 3: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - start build" 4: (153) Start build notification, steps 0, name "lint" 5: (150) Set build percentage 0%, reserved 0 6: (134) Switch to Tool 0 7: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G0 - rapid move" 8: (139) Absolute move to (889, 889, 4000, -96, 0) with DDA 269 9: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G0 - rapid move-f" 10: (155) Move to (-889, -889, -4000, -96, 0), DDA rate 3849, A, B relative, distance 34.641018 mm, feedrate*64 1066 steps/s 11: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G1 - coord move" 12: (155) Move to (889, 889, 4000, -96, 0), DDA rate 3849, A, B relative, distance 34.641018 mm, feedrate*64 1066 steps/s 13: (150) Set build percentage 1%, reserved 0 14: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G1 - coord move-f" 15: (155) Move to (889, 889, 4000, -97, 0), DDA rate 2560, A, B relative, distance 1.000000 mm, feedrate*64 1706 steps/s 16: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G4 - dwell" 17: (133) Dwell for 1000 milliseconds 18: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G10 - set offsets" 19: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G21 - metric units" 20: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G28 - home to max" 21: (132) Home maximum on X, Y, feedrate 382 us/step, timeout 20 s 22: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G54 - use G10 P1" 23: (139) Absolute move to (889, 889, 4000, -578, 0) with DDA 337 24: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G55 - use G10 P2" 25: (155) Move to (1778, 1778, 8000, -97, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 26: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G56 - use G10 P3" 27: (155) Move to (2667, 2667, 12000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 28: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G57 - use G10 P4" 29: (155) Move to (3556, 3556, 16000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 30: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G58 - use G10 P5" 31: (155) Move to (4444, 4444, 20000, -96, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 32: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G59 - use G10 P6" 33: (155) Move to (5333, 5333, 24000, -97, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 34: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G53 - machine zero" 35: (155) Move to (0, 0, 0, -96, 0), DDA rate 7698, A, B relative, distance 103.923050 mm, feedrate*64 2133 steps/s 36: (150) Set build percentage 2%, reserved 0 37: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G91 - relative" 38: (155) Move to (889, 889, 4000, 1059, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 39: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G90 - absolute" 40: (155) Move to (0, 0, 0, -1252, 0), DDA rate 7698, A, B relative, distance 17.320509 mm, feedrate*64 2133 steps/s 41: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G92 - define pos" 42: (140) Define position as (2667, 2667, 12000, 0, 0) 43: (155) Move to (0, 0, 0, 0, 0), DDA rate 7698, A, B relative, distance 51.961525 mm, feedrate*64 2133 steps/s 44: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - set pots" 45: (145) Set X axis digipot to 20 46: (145) Set Y axis digipot to 20 47: (145) Set Z axis digipot to 20 48: (145) Set A axis digipot to 20 49: (145) Set B axis digipot to 20 50: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - home xy max" 51: (132) Home maximum on X, Y, feedrate 382 us/step, timeout 20 s 52: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "G130 - home xy min" 53: (131) Home minimum on Z, feedrate 136 us/step, timeout 20 s 54: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M104 - set temp" 55: (136) Tool 0: (3) Set target temperature to 230 C 56: (150) Set build percentage 19%, reserved 0 57: (136) Tool 1: (3) Set target temperature to 230 C 58: (150) Set build percentage 36%, reserved 0 59: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M6 - wait for tool" 60: (135) Wait until Tool 0 is ready, 100 ms between polls, 65535 s timeout 61: (134) Switch to Tool 1 62: (135) Wait until Tool 1 is ready, 100 ms between polls, 65535 s timeout 63: (135) Wait until Tool 1 is ready, 100 ms between polls, 65535 s timeout 64: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M17 - steppers on" 65: (137) Enable X, Y, Z, A, B stepper motors 66: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M18 - steppers off" 67: (137) Disable X, Y, Z, A, B stepper motors 68: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T0 - tool change" 69: (134) Switch to Tool 0 70: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T1 - tool change" 71: (134) Switch to Tool 1 72: (149) Display message, options 0x00, position (0, 0), timeout 0 s, message "This is a really lar" 73: (149) Display message, options 0x01, position (0, 0), timeout 0 s, message "ge message that will" 74: (149) Display message, options 0x01, position (0, 0), timeout 0 s, message " take up quite a few" 75: (149) Display message, options 0x03, position (0, 0), timeout 20 s, message " rows to display on " 76: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M71 - wait for input" 77: (149) Display message, options 0x06, position (0, 0), timeout 0 s, message "Press the M Button" 78: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M72 - play song" 79: (151) Queue song 0 80: (151) Queue song 1 81: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - progress" 82: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M101 - extruder on-f" 83: (137) Enable B stepper motors 84: (137) Enable A stepper motors 85: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M102 - extruder on-r" 86: (137) Enable B stepper motors 87: (137) Enable A stepper motors 88: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M103 - extruder off" 89: (137) Disable B stepper motors 90: (137) Disable A stepper motors 91: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M104 - set temp" 92: (136) Tool 1: (3) Set target temperature to 240 C 93: (136) Tool 0: (3) Set target temperature to 230 C 94: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M108 - set rpm" 95: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M109 - hbp temp" 96: (136) Tool 0: (3) Set target temperature to 110 C 97: (135) Wait until Tool 0 is ready, 100 ms between polls, 65535 s timeout 98: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M126 - blower on" 99: (136) Tool 0: (13) Toggle blower fan 1 100: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M127 - blower off" 101: (136) Tool 0: (13) Toggle blower fan 0 102: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M131 - store EEPROM" 103: (143) Store home position for X, Y, Z, A, B 104: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M132 - load EEPROM" 105: (144) Recall home position for X, Y, Z, A, B 106: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M140 - hbp temp" 107: (136) Tool 0: (31) Set build platform temperature to 100 C 108: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M300 - set beep" 109: (147) Set buzzer frequency 4000, duration 100 ms, effect 0 110: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M320 - acc on" 111: (156) Set segment acceleration on 112: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M21 - acc off" 113: (156) Set segment acceleration off 114: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M322 - pause@z" 115: (158) Pause @ Z position 10.000000 116: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M420 - set LED" 117: (146) Set RGB LED (0xff, 0x00, 0x00), blink rate 0, effect 0 118: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T1 - set tool" 119: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "T0 - set tool" 120: (134) Switch to Tool 0 121: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "M73 - end build" 122: (150) Set build percentage 100%, reserved 0 123: (154) End build notification, options 0x00 124: (149) Display message, options 0x02, position (0, 0), timeout 0 s, message "after the end" 125: (8) Pause EOF GPX-2.5.2/src/gpx/tests/lint.x3g000066400000000000000000000036101271205255700163040ustar00rootroot00000000000000M103 - extruder offM73 - start buildlintG0 - rapid moveyy G0 - rapid move-f` g B*G1 - coord moveyy g B*G1 - coord move-fyy ?G4 - dwellG10 - set offsetsG21 - metric unitsG28 - home to max~G54 - use G10 P1yyQG55 - use G10 P2@gAUG56 - use G10 P3k k .gAUG57 - use G10 P4 >gAUG58 - use G10 P5\\ NgAUG59 - use G10 P6]gAUG53 - machine zeroBUG91 - relativeyy#gAUG90 - absolutegAUG92 - define posk k .OBUG130 - set potsG130 - home xy max~G130 - home xy minM104 - set temp$M6 - wait for tooldddM17 - steppers onM18 - steppers offT0 - tool changeT1 - tool changeThis is a really large message that will take up quite a few rows to display on M71 - wait for inputPress the M ButtonM72 - play songM73 - progressM101 - extruder on-fM102 - extruder on-rM103 - extruder offM104 - set tempM108 - set rpmM109 - hbp tempndM126 - blower on M127 - blower off M131 - store EEPROMM132 - load EEPROMM140 - hbp tempdM300 - set beepdM320 - acc onM21 - acc offM322 - pause@z AM420 - set LEDT1 - set toolT0 - set toolM73 - end builddafter the endGPX-2.5.2/src/gpx/vector.c000066400000000000000000000056231271205255700152250ustar00rootroot00000000000000// vector.c // // Simple implementation of a dynamic array // // Created by Mark Walker (markwal@hotmail.com) // // Copyright (c) 2015 Mark Walker, All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #include #include #include "vector.h" // create a vector of items of size cb, initial size cInitial and grows by cChunk // returns a pointer to the new vector or NULL on failure vector *vector_create(int cb, int cInitial, int cChunk) { vector *pv = (vector *)malloc(sizeof(vector)); if (pv == NULL) return NULL; pv->c = 0; pv->cb = cb; pv->cSize = cInitial; pv->cChunk = cChunk; pv->pb = (char *)malloc((size_t)cb * cInitial); if (pv->pb == NULL) { free(pv); return NULL; } return pv; } // free the vector void vector_free(vector *pv) { free(pv->pb); free(pv); } // grow the vector by cChunk items // returns true on success or false on failure int vector_grow(vector *pv) { if (pv->cSize + pv->cChunk < pv->cSize) // overflow? return 0; if ((size_t)(pv->cSize + pv->cChunk) * pv->cb < (size_t)pv->cSize * pv->cb) return 0; char *pb = (char *)realloc(pv->pb, (size_t)(pv->cSize + pv->cChunk) * pv->cb); if (pb == NULL) return 0; pv->pb = pb; pv->cSize += pv->cChunk; return 1; } // insert item into the vector at index i // returns the index of the item or -1 on failure int vector_insert(vector *pv, int i, void *p) { if (i < 0 || i > pv->c) return -1; if (pv->c >= pv->cSize && !vector_grow(pv)) return -1; if (i < pv->c) memmove(pv->pb + ((size_t)(i + 1) * pv->cb), pv->pb + ((size_t)i * pv->cb), (size_t)(pv->c - i) * pv->cb); memcpy(pv->pb + ((size_t)i * pv->cb), p, pv->cb); (pv->c)++; return i; } // append item to the end of the vector // returns the index to the item or -1 on failure int vector_append(vector *pv, void *p) { return vector_insert(pv, pv->c, p); } // return a pointer to the ith item in the vector, don't hold this pointer // across calls that could end up modifying the vector void *vector_get(vector *pv, int i) { if (pv->c == 0 || i < 0 || i >= pv->c) return NULL; return pv->pb + ((size_t)i * pv->cb); } GPX-2.5.2/src/gpx/vector.h000066400000000000000000000036641271205255700152350ustar00rootroot00000000000000// vector.h // // Simple implementation of a dynamic array // // Created by Mark Walker (markwal@hotmail.com) // // Copyright (c) 2015 Mark Walker, All rights reserved. // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA typedef struct _vector { int c; // count of items in the vector int cb; // count of bytes per item int cSize; // count of items of allocated space int cChunk; // number of items to allocate at a time char *pb; // array of items } vector; // create a vector of items of size cb, initial size cInitial and grows by cChunk // returns a pointer to the new vector or NULL on failure vector *vector_create(int cb, int cInitial, int cChunk); // free the vector void vector_free(vector *pv); // grow the vector by cChunk items // returns true on success or false on failure int vector_grow(vector *pv); // insert item into the vector at index i // returns the index of the item or -1 on failure int vector_insert(vector *pv, int i, void *p); // append item to the end of the vector // returns the index to the item or -1 on failure int vector_append(vector *pv, void *p); // return a pointer to the ith item in the vector, don't hold this pointer // across calls that could end up modifying the vector void *vector_get(vector *pv, int i); GPX-2.5.2/src/gpx/winsio.c000066400000000000000000000054631271205255700152350ustar00rootroot00000000000000// // winsio.c // // winsio - allow serial I/O without a cygwin dependency // added to gpx markwal 5/8/2015 // // GPX originally created by WHPThomas on 1/04/13. // // gpx is Copyright (c) 2013 WHPThomas, All rights reserved. // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #include #include #undef ERROR #include "winsio.h" #include "gpx.h" int gpx_sio_open(Gpx *gpx, const char *filename, speed_t baud_rate, int *sio_port) { HANDLE h = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, 0, OPEN_EXISTING, 0, 0); if (h == INVALID_HANDLE_VALUE) { fprintf(gpx->log, "Error opening port"); return 0; } *sio_port = _open_osfhandle((intptr_t)h, 0); DCB dcb = {0}; dcb.DCBlength = sizeof(dcb); if (!GetCommState(h, &dcb)) { fprintf(gpx->log, "Error getting port attributes"); return 0; } dcb.BaudRate = baud_rate; dcb.ByteSize=8; dcb.StopBits=ONESTOPBIT; dcb.Parity=NOPARITY; if (!SetCommState(h, &dcb)) { fprintf(gpx->log, "Error setting port attributes"); return 0; } COMMTIMEOUTS timeouts={0}; timeouts.ReadIntervalTimeout=50; timeouts.ReadTotalTimeoutConstant=10; timeouts.ReadTotalTimeoutMultiplier=50; timeouts.WriteTotalTimeoutMultiplier=10; if (!SetCommTimeouts(h, &timeouts)) { fprintf(gpx->log, "Error setting port timeouts"); return 0; } // not sure best way to flush the read buffer without tcflush printf("reading bytes\n"); unsigned char buffer[128]; size_t bytes; while ((bytes = read(*sio_port, buffer, sizeof(buffer))) > 0) { unsigned char *p = buffer; while (bytes--) printf("%02x ", (unsigned)*p++); } printf("\ngot rval = %ld\n", (long)bytes); if(gpx->flag.verboseMode) fprintf(gpx->log, "Communicating via: %s" EOL, filename); return 1; } GPX-2.5.2/src/gpx/winsio.h000066400000000000000000000027261271205255700152410ustar00rootroot00000000000000// // winsio.h // // winsio - allow serial I/O without a cygwin dependency // added to gpx markwal 5/8/2015 // // GPX originally created by WHPThomas on 1/04/13. // // gpx is Copyright (c) 2013 WHPThomas, All rights reserved. // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // #define B0 0 #define B4800 4800 #define B9600 9600 #define B14400 14400 #define B19200 19200 #define B28800 28800 #define B38400 38400 #define B57600 57600 #define B115200 115200 #if !defined(SPEED_T_DEFINED) typedef long speed_t; #define SPEED_T_DEFINED #endif GPX-2.5.2/src/pymodule/000077500000000000000000000000001271205255700146115ustar00rootroot00000000000000GPX-2.5.2/src/pymodule/Readme.md000066400000000000000000000014201271205255700163250ustar00rootroot00000000000000python-gpx is a python package that wraps GPX (Dr. Henry Thomas's g-code translator). You can use it to talk gcode to MakerBot's (pre gen 5) and to clones. #Work in progress Currently this is just barely wired up. So, for example, it really only supports the g-codes that would normally come out of a slicer and doesn't really do anything useful with g-codes that are intended to return useful information like temperature, etc. #How to install via sources: ``` python setup.py install ``` #Examples For fun, you can boot up python and type this at the python command prompt: ``` import gpx # reads config from gpx.ini in current dir and writes log entries to stderr gpx.connect("/dev/ttyACM0", 115200, "gpx.ini") # play a song gpx.write("M72 P1") # cleanup gpx.disconnect() ``` GPX-2.5.2/src/pymodule/gpxmodule.c000066400000000000000000001641711271205255700167730ustar00rootroot00000000000000#include #include #include #include #include #include #if !defined(_WIN32) && !defined(_WIN64) #include #include #else #include "winsio.h" #endif #define USE_GPX_SIO_OPEN #include "eeprominfo.h" #include "gpx.h" // TODO at the moment the module is taking twice as much memory for Gpx as it // should to because gpx-main also has one. We can merge them via extern or pass // it one way or the other, but perhaps the best way is to drop gpx-main from // the module and reserve that for the CLI. We'll need to refactor a couple of // things from it however static Gpx gpx; #define SHOW(FN) if(gpx->flag.logMessages) {FN;} #define VERBOSE(FN) if(gpx->flag.verboseMode && gpx->flag.logMessages) {FN;} // Sttb - string table // need one of these to hang onto the filename list so that we can emulate // case insensitivty since some host software expects that of gcode M23 typedef struct tSttb { char **rgs; // array of pointers size_t cb; // count of bytes - allocated size of rgs size_t cb_expand; // count of bytes to expand by each expansion long cs; // count of strings currently stored Assert(cs * sizeof(char *) <= cb) } Sttb; // make a new string table // cs_chunk -- count of strings -- grow the string array in chunks of this many strings Sttb *sttb_init(Sttb *psttb, long cs_chunk) { size_t cb = (size_t)cs_chunk * sizeof(char *); psttb->cs = 0; psttb->rgs = malloc(cb); if (psttb->rgs == NULL) return NULL; psttb->cb_expand = psttb->cb = cb; return psttb; } void sttb_cleanup(Sttb *psttb) { char **ps = NULL; if (psttb->rgs == NULL) return; for (ps = psttb->rgs; ps < psttb->rgs + psttb->cs; ps++) free(*ps); free(psttb->rgs); psttb->rgs = NULL; psttb->cb = psttb->cb_expand = 0; psttb->cs = 0; } char *sttb_add(Sttb *psttb, char *s) { if (psttb->rgs == NULL) return NULL; size_t cb_needed = sizeof(char *) * ((size_t)psttb->cs + 1); if (cb_needed > psttb->cb) { if (psttb->cb + psttb->cb_expand > cb_needed) cb_needed = psttb->cb + psttb->cb_expand; char **rgs_new = realloc(psttb->rgs, cb_needed); if (rgs_new == NULL) return NULL; psttb->rgs = rgs_new; psttb->cb = cb_needed; } if ((s = strdup(s)) == NULL) return NULL; return psttb->rgs[psttb->cs++] = s; } void sttb_remove(Sttb *psttb, long i) { if (i < 0 || i >= psttb->cs) // a little bounds checking return; free(psttb->rgs[i]); memcpy(psttb->rgs + i, psttb->rgs + i + 1, (psttb->cs - i - 1) * sizeof(char *)); psttb->cs--; } long sttb_find_nocase(Sttb *psttb, char *s) { long i; for (i = 0; i < psttb->cs; i++) { if (strcasecmp(s, psttb->rgs[i]) == 0) return i; } return -1; } // Note on cancellation states // So, there are a few things that are tricky about cancellation. First, we need // three different threads of execution to know that there is a cancel and take // an action. Any of the three can initiate, but all need to complete before // we're back to normal. // 1. The host control loop needs to stop sending new commands and will send // (@clear_cancel) when to acknowledge that it is no longer sending new commands // from the cancelled job // 2. The host event handler loop is asynchronous with the control loop will // send an out of order M112 to cancel. This is done to interrupt any long // running operations that the control loop will just wait for (like homing or // heating). It should do nothing when the printer initiates a cancel. // 3. The printer itself can initiate a cancel by returning 0x89 from a serial // communication. It may do this, for example, because the user used the LCD to // cancel the print. Complicating matters is that it will also return 0x89 to // acknowledge that it has complied with a host request to cancel and it takes // suprisingly long time for it to do that. // // so we have three bits that get set to say we're still waiting for one of the // threads, more than one may be set simultaneously // flag.cancelPending - waiting for the control loop to send (@clear_cancel) // marking the end of the send stream // waitflag.waitForCancelSync - waiting for the event loop to send the M112 via // gpx_abort // waitflag.waitForBotCancel - waiting for the bot to reply with 0x89 // // two may be set simultaneously // In addition, on cancel we need to wait for the bot to quiesce (if clear build // EEPROM is set) and discover our position again. // Tio - translated serial io // wraps Sio and adds translation output buffer // translation is reprap style response typedef struct tTio { char translation[BUFFER_MAX + 1]; size_t cur; Sio sio; union { unsigned flags; struct { unsigned listingFiles:1; // in the middle of an M20 response unsigned getPosWhenReady:1; // waiting for queue to drain to get position unsigned cancelPending:1; // we're eating everything until the host says it has stopped sending stuff (@clear_cancel) unsigned okPending:1; // we want the ok to come at the end of the response unsigned waitClearedByCancel:1; // recheck wait state } flag; }; union { unsigned waiting; struct { unsigned waitForPlatform:1; unsigned waitForExtruderA:1; unsigned waitForExtruderB:1; unsigned waitForButton:1; unsigned waitForStart:1; unsigned waitForEmptyQueue:1; unsigned waitForCancelSync:1; // the host came through (@clear_cancel) before the M112 so we're still waiting to send the abort unsigned waitForBotCancel:1; // we told the bot to cancel, so we're waiting for an 0x89 response unsigned waitForBuffer:1; // the firmware's buffer is full unsigned waitForUnpause:1; // the bot is paused } waitflag; }; Sttb sttb; time_t sec; Point5d position_response; // last synchronized get extended position response } Tio; static Tio tio; static int connected = 0; // Some custom python exceptions static PyObject *pyerrCancelBuild; static PyObject *pyerrBufferOverflow; static PyObject *pyerrTimeout; static PyObject *pyerrUnknownFirmware; static int tio_vprintf(Tio *tio, const char *fmt, va_list ap) { size_t result; if (tio->cur >= sizeof(tio->translation)) return 0; result = vsnprintf(tio->translation + tio->cur, sizeof(tio->translation) - tio->cur, fmt, ap); if (result > 0) tio->cur += result; return result; } static int tio_printf(Tio *tio, char const* fmt, ...) { va_list args; int result; va_start(args, fmt); result = tio_vprintf(tio, fmt, args); va_end(args); return result; } // clean up anything left over from before static void gpx_cleanup(void) { connected = 0; if (gpx.log != NULL && gpx.log != stderr) { fflush(gpx.log); fclose(gpx.log); gpx.log = stderr; } if (tio.sio.port > -1) { close(tio.sio.port); tio.sio.port = -1; } if (tio.sttb.cs > 0) { sttb_cleanup(&tio.sttb); sttb_init(&tio.sttb, 10); } tio.sec = 0; tio.waiting = 0; tio.flags = 0; gpx_set_machine(&gpx, "r2", 1); } static void clear_state_for_cancel(void) { gpx.flag.programState = READY_STATE; gpx.axis.positionKnown = 0; gpx.excess.a = 0; gpx.excess.b = 0; if (tio.waiting) { tio.flag.waitClearedByCancel = 1; if(gpx.flag.verboseMode) fprintf(gpx.log, "setting waitClearedByCancel"); } tio.waiting = 0; tio.waitflag.waitForEmptyQueue = 1; tio.flag.getPosWhenReady = 0; } // wrap port_handler and translate to the expect gcode response #define COMMAND_OFFSET 2 #define EXTRUDER_ID_OFFSET 3 #define QUERY_COMMAND_OFFSET 4 #define EEPROM_LENGTH_OFFSET 8 static void translate_extruder_query_response(Gpx *gpx, Tio *tio, unsigned query_command, char *buffer) { unsigned extruder_id = buffer[EXTRUDER_ID_OFFSET]; switch (query_command) { // Query 00 - Query firmware version information case 0: // sio->response.firmware.version = read_16(gpx); break; // Query 02 - Get extruder temperature case 2: // like T0:170 tio_printf(tio, " T"); if (gpx->machine.extruder_count > 1) tio_printf(tio, "%u", extruder_id); tio_printf(tio, ":%u", tio->sio.response.temperature); break; // Query 22 - Is extruder ready case 22: if (extruder_id) tio->waitflag.waitForExtruderB = !tio->sio.response.isReady; else tio->waitflag.waitForExtruderA = !tio->sio.response.isReady; break; // Query 30 - Get build platform temperature case 30: tio_printf(tio, " B:%u", tio->sio.response.temperature); break; // Query 32 - Get extruder target temperature case 32: if (tio->waiting && !tio->waitflag.waitForEmptyQueue && tio->sio.response.temperature == 0) { if (extruder_id) tio->waitflag.waitForExtruderB = 0; else tio->waitflag.waitForExtruderA = 0; } tio_printf(tio, " /%u", tio->sio.response.temperature); break; // Query 33 - Get build platform target temperature case 33: if (tio->waiting && !tio->waitflag.waitForEmptyQueue && tio->sio.response.temperature == 0) tio->waitflag.waitForPlatform = 0; tio_printf(tio, " /%u", tio->sio.response.temperature); break; // Query 35 - Is build platform ready? case 35: tio->waitflag.waitForPlatform = !tio->sio.response.isReady; break; // Query 36 - Get extruder status case 36: /* NYI if(gpx->flag.verboseMode && gpx->flag.logMessages) { fprintf(gpx->log, "Extruder T%u status" EOL, extruder_id); if(sio->response.extruder.flag.ready) fputs("Target temperature reached" EOL, gpx->log); if(sio->response.extruder.flag.notPluggedIn) fputs("The extruder or build plate is not plugged in" EOL, gpx->log); if(sio->response.extruder.flag.softwareCutoff) fputs("Above maximum allowable temperature recorded: heater shutdown for safety" EOL, gpx->log); if(sio->response.extruder.flag.temperatureDropping) fputs("Heater temperature dropped below target temperature" EOL, gpx->log); if(sio->response.extruder.flag.buildPlateError) fputs("An error was detected with the build plate heater or sensor" EOL, gpx->log); if(sio->response.extruder.flag.extruderError) fputs("An error was detected with the extruder heater or sensor" EOL, gpx->log); } */ break; // Query 37 - Get PID state case 37: /* NYI sio->response.pid.extruderError = read_16(gpx); sio->response.pid.extruderDelta = read_16(gpx); sio->response.pid.extruderOutput = read_16(gpx); sio->response.pid.buildPlateError = read_16(gpx); sio->response.pid.buildPlateDelta = read_16(gpx); sio->response.pid.buildPlateOutput = read_16(gpx); */ break; } } // translate_handler // Callback function for gpx_convert_and_send. It's where we translate the // s3g/x3g response into a text response that mimics a reprap printer. static int translate_handler(Gpx *gpx, Tio *tio, char *buffer, size_t length) { unsigned command; unsigned extruder; if (tio->flag.okPending) { tio->flag.okPending = 0; tio_printf(tio, "ok"); // ok means: I'm ready for another command, not necessarily that everything worked } if (length == 0) { // we translated a command that has no translation to x3g, but there // still may be something to do to emulate gcode behavior if (gpx->command.flag & M_IS_SET) { switch (gpx->command.m) { case 23: { // M23 - select SD file // Some host software expects case insensitivity for M23 long i = sttb_find_nocase(&tio->sttb, gpx->selectedFilename); if (i >= 0) { char *s = strdup(tio->sttb.rgs[i]); if (s != NULL) { free(gpx->selectedFilename); gpx->selectedFilename = s; } } // answer to M23, at least on Marlin, Repetier and Sprinter: "File opened:%s Size:%d" // followed by "File selected:%s Size:%d". Caller is going to // be really surprised when the failure happens on start print // but other than enumerating all the files again, we don't // have a way to tell the printer to go check if it can be // opened tio_printf(tio, "\nFile opened:%s Size:%d\nFile selected:%s", gpx->selectedFilename, 0, gpx->selectedFilename); // currently no way to ask Sailfish for the file size, that I can tell :-( break; } } } return SUCCESS; } command = buffer[COMMAND_OFFSET]; extruder = buffer[EXTRUDER_ID_OFFSET]; // throw any queuable command in the bit bucket while we're waiting for the cancel if (tio->flag.cancelPending && (command & 0x80)) return SUCCESS; int rval = port_handler(gpx, &tio->sio, buffer, length); if (rval != SUCCESS) { VERBOSE(fprintf(gpx->log, "port_handler returned: rval = %d\n", rval);) return rval; } // we got a SUCCESS on a queable command, so we're not waiting anymore if (command & 0x80) tio->waitflag.waitForBuffer = 0; switch (command) { // 03 - Clear buffer case 3: // 07 - Abort immediately case 7: // 17 - reset case 17: tio->waiting = 0; tio->waitflag.waitForBotCancel = 1; break; // 10 - Extruder (tool) query response case 10: { unsigned query_command = buffer[QUERY_COMMAND_OFFSET]; translate_extruder_query_response(gpx, tio, query_command, buffer); break; } // 11 - Is ready? case 11: VERBOSE( fprintf(gpx->log, "is_ready: %d\n", tio->sio.response.isReady) ); if (tio->sio.response.isReady) { tio->waitflag.waitForEmptyQueue = tio->waitflag.waitForButton = 0; if (tio->flag.getPosWhenReady) { get_extended_position(gpx); tio->flag.getPosWhenReady = 0; } } break; // 14 - Begin capture to file case 14: if (gpx->command.flag & ARG_IS_SET) tio_printf(tio, "\nWriting to file: %s", gpx->command.arg); break; // 15 - End capture case 15: tio_printf(tio, "\nDone saving file"); break; // 16 - Playback capture (print from SD) case 16: // give the bot a chance to clear the BUILD_CANCELLED from the previous build if (tio->sio.response.sd.status == 7) tio_printf(tio, "\nError: Not SD printing file not found"); else { tio->cur = 0; tio->translation[0] = 0; tio->sec = time(NULL) + 3; tio->waitflag.waitForStart = 1; } break; // 18 - Get next filename case 18: if (!tio->flag.listingFiles && (gpx->command.flag & M_IS_SET) && gpx->command.m == 21) { // we used "get_next_filename(1)" to emulate M21 if (tio->sio.response.sd.status == 0) tio_printf(tio, "\nSD card ok"); else tio_printf(tio, "\nSD init fail"); } else { // otherwise generate the M20 response if (!tio->flag.listingFiles) { tio_printf(tio, "\nBegin file list\n"); tio->flag.listingFiles = 1; if (tio->sttb.cs > 0) sttb_cleanup(&tio->sttb); sttb_init(&tio->sttb, 10); } if (!tio->sio.response.sd.filename[0]) { tio_printf(tio, "End file list"); tio->flag.listingFiles = 0; } else { tio_printf(tio, "%s", tio->sio.response.sd.filename); sttb_add(&tio->sttb, tio->sio.response.sd.filename); } } break; // 21 - Get extended position case 21: { double epos = (double)tio->sio.response.position.a / gpx->machine.a.steps_per_mm; if (gpx->current.extruder == 1) epos = (double)tio->sio.response.position.b / gpx->machine.b.steps_per_mm; tio_printf(tio, " X:%0.2f Y:%0.2f Z:%0.2f E:%0.2f", (double)tio->sio.response.position.x / gpx->machine.x.steps_per_mm, (double)tio->sio.response.position.y / gpx->machine.y.steps_per_mm, (double)tio->sio.response.position.z / gpx->machine.z.steps_per_mm, epos); // squirrel away any positions we don't think we know, in case the // incoming stream tries to do a G92 without those axes if (tio->flag.getPosWhenReady) { if (!(gpx->axis.positionKnown & X_IS_SET)) gpx->current.position.x = (double)tio->sio.response.position.x / gpx->machine.x.steps_per_mm; if (!(gpx->axis.positionKnown & Y_IS_SET)) gpx->current.position.y = (double)tio->sio.response.position.y / gpx->machine.y.steps_per_mm; if (!(gpx->axis.positionKnown & Z_IS_SET)) gpx->current.position.z = (double)tio->sio.response.position.z / gpx->machine.z.steps_per_mm; if (!(gpx->axis.positionKnown & A_IS_SET)) gpx->current.position.a = (double)tio->sio.response.position.a / gpx->machine.a.steps_per_mm; if (!(gpx->axis.positionKnown & B_IS_SET)) gpx->current.position.b = (double)tio->sio.response.position.b / gpx->machine.b.steps_per_mm; } break; } // 23 - Get motherboard status case 23: if (!tio->sio.response.motherboard.bitfield) tio->waitflag.waitForButton = 0; else { if (tio->sio.response.motherboard.flag.buildCancelling) return 0x89; if (tio->sio.response.motherboard.flag.heatShutdown) { tio->cur = 0; tio_printf(tio, "Error: Heaters were shutdown after 30 minutes of inactivity"); return 0x89; } if (tio->sio.response.motherboard.flag.powerError) { tio->cur = 0; tio_printf(tio, "Error: Error detected in system power"); return 0x89; } } break; // Query 24 - Get build statistics case 24: if (tio->waitflag.waitForStart || ((gpx->command.flag & M_IS_SET) && (gpx->command.m == 27))) { // M27 response time_t t; if (tio->sec && tio->sio.response.build.status != 1 && time(&t) < tio->sec) { if ((tio->sec - t) > 4) { // in case we have a clock discontinuity we don't want to ignore status forever tio->sec = 0; tio->waitflag.waitForStart = 0; } break; // ignore it if we haven't started yet } switch (tio->sio.response.build.status) { case BUILD_NONE: // this is a matter of Not SD printing *yet* when we just // kicked off the print, let's give it a moment tio_printf(tio, "\nNot SD printing"); break; case BUILD_RUNNING: tio->sec = 0; tio->waitflag.waitForStart = 0; tio_printf(tio, "\nSD printing byte on line %u/0", tio->sio.response.build.lineNumber); break; case BUILD_CANCELED: tio_printf(tio, "\nSD printing cancelled. "); tio->waiting = 0; tio->flag.getPosWhenReady = 0; // fall through case BUILD_FINISHED_NORMALLY: tio_printf(tio, "\nDone printing file"); break; case BUILD_PAUSED: tio_printf(tio, "\nSD printing paused at line %u", tio->sio.response.build.lineNumber); break; case BUILD_CANCELLING: tio_printf(tio, "\nSD printing sleeping at line %u", tio->sio.response.build.lineNumber); break; } } else { // not an M27 response, we're checking routinely or to clear a wait state switch (tio->sio.response.build.status) { case BUILD_NONE: case BUILD_RUNNING: if (tio->waitflag.waitForUnpause) tio->waitflag.waitForEmptyQueue = 1; // fallthrough default: tio->waitflag.waitForUnpause = 0; break; case BUILD_PAUSED: tio->waitflag.waitForUnpause = 1; tio_printf(tio, "\n// echo: Waiting for unpause button on the LCD panel\n"); break; } } break; // 27 - Get advanced version number case 27: { char *variant = "Unknown"; switch(tio->sio.response.firmware.variant) { case 0x01: variant = "Makerbot"; break; case 0x80: variant = "Sailfish"; break; } tio_printf(tio, " %s v%u.%u", variant, tio->sio.response.firmware.version / 100, tio->sio.response.firmware.version % 100); break; // 135 - wait for extruder case 135: tio->cur = 0; tio->translation[0] = 0; VERBOSE( fprintf(gpx->log, "waiting for extruder %d\n", extruder) ); if (extruder == 0) tio->waitflag.waitForEmptyQueue = tio->waitflag.waitForExtruderA = 1; else tio->waitflag.waitForEmptyQueue = tio->waitflag.waitForExtruderB = 1; break; // 141 - wait for build platform case 141: tio->cur = 0; tio->translation[0] = 0; VERBOSE( fprintf(gpx->log, "waiting for platform\n") ); tio->waitflag.waitForEmptyQueue = tio->waitflag.waitForPlatform = 1; break; // 144 - recall home position case 144: // fallthrough // 131, 132 - home axes case 131: case 132: VERBOSE( fprintf(gpx->log, "homing or recall home positions, wait for queue then ask bot for pos\n") ); tio->cur = 0; tio->translation[0] = 0; tio->waitflag.waitForEmptyQueue = 1; tio->flag.getPosWhenReady = 1; break; case 133: VERBOSE( fprintf(gpx->log, "wait for (133) delay\n") ); tio->cur = 0; tio->translation[0] = 0; tio->waitflag.waitForEmptyQueue = 1; break; // 148, 149 - message to the LCD, may be waiting for a button case 148: case 149: tio->cur = 0; tio->translation[0] = 0; VERBOSE( fprintf(gpx->log, "waiting for button\n") ); tio->waitflag.waitForButton = 1; break; } } return rval; } static int translate_result(Gpx *gpx, Tio *tio, const char *fmt, va_list ap) { int len = 0; if (!strcmp(fmt, "@clear_cancel")) { if (!tio->flag.cancelPending && gpx->flag.programState == RUNNING_STATE) { // cancel gcode came through before cancel event VERBOSE( fprintf(gpx->log, "got @clear_cancel, waiting for abort call\n") ); tio->waitflag.waitForCancelSync = 1; } else { tio->flag.cancelPending = 0; tio->waitflag.waitForEmptyQueue = 1; } return 0; } if (tio->flag.okPending) { tio->flag.okPending = 0; tio_printf(tio, "ok"); // ok means: I'm ready for another command, not necessarily that everything worked } if (tio->cur > 0 && tio->translation[tio->cur - 1] != '\n') len = tio_printf(tio, "\n"); return len + tio_printf(tio, "// echo: ") + tio_vprintf(tio, fmt, ap); } static int debug_printf(const char *fmt, ...) { va_list args; int result; va_start(args, fmt); result = translate_result(&gpx, &tio, fmt, args); va_end(args); return result; } // return the translation or set the error context and return NULL if failure static PyObject *gpx_return_translation(int rval) { int waiting = tio.waiting; // ENDED -> READY if (gpx.flag.programState > RUNNING_STATE) gpx.flag.programState = READY_STATE; gpx.flag.macrosEnabled = 1; // if we're waiting for something and we haven't produced any output // give back current temps if (rval == SUCCESS && tio.waiting && tio.cur == 0) { if(gpx.flag.verboseMode) fprintf(gpx.log, "implicit M105\n"); strncpy(gpx.buffer.in, "M105", sizeof(gpx.buffer.in)); rval = gpx_convert_line(&gpx, gpx.buffer.in); if(gpx.flag.verboseMode) fprintf(gpx.log, "implicit M105 rval = %d\n", rval); } if(gpx.flag.verboseMode) fprintf(gpx.log, "gpx_return_translation rval = %d\n", rval); fflush(gpx.log); switch (rval) { case SUCCESS: case END_OF_FILE: break; case EOSERROR: return PyErr_SetFromErrno(PyExc_IOError); case ERROR: PyErr_SetString(PyExc_IOError, "GPX error"); return NULL; case ESIOWRITE: case ESIOREAD: case ESIOFRAME: case ESIOCRC: PyErr_SetString(PyExc_IOError, "Serial communication error"); return NULL; case ESIOTIMEOUT: PyErr_SetString(pyerrTimeout, "Timeout"); return NULL; case 0x80: PyErr_SetString(PyExc_IOError, "Generic Packet error"); return NULL; case 0x82: // Action buffer overflow tio.waitflag.waitForBuffer = 1; PyErr_SetString(pyerrBufferOverflow, "Buffer overflow"); return NULL; case 0x83: // TODO resend? tio.cur = 0; tio_printf(&tio, "Error: checksum mismatch"); break; case 0x84: PyErr_SetString(PyExc_IOError, "Query packet too big"); return NULL; case 0x85: PyErr_SetString(PyExc_IOError, "Command not supported or recognized"); return NULL; case 0x87: tio.cur = 0; tio_printf(&tio, "Error: timeout downstream"); break; case 0x88: tio.cur = 0; tio_printf(&tio, "Error: timeout for tool lock"); break; case 0x89: if (tio.waitflag.waitForBotCancel) { // ah, we told the bot to abort, and this 0x89 means that it did tio.waitflag.waitForBotCancel = 0; if(gpx.flag.verboseMode) fprintf(gpx.log, "cleared waitForBotCancel\n"); break; } // bot is initiating a cancel if (gpx.flag.verboseMode) fprintf(gpx.log, "bot cancelled, now waiting for @clear_cancel\n"); // we'll only get a @clear_cancel from the host loop, an M112 // won't come through because the event layer will eat the next // event (because it's anticipating this event) tio.flag.cancelPending = 1; clear_state_for_cancel(); PyErr_SetString(pyerrCancelBuild, "Cancel build"); return NULL; case 0x8A: tio.cur = 0; tio_printf(&tio, "SD printing"); break; case 0x8B: tio.cur = 0; tio_printf(&tio, "Error: RC_BOT_OVERHEAT Printer reports overheat condition"); break; case 0x8C: tio.cur = 0; tio_printf(&tio, "Error: timeout"); break; default: if (gpx.flag.verboseMode) fprintf(gpx.log, "Unknown error code: %d", rval); PyErr_SetString(PyExc_IOError, "Unknown error."); return NULL; } // if the rval cleared the wait state, we need an ok if(waiting && !tio.waiting) { if(gpx.flag.verboseMode) fprintf(gpx.log, "add ok for wait cleared\n"); if (tio.cur > 0 && tio.translation[tio.cur - 1] != '\n') tio_printf(&tio, "\n"); tio_printf(&tio, "ok"); } else if (tio.cur > 0 && tio.translation[tio.cur - 1] == '\n') tio.translation[--tio.cur] = 0; fflush(gpx.log); return Py_BuildValue("s", tio.translation); } static PyObject *gpx_write_string(const char *s) { unsigned waiting = tio.waiting; if (waiting && gpx.flag.verboseMode) fprintf(gpx.log, "waiting in gpx_write_string\n"); strncpy(gpx.buffer.in, s, sizeof(gpx.buffer.in)); int rval = gpx_convert_line(&gpx, gpx.buffer.in); if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_return_translation rval = %d\n", rval); if (tio.flag.okPending) { tio_printf(&tio, "ok"); // ok means: I'm ready for another command, not necessarily that everything worked } // if we were waiting, but now we're not, throw an ok on there else if (!tio.waiting && waiting) tio_printf(&tio, "\nok"); tio.flag.okPending = 0; if (waiting && gpx.flag.verboseMode) fprintf(gpx.log, "leaving gpx_write_string %d\n", tio.waiting); fflush(gpx.log); return gpx_return_translation(rval); } // convert from a long int value to a speed_t constant // on error, sets python error state and returns B0 speed_t speed_from_long(long *baudrate) { speed_t speed = B0; // TODO Baudrate warning for Replicator 2/2X with 57600? Throw maybe? switch(*baudrate) { case 4800: speed=B4800; break; case 9600: speed=B9600; break; #ifdef B14400 case 14400: speed=B14400; break; #endif case 19200: speed=B19200; break; #ifdef B28800 case 28800: speed=B28800; break; #endif case 38400: speed=B38400; break; case 57600: speed=B57600; break; // TODO auto detect speed when 0? case 0: // 0 means default of 115200 *baudrate=115200; case 115200: speed=B115200; break; default: sprintf(gpx.buffer.out, "Unsupported baud rate '%ld'\n", *baudrate); fprintf(gpx.log, "%s", gpx.buffer.out); PyErr_SetString(PyExc_ValueError, gpx.buffer.out); break; } return speed; } // def connect(port, baudrate, inipath, logpath) static PyObject *gpx_connect(PyObject *self, PyObject *args) { const char *port = NULL; long baudrate = 0; const char *inipath = NULL; const char *logpath = NULL; int verbose = 0; if (!PyArg_ParseTuple(args, "s|lssi", &port, &baudrate, &inipath, &logpath, &verbose)) return NULL; gpx_cleanup(); gpx_initialize(&gpx, 0); gpx.axis.positionKnown = 0; gpx.flag.M106AlwaysValve = 1; // open the log file if (logpath != NULL && (gpx.log = fopen(logpath, "a")) == NULL) { fprintf(stderr, "Unable to open logfile (%s) for writing\n", logpath); } if (gpx.log == NULL) gpx.log = stderr; #ifdef ALWAYS_USE_STDERR else if (gpx.log != stderr) { fclose(gpx.log); gpx.log = stderr; } #endif // load the config if (inipath != NULL) { int lineno = gpx_load_config(&gpx, inipath); if (lineno < 0) fprintf(gpx.log, "Unable to load configuration file (%s)\n", inipath); if (lineno > 0) fprintf(gpx.log, "(line %u) Configuration syntax error in %s: unrecognized parameters\n", lineno, inipath); } gpx.flag.verboseSioMode = gpx.flag.verboseMode = verbose; gpx.flag.logMessages = 1; // open the port speed_t speed = speed_from_long(&baudrate); if (speed == B0) return NULL; if (!gpx_sio_open(&gpx, port, speed, &tio.sio.port)) { return PyErr_SetFromErrnoWithFilename(PyExc_OSError, port); } gpx_start_convert(&gpx, "", 0); gpx.flag.framingEnabled = 1; gpx.flag.sioConnected = 1; gpx.sio = &tio.sio; gpx_register_callback(&gpx, (int (*)(Gpx*, void*, char*, size_t))translate_handler, &tio); gpx.resultHandler = (int (*)(Gpx*, void*, const char*, va_list))translate_result; tio.sio.in = NULL; tio.sio.bytes_out = tio.sio.bytes_in = 0; tio.sio.flag.retryBufferOverflow = 1; tio.sio.flag.shortRetryBufferOverflowOnly = 1; connected = 1; fprintf(gpx.log, "gpx connected to %s at %ld using %s and %s\n", port, baudrate, inipath, logpath); tio.cur = 0; tio_printf(&tio, "start\n"); return gpx_return_translation(SUCCESS); } static PyObject *PyErr_NotConnected(void) { PyErr_SetString(PyExc_IOError, "Not connected"); return NULL; } // def start() // Intended to be called after connect to have the first conversation with the // bot, connect merely opens the port. Separating the two allows for a pause // between the calls at the python level so multithreading works. static PyObject *gpx_start(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "")) return NULL; tio.cur = 0; tio.translation[0] = 0; int rval = get_advanced_version_number(&gpx); if (rval >= 0) { tio.waitflag.waitForEmptyQueue = 1; tio_printf(&tio, "\necho: gcode to x3g translation by GPX"); return gpx_write_string("M21"); } return gpx_return_translation(rval); } // def write(data) static PyObject *gpx_write(PyObject *self, PyObject *args) { char *line; if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "s", &line)) return NULL; tio.cur = 0; tio.translation[0] = 0; tio.waitflag.waitForBuffer = 0; // maybe clear this every time? tio.flag.okPending = !tio.waiting; PyObject *rval = gpx_write_string(line); tio.flag.okPending = 0; return rval; } // def readnext() static PyObject *gpx_readnext(PyObject *self, PyObject *args) { int rval = SUCCESS; if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "")) return NULL; if (gpx.flag.verboseMode) fprintf(gpx.log, "i"); tio.cur = 0; tio.translation[0] = 0; if (tio.flag.listingFiles) { rval = get_next_filename(&gpx, 0); } else if (tio.waiting) { if (gpx.flag.verboseMode) fprintf(gpx.log, "tio.waiting = %u\n", tio.waiting); if (!tio.waitflag.waitForCancelSync) { if (tio.waitflag.waitForUnpause) rval = get_build_statistics(&gpx); // if we're waiting for the queue to drain, do that before checking on // anything else if (rval == SUCCESS && (tio.waitflag.waitForEmptyQueue || tio.waitflag.waitForButton)) rval = is_ready(&gpx); if (rval == SUCCESS && !tio.waitflag.waitForEmptyQueue) { if (tio.waitflag.waitForStart) rval = get_build_statistics(&gpx); if (rval == SUCCESS && tio.waitflag.waitForPlatform) rval = is_build_platform_ready(&gpx, 0); if (rval == SUCCESS && tio.waitflag.waitForExtruderA) rval = is_extruder_ready(&gpx, 0); if (rval == SUCCESS && tio.waitflag.waitForExtruderB) rval = is_extruder_ready(&gpx, 1); } } if (gpx.flag.verboseMode) fprintf(gpx.log, "tio.waiting = %u and rval = %d\n", tio.waiting, rval); if (rval == SUCCESS) { if (tio.waiting) { if (gpx.flag.verboseMode) { tio_printf(&tio, "// echo: tio.waiting = 0x%x\n", tio.waiting); fprintf(gpx.log, "o"); } return gpx_write_string("M105"); } tio.cur = 0; tio_printf(&tio, "ok"); } } else if (tio.flag.waitClearedByCancel) { if(gpx.flag.verboseMode) fprintf(gpx.log, "adding ok for wait cleared by cancel\n"); tio.flag.waitClearedByCancel = 0; tio_printf(&tio, "ok"); } if (gpx.flag.verboseMode) fprintf(gpx.log, "o"); return gpx_return_translation(rval); } #if !defined(_WIN32) && !defined(_WIN64) // def baudrate(long) static PyObject *gpx_set_baudrate(PyObject *self, PyObject *args) { struct termios tp; long baudrate; speed_t speed; if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "l", &baudrate)) return NULL; if(tcgetattr(tio.sio.port, &tp) < 0) return PyErr_SetFromErrno(PyExc_IOError); speed = speed_from_long(&baudrate); if (speed == B0) return NULL; cfsetspeed(&tp, speed); if(tcsetattr(tio.sio.port, TCSANOW, &tp) < 0) return PyErr_SetFromErrno(PyExc_IOError); return Py_BuildValue("i", 0); } #else static PyObject *gpx_set_baudrate(PyObject *self, PyObject *args) { long baudrate; if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "l", &baudrate)) return NULL; // TODO Windows set_baudrate return NULL; } #endif // _WIN32 || _WIN64 // def disconnect() static PyObject *gpx_disconnect(PyObject *self, PyObject *args) { gpx_cleanup(); if (!PyArg_ParseTuple(args, "")) return NULL; return Py_BuildValue("i", 0); } // def get_machine_defaults(machine_type_id) // for example: machine_info = get_machine_defaults("r1d") static PyObject *gpx_get_machine_defaults(PyObject *self, PyObject *args) { char *machine_type_id; if (!PyArg_ParseTuple(args, "s", &machine_type_id)) return NULL; Machine *machine = gpx_find_machine(machine_type_id); fflush(gpx.log); if (machine == NULL) { PyErr_SetString(PyExc_ValueError, "Machine id not found"); return NULL; } return Py_BuildValue("{s{sd,sd,sd,si}s{sd,sd,sd,si}s{sd,sd,sd,si}s{sd,sd,sd,si}s{sd,sd,sd,si}s{sdsdsdsisi}}", "x", "max_feedrate", machine->x.max_feedrate, "home_feedrate", machine->x.home_feedrate, "steps_per_mm", machine->x.steps_per_mm, "endstop", machine->x.endstop, "y", "max_feedrate", machine->y.max_feedrate, "home_feedrate", machine->y.home_feedrate, "steps_per_mm", machine->y.steps_per_mm, "endstop", machine->y.endstop, "z", "max_feedrate", machine->z.max_feedrate, "home_feedrate", machine->z.home_feedrate, "steps_per_mm", machine->z.steps_per_mm, "endstop", machine->z.endstop, "a", "max_feedrate", machine->a.max_feedrate, "steps_per_mm", machine->a.steps_per_mm, "motor_steps", machine->a.motor_steps, "has_heated_build_platform", machine->a.has_heated_build_platform, "b", "max_feedrate", machine->b.max_feedrate, "steps_per_mm", machine->b.steps_per_mm, "motor_steps", machine->b.motor_steps, "has_heated_build_platform", machine->b.has_heated_build_platform, "machine", "slicer_filament_diameter", machine->nominal_filament_diameter, "packing_density", machine->nominal_packing_density, "nozzle_diameter", machine->nozzle_diameter, "extruder_count", machine->extruder_count, "timeout", machine->timeout ); } // def read_ini(ini_filepath) static PyObject *gpx_read_ini(PyObject *self, PyObject *args) { const char *inipath = NULL; if (!PyArg_ParseTuple(args, "s", &inipath)) return NULL; int lineno = gpx_load_config(&gpx, inipath); if (lineno == 0) return Py_BuildValue("i", 0); // success if (lineno < 0) fprintf(gpx.log, "Unable to load configuration file (%s)\n", inipath); if (lineno > 0) fprintf(gpx.log, "(line %u) Configuration syntax error in %s: unrecognized parameters\n", lineno, inipath); fflush(gpx.log); PyErr_SetString(PyExc_ValueError, "Unable to load ini file"); return Py_BuildValue("i", 0); } // def reset_ini() // reset settings to defaults static PyObject *gpx_reset_ini(PyObject *self, PyObject *args) { // some state survives reset_ini void *callbackHandler = gpx.callbackHandler; void *resultHandler = gpx.resultHandler; void *callbackData = gpx.callbackData; FILE *log = gpx.log; unsigned verbose = gpx.flag.verboseMode; // nuke it all gpx_initialize(&gpx, 1); gpx.axis.positionKnown = 0; gpx.flag.M106AlwaysValve = 1; // restore some stuff, plus we're still in pymodule mode gpx.callbackHandler = callbackHandler; gpx.resultHandler = resultHandler; gpx.callbackData = callbackData; gpx.log = log; gpx.flag.framingEnabled = 1; gpx.flag.sioConnected = 1; gpx.sio = &tio.sio; gpx.flag.verboseMode = verbose; gpx.flag.logMessages = 1; return Py_BuildValue("i", 0); } // def waiting() // is the bot waiting for something? static PyObject *gpx_waiting(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); if (tio.waiting || tio.flag.waitClearedByCancel) Py_RETURN_TRUE; else Py_RETURN_FALSE; } // def build_started() // are we printing a build? static PyObject *gpx_build_started(PyObject *self, PyObject *args) { if (gpx.flag.programState == RUNNING_STATE) Py_RETURN_TRUE; else Py_RETURN_FALSE; } // def build_paused() // is the build paused on the LCD? static PyObject *gpx_build_paused(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); int rval = get_build_statistics(&gpx); // if we fail, is that a yes or a no? if (rval != SUCCESS) { PyErr_SetString(PyExc_IOError, "Unable to get build statistics."); return NULL; } if (tio.waitflag.waitForUnpause) Py_RETURN_TRUE; else Py_RETURN_FALSE; } // def listing_files() // are we in the middle of listing files from the SD card? static PyObject *gpx_listing_files(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); if (tio.flag.listingFiles) Py_RETURN_TRUE; else Py_RETURN_FALSE; } // def reprap_flavor(turn_on_reprap) static PyObject *gpx_reprap_flavor(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); int reprap = 1; if (!PyArg_ParseTuple(args, "i", &reprap)) return NULL; int rval = gpx.flag.reprapFlavor; gpx.flag.reprapFlavor = !!reprap; if (rval) Py_RETURN_TRUE; else Py_RETURN_FALSE; } // ----- immediate mode commands ---- // There isn't a gcode equivalent of these since the gcode "standard" always waits // for the buffer to drain. Thus, these entry points are provided to interrupt // the queue handling // helper for gpx_stop and gpx_abort for post abort state static PyObject *set_build_aborted_state(Gpx *gpx) { int rval = SUCCESS; VERBOSE( fprintf(gpx->log, "set_build_aborted_state\n") ); if (gpx->flag.programState == RUNNING_STATE) { VERBOSE( fprintf(gpx->log, "currently RUNNING_STATE calling end_build\n") ); gpx->flag.programState = READY_STATE; // wait for the bot to be back up after the abort int retries = 5; while (retries--) { rval = set_build_progress(gpx, 100); if (rval == 0x8B) return gpx_return_translation(rval); if (rval == SUCCESS || rval != ESIOTIMEOUT) break; } rval = end_build(gpx); } return gpx_return_translation(rval); } // def stop(halt_steppers = True, clear_queue = True) static PyObject *gpx_stop(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); int halt_steppers = 1; int clear_queue = 1; if (!PyArg_ParseTuple(args, "|ii", &halt_steppers, &clear_queue)) return NULL; if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_stop\n"); if (!tio.waitflag.waitForCancelSync) { if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_stop now waiting for @clear_cancel\n"); tio.flag.cancelPending = 1; } clear_state_for_cancel(); tio.cur = 0; tio.translation[0] = 0; tio.sec = 0; int rval = SUCCESS; // first, ask if we are SD printing // delay 1ms is a queuable command that will fail if SD printing int sdprinting = 0; tio.sio.flag.retryBufferOverflow = 1; rval = delay(&gpx, 1); tio.sio.flag.retryBufferOverflow = 0; if (rval == 0x8A) // SD printing sdprinting = 1; // ignore any other response if (sdprinting && !gpx.flag.sd_paused) { rval = pause_resume(&gpx); if (rval != SUCCESS) return gpx_return_translation(rval); gpx.flag.sd_paused = 1; } rval = extended_stop(&gpx, halt_steppers, clear_queue); if (!tio.flag.cancelPending) { tio.waitflag.waitForCancelSync = 0; } if (rval != SUCCESS) return gpx_return_translation(rval); gpx.flag.sd_paused = 0; return set_build_aborted_state(&gpx); } // def abort() static PyObject *gpx_abort(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); if (!PyArg_ParseTuple(args, "")) return NULL; if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_abort\n"); if (!tio.waitflag.waitForCancelSync) { if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_abort now waiting for @clear_cancel\n"); tio.flag.cancelPending = 1; } clear_state_for_cancel(); tio.cur = 0; tio.translation[0] = 0; tio.sec = 0; int rval = abort_immediately(&gpx); // ESIOTIMEOUT is only returned if the write succeeded, but no bytes returned // I think this can happen if the bot resets immediately and doesn't respond // via the serial port before hand // let's eat it if (rval == ESIOTIMEOUT) rval = SUCCESS; if (!tio.flag.cancelPending) { tio.waitflag.waitForCancelSync = 0; } if (rval != SUCCESS) { if (gpx.flag.verboseMode) fprintf(gpx.log, "abort_immediately rval = %d\n", rval); return gpx_return_translation(rval); } gpx.flag.sd_paused = 0; return set_build_aborted_state(&gpx); } // def read_eeprom(id) static PyObject *gpx_read_eeprom(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); tio.cur = 0; tio.translation[0] = 0; if (gpx.eepromMap == NULL && load_eeprom_map(&gpx) != SUCCESS) { PyErr_SetString(pyerrUnknownFirmware, "No EEPROM map found for firmware type and/or version"); return NULL; } char *id; if (!PyArg_ParseTuple(args, "s", &id)) return NULL; if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_read_eeprom %s\n", id); EepromMapping *pem = find_any_eeprom_mapping(&gpx, id); if (pem == NULL) { PyErr_SetString(PyExc_ValueError, "EEPROM id mapping not found"); return NULL; } unsigned char b; unsigned short us; unsigned long ul; float n; switch (pem->et) { case et_boolean: if (read_eeprom_8(&gpx, gpx.sio, pem->address, &b) == SUCCESS) return Py_BuildValue("O", b ? Py_True : Py_False); break; case et_bitfield: case et_byte: if (read_eeprom_8(&gpx, gpx.sio, pem->address, &b) == SUCCESS) return Py_BuildValue("B", b); break; case et_ushort: if (read_eeprom_16(&gpx, gpx.sio, pem->address, &us) == SUCCESS) return Py_BuildValue("H", us); break; case et_fixed: if (read_eeprom_fixed_16(&gpx, gpx.sio, pem->address, &n) == SUCCESS) return Py_BuildValue("f", n); break; case et_long: case et_ulong: if (read_eeprom_32(&gpx, gpx.sio, pem->address, &ul) == SUCCESS) return Py_BuildValue(pem->et == et_long ? "l" : "k", ul); break; case et_float: if (read_eeprom_float(&gpx, gpx.sio, pem->address, &n) == SUCCESS) return Py_BuildValue("f", n); break; case et_string: memset(gpx.sio->response.eeprom.buffer, 0, sizeof(gpx.sio->response.eeprom.buffer)); int len = pem->len; if (len > sizeof(gpx.sio->response.eeprom.buffer)) len = sizeof(gpx.sio->response.eeprom.buffer); if (read_eeprom(&gpx, pem->address, len) == SUCCESS) return Py_BuildValue("s", gpx.sio->response.eeprom.buffer); break; default: PyErr_SetString(PyExc_ValueError, "EEPROM type not supported"); return NULL; } return Py_BuildValue("i", 0); } // def write_eeprom(id, value) static PyObject *gpx_write_eeprom(PyObject *self, PyObject *args) { if (!connected) return PyErr_NotConnected(); tio.cur = 0; tio.translation[0] = 0; char *id; PyObject *value; if (!PyArg_ParseTuple(args, "sO", &id, &value)) return NULL; PyObject_Print(value, gpx.log, 0); fprintf(gpx.log, " <- \n"); if (gpx.flag.verboseMode) fprintf(gpx.log, "gpx_write_eeprom\n"); if (gpx.eepromMap == NULL && load_eeprom_map(&gpx) != SUCCESS) { PyErr_SetString(pyerrUnknownFirmware, "No EEPROM map found for firmware type and/or version"); return NULL; } EepromMapping *pem = find_any_eeprom_mapping(&gpx, id); if (pem == NULL) { PyErr_SetString(PyExc_ValueError, "EEPROM id mapping not found"); return NULL; } int rval = SUCCESS; int len = 0; unsigned char b = 0; unsigned short us = 0; unsigned long ul = 0; float n = 0.0; char *s = NULL; int f = 0; switch (pem->et) { case et_boolean: if (!PyArg_Parse(value, "B", &b)) return NULL; debug_printf("write_eeprom_8(%u) to address %u", (unsigned)!!b, pem->address); rval = write_eeprom_8(&gpx, gpx.sio, pem->address, !!b); break; case et_bitfield: case et_byte: value = PyNumber_Int(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "B", &b); Py_DECREF(value); if (!f) return NULL; debug_printf("write_eeprom_8(%u) to address %u", (unsigned)b, pem->address); rval = write_eeprom_8(&gpx, gpx.sio, pem->address, b); break; case et_ushort: value = PyNumber_Int(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "H", &us); Py_DECREF(value); if (!f) return NULL; debug_printf("write_eeprom_16(%u) to address %u", us, pem->address); rval = write_eeprom_16(&gpx, gpx.sio, pem->address, us); break; case et_fixed: value = PyNumber_Float(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "f", &n); Py_DECREF(value); if (!f) return NULL; rval = write_eeprom_fixed_16(&gpx, gpx.sio, pem->address, n); debug_printf("write_eeprom_fixed_16(%f) to address %u", n, pem->address); break; case et_long: value = PyNumber_Long(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "l", &ul); Py_DECREF(value); if (!f) return NULL; rval = write_eeprom_32(&gpx, gpx.sio, pem->address, ul); debug_printf("write_eeprom_32(%lu) to address %u", ul, pem->address); break; case et_ulong: value = PyNumber_Long(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "L", &ul); Py_DECREF(value); if (!f) return NULL; rval = write_eeprom_32(&gpx, gpx.sio, pem->address, ul); debug_printf("write_eeprom_32(%lu) to address %u", ul, pem->address); break; case et_float: value = PyNumber_Float(value); if (value == NULL) return NULL; f = PyArg_Parse(value, "f", &n); Py_DECREF(value); if (!f) return NULL; rval = write_eeprom_float(&gpx, gpx.sio, pem->address, n); debug_printf("write_eeprom_float(%f) to address %u", n, pem->address); break; case et_string: if (!PyArg_Parse(value, "s", &s)) return NULL; len = strlen(s); if (len >= pem->len) { PyErr_SetString(PyExc_ValueError, "String value too long for indicated EEPROM entry"); return NULL; } rval = write_eeprom(&gpx, pem->address, s, len + 1); debug_printf("write_eeprom(%s) to address %u", s, pem->address); break; default: PyErr_SetString(PyExc_ValueError, "EEPROM type not supported"); return NULL; } return gpx_return_translation(rval); } // method table describes what is exposed to python static PyMethodDef GpxMethods[] = { {"connect", gpx_connect, METH_VARARGS, "connect(port, baud = 0, inifilepath = None, logfilepath = None) Open the serial port to the printer and initialize the channel"}, {"disconnect", gpx_disconnect, METH_VARARGS, "disconnect() Close the serial port and clean up."}, {"write", gpx_write, METH_VARARGS, "write(string) Translate g-code into x3g and send."}, {"readnext", gpx_readnext, METH_VARARGS, "readnext() read next response if any"}, {"set_baudrate", gpx_set_baudrate, METH_VARARGS, "set_baudrate(long) Set the current baudrate for the connection to the printer."}, {"get_machine_defaults", gpx_get_machine_defaults, METH_VARARGS, "get_machine_defaults(string) Return a dict with the default settings for the indicated machine type."}, {"read_ini", gpx_read_ini, METH_VARARGS, "read_ini(string) Parse indicated ini file for gpx settings and macros and update current converter state. Loading ini files is additive. They just build on the ini's that have been read before. Use reset_ini to start from a clean state again."}, {"reset_ini", gpx_reset_ini, METH_VARARGS, "reset_ini() Reset configuration state to default"}, {"waiting", gpx_waiting, METH_VARARGS, "waiting() Returns True if the bot reports it is waiting for a temperature, pause or prompt"}, {"reprap_flavor", gpx_reprap_flavor, METH_VARARGS, "reprap_flavor(boolean) Sets the expected gcode flavor (true = reprap, false = makerbot), returns the previous setting"}, {"start", gpx_start, METH_VARARGS, "start() Call after connect and a printer specific pause (2 seconds for most) to start the serial communication"}, {"stop", gpx_stop, METH_VARARGS, "stop(halt_steppers, clear_queue) Tells the bot to either stop the steppers, clear the queue or both"}, {"abort", gpx_abort, METH_VARARGS, "abort() Tells the bot to clear the queue and stop all motors and heaters"}, {"read_eeprom", gpx_read_eeprom, METH_VARARGS, "read_eeprom(id) Read the value identified by id from the eeprom"}, {"write_eeprom", gpx_write_eeprom, METH_VARARGS, "write_eeprom(id, value) Write 'value' to the eeprom location identified by 'id'"}, {"build_started", gpx_build_started, METH_VARARGS, "build_started() Returns True if a build has been started, but not yet ended"}, {"build_paused", gpx_build_paused, METH_VARARGS, "build_paused() Returns true if build is paused"}, {"listing_files", gpx_listing_files, METH_VARARGS, "listing_files() Returns true if there are still filenames to be returned of an SD card enumeration"}, {NULL, NULL, 0, NULL} // sentinel }; __attribute__ ((visibility ("default"))) PyMODINIT_FUNC initgpx(void); // python calls init when the module is loaded PyMODINIT_FUNC initgpx(void) { PyObject *m = Py_InitModule("gpx", GpxMethods); if (m == NULL) return; pyerrCancelBuild = PyErr_NewException("gpx.CancelBuild", NULL, NULL); Py_INCREF(pyerrCancelBuild); PyModule_AddObject(m, "CancelBuild", pyerrCancelBuild); pyerrBufferOverflow = PyErr_NewException("gpx.BufferOverflow", NULL, NULL); Py_INCREF(pyerrBufferOverflow); PyModule_AddObject(m, "BufferOverflow", pyerrBufferOverflow); pyerrTimeout = PyErr_NewException("gpx.Timeout", NULL, NULL); Py_INCREF(pyerrTimeout); PyModule_AddObject(m, "Timeout", pyerrTimeout); pyerrUnknownFirmware = PyErr_NewException("gpx.UnknownFirmware", NULL, NULL); Py_INCREF(pyerrUnknownFirmware); PyModule_AddObject(m, "UnknownFirmware", pyerrUnknownFirmware); tio.sio.port = -1; tio.flags = 0; tio.waiting = 0; tio.sec = 0; sttb_init(&tio.sttb, 10); gpx_initialize(&gpx, 1); gpx.axis.positionKnown = 0; gpx.flag.M106AlwaysValve = 1; } GPX-2.5.2/src/pymodule/setup.py000077500000000000000000000012771271205255700163350ustar00rootroot00000000000000#!/usr/bin/env python import sys from setuptools import setup, Extension sources = [ 'gpxmodule.c', '../shared/machine_config.c', '../shared/opt.c', '../gpx/gpx.c', '../gpx/gpx-main.c', ] if sys.platform == 'win32': sources.append('../gpx/winsio.c') def params(): name='gpx' version='1.0' description='Translates to and from gcode to x3g, more or less' author='Mark Walker' author_email='markwal@hotmail.com' url='https://www.github.com/markwal/GPX' ext_modules = [ Extension('gpx', sources = sources, extra_compile_args = ['-DSERIAL_SUPPORT', '-fvisibility=hidden', '-I../shared', '-I../gpx'], extra_link_args = ['-fvisibility=hidden']) ] return locals() setup(**params()) GPX-2.5.2/src/pymodule/test.py000066400000000000000000000001441271205255700161410ustar00rootroot00000000000000import gpx gpx.connect("/dev/ttyACM0", 0, "/home/pi/gpx.ini") gpx.write("M72 P1") gpx.disconnect() GPX-2.5.2/src/pymodule/test2.py000066400000000000000000000002271271205255700162250ustar00rootroot00000000000000import gpx gpx.connect("/dev/ttyACM0", 0, "/home/pi/gpx.ini") print gpx.write("M105") print gpx.write("M114") print gpx.write("G91") gpx.disconnect() GPX-2.5.2/src/shared/000077500000000000000000000000001271205255700142215ustar00rootroot00000000000000GPX-2.5.2/src/shared/classic_machines.h000066400000000000000000000163161271205255700176710ustar00rootroot00000000000000// // classic_machines.h // // Created by WHPThomas on 1/04/13. // Copyright (c) 2013 WHPThomas, All rights reserved. // // Updates 2015 by Dan Newman, // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __classic_machines_h__ #define __classic_machines_h__ // Classic Incorrect Machine definitions // // From http://github.com/dcnewman/GPX 727a9fff // MBI has incorrectly calculated the steps/mm for the X and Y axis for all // their printers. They used the pulley's effective pitch diameter to // arrive at the values they used. They should instead have computed // (total-steps-per-revolution)/(belt-pitch * tooth-count). These are the // the old values before the correct calculations. Some people may want // to use these incorrect values if they've tweaked packing densities etc. // based on them. static Machine wrong_thing_o_matic_7 = { "ot7", "TOM Mk7 - single extruder - original (incorrect) MakerBot steps per mm calculation", 0, 0, {9600, 500, 30, 500, 106, 47.069852, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 120, 47.069852, ENDSTOP_IS_MIN}, // y axis {1000, 150, 10, 500, 106, 200, ENDSTOP_IS_MAX}, // z axis {1600, 1000, 30, 50.235478806907409, 1600, 1}, // a extruder {1600, 1000, 30, 50.235478806907409, 1600, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0070, 0.0040}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_THINGOMATIC_7 }; static Machine wrong_thing_o_matic_7D = { "ot7d", "TOM Mk7 - dual extruder - original (incorrect) MakerBot steps per mm calculation", 0, 0, {9600, 500, 30, 500, 106, 47.069852, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 120, 47.069852, ENDSTOP_IS_MIN}, // y axis {1000, 150, 10, 500, 106, 200, ENDSTOP_IS_MAX}, // z axis {1600, 1000, 30, 50.235478806907409, 1600, 1}, // a extruder {1600, 1000, 30, 50.235478806907409, 1600, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0070, 0.0040}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_THINGOMATIC_7D }; static Machine wrong_replicator_1 = { "or1", "Replicator 1 - single extruder - original (incorrect) MakerBot steps per mm calculation", 0, 0, {18000, 1000, 15, 2500, 227, 94.139704, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 148, 94.139704, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 150, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_1 }; static Machine wrong_replicator_1D = { "or1d", "Replicator 1 - dual extruder - original (incorrect) MakerBot steps per mm calculation", 0, 0, {18000, 1000, 15, 2500, 227, 94.139704, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 148, 94.139704, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 150, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_1D }; static Machine wrong_replicator_2 = { "or2", "Replicator 2 (default) - original (incorrect) MakerBot steps per mm calculation", 0, 0, {18000, 1000, 15, 2500, 285, 88.573186, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.573186, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 0}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 0}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2 }; static Machine wrong_replicator_2H = { "or2h", "Replicator 2 with HBP - original (incorrect) MakerBot steps per mm calculation", 0, 0, {18000, 1000, 15, 2500, 285, 88.573186, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.573186, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2H }; static Machine wrong_replicator_2X = { "or2x", "Replicator 2X - original (incorrect) MakerBot steps per mm calculation", 0, 0, {18000, 1000, 15, 2500, 246, 88.573186, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.573186, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {35, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2X }; #if defined(MACHINE_ARRAY) static Machine *wrong_machines[] = { &wrong_replicator_1, &wrong_replicator_1D, &wrong_replicator_2, &wrong_replicator_2H, &wrong_replicator_2X, &wrong_thing_o_matic_7, &wrong_thing_o_matic_7D, NULL }; #endif #endif GPX-2.5.2/src/shared/config.h.in000066400000000000000000000102771271205255700162530ustar00rootroot00000000000000/* src/shared/config.h.in. Generated from configure.ac by autoheader. */ /* Define to 1 if you have the `atexit' function. */ #undef HAVE_ATEXIT /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H /* Define to 1 if you have the header file. */ #undef HAVE_FLOAT_H /* Define to 1 if you have the header file. */ #undef HAVE_INTTYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_LIMITS_H /* Define to 1 if you have the `memmove' function. */ #undef HAVE_MEMMOVE /* Define to 1 if you have the header file. */ #undef HAVE_MEMORY_H /* Define to 1 if you have the `memset' function. */ #undef HAVE_MEMSET /* Define to 1 if you have the `nanosleep' function. */ #undef HAVE_NANOSLEEP /* Define to 1 if you have the `select' function. */ #undef HAVE_SELECT /* Define to 1 if you have the `sqrt' function. */ #undef HAVE_SQRT /* Define to 1 if you have the header file. */ #undef HAVE_STDINT_H /* Define to 1 if you have the header file. */ #undef HAVE_STDLIB_H /* Define to 1 if you have the `strcasecmp' function. */ #undef HAVE_STRCASECMP /* Define to 1 if you have the `strchr' function. */ #undef HAVE_STRCHR /* Define to 1 if you have the `strdup' function. */ #undef HAVE_STRDUP /* Define to 1 if you have the `strerror' function. */ #undef HAVE_STRERROR /* Define to 1 if you have the header file. */ #undef HAVE_STRINGS_H /* Define to 1 if you have the header file. */ #undef HAVE_STRING_H /* Define to 1 if you have the `strrchr' function. */ #undef HAVE_STRRCHR /* Define to 1 if you have the `strtol' function. */ #undef HAVE_STRTOL /* Define to 1 if you have the header file. */ #undef HAVE_SYS_STAT_H /* Define to 1 if you have the header file. */ #undef HAVE_SYS_TYPES_H /* Define to 1 if you have the header file. */ #undef HAVE_UNISTD_H /* Define to 1 if you have the header file. */ #undef HAVE_WINDOWS_H /* Define to 1 if the system has the type `_Bool'. */ #undef HAVE__BOOL /* Name of package */ #undef PACKAGE /* Define to the address where bug reports for this package should be sent. */ #undef PACKAGE_BUGREPORT /* Define to the full name of this package. */ #undef PACKAGE_NAME /* Define to the full name and version of this package. */ #undef PACKAGE_STRING /* Define to the one symbol short name of this package. */ #undef PACKAGE_TARNAME /* Define to the home page for this package. */ #undef PACKAGE_URL /* Define to the version of this package. */ #undef PACKAGE_VERSION /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS /* Version number of package */ #undef VERSION /* Define for Solaris 2.5.1 so the uint32_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT32_T /* Define for Solaris 2.5.1 so the uint8_t typedef from , , or is not used. If the typedef were allowed, the #define below would cause a syntax error. */ #undef _UINT8_T /* Define to the type of a signed integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef int16_t /* Define to the type of a signed integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef int32_t /* Define to the type of a signed integer type of width exactly 64 bits if such a type exists and the standard includes do not define it. */ #undef int64_t /* Define to `unsigned int' if does not define. */ #undef size_t /* Define to `int' if does not define. */ #undef ssize_t /* Define to the type of an unsigned integer type of width exactly 16 bits if such a type exists and the standard includes do not define it. */ #undef uint16_t /* Define to the type of an unsigned integer type of width exactly 32 bits if such a type exists and the standard includes do not define it. */ #undef uint32_t /* Define to the type of an unsigned integer type of width exactly 8 bits if such a type exists and the standard includes do not define it. */ #undef uint8_t GPX-2.5.2/src/shared/eeprominfo.h000066400000000000000000000035151271205255700165410ustar00rootroot00000000000000// // eeprominfo.h // // Created by WHPThomas on 1/04/13. // Copyright (c) 2013 WHPThomas, All rights reserved. // // Updates 2015 by Dan Newman, // and Mark Walker, // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __eeprominfo_h__ #define __eeprominfo_h__ typedef enum { et_null, et_bitfield, et_boolean, et_byte, et_ushort, et_long, et_ulong, et_fixed, et_float, et_string } EepromType; typedef struct tEepromMapping { const char *id; const char *label; const char *unit; unsigned address; EepromType et; int len; int minValue; int maxValue; const char *tooltip; } EepromMapping; typedef struct tEepromMap { unsigned short versionMin; unsigned short versionMax; unsigned char variant; EepromMapping *eepromMappings; int eepromMappingCount; } EepromMap; #endif // __eeprominfo_h__ GPX-2.5.2/src/shared/machine.h000066400000000000000000000066011271205255700160010ustar00rootroot00000000000000// // machines.h // // Created by WHPThomas on 1/04/13. // Copyright (c) 2013 WHPThomas, All rights reserved. // // Updates 2015 by Dan Newman, // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __machine_h__ #define __machine_h__ #define MACHINE_TYPE_NONE 0 #define MACHINE_TYPE_CUPCAKE_G3 1 // Cupcake Gen 3 electronics #define MACHINE_TYPE_CUPCAKE_G4 2 // Cupcake Gen 4 electronics #define MACHINE_TYPE_CUPCAKE_P4 3 // Cupcake Gen 4 + Pololu #define MACHINE_TYPE_CUPCAKE_PP 4 // Cupcake Gen 3 + Pololu #define MACHINE_TYPE_THINGOMATIC_6 5 // ToM Mk7 Single #define MACHINE_TYPE_THINGOMATIC_7 6 // ToM Mk7 Single #define MACHINE_TYPE_THINGOMATIC_7D 7 // ToM Mk7 Dual #define MACHINE_TYPE_REPLICATOR_1 8 // Rep 1 Single #define MACHINE_TYPE_REPLICATOR_1D 9 // Rep 1 Dual #define MACHINE_TYPE_REPLICATOR_2 10 // Rep 2 #define MACHINE_TYPE_REPLICATOR_2H 11 // Rep 2 w/HBP #define MACHINE_TYPE_REPLICATOR_2X 12 // Rep 2X #define MACHINE_TYPE_CORE_XY 13 // Core XY Single w/HBP #define MACHINE_TYPE_CORE_XYSZ 14 // Core XY Single w/HBP, slower Z #define MACHINE_TYPE_ZYYX 15 // ZYYX Single #define MACHINE_TYPE_ZYYX_D 16 // ZYYX Dual #define MACHINE_TYPE_CLONE_R1 17 // Clone R1 Single w/HBP #define MACHINE_TYPE_CLONE_R1D 18 // Clone R1 Dual w/HBP // endstop flags #define ENDSTOP_IS_MIN 0 #define ENDSTOP_IS_MAX 1 typedef struct { double max_feedrate; // mm/minute double max_accel; // mm/s^2 double max_speed_change; // mm/s double home_feedrate; // mm/minute double length; // mm double steps_per_mm; // steps/mm unsigned endstop; } Axis; typedef struct { double max_feedrate; // mm/minute double max_accel; // mm/s^2 double max_speed_change; // mm/s double steps_per_mm; // steps/mm double motor_steps; // microsteps per revolution unsigned has_heated_build_platform; } Extruder; typedef struct { const char *type; const char *desc; int free_type, free_desc; Axis x; Axis y; Axis z; Extruder a; Extruder b; double nominal_filament_diameter; double nominal_packing_density; double nozzle_diameter; double toolhead_offsets[3]; double jkn[2]; unsigned extruder_count; unsigned timeout; unsigned id; } Machine; typedef struct { const char *alias; const char *type; const char *desc; } MachineAlias; #endif GPX-2.5.2/src/shared/machine_config.c000066400000000000000000000232421271205255700173210ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* config.c * * Load a machine definiton (configuration) from a .ini file. */ #include #include #include #include "config.h" #include "opt.h" #include "machine_config.h" #include "machine.h" #define MACHINE_ARRAY #include "std_machines.h" // Forward declarations static int config_axis(Axis *axis, const char *name); static int config_extruder(Extruder *axis, const char *name); const Machine *config_get_machine(const char *type) { Machine **ptr = machines; if (!type) return(NULL); while (*ptr) { if (0 == strcasecmp((*ptr)->type, type)) return(*ptr); ++ptr; } return(NULL); } #define GET_UNSIGNED(f, s) \ opt = s; \ if ((iret = opt_get_int(&i, name, opt))) \ goto error; \ axis->f = (unsigned)(0x7fffffff & i) #define GET_DOUBLE(f, s) \ opt = s; \ if ((iret = opt_get_double(&axis->f, name, opt))) \ goto error static int config_axis(Axis *axis, const char *name) { int i, iret; const char *opt; if (!axis || !name) return(OPT_ERR_BADARGS); GET_UNSIGNED(endstop, "endstop"); axis->endstop = axis->endstop ? 1 : 0; GET_DOUBLE(max_feedrate, "max_feedrate"); GET_DOUBLE(max_accel, "max_acceleration"); GET_DOUBLE(max_speed_change, "max_speed_change"); GET_DOUBLE(home_feedrate, "home_feedrate"); GET_DOUBLE(length, "length"); GET_DOUBLE(steps_per_mm, "steps_per_mm"); return(0); error: fprintf(stderr, "Cannot parse the value for the \"%s\" option for " "the \"%s\" axis; %s\n", opt ? opt : "???", name ? name : "???", opt_strerror(iret)); return(iret); } static void config_dump_axis(FILE *fp, const Axis *a, const char *name) { if (!fp || !a) return; if (name) fprintf(fp, "[%s]\n", name); fprintf(fp, "steps_per_mm = %.10g\n", a->steps_per_mm); fprintf(fp, "max_feedrate = %g\n", a->max_feedrate); fprintf(fp, "max_acceleration = %g\n", a->max_accel); fprintf(fp, "max_speed_change = %g\n", a->max_speed_change); fprintf(fp, "home_feedrate = %g\n", a->home_feedrate); fprintf(fp, "length = %g\n", a->length); fprintf(fp, "endstop = %u\n", a->endstop); } static int config_extruder(Extruder *axis, const char *name) { int i, iret; const char *opt = NULL; if (!axis || !name) return(OPT_ERR_BADARGS); GET_DOUBLE(max_feedrate, "max_feedrate"); GET_DOUBLE(max_accel, "max_acceleration"); GET_DOUBLE(max_speed_change, "max_speed_change"); GET_DOUBLE(steps_per_mm, "steps_per_mm"); GET_DOUBLE(motor_steps, "motor_steps"); GET_UNSIGNED(has_heated_build_platform, "has_heated_build_platform"); axis->has_heated_build_platform = axis->has_heated_build_platform ? 1 : 0; return(0); error: fprintf(stderr, "Cannot parse the value for the \"%s\" option for " "the \"%s\" axis; %s\n", opt ? opt : "???", name ? name : "???", opt_strerror(iret)); return(iret); } static void config_dump_extruder(FILE *fp, const Extruder *a, const char *name) { if (!fp || !a) return; if (name) fprintf(fp, "[%s]\n", name); fprintf(fp, "steps_per_mm = %g\n", a->steps_per_mm); fprintf(fp, "max_feedrate = %g\n", a->max_feedrate); fprintf(fp, "max_acceleration = %g\n", a->max_accel); fprintf(fp, "max_speed_change = %g\n", a->max_speed_change); fprintf(fp, "motor_steps = %g\n", a->motor_steps); fprintf(fp, "has_heated_build_platform = %u\n", a->has_heated_build_platform); } #undef GET_UNSIGNED #undef GET_DOUBLE #define GET_STRING(f, t, s) \ tmp = (char *)opt_get_str("printer", s); \ if (tmp) tmp = strdup(tmp); \ if (tmp) { \ if (m->f && m->t) free((char *)m->f); \ m->f = tmp; \ m->t = 1; } #define GET_UNSIGNED(f, s) \ opt = s; \ if ((iret = opt_get_int(&i, "printer", opt))) \ goto error; \ m->f = (unsigned)(0x7fffffff & i) #define GET_DOUBLE(f, s) \ opt = s; \ if ((iret = opt_get_double(&m->f, "printer", opt))) \ goto error int config_machine(Machine *m, const Machine *def, const char *mtype) { int i, iret; const char *opt; char *tmp; if (!m) return(OPT_ERR_BADARGS); if (!def) def = &replicator_2; // See if a machine type was specified in the config file // If one was, then attempt to use it as the source of defaults // If one wasn't, then use the passed in mtype if not NULL // Finally, use def if all else fails. opt = opt_get_str("printer", "machine_type"); if (!opt) opt = mtype; i = 0; if (opt) { const Machine *d = config_get_machine(opt); if (d) { memcpy(m, d, sizeof(Machine)); i = 1; } } // Fall back to using the passed in default machine as our defaults // We are assured of def being non-NULL: if it was NULL upon entry, // it was set to &replicator_2. if ((i == 0) && (m != def)) memcpy(m, def, sizeof(Machine)); if ((iret = config_axis(&m->x, "x"))) return(iret); if ((iret = config_axis(&m->y, "y"))) return(iret); if ((iret = config_axis(&m->z, "z"))) return(iret); if ((iret = config_extruder(&m->a, "a"))) return(iret); if ((iret = config_extruder(&m->b, "b"))) return(iret); GET_DOUBLE(nominal_filament_diameter, "filament_diameter"); GET_DOUBLE(nominal_packing_density, "packing_density"); GET_DOUBLE(nozzle_diameter, "nozzle_diameter"); GET_DOUBLE(toolhead_offsets[0], "toolhead_offset_x"); GET_DOUBLE(toolhead_offsets[1], "toolhead_offset_y"); GET_DOUBLE(toolhead_offsets[2], "toolhead_offset_z"); GET_DOUBLE(jkn[0], "jkn_k"); GET_DOUBLE(jkn[1], "jkn_k2"); GET_UNSIGNED(extruder_count, "extruder_count"); GET_UNSIGNED(timeout, "timeout"); // GET_STRING(type, free_type, "machine_type"); GET_STRING(desc, free_desc, "machine_description"); return(OPT_OK); error: fprintf(stderr, "Cannot parse the value for the \"%s\" option; " "%s\n", opt ? opt : "???", opt_strerror(iret)); return(iret); } void config_dump(FILE *fp, const Machine *m) { int dumped; if (!fp || !m) return; fprintf(fp, "[printer]\n"); if (m->type) fprintf(fp, "machine_type = %s\n", m->type); if (m->desc) fprintf(fp, "machine_description = %s\n", m->desc); fprintf(fp, "filament_diameter = %g\n", m->nominal_filament_diameter); fprintf(fp, "packing_density = %g\n", m->nominal_packing_density); fprintf(fp, "nozzle_diameter = %g\n", m->nozzle_diameter); fprintf(fp, "toolhead_offset_x = %g\n", m->toolhead_offsets[0]); fprintf(fp, "toolhead_offset_y = %g\n", m->toolhead_offsets[1]); fprintf(fp, "toolhead_offset_z = %g\n", m->toolhead_offsets[2]); fprintf(fp, "jkn_k = %g\n", m->jkn[0]); fprintf(fp, "jkn_k2 = %g\n", m->jkn[1]); fprintf(fp, "extruder_count = %u\n", m->extruder_count); fprintf(fp, "timeout = %u\n", m->timeout); fprintf(fp, "\n"); dumped = 0x00; if (0 == memcmp(&m->x, &m->y, sizeof(Axis))) { if (0 == memcmp(&m->x, &m->z, sizeof(Axis))) { dumped |= 0x7; config_dump_axis(fp, &m->x, "x, y, z"); } else { dumped |= 0x3; config_dump_axis(fp, &m->x, "x, y"); } } else { dumped |= 0x1; config_dump_axis(fp, &m->x, "x"); } fprintf(fp, "\n"); if (0 == (dumped & 0x2)) { if (0 == memcmp(&m->y, &m->z, sizeof(Axis))) { dumped |= 0x06; config_dump_axis(fp, &m->y, "y, z"); } else { dumped |= 0x02; config_dump_axis(fp, &m->y, "y"); } fprintf(fp, "\n"); } if (0 == (dumped & 0x04)) { config_dump_axis(fp, &m->z, "z"); fprintf(fp, "\n"); } if (0 == memcmp(&m->a, &m->b, sizeof(Extruder))) config_dump_extruder(fp, &m->a, "a, b"); else { config_dump_extruder(fp, &m->a, "a"); fprintf(fp, "\n"); config_dump_extruder(fp, &m->b, "b"); } } GPX-2.5.2/src/shared/machine_config.h000066400000000000000000000067621271205255700173360ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _CONFIG_H_ #define _CONFIG_H_ #include "machine.h" /* config_machine() * * Using a default machine type for defaults, populate the settings for machine "m" * from a previously digested .ini file. * * The defaulting hiearchy in order of highest to lowers precedence is * * 1. Values from the user-supplied configuration file. * * 2. Values from the machine definition specified with the "machine_type" * option in the user-supplied configuration file. * * 3. Values from the machine definition specified with the "machine_type" * call argument if non-NULL. * * 4. Values from the "def" call argument if non-NULL. * * 5. The GPX-default machine type, "r2" (Replicator 2). * * opt_loadfile() should be called before calling config_machine() in order for * options from a user-supplied config file to be used. Do not * call opt_dispose() until after calling config_machine(). * * Call arguments: * * Machine *m * The machine to populate from the .ini file. * * const Machine *def * A machine to use as the default template supplying values * for options not specified in the configuration file. * * const char *machine_type * A type specification for the machine type to use for options * not specified in the option file. * * Return values * * OPT_OK -- Success * OPT_ERR_BADARGS -- Bad call arguments supplied. One or both of m or def is NULL. * OPT_ERR_BADFLOAT -- Unable to parse as a floating point value one of the option values. * OPT_ERR_BADINT -- Unable to parse as an integer value one of the option values. */ int config_machine(Machine *m, const Machine *def, const char *machine_type); /* config_dump() * * Write to the file fp a .ini file describing the supplied machine. The * file written will contain all machine settings. * * Call arguments: * * FILE *fp * File pointer of the file to write to. * * const Machine *m * Machine to output. * * Return values: None */ void config_dump(FILE *fp, const Machine *m); const Machine *config_get_machine(const char *type); #endif GPX-2.5.2/src/shared/opt.c000066400000000000000000000421531271205255700151740ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* opt.c * * ".ini"-style file parser for option=value pairs. * * And, YES, gpx already has a different .ini file parser. It is an event-driven, * callback-style parser. That is suitable to gpx and the macros which can be * put into a gpx .ini file. For other uses of the same .ini file -- uses where * it's a fixed, rigid set of option names -- this style of parser is easier to use. * Thus, we have two .ini file parsers. * * About this parser... * * 0. Blank lines are ignored. * * 1. Comments are introduced on a line with either ';' or '#'. A line with * a comment may only have a comment. Do not attempt to follow an option=value * with a comment. * * 2. Presently there is no character escape mechanism to literalize a * character. Easy enough to add should it ever prove needed. * * 3. Presently there is no mechanism to enclose in quotes an option value * and then have the quotes stripped by the parser. This can be added * should it be needed. * * 4. Leading and trailing linear whitespace (LWSP) is ignored. Combined * with 3 above, this means that if LWSP at the end of an option value * is significant, then 3 above needs to be rectified. * * 5. Groups are started with a line of the form * * [group] * * All subsequent options are grouped under that group until such * time that a new group is started. * * 6. A group containing commas in the name, creates multiple groups, * * [group1, group2, group3] * * Each subsequent option will be filed under each named group. * * 7. Option/value pairs are expressed one per line in the format * * option-name=value * * There can be any amount of LWSP before the option-name, between * the option-name and the '=', after the '=', and after the value. * * 8. Any option/value pair specified before any group declarations are * considered to be in the group whose name is the empty-string. * * 9. As the file is parsed, a linked list of option=value pairs is built. * Options can subsequently be retrieved by specifying the group name * and the option name. The group and option names are considered to * be case insensitive. * * 10. When retrieving an option value of type "double", strtod() is used * to parse the value. * * 11. When retrieving an option value of type "int", strtol(, 0) is used * to parse the value. As such, the value may be expressed in octal, * decimal, or hexadecimal. */ #include #include #include #include #include "opt.h" // Structure to store an option=value pair // The structure is always allocated such that its length is // // sizeof(option_t) + strlen(name) + 1 + strlen(value) // // Then name and value point into the buf[] field and store // their values in buf[]. Note that since sizeof(option_t) // includes 1 byte of buf, the allocated structure size // includes 1 byte for the NUL terminator of the value field. // Hence the length computation above including 1 byte for the // name field's NUL terminator but not the value field's. typedef struct option_s { struct option_s *prev; struct option_s *next; char *option; char *value; char buf[1]; } option_t; static option_t *root = NULL; // Forward declarations static int opt_add(const char *group, const char *option, const char *value); static int opt_add_inner(const char *group, size_t glen, const char *option, const char *value); static const char *opt_find(const char *group, const char *option); static int opt_parse_line(char *line, char **group); // Dispose of the linked list of option=value pairs void opt_dispose(void) { option_t *tmp; while (root) { tmp = root->next; free(root); root = tmp; } } // Add an option=value pair to the linked list of option=value pairs // Group names are handled by prefixing the option name with the // string // // 0x01 // // The 0x01 is a sentinel to guard against // // [foo] // bar=2 // // being confused with // // foobar=2 static int opt_add(const char *group, const char *option, const char *value) { int iret; char *ptr, *tmp, *tmp0, *tmpend; ptr = group ? strchr(group, ',') : NULL; if (!ptr) return(opt_add_inner(group, group ? strlen(group) : (size_t)0, option, value)); // group has commas // treat as multiple groups // LWSP was already removed // Make a copy we can manipulate tmp0 = strdup(group); // Note the end of the string tmpend = tmp0 + strlen(tmp0); // Figure out where the "," is in our copy // We could do this a bit more simply with strtok(_r) but strtok(_r) // is not found on all platforms. tmp = tmp0; ptr = tmp + (ptr - group); *ptr = '\0'; iret = 0; loop: if ((iret = opt_add_inner(tmp, strlen(tmp), option, value))) goto done; // Move to the next segment tmp = ptr + 1; // Finish up if the string has been exhausted if (tmp >= tmpend) goto done; // Another comma? if ((ptr = strchr(tmp, ','))) // Yes, another comma *ptr = '\0'; else // Process remainder of the string and set a termination condition ptr = tmpend; // Process this section goto loop; done: if (tmp0) free(tmp0); return(iret); } static int opt_add_inner(const char *group, size_t lg, const char *option, const char *value) { size_t i, lo, lv; char *ptr; option_t *tmp; // Determine the lengths of each of the fields lo = option ? strlen(option) : 0; lv = value ? strlen(value) : 0; // Allocate an option_t structure tmp = (option_t *)calloc(1, sizeof(option_t) + lg + 1 + lo + 1 + lv); if (!tmp) return(-1); // Option field receives 0x01 NUL tmp->option = tmp->buf; ptr = tmp->buf; for (i = 0; i < lg; i++) *ptr++ = tolower(*group++); *ptr++ = (char)0x01; for (i = 0; i < lo; i++) *ptr++ = tolower(*option++); *ptr++ = '\0'; // Value field receives NUL tmp->value = ptr; // tmp->buf + lg + 1 + lo + 1; if (value) memcpy(tmp->value, value, lv); tmp->value[lv] = '\0'; // Add this option to the head of the list // This will effectively make the last seen of a duplicate option prevail tmp->next = root; // Back link things // This is only used when dumping the options back to a file. It facilitates // listing the options in the order in which they appeared in the file. if (root) root->prev = tmp; // Make this new option the head of the list root = tmp; return(0); } // Find the indicated option in the linked list of options. // The first match is returned, starting from the head of the list. static const char *opt_find(const char *group, const char *option) { char buf[64], *bufptr, *ptr; size_t i, lg, lo; const char *value; option_t *tmp; // If there are no options, then just return a no-match if (!root) return((const char *)NULL); // Field lengths lg = group ? strlen(group) : 0; lo = option ? strlen(option) : 0; // Use our static buffer if possible; otherwise, allocate a buffer if ((lg + 1 + lo + 1) < sizeof(buf)) bufptr = buf; else { bufptr = malloc(lg + 1 + lo + 1); if (!bufptr) return(NULL); } // Build our search string 0x01 (option-name) ptr = bufptr; for (i = 0; i < lg; i++) *ptr++ = tolower(*group++); *ptr++ = (char)0x01; for (i = 0; i < lo; i++) *ptr++ = tolower(*option++); *ptr = '\0'; // Now walk the list looking for this option value = NULL; tmp = root; while (tmp) { if (0 == strcmp(tmp->option, bufptr)) break; tmp = tmp->next; } // If tmp != NULL, then we found a match if (tmp) value = tmp->value; // Release any memory we allocated if (bufptr && bufptr != buf) free(bufptr); // Return the match or NULL if no match was found return(value); } // Parse a line of the configuration file, updating the linked // list of option=value pairs #define STATE_BEGIN 0 #define STATE_GROUP 1 #define STATE_LEFT_HAND_SIDE 2 #define STATE_FIND_DELIM 3 #define STATE_FIND_RIGHT_HAND_SIDE 4 #define STATE_RIGHT_HAND_SIDE 5 static int opt_parse_line(char *line, char **group) { char c; char *inptr, *left, *outptr, *right, *ptr; const char *grp; int state; static const char empty_string[] = ""; if (!line) return(OPT_ERR_BADARGS); // ignore leading LWSP while (isspace(*line)) ++line; // Return now if the line was exhausted if (!(*line)) return(0); // And chew off any trailing LWSP // strlen(line) >= 1 owing to prior test ptr = line + strlen(line) - 1; while ((ptr >= line) && isspace(*ptr)) *ptr-- = '\0'; // Return now if the line was exhausted if (!(*line)) return(0); // Return now the line is a comment if (*line == ';' || *line == '#') return(0); // We're ready to parse // // Case 1: ';' comment // Case 2: '#' comment // Case 3: option-name LWSP '=' LWSP option-value // Case 4: '[' LWSP group-name LWSP ']' state = STATE_BEGIN; left = NULL; right = NULL; inptr = line; outptr = line; while ((c = *inptr++)) { switch(state) { case STATE_BEGIN: if (c == '[') { state = STATE_GROUP; left = inptr; outptr = left; } else { state = STATE_LEFT_HAND_SIDE; left = outptr; // Lower case the option name *outptr++ = tolower(c); } break; case STATE_GROUP: if (c == ']') { // End of group name // NUL terminate *outptr = '\0'; // watch out for trailing non-LWSP after the ']' if (*inptr) // There's non-LWSP after the ']' return(OPT_ERR_NONLWSP_AFTER_GROUPNAME); else if (group) { // Strip LWSP inptr = left; outptr = left; while ((c = *inptr++)) if (!isspace(c)) *outptr++ = c; *outptr = '\0'; char *tmp = strdup(left); if (!tmp) return(OPT_ERR_NOMEM); *group = tmp; break; } } else // Lower case the group name *outptr++ = tolower(c); break; case STATE_LEFT_HAND_SIDE: if ((c == '=') || isspace(c)) { // End of option name // NUL terminated *outptr++ = '\0'; // Look for the '=' // There may be intervening LWSP state = (c == '=') ? STATE_FIND_RIGHT_HAND_SIDE : STATE_FIND_DELIM; right = inptr; outptr = right; } else // Lower case the option name *outptr++ = tolower(c); break; case STATE_FIND_DELIM: if (c == '=') { state = STATE_FIND_RIGHT_HAND_SIDE; // If EOL is next, then right[0] = NUL and so we're already NUL terminated right = inptr; outptr = right; } else if (!isspace(c)) // Error -- non-LWSP seen before the '=' return(OPT_ERR_NONLWSP_AFTER_OPTNAME); break; case STATE_FIND_RIGHT_HAND_SIDE: if (isspace(c)) { // If EOL is next, then right[0] = NUL and so we're already NUL terminated right = inptr; outptr = right; break; } else // We've started to see the start of the right hand side state = STATE_RIGHT_HAND_SIDE; // Fall through case STATE_RIGHT_HAND_SIDE: *outptr++ = c; break; } } if (state == STATE_RIGHT_HAND_SIDE) *outptr = '\0'; // Successful end states if ((state != STATE_RIGHT_HAND_SIDE) && (state != STATE_GROUP)) return(OPT_ERR_CANNOT_PARSE); // If we parsed a group name then there's nothing to do for now if (state == STATE_GROUP) return(0); // Push this option into the list if ((group == NULL) || (*group == NULL)) grp = empty_string; else grp = *group; return((opt_add(grp, left, right)) ? OPT_ERR_NOMEM : OPT_OK); } // Build a linked list of option=value pairs from a ".ini" style // configuration file. int opt_loadfile(const char *fname, int *lineno) { char buffer[4096], *group; FILE *fp; int istat; if (lineno) *lineno = 0; if (!fname) return(OPT_ERR_BADARGS); fp = fopen(fname, "r"); if (!fp) return(OPT_ERR_FOPEN); group = NULL; while (fgets(buffer, sizeof(buffer), fp) != NULL) { if (lineno) *lineno += 1; if ((istat = opt_parse_line(buffer, &group))) break; } // See why we've finished the loop if (ferror(fp)) istat = OPT_ERR_FREAD; // otherwise, we exited because // istat != 0 -- parsing error // istat == 0 -- EOF if (group) free(group); if (fp != NULL) fclose(fp); return(istat); } // Return as a string the matching option's value const char *opt_get_str(const char *group, const char *option) { return(opt_find(group, option)); } // Return by reference the double precision value of the matching option. // The returned value is passed via the (option) d call argument. // // In the event of a parsing error, -1 is returned. Otherwise, 0 is returned int opt_get_double(double *d, const char *group, const char *option) { double dval; const char *val; char *endptr = NULL; val = opt_find(group, option); if (!val) return(0); endptr = NULL; dval = strtod(val, &endptr); if (endptr == val) // Parsing error! return(OPT_ERR_BADFLOAT); if (d) *d = dval; return(0); } // Return by reference the integer value of the matching option. // The returned value is passed via the (option) i call argument. // // In the event of a parsing error, -1 is returned. Otherwise, 0 is returned int opt_get_int(int *i, const char *group, const char *option) { long lval; const char *val; char *endptr = NULL; val = opt_find(group, option); if (!val) return(0); endptr = NULL; lval = strtol(val, &endptr, 0); if (endptr == val) // Parsing error! return(OPT_ERR_BADINT); if (i) *i = (int)lval; return(0); } #if defined(OPT_DEBUG) void opt_dump(void) { option_t *opt; if (!root) return; // Run to the end of the list // We do this so that we can dump the options // in the order they were read from the file. opt = root; while(opt->next) opt = opt->next; while(opt) { char *ptr = opt->option; while (*ptr) { if (*ptr == (char)0x01) fputc('/', stdout); else fputc(*ptr, stdout); ptr++; } fprintf(stdout, " = %s\n", opt->value); opt = opt->prev; } } #endif static const char *errmsg[] = { /* 0 */ "success", /* 1 */ "programming error; invalid call arguments", /* 2 */ "incorrectly specified real number", /* 3 */ "incorrectly specified integer value", /* 4 */ "syntactically invalid line", /* 5 */ "unable to open the configuration file", /* 6 */ "unable to read the configuration file", /* 7 */ "insufficient virtual memory", /* 8 */ "non space characters following the group name", /* 9 */ "non space characters following the option name and preceeding '='", }; #define ERROR_COUNT (sizeof(errmsg)/sizeof(char *)) // Provide an English languag) text string for a given error condition const char *opt_strerror(int err) { static const char *unknown = "programming error; unknown error code"; if (err < 0 || err >= ERROR_COUNT) return(unknown); else return(errmsg[err]); } GPX-2.5.2/src/shared/opt.h000066400000000000000000000114221271205255700151740ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef _OPT_H_ #define _OPT_H_ #define OPT_OK 0 #define OPT_ERR_BADARGS 1 #define OPT_ERR_BADFLOAT 2 #define OPT_ERR_BADINT 3 #define OPT_ERR_CANNOT_PARSE 4 #define OPT_ERR_FOPEN 5 #define OPT_ERR_FREAD 6 #define OPT_ERR_NOMEM 7 #define OPT_ERR_NONLWSP_AFTER_GROUPNAME 8 #define OPT_ERR_NONLWSP_AFTER_OPTNAME 9 /* opt_loadfile() * * Read and load a .ini file. * * Call arguments: * * const char *optfile * Option file to open. File is opened read-only. * * int *lineno * Optional pointer to an integer to receive the file line number * for which an error has occurred. * * Return values: * * OPT_OK -- Success * OPT_ERR_x -- Processing error of some sort. Use opt_strerror() * to generate an English-language error message. * The integer pointed at with lineno will contain the * errant line in the file if a parsing error occurred. * In the event of a non-parsing error (e.g., file not * found), lineno will be zero. */ int opt_loadfile(const char *optfile, int *lineno); /* opt_dispose() * * Release the virtual memory allocated for the option data. */ void opt_dispose(void); /* opt_get_str() * * Return as a string pointer the value of the specified option. This * pointer points within the in-memory option data parsed from the .ini * file. * * Call arguments: * * const char *group * Name of the group to look under. * * const char *name * Name of the option. * Return values: * * Pointer to the option's value. If the option was found, it will be * a pointer to a NUL terminated string. DO NOT free() this pointer. * The pointer will be valid until opt_dispose() is called. */ const char *opt_get_str(const char *group, const char *name); /* opt_get_double() * * Return the floating point value of the specified option. The value will * be parsed with strtod(). In the event of a parsing error by strtod(), * OPT_ERR_BADFLOAT will be returned. * * Call arguments: * * double *d * Pointer to a double to receive the result. * * const char *group * Name of the group to look under. * * const char *name * Name of the option. * * Return values: * * OPT_OK -- Success * OPT_ERR_BADFLOAT -- Unable to parse the option's value as a double */ int opt_get_double(double *d, const char *group, const char *name); /* opt_get_int() * * Return the integer value of the specified option. The value will * be parsed with strtol() with 0 passed for the radix. As such, the * value may be expressed as an octal, decimal, or hexadecimal value * in the configuration file. In the event that strtol() cannot parse * the value then OPT_ERR_BADINT will be returned. * * Call arguments: * * int *d * Pointer to an int to receive the result. * * const char *group * Name of the group to look under. * * const char *name * Name of the option. * * Return values: * * OPT_OK -- Success * OPT_ERR_BADINT -- Unable to parse the option's value as an integer */ int opt_get_int(int *i, const char *group, const char *name); /* opt_strerror() * * Return a pointer to a printable, English-language message describing * an OPT_ERR_ error code. */ const char *opt_strerror(int err); #if defined(OPT_DEBUG) void opt_dump(void); #endif #endif GPX-2.5.2/src/shared/portable_endian.h000066400000000000000000000060211271205255700175170ustar00rootroot00000000000000// portable_endian.h // from https://gist.github.com/panzi/6856583 // "License": Public Domain // I, Mathias Panzenböck, place this file hereby into the public domain. Use it // at your own risk for whatever you like. In case there are jurisdictions // that don't support putting things in the public domain you can also consider // it to be "dual licensed" under the BSD, MIT and Apache licenses, if you want // to. This code is trivial anyway. Consider it an example on how to get the // endian conversion functions on different platforms. #ifndef PORTABLE_ENDIAN_H__ #define PORTABLE_ENDIAN_H__ #if (defined(_WIN16) || defined(_WIN32) || defined(_WIN64)) && !defined(__WINDOWS__) # define __WINDOWS__ #endif #if defined(__linux__) || defined(__CYGWIN__) || defined(__GLIBC__) # include #elif defined(__APPLE__) # include # define htobe16(x) OSSwapHostToBigInt16(x) # define htole16(x) OSSwapHostToLittleInt16(x) # define be16toh(x) OSSwapBigToHostInt16(x) # define le16toh(x) OSSwapLittleToHostInt16(x) # define htobe32(x) OSSwapHostToBigInt32(x) # define htole32(x) OSSwapHostToLittleInt32(x) # define be32toh(x) OSSwapBigToHostInt32(x) # define le32toh(x) OSSwapLittleToHostInt32(x) # define htobe64(x) OSSwapHostToBigInt64(x) # define htole64(x) OSSwapHostToLittleInt64(x) # define be64toh(x) OSSwapBigToHostInt64(x) # define le64toh(x) OSSwapLittleToHostInt64(x) # define __BYTE_ORDER BYTE_ORDER # define __BIG_ENDIAN BIG_ENDIAN # define __LITTLE_ENDIAN LITTLE_ENDIAN # define __PDP_ENDIAN PDP_ENDIAN #elif defined(__OpenBSD__) # include #elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__DragonFly__) # include # define be16toh(x) betoh16(x) # define le16toh(x) letoh16(x) # define be32toh(x) betoh32(x) # define le32toh(x) letoh32(x) # define be64toh(x) betoh64(x) # define le64toh(x) letoh64(x) #elif defined(__WINDOWS__) //# include # include # if BYTE_ORDER == LITTLE_ENDIAN # define htobe16(x) htons(x) # define htole16(x) (x) # define be16toh(x) ntohs(x) # define le16toh(x) (x) # define htobe32(x) htonl(x) # define htole32(x) (x) # define be32toh(x) ntohl(x) # define le32toh(x) (x) # define htobe64(x) htonll(x) # define htole64(x) (x) # define be64toh(x) ntohll(x) # define le64toh(x) (x) # elif BYTE_ORDER == BIG_ENDIAN /* that would be xbox 360 */ # define htobe16(x) (x) # define htole16(x) __builtin_bswap16(x) # define be16toh(x) (x) # define le16toh(x) __builtin_bswap16(x) # define htobe32(x) (x) # define htole32(x) __builtin_bswap32(x) # define be32toh(x) (x) # define le32toh(x) __builtin_bswap32(x) # define htobe64(x) (x) # define htole64(x) __builtin_bswap64(x) # define be64toh(x) (x) # define le64toh(x) __builtin_bswap64(x) # else # error byte order not supported # endif # define __BYTE_ORDER BYTE_ORDER # define __BIG_ENDIAN BIG_ENDIAN # define __LITTLE_ENDIAN LITTLE_ENDIAN # define __PDP_ENDIAN PDP_ENDIAN #else # error platform not supported #endif #endif GPX-2.5.2/src/shared/s3g.c000066400000000000000000000773001271205255700150700ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include #include #include "portable_endian.h" #include "s3g_private.h" #include "s3g_stdio.h" #include "s3g.h" typedef struct { union { int32_t i; uint32_t u; float f; unsigned char c[4]; } u; } foo_32_t; typedef struct { union { int16_t i; uint16_t u; unsigned char c[2]; } u; } foo_16_t; typedef struct { uint8_t cmd_id; size_t cmd_len; int cmd_blocking; const char *cmd_desc; } s3g_command_info_t; static const s3g_command_info_t command_table_raw[] = { /* 0 */ {HOST_CMD_VERSION, 0, 0, "version"}, /* 1 */ {HOST_CMD_INIT, 0, -1, "initialize"}, /* 2 */ {HOST_CMD_GET_BUFFER_SIZE, 0, 0, "get buffer size"}, /* 3 */ {HOST_CMD_CLEAR_BUFFER, 0, 0, "clear buffer"}, /* 4 */ {HOST_CMD_GET_POSITION, 0, -1, "get position"}, /* 5,6 */ // DO NOT EXIST /* 7 */ {HOST_CMD_ABORT, 0, -1, "abort"}, /* 8 */ {HOST_CMD_PAUSE, 0, -1, "Pause"}, /* 9 */ {HOST_CMD_PROBE, 0, -1, "probe"}, /* 10 */ {HOST_CMD_TOOL_QUERY, 0, 0, "tool query"}, /* 11 */ {HOST_CMD_IS_FINISHED, 0, -1, "is finished?"}, /* 12 */ {HOST_CMD_READ_EEPROM, 0, 0, "read EEPROM"}, /* 13 */ {HOST_CMD_WRITE_EEPROM, 0, 0, "write EEPROM"}, /* 14 */ {HOST_CMD_CAPTURE_TO_FILE, 0, -1, "capture to file"}, /* 15 */ {HOST_CMD_END_CAPTURE, 0, -1, "end capture"}, /* 16 */ {HOST_CMD_PLAYBACK_CAPTURE, 0, -1, "playback capture"}, /* 17 */ {HOST_CMD_RESET, 0, -1, "software reset"}, /* 18 */ {HOST_CMD_NEXT_FILENAME, 0, -1, "next SD card filename"}, /* 19 */ {HOST_CMD_GET_DBG_REG, 0, 0, "get debug register"}, /* 20 */ {HOST_CMD_GET_BUILD_NAME, 0, 0, "get build name"}, /* 21 */ {HOST_CMD_GET_POSITION_EXT, 0, -1, "get position extended"}, /* 22 */ {HOST_CMD_EXTENDED_STOP, 0, -1, "extended stop"}, /* 23 */ {HOST_CMD_BOARD_STATUS, 0, 0, "get board status"}, /* 24 */ {HOST_CMD_GET_BUILD_STATS, 0, -1, "get build statistics"}, /* 25-6*/ // DO NOT EXIST /* 27 */ {HOST_CMD_ADVANCED_VERSION, 0, 0, "advanced version"}, /* ... */ // DO NOT EXIST /* 112 */ {HOST_CMD_DEBUG_ECHO, 0, -1, "debug echo"}, /* ... */ // DO NOT EXIST /* 131 */ {HOST_CMD_FIND_AXES_MINIMUM, 7, -1, "find axes minimum"}, /* 132 */ {HOST_CMD_FIND_AXES_MAXIMUM, 7, -1, "find axes maximum"}, /* 133 */ {HOST_CMD_DELAY, 4, -1, "delay"}, /* 134 */ {HOST_CMD_CHANGE_TOOL, 1, -1, "change tool"}, /* 135 */ {HOST_CMD_WAIT_FOR_TOOL, 5, -1, "wait for tool ready"}, /* 136 */ {HOST_CMD_TOOL_COMMAND, 0xffffffff, 0, "tool action"}, /* 137 */ {HOST_CMD_ENABLE_AXES, 1, -1, "enable/disable axes"}, /* 138 */ // DOES NOT EXIST /* 139 */ {HOST_CMD_QUEUE_POINT_EXT, 24, -1, "queue point extended"}, /* 140 */ {HOST_CMD_SET_POSITION_EXT, 20, -1, "set position extended"}, /* 141 */ {HOST_CMD_WAIT_FOR_PLATFORM, 5, -1, "wait for platform ready"}, /* 142 */ {HOST_CMD_QUEUE_POINT_NEW, 25, -1, "queue new point"}, /* 143 */ {HOST_CMD_STORE_HOME_POSITION, 1, -1, "store home position"}, /* 144 */ {HOST_CMD_RECALL_HOME_POSITION, 1, -1, "recall home position"}, /* 145 */ {HOST_CMD_SET_POT_VALUE, 2, -1, "digital potentiometer"}, /* 146 */ {HOST_CMD_SET_RGB_LED, 5, -1, "RGB LED"}, /* 147 */ {HOST_CMD_SET_BEEP, 5, -1, "buzzer beep"}, /* 148 */ {HOST_CMD_PAUSE_FOR_BUTTON, 4, -1, "pause for button"}, /* 149 */ {HOST_CMD_DISPLAY_MESSAGE, -1, -1, "display message"}, /* 150 */ {HOST_CMD_SET_BUILD_PERCENT, 2, 0, "build percentage"}, /* 151 */ {HOST_CMD_QUEUE_SONG, 1, -1, "queue song"}, /* 152 */ {HOST_CMD_RESET_TO_FACTORY, 1, -1, "restore to factory settings"}, /* 153 */ {HOST_CMD_BUILD_START_NOTIFICATION, 4, -1, "build start notification"}, /* 154 */ {HOST_CMD_BUILD_END_NOTIFICATION, 1, -1, "build end notification"}, /* 155 */ {HOST_CMD_QUEUE_POINT_NEW_EXT, 31, 0, "queue point new extended"}, /* 156 */ {HOST_CMD_SET_ACCELERATION_TOGGLE, 1, -1, "set segment acceleration"}, /* 157 */ {HOST_CMD_STREAM_VERSION, 20, 0, "stream version"}, /* 158 */ {HOST_CMD_PAUSE_AT_ZPOS, 4, 0, "pause at Z position"} /* ... */ // DO NOT EXIST }; static const s3g_command_info_t tool_command_table_raw[] = { /* 0 */ {TOOL_CMD_VERSION, 0, 0, "version"}, /* 1 */ {TOOL_CMD_INIT, 0, -1, "initialize"}, /* 2 */ {TOOL_CMD_GET_TEMP, 0, 0, "query current extruder temperature"}, /* 3 */ {TOOL_CMD_SET_TEMP, 0, 0, "set extruder target temperature"}, /* 4 */ {TOOL_CMD_SET_MOTOR_1_PWM, 0, -1, "set motor 1 speed (PWM)"}, /* 5 */ {TOOL_CMD_SET_MOTOR_2_PWM, 0, -1, "set motor 2 speed (PWM)"}, /* 6 */ {TOOL_CMD_SET_MOTOR_1_RPM, 0, -1, "set motor 1 speed (RPM)"}, /* 7 */ {TOOL_CMD_SET_MOTOR_2_RPM, 0, -1, "set motor 2 speed (RPM)"}, /* 8 */ {TOOL_CMD_SET_MOTOR_1_DIR, 0, -1, "set motor 1 direction"}, /* 9 */ {TOOL_CMD_SET_MOTOR_2_DIR, 0, -1, "set motor 2 direction"}, /* 10 */ {TOOL_CMD_TOGGLE_MOTOR_1, 0, -1, "set motor 1 state"}, /* 11 */ {TOOL_CMD_TOGGLE_MOTOR_2, 0, -1, "set motor 2 state"}, /* 12 */ {TOOL_CMD_TOGGLE_FAN, 0, 0, "set heatsink cooling fan state"}, /* 13 */ {TOOL_CMD_TOGGLE_VALVE, 0, 0, "set print cooling fan state"}, /* 14 */ {TOOL_CMD_SET_SERVO_1_POS, 0, -1, "set servo 1 position"}, /* 15 */ {TOOL_CMD_SET_SERVO_2_POS, 0, -1, "set servo 2 position"}, /* 16 */ {TOOL_CMD_FILAMENT_STATUS, 0, 0, "query filament status"}, /* 17 */ {TOOL_CMD_GET_MOTOR_1_RPM, 0, 0, "query motor 1 speed (RPM)"}, /* 18 */ {TOOL_CMD_GET_MOTOR_2_RPM, 0, 0, "query motor 2 speed (RPM)"}, /* 19 */ {TOOL_CMD_GET_MOTOR_1_PWM, 0, 0, "query motor 1 speed (PWM)"}, /* 20 */ {TOOL_CMD_GET_MOTOR_2_PWM, 0, 0, "query motor 2 speed (PWM)"}, /* 21 */ {TOOL_CMD_SELECT_TOOL, 0, -1, "switch tool"}, /* 22 */ {TOOL_CMD_IS_TOOL_READY, 0, -1, "query tool ready"}, /* 23 */ {TOOL_CMD_PAUSE_UNPAUSE, 0, -1, "toggle pause state"}, /* 24 */ {TOOL_CMD_ABORT, 0, -1, "abort"}, /* 25 */ {TOOL_CMD_READ_FROM_EEPROM, 0, 0, "read EEPROM"}, /* 26 */ {TOOL_CMD_WRITE_TO_EEPROM, 0, 0, "write EEPROM"}, /* 30 */ {TOOL_CMD_GET_PLATFORM_TEMP, 0, 0, "query current platform temperature"}, /* 31 */ {TOOL_CMD_SET_PLATFORM_TEMP, 0, 0, "set platform target temperature"}, /* 32 */ {TOOL_CMD_GET_SP, 0, 0, "query extruder target temperature"}, /* 33 */ {TOOL_CMD_GET_PLATFORM_SP, 0, 0, "query platform target temperature"}, /* 34 */ {TOOL_CMD_GET_BUILD_NAME, 0, 0, "query build name"}, /* 35 */ {TOOL_CMD_IS_PLATFORM_READY, 0, -1, "query platform ready"}, /* 36 */ {TOOL_CMD_GET_TOOL_STATUS, 0, 0, "query tool status"}, /* 37 */ {TOOL_CMD_GET_PID_STATE, 0, 0, "query PID state"}, /* 40 */ {TOOL_CMD_LIGHT_INDICATOR_LED, 0, -1, "set LED state"} }; static s3g_command_info_t command_table[256]; static s3g_command_info_t tool_command_table[256]; // Not thread safe static int tables_initialized = 0; static int s3g_init(void) { int i, istat; const s3g_command_info_t *p; if (tables_initialized != 0) return(0); // Initialize the indexed command tables memset(command_table, 0, sizeof(command_table)); memset(tool_command_table, 0, sizeof(tool_command_table)); // Force all unrecognized commands to be blocking for (i = 0; i < 256; i++) { command_table[i].cmd_blocking = -1; tool_command_table[i].cmd_blocking = -1; } istat = 0; p = command_table_raw; // Load the indexed command table, looking for conflicts for (i = 0; i < sizeof(command_table_raw) / sizeof(s3g_command_info_t); i++, p++) { if ((command_table[p->cmd_id].cmd_len != 0 || command_table[p->cmd_id].cmd_desc != NULL)) { // Table already has an entry for this command id // Make sure that the lengths don't conflict if (command_table[p->cmd_id].cmd_len != p->cmd_len) { fprintf(stderr, "s3g_init(%d): Two commands with identical ids (%d) but " "different lengths encountered; ignoring \"%s\"\n", __LINE__, p->cmd_id, p->cmd_desc ? p->cmd_desc : ""); istat = -1; continue; } } command_table[p->cmd_id].cmd_id = p->cmd_id; command_table[p->cmd_id].cmd_len = p->cmd_len; command_table[p->cmd_id].cmd_desc = p->cmd_desc; command_table[p->cmd_id].cmd_blocking = p->cmd_blocking; } p = tool_command_table_raw; // Load the indexed command table, looking for conflicts for (i = 0; i < sizeof(tool_command_table_raw) / sizeof(s3g_command_info_t); i++, p++) { if ((tool_command_table[p->cmd_id].cmd_len != 0 || tool_command_table[p->cmd_id].cmd_desc != NULL)) { // Table already has an entry for this command id // Make sure that the lengths don't conflict if (tool_command_table[p->cmd_id].cmd_len != p->cmd_len) { fprintf(stderr, "s3g_init(%d): Two tool commands with identical ids (%d) but " "different lengths encountered; ignoring \"%s\"\n", __LINE__, p->cmd_id, p->cmd_desc ? p->cmd_desc : ""); istat = -1; continue; } } tool_command_table[p->cmd_id].cmd_id = p->cmd_id; tool_command_table[p->cmd_id].cmd_len = p->cmd_len; tool_command_table[p->cmd_id].cmd_desc = p->cmd_desc; tool_command_table[p->cmd_id].cmd_blocking = p->cmd_blocking; } tables_initialized = -1; return(istat); } s3g_context_t *s3g_open(int type, const char *src, int flags, int mode) { s3g_context_t *ctx; (void)type; // Only type is a file ctx = (s3g_context_t *)calloc(1, sizeof(s3g_context_t)); if (!ctx) { fprintf(stderr, "s3g_open(%d): Unable to allocate VM; %s (%d)\n", __LINE__, strerror(errno), errno); return(NULL); } if (s3g_stdio_open(ctx, src, flags, mode)) return(NULL); return(ctx); } int s3g_close(s3g_context_t *ctx) { int iret; if (!ctx) return(0); iret = (ctx->close != NULL) ? (*ctx->close)(ctx->r_ctx) : 0; free(ctx); return(iret); } int s3g_command_isblocking(s3g_command_t *cmd) { if (!cmd) // Bad call: claim the worst case which is blocking true; return(-1); if (cmd->cmd_id != HOST_CMD_TOOL_COMMAND) return (command_table[cmd->cmd_id].cmd_blocking); else return(tool_command_table[cmd->t.tool.subcmd_id].cmd_blocking); } int s3g_command_read_ext(s3g_context_t *ctx, s3g_command_t *cmd, unsigned char *buf, size_t maxbuf, size_t *buflen) { unsigned char *buf0 = buf; ssize_t bytes_expected, bytes_read; s3g_command_info_t *ct; s3g_command_t dummy; foo_16_t f16; foo_32_t f32; int iret; uint8_t ui8arg; iret = -1; if (buflen) *buflen = 0; // We have to have a read context // We don't need a command context to return the command in if (!ctx || !buf || maxbuf == 0) { fprintf(stderr, "s3g_command_get(%d): Invalid call; ctx=%p, buf=%p, " "maxbuf=%lu\n", __LINE__, (void *)ctx, (void *)buf, (unsigned long)maxbuf); errno = EINVAL; return(-1); } else if (!ctx->read) { fprintf(stderr, "s3g_command_get(%d): Invalid context; " "ctx->read=NULL\n", __LINE__); errno = EINVAL; return(-1); } else if (!buf || maxbuf == 0) { fprintf(stderr, "s3g_command_get(%d): Invalid context; " "ctx->read=NULL\n", __LINE__); errno = EINVAL; return(-1); } // Initialize command table s3g_init(); if (1 != (bytes_expected = (*ctx->read)(ctx->r_ctx, buf0, maxbuf, 1))) { // End of file condition? if (bytes_expected == 0) return(1); // EOF fprintf(stderr, "s3g_command_get(%d): Error while reading from the s3g file; " "%s (%d)\n", __LINE__, strerror(errno), errno); return(-1); } ct = command_table + buf0[0]; // &command_table[buf0[0]] buf += 1; maxbuf -= 1; if (!cmd) cmd = &dummy; cmd->cmd_id = ct->cmd_id; cmd->cmd_desc = ct->cmd_desc; cmd->cmd_len = ct->cmd_len; cmd->cmd_raw_len = 0; if (ct->cmd_desc == NULL) { fprintf(stderr, "s3g_command_get(%d): Unrecognized command, %d\n", __LINE__, buf0[0]); goto done; } #define GET_INT32(v) \ if (maxbuf < 4) goto trunc; \ if (4 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 4))) \ goto io_error; \ memcpy(&f32.u.c, buf, 4); \ buf += bytes_read; \ maxbuf -= bytes_read; \ f32.u.u = le32toh(f32.u.u); \ cmd->t.v = f32.u.i #define GET_UINT32(v) \ if (maxbuf < 4) goto trunc; \ if (4 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 4))) \ goto io_error; \ memcpy(&f32.u.c, buf, 4); \ buf += bytes_read; \ maxbuf -= bytes_read; \ cmd->t.v = le32toh(f32.u.u) #define GET_FLOAT32(v) \ if (maxbuf < 4) goto trunc; \ if (4 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 4))) \ goto io_error; \ memcpy(&f32.u.c, buf, 4); \ buf += bytes_read; \ maxbuf -= bytes_read; \ f32.u.u = le32toh(f32.u.u); \ cmd->t.v = f32.u.f; #define GET_UINT8(v) \ if (maxbuf < 1) goto trunc; \ if (1 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 1))) \ goto io_error; \ ui8arg = buf[0]; \ buf += bytes_read; \ maxbuf -= bytes_read; \ cmd->t.v = ui8arg #define GET_INT16(v) \ if (maxbuf < 2) goto trunc; \ if (2 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 2))) \ goto io_error; \ memcpy(&f16.u.c, buf, 2); \ buf += bytes_read; \ maxbuf -= bytes_read; \ f16.u.u = le16toh(f16.u.u); \ cmd->t.v = f16.u.i #define GET_UINT16(v) \ if (maxbuf < 2) goto trunc; \ if (2 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 2))) \ goto io_error; \ memcpy(&f16.u.c, buf, 2); \ buf += bytes_read; \ maxbuf -= bytes_read; \ cmd->t.v = le16toh(f16.u.u) #define ZERO(v,c) cmd->t.v = (c)0 switch(cmd->cmd_id) { case HOST_CMD_DELAY : GET_UINT32(delay.millis); break; case HOST_CMD_FIND_AXES_MINIMUM : case HOST_CMD_FIND_AXES_MAXIMUM : GET_UINT8(find_axes_minmax.flags); GET_UINT32(find_axes_minmax.feedrate); GET_UINT16(find_axes_minmax.timeout); break; case HOST_CMD_WAIT_FOR_TOOL : GET_UINT8(wait_for_tool.index); GET_UINT16(wait_for_tool.ping_delay); GET_UINT16(wait_for_tool.timeout); break; case HOST_CMD_WAIT_FOR_PLATFORM : GET_UINT8(wait_for_platform.index); GET_UINT16(wait_for_platform.ping_delay); GET_UINT16(wait_for_platform.timeout); break; case HOST_CMD_STORE_HOME_POSITION : GET_UINT8(store_home_position.axes); break; case HOST_CMD_RECALL_HOME_POSITION : GET_UINT8(recall_home_position.axes); break; default : // Just read the data bytes_expected = (ssize_t)(ct->cmd_len & 0x7fffffff); if ((bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, ct->cmd_len)) != bytes_expected) goto io_error; buf += bytes_read; maxbuf -= bytes_read; break; case HOST_CMD_TOOL_COMMAND : // This command is VERY MBI specific if ((ssize_t)3 != (*ctx->read)(ctx->r_ctx, buf, maxbuf, 3)) goto io_error; if (cmd) cmd->cmd_len = (size_t)buf[2]; cmd->t.tool.subcmd_id = buf[1]; cmd->t.tool.index = buf[0]; cmd->t.tool.subcmd_len = bytes_expected = (ssize_t)buf[2]; if ((bytes_read = (*ctx->read)(ctx->r_ctx, buf + 3, maxbuf - 3, (size_t)buf[2])) != bytes_expected) goto io_error; if (cmd->t.tool.subcmd_len == 1) cmd->t.tool.subcmd_value = (uint16_t)buf[3]; else if (cmd->t.tool.subcmd_len > 1) { memcpy((void *)&cmd->t.tool.subcmd_value, buf + 3, sizeof(uint16_t)); cmd->t.tool.subcmd_value = le16toh(cmd->t.tool.subcmd_value); } else cmd->t.tool.subcmd_value = 0; maxbuf -= 3 + bytes_read; buf += 3 + bytes_read; cmd->t.tool.subcmd_desc = tool_command_table[cmd->t.tool.subcmd_id].cmd_desc; if (cmd->t.tool.subcmd_desc == NULL) cmd->t.tool.subcmd_desc = "unknown tool subcommand"; break; case HOST_CMD_SET_POSITION_EXT : // x4, y4, z4, a4, b4 = 20 bytes GET_INT32(set_position_ext.x); GET_INT32(set_position_ext.y); GET_INT32(set_position_ext.z); GET_INT32(set_position_ext.a); GET_INT32(set_position_ext.b); break; case HOST_CMD_QUEUE_POINT_EXT : // x4, y4, z4, a4, b4, dda4 = 24 bytes GET_INT32(queue_point_ext.x); GET_INT32(queue_point_ext.y); GET_INT32(queue_point_ext.z); GET_INT32(queue_point_ext.a); GET_INT32(queue_point_ext.b); GET_INT32(queue_point_ext.dda); ZERO(queue_point_ext.dummy_rel, uint8_t); ZERO(queue_point_ext.dummy_distance, float); ZERO(queue_point_ext.dummy_feedrate_mult_64, uint16_t); break; case HOST_CMD_QUEUE_POINT_NEW : // x4, y4, z4, a4, b4, us4, relative = 25 bytes GET_INT32(queue_point_new.x); GET_INT32(queue_point_new.y); GET_INT32(queue_point_new.z); GET_INT32(queue_point_new.a); GET_INT32(queue_point_new.b); GET_INT32(queue_point_new.us); GET_UINT8(queue_point_new.rel); ZERO(queue_point_ext.dummy_distance, float); ZERO(queue_point_ext.dummy_feedrate_mult_64, uint16_t); break; case HOST_CMD_QUEUE_POINT_NEW_EXT : // x4, y4, z4, a4, b4, dda_rate4, relative, distance 4, feedrate_mult64 2 = 31 bytes GET_INT32(queue_point_new_ext.x); GET_INT32(queue_point_new_ext.y); GET_INT32(queue_point_new_ext.z); GET_INT32(queue_point_new_ext.a); GET_INT32(queue_point_new_ext.b); GET_INT32(queue_point_new_ext.dda_rate); GET_UINT8(queue_point_new_ext.rel); GET_FLOAT32(queue_point_new_ext.distance); GET_INT16(queue_point_new_ext.feedrate_mult_64); break; case HOST_CMD_SET_POT_VALUE : GET_UINT8(digi_pot.axis); GET_UINT8(digi_pot.value); break; case HOST_CMD_SET_RGB_LED : GET_UINT8(rgb_led.red); GET_UINT8(rgb_led.green); GET_UINT8(rgb_led.blue); GET_UINT8(rgb_led.blink_rate); GET_UINT8(rgb_led.effect); break; case HOST_CMD_SET_BEEP : GET_UINT16(beep.frequency); GET_UINT16(beep.duration); GET_UINT8(beep.effect); break; case HOST_CMD_PAUSE_FOR_BUTTON : GET_UINT8(button_pause.mask); GET_UINT16(button_pause.timeout); GET_UINT8(button_pause.timeout_behavior); break; case HOST_CMD_DISPLAY_MESSAGE : GET_UINT8(display_message.options); GET_UINT8(display_message.x); GET_UINT8(display_message.y); GET_UINT8(display_message.timeout); cmd->t.display_message.message_len = 0; if (maxbuf < 1) goto trunc; for (;;) { unsigned char uc; if (1 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 1))) goto io_error; uc = buf[0]; ++buf; --maxbuf; if (uc == '\0') break; if (cmd->t.display_message.message_len < (sizeof(cmd->t.display_message.message) - 1)) cmd->t.display_message.message[cmd->t.display_message.message_len++] = uc; if (maxbuf < 1) goto trunc; } cmd->t.display_message.message[cmd->t.display_message.message_len] = '\0'; break; case HOST_CMD_SET_BUILD_PERCENT : GET_UINT8(build_percentage.percentage); GET_UINT8(build_percentage.reserved); break; case HOST_CMD_QUEUE_SONG : GET_UINT8(queue_song.song_id); break; case HOST_CMD_RESET_TO_FACTORY : GET_UINT8(factory_reset.options); break; case HOST_CMD_BUILD_START_NOTIFICATION : GET_INT32(build_start.steps); cmd->t.build_start.message_len = 0; if (maxbuf < 1) goto trunc; for (;;) { unsigned char uc; if (1 != (bytes_read = (*ctx->read)(ctx->r_ctx, buf, maxbuf, 1))) goto io_error; uc = buf[0]; ++buf; --maxbuf; if (uc == '\0') break; if (cmd->t.build_start.message_len < (sizeof(cmd->t.build_start.message) - 1)) cmd->t.build_start.message[cmd->t.build_start.message_len++] = uc; } cmd->t.build_start.message[cmd->t.build_start.message_len] = '\0'; break; case HOST_CMD_BUILD_END_NOTIFICATION : GET_UINT8(build_end.flags); break; case HOST_CMD_CHANGE_TOOL : GET_UINT8(change_tool.index); break; case HOST_CMD_ENABLE_AXES : GET_UINT8(enable_axes.axes); break; case HOST_CMD_SET_ACCELERATION_TOGGLE: GET_UINT8(set_segment_acceleration.s); break; case HOST_CMD_STREAM_VERSION: GET_UINT8(x3g_version.version_high); GET_UINT8(x3g_version.version_low); GET_UINT8(x3g_version.reserved1); GET_UINT32(x3g_version.reserved2); GET_UINT16(x3g_version.bot_type); GET_UINT16(x3g_version.reserved3); GET_UINT32(x3g_version.reserved4); GET_UINT32(x3g_version.reserved5); GET_UINT8(x3g_version.reserved6); break; case HOST_CMD_PAUSE_AT_ZPOS: GET_FLOAT32(pause_at_zpos.zpos); break; } #undef ZERO #undef GET_UINT8 #undef GET_INT32 iret = 0; goto done; io_error: fprintf(stderr, "s3g_command_get(%d): Error while reading from the s3g file; " "%s (%d)\n", __LINE__, strerror(errno), errno); iret = -1; goto done; trunc: fprintf(stderr, "s3g_command_get(%d): Caller supplied read buffer is too small", __LINE__); iret = -1; done: cmd->cmd_raw_len = (size_t)(buf - buf0); if (buflen) *buflen = cmd->cmd_raw_len; return(iret); } static void writef(s3g_context_t *ctx, const char *fmt, ...) { va_list ap; va_start(ap, fmt); if (ctx && ctx->write) { char buf[4096]; vsnprintf(buf, sizeof(buf), fmt, ap); (*ctx->write)(ctx->w_ctx, (unsigned char *)buf, strlen(buf)); } else vfprintf(stdout, fmt, ap); va_end(ap); } int s3g_command_read(s3g_context_t *ctx, s3g_command_t *cmd) { if (cmd) return(s3g_command_read_ext(ctx, cmd, cmd->cmd_raw, sizeof(cmd->cmd_raw), NULL)); else { unsigned char buf[128]; return(s3g_command_read_ext(ctx, cmd, buf, sizeof(buf), NULL)); } } static const char *bot_type(uint16_t btype, char *buf, size_t maxbuf) { char tmpbuf[32]; if (!buf || !maxbuf) { buf = tmpbuf; maxbuf = sizeof(tmpbuf); } if (btype == 0xD314) snprintf(buf, maxbuf, "Replicator 1"); else if (btype == 0xB015) snprintf(buf, maxbuf, "Replicator 2"); else snprintf(buf, maxbuf, "Unknown"); return(buf); } static const char *axes_mask(uint8_t flags, char *buf, size_t maxbuf, int isEnable) { #define CAT(x) \ { if (buf[0]) strncat(buf, ", ", maxbuf); \ strncat(buf, (x), maxbuf); } if (!buf || !maxbuf) return(NULL); buf[0] = '\0'; if (isEnable) strncat(buf, (flags & 0x80) ? "+" : "-", maxbuf); if (flags != (uint8_t)0) { if (flags & 0x01) CAT("X"); if (flags & 0x02) CAT("Y"); if (flags & 0x04) CAT("Z"); if (flags & 0x08) CAT("A"); if (flags & 0x10) CAT("B"); } else strncat(buf, "", maxbuf); return(buf); #undef CAT } static const char *axes_names(uint8_t axis, char *buf, size_t maxbuf) { static const char *names[] = {"X", "Y", "Z", "A", "B"}; if (!buf || !maxbuf) return(NULL); if (axis <= (sizeof(names)/sizeof(const char *))) strncpy(buf, names[axis], maxbuf); else snprintf(buf, maxbuf, "unknown %hhu", axis); return(buf); } int s3g_add_writer(s3g_context_t *ctx, s3g_write_proc_t *wproc, void *wctx) { if (!ctx) return(-1); ctx->write = wproc; ctx->w_ctx = wctx; return(0); } void s3g_command_display(s3g_context_t *ctx, s3g_command_t *cmd) { char buf[64]; const char *fmt; #define F(v) (cmd->t.v) writef(ctx, "(%d) ", cmd->cmd_id); switch(cmd->cmd_id) { default : writef(ctx, "%s", cmd->cmd_desc); break; case HOST_CMD_DELAY : writef(ctx, "Dwell for %u milliseconds\n", F(delay.millis)); break; case HOST_CMD_FIND_AXES_MINIMUM : writef(ctx, "Home minimum on %s, feedrate %u us/step, timeout %hu s\n", axes_mask(F(find_axes_minmax.flags), buf, sizeof(buf), 0), F(find_axes_minmax.feedrate), F(find_axes_minmax.timeout)); break; case HOST_CMD_FIND_AXES_MAXIMUM : writef(ctx, "Home maximum on %s, feedrate %u us/step, timeout %hu s\n", axes_mask(F(find_axes_minmax.flags), buf, sizeof(buf), 0), F(find_axes_minmax.feedrate), F(find_axes_minmax.timeout)); break; case HOST_CMD_WAIT_FOR_TOOL : writef(ctx, "Wait until Tool %hhu is ready, %hu ms between polls, " "%hu s timeout\n", F(wait_for_tool.index), F(wait_for_tool.ping_delay), F(wait_for_tool.timeout)); break; case HOST_CMD_WAIT_FOR_PLATFORM : writef(ctx, "Wait until platform %hhu is ready, %hu ms between polls, " "%hu s timeout\n", F(wait_for_tool.index), F(wait_for_tool.ping_delay), F(wait_for_tool.timeout)); break; case HOST_CMD_STORE_HOME_POSITION : writef(ctx, "Store home position for %s\n", axes_mask(F(store_home_position.axes), buf, sizeof(buf), 0)); break; case HOST_CMD_RECALL_HOME_POSITION : writef(ctx, "Recall home position for %s\n", axes_mask(F(recall_home_position.axes), buf, sizeof(buf), 0)); break; case HOST_CMD_TOOL_COMMAND : switch (cmd->t.tool.subcmd_id) { case TOOL_CMD_SET_TEMP : fmt = "Set target temperature to %hu C\n"; break; case TOOL_CMD_SET_PLATFORM_TEMP : fmt = "Set build platform temperature to %hu C\n"; break; case TOOL_CMD_SET_MOTOR_1_PWM : fmt = "Set Motor 1 speed (PWM) to %hu\n"; break; case TOOL_CMD_TOGGLE_MOTOR_1 : fmt = "Toggle Motor 1 to %hu\n"; break; case TOOL_CMD_TOGGLE_VALVE : fmt = "Toggle blower fan %hu\n"; break; default : fmt = NULL; break; } writef(ctx, "Tool %hhu: (%hhu) ", cmd->t.tool.index, cmd->t.tool.subcmd_id); if (fmt) writef(ctx, fmt, cmd->t.tool.subcmd_value); else writef(ctx, "Tool command %hhu for tool %hhu, value %hu\n", cmd->t.tool.subcmd_id, cmd->t.tool.index, cmd->t.tool.subcmd_value); break; case HOST_CMD_SET_POSITION_EXT : writef(ctx, "Define position as (%d, %d, %d, %d, %d)\n", F(set_position_ext.x), F(set_position_ext.y), F(set_position_ext.z), F(set_position_ext.a), F(set_position_ext.b)); break; case HOST_CMD_QUEUE_POINT_EXT : writef(ctx, "Absolute move to (%d, %d, %d, %d, %d) with DDA %d\n", F(queue_point_ext.x), F(queue_point_ext.y), F(queue_point_ext.z), F(queue_point_ext.a), F(queue_point_ext.b), F(queue_point_ext.dda)); break; case HOST_CMD_QUEUE_POINT_NEW : writef(ctx, "Move to (%d, %d, %d, %d, %d) in %d us, %s relative\n", F(queue_point_new.x), F(queue_point_new.y), F(queue_point_new.z), F(queue_point_new.a), F(queue_point_new.b), F(queue_point_new.us), axes_mask(F(queue_point_new.rel), buf, sizeof(buf), 0)); break; case HOST_CMD_QUEUE_POINT_NEW_EXT : writef(ctx, "Move to (%d, %d, %d, %d, %d), DDA rate %d, %s relative, " "distance %f mm, feedrate*64 %d steps/s\n", F(queue_point_new_ext.x), F(queue_point_new_ext.y), F(queue_point_new_ext.z), F(queue_point_new_ext.a), F(queue_point_new_ext.b), F(queue_point_new_ext.dda_rate), axes_mask(F(queue_point_new_ext.rel), buf, sizeof(buf), 0), F(queue_point_new_ext.distance), F(queue_point_new_ext.feedrate_mult_64)); break; case HOST_CMD_SET_POT_VALUE : writef(ctx, "Set %s axis digipot to %hhu\n", axes_names(F(digi_pot.axis), buf, sizeof(buf)), F(digi_pot.value)); break; case HOST_CMD_SET_RGB_LED : writef(ctx, "Set RGB LED (0x%02hhx, 0x%02hhx, 0x%02hhx), " "blink rate %hhu, effect %hhu\n", F(rgb_led.red), F(rgb_led.green), F(rgb_led.blue), F(rgb_led.blink_rate), F(rgb_led.effect)); break; case HOST_CMD_SET_BEEP : writef(ctx, "Set buzzer frequency %hu, duration %hu ms, " "effect %hhu\n", F(beep.frequency), F(beep.duration), F(beep.effect)); break; case HOST_CMD_PAUSE_FOR_BUTTON : writef(ctx, "Pause for button 0x%02hhx, timeout %hu s, " "timeout behavior %hhu\n", F(button_pause.mask), F(button_pause.timeout), F(button_pause.timeout_behavior)); break; case HOST_CMD_DISPLAY_MESSAGE : writef(ctx, "Display message, options 0x%02x, position " "(%hhu, %hhu), timeout %hhu s, message \"%.*s\"\n", F(display_message.options), F(display_message.x), F(display_message.y), F(display_message.timeout), F(display_message.message_len), F(display_message.message)); break; case HOST_CMD_SET_BUILD_PERCENT : writef(ctx, "Set build percentage %hhu%%, reserved %hhu\n", F(build_percentage.percentage), F(build_percentage.reserved)); break; case HOST_CMD_QUEUE_SONG : writef(ctx, "Queue song %hhu\n", F(queue_song.song_id)); break; case HOST_CMD_RESET_TO_FACTORY : writef(ctx, "Restore factory defaults, options 0x%02hhx\n", F(factory_reset.options)); break; case HOST_CMD_BUILD_START_NOTIFICATION : writef(ctx, "Start build notification, steps %d, name \"%.*s\"\n", F(build_start.steps), F(build_start.message_len), F(build_start.message)); break; case HOST_CMD_BUILD_END_NOTIFICATION : writef(ctx, "End build notification, options 0x%02hhx\n", F(build_end.flags)); break; case HOST_CMD_CHANGE_TOOL : writef(ctx, "Switch to Tool %hhu\n", F(change_tool.index)); break; case HOST_CMD_ENABLE_AXES : writef(ctx, "%s %s stepper motors\n", (F(enable_axes.axes) & 0x80) ? "Enable" : "Disable", axes_mask(F(enable_axes.axes), buf, sizeof(buf), 0)); break; case HOST_CMD_SET_ACCELERATION_TOGGLE: writef(ctx, "Set segment acceleration %s\n", (F(set_segment_acceleration.s)) ? "on" : "off"); break; case HOST_CMD_STREAM_VERSION: writef(ctx, "Stream version %hhu.%hhu, bot type %s (0x%04hx)\n", F(x3g_version.version_high), F(x3g_version.version_low), bot_type(F(x3g_version.bot_type), buf, sizeof(buf)), F(x3g_version.bot_type)); break; case HOST_CMD_PAUSE_AT_ZPOS: writef(ctx, "Pause @ Z position %f\n", F(pause_at_zpos.zpos)); break; } } int s3g_command_write(s3g_context_t *ctx, s3g_command_t *cmd) { if (!ctx || !cmd || !ctx->write) { errno = EINVAL; return(-1); } if (cmd->cmd_raw_len == 0) return(0); if ((ssize_t)cmd->cmd_raw_len == (*ctx->write)(ctx->w_ctx, cmd->cmd_raw, cmd->cmd_raw_len)) return(0); return(-1); } GPX-2.5.2/src/shared/s3g.h000066400000000000000000000257071271205255700151010ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // s3g.h // Structure and routine definitions for the s3g library #ifndef S3G_H_ #define S3G_H_ #include #include "s3g_commands.h" #ifdef __cplusplus extern "C" { #endif #ifndef S3G_CONTEXT_T_ #define S3G_CONTEXT_T_ typedef void s3g_context_t; #endif // s3g_queue_point_abs, s3g_queue_point_ext, and s3g_queue_point_new // all have the same size, packing and layout. They can be cast to // one another and the relevant fields extracted. The dummy_ fields // will be set to zero when appropriate. typedef struct { int32_t x; int32_t y; int32_t z; int32_t dummy_a; int32_t dummy_b; int32_t dda; uint8_t dummy_rel; float dummy_distance; uint16_t dummy_feedrate_mult_64; } s3g_queue_point_abs; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; int32_t b; int32_t dda; uint8_t dummy_rel; float dummy_distance; uint16_t dummy_feedrate_mult_64; } s3g_queue_point_ext; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; int32_t b; int32_t dda_rate; uint8_t rel; float distance; uint16_t feedrate_mult_64; } s3g_queue_point_new_ext; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; int32_t b; int32_t us; uint8_t rel; float dummy_distance; uint16_t dummy_feedrate_mult_64; } s3g_queue_point_new; typedef struct { uint8_t index; } s3g_change_tool; typedef struct { uint8_t axes; } s3g_enable_axes; typedef struct { int32_t x; int32_t y; int32_t z; } s3g_set_position; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; int32_t b; } s3g_set_position_ext; typedef struct { uint32_t millis; } s3g_delay; typedef struct { uint8_t flags; uint32_t feedrate; // microseconds per step uint16_t timeout; // seconds } s3g_find_axes_minmax; typedef struct { uint8_t index; uint16_t ping_delay; uint16_t timeout; } s3g_wait_for_tool; typedef struct { uint8_t index; uint16_t ping_delay; uint16_t timeout; } s3g_wait_for_platform; typedef struct { uint8_t axes; } s3g_store_home_position; typedef struct { uint8_t axes; } s3g_recall_home_position; typedef struct { uint8_t index; uint8_t subcmd_id; size_t subcmd_len; const char *subcmd_desc; uint16_t subcmd_value; } s3g_tool; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; } s3g_set_max_accel; typedef struct { int32_t x; int32_t y; int32_t z; int32_t a; } s3g_set_max_feedrate; typedef struct { int32_t s; int32_t t; } s3g_set_default_accel; typedef struct { int32_t s; int32_t t; int32_t x; int32_t z; } s3g_set_advanced_accel; typedef struct { int32_t d; } s3g_set_filament_diameter; typedef struct { int32_t s; int32_t k; } s3g_set_advance_k; typedef struct { int32_t a; } s3g_set_extruder_stepsmm; typedef struct { uint8_t s; } s3g_set_segment_acceleration; typedef struct { int32_t r; int32_t g; int32_t b; int32_t fade_speed; int32_t write_to_eeprom; } s3g_mood_set_rgb; typedef struct { int32_t h; int32_t s; int32_t b; int32_t write_to_eeprom; } s3g_mood_set_hsb; typedef struct { int32_t script_id; int32_t write_to_eeprom; } s3g_mood_play_script; typedef struct { uint8_t repeats; } s3g_buzzer_repeats; typedef struct { uint8_t buzzes; uint8_t duration; uint8_t repeats; } s3g_buzzer_buzz; typedef struct { int64_t x; // int32_t * 10000 int64_t y; // int32_t * 10000 int64_t z; // int32_t * 10000 int64_t a; // int32_t * 10000 } s3g_set_axis_steps_mm; typedef struct { uint8_t axis; uint8_t value; } s3g_set_pot_value; typedef struct { uint8_t red; uint8_t green; uint8_t blue; uint8_t blink_rate; uint8_t effect; } s3g_set_rgb_led; typedef struct { uint16_t frequency; uint16_t duration; uint8_t effect; } s3g_set_beep; typedef struct { uint8_t mask; uint16_t timeout; uint8_t timeout_behavior; } s3g_pause_for_button; typedef struct { uint8_t options; uint8_t x; uint8_t y; uint8_t timeout; uint8_t message_len; unsigned char message[64]; } s3g_display_message; typedef struct { uint8_t percentage; uint8_t reserved; } s3g_set_build_percent; typedef struct { uint8_t song_id; } s3g_queue_song; typedef struct { uint8_t options; } s3g_reset_to_factory; typedef struct { uint32_t steps; uint8_t message_len; unsigned char message[64]; } s3g_build_start_notification; typedef struct { uint8_t flags; } s3g_build_end_notification; typedef struct { uint8_t version_high; uint8_t version_low; uint8_t reserved1; uint32_t reserved2; uint16_t bot_type; uint16_t reserved3; uint32_t reserved4; uint32_t reserved5; uint8_t reserved6; } s3g_stream_version; typedef struct { float zpos; } s3g_pause_at_zpos; // s3g_command_t // An individual command read from a .s3g file is stored in // this data structure. You need to know from the command id // which member of the union to look at. #define MAX_S3G_CMD_LEN 32 // #define constants from the command ids are available in Commands.hh typedef struct { uint8_t cmd_id; size_t cmd_len; const char *cmd_desc; size_t cmd_raw_len; unsigned char cmd_raw[MAX_S3G_CMD_LEN]; union { s3g_queue_point_abs queue_point_abs; s3g_queue_point_ext queue_point_ext; s3g_queue_point_new queue_point_new; s3g_queue_point_new_ext queue_point_new_ext; s3g_change_tool change_tool; s3g_enable_axes enable_axes; s3g_set_position set_position; s3g_set_position_ext set_position_ext; s3g_delay delay; s3g_find_axes_minmax find_axes_minmax; s3g_wait_for_tool wait_for_tool; s3g_wait_for_platform wait_for_platform; s3g_store_home_position store_home_position; s3g_recall_home_position recall_home_position; s3g_tool tool; s3g_set_max_accel set_max_accel; s3g_set_max_feedrate set_max_feedrate; s3g_set_default_accel set_default_accel; s3g_set_advanced_accel set_advanced_accel; s3g_set_filament_diameter set_filament_diameter; s3g_set_advance_k set_advance_k; s3g_set_extruder_stepsmm set_extruder_stepsmm; s3g_set_segment_acceleration set_segment_acceleration; s3g_mood_set_rgb mood_set_rgb; s3g_mood_set_hsb mood_set_hsb; s3g_mood_play_script mood_play_script; s3g_buzzer_repeats buzzer_repeats; s3g_buzzer_buzz buzzer_buzz; s3g_set_axis_steps_mm set_axis_steps_mm; s3g_set_pot_value digi_pot; s3g_set_rgb_led rgb_led; s3g_set_beep beep; s3g_pause_for_button button_pause; s3g_display_message display_message; s3g_set_build_percent build_percentage; s3g_queue_song queue_song; s3g_reset_to_factory factory_reset; s3g_build_start_notification build_start; s3g_build_end_notification build_end; s3g_stream_version x3g_version; s3g_pause_at_zpos pause_at_zpos; } t; } s3g_command_t; #define S3G_INPUT_TYPE_FILE 0 // stdin or a named disk file // Obtain an s3g_context for an input source of type S3G_INPUT_TYPE_. // The context returned must be disposed of by calling s3g_close(). // // Call arguments: // // int type // Input source type. Must be one of // // S3G_INPUT_TYPE_FILE // // void *src // Input source information for the selected input type // // S3G_INPUT_TYPE_FILE -- const char *filename or NULL for stdin // // Return values: // // != NULL -- Success // == NULL -- Error; consult errno s3g_context_t *s3g_open(int type, const char *src, int create_file, int mode); // Read a single command from the s3g context, storing the result in the // supplied s3g_command_t structure // // Call arguments: // // s3g_context_t *ctx // Context obtained by calling s3g_open(). // // s3g_command_t *cmd // Pointer to a s3g_command_t structure to store the read command in. If NULL // is passed for this argument, then the command is read but no information about // the command is returned. // // Return values: // // 0 -- Success // 1 -- Unrecognized command encountered; not possible to read further // -1 -- Read error; check errno int s3g_command_read(s3g_context_t *ctx, s3g_command_t *cmd); int s3g_command_read_ext(s3g_context_t *ctx, s3g_command_t *cmd, unsigned char *rawbuf, size_t maxbuf, size_t *len); // Close the s3g input source, releasing any resources // // Call arguments: // // s3g_context_t *ctx // Context obtained by calling s3g_open(). // // Return values: // // 0 -- Success // -1 -- Close error; check errno int s3g_close(s3g_context_t *ctx); #ifndef S3G_PRIVATE_H_ typedef ssize_t s3g_write_proc_t(void *ctx, void *buf, size_t nbytes); #endif int s3g_add_writer(s3g_context_t *ctx, s3g_write_proc_t *wproc, void *wctx); void s3g_command_display(s3g_context_t *ctx, s3g_command_t *cmd); int s3g_command_write(s3g_context_t *ctx, s3g_command_t *cmd); int s3g_command_isblocking(s3g_command_t *cmd); #ifdef __cplusplus } #endif #endif GPX-2.5.2/src/shared/s3g_commands.h000066400000000000000000000112011271205255700167420ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef S3G_COMMANDS_H_ #define S3G_COMMANDS_H_ #ifdef __cplusplus extern "C" { #endif #define HOST_CMD_VERSION 0 #define HOST_CMD_INIT 1 #define HOST_CMD_GET_BUFFER_SIZE 2 #define HOST_CMD_CLEAR_BUFFER 3 #define HOST_CMD_GET_POSITION 4 #define HOST_CMD_ABORT 7 #define HOST_CMD_PAUSE 8 #define HOST_CMD_PROBE 9 #define HOST_CMD_TOOL_QUERY 10 #define HOST_CMD_IS_FINISHED 11 #define HOST_CMD_READ_EEPROM 12 #define HOST_CMD_WRITE_EEPROM 13 #define HOST_CMD_CAPTURE_TO_FILE 14 #define HOST_CMD_END_CAPTURE 15 #define HOST_CMD_PLAYBACK_CAPTURE 16 #define HOST_CMD_RESET 17 #define HOST_CMD_NEXT_FILENAME 18 #define HOST_CMD_GET_DBG_REG 19 #define HOST_CMD_GET_BUILD_NAME 20 #define HOST_CMD_GET_POSITION_EXT 21 #define HOST_CMD_EXTENDED_STOP 22 #define HOST_CMD_BOARD_STATUS 23 #define HOST_CMD_GET_BUILD_STATS 24 #define HOST_CMD_ADVANCED_VERSION 27 #define HOST_CMD_DEBUG_ECHO 112 #define HOST_CMD_FIND_AXES_MINIMUM 131 #define HOST_CMD_FIND_AXES_MAXIMUM 132 #define HOST_CMD_DELAY 133 #define HOST_CMD_CHANGE_TOOL 134 #define HOST_CMD_WAIT_FOR_TOOL 135 #define HOST_CMD_TOOL_COMMAND 136 #define HOST_CMD_ENABLE_AXES 137 #define HOST_CMD_QUEUE_POINT_EXT 139 #define HOST_CMD_SET_POSITION_EXT 140 #define HOST_CMD_WAIT_FOR_PLATFORM 141 #define HOST_CMD_QUEUE_POINT_NEW 142 #define HOST_CMD_STORE_HOME_POSITION 143 #define HOST_CMD_RECALL_HOME_POSITION 144 #define HOST_CMD_SET_POT_VALUE 145 #define HOST_CMD_SET_RGB_LED 146 #define HOST_CMD_SET_BEEP 147 #define HOST_CMD_PAUSE_FOR_BUTTON 148 #define HOST_CMD_DISPLAY_MESSAGE 149 #define HOST_CMD_SET_BUILD_PERCENT 150 #define HOST_CMD_QUEUE_SONG 151 #define HOST_CMD_RESET_TO_FACTORY 152 #define HOST_CMD_BUILD_START_NOTIFICATION 153 #define HOST_CMD_BUILD_END_NOTIFICATION 154 #define HOST_CMD_QUEUE_POINT_NEW_EXT 155 #define HOST_CMD_SET_ACCELERATION_TOGGLE 156 #define HOST_CMD_STREAM_VERSION 157 #define HOST_CMD_PAUSE_AT_ZPOS 158 #define TOOL_CMD_VERSION 0 #define TOOL_CMD_INIT 1 #define TOOL_CMD_GET_TEMP 2 #define TOOL_CMD_SET_TEMP 3 #define TOOL_CMD_SET_MOTOR_1_PWM 4 #define TOOL_CMD_SET_MOTOR_2_PWM 5 #define TOOL_CMD_SET_MOTOR_1_RPM 6 #define TOOL_CMD_SET_MOTOR_2_RPM 7 #define TOOL_CMD_SET_MOTOR_1_DIR 8 #define TOOL_CMD_SET_MOTOR_2_DIR 9 #define TOOL_CMD_TOGGLE_MOTOR_1 10 #define TOOL_CMD_TOGGLE_MOTOR_2 11 #define TOOL_CMD_TOGGLE_FAN 12 #define TOOL_CMD_TOGGLE_VALVE 13 #define TOOL_CMD_SET_SERVO_1_POS 14 #define TOOL_CMD_SET_SERVO_2_POS 15 #define TOOL_CMD_FILAMENT_STATUS 16 #define TOOL_CMD_GET_MOTOR_1_RPM 17 #define TOOL_CMD_GET_MOTOR_2_RPM 18 #define TOOL_CMD_GET_MOTOR_1_PWM 19 #define TOOL_CMD_GET_MOTOR_2_PWM 20 #define TOOL_CMD_SELECT_TOOL 21 #define TOOL_CMD_IS_TOOL_READY 22 #define TOOL_CMD_PAUSE_UNPAUSE 23 #define TOOL_CMD_ABORT 24 #define TOOL_CMD_READ_FROM_EEPROM 25 #define TOOL_CMD_WRITE_TO_EEPROM 26 #define TOOL_CMD_GET_PLATFORM_TEMP 30 #define TOOL_CMD_SET_PLATFORM_TEMP 31 #define TOOL_CMD_GET_SP 32 #define TOOL_CMD_GET_PLATFORM_SP 33 #define TOOL_CMD_GET_BUILD_NAME 34 #define TOOL_CMD_IS_PLATFORM_READY 35 #define TOOL_CMD_GET_TOOL_STATUS 36 #define TOOL_CMD_GET_PID_STATE 37 #define TOOL_CMD_LIGHT_INDICATOR_LED 40 #ifdef __cplusplus } #endif #endif GPX-2.5.2/src/shared/s3g_private.h000066400000000000000000000051371271205255700166260ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // s3g_private.h // Private declarations for the s3g library #ifndef S3G_PRIVATE_H_ #define S3G_PRIVATE_H_ #ifdef __cplusplus extern "C" { #endif // read, write, and close procedure definitions for .s3g file drivers typedef ssize_t s3g_read_proc_t(void *ctx, void *buf, size_t maxbuf, size_t nbytes); typedef ssize_t s3g_write_proc_t(void *ctx, const void *buf, size_t nbytes); typedef int s3g_close_proc_t(void *ctx); // The actual s3g_context_t declaration #ifndef S3G_CONTEXT_T_ #define S3G_CONTEXT_T_ typedef struct { s3g_read_proc_t *read; // File driver read procedure; req'd for reading s3g_write_proc_t *write; // File driver write procedure; req'd for writing s3g_close_proc_t *close; // File driver close procedure; optional void *r_ctx; // File driver private context void *w_ctx; // File driver private context size_t nread; // Bytes read size_t nwritten; // Bytes written } s3g_context_t; #endif // File driver open procedure; no need at present to keep this in the context typedef int s3g_open_proc_t(s3g_context_t *ctx, const char *src, int create_file, int mode); #ifdef __cplusplus } #endif #endif GPX-2.5.2/src/shared/s3g_stdio.c000066400000000000000000000272421271205255700162720ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include #include #include #include #include #include #include "s3g_stdio.h" // Identify temporary read errors // Can be os-specific #if !defined(_WIN32) && !defined(_WIN64) #if defined(ENOSR) #define ERRNO_EQ_ENOSR errno == ENOSR #else #define ERRNO_EQ_ENOSR 0 #endif #define FD_TEMPORARY_ERR() \ (errno == EINTR || errno == ENOMEM || errno == ENOBUFS || ERRNO_EQ_ENOSR) #define FD_WOULDBLOCK_ERR() \ (errno == EWOULDBLOCK || errno == EAGAIN) #else #define FD_TEMPORARY_ERR() \ (errno == EINTR || errno == ENOMEM ) #define FD_WOULDBLOCK_ERR() \ (errno == EAGAIN) #endif // This driver's private context typedef struct { int fd; // File descriptor; < 0 indicates that the file is not open size_t nread; size_t nwritten; } s3g_rw_stdio_ctx_t; // stdio_close // // Close the input source and release the allocated driver context // // Call arguments: // // void *ctx // Private driver context allocated by stdio_open(). // // Return values: // // 0 -- Success // -1 -- Error; check errno may be a close() error which is significant // when writing static s3g_close_proc_t stdio_close; static int stdio_close(void *ctx) { int fd; s3g_rw_stdio_ctx_t *myctx = (s3g_rw_stdio_ctx_t *)ctx; // Sanity check if (!myctx) { errno = EINVAL; return(-1); } fd = myctx->fd; free(myctx); if (fd < 0) { errno = EBADF; return(-1); } return(close(fd)); } // stdio_read_retry // // Read the specified number of bytes into the buffer. Temporary read errors // wil be handled by this routine which will try to read all nbytes unless EOF // is encountered. // // When the end of the file is reached before reading nbytes, the return value, // R, will satisfy 0 <= R < nbytes. // // *** Length checking is not performed on the buffer // *** That is presumed to be done by stdio_read() // // Call arguments: // // int fd // Descriptor of the open file to read from. // // unsigned char *buf // Pointer to a buffer to read the data to. Length of the buffer must be // at least nbytes long. Buffer will NOT be NUL terminated. // // size_t nbytes // The number of bytes to read from the input source. // // Return values: // // > 0 -- Number of bytes read. Guaranteed to be == nbytes UNLESS a // permanent read error occurs or the end of the file is reached. // 0 -- End of file reached (unless nbytes == 0) // -1 -- File error; check errno static ssize_t stdio_read_retry(int fd, void *buf, size_t nbytes) { ssize_t n, nread; // Save read() the bother of this test if (fd < 0) { errno = EBADF; return((ssize_t)-1); } // Repeatedly call until we've read the requested amount of data or gotten // an error which isn't temporary nread = 0; for (;;) { if ((n = read(fd, buf, nbytes)) <= 0 && FD_TEMPORARY_ERR()) continue; if (n == 0) // EOF reached return(nread); nread += n; nbytes -= n; if (nbytes == 0) return(nread); buf += n; } } // stdio_read // // Read the specified number of bytes from the input source, placing at most // maxbuf bytes into the buffer, buf. If nbytes > maxbuf, then nbytes will be // read. However, only the first maxbuf bytes read will be stored in buf. // Note that buf will not be NUL terminated. // // Unless a permanent error occurs, stdio_read() guarantees that nbytes will // actually be read. If less than nbytes is returned, then either an // end-of-file condition occurred or there was a non-temporary read error. // // On return, stdio_read() indicates how many bytes were actually read. // // Call arguments: // // void *ctx // Private driver context created by stdio_open(). // // void *buf // Buffer into which to read the data. At most maxbuf bytes will be // stored in this buffer. Any bytes read beyond maxbuf will be discarded. // That only occurs when nbytes > maxbuf. If buf == NULL, then maxbuf will // be considered 0 and nbytes will be read and discarded. // // size_t maxbuf // Maximum number of bytes to store in buf. Maxbuf must not exceed the // size of the buffer pointed at by buf. // // size_t nbytes // The number of bytes to read from the input source. // // Return values: // // > 0 -- Number of bytes read. If the returned value is less than nbytes, // then an end of file condition has occurred. // 0 -- End of file reached or nbytes == 0 // -1 -- Read error or invalid call arguments; check errno // static s3g_read_proc_t stdio_read; static ssize_t stdio_read(void *ctx, void *buf, size_t maxbuf, size_t nbytes) { s3g_rw_stdio_ctx_t *myctx = (s3g_rw_stdio_ctx_t *)ctx; ssize_t n; // Sanity check if (!myctx) { errno = EINVAL; return((ssize_t)-1); } else if (myctx->fd < 0) { errno = EBADF; return((size_t)-1); } // Return now if nothing to read if (nbytes == 0) return((ssize_t)0); // Treat NULL for buf as though maxbuf == 0 if (!buf) maxbuf = 0; // Buffer is big enough to contain the entire read if (nbytes <= maxbuf) return(stdio_read_retry(myctx->fd, buf, nbytes)); // Buffer is not large enough to contain the entire read if ((n = stdio_read_retry(myctx->fd, buf, maxbuf)) <= 0) return(n); // Read the remaining number of bytes requested without // shoving them into buf (which is full) nbytes -= n; { unsigned char tmpbuf[1024]; size_t nread; while (nbytes != 0) { nread = (sizeof(tmpbuf) < nbytes) ? (size_t)sizeof(tmpbuf) : nbytes; if ((n = stdio_read_retry(myctx->fd, tmpbuf, nread)) <= 0) return(n); // NOTE: stdio_read_retry() guarantees n == nread when n > 0 nbytes -= n; myctx->nread += n; } } return(0); } // stdio_write // // Write the first nbytes from the buffer buf to the underlying file descriptor. // // Unless a permanent error occurs, stdio_write() guarantees that nbytes will // actually be written. If less than nbytes are written, then a permanent // error of some flavor has occurred. // // On return, stdio_write() indicates how many bytes were actually read or // -1 in the event of a permanent error. Check errno for details on any // returned error. // // Call arguments: // // void *ctx // Private driver context created by stdio_open(). // // const void *buf // Buffer of data to write. At most nbytes bytes will be written from // this buffer. Used for input only. // // size_t nbytes // The number of bytes to write from the buffer, buf. Used for input // only. // // Return values: // // > 0 -- Number of bytes written. If the returned value is less than // nbytes, then a permanent error condition has occurred. // 0 -- Nothing written; nbytes == 0 // -1 -- Write error or invalid call arguments supplied; check errno // static s3g_write_proc_t stdio_write; static ssize_t stdio_write(void *ctx, const void *buf, size_t nbytes) { s3g_rw_stdio_ctx_t *myctx = (s3g_rw_stdio_ctx_t *)ctx; ssize_t nwritten; // Sanity check if (!myctx || !buf) { errno = EINVAL; return((ssize_t)-1); } else if (myctx->fd < 0) { errno = EBADF; return((size_t)-1); } // Return now if nothing to read if (nbytes == 0) return((ssize_t)0); // Read the remaining number of bytes requested without // shoving them into buf (which is full) nwritten = 0; while (nbytes) { ssize_t nw; nw = write(myctx->fd, buf, nbytes); if (nw <= 0) { if (FD_WOULDBLOCK_ERR()) continue; return((ssize_t)-1); } nwritten += nw; nbytes -= nw; myctx->nwritten += nw; buf = (const void *)((char *)buf + nw); } return(nwritten); } // s3g_stdio_open // Our public open routine. This is the only public routine for the driver. // // Call arguments // // s3g_context_t *ctx // s3g context to associate ourselves with. // // void *src // Input source information. For this driver, a value of NULL indicates // that the input source is stdin (create_file == 0) or stdout // (create_file != 0). Otherwise, the value is treated as a "const char *" // pointer pointing to the name of a file to open in read only mode. A // ".s3g" will NOT be appended to the file name. The file name must be // the complete file name (but need not be an absolute file path). // // int create_file // If zero, then the file is opened for reading only. If non-zero, the // file is created and opened for writing only. Used for input only. // // int mode // open(2) permission mask, mode, used when creating a new file. Used for // input only. // // Return values: // // 0 -- Success // -1 -- Error; check errno int s3g_stdio_open(s3g_context_t *ctx, const char *src, int create_file, int mode) { s3g_rw_stdio_ctx_t *tmp; // Sanity check if (!ctx) { fprintf(stderr, "s3g_stdio_open(%d): Invalid call; ctx=NULL\n", __LINE__); errno = EINVAL; return(-1); } // Allocate memory for our "driver" context tmp = (s3g_rw_stdio_ctx_t *)calloc(1, sizeof(s3g_rw_stdio_ctx_t)); if (tmp == NULL) { fprintf(stderr, "s3g_open(%d): Unable to allocate VM; %s (%d)\n", __LINE__, strerror(errno), errno); return(-1); } // What sort of input source: named file or stdin? if (src == NULL) { // Assume we're using stdin tmp->fd = create_file ? fileno(stdout) : fileno(stdin); } else { const char *fname = (const char *)src; int oflag = create_file ? O_CREAT | O_WRONLY : O_RDONLY; #ifdef O_BINARY if (!create_file) oflag |= O_BINARY; #endif int fd = open(fname, oflag, mode); if (fd < 0) { fprintf(stderr, "s3g_open(%d): Unable to open the file \"%s\"; " "%s (%d)\n", __LINE__, fname, strerror(errno), errno); free(tmp); return(-1); } tmp->fd = fd; } // All finished and happy ctx->close = stdio_close; ctx->read = stdio_read; ctx->r_ctx = tmp; ctx->write = create_file ? stdio_write : NULL; ctx->w_ctx = create_file ? tmp : NULL; return(0); } GPX-2.5.2/src/shared/s3g_stdio.h000066400000000000000000000032541271205255700162740ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // s3g_stdio.h // Private declarations for the standard unix i/o file driver #ifndef S3G_STDIO_H_ #define S3G_STDIO_H_ #include "s3g_private.h" #ifdef __cplusplus extern "C" { #endif // Driver's open procedure s3g_open_proc_t s3g_stdio_open; #ifdef __cplusplus } #endif #endif GPX-2.5.2/src/shared/sailfish_7_7.h000066400000000000000000000232571271205255700166610ustar00rootroot00000000000000EepromMapping eeprom_map_sailfish_7_7[] = { { "ACCELERATION_ACTIVE", "Acceleration active", "", 0x16e, et_boolean, 0, 0, 1, "Check or set to 1 to use acceleration. Uncheck or set to 0 for no acceleration. Note that you must turn acceleration on to print safely at speeds over 50mm/s." }, { "MAX_ACCELERATION_EXTRUDER_MOVE", "Max acceleration extruder move", "mm/s²", 0x186, et_ushort, 0, 0, 0, "" }, { "MAX_SPEED_CHANGE_X", "Max speed change x", "mm/s", 0x17c, et_ushort, 0, 0, 0, "" }, { "MAX_SPEED_CHANGE_Y", "Max speed change y", "mm/s", 0x17e, et_ushort, 0, 0, 0, "" }, { "MAX_SPEED_CHANGE_Z", "Max speed change z", "mm/s", 0x180, et_ushort, 0, 0, 0, "" }, { "MAX_SPEED_CHANGE_A", "Max speed change a", "mm/s", 0x182, et_ushort, 0, 0, 0, "" }, { "MAX_SPEED_CHANGE_B", "Max speed change b", "mm/s", 0x184, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_AXIS_X", "Max acceleration axis x", "mm/s²", 0x172, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_AXIS_Y", "Max acceleration axis y", "mm/s²", 0x174, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_AXIS_Z", "Max acceleration axis z", "mm/s²", 0x176, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_AXIS_A", "Max acceleration axis a", "mm/s²", 0x178, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_AXIS_B", "Max acceleration axis b", "mm/s²", 0x17a, et_ushort, 0, 0, 0, "" }, { "MAX_ACCELERATION_NORMAL_MOVE", "Max acceleration normal move", "mm/s²", 0x170, et_ushort, 0, 0, 0, "" }, { "EXTRUDER_DEPRIME_ON_TRAVEL", "Extruder deprime on travel", "", 0x20b, et_boolean, 0, 0, 1, "When set, the firmware will deprime the extruder on detected travel moves as well as on pauses, planned or otherwise. When not set, the firmware will only deprime the extruder on pauses, planned or otherwise. Unplanned pauses occur when the acceleration planner falls behind and the printer waits briefly for another segment to print." }, { "ALEVEL_MAX_ZPROBE_HITS", "Alevel max zprobe hits", "", 0xf64, et_byte, 0, 0, 200, "Trigger a pause if the auto-leveling probe registers too many hits during a print. Set to the value 0 to allow an unlimited number of hits without pausing; otherwise, set to a value in the range 1 to 200." }, { "T0_COOLING_SETPOINT_C", "T0 cooling setpoint c", "C", 0x11b, et_byte, 0, 0, 300, "" }, { "T0_COOLING_ENABLE", "T0 cooling enable", "", 0x11a, et_boolean, 0, 0, 1, "" }, { "T0_EXTRUDER_P_TERM", "T0 extruder p term", "", 0x10a, et_fixed, 0, 0, 100, "" }, { "T0_EXTRUDER_I_TERM", "T0 extruder i term", "", 0x10c, et_fixed, 0, 0, 1, "" }, { "T0_EXTRUDER_D_TERM", "T0 extruder d term", "", 0x10e, et_fixed, 0, 0, 100, "" }, { "HBP_P_TERM", "Heatbed p term", "", 0x110, et_fixed, 0, 0, 100, "" }, { "HBP_I_TERM", "T0 extruder i term", "", 0x112, et_fixed, 0, 0, 1, "" }, { "HBP_D_TERM", "T0 extruder d term", "", 0x114, et_fixed, 0, 0, 100, "" }, { "PREHEAT_PREHEAT_RIGHT_TEMP", "Preheat preheat right temp", "C", 0x158, et_ushort, 0, 0, 280, "" }, { "PREHEAT_PREHEAT_PLATFORM_TEMP", "Preheat preheat platform temp", "C", 0x15c, et_ushort, 0, 0, 130, "" }, { "PREHEAT_PREHEAT_LEFT_TEMP", "Preheat preheat left temp", "C", 0x15a, et_ushort, 0, 0, 280, "" }, { "JKN_ADVANCE_K2", "Jkn advance k2", "factor * 100000", 0x1dc, et_ulong, 0, 0, 0, "" }, { "JKN_ADVANCE_K", "Jkn advance k", "factor * 100000", 0x1d8, et_ulong, 0, 0, 0, "" }, { "EXTRUDER_DEPRIME_STEPS_A", "Extruder deprime steps a", "steps", 0x1e0, et_ushort, 0, 0, 0, "" }, { "EXTRUDER_DEPRIME_STEPS_B", "Extruder deprime steps b", "steps", 0x1e2, et_ushort, 0, 0, 0, "" }, { "SLOWDOWN_FLAG", "Slowdown flag", "", 0x1e4, et_boolean, 0, 0, 1, "Check or set to 1 to enable automatic print slowdown when the queue of planned segments is running low. Uncheck or set to 0 to disable automatic slowdown." }, { "COOLING_FAN_DUTY_CYCLE", "Cooling fan duty cycle", "", 0xf63, et_byte, 0, 0, 100, "Set a blower strength (duty cycle) to use for the print cooling fan when it is activated by the print commands. Select a value between 0% (off) and 100% (on full). For example, if your fan is too strong, you may want to set this value to 50 so that the fan operates at 50% strength. If set this value to 0, then the cooling fan will not activate at all when the print commands request it to." }, { "MACHINE_NAME", "Machine name", "", 0x22, et_string, 16, 0, 0, "" }, { "ALEVEL_MAX_ZDELTA", "Alevel max zdelta", "steps", 0xf66, et_long, 0, 0, 0, "The maximum vertical difference between any two probed leveling points may not exceed this value. Default value is 50 steps (0.5 mm)." }, { "PSTOP_ENABLE", "Pstop enable", "", 0xf90, et_boolean, 0, 0, 1, "Check or set to 1 to enable the optional Pause Stop hardware. Set to zero or uncheck to disable. The bot should be power cycled after changing this field." }, { "DITTO_PRINT_ENABLED", "Ditto print enabled", "", 0xfff, et_boolean, 0, 0, 1, "Check or set to 1 to enable ditto printing. Uncheck or set to zero to disable ditto printing." }, { "SD_USE_CRC", "Sd use crc", "", 0xf91, et_boolean, 0, 0, 1, "Check or set to 1 to enable SD card error checkin. Uncheck or set to 0 to disable." }, { "CLEAR_FOR_ESTOP", "Clear for estop", "", 0xf8e, et_boolean, 0, 0, 1, "Check or set to 1 to instruct the printer to clear the build away from the extruder before stopping. Uncheck or set to zero to immediately stop the printer (e.g., perform an Emergency Stop)." }, { "AXIS_HOME_DIRECTION", "Axis home direction", "", 0xc, et_bitfield, 0, 0, 0, "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is homing in the wrong direction, toggle the bit for that axis" }, { "LED_LED_HEAT", "Led led heat", "", 0x142, et_byte, 0, 1, 0, "" }, { "LED_BASIC_COLOR", "Led basic color", "", 0x140, et_byte, 0, 0, 10, "" }, { "LED_CUSTOM_COLOR_R", "Led custom color r", "RGB", 0x144, et_byte, 0, 0, 0, "" }, { "LED_CUSTOM_COLOR_G", "Led custom color g", "RGB", 0x145, et_byte, 0, 0, 0, "" }, { "LED_CUSTOM_COLOR_B", "Led custom color b", "RGB", 0x146, et_byte, 0, 0, 0, "" }, { "AXIS_HOME_POSITIONS_STEPS_X", "Axis home positions steps x", "steps", 0xe, et_ulong, 0, 0, 0, "" }, { "AXIS_HOME_POSITIONS_STEPS_Y", "Axis home positions steps y", "steps", 0x12, et_ulong, 0, 0, 0, "" }, { "AXIS_HOME_POSITIONS_STEPS_Z", "Axis home positions steps z", "steps", 0x16, et_ulong, 0, 0, 0, "" }, { "AXIS_HOME_POSITIONS_STEPS_A", "Axis home positions steps a", "steps", 0x1a, et_ulong, 0, 0, 0, "" }, { "AXIS_HOME_POSITIONS_STEPS_B", "Axis home positions steps b", "steps", 0x1e, et_ulong, 0, 0, 0, "" }, { "AXIS_STEPS_PER_MM_X", "Axis steps per mm x", "1,000,000 * steps/mm", 0x1a4, et_ulong, 0, 0, 0, "" }, { "AXIS_STEPS_PER_MM_Y", "Axis steps per mm y", "1,000,000 * steps/mm", 0x1a8, et_ulong, 0, 0, 0, "" }, { "AXIS_STEPS_PER_MM_Z", "Axis steps per mm z", "1,000,000 * steps/mm", 0x1ac, et_ulong, 0, 0, 0, "" }, { "AXIS_STEPS_PER_MM_A", "Axis steps per mm a", "1,000,000 * steps/mm", 0x1b0, et_ulong, 0, 0, 0, "" }, { "AXIS_STEPS_PER_MM_B", "Axis steps per mm b", "1,000,000 * steps/mm", 0x1b4, et_ulong, 0, 0, 0, "" }, { "OVERRIDE_GCODE_TEMP", "Override gcode temp", "", 0xffd, et_boolean, 0, 0, 1, "Check or set to 1 to override non-zero gcode temperature settings with the pre-heat temperature settings. Uncheck or set to zero to honor temperature settings in the gcode." }, { "ENDSTOP_INVERSION", "Endstop inversion", "", 0x4, et_bitfield, 0, 0, 0, "" }, { "TOOL_COUNT", "Tool count", "", 0x42, et_byte, 0, 1, 2, "" }, { "T1_COOLING_SETPOINT_C", "T1 cooling setpoint c", "C", 0x137, et_byte, 0, 0, 300, "" }, { "T1_COOLING_ENABLE", "T1 cooling enable", "", 0x136, et_boolean, 0, 0, 1, "" }, { "T1_EXTRUDER_P_TERM", "T1 extruder p term", "", 0x126, et_fixed, 0, 0, 100, "" }, { "T1_EXTRUDER_I_TERM", "T1 extruder i term", "", 0x128, et_fixed, 0, 0, 1, "" }, { "T1_EXTRUDER_D_TERM", "T1 extruder d term", "", 0x12a, et_fixed, 0, 0, 100, "" }, { "BUZZ_SOUND_ON", "Buzz sound on", "", 0x14a, et_boolean, 0, 0, 1, "Check or set to 1 to play bot sounds. Uncheck or set to 0 for no sounds." }, { "HEAT_DURING_PAUSE", "Heat during pause", "", 0xffe, et_boolean, 0, 0, 1, "Check or set to 1 to leave heaters enabled for up to 30 minutes while the bot is pasued. Uncheck or set to zero to disable the heaters upon entering a paused state." }, { "AXIS_INVERSION", "Axis inversion", "", 0x2, et_bitfield, 0, 0, 0, "A Bitfield representing the XYZAB axes, with X as bit 0. If an axis is moving in the wrong direction, toggle the bit for that axis" }, { "DIGI_POT_SETTINGS_0", "Digi pot settings 0", "scale(1-118)", 0x6, et_byte, 0, 0, 0, "" }, { "DIGI_POT_SETTINGS_1", "Digi pot settings 0", "scale(1-118)", 0x7, et_byte, 0, 0, 0, "" }, { "DIGI_POT_SETTINGS_2", "Digi pot settings 0", "scale(1-118)", 0x8, et_byte, 0, 0, 0, "" }, { "DIGI_POT_SETTINGS_3", "Digi pot settings 0", "scale(1-118)", 0x9, et_byte, 0, 0, 0, "" }, { "DIGI_POT_SETTINGS_4", "Digi pot settings 0", "scale(1-118)", 0xa, et_byte, 0, 0, 0, "" }, { "HBP_PRESENT", "Hbp present", "", 0x4c, et_boolean, 0, 0, 1, "Check or set to 1 if this machine has a heated build platform; otherwise, uncheck or set to 0 if it does not. The bot should be power cycled after changing this field." }, { "TOOLHEAD_OFFSET_SYSTEM", "Toolhead offset system", "", 0xf93, et_boolean, 0, 0, 1, "Check to use the NEW dualstrusion system. Uncheck to use the old (RepG 39 and earlier) dualstrusion system. The bot should be power cycled after changing this field." }, { "TOOLHEAD_OFFSET_SETTINGS_X", "Toolhead offset settings x", "steps", 0x162, et_long, 0, -2000, 20000, "" }, { "TOOLHEAD_OFFSET_SETTINGS_Y", "Toolhead offset settings y", "steps", 0x166, et_long, 0, -2000, 20000, "" }, { "EXTRUDER_HOLD", "Extruder hold", "", 0xf92, et_boolean, 0, 0, 1, "Check or set to 1 to enable the Extruder Hold feature. Uncheck or set to 0 to disable." }, }; GPX-2.5.2/src/shared/std_eeprommaps.h000066400000000000000000000030571271205255700174210ustar00rootroot00000000000000// // std_eeprommaps.h // // Created by WHPThomas on 1/04/13. // Copyright (c) 2013 WHPThomas, All rights reserved. // // Updates 2015 by Dan Newman, // and Mark Walker, // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __std_eeprommaps_h__ #define __std_eeprommaps_h__ #include "eeprominfo.h" #include "sailfish_7_7.h" EepromMap eepromMaps[] = { { 707, 708, 0x80, eeprom_map_sailfish_7_7, (sizeof(eeprom_map_sailfish_7_7) / sizeof(EepromMapping)) }, }; #define eepromMapCount (sizeof(eepromMaps) / sizeof(EepromMap)) #endif // __std_eeprommaps_h__ GPX-2.5.2/src/shared/std_machines.h000077500000000000000000000342071271205255700170440ustar00rootroot00000000000000// // std_machines.h // // Created by WHPThomas on 1/04/13. // Copyright (c) 2013 WHPThomas, All rights reserved. // // Updates 2015 by Dan Newman, // // gpx references ReplicatorG sources from /src/replicatorg/drivers // which are part of the ReplicatorG project - http://www.replicat.org // Copyright (c) 2008 Zach Smith // and Makerbot4GSailfish.java Copyright (C) 2012 Jetty / Dan Newman // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software Foundation, // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef __std_machines_h__ #define __std_machines_h__ #include "machine.h" static Machine cupcake_G3 = { "c3", "Cupcake Gen3 XYZ, Mk5/6 + Gen4 Extruder", 0, 0, {9600, 500, 30, 500, 100, 11.767463, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 100, 11.767463, ENDSTOP_IS_MIN}, // y axis {450, 100, 25, 450, 100, 320, ENDSTOP_IS_MIN}, // z axis {7200, 1000, 30, 50.235478806907409, 400, 1}, // a extruder {7200, 1000, 30, 50.235478806907409, 400, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0085, 0.0090}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CUPCAKE_G3 }; static Machine cupcake_G4 = { "c4", "Cupcake Gen4 XYZ, Mk5/6 + Gen4 Extruder", 0, 0, {9600, 500, 30, 500, 100, 47.069852, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 100, 47.069852, ENDSTOP_IS_MIN}, // y axis {450, 100, 25, 450, 100, 1280, ENDSTOP_IS_MIN}, // z axis {7200, 1000, 30, 50.235478806907409, 400, 1}, // a extruder {7200, 1000, 30, 50.235478806907409, 400, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0085, 0.0090}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CUPCAKE_G4 }; static Machine cupcake_P4 = { "cp4", "Cupcake Pololu XYZ, Mk5/6 + Gen4 Extruder", 0, 0, {9600, 500, 30, 500, 100, 94.13970462, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 100, 94.13970462, ENDSTOP_IS_MIN}, // y axis {450, 100, 25, 450, 100, 2560, ENDSTOP_IS_MIN}, // z axis {7200, 1000, 30, 50.235478806907409, 400, 1}, // a extruder {7200, 1000, 30, 50.235478806907409, 400, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0085, 0.0090}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CUPCAKE_P4 }; static Machine cupcake_PP = { "cpp", "Cupcake Pololu XYZ, Mk5/6 + Pololu Extruder", 0, 0, {9600, 500, 30, 500, 100, 47.069852, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 100, 47.069852, ENDSTOP_IS_MIN}, // y axis {450, 100, 25, 450, 100, 1280, ENDSTOP_IS_MIN}, // z axis {7200, 1000, 30, 100.470957613814818, 400, 1}, // a extruder {7200, 1000, 30, 100.470957613814818, 400, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0085, 0.0090}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CUPCAKE_PP }; static Machine thing_o_matic_6 = { "t6", "TOM Mk6 - single extruder", 0, 0, {9600, 500, 30, 500, 106, 47.058824, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 120, 47.058824, ENDSTOP_IS_MIN}, // y axis {1000, 150, 10, 500, 106, 200, ENDSTOP_IS_MAX}, // z axis {1600, 1000, 30, 50.235478806907409, 1600, 1}, // a extruder {1600, 1000, 30, 50.235478806907409, 1600, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0070, 0.0040}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_THINGOMATIC_6 }; static Machine thing_o_matic_7 = { "t7", "TOM Mk7 - single extruder", 0, 0, {9600, 500, 30, 500, 106, 47.058824, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 120, 47.058824, ENDSTOP_IS_MIN}, // y axis {1000, 150, 10, 500, 106, 200, ENDSTOP_IS_MAX}, // z axis {1600, 1000, 30, 50.235478806907409, 1600, 1}, // a extruder {1600, 1000, 30, 50.235478806907409, 1600, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0070, 0.0040}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_THINGOMATIC_7 }; static Machine thing_o_matic_7D = { "t7d", "TOM Mk7 - dual extruder", 0, 0, {9600, 500, 30, 500, 106, 47.058824, ENDSTOP_IS_MIN}, // x axis {9600, 500, 30, 500, 120, 47.058824, ENDSTOP_IS_MIN}, // y axis {1000, 150, 10, 500, 106, 200, ENDSTOP_IS_MAX}, // z axis {1600, 1000, 30, 50.235478806907409, 1600, 1}, // a extruder {1600, 1000, 30, 50.235478806907409, 1600, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0070, 0.0040}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_THINGOMATIC_7D }; static Machine replicator_1 = { "r1", "Replicator 1 - single extruder", 0, 0, {18000, 1000, 15, 2500, 227, 94.117647, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 148, 94.117647, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 150, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_1 }; static Machine replicator_1D = { "r1d", "Replicator 1 - dual extruder", 0, 0, {18000, 1000, 15, 2500, 227, 94.117647, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 148, 94.117647, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 150, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_1D }; static Machine replicator_2 = { "r2", "Replicator 2 (default)", 0, 0, {18000, 1000, 15, 2500, 285, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 0}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 0}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2 }; static Machine replicator_2H = { "r2h", "Replicator 2 with HBP", 0, 0, {18000, 1000, 15, 2500, 285, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2H }; static Machine replicator_2X = { "r2x", "Replicator 2X", 0, 0, {18000, 1000, 15, 2500, 246, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 152, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 155, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {35, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_REPLICATOR_2X }; // Core-XY machine, 18 tooth GT2 timing pulleys for X and Y static Machine core_xy = { "cxy", "Core-XY with HBP - single extruder", 0, 0, {18000, 1000, 15, 2500, 200, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 200, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 200, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CORE_XY }; // Core-XY machine with a slow Z axis ("sz"), 18T GT2 pulleys for X and Y static Machine core_xysz = { "cxysz", "Core-XY with HBP - single extruder, slow Z", 0, 0, {18000, 1000, 15, 2500, 200, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 200, 88.888889, ENDSTOP_IS_MAX}, // y axis {600, 150, 10, 600, 200, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.85, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CORE_XYSZ }; // ZYYX 3D printer, single extruder, 18T GT2 pulleys for X and Y static Machine zyyx = { "z", "ZYYX - single extruder", 0, 0, {18000, 850, 12, 2500, 270, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 850, 12, 2500, 230, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 50, 12, 1100, 195, 400, ENDSTOP_IS_MIN}, // z axis {1600, 5000, 100, 96.275201870333662468889989185642, 3200, 0}, // a extruder {1600, 5000, 100, 96.275201870333662468889989185642, 3200, 0}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_ZYYX }; // ZYYX 3D printer, dual extruders, 18T GT2 pulleys for X and Y static Machine zyyx_D = { "zd", "ZYYX - dual extruder", 0, 0, {18000, 850, 12, 2500, 270, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 850, 12, 2500, 230, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 50, 12, 1100, 195, 400, ENDSTOP_IS_MIN}, // z axis {1600, 5000, 100, 96.275201870333662468889989185642, 3200, 0}, // a extruder {1600, 5000, 100, 96.275201870333662468889989185642, 3200, 0}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_ZYYX_D }; static Machine clone_r1 = { "cr1", "Clone R1 Single with HBP", 0, 0, {18000, 1000, 15, 2500, 300, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 195, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 210, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {0, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 1, // extruder count 20, // timeout MACHINE_TYPE_CLONE_R1 }; static Machine clone_r1d = { "cr1d", "Clone R1 Dual with HBP", 0, 0, {18000, 1000, 15, 2500, 280, 88.888889, ENDSTOP_IS_MAX}, // x axis {18000, 1000, 15, 2500, 195, 88.888889, ENDSTOP_IS_MAX}, // y axis {1170, 150, 10, 1100, 210, 400, ENDSTOP_IS_MIN}, // z axis {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // a extruder {1600, 2000, 20, 96.275201870333662468889989185642, 3200, 1}, // b extruder 1.75, // nominal filament diameter 0.97, // nominal packing density 0.4, // nozzle diameter {33, 0, 0}, // toolhead offsets {0.0050, 0.0550}, // JKN 2, // extruder count 20, // timeout MACHINE_TYPE_CLONE_R1D }; #if defined(MACHINE_ARRAY) static Machine *machines[] = { &cupcake_G3, &cupcake_G4, &cupcake_P4, &cupcake_PP, &core_xy, &core_xysz, &clone_r1, &clone_r1d, &replicator_1, &replicator_1D, &replicator_2, &replicator_2H, &replicator_2X, &thing_o_matic_6, &thing_o_matic_7, &thing_o_matic_7D, &zyyx, &zyyx_D, NULL }; #endif #ifdef MACHINE_ALIAS_ARRAY // FlashForge Creator Pro static MachineAlias fcp = { "fcp", "r1d", "FlashForge Creator Pro" }; static MachineAlias *machine_aliases[] = { &fcp, NULL }; #endif #endif GPX-2.5.2/src/utils/000077500000000000000000000000001271205255700141135ustar00rootroot00000000000000GPX-2.5.2/src/utils/Makefile.am000066400000000000000000000016561271205255700161570ustar00rootroot00000000000000# Build GPX utilities # Dan Newman, February 2015 AM_CPPFLAGS = -Wall -I$(top_srcdir)/src/shared MACHINEDIR = $(top_builddir)/machine_inis GPXDIR = $(top_srcdir)/src/gpx # if we're cross-compiling, we're depending on an earlier build=host build # being installed and available if CROSS_COMPILING MACHINES = machines MACHINES_PROGRAM = else MACHINES = $(builddir)/machines$(EXEEXT) MACHINES_PROGRAM = $(MACHINES) endif bin_PROGRAMS = s3gdump machines EXTRA_DIST = $(MACHINEDIR) s3gdump_SOURCES = s3gdump.c ../shared/s3g.c ../shared/s3g_stdio.c machines_SOURCES = machines.c ../shared/opt.c ../shared/machine_config.c $(MACHINEDIR): $(MACHINES_PROGRAM) @$(MKDIR_P) $(MACHINEDIR) @$(MACHINES) $(MACHINEDIR)/ if HAVE_DIFF test-local: $(builddir)/s3gdump$(EXEEXT) $(builddir)/s3gdump$(EXEEXT) $(GPXDIR)/tests/lint.x3g > $(builddir)/lint.txt 2>&1 $(DIFF) $(GPXDIR)/tests/lint.txt $(builddir)/lint.txt # -@$(RM) $(builddir)/lint.txt endif GPX-2.5.2/src/utils/Makefile.in000066400000000000000000000500141271205255700161600ustar00rootroot00000000000000# Makefile.in generated by automake 1.15 from Makefile.am. # @configure_input@ # Copyright (C) 1994-2014 Free Software Foundation, Inc. # This Makefile.in is free software; the Free Software Foundation # gives unlimited permission to copy and/or distribute it, # with or without modifications, as long as this notice is preserved. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY, to the extent permitted by law; without # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @SET_MAKE@ # Build GPX utilities # Dan Newman, February 2015 VPATH = @srcdir@ am__is_gnu_make = { \ if test -z '$(MAKELEVEL)'; then \ false; \ elif test -n '$(MAKE_HOST)'; then \ true; \ elif test -n '$(MAKE_VERSION)' && test -n '$(CURDIR)'; then \ true; \ else \ false; \ fi; \ } am__make_running_with_option = \ case $${target_option-} in \ ?) ;; \ *) echo "am__make_running_with_option: internal error: invalid" \ "target option '$${target_option-}' specified" >&2; \ exit 1;; \ esac; \ has_opt=no; \ sane_makeflags=$$MAKEFLAGS; \ if $(am__is_gnu_make); then \ sane_makeflags=$$MFLAGS; \ else \ case $$MAKEFLAGS in \ *\\[\ \ ]*) \ bs=\\; \ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \ esac; \ fi; \ skip_next=no; \ strip_trailopt () \ { \ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \ }; \ for flg in $$sane_makeflags; do \ test $$skip_next = yes && { skip_next=no; continue; }; \ case $$flg in \ *=*|--*) continue;; \ -*I) strip_trailopt 'I'; skip_next=yes;; \ -*I?*) strip_trailopt 'I';; \ -*O) strip_trailopt 'O'; skip_next=yes;; \ -*O?*) strip_trailopt 'O';; \ -*l) strip_trailopt 'l'; skip_next=yes;; \ -*l?*) strip_trailopt 'l';; \ -[dEDm]) skip_next=yes;; \ -[JT]) skip_next=yes;; \ esac; \ case $$flg in \ *$$target_option*) has_opt=yes; break;; \ esac; \ done; \ test $$has_opt = yes am__make_dryrun = (target_option=n; $(am__make_running_with_option)) am__make_keepgoing = (target_option=k; $(am__make_running_with_option)) pkgdatadir = $(datadir)/@PACKAGE@ pkgincludedir = $(includedir)/@PACKAGE@ pkglibdir = $(libdir)/@PACKAGE@ pkglibexecdir = $(libexecdir)/@PACKAGE@ am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd install_sh_DATA = $(install_sh) -c -m 644 install_sh_PROGRAM = $(install_sh) -c install_sh_SCRIPT = $(install_sh) -c INSTALL_HEADER = $(INSTALL_DATA) transform = $(program_transform_name) NORMAL_INSTALL = : PRE_INSTALL = : POST_INSTALL = : NORMAL_UNINSTALL = : PRE_UNINSTALL = : POST_UNINSTALL = : build_triplet = @build@ host_triplet = @host@ bin_PROGRAMS = s3gdump$(EXEEXT) machines$(EXEEXT) subdir = src/utils ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 am__aclocal_m4_deps = $(top_srcdir)/configure.ac am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \ $(ACLOCAL_M4) DIST_COMMON = $(srcdir)/Makefile.am $(am__DIST_COMMON) mkinstalldirs = $(install_sh) -d CONFIG_HEADER = $(top_builddir)/src/shared/config.h CONFIG_CLEAN_FILES = CONFIG_CLEAN_VPATH_FILES = am__installdirs = "$(DESTDIR)$(bindir)" PROGRAMS = $(bin_PROGRAMS) am__dirstamp = $(am__leading_dot)dirstamp am_machines_OBJECTS = machines.$(OBJEXT) ../shared/opt.$(OBJEXT) \ ../shared/machine_config.$(OBJEXT) machines_OBJECTS = $(am_machines_OBJECTS) machines_LDADD = $(LDADD) am_s3gdump_OBJECTS = s3gdump.$(OBJEXT) ../shared/s3g.$(OBJEXT) \ ../shared/s3g_stdio.$(OBJEXT) s3gdump_OBJECTS = $(am_s3gdump_OBJECTS) s3gdump_LDADD = $(LDADD) AM_V_P = $(am__v_P_@AM_V@) am__v_P_ = $(am__v_P_@AM_DEFAULT_V@) am__v_P_0 = false am__v_P_1 = : AM_V_GEN = $(am__v_GEN_@AM_V@) am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@) am__v_GEN_0 = @echo " GEN " $@; am__v_GEN_1 = AM_V_at = $(am__v_at_@AM_V@) am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/src/shared depcomp = $(SHELL) $(top_srcdir)/build-aux/depcomp am__depfiles_maybe = depfiles am__mv = mv -f COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \ $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS) AM_V_CC = $(am__v_CC_@AM_V@) am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@) am__v_CC_0 = @echo " CC " $@; am__v_CC_1 = CCLD = $(CC) LINK = $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@ AM_V_CCLD = $(am__v_CCLD_@AM_V@) am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@) am__v_CCLD_0 = @echo " CCLD " $@; am__v_CCLD_1 = SOURCES = $(machines_SOURCES) $(s3gdump_SOURCES) DIST_SOURCES = $(machines_SOURCES) $(s3gdump_SOURCES) am__can_run_installinfo = \ case $$AM_UPDATE_INFO_DIR in \ n|no|NO) false;; \ *) (install-info --version) >/dev/null 2>&1;; \ esac am__extra_recursive_targets = test-recursive am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) $(LISP) # Read a list of newline-separated strings from the standard input, # and print each of them once, without duplicates. Input order is # *not* preserved. am__uniquify_input = $(AWK) '\ BEGIN { nonempty = 0; } \ { items[$$0] = 1; nonempty = 1; } \ END { if (nonempty) { for (i in items) print i; }; } \ ' # Make sure the list of sources is unique. This is necessary because, # e.g., the same source file might be shared among _SOURCES variables # for different programs/libraries. am__define_uniq_tagged_files = \ list='$(am__tagged_files)'; \ unique=`for i in $$list; do \ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \ done | $(am__uniquify_input)` ETAGS = etags CTAGS = ctags am__DIST_COMMON = $(srcdir)/Makefile.in \ $(top_srcdir)/build-aux/depcomp DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) ACLOCAL = @ACLOCAL@ AMTAR = @AMTAR@ AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@ AUTOCONF = @AUTOCONF@ AUTOHEADER = @AUTOHEADER@ AUTOMAKE = @AUTOMAKE@ AWK = @AWK@ BDIST_TARGET = @BDIST_TARGET@ CC = @CC@ CCDEPMODE = @CCDEPMODE@ CFLAGS = @CFLAGS@ CPP = @CPP@ CPPFLAGS = @CPPFLAGS@ CREATEDMG = @CREATEDMG@ CYGPATH_W = @CYGPATH_W@ DEFS = @DEFS@ DEPDIR = @DEPDIR@ DIFF = @DIFF@ ECHO_C = @ECHO_C@ ECHO_N = @ECHO_N@ ECHO_T = @ECHO_T@ EGREP = @EGREP@ EXEEXT = @EXEEXT@ GREP = @GREP@ INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@ LDFLAGS = @LDFLAGS@ LIBOBJS = @LIBOBJS@ LIBS = @LIBS@ LTLIBOBJS = @LTLIBOBJS@ MAINT = @MAINT@ MAKEINFO = @MAKEINFO@ MKDIR_P = @MKDIR_P@ OBJEXT = @OBJEXT@ PACKAGE = @PACKAGE@ PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@ PACKAGE_NAME = @PACKAGE_NAME@ PACKAGE_STRING = @PACKAGE_STRING@ PACKAGE_TARNAME = @PACKAGE_TARNAME@ PACKAGE_URL = @PACKAGE_URL@ PACKAGE_VERSION = @PACKAGE_VERSION@ PATH_SEPARATOR = @PATH_SEPARATOR@ PLATFORM = @PLATFORM@ POW_LIB = @POW_LIB@ PYTHON = @PYTHON@ SET_MAKE = @SET_MAKE@ SHELL = @SHELL@ SIGNOSX = @SIGNOSX@ STRIP = @STRIP@ VERSION = @VERSION@ abs_builddir = @abs_builddir@ abs_srcdir = @abs_srcdir@ abs_top_builddir = @abs_top_builddir@ abs_top_srcdir = @abs_top_srcdir@ ac_ct_CC = @ac_ct_CC@ am__include = @am__include@ am__leading_dot = @am__leading_dot@ am__quote = @am__quote@ am__tar = @am__tar@ am__untar = @am__untar@ bindir = @bindir@ build = @build@ build_alias = @build_alias@ build_cpu = @build_cpu@ build_os = @build_os@ build_vendor = @build_vendor@ builddir = @builddir@ datadir = @datadir@ datarootdir = @datarootdir@ docdir = @docdir@ dvidir = @dvidir@ exec_prefix = @exec_prefix@ host = @host@ host_alias = @host_alias@ host_cpu = @host_cpu@ host_os = @host_os@ host_vendor = @host_vendor@ htmldir = @htmldir@ includedir = @includedir@ infodir = @infodir@ install_sh = @install_sh@ libdir = @libdir@ libexecdir = @libexecdir@ localedir = @localedir@ localstatedir = @localstatedir@ mandir = @mandir@ mkdir_p = @mkdir_p@ oldincludedir = @oldincludedir@ pdfdir = @pdfdir@ prefix = @prefix@ program_transform_name = @program_transform_name@ psdir = @psdir@ runstatedir = @runstatedir@ sbindir = @sbindir@ sharedstatedir = @sharedstatedir@ srcdir = @srcdir@ sysconfdir = @sysconfdir@ target_alias = @target_alias@ top_build_prefix = @top_build_prefix@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ AM_CPPFLAGS = -Wall -I$(top_srcdir)/src/shared MACHINEDIR = $(top_builddir)/machine_inis GPXDIR = $(top_srcdir)/src/gpx @CROSS_COMPILING_FALSE@MACHINES = $(builddir)/machines$(EXEEXT) # if we're cross-compiling, we're depending on an earlier build=host build # being installed and available @CROSS_COMPILING_TRUE@MACHINES = machines @CROSS_COMPILING_FALSE@MACHINES_PROGRAM = $(MACHINES) @CROSS_COMPILING_TRUE@MACHINES_PROGRAM = EXTRA_DIST = $(MACHINEDIR) s3gdump_SOURCES = s3gdump.c ../shared/s3g.c ../shared/s3g_stdio.c machines_SOURCES = machines.c ../shared/opt.c ../shared/machine_config.c all: all-am .SUFFIXES: .SUFFIXES: .c .o .obj $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps) @for dep in $?; do \ case '$(am__configure_deps)' in \ *$$dep*) \ ( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \ && { if test -f $@; then exit 0; else break; fi; }; \ exit 1;; \ esac; \ done; \ echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign src/utils/Makefile'; \ $(am__cd) $(top_srcdir) && \ $(AUTOMAKE) --foreign src/utils/Makefile Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status @case '$?' in \ *config.status*) \ cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \ *) \ echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \ cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \ esac; $(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps) cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh $(am__aclocal_m4_deps): install-binPROGRAMS: $(bin_PROGRAMS) @$(NORMAL_INSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ if test -n "$$list"; then \ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \ fi; \ for p in $$list; do echo "$$p $$p"; done | \ sed 's/$(EXEEXT)$$//' | \ while read p p1; do if test -f $$p \ ; then echo "$$p"; echo "$$p"; else :; fi; \ done | \ sed -e 'p;s,.*/,,;n;h' \ -e 's|.*|.|' \ -e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \ sed 'N;N;N;s,\n, ,g' | \ $(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \ { d=$$3; if (dirs[d] != 1) { print "d", d; dirs[d] = 1 } \ if ($$2 == $$4) files[d] = files[d] " " $$1; \ else { print "f", $$3 "/" $$4, $$1; } } \ END { for (d in files) print "f", d, files[d] }' | \ while read type dir files; do \ if test "$$dir" = .; then dir=; else dir=/$$dir; fi; \ test -z "$$files" || { \ echo " $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files '$(DESTDIR)$(bindir)$$dir'"; \ $(INSTALL_PROGRAM_ENV) $(INSTALL_PROGRAM) $$files "$(DESTDIR)$(bindir)$$dir" || exit $$?; \ } \ ; done uninstall-binPROGRAMS: @$(NORMAL_UNINSTALL) @list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \ files=`for p in $$list; do echo "$$p"; done | \ sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \ -e 's/$$/$(EXEEXT)/' \ `; \ test -n "$$list" || exit 0; \ echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \ cd "$(DESTDIR)$(bindir)" && rm -f $$files clean-binPROGRAMS: -test -z "$(bin_PROGRAMS)" || rm -f $(bin_PROGRAMS) ../shared/$(am__dirstamp): @$(MKDIR_P) ../shared @: > ../shared/$(am__dirstamp) ../shared/$(DEPDIR)/$(am__dirstamp): @$(MKDIR_P) ../shared/$(DEPDIR) @: > ../shared/$(DEPDIR)/$(am__dirstamp) ../shared/opt.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) ../shared/machine_config.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) machines$(EXEEXT): $(machines_OBJECTS) $(machines_DEPENDENCIES) $(EXTRA_machines_DEPENDENCIES) @rm -f machines$(EXEEXT) $(AM_V_CCLD)$(LINK) $(machines_OBJECTS) $(machines_LDADD) $(LIBS) ../shared/s3g.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) ../shared/s3g_stdio.$(OBJEXT): ../shared/$(am__dirstamp) \ ../shared/$(DEPDIR)/$(am__dirstamp) s3gdump$(EXEEXT): $(s3gdump_OBJECTS) $(s3gdump_DEPENDENCIES) $(EXTRA_s3gdump_DEPENDENCIES) @rm -f s3gdump$(EXEEXT) $(AM_V_CCLD)$(LINK) $(s3gdump_OBJECTS) $(s3gdump_LDADD) $(LIBS) mostlyclean-compile: -rm -f *.$(OBJEXT) -rm -f ../shared/*.$(OBJEXT) distclean-compile: -rm -f *.tab.c @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/machine_config.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/opt.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/s3g.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@../shared/$(DEPDIR)/s3g_stdio.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/machines.Po@am__quote@ @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/s3gdump.Po@am__quote@ .c.o: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $< .c.obj: @am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\ @am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\ @am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po @AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@ @AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@ @am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'` test-local: ID: $(am__tagged_files) $(am__define_uniq_tagged_files); mkid -fID $$unique tags: tags-am TAGS: tags tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) set x; \ here=`pwd`; \ $(am__define_uniq_tagged_files); \ shift; \ if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \ test -n "$$unique" || unique=$$empty_fix; \ if test $$# -gt 0; then \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ "$$@" $$unique; \ else \ $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \ $$unique; \ fi; \ fi ctags: ctags-am CTAGS: ctags ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files) $(am__define_uniq_tagged_files); \ test -z "$(CTAGS_ARGS)$$unique" \ || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \ $$unique GTAGS: here=`$(am__cd) $(top_builddir) && pwd` \ && $(am__cd) $(top_srcdir) \ && gtags -i $(GTAGS_ARGS) "$$here" cscopelist: cscopelist-am cscopelist-am: $(am__tagged_files) list='$(am__tagged_files)'; \ case "$(srcdir)" in \ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \ *) sdir=$(subdir)/$(srcdir) ;; \ esac; \ for i in $$list; do \ if test -f "$$i"; then \ echo "$(subdir)/$$i"; \ else \ echo "$$sdir/$$i"; \ fi; \ done >> $(top_builddir)/cscope.files distclean-tags: -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags distdir: $(DISTFILES) @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \ list='$(DISTFILES)'; \ dist_files=`for file in $$list; do echo $$file; done | \ sed -e "s|^$$srcdirstrip/||;t" \ -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \ case $$dist_files in \ */*) $(MKDIR_P) `echo "$$dist_files" | \ sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \ sort -u` ;; \ esac; \ for file in $$dist_files; do \ if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \ if test -d $$d/$$file; then \ dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \ if test -d "$(distdir)/$$file"; then \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \ cp -fpR $(srcdir)/$$file "$(distdir)$$dir" || exit 1; \ find "$(distdir)/$$file" -type d ! -perm -700 -exec chmod u+rwx {} \;; \ fi; \ cp -fpR $$d/$$file "$(distdir)$$dir" || exit 1; \ else \ test -f "$(distdir)/$$file" \ || cp -p $$d/$$file "$(distdir)/$$file" \ || exit 1; \ fi; \ done check-am: all-am check: check-am all-am: Makefile $(PROGRAMS) installdirs: for dir in "$(DESTDIR)$(bindir)"; do \ test -z "$$dir" || $(MKDIR_P) "$$dir"; \ done install: install-am install-exec: install-exec-am install-data: install-data-am uninstall: uninstall-am install-am: all-am @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am installcheck: installcheck-am install-strip: if test -z '$(STRIP)'; then \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ install; \ else \ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \ fi mostlyclean-generic: clean-generic: distclean-generic: -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES) -test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES) -rm -f ../shared/$(DEPDIR)/$(am__dirstamp) -rm -f ../shared/$(am__dirstamp) maintainer-clean-generic: @echo "This command is intended for maintainers to use" @echo "it deletes files that may require special tools to rebuild." @HAVE_DIFF_FALSE@test-local: clean: clean-am clean-am: clean-binPROGRAMS clean-generic mostlyclean-am distclean: distclean-am -rm -rf ../shared/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile distclean-am: clean-am distclean-compile distclean-generic \ distclean-tags dvi: dvi-am dvi-am: html: html-am html-am: info: info-am info-am: install-data-am: install-dvi: install-dvi-am install-dvi-am: install-exec-am: install-binPROGRAMS install-html: install-html-am install-html-am: install-info: install-info-am install-info-am: install-man: install-pdf: install-pdf-am install-pdf-am: install-ps: install-ps-am install-ps-am: installcheck-am: maintainer-clean: maintainer-clean-am -rm -rf ../shared/$(DEPDIR) ./$(DEPDIR) -rm -f Makefile maintainer-clean-am: distclean-am maintainer-clean-generic mostlyclean: mostlyclean-am mostlyclean-am: mostlyclean-compile mostlyclean-generic pdf: pdf-am pdf-am: ps: ps-am ps-am: test: test-am test-am: test-local uninstall-am: uninstall-binPROGRAMS .MAKE: install-am install-strip .PHONY: CTAGS GTAGS TAGS all all-am check check-am clean \ clean-binPROGRAMS clean-generic cscopelist-am ctags ctags-am \ distclean distclean-compile distclean-generic distclean-tags \ distdir dvi dvi-am html html-am info info-am install \ install-am install-binPROGRAMS install-data install-data-am \ install-dvi install-dvi-am install-exec install-exec-am \ install-html install-html-am install-info install-info-am \ install-man install-pdf install-pdf-am install-ps \ install-ps-am install-strip installcheck installcheck-am \ installdirs maintainer-clean maintainer-clean-generic \ mostlyclean mostlyclean-compile mostlyclean-generic pdf pdf-am \ ps ps-am tags tags-am test-am test-local uninstall \ uninstall-am uninstall-binPROGRAMS .PRECIOUS: Makefile $(MACHINEDIR): $(MACHINES_PROGRAM) @$(MKDIR_P) $(MACHINEDIR) @$(MACHINES) $(MACHINEDIR)/ @HAVE_DIFF_TRUE@test-local: $(builddir)/s3gdump$(EXEEXT) @HAVE_DIFF_TRUE@ $(builddir)/s3gdump$(EXEEXT) $(GPXDIR)/tests/lint.x3g > $(builddir)/lint.txt 2>&1 @HAVE_DIFF_TRUE@ $(DIFF) $(GPXDIR)/tests/lint.txt $(builddir)/lint.txt # -@$(RM) $(builddir)/lint.txt # Tell versions [3.59,3.63) of GNU make to not export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: GPX-2.5.2/src/utils/machines.c000066400000000000000000000070401271205255700160470ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // machines.c // Write an .ini file for each of the built in machines #include #include #include #include #include "config.h" #include "getopt.h" #include "opt.h" #include "machine_config.h" #define MACHINE_ARRAY #include "std_machines.h" #include "classic_machines.h" void usage(void) { printf("machines\n"); printf("Copyright (c) 2015 Dan Newman, All rights reserved.\n"); printf("\nCreate machine definition files (machine.ini) for all the standard\n"); printf("machines built-in to GPX.\n"); printf("\nUsage:\n"); printf("machines [-c] [dir]\n"); printf("\nOptions:\n"); printf("\t-c\talso create classic (wrong) machine ini files\n"); printf("\tdir\tdestination directory, must end with separator ('/' or '\\')\n"); } int main(int argc, char * const argv[]) { size_t dlen = 0; int iret = 0; Machine machine, **ptr = machines; int c; int also_dump_wrong = 0; while ((c = getopt(argc, argv, "c?")) != -1) { switch (c) { case 'c': also_dump_wrong = 1; break; case '?': usage(); return 0; } } argc -= optind; argv += optind; // Directory path // Must include "/" or "\". You supply it; code is // a tad more portable that way. if (argc > 0) dlen = strlen(argv[0]); do { while (*ptr) { if ((*ptr)->type) { char *fname; size_t len = strlen((*ptr)->type); fname = (char *)malloc(dlen + len + 5); if (fname) { FILE *fp; if (dlen) memcpy(fname, argv[0], dlen); memcpy(fname + dlen, (*ptr)->type, len); memcpy(fname + dlen + len, ".ini", 5); fp = fopen(fname, "w"); if (fp) { memcpy(&machine, *ptr, sizeof(Machine)); config_dump(fp, &machine); fclose(fp); } else { fprintf(stderr, "Unable to create the file \"%s\"\n", fname); iret = 1; } free(fname); } ptr++; } } if (also_dump_wrong) { also_dump_wrong = 0; ptr = wrong_machines; } } while(*ptr); return(iret); } GPX-2.5.2/src/utils/s3gdump.c000066400000000000000000000057701271205255700156520ustar00rootroot00000000000000/* Copyright (c) 2015, Dan Newman * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions are met: * * 1. Redistributions of source code must retain the above copyright notice, this * list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ // Simple tool to dump a .s3g file either from disk of from stdin // // s3gdump filename // // or // // s3gdump < filename #include #include #include #include "s3g.h" #define GETOPTS_END -1 static void usage(FILE *f, const char *prog) { if (f == NULL) f = stderr; fprintf(f, "Usage: %s -hE [file]\n" " file -- The .s3g file to dump. If not supplied then stdin is dumped\n" " ?, -h -- This help message\n", prog ? prog : "s3gdump"); } int main(int argc, const char *argv[]) { int c; s3g_context_t *ctx; s3g_command_t cmd; int lineno, simple; simple = 0; while ((c = getopt(argc, (char **)argv, ":h?")) != GETOPTS_END) { switch(c) { // Unknown switch case ':' : default : usage(stderr, argv[0]); return(1); // Explicit help request case 'h' : case '?' : usage(stdout, argv[0]); return(0); } } // Not that we care at this point argc -= optind; argv += optind; if (argc == 0) ctx = s3g_open(0, NULL, 0, 0); else ctx = s3g_open(0, (void *)argv[0], 0, 0); if (!ctx) // Assume that s3g_open() has logged the problem to stderr return(1); fprintf(stdout, "Command count: (Command ID) Command description\n"); lineno = 0; while (!s3g_command_read(ctx, &cmd)) { fprintf(stdout, "%d: ", ++lineno); if (simple) fprintf(stdout, "(%d) %s\n", cmd.cmd_id, cmd.cmd_desc); else s3g_command_display(ctx, &cmd); } fprintf(stdout, "\nEOF\n"); s3g_close(ctx); return(0); }