├── .gitignore ├── CrossPack-AVR.xcodeproj ├── project.pbxproj └── project.xcworkspace │ └── contents.xcworkspacedata ├── License.txt ├── README.md ├── manual-source ├── documentation.html ├── footer.php ├── gettingstarted.html ├── header.php ├── index.html ├── installation.html ├── licenses.html ├── links.html ├── mkmanual.sh ├── releasenotes.html └── resources │ ├── logo150.jpg │ └── style.css ├── mkclean.sh ├── mkdist.sh ├── package-info ├── Readme.rtf ├── Resources │ ├── background.jp2 │ └── en.lproj │ │ ├── ReadMe.rtf │ │ └── Welcome.rtf └── scripts │ └── postinstall ├── patches-local ├── avr-libc-1.8.0 │ ├── 010-iotn2313a-header.patch │ └── 010-iotn4313-header.patch ├── gcc-3.4.6 │ ├── 20-gcc-binary-constants.patch │ ├── 21-gcc-avr-misspelled-sig-1.patch │ └── 60-new-devices.patch └── libusb-0.1.12 │ └── 010-fix-64-bit.patch └── templates └── TemplateProject ├── TemplateProject.xcodeproj └── project.pbxproj └── firmware ├── Makefile └── main.c /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | ._* 3 | xcuserdata 4 | /patches 5 | /manual 6 | /packages 7 | /compile 8 | /math 9 | /temporary-install 10 | -------------------------------------------------------------------------------- /CrossPack-AVR.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 46; 7 | objects = { 8 | 9 | /* Begin PBXFileReference section */ 10 | 4066DB6314EAA6220051D0F4 /* mkdist.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkdist.sh; sourceTree = ""; }; 11 | 4066DB6714EBD0BC0051D0F4 /* 010-fix-64-bit.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "010-fix-64-bit.patch"; sourceTree = ""; }; 12 | 4066DB6914EBEE560051D0F4 /* 20-gcc-binary-constants.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "20-gcc-binary-constants.patch"; sourceTree = ""; }; 13 | 4066DB6A14EBEE560051D0F4 /* 21-gcc-avr-misspelled-sig-1.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "21-gcc-avr-misspelled-sig-1.patch"; sourceTree = ""; }; 14 | 4066DB6B14EBEE560051D0F4 /* 60-new-devices.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "60-new-devices.patch"; sourceTree = ""; }; 15 | 4066DB7014EC5E8C0051D0F4 /* Readme.rtf */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; path = Readme.rtf; sourceTree = ""; }; 16 | 4066DB7B14EC5E8C0051D0F4 /* main.c */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 17 | 4066DB7C14EC5E8C0051D0F4 /* Makefile */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 18 | 4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */ = {isa = PBXFileReference; lastKnownFileType = "wrapper.pb-project"; path = TemplateProject.xcodeproj; sourceTree = ""; }; 19 | 4066DB8514EC81B00051D0F4 /* documentation.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = documentation.html; sourceTree = ""; }; 20 | 4066DB8614EC81B00051D0F4 /* footer.php */ = {isa = PBXFileReference; lastKnownFileType = text.script.php; path = footer.php; sourceTree = ""; }; 21 | 4066DB8714EC81B00051D0F4 /* gettingstarted.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = gettingstarted.html; sourceTree = ""; }; 22 | 4066DB8814EC81B00051D0F4 /* header.php */ = {isa = PBXFileReference; lastKnownFileType = text.script.php; path = header.php; sourceTree = ""; }; 23 | 4066DB8914EC81B00051D0F4 /* index.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = index.html; sourceTree = ""; }; 24 | 4066DB8A14EC81B00051D0F4 /* installation.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = installation.html; sourceTree = ""; }; 25 | 4066DB8B14EC81B00051D0F4 /* licenses.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = licenses.html; sourceTree = ""; }; 26 | 4066DB8C14EC81B00051D0F4 /* links.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = links.html; sourceTree = ""; }; 27 | 4066DB8D14EC81B00051D0F4 /* mkmanual.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkmanual.sh; sourceTree = ""; }; 28 | 4066DB8E14EC81B00051D0F4 /* releasenotes.html */ = {isa = PBXFileReference; lastKnownFileType = text.html; path = releasenotes.html; sourceTree = ""; }; 29 | 4066DB9014EC81B00051D0F4 /* logo150.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = logo150.jpg; sourceTree = ""; }; 30 | 4066DB9114EC81B00051D0F4 /* style.css */ = {isa = PBXFileReference; lastKnownFileType = text.css; path = style.css; sourceTree = ""; }; 31 | 4066DB9414ECF9D90051D0F4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = ReadMe.rtf; sourceTree = ""; }; 32 | 4066DB9614ECF9D90051D0F4 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.rtf; name = en; path = Welcome.rtf; sourceTree = ""; }; 33 | 406D9473166655FD004D70FD /* mkclean.sh */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = mkclean.sh; sourceTree = ""; }; 34 | 406D9474166655FD004D70FD /* README.md */ = {isa = PBXFileReference; lastKnownFileType = text; path = README.md; sourceTree = ""; }; 35 | 406D947716665618004D70FD /* License.txt */ = {isa = PBXFileReference; lastKnownFileType = text; path = License.txt; sourceTree = ""; }; 36 | 406D947916665641004D70FD /* postinstall */ = {isa = PBXFileReference; lastKnownFileType = text.script.sh; path = postinstall; sourceTree = ""; }; 37 | 406D947A16665653004D70FD /* background.jp2 */ = {isa = PBXFileReference; lastKnownFileType = file; path = background.jp2; sourceTree = ""; }; 38 | 40D919CE1846922B00A9661C /* 010-iotn2313a-header.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "010-iotn2313a-header.patch"; sourceTree = ""; }; 39 | 40D919CF1846922B00A9661C /* 010-iotn4313-header.patch */ = {isa = PBXFileReference; lastKnownFileType = text; path = "010-iotn4313-header.patch"; sourceTree = ""; }; 40 | /* End PBXFileReference section */ 41 | 42 | /* Begin PBXGroup section */ 43 | 4066DB5714EAA5C00051D0F4 = { 44 | isa = PBXGroup; 45 | children = ( 46 | 406D9473166655FD004D70FD /* mkclean.sh */, 47 | 4066DB6314EAA6220051D0F4 /* mkdist.sh */, 48 | 406D9474166655FD004D70FD /* README.md */, 49 | 406D947716665618004D70FD /* License.txt */, 50 | 4066DB8414EC81B00051D0F4 /* manual-source */, 51 | 4066DB6C14EC5E8C0051D0F4 /* package-info */, 52 | 4066DB7814EC5E8C0051D0F4 /* templates */, 53 | 4066DB6514EBD0BC0051D0F4 /* patches-local */, 54 | ); 55 | sourceTree = ""; 56 | }; 57 | 4066DB6514EBD0BC0051D0F4 /* patches-local */ = { 58 | isa = PBXGroup; 59 | children = ( 60 | 40CFCFBC16C9A6B200C292D0 /* avr-libc-1.8.0 */, 61 | 4066DB6814EBEE560051D0F4 /* gcc-3.4.6 */, 62 | 4066DB6614EBD0BC0051D0F4 /* libusb-0.1.12 */, 63 | ); 64 | path = "patches-local"; 65 | sourceTree = ""; 66 | }; 67 | 4066DB6614EBD0BC0051D0F4 /* libusb-0.1.12 */ = { 68 | isa = PBXGroup; 69 | children = ( 70 | 4066DB6714EBD0BC0051D0F4 /* 010-fix-64-bit.patch */, 71 | ); 72 | path = "libusb-0.1.12"; 73 | sourceTree = ""; 74 | }; 75 | 4066DB6814EBEE560051D0F4 /* gcc-3.4.6 */ = { 76 | isa = PBXGroup; 77 | children = ( 78 | 4066DB6914EBEE560051D0F4 /* 20-gcc-binary-constants.patch */, 79 | 4066DB6A14EBEE560051D0F4 /* 21-gcc-avr-misspelled-sig-1.patch */, 80 | 4066DB6B14EBEE560051D0F4 /* 60-new-devices.patch */, 81 | ); 82 | path = "gcc-3.4.6"; 83 | sourceTree = ""; 84 | }; 85 | 4066DB6C14EC5E8C0051D0F4 /* package-info */ = { 86 | isa = PBXGroup; 87 | children = ( 88 | 4066DB7014EC5E8C0051D0F4 /* Readme.rtf */, 89 | 4066DB7114EC5E8C0051D0F4 /* Resources */, 90 | 406D947816665641004D70FD /* scripts */, 91 | ); 92 | path = "package-info"; 93 | sourceTree = ""; 94 | }; 95 | 4066DB7114EC5E8C0051D0F4 /* Resources */ = { 96 | isa = PBXGroup; 97 | children = ( 98 | 406D947A16665653004D70FD /* background.jp2 */, 99 | 4066DB9214ECF9D90051D0F4 /* en.lproj */, 100 | ); 101 | path = Resources; 102 | sourceTree = ""; 103 | }; 104 | 4066DB7814EC5E8C0051D0F4 /* templates */ = { 105 | isa = PBXGroup; 106 | children = ( 107 | 4066DB7914EC5E8C0051D0F4 /* TemplateProject */, 108 | ); 109 | path = templates; 110 | sourceTree = ""; 111 | }; 112 | 4066DB7914EC5E8C0051D0F4 /* TemplateProject */ = { 113 | isa = PBXGroup; 114 | children = ( 115 | 4066DB7A14EC5E8C0051D0F4 /* firmware */, 116 | 4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */, 117 | ); 118 | path = TemplateProject; 119 | sourceTree = ""; 120 | }; 121 | 4066DB7A14EC5E8C0051D0F4 /* firmware */ = { 122 | isa = PBXGroup; 123 | children = ( 124 | 4066DB7B14EC5E8C0051D0F4 /* main.c */, 125 | 4066DB7C14EC5E8C0051D0F4 /* Makefile */, 126 | ); 127 | path = firmware; 128 | sourceTree = ""; 129 | }; 130 | 4066DB7E14EC5E8C0051D0F4 /* Products */ = { 131 | isa = PBXGroup; 132 | children = ( 133 | ); 134 | name = Products; 135 | sourceTree = ""; 136 | }; 137 | 4066DB8414EC81B00051D0F4 /* manual-source */ = { 138 | isa = PBXGroup; 139 | children = ( 140 | 4066DB8514EC81B00051D0F4 /* documentation.html */, 141 | 4066DB8614EC81B00051D0F4 /* footer.php */, 142 | 4066DB8714EC81B00051D0F4 /* gettingstarted.html */, 143 | 4066DB8814EC81B00051D0F4 /* header.php */, 144 | 4066DB8914EC81B00051D0F4 /* index.html */, 145 | 4066DB8A14EC81B00051D0F4 /* installation.html */, 146 | 4066DB8B14EC81B00051D0F4 /* licenses.html */, 147 | 4066DB8C14EC81B00051D0F4 /* links.html */, 148 | 4066DB8D14EC81B00051D0F4 /* mkmanual.sh */, 149 | 4066DB8E14EC81B00051D0F4 /* releasenotes.html */, 150 | 4066DB8F14EC81B00051D0F4 /* resources */, 151 | ); 152 | path = "manual-source"; 153 | sourceTree = ""; 154 | }; 155 | 4066DB8F14EC81B00051D0F4 /* resources */ = { 156 | isa = PBXGroup; 157 | children = ( 158 | 4066DB9014EC81B00051D0F4 /* logo150.jpg */, 159 | 4066DB9114EC81B00051D0F4 /* style.css */, 160 | ); 161 | path = resources; 162 | sourceTree = ""; 163 | }; 164 | 4066DB9214ECF9D90051D0F4 /* en.lproj */ = { 165 | isa = PBXGroup; 166 | children = ( 167 | 4066DB9314ECF9D90051D0F4 /* ReadMe.rtf */, 168 | 4066DB9514ECF9D90051D0F4 /* Welcome.rtf */, 169 | ); 170 | path = en.lproj; 171 | sourceTree = ""; 172 | }; 173 | 406D947816665641004D70FD /* scripts */ = { 174 | isa = PBXGroup; 175 | children = ( 176 | 406D947916665641004D70FD /* postinstall */, 177 | ); 178 | path = scripts; 179 | sourceTree = ""; 180 | }; 181 | 40CFCFBC16C9A6B200C292D0 /* avr-libc-1.8.0 */ = { 182 | isa = PBXGroup; 183 | children = ( 184 | 40D919CE1846922B00A9661C /* 010-iotn2313a-header.patch */, 185 | 40D919CF1846922B00A9661C /* 010-iotn4313-header.patch */, 186 | ); 187 | path = "avr-libc-1.8.0"; 188 | sourceTree = ""; 189 | }; 190 | /* End PBXGroup section */ 191 | 192 | /* Begin PBXProject section */ 193 | 4066DB5914EAA5C00051D0F4 /* Project object */ = { 194 | isa = PBXProject; 195 | attributes = { 196 | LastUpgradeCheck = 0420; 197 | ORGANIZATIONNAME = "Objective Development Software GmbH"; 198 | }; 199 | buildConfigurationList = 4066DB5C14EAA5C00051D0F4 /* Build configuration list for PBXProject "CrossPack-AVR" */; 200 | compatibilityVersion = "Xcode 3.2"; 201 | developmentRegion = English; 202 | hasScannedForEncodings = 0; 203 | knownRegions = ( 204 | en, 205 | English, 206 | ); 207 | mainGroup = 4066DB5714EAA5C00051D0F4; 208 | projectDirPath = ""; 209 | projectReferences = ( 210 | { 211 | ProductGroup = 4066DB7E14EC5E8C0051D0F4 /* Products */; 212 | ProjectRef = 4066DB7D14EC5E8C0051D0F4 /* TemplateProject.xcodeproj */; 213 | }, 214 | ); 215 | projectRoot = ""; 216 | targets = ( 217 | ); 218 | }; 219 | /* End PBXProject section */ 220 | 221 | /* Begin PBXVariantGroup section */ 222 | 4066DB9314ECF9D90051D0F4 /* ReadMe.rtf */ = { 223 | isa = PBXVariantGroup; 224 | children = ( 225 | 4066DB9414ECF9D90051D0F4 /* en */, 226 | ); 227 | name = ReadMe.rtf; 228 | sourceTree = ""; 229 | }; 230 | 4066DB9514ECF9D90051D0F4 /* Welcome.rtf */ = { 231 | isa = PBXVariantGroup; 232 | children = ( 233 | 4066DB9614ECF9D90051D0F4 /* en */, 234 | ); 235 | name = Welcome.rtf; 236 | sourceTree = ""; 237 | }; 238 | /* End PBXVariantGroup section */ 239 | 240 | /* Begin XCBuildConfiguration section */ 241 | 4066DB5E14EAA5C00051D0F4 /* Debug */ = { 242 | isa = XCBuildConfiguration; 243 | buildSettings = { 244 | }; 245 | name = Debug; 246 | }; 247 | 4066DB5F14EAA5C00051D0F4 /* Release */ = { 248 | isa = XCBuildConfiguration; 249 | buildSettings = { 250 | }; 251 | name = Release; 252 | }; 253 | /* End XCBuildConfiguration section */ 254 | 255 | /* Begin XCConfigurationList section */ 256 | 4066DB5C14EAA5C00051D0F4 /* Build configuration list for PBXProject "CrossPack-AVR" */ = { 257 | isa = XCConfigurationList; 258 | buildConfigurations = ( 259 | 4066DB5E14EAA5C00051D0F4 /* Debug */, 260 | 4066DB5F14EAA5C00051D0F4 /* Release */, 261 | ); 262 | defaultConfigurationIsVisible = 0; 263 | defaultConfigurationName = Release; 264 | }; 265 | /* End XCConfigurationList section */ 266 | }; 267 | rootObject = 4066DB5914EAA5C00051D0F4 /* Project object */; 268 | } 269 | -------------------------------------------------------------------------------- /CrossPack-AVR.xcodeproj/project.xcworkspace/contents.xcworkspacedata: -------------------------------------------------------------------------------- 1 | 2 | 4 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /License.txt: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | CrossPack for AVR Development is a development environment for Atmel's AVR 2 | microcontrollers running on Apple's OS X, similar to AVR Studio on Windows. 3 | It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE 4 | downloader and several other useful tools. 5 | 6 | This repository contains a shell script which downloads the source code of 7 | all required packages, compiles them, builds an installer package and wraps 8 | it into a disk image, ready for distribution. It also contains resources such 9 | as a project template, manual etc. 10 | 11 | 12 | PREREQUISITES 13 | ============= 14 | 15 | * Xcode 5. It probably also works with Xcode 4.4 and newer versions of Xcode. 16 | 17 | 18 | BUILDING CROSSPACK-AVR 19 | ====================== 20 | 21 | After installing Xcode, simply run 22 | 23 | ./mkdist.sh 24 | 25 | or 26 | 27 | ./mkdist.sh debug 28 | 29 | in the root directory of the project. You may want to edit some options in 30 | the script before running it, e.g. the version of CrossPack-AVR or versions 31 | of packages downloaded and compiled. The user who runs the script needs write 32 | permissions to the directory /usr/local. 33 | 34 | The resulting disk image can be found in /tmp. 35 | 36 | The build procedure preserves all downloaded packages. If you want to remove 37 | them in order to save disk space, run 38 | 39 | ./mkclean.sh 40 | 41 | -------------------------------------------------------------------------------- /manual-source/documentation.html: -------------------------------------------------------------------------------- 1 | 2 |

Documentation

3 | The various packages contained in come with different forms of documentation. Some have HTML documentation, some have Unix man pages and some have GNU Info files. 4 |

5 | This section is a starting point for all documentation resources. Unfortunately, we can't link Unix man pages and GNU Info files into this HTML page. You must type the appropriate commands yourself. 6 | 7 | 14 |

Documentation Available in HTML Format

15 | ">AVR Libc - a C library for GCC on AVR microcontrollers
16 | ">AVRDUDE - AVR Downloader/Uploader
17 | 18 |

Documentation Available as Unix Man Pages

19 | includes the command avr-man to ensure that AVR specific manual pages are printed. Example: 20 |
Shell Session:
bash$ avr-man strcpy 21 | <string.h>: Strings(3) avr-libc <string.h>: Strings(3) 22 | 23 | NAME 24 | <string.h>: Strings - 25 | 26 | Detailed Description 27 | #include <string.h> 28 | 29 | The string functions perform string operations on NULL terminated 30 | strings. 31 | ... 32 |
33 | Documents in Section $section\n"; 40 | $fp = opendir("$prefix/man/$dir"); 41 | while($name = readdir($fp)){ 42 | if(!ereg(".$section\$", $name)) 43 | continue; 44 | if(filesize("$prefix/man/$dir/$name") < 300) 45 | continue; 46 | $f = fopen("$prefix/man/$dir/$name", "r"); 47 | $description = ""; 48 | while($line = fgets($f, 1000)){ 49 | if(ereg('^[.]SH NAME', $line)){ 50 | $description = trim(fgets($f, 1000)); 51 | break; 52 | } 53 | } 54 | fclose($f); 55 | $name = ereg_replace(".$section\$", "", $name); 56 | $description = ereg_replace('[ \t]*\\\\[a-zA-Z0-9]+[ \t]*', ' ', $description); 57 | $description = ereg_replace('[.]PP', '', $description); 58 | if(ereg('^(.*) \\\\- ?(.*)$', $description, $regs)){ 59 | $part1 = trim($regs[1]); 60 | $part2 = trim($regs[2]); 61 | if($part1 == ""){ 62 | $description = $part2; 63 | }else if($part1 == $name || "avr-$part1" == $name){ 64 | $description = $part2; 65 | }else if($part2 == ""){ 66 | $description = $part1; 67 | }else{ 68 | $description = "$part1 - $part2"; 69 | } 70 | } 71 | if(strlen($description) > 70) 72 | $description = ""; 73 | if($description == ""){ 74 | echo "$name
\n"; 75 | }else{ 76 | echo "$name: " . htmlspecialchars($description) . "
\n"; 77 | } 78 | } 79 | closedir($fp); 80 | } 81 | } 82 | closedir($sfp); 83 | ?> 84 | 85 |

Documentation Available as GNU Info Pages

86 | includes the command avr-info to ensure that AVR specific info pages are printed. Example: 87 |
Shell Session:
bash$ avr-info binutils 88 | File: binutils.info, Node: Top, Next: ar, Up: (dir) 89 | 90 | Introduction 91 | ************ 92 | 93 | This brief manual contains documentation for the GNU binary utilities 94 | (GNU Binutils) version 2.17.90: 95 | ... 96 |
97 |

List of Info Documents

98 | \n"; 113 | } 114 | 115 | ?> 116 | 117 |

AVR Libc Examples

118 | 123 | AVR Libc comes with a set of example projects. These can be viewed ">here. 124 | 125 | -------------------------------------------------------------------------------- /manual-source/footer.php: -------------------------------------------------------------------------------- 1 | 2 | 3 | -------------------------------------------------------------------------------- /manual-source/gettingstarted.html: -------------------------------------------------------------------------------- 1 | 2 |

Getting Started

3 | Let's start with a simple example. We have an ATMega8 and want to blink an LED connected to Port D bit 4. To create a template project, run the following commands in a Terminal window: 4 |
Shell Session:
bash$ cd ~/Documents 5 | bash$ mkdir AVR 6 | bash$ cd AVR 7 | bash$ avr-project Demo 8 | bash$ open Demo 9 |
10 | We have added a new subdirectory to your Documents folder and created a project named "Demo" in it. Then we opened the newly created folder in Finder. The contents of the folder are: 11 |
Shell Session:
bash$ cd Demo 12 | bash$ ls -l 13 | total 0 14 | drwxr-xr-x 5 cs cs 170 Nov 19 13:58 Demo.xcodeproj 15 | drwxr-xr-x 4 cs cs 136 Nov 19 13:58 firmware 16 |
17 | You can later create new subdirectories for the circuit diagrams, construction drawings and maybe Mac software here. If you don't have Xcode installed, you can delete Demo.xcodeproj. The subdirectory firmware is intended for the AVR firmware, it contains: 18 |
Shell Session:
bash$ cd firmware 19 | bash$ ls -l 20 | total 24 21 | -rw-r--r-- 1 cs cs 4139 Nov 19 13:58 Makefile 22 | -rw-r--r-- 1 cs cs 348 Nov 19 13:58 main.c 23 |
24 | Makefile controls the build process and main.c contains the C source code for the project. We first edit Makefile. We want to configure the fuse values so that the AVR runs on an internal RC oscillator at 8 MHz and choose our programming tool. For this example we assume that you use Thomas Fischl's USBasp. We edit the options at the beginning of Makefile to look like this: 25 |
Excerpt of Makefile:
DEVICE = atmega8 26 | CLOCK = 8000000 # 8 MHz in Hz 27 | PROGRAMMER = -c USBasp 28 | FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m 29 | OBJECTS = main.o 30 |
31 | The first two lines are obvious. The third line is avrdude's command line option for the USBasp programmer. The fourth line contains avrdude's command line options to program the fuses appropriately (see the ATMega8 data sheet for more information on fuse bits or use one of the tools in the Links section to calculate the values). And the last line lists all modules which should be compiled. That's the same as the list of source files, but with the file extension changed to .o. 32 |

33 | Then we edit main.c, make it look like this: 34 |

main.c:
#include <avr/io.h> 35 | #include <util/delay.h> 36 | 37 | int main(void) 38 | { 39 | DDRD = 1 << 4; /* make the LED pin an output */ 40 | for(;;){ 41 | char i; 42 | for(i = 0; i < 10; i++){ 43 | _delay_ms(30); /* max is 262.14 ms / F_CPU in MHz */ 44 | } 45 | PORTD ^= 1 << 4; /* toggle the LED */ 46 | } 47 | return 0; /* never reached */ 48 | } 49 |
50 | Now we can run the build process in the firmware directory: 51 |
Shell Session:
bash$ make 52 | avr-gcc -Wall -Os -DF_CPU=8000000 -mmcu=atmega8 -c main.c -o main.o 53 | avr-gcc -Wall -Os -DF_CPU=8000000 -mmcu=atmega8 -o main.elf main.o 54 | rm -f main.hex 55 | avr-objcopy -j .text -j .data -O ihex main.elf main.hex 56 |
57 | If you use Xcode, you can also click the Build button to build the firmware. 58 | Make has now created the files main.o, the compiled version of main.c, main.elf, that is main.o linked with all required external libraries and finally main.hex, an Intel-Hex file ready for passing to the programmer: 59 |
Shell Session:
bash$ ls -l 60 | total 48 61 | -rw-r--r-- 1 cs cs 4142 Nov 19 14:05 Makefile 62 | -rw-r--r-- 1 cs cs 367 Nov 19 14:06 main.c 63 | -rwxr-xr-x 1 cs cs 3161 Nov 19 14:07 main.elf 64 | -rw-r--r-- 1 cs cs 390 Nov 19 14:07 main.hex 65 | -rw-r--r-- 1 cs cs 808 Nov 19 14:07 main.o 66 |
67 |

68 | The final step consists of uploading the code and fuses through the programmer: 69 |

Shell Session:
bash$ make flash 70 | avrdude -c USBasp -p atmega8 -U flash:w:main.hex:i 71 | 72 | avrdude: AVR device initialized and ready to accept instructions 73 | 74 | Reading | ################################################## | 100% 0.19s 75 | 76 | avrdude: Device signature = 0x1e9307 77 | avrdude: NOTE: FLASH memory has been specified, an erase cycle will be performed 78 | To disable this feature, specify the -D option. 79 | avrdude: erasing chip 80 | avrdude: reading input file "main.hex" 81 | avrdude: writing flash (130 bytes): 82 | 83 | Writing | ################################################## | 100% 0.21s 84 | 85 | avrdude: 130 bytes of flash written 86 | avrdude: verifying flash memory against main.hex: 87 | avrdude: load data flash data from input file main.hex: 88 | avrdude: input file main.hex contains 130 bytes 89 | avrdude: reading on-chip flash data: 90 | 91 | Reading | ################################################## | 100% 0.15s 92 | 93 | avrdude: verifying ... 94 | avrdude: 130 bytes of flash verified 95 | 96 | avrdude: safemode: Fuses OK 97 | 98 | avrdude done. Thank you. 99 |
100 |
Shell Session:
bash$ make fuse 101 | avrdude -c USBasp -p atmega8 -U hfuse:w:0xd9:m -U lfuse:w:0x24:m 102 | 103 | avrdude: AVR device initialized and ready to accept instructions 104 | 105 | Reading | ################################################## | 100% 0.19s 106 | 107 | avrdude: Device signature = 0x1e9307 108 | avrdude: reading input file "0xd9" 109 | avrdude: writing hfuse (1 bytes): 110 | 111 | Writing | ################################################## | 100% 0.19s 112 | 113 | avrdude: 1 bytes of hfuse written 114 | avrdude: verifying hfuse memory against 0xd9: 115 | avrdude: load data hfuse data from input file 0xd9: 116 | avrdude: input file 0xd9 contains 1 bytes 117 | avrdude: reading on-chip hfuse data: 118 | 119 | Reading | ################################################## | 100% 0.07s 120 | 121 | avrdude: verifying ... 122 | avrdude: 1 bytes of hfuse verified 123 | avrdude: reading input file "0x24" 124 | avrdude: writing lfuse (1 bytes): 125 | 126 | Writing | ################################################## | 100% 0.20s 127 | 128 | avrdude: 1 bytes of lfuse written 129 | avrdude: verifying lfuse memory against 0x24: 130 | avrdude: load data lfuse data from input file 0x24: 131 | avrdude: input file 0x24 contains 1 bytes 132 | avrdude: reading on-chip lfuse data: 133 | 134 | Reading | ################################################## | 100% 0.07s 135 | 136 | avrdude: verifying ... 137 | avrdude: 1 bytes of lfuse verified 138 | 139 | avrdude: safemode: Fuses OK 140 | 141 | avrdude done. Thank you. 142 |
143 | The LED connected to Port D bit 4 should blink now. 144 | -------------------------------------------------------------------------------- /manual-source/header.php: -------------------------------------------------------------------------------- 1 | 9 | 10 | 11 | 12 | <?echo $pkgname?> - A Development Environment for AVR Microcontrollers 13 | 14 | 15 | 16 | "; 36 | } 37 | ?> 38 | 39 | 52 | 53 |
40 | 41 |

42 |

43 | Overview

44 | Installation and Removal

45 | Getting Started

46 | Documentation

47 | Links

48 | Release Notes

49 | Software Licenses 50 |

51 |
  54 | -------------------------------------------------------------------------------- /manual-source/index.html: -------------------------------------------------------------------------------- 1 | 2 |

Overview

3 |

What is ?

4 | is a development environment for Atmel's AVR microcontrollers running on Apple's Mac OS X, similar to WinAVR for Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE uploader and several other useful tools. 5 | 6 | consists of the following packages: 7 |
    8 | $package in version $version\n"; 23 | } 24 | fclose($fp); 25 | ?> 26 |
27 | 28 |

Supported Devices

29 |

Devices supported by avr-gcc

30 | /dev/null 2>&1"); 35 | $devices = array(); 36 | $fp = popen("$prefix/bin/avr-gcc --target-help -mlist-devices | grep __AVR", "r"); 37 | while($line = fgets($fp, 1000)){ 38 | $arr = explode(" ", $line, 2); 39 | $devices[] = $arr[0]; 40 | } 41 | pclose($fp); 42 | sort($devices, SORT_STRING); 43 | for($i = 0; $i < count($devices); $i++){ 44 | if($i != 0){ 45 | echo ", "; 46 | } 47 | echo $devices[$i]; 48 | } 49 | } 50 | 51 | gccDevices("4"); 52 | ?> 53 | 54 |

Devices supported by the assembler avr-as

55 | &1", "r"); 58 | while($line = fgets($fp, 1000)){ 59 | $line = trim($line); 60 | if($line == "" || eregi('known', $line) || eregi('assembler', $line) || eregi('fatal', $line)) 61 | continue; 62 | $list = explode(" ", $line); 63 | for($i = 0; $i < count($list); $i++){ 64 | $devices[] = $list[$i]; 65 | } 66 | } 67 | pclose($fp); 68 | sort($devices, SORT_STRING); 69 | for($i = 0; $i < count($devices); $i++){ 70 | if($i != 0){ 71 | echo ", "; 72 | } 73 | echo $devices[$i]; 74 | } 75 | ?> 76 | -------------------------------------------------------------------------------- /manual-source/installation.html: -------------------------------------------------------------------------------- 1 | 2 |

Installing

3 | comes as a Mac OS X installer package. Simply double-click .pkg to install. Please restart Terminal after installation to make sure that it inherits the new PATH environment variable. 4 |

5 | does not include a text editor for editing source files. If you have Xcode already installed (e.g. because you also need to develop software for the Mac), simply use Xcode to edit your sources. If you don't have Xcode, recommend BareBone's TextWrangler instead. It's free. You may also use TextEdit (which ships with Mac OS X) for source code editing, but it lacks things like auto-indentation. 6 | 7 |

Upgrading

8 | installs into /usr/local/-<version> and /usr/local/ is always a symbolic link to the version which has been installed last. Several versions of can therefore coexist and you can switch between them by changing the symbolic link. If you want only one version, remove the old installation before installing the new package, or delete it any time later from /usr/local/: 9 |
Shell Session:
bash$ cd /usr/local/ 10 | bash$ ls -ld * 11 | lrwxr-xr-x 1 root wheel 19 Dec 1 18:04 -> -20071201 12 | drwxr-xr-x 15 root wheel 568 Nov 26 22:12 -20071126 13 | drwxr-xr-x 18 root wheel 612 Dec 1 18:04 -20071201 14 | bash$ sudo rm -rf -20071126 15 | Password: 16 |
17 | 18 | 19 |

Removing

20 | To remove completely, run the following command in a Terminal window: 21 |
Shell Session:
bash$ sudo /usr/local//uninstall 22 | Password: 23 | Are you sure you want to uninstall ? 24 | [y/N] 25 | yes 26 | Starting uninstall. 27 | is now removed. 28 |
29 | 30 | -------------------------------------------------------------------------------- /manual-source/licenses.html: -------------------------------------------------------------------------------- 1 | 2 |

Software Licenses

3 | Most of the software included in this package is distributed under the GNU General Public License in version 2, which is reproduced below. Only AVR Libc is distributed under a more liberal license which is also reproduced below. 4 | 5 |

The GNU General Public License Version 2

6 |
GNU GPLv2:
GNU GENERAL PUBLIC LICENSE 7 | Version 2, June 1991 8 | 9 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 10 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 11 | Everyone is permitted to copy and distribute verbatim copies 12 | of this license document, but changing it is not allowed. 13 | 14 | Preamble 15 | 16 | The licenses for most software are designed to take away your 17 | freedom to share and change it. By contrast, the GNU General Public 18 | License is intended to guarantee your freedom to share and change free 19 | software--to make sure the software is free for all its users. This 20 | General Public License applies to most of the Free Software 21 | Foundation's software and to any other program whose authors commit to 22 | using it. (Some other Free Software Foundation software is covered by 23 | the GNU Library General Public License instead.) You can apply it to 24 | your programs, too. 25 | 26 | When we speak of free software, we are referring to freedom, not 27 | price. Our General Public Licenses are designed to make sure that you 28 | have the freedom to distribute copies of free software (and charge for 29 | this service if you wish), that you receive source code or can get it 30 | if you want it, that you can change the software or use pieces of it 31 | in new free programs; and that you know you can do these things. 32 | 33 | To protect your rights, we need to make restrictions that forbid 34 | anyone to deny you these rights or to ask you to surrender the rights. 35 | These restrictions translate to certain responsibilities for you if you 36 | distribute copies of the software, or if you modify it. 37 | 38 | For example, if you distribute copies of such a program, whether 39 | gratis or for a fee, you must give the recipients all the rights that 40 | you have. You must make sure that they, too, receive or can get the 41 | source code. And you must show them these terms so they know their 42 | rights. 43 | 44 | We protect your rights with two steps: (1) copyright the software, and 45 | (2) offer you this license which gives you legal permission to copy, 46 | distribute and/or modify the software. 47 | 48 | Also, for each author's protection and ours, we want to make certain 49 | that everyone understands that there is no warranty for this free 50 | software. If the software is modified by someone else and passed on, we 51 | want its recipients to know that what they have is not the original, so 52 | that any problems introduced by others will not reflect on the original 53 | authors' reputations. 54 | 55 | Finally, any free program is threatened constantly by software 56 | patents. We wish to avoid the danger that redistributors of a free 57 | program will individually obtain patent licenses, in effect making the 58 | program proprietary. To prevent this, we have made it clear that any 59 | patent must be licensed for everyone's free use or not licensed at all. 60 | 61 | The precise terms and conditions for copying, distribution and 62 | modification follow. 63 | 64 | GNU GENERAL PUBLIC LICENSE 65 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 66 | 67 | 0. This License applies to any program or other work which contains 68 | a notice placed by the copyright holder saying it may be distributed 69 | under the terms of this General Public License. The "Program", below, 70 | refers to any such program or work, and a "work based on the Program" 71 | means either the Program or any derivative work under copyright law: 72 | that is to say, a work containing the Program or a portion of it, 73 | either verbatim or with modifications and/or translated into another 74 | language. (Hereinafter, translation is included without limitation in 75 | the term "modification".) Each licensee is addressed as "you". 76 | 77 | Activities other than copying, distribution and modification are not 78 | covered by this License; they are outside its scope. The act of 79 | running the Program is not restricted, and the output from the Program 80 | is covered only if its contents constitute a work based on the 81 | Program (independent of having been made by running the Program). 82 | Whether that is true depends on what the Program does. 83 | 84 | 1. You may copy and distribute verbatim copies of the Program's 85 | source code as you receive it, in any medium, provided that you 86 | conspicuously and appropriately publish on each copy an appropriate 87 | copyright notice and disclaimer of warranty; keep intact all the 88 | notices that refer to this License and to the absence of any warranty; 89 | and give any other recipients of the Program a copy of this License 90 | along with the Program. 91 | 92 | You may charge a fee for the physical act of transferring a copy, and 93 | you may at your option offer warranty protection in exchange for a fee. 94 | 95 | 2. You may modify your copy or copies of the Program or any portion 96 | of it, thus forming a work based on the Program, and copy and 97 | distribute such modifications or work under the terms of Section 1 98 | above, provided that you also meet all of these conditions: 99 | 100 | a) You must cause the modified files to carry prominent notices 101 | stating that you changed the files and the date of any change. 102 | 103 | b) You must cause any work that you distribute or publish, that in 104 | whole or in part contains or is derived from the Program or any 105 | part thereof, to be licensed as a whole at no charge to all third 106 | parties under the terms of this License. 107 | 108 | c) If the modified program normally reads commands interactively 109 | when run, you must cause it, when started running for such 110 | interactive use in the most ordinary way, to print or display an 111 | announcement including an appropriate copyright notice and a 112 | notice that there is no warranty (or else, saying that you provide 113 | a warranty) and that users may redistribute the program under 114 | these conditions, and telling the user how to view a copy of this 115 | License. (Exception: if the Program itself is interactive but 116 | does not normally print such an announcement, your work based on 117 | the Program is not required to print an announcement.) 118 | 119 | These requirements apply to the modified work as a whole. If 120 | identifiable sections of that work are not derived from the Program, 121 | and can be reasonably considered independent and separate works in 122 | themselves, then this License, and its terms, do not apply to those 123 | sections when you distribute them as separate works. But when you 124 | distribute the same sections as part of a whole which is a work based 125 | on the Program, the distribution of the whole must be on the terms of 126 | this License, whose permissions for other licensees extend to the 127 | entire whole, and thus to each and every part regardless of who wrote it. 128 | 129 | Thus, it is not the intent of this section to claim rights or contest 130 | your rights to work written entirely by you; rather, the intent is to 131 | exercise the right to control the distribution of derivative or 132 | collective works based on the Program. 133 | 134 | In addition, mere aggregation of another work not based on the Program 135 | with the Program (or with a work based on the Program) on a volume of 136 | a storage or distribution medium does not bring the other work under 137 | the scope of this License. 138 | 139 | 3. You may copy and distribute the Program (or a work based on it, 140 | under Section 2) in object code or executable form under the terms of 141 | Sections 1 and 2 above provided that you also do one of the following: 142 | 143 | a) Accompany it with the complete corresponding machine-readable 144 | source code, which must be distributed under the terms of Sections 145 | 1 and 2 above on a medium customarily used for software interchange; or, 146 | 147 | b) Accompany it with a written offer, valid for at least three 148 | years, to give any third party, for a charge no more than your 149 | cost of physically performing source distribution, a complete 150 | machine-readable copy of the corresponding source code, to be 151 | distributed under the terms of Sections 1 and 2 above on a medium 152 | customarily used for software interchange; or, 153 | 154 | c) Accompany it with the information you received as to the offer 155 | to distribute corresponding source code. (This alternative is 156 | allowed only for noncommercial distribution and only if you 157 | received the program in object code or executable form with such 158 | an offer, in accord with Subsection b above.) 159 | 160 | The source code for a work means the preferred form of the work for 161 | making modifications to it. For an executable work, complete source 162 | code means all the source code for all modules it contains, plus any 163 | associated interface definition files, plus the scripts used to 164 | control compilation and installation of the executable. However, as a 165 | special exception, the source code distributed need not include 166 | anything that is normally distributed (in either source or binary 167 | form) with the major components (compiler, kernel, and so on) of the 168 | operating system on which the executable runs, unless that component 169 | itself accompanies the executable. 170 | 171 | If distribution of executable or object code is made by offering 172 | access to copy from a designated place, then offering equivalent 173 | access to copy the source code from the same place counts as 174 | distribution of the source code, even though third parties are not 175 | compelled to copy the source along with the object code. 176 | 177 | 4. You may not copy, modify, sublicense, or distribute the Program 178 | except as expressly provided under this License. Any attempt 179 | otherwise to copy, modify, sublicense or distribute the Program is 180 | void, and will automatically terminate your rights under this License. 181 | However, parties who have received copies, or rights, from you under 182 | this License will not have their licenses terminated so long as such 183 | parties remain in full compliance. 184 | 185 | 5. You are not required to accept this License, since you have not 186 | signed it. However, nothing else grants you permission to modify or 187 | distribute the Program or its derivative works. These actions are 188 | prohibited by law if you do not accept this License. Therefore, by 189 | modifying or distributing the Program (or any work based on the 190 | Program), you indicate your acceptance of this License to do so, and 191 | all its terms and conditions for copying, distributing or modifying 192 | the Program or works based on it. 193 | 194 | 6. Each time you redistribute the Program (or any work based on the 195 | Program), the recipient automatically receives a license from the 196 | original licensor to copy, distribute or modify the Program subject to 197 | these terms and conditions. You may not impose any further 198 | restrictions on the recipients' exercise of the rights granted herein. 199 | You are not responsible for enforcing compliance by third parties to 200 | this License. 201 | 202 | 7. If, as a consequence of a court judgment or allegation of patent 203 | infringement or for any other reason (not limited to patent issues), 204 | conditions are imposed on you (whether by court order, agreement or 205 | otherwise) that contradict the conditions of this License, they do not 206 | excuse you from the conditions of this License. If you cannot 207 | distribute so as to satisfy simultaneously your obligations under this 208 | License and any other pertinent obligations, then as a consequence you 209 | may not distribute the Program at all. For example, if a patent 210 | license would not permit royalty-free redistribution of the Program by 211 | all those who receive copies directly or indirectly through you, then 212 | the only way you could satisfy both it and this License would be to 213 | refrain entirely from distribution of the Program. 214 | 215 | If any portion of this section is held invalid or unenforceable under 216 | any particular circumstance, the balance of the section is intended to 217 | apply and the section as a whole is intended to apply in other 218 | circumstances. 219 | 220 | It is not the purpose of this section to induce you to infringe any 221 | patents or other property right claims or to contest validity of any 222 | such claims; this section has the sole purpose of protecting the 223 | integrity of the free software distribution system, which is 224 | implemented by public license practices. Many people have made 225 | generous contributions to the wide range of software distributed 226 | through that system in reliance on consistent application of that 227 | system; it is up to the author/donor to decide if he or she is willing 228 | to distribute software through any other system and a licensee cannot 229 | impose that choice. 230 | 231 | This section is intended to make thoroughly clear what is believed to 232 | be a consequence of the rest of this License. 233 | 234 | 8. If the distribution and/or use of the Program is restricted in 235 | certain countries either by patents or by copyrighted interfaces, the 236 | original copyright holder who places the Program under this License 237 | may add an explicit geographical distribution limitation excluding 238 | those countries, so that distribution is permitted only in or among 239 | countries not thus excluded. In such case, this License incorporates 240 | the limitation as if written in the body of this License. 241 | 242 | 9. The Free Software Foundation may publish revised and/or new versions 243 | of the General Public License from time to time. Such new versions will 244 | be similar in spirit to the present version, but may differ in detail to 245 | address new problems or concerns. 246 | 247 | Each version is given a distinguishing version number. If the Program 248 | specifies a version number of this License which applies to it and "any 249 | later version", you have the option of following the terms and conditions 250 | either of that version or of any later version published by the Free 251 | Software Foundation. If the Program does not specify a version number of 252 | this License, you may choose any version ever published by the Free Software 253 | Foundation. 254 | 255 | 10. If you wish to incorporate parts of the Program into other free 256 | programs whose distribution conditions are different, write to the author 257 | to ask for permission. For software which is copyrighted by the Free 258 | Software Foundation, write to the Free Software Foundation; we sometimes 259 | make exceptions for this. Our decision will be guided by the two goals 260 | of preserving the free status of all derivatives of our free software and 261 | of promoting the sharing and reuse of software generally. 262 | 263 | NO WARRANTY 264 | 265 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 266 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 267 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 268 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 269 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 270 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 271 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 272 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 273 | REPAIR OR CORRECTION. 274 | 275 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 276 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 277 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 278 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 279 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 280 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 281 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 282 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 283 | POSSIBILITY OF SUCH DAMAGES. 284 | 285 | END OF TERMS AND CONDITIONS 286 | 287 | How to Apply These Terms to Your New Programs 288 | 289 | If you develop a new program, and you want it to be of the greatest 290 | possible use to the public, the best way to achieve this is to make it 291 | free software which everyone can redistribute and change under these terms. 292 | 293 | To do so, attach the following notices to the program. It is safest 294 | to attach them to the start of each source file to most effectively 295 | convey the exclusion of warranty; and each file should have at least 296 | the "copyright" line and a pointer to where the full notice is found. 297 | 298 | <one line to give the program's name and a brief idea of what it does.> 299 | Copyright (C) <year> <name of author> 300 | 301 | This program is free software; you can redistribute it and/or modify 302 | it under the terms of the GNU General Public License as published by 303 | the Free Software Foundation; either version 2 of the License, or 304 | (at your option) any later version. 305 | 306 | This program is distributed in the hope that it will be useful, 307 | but WITHOUT ANY WARRANTY; without even the implied warranty of 308 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 309 | GNU General Public License for more details. 310 | 311 | You should have received a copy of the GNU General Public License 312 | along with this program; if not, write to the Free Software 313 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 314 | 315 | 316 | Also add information on how to contact you by electronic and paper mail. 317 | 318 | If the program is interactive, make it output a short notice like this 319 | when it starts in an interactive mode: 320 | 321 | Gnomovision version 69, Copyright (C) year name of author 322 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 323 | This is free software, and you are welcome to redistribute it 324 | under certain conditions; type `show c' for details. 325 | 326 | The hypothetical commands `show w' and `show c' should show the appropriate 327 | parts of the General Public License. Of course, the commands you use may 328 | be called something other than `show w' and `show c'; they could even be 329 | mouse-clicks or menu items--whatever suits your program. 330 | 331 | You should also get your employer (if you work as a programmer) or your 332 | school, if any, to sign a "copyright disclaimer" for the program, if 333 | necessary. Here is a sample; alter the names: 334 | 335 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 336 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 337 | 338 | <signature of Ty Coon>, 1 April 1989 339 | Ty Coon, President of Vice 340 | 341 | This General Public License does not permit incorporating your program into 342 | proprietary programs. If your program is a subroutine library, you may 343 | consider it more useful to permit linking proprietary applications with the 344 | library. If this is what you want to do, use the GNU Library General 345 | Public License instead of this License. 346 |
347 | 348 |

AVR Libc License

349 |
AVR Libc License:
350 | avr-libc can be freely used and redistributed, provided the following license 351 | conditions are met. 352 | 353 | Portions of avr-libc are Copyright (c) 1999-2007 354 | Keith Gudger, 355 | Bjoern Haase, 356 | Steinar Haugen, 357 | Peter Jansen, 358 | Reinhard Jessich, 359 | Magnus Johansson, 360 | Artur Lipowski, 361 | Marek Michalkiewicz, 362 | Colin O'Flynn, 363 | Bob Paddock, 364 | Reiner Patommel, 365 | Michael Rickman, 366 | Theodore A. Roth, 367 | Juergen Schilling, 368 | Philip Soeberg, 369 | Anatoly Sokolov, 370 | Nils Kristian Strom, 371 | Michael Stumpf, 372 | Stefan Swanepoel, 373 | Eric B. Weddington, 374 | Joerg Wunsch, 375 | Dmitry Xmelkov, 376 | The Regents of the University of California. 377 | All rights reserved. 378 | 379 | Redistribution and use in source and binary forms, with or without 380 | modification, are permitted provided that the following conditions are met: 381 | 382 | * Redistributions of source code must retain the above copyright 383 | notice, this list of conditions and the following disclaimer. 384 | 385 | * Redistributions in binary form must reproduce the above copyright 386 | notice, this list of conditions and the following disclaimer in 387 | the documentation and/or other materials provided with the 388 | distribution. 389 | 390 | * Neither the name of the copyright holders nor the names of 391 | contributors may be used to endorse or promote products derived 392 | from this software without specific prior written permission. 393 | 394 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 395 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 396 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 397 | ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 398 | LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 399 | CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 400 | SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 401 | INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 402 | CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 403 | ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 404 | POSSIBILITY OF SUCH DAMAGE. 405 |
406 | 407 | -------------------------------------------------------------------------------- /manual-source/links.html: -------------------------------------------------------------------------------- 1 | 2 |

Links

3 | This section lists software packages and sites which may be useful for people working with the AVR. 4 | 5 |

Barebone's TextWrangler

6 | This is a text editor. We list it here because it's a powerful programming editor and it's free. If you don't want to install Xcode, you probably want TextWrangler for source code editing. 7 | 8 |

AVR Fuse Calculator

9 | This web site is an interactive fuse value calculator for AVR devices. You choose the desired options from pop-up menus or checkboxes and it tells you the hexadecimal fuse values to be used with AVRDUDE. 10 | 11 |

AVRFuses

12 | This native Mac application is a GUI frontend for AVRDUDE, the uploader/downloader tool which ships with . AVRFuses, as the name suggests, contains a fuse value calculator for user friendly feature selection. AVRFuses is free! 13 | 14 |

V-USB

15 | Objective Development has a USB library for AVR microcontrollers. This library implements low speed USB device functionality without special hardware resources. Only one edge triggered interrupt is required. This library is free (Gnu General Public License version 2 and 3). 16 | 17 |

AVR Studio 5

18 | This is Atmel's development environment for AVRs running on Windows. It ships with avr-gcc for C/C++ development. tracks the development of AVR Studio and tries to provide the same functionality. 19 | 20 | -------------------------------------------------------------------------------- /manual-source/mkmanual.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | dest="../manual" 3 | 4 | rm -rf "$dest" 5 | mkdir "$dest" 6 | for i in *.html; do 7 | php -f $i >"$dest/$i" "$@" 8 | done 9 | cp -r resources "$dest" -------------------------------------------------------------------------------- /manual-source/releasenotes.html: -------------------------------------------------------------------------------- 1 | 2 |

Release Notes

3 | The following list is in reverse historic order, new releases are inserted at the top: 4 | 5 |

CrossPack-AVR 20170210

6 |
    7 |
  • New versions: avr-gcc 4.9.2, binutils 2.26.20160125, avr-libc 2.0.0, avrdude 6.3
  • 8 |
9 | 10 |

CrossPack-AVR 20131216

11 |
    12 |
  • AVR-Libc headers for some new devices were missing. Fixed.
  • 13 |
  • Avr-gcc in version 4.8.1.
  • 14 |
  • Binutils in version 2.23.2.
  • 15 |
16 | 17 |

CrossPack-AVR 20131205

18 |
    19 |
  • Build all tools for minimum deployment target 10.6. Previous version required OS X 10.8 or 10.9.
  • 20 |
21 | 22 |

CrossPack-AVR 20131128

23 |
    24 |
  • Header with I/O definitions for ATTiny2313 was inconsistent with data sheet. Fixed.
  • 25 |
  • Avr-gcc in version 4.7.2 (generates slightly less efficient code than 4.6.2 from previous release).
  • 26 |
  • AVRDUDE in version 6.0.1.
  • 27 |
  • Binutils in version 2.23.1.
  • 28 |
  • GNU Make in version 4.0.
  • 29 |
  • Gdb in version 7.6.1.
  • 30 |
  • Libusb in version 1.0.9.
  • 31 |
32 | 33 |

CrossPack-AVR 20130212

34 |
    35 |
  • Header with I/O definitions for ATTiny4313 was inconsistent with data sheet. Fixed.
  • 36 |
37 | 38 |

CrossPack-AVR 20121207

39 |
    40 |
  • Fixed bug in previous release where avrdude binary did not have executable bit set.
  • 41 |
42 | 43 |

CrossPack-AVR 20121205

44 |
    45 |
  • Avrdude is now compatible with OS X 10.6. The previous version linked against a library not available on 10.6.
  • 46 |
  • Make is now compatible with OS X 10.6. The previous version used a libc function not available on 10.6.
  • 47 |
48 | 49 |

CrossPack-AVR 20121203

50 |
    51 |
  • Include C++ compiler. The previous version came without C++.
  • 52 |
53 | 54 |

CrossPack-AVR 20121128

55 |
    56 |
  • Based on gcc version 4.6.2 with patches obtained from Atmel.
  • 57 |
  • Fixed dependency of avarice on /usr/local/lib/libintl.dylib.
  • 58 |
  • Fixed dependency of avr-gdb on Python.
  • 59 |
  • New build script is now available on github.com
  • 60 |
61 | 62 |

CrossPack-AVR 20120217

63 |
    64 |
  • Based on gcc version 4.5.1 and patches obtained from FreeBSD's ports section.
  • 65 |
  • New versions of all packages.
  • 66 |
  • Dropped support for Mac OS X 10.5 and older.
  • 67 |
  • Dropped support for avr-gcc version 3.
  • 68 |
69 | 70 |

CrossPack-AVR 20100115

71 |
    72 |
  • Based on WinAVR 20100110.
  • 73 |
  • Added binutils bfd library for AVR to distribution.
  • 74 |
  • New versions: avr-gcc 4.3.3, avr-libc 1.6.7, avrdude 5.8, simulavr 0.9
  • 75 |
76 | 77 |

CrossPack-AVR 20090415

78 |
    79 |
  • Renamed project to CrossPack due to trademark issues.
  • 80 |
81 | 82 |

AVR MacPack 20090319

83 |
    84 |
  • Based on WinAVR 20090313.
  • 85 |
  • New patches from WinAVR fix linker bug which affected 8k devices in avr25 class such as ATTiny85.
  • 86 |
  • Support for new devices: AT90PWM81, AT90SCR100, ATA6289, ATmega16M1, ATmega16U4, ATmega64C1, ATmega64M1, ATmega128RFA1, ATtiny87, ATxmega32A4, ATxmega32D4, ATxmega16A4, ATxmega16D4.
  • 87 |
  • New versions: avr-libc 1.6.6, avrdude 5.6, avarice 2.9, simulavr 0.1.2.6.
  • 88 |
89 | 90 |

AVR MacPack 20081213

91 |
    92 |
  • Removed all ".svn" directories from release.
  • 93 |
  • New versions and patches from WinAVR 20081205: binutils 2.19, gcc 4.3.2, avr-libc 1.6.4, gdb 6.8, avarice 2.8.
  • 94 |
  • These versions and patches bring support for new devices: ATxmega64A3, ATxmega128A3, ATxmega256A3, ATxmega256A3B and ATmega32U6. 95 |
  • 96 |
97 | 98 |

AVR MacPack 20080721

99 |
    100 |
  • Avrdude linked libusb from /usr/local/lib instead of /usr/local/AVRMacPack/lib in version 20080716. This problem was caused by a changed precedence of library paths in Mac OS X 10.5. Only 20080716 is affected since this was the first release built on 10.5.
  • 101 |
102 | 103 |

AVR MacPack 20080716

104 |
    105 |
  • Based on patches from WinAVR 20080610.
  • 106 |
  • Added "binary constants" patch for gcc 3.
  • 107 |
108 | 109 |

AVR MacPack 20080514

110 |
    111 |
  • New versions: gcc 4.3, avr-libc 1.6.2, simulavr 1.2.5.
  • 112 |
  • Based on patches from WinAVR 20080512.
  • 113 |
114 | 115 |

AVR MacPack 20080318

116 |
    117 |
  • Upgraded to avr-libc 1.6.1 patch level 20080228. Gcc 4.2.2 requires this version for some of the newer devices.
  • 118 |
  • Added links to fuse calculators and other related information in manual.
  • 119 |
  • Fixed a problem with changes in /etc/csh.login which caused an error message for users with tcsh as login shell.
  • 120 |
121 | 122 | 123 |

AVR MacPack 20080121

124 |
    125 |
  • Fixed a problem in the template project where Xcode could not find avr-gcc and related tools (problem with PATH environment variable).
  • 126 |
  • Fixed listing of supported devices in manual.
  • 127 |
  • Allow user specific template projects in ~/.AVRMacPack/templates/TemplateProject.
  • 128 |
129 | 130 | 131 |

AVR MacPack 20071201

132 | Cleaner separation into avr-gcc version 3 and 4. We now switch not only gcc, but also avr-libc so that it has been compiled with the same version of gcc. 133 | 134 | 135 |

AVR MacPack 20071126

136 | This is the initial release. 137 | 138 | 139 | -------------------------------------------------------------------------------- /manual-source/resources/logo150.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obdev/CrossPack-AVR/a34385512e77f262a82cee46a2dd46f390837b20/manual-source/resources/logo150.jpg -------------------------------------------------------------------------------- /manual-source/resources/style.css: -------------------------------------------------------------------------------- 1 | /* elements */ 2 | 3 | A:link { text-decoration: none; color: #049; } 4 | A:visited { text-decoration: none; color: #049; } 5 | A:active { text-decoration: none; color: #025; } 6 | A:hover { text-decoration: underline; } 7 | 8 | BODY { 9 | color: #222; 10 | text-align: left; 11 | font-family: Lucida Grande,Verdana,Arial,Helvetica; 12 | font-size: 12px; 13 | margin: 20px; 14 | padding: 0px 0px; 15 | } 16 | TD { 17 | font-size: 12px; 18 | } 19 | 20 | H1 { 21 | font-size: 24px; 22 | color: #334; 23 | margin: 32px 0px; 24 | margin-bottom: 1em; 25 | padding-bottom: 0.2em; 26 | border-bottom: 2px solid #bbb; 27 | line-height: 1.1em; 28 | } 29 | 30 | H2 { 31 | font-size: 14px; 32 | color: #555; 33 | margin: 2em 0em 1em 0px; 34 | padding: 2px 0px 3px 0px; 35 | border-bottom: 1px solid #bbb; 36 | line-height: normal; 37 | } 38 | H3 { font-size: 13px; margin-top: 1.8em; margin-bottom: 0.8em; color: #333; } 39 | H4 { font-size: 12px; margin-bottom: 3px; color: #333; } 40 | H5 { font-size: 11px; margin-bottom: 3px; } 41 | H6 { font-size: 10px; } 42 | 43 | HR.dotted { 44 | border: none; 45 | height: 1px; 46 | background-image: url(images/hdots.gif); 47 | margin: 10px 0px; 48 | padding: 0px; 49 | } 50 | 51 | I { font-family: Helvetica; margin-right: 0.3em; } 52 | INPUT { font-size: 12px; } 53 | PRE { font-family: Courier; font-size: 12px; } 54 | SELECT { font-size: 12px; } 55 | SMALL { font-size: 10px; line-height: 145%; } 56 | TT, KBD { font-family: Monaco, Courier, monospace; font-size: 90%; } 57 | UL { list-style-image: url(images/bullet.png); padding-left: 20px; margin-left: 0px; } 58 | UL UL { list-style: circle outside none; } 59 | OL { list-style-image: none; padding-left: 36px; margin-left: 0px; } 60 | 61 | /* classes */ 62 | 63 | .index { 64 | width: 150px; 65 | padding: 8px 10px; 66 | margin-top: 16px; 67 | height: 100%; 68 | } 69 | 70 | .box { 71 | background-color: #eee; 72 | border: 1px solid #bbb; 73 | border-left-width: 1px; 74 | padding: 8px 10px; 75 | margin-top: 0px; 76 | margin-bottom: 18px; 77 | font-family: Courier, Monaco; 78 | font-size: 12px; 79 | white-space: pre; 80 | line-height: 130%; 81 | width: 580px; 82 | } 83 | 84 | .box.shell { 85 | background-color: #eee; 86 | border-color: #bbb; 87 | } 88 | .box.code { 89 | background-color: #ffee80; 90 | border-color: #ddcc60; 91 | } 92 | .box.shell.header { 93 | margin-top: 12px; 94 | margin-bottom: 0px; 95 | padding: 0px 10px; 96 | border-bottom-width: 0px; 97 | background-color: #bbb; 98 | font-size: 10px; 99 | } 100 | .box.code.header { 101 | margin-top: 12px; 102 | margin-bottom: 0px; 103 | padding: 0px 10px; 104 | border-bottom-width: 0px; 105 | background-color: #ddcc60; 106 | font-size: 10px; 107 | } -------------------------------------------------------------------------------- /mkclean.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ ! -x ./mkclean.sh ]; then 4 | echo "mkclean.sh must be called from the current directory as ./mkclean.sh" 5 | exit 1 6 | fi 7 | 8 | rm -rf compile math temporary-install patches manual packages 9 | -------------------------------------------------------------------------------- /mkdist.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # mkdist.sh 4 | # CrossPack-AVR 5 | # 6 | # Created by Christian Starkjohann on 2012-11-28. 7 | # Copyright (c) 2012 Objective Development Software GmbH. 8 | 9 | pkgUnixName=CrossPack-AVR 10 | pkgPrettyName="CrossPack for AVR Development" 11 | pkgUrlName=crosspack # name used for http://www.obdev.at/$pkgUrlName 12 | pkgVersion=20170210 13 | 14 | # Build dependencies 15 | version_automake=1.15 16 | version_autoconf=2.68 17 | 18 | version_gdb=7.12 19 | version_gmp=6.1.2 20 | version_mpfr=3.1.2 21 | version_mpc=1.0 22 | version_ppl=0.12.1 23 | version_cloog=0.16.2 24 | version_libusb=1.0.21 25 | version_libusb_compat=0.1.5 26 | version_avarice=2.13 27 | version_avrdude=6.3 28 | version_simulavr=0.1.2.7 29 | # simulavr-1.0.0 does not compile 30 | # We want to add simavr to the distribution, but it does not compile easily... 31 | 32 | # The following packages are fetched from Atmel: 33 | atmelToolchainVersion=3.5.4 34 | version_binutils=2.26.20160125 35 | version_gcc=4.9.2 36 | #version_gcc3=3.4.6 37 | #version_headers=??? 38 | version_avrlibc=2.0.0 39 | 40 | debug=false 41 | if [ "$1" = debug ]; then 42 | debug=true 43 | fi 44 | 45 | prefix="/usr/local/$pkgUnixName-$pkgVersion" 46 | configureArgs="--disable-dependency-tracking --disable-nls --disable-werror" 47 | 48 | umask 0022 49 | 50 | xcodepath="$(xcode-select -print-path)" 51 | sysroot="$xcodepath/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk" 52 | 53 | # Do not include original PATH in our PATH to ensure that third party stuff is not found 54 | PATH="$prefix/bin:$xcodepath/usr/bin:$xcodepath/Toolchains/XcodeDefault.xctoolchain/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" 55 | export PATH 56 | 57 | commonCFLAGS="-isysroot $sysroot -mmacosx-version-min=10.6" 58 | # Build libraries for i386 and x86_64, but executables i386 only so that the 59 | # size of the distribution is not unecessary large. 60 | buildCFLAGS="$commonCFLAGS -arch i386 -fno-stack-protector" # used for tool chain 61 | # Why -fno-stack-protector? Gcc 4.7.2 compiled with Xcode 5 aborts with a stack 62 | # protection failure when building libgcc for avrtiny. The problem occurs with -O2 63 | # only, not with -O0. It's hard to debug with the heavy inlining of -O2. Since 64 | # there is no obvious overflow, this is maybe a bug in clang's stack protector. 65 | # In any case, we are not responsible for debugging either of the two compilers, 66 | # so we simply disable the check. 67 | 68 | 69 | ############################################################################### 70 | # Check prerequisites first 71 | ############################################################################### 72 | 73 | releaseNotesVersion=$(sed -n -e '/20[01234][0-9][01][0-9][0-3][0-9]<[/]h/ s/^.*\([0-9]\{8\}\).*$/\1/g p' manual-source/releasenotes.html | head -1) 74 | if ! $debug; then 75 | if [ "$releaseNotesVersion" != "$pkgVersion" ]; then 76 | echo "*** Release notes not up-to-date!" 77 | echo "Latest release notes are for version $releaseNotesVersion, package version is $pkgVersion" 78 | exit 1 79 | fi 80 | fi 81 | 82 | ############################################################################### 83 | # Obtaining the packages from the net 84 | ############################################################################### 85 | 86 | # download a package and unpack it 87 | getPackage() # 88 | { 89 | url="$1" 90 | package=$(basename "$url") 91 | [ "$3" ] && package="$3" 92 | doDownload=no 93 | if [ ! -f "packages/$package" ]; then 94 | doDownload=yes # not yet downloaded 95 | elif ! $debug; then 96 | if [ "$2" = alwaysDownload ]; then 97 | doDownload=yes # release build and download forced 98 | fi 99 | fi 100 | if [ "$doDownload" = yes ]; then 101 | echo "=== Downloading package $package" 102 | rm -f "packages/$package" 103 | curl --location --progress-bar -o "packages/$package" "$url" 104 | if [ $? -ne 0 ] || file "packages/$package" | grep -q HTML; then 105 | echo "################################################################################" 106 | echo "Failed to download $url" 107 | echo "################################################################################" 108 | rm -f "packages/$package" 109 | exit 1 110 | fi 111 | fi 112 | } 113 | 114 | 115 | ############################################################################### 116 | # helper for building fat libraries 117 | ############################################################################### 118 | 119 | lipoHelper() # 120 | { 121 | action="$1" 122 | file="$2" 123 | if [ "$action" = rename ]; then 124 | if echo "$file" | egrep '\.(i386|x86_64)$' >/dev/null; then 125 | : # already renamed 126 | elif arch=$(lipo -info "$file" 2>/dev/null); then # true if lipo is applicable 127 | arch=$(echo $arch | sed -e 's/^.*: \([^:]*\)$/\1/g') 128 | case "$arch" in 129 | x86_64|i386) 130 | mv "$file" "$file.$arch";; 131 | esac 132 | fi 133 | elif [ "$action" = merge ]; then 134 | base=$(echo "$file" | sed -E -e 's/[.](i386|x86_64)$//g') 135 | if [ ! -f "$base.x86_64" ]; then 136 | mv -f "$base.i386" "$base" 137 | elif [ ! -f "$base.i386" ]; then 138 | mv -f "$base.x86_64" "$base" 139 | elif lipo -create -arch i386 "$base.i386" -arch x86_64 "$base.x86_64" -output "$base"; then 140 | rm -f "$base.i386" "$base.x86_64" 141 | fi 142 | else 143 | echo "Invalid action $1" 144 | fi 145 | } 146 | 147 | lipoHelperRecursive() # 148 | { 149 | action="$1" 150 | baseDir="$2" 151 | if [ "$action" = "rename" ]; then 152 | find "$baseDir" -type f -and '(' -name '*.a' -or -name '*.dylib*' -or -name '*.so*' -or -perm -u+x ')' -print | while read i; do 153 | lipoHelper "$action" "$i" 154 | done 155 | else 156 | find "$baseDir" -type f -and -name '*.i386' -print | while read i; do 157 | lipoHelper "$action" "$i" 158 | done 159 | fi 160 | } 161 | 162 | 163 | ############################################################################### 164 | # building the packages 165 | ############################################################################### 166 | 167 | # checkreturn is used to check for exit status of subshell 168 | checkreturn() 169 | { 170 | rval="$?" 171 | if [ "$rval" != 0 ]; then 172 | exit "$rval" 173 | fi 174 | } 175 | 176 | applyPatches() # 177 | { 178 | name="$1" 179 | base=$(echo "$name" | sed -e 's/-[.0-9]\{1,\}$//g') 180 | for patchdir in patches-local; do 181 | for target in "$base" "$name"; do 182 | if [ -d "$patchdir/$target" ]; then 183 | echo "=== applying patches from $patchdir/$target" 184 | ( 185 | cd "compile/$name" 186 | for patch in "../../$patchdir/$target/"*; do 187 | if [ "$patch" != "../$patchdir/$target/*" ]; then 188 | echo " -" "$(basename "$patch")" 189 | if ! patch --silent -f -p0 < "$patch"; then 190 | echo "Patch $patch failed!" 191 | echo "Press enter to continue anyway" 192 | read 193 | fi 194 | fi 195 | done 196 | ) 197 | fi 198 | done 199 | done 200 | } 201 | 202 | unpackPackage() # 203 | { 204 | name="$1" 205 | archive=$(ls "packages/$name"* | grep -E "$name\..+$") # wildcard expands to compression extension 206 | extension=$(echo "$archive" | awk -F . '{print $NF}') 207 | zipOption="-z" 208 | if [ "$extension" = "bz2" ]; then 209 | zipOption="-j" 210 | fi 211 | if [ ! -d compile ]; then 212 | mkdir compile 213 | fi 214 | echo "=== unpacking $name" 215 | rm -rf "compile/$name" 216 | mkdir "compile/tmp" 217 | if [ "$extension" = "zip" ]; then 218 | unzip -d compile/tmp "$archive" 219 | else 220 | tar -x $zipOption -C compile/tmp -f "$archive" 221 | fi 222 | mv compile/tmp/* "compile/$name" 223 | rm -rf compile/tmp 224 | if [ ! -d "compile/$name" ]; then 225 | echo "*** Package $name does not contain expected directory" 226 | exit 1 227 | fi 228 | dir=$(echo "compile/$name/"*) 229 | if [ $(echo "$dir" | wc -w) = 1 ]; then # package contains single dir 230 | mv "$dir"/* "compile/$name" # move everything up one level 231 | rm -rf "$dir" 232 | fi 233 | } 234 | 235 | mergeAVRHeaders() 236 | { 237 | for i in "../avr8-headers"/io?*.h; do 238 | # iotn4313.h is broken in atmel's header package AND in avr-libc-1.8.0. Our 239 | # build mechanism allows to apply a patch to avr-libc-1.8.0 (since it has the 240 | # standard configure/make procedure), but not to Atmel's headers. We therefore 241 | # patch avr-libc and give it precedence over Atmel's headers for iotn4313.h. 242 | # In all other cases Atmel's headers have precedence. 243 | # The same is true for the 2313a. 244 | if [ "$(basename "$i")" != iotn4313.h -a "$(basename "$i")" != iotn2313a.h ]; then 245 | cp -f "$i" include/avr/ 246 | fi 247 | done 248 | if [ -f "../avr8-headers/io.h" ]; then 249 | # We must merge the conditional includes of both versions of io.h since we 250 | # want to build a superset: 251 | awk 'BEGIN { 252 | line = 0; 253 | insertAt = 0; 254 | recordLines = 1; 255 | } 256 | 257 | { 258 | if (file != FILENAME) { # file changed 259 | if (file != "") { 260 | recordLines = 0; # not first file 261 | } 262 | file = FILENAME; 263 | } 264 | if (def != "" && match($0, "^#[ \t]*include")) { 265 | includes[def] = $0; 266 | } else if (match($0, "^#[a-zA-Z]+[ \t]+[(]?defined")) { 267 | if (insertAt == 0) { 268 | insertAt = line; 269 | } 270 | def = $3; 271 | gsub("[^a-zA-Z0-9_]", "", def); 272 | } else { 273 | def = ""; 274 | if (recordLines) { 275 | lines[line++] = $0; 276 | } 277 | } 278 | } 279 | 280 | END { 281 | for (i = 0; i < line; i++) { 282 | if (i == insertAt) { 283 | prefix = "#if"; 284 | for (def in includes) { 285 | printf("%s defined (%s)\n%s\n", prefix, def, includes[def]); 286 | prefix = "#elif"; 287 | } 288 | } 289 | print lines[i]; 290 | } 291 | } 292 | ' "../avr8-headers/io.h" include/avr/io.h > include/avr/io.h.new 293 | mv -f include/avr/io.h.new include/avr/io.h 294 | fi 295 | } 296 | 297 | postConfigurePatches() 298 | { 299 | # Patch config.h so that we do not use strndup(), even if it is available. 300 | # Strndup() is not available on 10.6 and we must not use it in order to 301 | # preserve 10.6 compatibility. 302 | if [ -f config.h ]; then 303 | sed -ibak -e 's/#define.*HAVE_STRNDUP[^0-9A-Za-z].*$/#undef HAVE_STRNDUP/g' config.h 304 | fi 305 | } 306 | 307 | buildPackage() # 308 | { 309 | name="$1" 310 | product="$2" 311 | if [ -f "$product" ]; then 312 | echo "Skipping build of $name because it's already built" 313 | return # the product we generate exists already 314 | fi 315 | shift; shift 316 | echo "################################################################################" 317 | echo "Building $name at $(date +"%Y-%m-%d %H:%M:%S")" 318 | echo "################################################################################" 319 | cwd=$(pwd) 320 | base=$(echo "$name" | sed -e 's/-[.0-9]\{1,\}$//g') 321 | version=$(echo "$name" | sed -e 's/^.*-\([.0-9]\{1,\}\)$/\1/') 322 | unpackPackage "$name" 323 | applyPatches "$name" 324 | ( 325 | cd "compile/$name" 326 | if [ "$base" = avr-binutils ]; then 327 | # we remove version check because we can't guarantee a particular version 328 | sed -ibak 's/ \[m4_fatal(\[Please use exactly Autoconf \]/ \[m4_errprintn(\[Please use exactly Autoconf \]/g' ./config/override.m4 329 | (cd ld; autoreconf) 330 | fi 331 | if [ "$base" = avr-libc ]; then 332 | mergeAVRHeaders 333 | fi 334 | if [ -x ./bootstrap ]; then # avr-libc builds lib tree from this script 335 | ./bootstrap # If the package has a bootstrap script, run it 336 | if [ "$base" = simulavr ]; then 337 | autoconf # additional magic needed for simulavr 338 | ./bootstrap 339 | fi 340 | fi 341 | if [ "$base" = avr-gcc ]; then 342 | # manually clean dependent files, these are not always removed by make distclean 343 | grep -RiIn --exclude-dir zlib 'generated automatically by' . | tr ':' ' ' | while read file line rest; do 344 | if [ "$line" -lt 4 ]; then 345 | echo "removing dependent file $file" 346 | rm "$file" 347 | fi 348 | done 349 | fi 350 | if [ "$base" = avr-gcc -o "$base" = simulavr ]; then # build gcc in separate dir, it will fail otherwise 351 | mkdir build-objects 352 | rm -rf build-objects/* 353 | cd build-objects 354 | rootdir=.. 355 | else 356 | rootdir=. 357 | fi 358 | if [ "$base" != avr-libc ]; then 359 | export CC="xcrun gcc $buildCFLAGS" 360 | export CXX="xcrun g++ $buildCFLAGS" 361 | fi 362 | make distclean 2>/dev/null 363 | echo "cwd=`pwd`" 364 | echo $rootdir/configure --prefix="$prefix" $configureArgs "$@" 365 | $rootdir/configure --prefix="$prefix" $configureArgs "$@" || exit 1 366 | postConfigurePatches 367 | if [ -d $rootdir/bfd ]; then # if we build GNU binutils, ensure we update headers after patching 368 | make # expect this make to fail, but at least we have configured everything 369 | ( 370 | cd $rootdir/bfd 371 | rm -f bfd-in[23].h libbfd.h libcoff.h 372 | make headers 373 | ) 374 | fi 375 | if ! make; then 376 | echo "################################################################################" 377 | echo "Building $name failed." 378 | echo "################################################################################" 379 | exit 1 380 | fi 381 | make install || exit 1 382 | case "$product" in 383 | "$cwd"/*) # install destination is in source tree -> do nothing 384 | echo "package $name is not part of distribution" 385 | ;; 386 | *) # install destination is not in source tree 387 | mkdir "$prefix" 2>/dev/null 388 | mkdir "$prefix/etc" 2>/dev/null 389 | mkdir "$prefix/etc/versions.d" 2>/dev/null 390 | echo "$base: $version" >"$prefix/etc/versions.d/$base" 391 | ;; 392 | esac 393 | ) 394 | checkreturn 395 | } 396 | 397 | copyPackage() # 398 | { 399 | name="$1" 400 | destination="$2" 401 | unpackPackage "$name" 402 | mkdir -p "$destination" 2>/dev/null 403 | echo "=== installing files in $name" 404 | mv "compile/$name/"* "$destination/" 405 | chmod -R a+rX "$destination" 406 | } 407 | 408 | # The following function fixes the library path of a load command in a mach-o 409 | # executable. Yes, this is a hack! 410 | # We need to patch the path in order to preserve 10.6 compatibility when compiling 411 | # with 10.7 SDK: When we link to libreadline, we get libedit as an indirect 412 | # dependency of the binary (in our case: avrdude). Since libreadline links to an 413 | # explicit version of libedit and this version differs between 10.6 and 10.7, we 414 | # need to remove the version number. 415 | fixLoadCommandInBinary() # 416 | { 417 | executable="$1" 418 | searchLib="$2" 419 | replaceLib="$3" 420 | echo "Fixing library $searchLib in $executable" 421 | # we need /bin/echo because sh's built-in echo does not support -n 422 | search=$(/bin/echo -n "$searchLib" | xxd -p | tr -d '\n') 423 | replace=$(/bin/echo -n "$replaceLib" | xxd -p | tr -d '\n') 424 | # now pad $replace to same length as search: 425 | delta=$((${#search} - ${#replace})) 426 | zero="00000000000000000000000000000000000000000000000000000000000000000000000" 427 | replace="$replace${zero:0:$delta}" 428 | cp "$executable" "$executable.orig" 429 | xxd -p "$executable.orig" | tr -d '\n' | sed -e "s/$search/$replace/" | xxd -p -r >"$executable" 430 | rm -f "$executable.orig" 431 | } 432 | 433 | ############################################################################### 434 | # main code 435 | ############################################################################### 436 | 437 | if [ -d "$prefix" -a ! -w "$prefix" -a -x "$prefix/uninstall" ]; then 438 | echo "Please type your password so that we can run uninstall as root:" 439 | if ! sudo "$prefix/uninstall"; then 440 | echo "Aborting because uninstall failed" 441 | exit 1 442 | fi 443 | fi 444 | 445 | if ! "$debug"; then 446 | rm -rf "$installdir" 447 | rm -rf compile 448 | rm -rf "$prefix" 449 | fi 450 | 451 | if [ ! -d packages ]; then 452 | mkdir packages 453 | fi 454 | 455 | echo "Starting download at $(date +"%Y-%m-%d %H:%M:%S")" 456 | 457 | atmelBaseURL="http://distribute.atmel.no/tools/opensource/Atmel-AVR-GNU-Toolchain/$atmelToolchainVersion" 458 | # always download packages from Atmel, they sometimes update patches without updating the package name 459 | getPackage "$atmelBaseURL/avr-binutils.tar.bz2" alwaysDownload "avr-binutils-$version_binutils.tar.bz2" 460 | getPackage "$atmelBaseURL/avr-gcc.tar.bz2" alwaysDownload "avr-gcc-$version_gcc.tar.bz2" 461 | getPackage "$atmelBaseURL/avr8-headers.zip" alwaysDownload 462 | getPackage "$atmelBaseURL/avr-libc.tar.bz2" alwaysDownload "avr-libc-$version_avrlibc.tar.bz2" 463 | # We do not fetch patches available in this directory because they are already applied 464 | 465 | #getPackage http://ftp.sunet.se/pub/gnu/gcc/releases/gcc-"$version_gcc3"/gcc-"$version_gcc3".tar.bz2 466 | 467 | getPackage https://ftp.gnu.org/gnu/automake/automake-"$version_automake".tar.gz 468 | getPackage https://gmplib.org/download/gmp/gmp-"$version_gmp".tar.bz2 469 | getPackage https://ftp.gnu.org/gnu/mpfr/mpfr-"$version_mpfr".tar.bz2 470 | getPackage http://www.multiprecision.org/mpc/download/mpc-"$version_mpc".tar.gz 471 | # We would like to compile with cloog, but linking 32 bit C++ code fails with clang. 472 | #getPackage http://bugseng.com/products/ppl/download/ftp/releases/"$version_ppl"/ppl-"$version_ppl".tar.bz2 473 | #getPackage http://gcc.cybermirror.org/infrastructure/cloog-"$version_cloog".tar.gz 474 | getPackage https://ftp.gnu.org/gnu/autoconf/autoconf-"$version_autoconf".tar.gz 475 | getPackage https://ftp.gnu.org/gnu/gdb/gdb-"$version_gdb".tar.gz 476 | getPackage http://downloads.sourceforge.net/avarice/avarice-"$version_avarice".tar.bz2 477 | getPackage https://download.savannah.gnu.org/releases/avr-libc/avr-libc-manpages-"$version_avrlibc".tar.bz2 478 | getPackage https://download.savannah.gnu.org/releases/avr-libc/avr-libc-user-manual-"$version_avrlibc".tar.bz2 479 | getPackage http://downloads.sourceforge.net/project/libusb/libusb-1.0/libusb-"$version_libusb"/libusb-"$version_libusb".tar.bz2 480 | getPackage http://downloads.sourceforge.net/project/libusb/libusb-compat-0.1/libusb-compat-"$version_libusb_compat"/libusb-compat-"$version_libusb_compat".tar.bz2 481 | getPackage https://download.savannah.gnu.org/releases/avrdude/avrdude-"$version_avrdude".tar.gz 482 | getPackage https://download.savannah.gnu.org/releases/avrdude/avrdude-doc-"$version_avrdude".tar.gz 483 | getPackage https://download.savannah.gnu.org/releases/simulavr/simulavr-"$version_simulavr".tar.gz 484 | 485 | installdir="$(pwd)/temporary-install" 486 | if [ ! -d "$installdir" ]; then 487 | mkdir "$installdir" 488 | fi 489 | 490 | 491 | ######################################################################### 492 | # Build sources 493 | ######################################################################### 494 | 495 | echo "Starting build at $(date +"%Y-%m-%d %H:%M:%S")" 496 | 497 | ######################################################################### 498 | # math and other prerequisites 499 | ######################################################################### 500 | export M4="xcrun m4" 501 | buildPackage autoconf-"$version_autoconf" "$installdir/autoconf/bin/autoconf" --prefix="$installdir/autoconf" 502 | unset M4 503 | export PATH="$installdir/autoconf/bin:$PATH" 504 | 505 | buildPackage automake-"$version_automake" "$installdir/automake/bin/automake" --prefix="$installdir/automake" 506 | export PATH="$installdir/automake/bin:$PATH" 507 | 508 | buildPackage gmp-"$version_gmp" "$installdir/lib/libgmp.a" --prefix="$installdir" --enable-cxx --enable-shared=no --disable-assembly 509 | buildPackage mpfr-"$version_mpfr" "$installdir/lib/libmpfr.a" --with-gmp="$installdir" --prefix="$installdir" --enable-shared=no 510 | buildPackage mpc-"$version_mpc" "$installdir/lib/libmpc.a" --with-gmp="$installdir" --with-mpfr="$installdir" --prefix="$installdir" --enable-shared=no 511 | #buildPackage ppl-"$version_ppl" "$installdir/lib/libppl.a" --with-gmp="$installdir" --prefix="$installdir" --enable-shared=no 512 | #buildPackage cloog-"$version_cloog" "$installdir/lib/libcloog-isl.a" --with-gmp-prefix="$installdir" --prefix="$installdir" --enable-shared=no 513 | 514 | rm -f "$installdir/lib/"*.dylib # ensure we have no shared libs 515 | 516 | ######################################################################### 517 | # additional goodies 518 | ######################################################################### 519 | ( 520 | for arch in i386 x86_64; do 521 | buildCFLAGS="$commonCFLAGS -arch $arch" 522 | buildPackage libusb-"$version_libusb" "$prefix/lib/libusb-1.0.a" --disable-shared 523 | export LIBUSB_1_0_CFLAGS="-I$prefix/include/libusb-1.0" 524 | export LIBUSB_1_0_LIBS="-lusb" 525 | buildPackage libusb-compat-"$version_libusb_compat" "$prefix/lib/libusb.a" --disable-shared 526 | rm -f "$prefix/lib"/libusb*.dylib 527 | for file in "$prefix/lib"/libusb*.a; do 528 | if [ "$file" != "$prefix/lib/libusb*.a" ]; then 529 | lipoHelper rename "$file" 530 | fi 531 | done 532 | done 533 | for file in "$prefix/lib"/libusb*.a.i386; do 534 | if [ "$file" != "$prefix/lib/libusb*.a.i386" ]; then 535 | lipoHelper merge "$file" 536 | fi 537 | done 538 | ) 539 | checkreturn 540 | 541 | ######################################################################### 542 | # binutils and prerequisites 543 | ######################################################################### 544 | buildPackage avr-binutils-"$version_binutils" "$prefix/bin/avr-nm" --target=avr 545 | if [ ! -f "$prefix/bfd/lib/libbfd.a" ]; then 546 | mkdir -p "$prefix/bfd/include" # copy bfd directory manually 547 | mkdir "$prefix/bfd/lib" 548 | cp compile/avr-binutils-"$version_binutils"/bfd/libbfd.a "$prefix/bfd/lib/" 549 | cp compile/avr-binutils-"$version_binutils"/bfd/bfd.h "$prefix/bfd/include/" 550 | cp compile/avr-binutils-"$version_binutils"/include/ansidecl.h "$prefix/bfd/include/" 551 | cp compile/avr-binutils-"$version_binutils"/include/symcat.h "$prefix/bfd/include/" 552 | fi 553 | if [ ! -f "$prefix/lib/libiberty.a" ]; then 554 | mkdir "$prefix/lib" 555 | cp compile/avr-binutils-"$version_binutils"/libiberty/libiberty.a "$prefix/lib/" 556 | fi 557 | 558 | ######################################################################### 559 | # gcc bootstrap 560 | ######################################################################### 561 | buildPackage avr-gcc-"$version_gcc" "$prefix/bin/avr-gcc" --target=avr --enable-languages=c --disable-libssp --disable-libada --with-dwarf2 --disable-shared --with-avrlibc=yes --with-gmp="$installdir" --with-mpfr="$installdir" --with-mpc="$installdir" 562 | 563 | # --with-ppl="$installdir" --with-cloog="$installdir" --enable-cloog-backend=isl 564 | # We would like to compile with cloog, but linking 32 bit C++ code fails with clang. 565 | 566 | # If we want to support avr-gcc version 3.x, we want to have it available as 567 | # separate binary avr-gcc3, not with avr-gcc-select. Unfortunately, we also need 568 | # a separate compile of avr-libc with gcc 3.x (other built-in functions etc). 569 | # We don't enable this until we have found a good way to hold both compiles of 570 | # avr-libc in parallel. 571 | #for i in avr-ar avr-ranlib; do 572 | # ln -s $i "$prefix/bin/${i}3" 573 | #done 574 | #buildPackage gcc-"$version_gcc3" "$prefix/bin/avr-gcc3" --target=avr --enable-languages=c,c++ --disable-libssp --program-suffix=3 --program-prefix="avr-" 575 | #for i in avr-ar avr-ranlib; do 576 | # rm -f "$prefix/bin/${i}3" 577 | #done 578 | 579 | ######################################################################### 580 | # avr-libc 581 | ######################################################################### 582 | unpackPackage "avr8-headers" 583 | buildPackage avr-libc-"$version_avrlibc" "$prefix/avr/lib/libc.a" --host=avr --enable-device-lib 584 | copyPackage avr-libc-user-manual-"$version_avrlibc" "$prefix/doc/avr-libc" 585 | copyPackage avr-libc-manpages-"$version_avrlibc" "$prefix/man" 586 | 587 | ######################################################################### 588 | # avr-gcc full build 589 | ######################################################################### 590 | buildPackage avr-gcc-"$version_gcc" "$prefix/bin/avr-g++" --target=avr --enable-languages=c,c++ --disable-libssp --disable-libada --with-dwarf2 --disable-shared --with-avrlibc=yes --with-gmp="$installdir" --with-mpfr="$installdir" --with-mpc="$installdir" 591 | 592 | ######################################################################### 593 | # gdb and simulavr 594 | ######################################################################### 595 | buildPackage gdb-"$version_gdb" "$prefix/bin/avr-gdb" --target=avr --without-python 596 | ( 597 | binutils="$(pwd)/compile/avr-binutils-$version_binutils" 598 | buildCFLAGS="$buildCFLAGS $("$prefix/bin/libusb-config" --cflags) -I$binutils/bfd -I$binutils/include -O" 599 | export LDFLAGS="$LDFLAGS $("$prefix/bin/libusb-config" --libs) -L$binutils/bfd -lz -L$binutils/libiberty -liberty" 600 | buildPackage avarice-"$version_avarice" "$prefix/bin/avarice" 601 | ) 602 | checkreturn 603 | ( 604 | export CFLAGS="-Wno-error -g -O2" 605 | buildPackage simulavr-"$version_simulavr" "$prefix/bin/simulavr" --with-bfd="$prefix/bfd" --with-libiberty="$prefix" --disable-static --enable-dependency-tracking 606 | ) 607 | checkreturn 608 | 609 | ######################################################################### 610 | # avrdude 611 | ######################################################################### 612 | ( 613 | buildCFLAGS="$buildCFLAGS $("$prefix/bin/libusb-config" --cflags)" 614 | export LDFLAGS="$LDFLAGS $("$prefix/bin/libusb-config" --libs)" 615 | buildPackage avrdude-"$version_avrdude" "$prefix/bin/avrdude" 616 | fixLoadCommandInBinary "$prefix/bin/avrdude" /usr/lib/libedit.3.dylib /usr/lib/libedit.dylib 617 | copyPackage avrdude-doc-"$version_avrdude" "$prefix/doc/avrdude" 618 | if [ ! -f "$prefix/doc/avrdude/index.html" ]; then 619 | ln -s avrdude.html "$prefix/doc/avrdude/index.html" 620 | fi 621 | ) 622 | checkreturn 623 | 624 | ######################################################################### 625 | # ensure that we don't link anything local: 626 | ######################################################################### 627 | libErrors=$(find "$prefix" -type f -perm +0100 -print | while read file; do 628 | locallibs=$(otool -L "$file" | tail -n +2 | grep '^/usr/local/') 629 | if [ -n "$locallibs" ]; then 630 | echo "*** $file uses local libraries:" 631 | echo "$locallibs" 632 | fi 633 | done) 634 | 635 | if [ -n "$libErrors" ]; then 636 | echo "################################################################################" 637 | echo "Aborting build due to above errors" 638 | echo "################################################################################" 639 | exit 1 640 | fi 641 | 642 | ######################################################################### 643 | # basic tests 644 | ######################################################################### 645 | tmpfile="/tmp/test-$$.elf" 646 | rm -rf "$tmpfile" 647 | echo "int main(void) { return 0; }" | "$prefix/bin/avr-gcc" -x c -o "$tmpfile" - 648 | if [ ! -f "$tmpfile" ]; then 649 | echo "################################################################################" 650 | echo "Aborting build because avr-gcc cannot compile C code" 651 | echo "################################################################################" 652 | exit 1 653 | fi 654 | 655 | rm -rf "$tmpfile" 656 | echo "int main(void) { return 0; }" | "$prefix/bin/avr-gcc" -x c++ -o "$tmpfile" - 657 | if [ ! -f "$tmpfile" ]; then 658 | echo "################################################################################" 659 | echo "Aborting build because avr-gcc cannot compile C++ code" 660 | echo "################################################################################" 661 | exit 1 662 | fi 663 | rm -f "$tmpfile" 664 | 665 | for i in "$prefix/bin/"*; do 666 | case $(basename "$i") in 667 | avr-gcc-ar|avr-gcc-nm|avr-gcc-ranlib) 668 | ;; 669 | *) 670 | if [ "$(head -c 2 "$i")" != "#!" ]; then 671 | "$i" --help >/dev/null 2>&1 672 | rval=$? 673 | if [ "$rval" != 0 -a "$rval" != 1 ]; then # Those executables which don't understand --help, exit with status 1 674 | echo "*** Cannot execute $i, rval=$rval" 675 | exit 1 676 | fi 677 | fi 678 | ;; 679 | esac 680 | done 681 | 682 | ######################################################################### 683 | # Create shell scripts and supporting files 684 | ######################################################################### 685 | rm -f "$prefix/versions.txt" 686 | cat "$prefix/etc/versions.d"/* >"$prefix/versions.txt" 687 | echo "stripping all executables" 688 | find "$prefix" -type f -perm -u+x -exec strip '{}' \; 2>/dev/null 689 | 690 | # avr-man 691 | cat >"$prefix/bin/avr-man" <<-EOF 692 | #!/bin/sh 693 | exec man -M "$prefix/man:$prefix/share/man" "\$@" 694 | EOF 695 | chmod a+x "$prefix/bin/avr-man" 696 | 697 | # avr-info 698 | cat >"$prefix/bin/avr-info" <<-EOF 699 | #!/bin/sh 700 | exec info -d "$prefix/share/info" "\$@" 701 | EOF 702 | chmod a+x "$prefix/bin/avr-info" 703 | 704 | # avr-help 705 | cat >"$prefix/bin/avr-help" <<-EOF 706 | #!/bin/sh 707 | exec open "$prefix/manual/index.html" 708 | EOF 709 | chmod a+x "$prefix/bin/avr-help" 710 | 711 | # avr-gcc-select 712 | cat > "$prefix/bin/avr-gcc-select" <<-EOF 713 | #!/bin/sh 714 | echo "avr-gcc-select is not supported any more." 715 | echo "This version of $pkgPrettyName comes with gcc 4 only." 716 | exit 0 717 | EOF 718 | chmod a+x "$prefix/bin/avr-gcc-select" 719 | 720 | # uninstall script 721 | cat >"$prefix/uninstall" <<-EOF 722 | #!/bin/sh 723 | if [ "\$1" != nocheck ]; then 724 | if [ "\$(whoami)" != root ]; then 725 | echo "\$0 must be run as root, use \\"sudo \$0\\"" 726 | exit 1 727 | fi 728 | fi 729 | echo "Are you sure you want to uninstall $pkgPrettyName $pkgVersion?" 730 | echo "[y/N]" 731 | read answer 732 | if echo "\$answer" | egrep -i 'y|yes' >/dev/null; then 733 | echo "Starting uninstall." 734 | if cd "$prefix/.."; then 735 | rm -f "$pkgUnixName" 736 | fi 737 | rm -rf "$prefix" 738 | rm -rf "/etc/paths.d/50-at.obdev.$pkgUnixName" 739 | rm -f "/Applications/$pkgUnixName-Manual.html" 740 | rm -rf "/Library/Receipts/$pkgUnixName.pkg" 741 | echo "$pkgPrettyName is now removed." 742 | else 743 | echo "Uninstall aborted." 744 | fi 745 | EOF 746 | chmod a+x "$prefix/uninstall" 747 | 748 | # avr-project 749 | cat >"$prefix/bin/avr-project" <<-EOF 750 | #!/bin/sh 751 | if [ \$# != 1 ]; then 752 | echo "usage: \$0 " 1>&2 753 | exit 1 754 | fi 755 | if [ "\$1" = "--help" -o "\$1" = "-h" ]; then 756 | { 757 | echo "This command creates an empty project with template files"; 758 | echo 759 | echo "usage: \$0 " 760 | } 1>&2 761 | exit 0; 762 | fi 763 | 764 | name=\$(basename "\$1") 765 | dir=\$(dirname "\$1") 766 | cd "\$dir" 767 | if [ -x "\$name" ]; then 768 | echo "An object named \$name already exists." 1>&2 769 | echo "Please delete this object and try again." 1>&2 770 | exit 1 771 | fi 772 | template=~/.$pkgUnixName/templates/TemplateProject 773 | if [ ! -d "\$template" ]; then 774 | template="$prefix/etc/templates/TemplateProject" 775 | fi 776 | echo "Using template: \$template" 777 | cp -R "\$template" "\$name" || exit 1 778 | cd "\$name" || exit 1 779 | mv TemplateProject.xcodeproj "\$name.xcodeproj" 780 | EOF 781 | chmod a+x "$prefix/bin/avr-project" 782 | 783 | # templates 784 | rm -rf "$prefix/etc/templates" 785 | cp -R "templates" "$prefix/etc/" 786 | ( 787 | if cd "$prefix/etc/templates/TemplateProject/TemplateProject.xcodeproj"; then 788 | rm -rf *.mode1 *.pbxuser xcuserdata project.xcworkspace/xcuserdata 789 | fi 790 | ) 791 | 792 | # manual 793 | ( 794 | cd manual-source 795 | ./mkmanual.sh "$prefix" "$pkgPrettyName" 796 | ) 797 | rm -rf "$prefix/manual" 798 | mv "manual" "$prefix/" 799 | 800 | 801 | ######################################################################### 802 | # Mac OS X Package creation 803 | ######################################################################### 804 | 805 | echo "Starting package creation at $(date +"%Y-%m-%d %H:%M:%S")" 806 | 807 | # remove files which should not make it into the package 808 | chmod -R a+rX "$prefix" 809 | find "$prefix" -type f -name '.DS_Store' -exec rm -f '{}' \; 810 | find "$prefix" -type f \( -name '*.i386' -or -name '*.x86_64' \) -print -exec rm -f '{}' \; 811 | 812 | echo "=== Making Mac OS X Package" 813 | pkgroot="/tmp/$pkgUnixName-root-$$" 814 | rm -rf "$pkgroot" 815 | mkdir "$pkgroot" 816 | mkdir "$pkgroot/usr" 817 | mkdir "$pkgroot/usr/local" 818 | 819 | # Do not use cp -a below because it does not preserve hard links. 820 | tar -C "$(dirname "$prefix")" -c -f - "$(basename "$prefix")" | tar -C "$pkgroot/usr/local" -x -f - 821 | 822 | osxpkgtmp="/tmp/osxpkg-$$" 823 | rm -rf "$osxpkgtmp" 824 | cp -a package-info "$osxpkgtmp" 825 | find "$osxpkgtmp" \( -name '*.plist' -or -name '*.rtf' -or -name '*.html' -or -name '*.txt' -or -name 'post*' \) -print | while read i; do 826 | echo "Running substitution on $i" 827 | cp "$i" "$i.tmp" # create file with same permissions (is overwritten in next line) 828 | sed -e "s|%version%|$pkgVersion|g" -e "s|%pkgPrettyName%|$pkgPrettyName|g" -e "s|%prefix%|$prefix|g" -e "s|%pkgUnixName%|$pkgUnixName|g" -e "s|%pkgUrlName%|$pkgUrlName|g" "$i" > "$i.tmp" 829 | rm -f "$i" 830 | mv "$i.tmp" "$i" 831 | done 832 | 833 | echo "Building package..." 834 | 835 | rm -rf "/tmp/$pkgUnixName-flat.pkg" 836 | pkgbuild --identifier at.obdev.$pkgUnixName --scripts "$osxpkgtmp/scripts" --version "$pkgVersion" --install-location / --root "$pkgroot" "/tmp/$pkgUnixName-flat.pkg" 837 | distfile="/tmp/$pkgUnixName-$$.dist" 838 | cat >"$distfile" < 840 | 841 | $pkgPrettyName 842 | 843 | 844 | 845 | 846 | 847 | 848 | 849 | 850 | 851 | 852 | 853 | 854 | 855 | 856 | $pkgUnixName-flat.pkg 857 | 858 | EOF 859 | productbuild --distribution "$distfile" --package-path /tmp --resources "$osxpkgtmp/Resources" "/tmp/$pkgUnixName.pkg" 860 | rm -f "$distfile" 861 | rm -rf "/tmp/$pkgUnixName-flat.pkg" 862 | rm -rf "$pkgroot" 863 | 864 | 865 | ######################################################################### 866 | # Disk Image 867 | ######################################################################### 868 | 869 | echo "Starting disk image creation at $(date +"%Y-%m-%d %H:%M:%S")" 870 | 871 | rwImage="/tmp/$pkgUnixName-$pkgVersion-rw-$$.dmg" # temporary disk image 872 | dmg="/tmp/$pkgUnixName-$pkgVersion.dmg" 873 | 874 | mountpoint="/Volumes/$pkgUnixName" 875 | 876 | # Unmount remainings from previous attempts so that we can be sure that 877 | # We don't get a digit-suffix for our mount point 878 | for i in "$mountpoint"*; do 879 | hdiutil eject "$i" 2>/dev/null 880 | done 881 | 882 | # Create a new disk image and mount it 883 | rm -f "$rwImage" 884 | hdiutil create -type UDIF -fs HFS+ -fsargs "-c c=64,a=16,e=16" -nospotlight -volname "$pkgUnixName" -size 65536k "$rwImage" 885 | hdiutil attach -readwrite -noverify -noautoopen "$rwImage" 886 | 887 | # Copy our data to the disk image: 888 | # Readme: 889 | cp -a "$osxpkgtmp/Readme.rtf" "/Volumes/$pkgUnixName/Readme.rtf" 890 | # Package: 891 | cp -a "/tmp/$pkgUnixName.pkg" "/Volumes/$pkgUnixName/" 892 | 893 | # Now set Finder options, window size and position and Finder options: 894 | # Note: 895 | # Window bounds is {topLeftX, topLeftY, bottomRightX, bottomRightY} in flipped coordinates 896 | # Icon posistions are icon center, measured from top (flipped coordinates) 897 | echo "Starting AppleScript" 898 | osascript </dev/null 923 | 924 | # And convert it to a compressed read-only image (zlib is smaller than bzip2): 925 | rm -f "$dmg" 926 | #hdiutil convert -format UDBZ -o "$dmg" "$rwImage" 927 | hdiutil convert -format UDZO -imagekey zlib-level=9 -o "$dmg" "$rwImage" 928 | 929 | # Remove read-write version of image because it opens automatically when we 930 | # double-click the read-only image. 931 | rm -f "$rwImage" 932 | open $(dirname "$dmg") 933 | 934 | 935 | ######################################################################### 936 | # Cleanup 937 | ######################################################################### 938 | 939 | echo "=== cleaning up..." 940 | rm -rf "$osxpkgtmp" 941 | if ! "$debug"; then 942 | rm -f "/tmp/$pkgUnixName.pkg" 943 | rm -rf compile # source and objects are HUGE 944 | fi 945 | echo "... done" 946 | 947 | echo "Finished at $(date +"%Y-%m-%d %H:%M:%S")" 948 | -------------------------------------------------------------------------------- /package-info/Readme.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw12240\paperh15840\vieww9600\viewh8400\viewkind0 5 | \pard\tx1440\tx2880\tx4320\tx5760\tx7200 6 | 7 | \f0\fs20 \cf0 For more information about %pkgPrettyName% please visit http://www.obdev.at/%pkgUrlName%/\ 8 | \pard\tx1440\tx2880\tx4320\tx5760\tx7200 9 | 10 | \fs24 \cf0 \ 11 | \ 12 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 13 | 14 | \b\fs48 \cf0 Welcome to %pkgPrettyName%!\ 15 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 16 | 17 | \b0\fs24 \cf0 \ 18 | \pard\pardeftab720 19 | \cf0 \CocoaLigature0 %pkgPrettyName% is a development environment for Atmel's AVR microcontrollers running on Apple's Mac OS X, similar to AVR Studio on Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE downloader and several other useful tools.\ 20 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 21 | \cf0 \ 22 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 23 | 24 | \b\fs28 \cf0 Installing %pkgPrettyName%\ 25 | 26 | \fs12 \ 27 | 28 | \b0\fs24 %pkgPrettyName% comes as a Mac OS X installer package. Simply double-click %pkgUnixName%.pkg to install. Please restart Terminal after installation to make sure that it inherits the new set of environment variables.\ 29 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 30 | \cf0 \CocoaLigature1 \ 31 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 32 | 33 | \b\fs28 \cf0 \CocoaLigature0 Upgrading\ 34 | 35 | \fs12 \ 36 | 37 | \b0\fs24 %pkgPrettyName% installs into /usr/local/%pkgUnixName%- and /usr/local/%pkgUnixName% is always a symbolic link to the version which has been installed last. Several versions of %pkgPrettyName% can therefore coexist. If you want only one version, remove the old installation before installing the new package, or delete it any time later from /usr/local/.\ 38 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 39 | \cf0 \CocoaLigature1 \ 40 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 41 | 42 | \b\fs28 \cf0 \CocoaLigature0 Software Licenses\ 43 | 44 | \fs12 \ 45 | 46 | \b0\fs24 All software in this package is distributed under the terms of the GNU General Public License version 2, except AVR Libc which is distributed under a more liberal license. See the manual for the full text of these licenses.\ 47 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 48 | \cf0 \CocoaLigature1 \ 49 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 50 | 51 | \b\fs28 \cf0 \CocoaLigature0 More Information\ 52 | 53 | \fs12 \ 54 | 55 | \b0\fs24 More information is available after installation. Type "avr-help" in a Terminal window to open the manual. An alias to the manual is also created in the Applications folder.\ 56 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 57 | \cf0 \CocoaLigature1 \ 58 | \pard\tx1440\tx2880\tx4320\tx5760\tx7200 59 | \cf0 __________________________________________\ 60 | \pard\tx1440\tx2880\tx4320\tx5760\tx7200 61 | 62 | \fs18 \cf0 Copyright 2012, OBJECTIVE DEVELOPMENT Software GmbH.} -------------------------------------------------------------------------------- /package-info/Resources/background.jp2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/obdev/CrossPack-AVR/a34385512e77f262a82cee46a2dd46f390837b20/package-info/Resources/background.jp2 -------------------------------------------------------------------------------- /package-info/Resources/en.lproj/ReadMe.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | \paperw12240\paperh15840\vieww9600\viewh8400\viewkind0 5 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 6 | 7 | \f0\b\fs48 \cf0 Getting Started with %pkgPrettyName%\ 8 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 9 | 10 | \b0\fs24 \cf0 \ 11 | %pkgPrettyName% has no Graphic User Interface, it consists of command line tools only. For help with the package, type "avr-help" in a Terminal window. This opens the manual in your favorite web browser. An alias to this manual is also created in the Applications folder during installation.\ 12 | 13 | \fs12 \ 14 | 15 | \b\fs24 Please restart Terminal after the initial installation!\ 16 | } -------------------------------------------------------------------------------- /package-info/Resources/en.lproj/Welcome.rtf: -------------------------------------------------------------------------------- 1 | {\rtf1\ansi\ansicpg1252\cocoartf1138\cocoasubrtf320 2 | {\fonttbl\f0\fswiss\fcharset0 Helvetica;} 3 | {\colortbl;\red255\green255\blue255;} 4 | {\*\listtable{\list\listtemplateid1\listhybrid{\listlevel\levelnfc23\levelnfcn23\leveljc0\leveljcn0\levelfollow0\levelstartat1\levelspace360\levelindent0{\*\levelmarker \{disc\}}{\leveltext\leveltemplateid1\'01\uc0\u8226 ;}{\levelnumbers;}\fi-360\li720\lin720 }{\listname ;}\listid1}} 5 | {\*\listoverridetable{\listoverride\listid1\listoverridecount0\ls1}} 6 | \paperw12240\paperh15840\vieww9600\viewh8400\viewkind0 7 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 8 | 9 | \f0\b\fs48 \cf0 Welcome to %pkgPrettyName% %version%\ 10 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 11 | 12 | \b0\fs24 \cf0 \ 13 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 14 | 15 | \b\fs28 \cf0 \CocoaLigature0 What is %pkgPrettyName%?\ 16 | 17 | \fs12 \ 18 | 19 | \b0\fs24 %pkgPrettyName% is a development environment for Atmel's AVR microcontrollers running on Apple's Mac OS X, similar to AVR Studio on Windows. It consists of the GNU compiler suite, a C library for the AVR, the AVRDUDE downloader and several other useful tools.\ 20 | \pard\tx566\tx1133\tx1700\tx2267\tx2834\tx3401\tx3968\tx4535\tx5102\tx5669\tx6236\tx6803\pardirnatural 21 | \cf0 \CocoaLigature1 \ 22 | \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\tx7280\tx7840\tx8400\tx8960\tx9520\tx10080\tx10640\tx11200\tx11760\tx12320\tx12880\tx13440\tx14000\tx14560\tx15120\tx15680\tx16240\tx16800\tx17360\tx17920\tx18480\tx19040\tx19600\tx20160\tx20720\tx21280\tx21840\tx22400\tx22960\tx23520\tx24080\tx24640\tx25200\tx25760\tx26320\tx26880\tx27440\tx28000\tx28560\tx29120\tx29680\tx30240\tx30800\tx31360\tx31920\tx32480\tx33040\tx33600\tx34160\tx34720\tx35280\tx35840\tx36400\tx36960\tx37520\tx38080\tx38640\tx39200\tx39760\tx40320\tx40880\tx41440\tx42000\tx42560\tx43120\tx43680\tx44240\tx44800\tx45360\tx45920\tx46480\tx47040\tx47600\tx48160\tx48720\tx49280\tx49840\tx50400\tx50960\tx51520\tx52080\tx52640\tx53200\tx53760\tx54320\tx54880\tx55440\tx56000\pardirnatural 23 | 24 | \b\fs28 \cf0 \CocoaLigature0 Features\ 25 | 26 | \fs12 \ 27 | \pard\tx220\tx440\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li440\fi-440 28 | \ls1\ilvl0 29 | \b0\fs24 \cf0 \CocoaLigature1 {\listtext \'95 }Easy installation and removal.\CocoaLigature0 \ 30 | {\listtext \'95 }Does not depend on Xcode for building AVR code.\ 31 | \pard\tx220\tx440\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\li440\fi-440 32 | \ls1\ilvl0\cf0 {\listtext \'95 }Runs on Mac OS X 10.6 (Snow Leopard) and higher.\ 33 | {\listtext \'95 }Patched gcc to support more devices (at least as many as AVR Studio)\ 34 | {\listtext \'95 }Includes gdb for debugging with simulavr and avarice.\ 35 | } -------------------------------------------------------------------------------- /package-info/scripts/postinstall: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Parameters passed: 3 | # $1: full path to the installation package (xxx.pkg) 4 | # $2: full path to destination (/) 5 | # $3: mountpoint of destination volume (/) 6 | # $4: root directory for current system folder (/) 7 | 8 | realPrefix="%prefix%" 9 | genericPrefix=$(echo "$realPrefix" | sed -e 's/-[0-9.]*$//g') 10 | pkgUnixName=$(basename "$genericPrefix") 11 | 12 | rm -f "$genericPrefix" 13 | ln -s `basename "$realPrefix"` "$genericPrefix" 14 | ln -s "$genericPrefix/manual/index.html" "/Applications/$pkgUnixName-Manual.html" 15 | 16 | echo "$genericPrefix/bin" >"/etc/paths.d/50-at.obdev.$pkgUnixName" 17 | 18 | (sleep 3; open "$genericPrefix/manual/index.html") & # Wait until the user realized that install is ready 19 | 20 | exit 0 21 | -------------------------------------------------------------------------------- /patches-local/avr-libc-1.8.0/010-iotn2313a-header.patch: -------------------------------------------------------------------------------- 1 | diff -ruwN avr-libc-1.8.0.orig/include/avr/iotn2313a.h avr-libc-1.8.0/include/avr/iotn2313a.h 2 | --- include/avr/iotn2313a.h 2011-12-29 09:51:50.000000000 +0100 3 | +++ include/avr/iotn2313a.h 2013-02-11 23:16:25.000000000 +0100 4 | @@ -68,7 +68,8 @@ 5 | #define USBS 3 6 | #define UPM0 4 7 | #define UPM1 5 8 | -#define UMSEL 6 9 | +#define UMSEL0 6 10 | +#define UMSEL1 7 11 | 12 | #define PCMSK1 _SFR_IO8(0x004) 13 | #define PCINT8 0 14 | @@ -303,7 +304,7 @@ 15 | #define EEAR5 5 16 | #define EEAR6 6 17 | 18 | -#define PCMSK _SFR_IO8(0x020) 19 | +#define PCMSK0 _SFR_IO8(0x020) 20 | #define PCINT0 0 21 | #define PCINT1 1 22 | #define PCINT2 2 23 | @@ -528,13 +529,17 @@ 24 | #define OCIE1A 6 25 | #define TOIE1 7 26 | 27 | -#define EIFR _SFR_IO8(0x03A) 28 | -#define PCIF 5 29 | +#define GIFR _SFR_IO8(0x03A) 30 | +#define PCIF1 3 31 | +#define PCIF2 4 32 | +#define PCIF0 5 33 | #define INTF0 6 34 | #define INTF1 7 35 | 36 | #define GIMSK _SFR_IO8(0x03B) 37 | -#define PCIE 5 38 | +#define PCIE1 3 39 | +#define PCIE2 4 40 | +#define PCIE0 5 41 | #define INT0 6 42 | #define INT1 7 43 | 44 | @@ -563,12 +568,12 @@ 45 | #define TIMER1_OVF_vect _VECTOR(5) /* Timer/Counter1 Overflow */ 46 | #define TIMER0_OVF_vect_num 6 47 | #define TIMER0_OVF_vect _VECTOR(6) /* Timer/Counter0 Overflow */ 48 | -#define USART_RX_vect_num 7 49 | -#define USART_RX_vect _VECTOR(7) /* USART, Rx Complete */ 50 | -#define USART_UDRE_vect_num 8 51 | -#define USART_UDRE_vect _VECTOR(8) /* USART Data Register Empty */ 52 | -#define USART_TX_vect_num 9 53 | -#define USART_TX_vect _VECTOR(9) /* USART, Tx Complete */ 54 | +#define USART0_RX_vect_num 7 55 | +#define USART0_RX_vect _VECTOR(7) /* USART, Rx Complete */ 56 | +#define USART0_UDRE_vect_num 8 57 | +#define USART0_UDRE_vect _VECTOR(8) /* USART Data Register Empty */ 58 | +#define USART0_TX_vect_num 9 59 | +#define USART0_TX_vect _VECTOR(9) /* USART, Tx Complete */ 60 | #define ANA_COMP_vect_num 10 61 | #define ANA_COMP_vect _VECTOR(10) /* Analog Comparator */ 62 | #define PCINT_B_vect_num 11 63 | @@ -583,14 +588,14 @@ 64 | #define USI_START_vect _VECTOR(15) /* USI Start Condition */ 65 | #define USI_OVERFLOW_vect_num 16 66 | #define USI_OVERFLOW_vect _VECTOR(16) /* USI Overflow */ 67 | -#define WDT_OVERFLOW_vect_num 18 68 | -#define WDT_OVERFLOW_vect _VECTOR(18) /* Watchdog Timer Overflow */ 69 | -#define PCINT_D_vect_num 20 70 | -#define PCINT_D_vect _VECTOR(20) /* Pin Change Interrupt Request D */ 71 | #define EEPROM_Ready_vect_num 17 72 | #define EEPROM_Ready_vect _VECTOR(17) /* */ 73 | +#define WDT_OVERFLOW_vect_num 18 74 | +#define WDT_OVERFLOW_vect _VECTOR(18) /* Watchdog Timer Overflow */ 75 | #define PCINT_A_vect_num 19 76 | #define PCINT_A_vect _VECTOR(19) /* Pin Change Interrupt Request A */ 77 | +#define PCINT_D_vect_num 20 78 | +#define PCINT_D_vect _VECTOR(20) /* Pin Change Interrupt Request D */ 79 | 80 | #define _VECTOR_SIZE 2 /* Size of individual vector. */ 81 | #define _VECTORS_SIZE (21 * _VECTOR_SIZE) 82 | -------------------------------------------------------------------------------- /patches-local/avr-libc-1.8.0/010-iotn4313-header.patch: -------------------------------------------------------------------------------- 1 | diff -ruwN avr-libc-1.8.0.orig/include/avr/iotn4313.h avr-libc-1.8.0/include/avr/iotn4313.h 2 | --- include/avr/iotn4313.h 2011-12-29 09:51:50.000000000 +0100 3 | +++ include/avr/iotn4313.h 2013-02-11 23:16:25.000000000 +0100 4 | @@ -68,7 +68,8 @@ 5 | #define USBS 3 6 | #define UPM0 4 7 | #define UPM1 5 8 | -#define UMSEL 6 9 | +#define UMSEL0 6 10 | +#define UMSEL1 7 11 | 12 | #define PCMSK1 _SFR_IO8(0x004) 13 | #define PCINT8 0 14 | @@ -303,7 +304,7 @@ 15 | #define EEAR5 5 16 | #define EEAR6 6 17 | 18 | -#define PCMSK _SFR_IO8(0x020) 19 | +#define PCMSK0 _SFR_IO8(0x020) 20 | #define PCINT0 0 21 | #define PCINT1 1 22 | #define PCINT2 2 23 | @@ -528,13 +529,17 @@ 24 | #define OCIE1A 6 25 | #define TOIE1 7 26 | 27 | -#define EIFR _SFR_IO8(0x03A) 28 | -#define PCIF 5 29 | +#define GIFR _SFR_IO8(0x03A) 30 | +#define PCIF1 3 31 | +#define PCIF2 4 32 | +#define PCIF0 5 33 | #define INTF0 6 34 | #define INTF1 7 35 | 36 | #define GIMSK _SFR_IO8(0x03B) 37 | -#define PCIE 5 38 | +#define PCIE1 3 39 | +#define PCIE2 4 40 | +#define PCIE0 5 41 | #define INT0 6 42 | #define INT1 7 43 | 44 | @@ -563,12 +568,12 @@ 45 | #define TIMER1_OVF_vect _VECTOR(5) /* Timer/Counter1 Overflow */ 46 | #define TIMER0_OVF_vect_num 6 47 | #define TIMER0_OVF_vect _VECTOR(6) /* Timer/Counter0 Overflow */ 48 | -#define USART_RX_vect_num 7 49 | -#define USART_RX_vect _VECTOR(7) /* USART, Rx Complete */ 50 | -#define USART_UDRE_vect_num 8 51 | -#define USART_UDRE_vect _VECTOR(8) /* USART Data Register Empty */ 52 | -#define USART_TX_vect_num 9 53 | -#define USART_TX_vect _VECTOR(9) /* USART, Tx Complete */ 54 | +#define USART0_RX_vect_num 7 55 | +#define USART0_RX_vect _VECTOR(7) /* USART, Rx Complete */ 56 | +#define USART0_UDRE_vect_num 8 57 | +#define USART0_UDRE_vect _VECTOR(8) /* USART Data Register Empty */ 58 | +#define USART0_TX_vect_num 9 59 | +#define USART0_TX_vect _VECTOR(9) /* USART, Tx Complete */ 60 | #define ANA_COMP_vect_num 10 61 | #define ANA_COMP_vect _VECTOR(10) /* Analog Comparator */ 62 | #define PCINT_B_vect_num 11 63 | @@ -583,14 +588,14 @@ 64 | #define USI_START_vect _VECTOR(15) /* USI Start Condition */ 65 | #define USI_OVERFLOW_vect_num 16 66 | #define USI_OVERFLOW_vect _VECTOR(16) /* USI Overflow */ 67 | -#define WDT_OVERFLOW_vect_num 18 68 | -#define WDT_OVERFLOW_vect _VECTOR(18) /* Watchdog Timer Overflow */ 69 | -#define PCINT_D_vect_num 20 70 | -#define PCINT_D_vect _VECTOR(20) /* Pin Change Interrupt Request D */ 71 | #define EEPROM_Ready_vect_num 17 72 | #define EEPROM_Ready_vect _VECTOR(17) /* */ 73 | +#define WDT_OVERFLOW_vect_num 18 74 | +#define WDT_OVERFLOW_vect _VECTOR(18) /* Watchdog Timer Overflow */ 75 | #define PCINT_A_vect_num 19 76 | #define PCINT_A_vect _VECTOR(19) /* Pin Change Interrupt Request A */ 77 | +#define PCINT_D_vect_num 20 78 | +#define PCINT_D_vect _VECTOR(20) /* Pin Change Interrupt Request D */ 79 | 80 | #define _VECTOR_SIZE 2 /* Size of individual vector. */ 81 | #define _VECTORS_SIZE (21 * _VECTOR_SIZE) 82 | -------------------------------------------------------------------------------- /patches-local/gcc-3.4.6/20-gcc-binary-constants.patch: -------------------------------------------------------------------------------- 1 | --- gcc/cpplib.h.orig Mon Feb 9 13:23:51 2004 2 | +++ gcc/cpplib.h Thu Apr 29 12:24:10 2004 3 | @@ -630,6 +630,7 @@ 4 | #define CPP_N_DECIMAL 0x0100 5 | #define CPP_N_HEX 0x0200 6 | #define CPP_N_OCTAL 0x0400 7 | +#define CPP_N_BINARY 0x0800 8 | 9 | #define CPP_N_UNSIGNED 0x1000 /* Properties. */ 10 | #define CPP_N_IMAGINARY 0x2000 11 | --- gcc/cppexp.c.orig Thu Feb 12 00:52:56 2004 12 | +++ gcc/cppexp.c Thu Apr 29 12:29:40 2004 13 | @@ -22,6 +22,9 @@ 14 | #include "system.h" 15 | #include "cpplib.h" 16 | #include "cpphash.h" 17 | +#include "flags.h" 18 | +#include "coretypes.h" 19 | +#include "toplev.h" 20 | 21 | #define PART_PRECISION (sizeof (cpp_num_part) * CHAR_BIT) 22 | #define HALF_MASK (~(cpp_num_part) 0 >> (PART_PRECISION / 2)) 23 | @@ -75,6 +78,9 @@ 24 | #define SYNTAX_ERROR2(msgid, arg) \ 25 | do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg); goto syntax_error; } \ 26 | while(0) 27 | +#define SYNTAX_ERROR3(msgid, arg1, arg2) \ 28 | + do { cpp_error (pfile, CPP_DL_ERROR, msgid, arg1, arg2); goto syntax_error; } \ 29 | + while(0) 30 | 31 | /* Subroutine of cpp_classify_number. S points to a float suffix of 32 | length LEN, possibly zero. Returns 0 for an invalid suffix, or a 33 | @@ -171,6 +177,11 @@ 34 | radix = 16; 35 | str++; 36 | } 37 | + else if ((*str == 'b' || *str == 'B') && (str[1] == '0' || str[1] == '1')) 38 | + { 39 | + radix = 2; 40 | + str++; 41 | + } 42 | } 43 | 44 | /* Now scan for a well-formed integer or float. */ 45 | @@ -209,7 +220,8 @@ 46 | radix = 10; 47 | 48 | if (max_digit >= radix) 49 | - SYNTAX_ERROR2 ("invalid digit \"%c\" in octal constant", '0' + max_digit); 50 | + SYNTAX_ERROR3 ("invalid digit \"%c\" in %s constant", '0' + max_digit, 51 | + radix == 2? "binary": "octal"); 52 | 53 | if (float_flag != NOT_FLOAT) 54 | { 55 | @@ -288,11 +300,16 @@ 56 | if ((result & CPP_N_IMAGINARY) && CPP_PEDANTIC (pfile)) 57 | cpp_error (pfile, CPP_DL_PEDWARN, 58 | "imaginary constants are a GCC extension"); 59 | + if (radix == 2 && CPP_PEDANTIC (pfile)) 60 | + cpp_error (pfile, CPP_DL_PEDWARN, 61 | + "binary constants are a GCC extension"); 62 | 63 | if (radix == 10) 64 | result |= CPP_N_DECIMAL; 65 | else if (radix == 16) 66 | result |= CPP_N_HEX; 67 | + else if (radix == 2) 68 | + result |= CPP_N_BINARY; 69 | else 70 | result |= CPP_N_OCTAL; 71 | 72 | @@ -341,6 +358,11 @@ 73 | else if ((type & CPP_N_RADIX) == CPP_N_HEX) 74 | { 75 | base = 16; 76 | + p += 2; 77 | + } 78 | + else if ((type & CPP_N_RADIX) == CPP_N_BINARY) 79 | + { 80 | + base = 2; 81 | p += 2; 82 | } 83 | -------------------------------------------------------------------------------- /patches-local/gcc-3.4.6/21-gcc-avr-misspelled-sig-1.patch: -------------------------------------------------------------------------------- 1 | 2004-05-12 Theodore A. Roth 2 | 3 | * gcc/config/avr/avr.c (avr_handle_fndecl_attribute): Generate a 4 | warning if the function name does not begin with "__vector" and the 5 | function has either the 'signal' or 'interrupt' attribute. 6 | 7 | Index: gcc/config/avr/avr.c 8 | =================================================================== 9 | RCS file: /cvsroot/gcc/gcc/gcc/config/avr/avr.c,v 10 | retrieving revision 1.118 11 | diff -u -p -p -r1.118 avr.c 12 | --- gcc/config/avr/avr.c 13 Mar 2004 06:43:30 -0000 1.118 13 | +++ gcc/config/avr/avr.c 12 May 2004 19:40:28 -0000 14 | @@ -4566,6 +4559,32 @@ avr_handle_fndecl_attribute (tree *node, 15 | warning ("`%s' attribute only applies to functions", 16 | IDENTIFIER_POINTER (name)); 17 | *no_add_attrs = true; 18 | + } 19 | + else 20 | + { 21 | + const char *func_name = IDENTIFIER_POINTER (DECL_NAME (*node)); 22 | + const char *attr = IDENTIFIER_POINTER (name); 23 | + 24 | + /* If the function has the 'signal' or 'interrupt' attribute, test to 25 | + make sure that the name of the function is "__vector_NN" so as to 26 | + catch when the user misspells the interrupt vector name. */ 27 | + 28 | + if (strncmp (attr, "interrupt", strlen ("interrupt")) == 0) 29 | + { 30 | + if (strncmp (func_name, "__vector", strlen ("__vector")) != 0) 31 | + { 32 | + warning ("`%s' appears to be a misspelled interrupt handler", 33 | + func_name); 34 | + } 35 | + } 36 | + else if (strncmp (attr, "signal", strlen ("signal")) == 0) 37 | + { 38 | + if (strncmp (func_name, "__vector", strlen ("__vector")) != 0) 39 | + { 40 | + warning ("`%s' appears to be a misspelled signal handler", 41 | + func_name); 42 | + } 43 | + } 44 | } 45 | 46 | return NULL_TREE; 47 | -------------------------------------------------------------------------------- /patches-local/gcc-3.4.6/60-new-devices.patch: -------------------------------------------------------------------------------- 1 | diff -ur ../gcc-3.4.6.orig/gcc/config/avr/avr.c ./gcc/config/avr/avr.c 2 | --- ../gcc-3.4.6.orig/gcc/config/avr/avr.c Sun Mar 20 22:14:28 2005 3 | +++ ./gcc/config/avr/avr.c Sun Mar 19 23:06:42 2006 4 | @@ -175,6 +175,18 @@ 5 | { "at90c8534", 2, "__AVR_AT90C8534__" }, 6 | { "at90s8535", 2, "__AVR_AT90S8535__" }, 7 | { "at86rf401", 2, "__AVR_AT86RF401__" }, 8 | + { "attiny261", 2, "__AVR_ATtiny261__" }, 9 | + { "attiny461", 2, "__AVR_ATtiny461__" }, 10 | + { "attiny861", 2, "__AVR_ATtiny861__" }, 11 | + /* Classic + MOVW, <= 8K. */ 12 | + { "attiny13", 2, "__AVR_ATtiny13__" }, 13 | + { "attiny2313", 2, "__AVR_ATtiny2313__" }, 14 | + { "attiny24", 2, "__AVR_ATtiny24__" }, 15 | + { "attiny44", 2, "__AVR_ATtiny44__" }, 16 | + { "attiny84", 2, "__AVR_ATtiny84__" }, 17 | + { "attiny25", 2, "__AVR_ATtiny25__" }, 18 | + { "attiny45", 2, "__AVR_ATtiny45__" }, 19 | + { "attiny85", 2, "__AVR_ATtiny85__" }, 20 | /* Classic, > 8K. */ 21 | { "avr3", 3, NULL }, 22 | { "atmega103", 3, "__AVR_ATmega103__" }, 23 | @@ -185,19 +197,50 @@ 24 | /* Enhanced, <= 8K. */ 25 | { "avr4", 4, NULL }, 26 | { "atmega8", 4, "__AVR_ATmega8__" }, 27 | + { "atmega48", 4, "__AVR_ATmega48__" }, 28 | + { "atmega88", 4, "__AVR_ATmega88__" }, 29 | { "atmega8515", 4, "__AVR_ATmega8515__" }, 30 | { "atmega8535", 4, "__AVR_ATmega8535__" }, 31 | + { "at90pwm2", 4, "__AVR_AT90PWM2__" }, 32 | + { "at90pwm3", 4, "__AVR_AT90PWM3__" }, 33 | /* Enhanced, > 8K. */ 34 | { "avr5", 5, NULL }, 35 | { "atmega16", 5, "__AVR_ATmega16__" }, 36 | { "atmega161", 5, "__AVR_ATmega161__" }, 37 | { "atmega162", 5, "__AVR_ATmega162__" }, 38 | { "atmega163", 5, "__AVR_ATmega163__" }, 39 | + { "atmega164p",5, "__AVR_ATmega164P__" }, 40 | + { "atmega165", 5, "__AVR_ATmega165__" }, 41 | + { "atmega165p", 5,"__AVR_ATmega165P__" }, 42 | + { "atmega168", 5, "__AVR_ATmega168__" }, 43 | { "atmega169", 5, "__AVR_ATmega169__" }, 44 | + { "atmega169p", 5,"__AVR_ATmega169P__" }, 45 | { "atmega32", 5, "__AVR_ATmega32__" }, 46 | { "atmega323", 5, "__AVR_ATmega323__" }, 47 | + { "atmega324p",5, "__AVR_ATmega324P__" }, 48 | + { "atmega325", 5, "__AVR_ATmega325__" }, 49 | + { "atmega3250", 5, "__AVR_ATmega3250__" }, 50 | + { "atmega329", 5, "__AVR_ATmega329__" }, 51 | + { "atmega3290", 5, "__AVR_ATmega3290__" }, 52 | + { "atmega406", 5, "__AVR_ATmega406__" }, 53 | + { "atmega640", 5, "__AVR_ATmega640__" }, 54 | { "atmega64", 5, "__AVR_ATmega64__" }, 55 | + { "atmega644", 5, "__AVR_ATmega644__" }, 56 | + { "atmega644p",5, "__AVR_ATmega644P__" }, 57 | + { "atmega645", 5, "__AVR_ATmega645__" }, 58 | + { "atmega6450", 5, "__AVR_ATmega6450__" }, 59 | + { "atmega649", 5, "__AVR_ATmega649__" }, 60 | + { "atmega6490", 5, "__AVR_ATmega6490__" }, 61 | { "atmega128", 5, "__AVR_ATmega128__" }, 62 | + { "atmega1280",5, "__AVR_ATmega1280__" }, 63 | + { "atmega1281",5, "__AVR_ATmega1281__" }, 64 | + { "at90can32", 5, "__AVR_AT90CAN32__" }, 65 | + { "at90can64", 5, "__AVR_AT90CAN64__" }, 66 | + { "at90can128", 5, "__AVR_AT90CAN128__" }, 67 | + { "at90usb646", 5, "__AVR_AT90USB646__" }, 68 | + { "at90usb647", 5, "__AVR_AT90USB647__" }, 69 | + { "at90usb1286", 5, "__AVR_AT90USB1286__" }, 70 | + { "at90usb1287", 5, "__AVR_AT90USB1287__" }, 71 | { "at94k", 5, "__AVR_AT94K__" }, 72 | /* Assembler only. */ 73 | { "avr1", 1, NULL }, 74 | diff -ur ../gcc-3.4.6.orig/gcc/config/avr/avr.h ./gcc/config/avr/avr.h 75 | --- ../gcc-3.4.6.orig/gcc/config/avr/avr.h Tue Mar 9 04:00:15 2004 76 | +++ ./gcc/config/avr/avr.h Sun Mar 19 23:08:23 2006 77 | @@ -2351,12 +2351,13 @@ 78 | Do not define this macro if it does not need to do anything. */ 79 | 80 | #define LINK_SPEC " %{!mmcu*:-m avr2}\ 81 | -%{mmcu=at90s1200|mmcu=attiny1*|mmcu=attiny28:-m avr1} \ 82 | -%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401:-m avr2}\ 83 | +%{mmcu=at90s1200|mmcu=attiny11|mmcu=attiny12|mmcu=attiny15|mmcu=attiny28:-m avr1} \ 84 | +%{mmcu=attiny22|mmcu=attiny26|mmcu=at90s2*|mmcu=at90s4*|mmcu=at90s8*|mmcu=at90c8*|mmcu=at86rf401|mmcu=attiny13|mmcu=attiny2313|mmcu=attiny24|mmcu=attiny44|mmcu=attiny84|mmcu=attiny25|mmcu=attiny45|mmcu=attiny85|mmcu=attiny261|mmcu=attiny461|mmcu=attiny861:-m avr2}\ 85 | %{mmcu=atmega103|mmcu=atmega603|mmcu=at43*|mmcu=at76*:-m avr3}\ 86 | -%{mmcu=atmega8*:-m avr4}\ 87 | -%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega64|mmcu=atmega128|mmcu=at94k:-m avr5}\ 88 | -%{mmcu=atmega64|mmcu=atmega128|mmcu=atmega162|mmcu=atmega169: -Tdata 0x800100} " 89 | +%{mmcu=atmega8*|mmcu=atmega48|mmcu=at90pwm*:-m avr4}\ 90 | +%{mmcu=atmega16*|mmcu=atmega32*|mmcu=atmega406|mmcu=atmega64*|mmcu=atmega128*|mmcu=at90can*|mmcu=at90usb*|mmcu=at94k:-m avr5}\ 91 | +%{mmcu=atmega324*|mmcu=atmega325|mmcu=atmega3250|mmcu=atmega329|mmcu=atmega3290|mmcu=atmega406|mmcu=atmega48|mmcu=atmega88|mmcu=atmega64|mmcu=atmega644*|mmcu=atmega645|mmcu=atmega6450|mmcu=atmega649|mmcu=atmega6490|mmcu=atmega128|mmcu=at90can*|mmcu=atmega162|mmcu=atmega164*|mmcu=atmega165*|mmcu=atmega168|mmcu=atmega169*|mmcu=at90pwm*|mmcu=at90usb*: -Tdata 0x800100}\ 92 | +%{mmcu=atmega640|mmcu=atmega1280|mmcu=atmega1281: -Tdata 0x800200} " 93 | 94 | /* A C string constant that tells the GCC driver program options to 95 | pass to the linker. It can also specify how to translate options 96 | @@ -2365,7 +2366,7 @@ 97 | Do not define this macro if it does not need to do anything. */ 98 | 99 | #define LIB_SPEC \ 100 | - "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lc }}}" 101 | + "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lc }}}}}" 102 | /* Another C string constant used much like `LINK_SPEC'. The 103 | difference between the two is that `LIB_SPEC' is used at the end 104 | of the command given to the linker. 105 | @@ -2377,7 +2378,7 @@ 106 | /* No libstdc++ for now. Empty string doesn't work. */ 107 | 108 | #define LIBGCC_SPEC \ 109 | - "%{!mmcu=at90s1*:%{!mmcu=attiny1*:%{!mmcu=attiny28: -lgcc }}}" 110 | + "%{!mmcu=at90s1*:%{!mmcu=attiny11:%{!mmcu=attiny12:%{!mmcu=attiny15:%{!mmcu=attiny28: -lgcc }}}}}" 111 | /* Another C string constant that tells the GCC driver program how 112 | and when to place a reference to `libgcc.a' into the linker 113 | command line. This constant is placed both before and after the 114 | @@ -2421,23 +2422,65 @@ 115 | %{mmcu=at90c8534:crtc8534.o%s} \ 116 | %{mmcu=at90s8535:crts8535.o%s} \ 117 | %{mmcu=at86rf401:crt86401.o%s} \ 118 | +%{mmcu=attiny13:crttn13.o%s} \ 119 | +%{mmcu=attiny2313:crttn2313.o%s} \ 120 | +%{mmcu=attiny24:crttn24.o%s} \ 121 | +%{mmcu=attiny44:crttn44.o%s} \ 122 | +%{mmcu=attiny84:crttn84.o%s} \ 123 | +%{mmcu=attiny25:crttn25.o%s} \ 124 | +%{mmcu=attiny45:crttn45.o%s} \ 125 | +%{mmcu=attiny85:crttn85.o%s} \ 126 | +%{mmcu=attiny261:crttn261.o%s} \ 127 | +%{mmcu=attiny461:crttn461.o%s} \ 128 | +%{mmcu=attiny861:crttn861.o%s} \ 129 | %{mmcu=atmega103|mmcu=avr3:crtm103.o%s} \ 130 | %{mmcu=atmega603:crtm603.o%s} \ 131 | %{mmcu=at43usb320:crt43320.o%s} \ 132 | %{mmcu=at43usb355:crt43355.o%s} \ 133 | %{mmcu=at76c711:crt76711.o%s} \ 134 | %{mmcu=atmega8|mmcu=avr4:crtm8.o%s} \ 135 | +%{mmcu=atmega48:crtm48.o%s} \ 136 | +%{mmcu=atmega88:crtm88.o%s} \ 137 | %{mmcu=atmega8515:crtm8515.o%s} \ 138 | %{mmcu=atmega8535:crtm8535.o%s} \ 139 | +%{mmcu=at90pwm2:crt90pwm2.o%s} \ 140 | +%{mmcu=at90pwm3:crt90pwm3.o%s} \ 141 | %{mmcu=atmega16:crtm16.o%s} \ 142 | %{mmcu=atmega161|mmcu=avr5:crtm161.o%s} \ 143 | %{mmcu=atmega162:crtm162.o%s} \ 144 | %{mmcu=atmega163:crtm163.o%s} \ 145 | +%{mmcu=atmega164p:crtm164p.o%s} \ 146 | +%{mmcu=atmega165:crtm165.o%s} \ 147 | +%{mmcu=atmega165p:crtm165p.o%s} \ 148 | +%{mmcu=atmega168:crtm168.o%s} \ 149 | %{mmcu=atmega169:crtm169.o%s} \ 150 | +%{mmcu=atmega169p:crtm169p.o%s} \ 151 | %{mmcu=atmega32:crtm32.o%s} \ 152 | %{mmcu=atmega323:crtm323.o%s} \ 153 | +%{mmcu=atmega324p:crtm324p.o%s} \ 154 | +%{mmcu=atmega325:crtm325.o%s} \ 155 | +%{mmcu=atmega3250:crtm3250.o%s} \ 156 | +%{mmcu=atmega329:crtm329.o%s} \ 157 | +%{mmcu=atmega3290:crtm3290.o%s} \ 158 | +%{mmcu=atmega406:crtm406.o%s} \ 159 | %{mmcu=atmega64:crtm64.o%s} \ 160 | +%{mmcu=atmega640:crtm640.o%s} \ 161 | +%{mmcu=atmega644:crtm644.o%s} \ 162 | +%{mmcu=atmega644p:crtm644p.o%s} \ 163 | +%{mmcu=atmega645:crtm645.o%s} \ 164 | +%{mmcu=atmega6450:crtm6450.o%s} \ 165 | +%{mmcu=atmega649:crtm649.o%s} \ 166 | +%{mmcu=atmega6490:crtm6490.o%s} \ 167 | %{mmcu=atmega128:crtm128.o%s} \ 168 | +%{mmcu=atmega1280:crtm1280.o%s} \ 169 | +%{mmcu=atmega1281:crtm1281.o%s} \ 170 | +%{mmcu=at90can32:crtcan32.o%s} \ 171 | +%{mmcu=at90can64:crtcan64.o%s} \ 172 | +%{mmcu=at90can128:crtcan128.o%s} \ 173 | +%{mmcu=at90usb646:crtusb646.o%s} \ 174 | +%{mmcu=at90usb647:crtusb647.o%s} \ 175 | +%{mmcu=at90usb1286:crtusb1286.o%s} \ 176 | +%{mmcu=at90usb1287:crtusb1287.o%s} \ 177 | %{mmcu=at94k:crtat94k.o%s}" 178 | 179 | #define EXTRA_SPECS {"crt_binutils", CRT_BINUTILS_SPECS}, 180 | diff -ur ../gcc-3.4.6.orig/gcc/config/avr/t-avr ./gcc/config/avr/t-avr 181 | --- ../gcc-3.4.6.orig/gcc/config/avr/t-avr Mon Apr 25 06:17:34 2005 182 | +++ ./gcc/config/avr/t-avr Sun Mar 19 23:08:56 2006 183 | @@ -46,12 +46,31 @@ 184 | mmcu?avr3=mmcu?at43usb320 mmcu?avr3=mmcu?at43usb355 \ 185 | mmcu?avr3=mmcu?at76c711 \ 186 | mmcu?avr4=mmcu?atmega8515 mmcu?avr4=mmcu?atmega8535 \ 187 | - mmcu?avr4=mmcu?atmega8 \ 188 | + mmcu?avr4=mmcu?atmega8 mmcu?avr4=mmcu?atmega48 \ 189 | + mmcu?avr4=mmcu?atmega88 \ 190 | + mmcu?avr4=mmcu?at90pwm2 mmcu?avr4=mmcu?at90pwm3 \ 191 | mmcu?avr5=mmcu?atmega161 mmcu?avr5=mmcu?atmega162 \ 192 | - mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega169 \ 193 | + mmcu?avr5=mmcu?atmega163 mmcu?avr5=mmcu?atmega164p \ 194 | + mmcu?avr5=mmcu?atmega165 mmcu?avr5=mmcu?atmega165p \ 195 | + mmcu?avr5=mmcu?atmega168 mmcu?avr5=mmcu?atmega169 \ 196 | + mmcu?avr5=mmcu?atmega169p \ 197 | mmcu?avr5=mmcu?atmega16 \ 198 | - mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega32 \ 199 | - mmcu?avr5=mmcu?atmega64 mmcu?avr5=mmcu?atmega128 \ 200 | + mmcu?avr5=mmcu?atmega323 mmcu?avr5=mmcu?atmega324p \ 201 | + mmcu?avr5=mmcu?atmega325 mmcu?avr5=mmcu?atmega3250 \ 202 | + mmcu?avr5=mmcu?atmega329 mmcu?avr5=mmcu?atmega3290 \ 203 | + mmcu?avr5=mmcu?atmega32 \ 204 | + mmcu?avr5=mmcu?atmega406 \ 205 | + mmcu?avr5=mmcu?atmega640 mmcu?avr5=mmcu?atmega644 \ 206 | + mmcu?avr5=mmcu?atmega644p mmcu?avr5=mmcu?atmega645 \ 207 | + mmcu?avr5=mmcu?atmega6450 mmcu?avr5=mmcu?atmega649 \ 208 | + mmcu?avr5=mmcu?atmega6490 mmcu?avr5=mmcu?atmega64 \ 209 | + mmcu?avr5=mmcu?atmega128 \ 210 | + mmcu?avr5=mmcu?atmega1280 mmcu?avr5=mmcu?atmega1281 \ 211 | + mmcu?avr5=mmcu?at90can32 \ 212 | + mmcu?avr5=mmcu?at90can64 \ 213 | + mmcu?avr5=mmcu?at90can128 \ 214 | + mmcu?avr5=mmcu?at90usb646 mmcu?avr5=mmcu?at90usb647 \ 215 | + mmcu?avr5=mmcu?at90usb1286 mmcu?avr5=mmcu?at90usb1287 \ 216 | mmcu?avr5=mmcu?at94k 217 | 218 | MULTILIB_EXCEPTIONS = 219 | -------------------------------------------------------------------------------- /patches-local/libusb-0.1.12/010-fix-64-bit.patch: -------------------------------------------------------------------------------- 1 | diff -ruwN darwin.c.orig darwin.c 2 | --- darwin.c.orig 2006-03-04 03:52:46.000000000 +0100 3 | +++ darwin.c 2012-02-15 12:25:18.000000000 +0100 4 | @@ -247,7 +247,8 @@ 5 | io_cf_plugin_ref_t *plugInInterface = NULL; 6 | usb_device_t **device; 7 | io_service_t usbDevice; 8 | - long result, score; 9 | + long result; 10 | + SInt32 score; 11 | 12 | if (!IOIteratorIsValid (deviceIterator) || !(usbDevice = IOIteratorNext(deviceIterator))) 13 | return NULL; 14 | @@ -447,7 +448,7 @@ 15 | IOUSBFindInterfaceRequest request; 16 | 17 | struct darwin_dev_handle *device; 18 | - long score; 19 | + SInt32 score; 20 | int current_interface; 21 | 22 | device = dev->impl_info; 23 | @@ -769,9 +770,9 @@ 24 | 25 | if (usb_debug > 2) 26 | fprintf(stderr, "io async operation completed: %s, size=%lu, result=0x%08x\n", darwin_error_str(result), 27 | - (UInt32)io_size, result); 28 | + (unsigned long)io_size, (int)result); 29 | 30 | - rw_arg->io_size = (UInt32)io_size; 31 | + rw_arg->io_size = (long)io_size; 32 | rw_arg->result = result; 33 | 34 | CFRunLoopStop(rw_arg->cf_loop); 35 | @@ -1064,7 +1065,7 @@ 36 | result = (*(device))->GetDeviceAddress(device, (USBDeviceAddress *)&address); 37 | 38 | if (usb_debug >= 2) 39 | - fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08lx\n", location); 40 | + fprintf(stderr, "usb_os_find_devices: Found USB device at location 0x%08lx\n", (long)location); 41 | 42 | /* first byte of location appears to be associated with the device's bus */ 43 | if (location >> 24 == bus_loc >> 24) { 44 | @@ -1092,7 +1093,7 @@ 45 | 46 | if (usb_debug >= 2) 47 | fprintf(stderr, "usb_os_find_devices: Found %s on %s at location 0x%08lx\n", 48 | - dev->filename, bus->dirname, location); 49 | + dev->filename, bus->dirname, (long)location); 50 | } 51 | 52 | /* release the device now */ 53 | -------------------------------------------------------------------------------- /templates/TemplateProject/TemplateProject.xcodeproj/project.pbxproj: -------------------------------------------------------------------------------- 1 | // !$*UTF8*$! 2 | { 3 | archiveVersion = 1; 4 | classes = { 5 | }; 6 | objectVersion = 42; 7 | objects = { 8 | 9 | /* Begin PBXFileReference section */ 10 | 4079525E0CEA38CC00E202DC /* main.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = main.c; sourceTree = ""; }; 11 | 4079525F0CEA38CC00E202DC /* Makefile */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.make; path = Makefile; sourceTree = ""; }; 12 | /* End PBXFileReference section */ 13 | 14 | /* Begin PBXGroup section */ 15 | 4079523B0CEA382200E202DC = { 16 | isa = PBXGroup; 17 | children = ( 18 | 4079525D0CEA38CC00E202DC /* firmware */, 19 | ); 20 | sourceTree = ""; 21 | }; 22 | 4079525D0CEA38CC00E202DC /* firmware */ = { 23 | isa = PBXGroup; 24 | children = ( 25 | 4079525F0CEA38CC00E202DC /* Makefile */, 26 | 4079525E0CEA38CC00E202DC /* main.c */, 27 | ); 28 | path = firmware; 29 | sourceTree = ""; 30 | }; 31 | /* End PBXGroup section */ 32 | 33 | /* Begin PBXLegacyTarget section */ 34 | 407952600CEA391500E202DC /* firmware */ = { 35 | isa = PBXLegacyTarget; 36 | buildArgumentsString = $ACTION; 37 | buildConfigurationList = 407952610CEA393300E202DC /* Build configuration list for PBXLegacyTarget "firmware" */; 38 | buildPhases = ( 39 | ); 40 | buildToolPath = /usr/bin/make; 41 | buildWorkingDirectory = firmware; 42 | dependencies = ( 43 | ); 44 | name = firmware; 45 | passBuildSettingsInEnvironment = 1; 46 | productName = "Build All"; 47 | }; 48 | /* End PBXLegacyTarget section */ 49 | 50 | /* Begin PBXProject section */ 51 | 4079523D0CEA382200E202DC /* Project object */ = { 52 | isa = PBXProject; 53 | buildConfigurationList = 4079523E0CEA382200E202DC /* Build configuration list for PBXProject "TemplateProject" */; 54 | compatibilityVersion = "Xcode 2.4"; 55 | hasScannedForEncodings = 0; 56 | mainGroup = 4079523B0CEA382200E202DC; 57 | projectDirPath = ""; 58 | projectRoot = ""; 59 | targets = ( 60 | 407952600CEA391500E202DC /* firmware */, 61 | ); 62 | }; 63 | /* End PBXProject section */ 64 | 65 | /* Begin XCBuildConfiguration section */ 66 | 407952400CEA382200E202DC /* Release */ = { 67 | isa = XCBuildConfiguration; 68 | buildSettings = { 69 | COPY_PHASE_STRIP = YES; 70 | }; 71 | name = Release; 72 | }; 73 | 407952630CEA393300E202DC /* Release */ = { 74 | isa = XCBuildConfiguration; 75 | buildSettings = { 76 | PATH = "$(PATH):/usr/local/CrossPack-AVR/bin"; 77 | }; 78 | name = Release; 79 | }; 80 | /* End XCBuildConfiguration section */ 81 | 82 | /* Begin XCConfigurationList section */ 83 | 4079523E0CEA382200E202DC /* Build configuration list for PBXProject "TemplateProject" */ = { 84 | isa = XCConfigurationList; 85 | buildConfigurations = ( 86 | 407952400CEA382200E202DC /* Release */, 87 | ); 88 | defaultConfigurationIsVisible = 0; 89 | defaultConfigurationName = Release; 90 | }; 91 | 407952610CEA393300E202DC /* Build configuration list for PBXLegacyTarget "firmware" */ = { 92 | isa = XCConfigurationList; 93 | buildConfigurations = ( 94 | 407952630CEA393300E202DC /* Release */, 95 | ); 96 | defaultConfigurationIsVisible = 0; 97 | defaultConfigurationName = Release; 98 | }; 99 | /* End XCConfigurationList section */ 100 | }; 101 | rootObject = 4079523D0CEA382200E202DC /* Project object */; 102 | } 103 | -------------------------------------------------------------------------------- /templates/TemplateProject/firmware/Makefile: -------------------------------------------------------------------------------- 1 | # Name: Makefile 2 | # Author: 3 | # Copyright: 4 | # License: 5 | 6 | # This is a prototype Makefile. Modify it according to your needs. 7 | # You should at least check the settings for 8 | # DEVICE ....... The AVR device you compile for 9 | # CLOCK ........ Target AVR clock rate in Hertz 10 | # OBJECTS ...... The object files created from your source files. This list is 11 | # usually the same as the list of source files with suffix ".o". 12 | # PROGRAMMER ... Options to avrdude which define the hardware you use for 13 | # uploading to the AVR and the interface where this hardware 14 | # is connected. We recommend that you leave it undefined and 15 | # add settings like this to your ~/.avrduderc file: 16 | # default_programmer = "stk500v2" 17 | # default_serial = "avrdoper" 18 | # FUSES ........ Parameters for avrdude to flash the fuses appropriately. 19 | 20 | DEVICE = atmega8 21 | CLOCK = 8000000 22 | PROGRAMMER = #-c stk500v2 -P avrdoper 23 | OBJECTS = main.o 24 | FUSES = -U hfuse:w:0xd9:m -U lfuse:w:0x24:m 25 | 26 | # ATMega8 fuse bits used above (fuse bits for other devices are different!): 27 | # Example for 8 MHz internal oscillator 28 | # Fuse high byte: 29 | # 0xd9 = 1 1 0 1 1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000) 30 | # ^ ^ ^ ^ ^ ^ ^------ BOOTSZ0 31 | # | | | | | +-------- BOOTSZ1 32 | # | | | | +---------- EESAVE (set to 0 to preserve EEPROM over chip erase) 33 | # | | | +-------------- CKOPT (clock option, depends on oscillator type) 34 | # | | +---------------- SPIEN (if set to 1, serial programming is disabled) 35 | # | +------------------ WDTON (if set to 0, watchdog is always on) 36 | # +-------------------- RSTDISBL (if set to 0, RESET pin is disabled) 37 | # Fuse low byte: 38 | # 0x24 = 0 0 1 0 0 1 0 0 39 | # ^ ^ \ / \--+--/ 40 | # | | | +------- CKSEL 3..0 (8M internal RC) 41 | # | | +--------------- SUT 1..0 (slowly rising power) 42 | # | +------------------ BODEN (if 0, brown-out detector is enabled) 43 | # +-------------------- BODLEVEL (if 0: 4V, if 1: 2.7V) 44 | # 45 | # For computing fuse byte values for other devices and options see 46 | # the fuse bit calculator at http://www.engbedded.com/fusecalc/ 47 | 48 | 49 | # Tune the lines below only if you know what you are doing: 50 | 51 | AVRDUDE = avrdude $(PROGRAMMER) -p $(DEVICE) 52 | COMPILE = avr-gcc -Wall -Os -DF_CPU=$(CLOCK) -mmcu=$(DEVICE) 53 | 54 | # symbolic targets: 55 | all: main.hex 56 | 57 | .c.o: 58 | $(COMPILE) -c $< -o $@ 59 | 60 | .S.o: 61 | $(COMPILE) -x assembler-with-cpp -c $< -o $@ 62 | # "-x assembler-with-cpp" should not be necessary since this is the default 63 | # file type for the .S (with capital S) extension. However, upper case 64 | # characters are not always preserved on Windows. To ensure WinAVR 65 | # compatibility define the file type manually. 66 | 67 | .c.s: 68 | $(COMPILE) -S $< -o $@ 69 | 70 | flash: all 71 | $(AVRDUDE) -U flash:w:main.hex:i 72 | 73 | fuse: 74 | $(AVRDUDE) $(FUSES) 75 | 76 | # Xcode uses the Makefile targets "", "clean" and "install" 77 | install: flash fuse 78 | 79 | # if you use a bootloader, change the command below appropriately: 80 | load: all 81 | bootloadHID main.hex 82 | 83 | clean: 84 | rm -f main.hex main.elf $(OBJECTS) 85 | 86 | # file targets: 87 | main.elf: $(OBJECTS) 88 | $(COMPILE) -o main.elf $(OBJECTS) 89 | 90 | main.hex: main.elf 91 | rm -f main.hex 92 | avr-objcopy -j .text -j .data -O ihex main.elf main.hex 93 | avr-size --format=avr --mcu=$(DEVICE) main.elf 94 | # If you have an EEPROM section, you must also create a hex file for the 95 | # EEPROM and add it to the "flash" target. 96 | 97 | # Targets for code debugging and analysis: 98 | disasm: main.elf 99 | avr-objdump -d main.elf 100 | 101 | cpp: 102 | $(COMPILE) -E main.c 103 | -------------------------------------------------------------------------------- /templates/TemplateProject/firmware/main.c: -------------------------------------------------------------------------------- 1 | /* Name: main.c 2 | * Author: 3 | * Copyright: 4 | * License: 5 | */ 6 | 7 | #include 8 | 9 | int main(void) 10 | { 11 | /* insert your hardware initialization here */ 12 | for(;;){ 13 | /* insert your main loop code here */ 14 | } 15 | return 0; /* never reached */ 16 | } 17 | --------------------------------------------------------------------------------