Added KDE3 version of PikLab

git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/piklab@1095639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 15 years ago
commit f508189682

@ -0,0 +1,339 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
License is intended to guarantee your freedom to share and change free
software--to make sure the software is free for all its users. This
General Public License applies to most of the Free Software
Foundation's software and to any other program whose authors commit to
using it. (Some other Free Software Foundation software is covered by
the GNU Lesser General Public License instead.) You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
this service if you wish), that you receive source code or can get it
if you want it, that you can change the software or use pieces of it
in new free programs; and that you know you can do these things.
To protect your rights, we need to make restrictions that forbid
anyone to deny you these rights or to ask you to surrender the rights.
These restrictions translate to certain responsibilities for you if you
distribute copies of the software, or if you modify it.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must give the recipients all the rights that
you have. You must make sure that they, too, receive or can get the
source code. And you must show them these terms so they know their
rights.
We protect your rights with two steps: (1) copyright the software, and
(2) offer you this license which gives you legal permission to copy,
distribute and/or modify the software.
Also, for each author's protection and ours, we want to make certain
that everyone understands that there is no warranty for this free
software. If the software is modified by someone else and passed on, we
want its recipients to know that what they have is not the original, so
that any problems introduced by others will not reflect on the original
authors' reputations.
Finally, any free program is threatened constantly by software
patents. We wish to avoid the danger that redistributors of a free
program will individually obtain patent licenses, in effect making the
program proprietary. To prevent this, we have made it clear that any
patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
a notice placed by the copyright holder saying it may be distributed
under the terms of this General Public License. The "Program", below,
refers to any such program or work, and a "work based on the Program"
means either the Program or any derivative work under copyright law:
that is to say, a work containing the Program or a portion of it,
either verbatim or with modifications and/or translated into another
language. (Hereinafter, translation is included without limitation in
the term "modification".) Each licensee is addressed as "you".
Activities other than copying, distribution and modification are not
covered by this License; they are outside its scope. The act of
running the Program is not restricted, and the output from the Program
is covered only if its contents constitute a work based on the
Program (independent of having been made by running the Program).
Whether that is true depends on what the Program does.
1. You may copy and distribute verbatim copies of the Program's
source code as you receive it, in any medium, provided that you
conspicuously and appropriately publish on each copy an appropriate
copyright notice and disclaimer of warranty; keep intact all the
notices that refer to this License and to the absence of any warranty;
and give any other recipients of the Program a copy of this License
along with the Program.
You may charge a fee for the physical act of transferring a copy, and
you may at your option offer warranty protection in exchange for a fee.
2. You may modify your copy or copies of the Program or any portion
of it, thus forming a work based on the Program, and copy and
distribute such modifications or work under the terms of Section 1
above, provided that you also meet all of these conditions:
a) You must cause the modified files to carry prominent notices
stating that you changed the files and the date of any change.
b) You must cause any work that you distribute or publish, that in
whole or in part contains or is derived from the Program or any
part thereof, to be licensed as a whole at no charge to all third
parties under the terms of this License.
c) If the modified program normally reads commands interactively
when run, you must cause it, when started running for such
interactive use in the most ordinary way, to print or display an
announcement including an appropriate copyright notice and a
notice that there is no warranty (or else, saying that you provide
a warranty) and that users may redistribute the program under
these conditions, and telling the user how to view a copy of this
License. (Exception: if the Program itself is interactive but
does not normally print such an announcement, your work based on
the Program is not required to print an announcement.)
These requirements apply to the modified work as a whole. If
identifiable sections of that work are not derived from the Program,
and can be reasonably considered independent and separate works in
themselves, then this License, and its terms, do not apply to those
sections when you distribute them as separate works. But when you
distribute the same sections as part of a whole which is a work based
on the Program, the distribution of the whole must be on the terms of
this License, whose permissions for other licensees extend to the
entire whole, and thus to each and every part regardless of who wrote it.
Thus, it is not the intent of this section to claim rights or contest
your rights to work written entirely by you; rather, the intent is to
exercise the right to control the distribution of derivative or
collective works based on the Program.
In addition, mere aggregation of another work not based on the Program
with the Program (or with a work based on the Program) on a volume of
a storage or distribution medium does not bring the other work under
the scope of this License.
3. You may copy and distribute the Program (or a work based on it,
under Section 2) in object code or executable form under the terms of
Sections 1 and 2 above provided that you also do one of the following:
a) Accompany it with the complete corresponding machine-readable
source code, which must be distributed under the terms of Sections
1 and 2 above on a medium customarily used for software interchange; or,
b) Accompany it with a written offer, valid for at least three
years, to give any third party, for a charge no more than your
cost of physically performing source distribution, a complete
machine-readable copy of the corresponding source code, to be
distributed under the terms of Sections 1 and 2 above on a medium
customarily used for software interchange; or,
c) Accompany it with the information you received as to the offer
to distribute corresponding source code. (This alternative is
allowed only for noncommercial distribution and only if you
received the program in object code or executable form with such
an offer, in accord with Subsection b above.)
The source code for a work means the preferred form of the work for
making modifications to it. For an executable work, complete source
code means all the source code for all modules it contains, plus any
associated interface definition files, plus the scripts used to
control compilation and installation of the executable. However, as a
special exception, the source code distributed need not include
anything that is normally distributed (in either source or binary
form) with the major components (compiler, kernel, and so on) of the
operating system on which the executable runs, unless that component
itself accompanies the executable.
If distribution of executable or object code is made by offering
access to copy from a designated place, then offering equivalent
access to copy the source code from the same place counts as
distribution of the source code, even though third parties are not
compelled to copy the source along with the object code.
4. You may not copy, modify, sublicense, or distribute the Program
except as expressly provided under this License. Any attempt
otherwise to copy, modify, sublicense or distribute the Program is
void, and will automatically terminate your rights under this License.
However, parties who have received copies, or rights, from you under
this License will not have their licenses terminated so long as such
parties remain in full compliance.
5. You are not required to accept this License, since you have not
signed it. However, nothing else grants you permission to modify or
distribute the Program or its derivative works. These actions are
prohibited by law if you do not accept this License. Therefore, by
modifying or distributing the Program (or any work based on the
Program), you indicate your acceptance of this License to do so, and
all its terms and conditions for copying, distributing or modifying
the Program or works based on it.
6. Each time you redistribute the Program (or any work based on the
Program), the recipient automatically receives a license from the
original licensor to copy, distribute or modify the Program subject to
these terms and conditions. You may not impose any further
restrictions on the recipients' exercise of the rights granted herein.
You are not responsible for enforcing compliance by third parties to
this License.
7. If, as a consequence of a court judgment or allegation of patent
infringement or for any other reason (not limited to patent issues),
conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot
distribute so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you
may not distribute the Program at all. For example, if a patent
license would not permit royalty-free redistribution of the Program by
all those who receive copies directly or indirectly through you, then
the only way you could satisfy both it and this License would be to
refrain entirely from distribution of the Program.
If any portion of this section is held invalid or unenforceable under
any particular circumstance, the balance of the section is intended to
apply and the section as a whole is intended to apply in other
circumstances.
It is not the purpose of this section to induce you to infringe any
patents or other property right claims or to contest validity of any
such claims; this section has the sole purpose of protecting the
integrity of the free software distribution system, which is
implemented by public license practices. Many people have made
generous contributions to the wide range of software distributed
through that system in reliance on consistent application of that
system; it is up to the author/donor to decide if he or she is willing
to distribute software through any other system and a licensee cannot
impose that choice.
This section is intended to make thoroughly clear what is believed to
be a consequence of the rest of this License.
8. If the distribution and/or use of the Program is restricted in
certain countries either by patents or by copyrighted interfaces, the
original copyright holder who places the Program under this License
may add an explicit geographical distribution limitation excluding
those countries, so that distribution is permitted only in or among
countries not thus excluded. In such case, this License incorporates
the limitation as if written in the body of this License.
9. The Free Software Foundation may publish revised and/or new versions
of the General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the Program
specifies a version number of this License which applies to it and "any
later version", you have the option of following the terms and conditions
either of that version or of any later version published by the Free
Software Foundation. If the Program does not specify a version number of
this License, you may choose any version ever published by the Free Software
Foundation.
10. If you wish to incorporate parts of the Program into other free
programs whose distribution conditions are different, write to the author
to ask for permission. For software which is copyrighted by the Free
Software Foundation, write to the Free Software Foundation; we sometimes
make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
REPAIR OR CORRECTION.
12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
Also add information on how to contact you by electronic and paper mail.
If the program is interactive, make it output a short notice like this
when it starts in an interactive mode:
Gnomovision version 69, Copyright (C) year name of author
Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, the commands you use may
be called something other than `show w' and `show c'; they could even be
mouse-clicks or menu items--whatever suits your program.
You should also get your employer (if you work as a programmer) or your
school, if any, to sign a "copyright disclaimer" for the program, if
necessary. Here is a sample; alter the names:
Yoyodyne, Inc., hereby disclaims all copyright interest in the program
`Gnomovision' (which makes passes at compilers) written by James Hacker.
<signature of Ty Coon>, 1 April 1989
Ty Coon, President of Vice
This General Public License does not permit incorporating your program into
proprietary programs. If your program is a subroutine library, you may
consider it more useful to permit linking proprietary applications with the
library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License.

@ -0,0 +1,440 @@
0.15.2 (24 November 2007)
* fixed loading some hex files [thanks to Xiaofan Chen and Hector Martin]
* added 24FJ128/96/64
* added missing register information for some devices
* added ETT direct programmer [thanks to Jimkirk]
* added 16F690/913/917 support to Picstart+
* fixed crash when manually updating firmwares [reported by Claus Bjerre]
* fixed blank-checking with icd2 debugger
* fixed crashes when halting debugging session
* added option to create a library from a project (gputils, sdcc, picc)
* added simple views for object and library files
* fixed crash in configuration generation dialog [report by Milan]
* fixed several problems with progress bar
* fixed crash when closing main window while programming
* better watch window
* add memory graph view to device information [idea by F. Gerin]
* fixed disappearing bookmarks and save them in project file [report by Luke Orland]
* updated Spanish translation [thanks to Felipe Caminos]
* fixed piklab-prog option "target-self-powered"
0.15.1 (11 November 2007)
* added 18F66J11/66J16/67J11 86J11/86J16/87J11
18F65J50/66J50/66J55/67J50 85J50/86J50/86J55/87J50
18F6393/8393 6493/8493
24HJ16GP304/32GP202/32GP204
* fixed config/template generator and I/O registers for some devices
* added "custom" toolchain for custom shell commands
* fixed coff parsing for PIC30 toolchain
* fixed crash when running device
* fixed device selection in project manager
* C source debugging (only for 18F devices due to sdcc/gputils bug)
* fixed debugging of C18 projects with gpsim 0.21.x
* fixed display of bootloader option window
* config bits comboboxes now ignore wheel events in hex editor
* added "piklab-coff", a command-line utility for viewing coff, object and library files
* updated French translation [thanks to Alain Portal]
* fixed some compilation issues
0.15.0 (20 October 2007)
* added 12F519 18F2423/4423/2523/4523 30F1010/2020/2023
18F24J10/25J10/44J10/45J10 65J10/65J15/66J10/66J15/67J10
18F85J10/85J15/86J10/86J15/87J10 18F63J11/64J11/65J11 83J11/84J11/85J11
18F63J90/64J90/65J90 83J90/84J90/85J90
* fixed checksum computations for some devices
* fixed configuration bits for some devices
* fixed config and template source generation for some devices
* fixed crash while programming 12F510 [report by Scott Dattalo]
* added option to disable eeprom programming
* added option to skip verification after programming
* fixed programming with picdem bootloader [thanks to Xiaofan Chen]
* fixed pickit2 bootloader [thanks to Xiaofan Chen]
* added icd2 support for 18F2450/4450/2423/4423/2523/4523/6527/6622/8527/8622
16F506/616/631/677
* fixed simulating some 18F devices with some versions of gpsim
* added support for EPE Toolkit mk3 direct programmer [thanks to Chris Lale]
* added support for the 'EPE Toolkit mk3' direct programmer [thanks to Chris Lale]
* better support for PIC30 toolchain [report by Brian Neltner]
* added option to run after successfull programming [proposed by jda2158]
* fixed "compile file" action [report by Alain Portal]
* fixed adding objects from outside project directory
* added option to automatically recompile before programming when the
project is modified [proposed by pryyanek]
* added status and feature filters in device chooser dialog
* added menu item to call "kfind" inside project directory [proposed by Polly Lister]
* added option to show/hide the close buttons on the tabs of the editor manager
[proposed by james and bjohan]
* added option to piklab-prog to set hardware type for direct programmers
* added check for device compatibility and file creation commands to piklab-hex
* move checksum command from piklab-prog to piklab-hex
0.14.5 (16 August 2007)
* better error reporting if USB not compiled in
* fixed USB support when compiling with qt only [report by Martin Goldack]
0.14.4 (5 August 2007)
* fixed bug where osccal would be lost and piklab would crash when programming
devices without osccal backup [report by Ed Spremolla]
* fixed "likeback" not showing
* added display in hex editor when configuration bits are invalid
* fixed CodeGuard configuration bits and hex editor
0.14.3 (26 July 2007)
* added support for 24H devices
* updated register definitions to MPLAB 7.41
* added 18F66J60 family [contribution by Alan Page]
* added 12F609/HV609 16F610/HV610 16F882
* added configuration for tiny bootloader (retries, port speed, delay)
* added configuration for picdem bootloader (USB ids)
* fixed tinybootloader for 16F88 [patch by Balaji Ramani]
* fixed direct programming of 16F87XA (again)
* fixed programming of 18F2410/2420/4410/4420 [report by Yuri Shnol]
* fixed problem with tab history [reported by agalliazzo]
* fixed crash in hex editor due to protected config bits (12F675, ...)
* Spanish translation by Felipe Caminos
* Czech translation by Milan Horák
* try to open unrecognized devices as serial port
instead of just failing in piklab-prog [reported by Jan Berkel]
* fixed crash using upload_firmware in piklab-prog [report by John McCullough]
* more resilient hex file parser [reported by Stefan Vonhalenbach]
0.14.2b (14 June 2007)
* support for USB ICD2 under Windows [fixed by Minh Nguyen]
0.14.2 (9 April 2007)
* device id and eeprom fixes for some 18F devices
* fixed debugging of 18F2455 family [report by Florian Brabetz]
* added parallel port support for FreeBSD (with ppbus)
* added support for Pickit2 and Picdem fsusb bootloaders (untested + no data eeprom operations)
* fixed device memory reading [broken in 0.14.1, report by Xiaofan Chen]
* fixed direct programming of 16F87XA [report by Jorus Cbaoth]
* do not open empty editor when file does not exit
* no "added file to project" in new file dialog when there is no project
* also include code for absent source files in disassembly listing (fixed debugging with sdcc + 18F devices)
* fixed output hex filename for CCSC projects [report by krengersi and Bill Sack]
* fixed CCSC options for version 3 (only detected for linux executables)
0.14.1 (11 March 2007)
* fixed alignment problem with icd2 (for some 18F devices)
* fixed some i18n inconsistency [thanks to Alain Portal]
* fixed crash with config/template generator [report by Alain Portal]
* fixed adding files in same directory with project wizard
* fixed output hex filename for CC5X projects [report by philter_777]
* fixed inverted "read-only" toggle for hex editor
* fixed saving in editors (freeze with hex editor and display for text files)
* support for Tiny Bootloader
0.14.0 (4 March 2007)
* merge in kate gui for source editor (many more menu items available)
* added console tool [idea by Rajesh Sankaran]
* new project wizard
* template source file generator
* fixed gui problems with fast comment system
* fixed crash when compiling assembler file with sdcc [report by Stefan von Halenbach]
* fixed support for linux version of CCSC [report by Alan Page and Rajesh Sankaran]
* fixed configuration dialog for PIC30 toolchain
* added support for MPC and CCX5 compilers
* added possibility to use custom device name for serial and parallel port
* allow read/write/erase of individual memory range with command-line utility
* speed-up programming and fixed timeouts for pickit2 [patch from Mark Stanley]
* added pickit2 support for 16F87X
* fixed freeze for connecting gpsim with an empty project [report by Florian Brabetz]
* fixed crash when showing PC while debugging [report by Florian Brabetz]
* added "--force" option for command-line programmer (answer "yes" to question and overwrite files)
* new command-line utility for manipulating hex files (check, info, fix, and compare)
* added Hungarian translation [thanks to Nagy Lázló]
0.13.3 (8 February 2007)
* fixed compilation for OpenSuse and Fedora 5 [report by Xiaofan Chen and Alain Portal]
* fixed support for CCSC
* fixlet for asm highlighting
* possibility to added several source files at once [idea by Gyula Kampfner]
* fixed tool views (new user layout; fixed "show all" menu item; added "reset layout" menu item)
* fixed toolchain config dialog: update/reset buttons work better
* added serial USB devices under Slackware [thanks to Mark Stanley]
0.13.2 (31 January 2007)
* better support for CCSC (windows and linux executables) [thanks to Mark Stanley]
* german translation by Stephan von Halenbach
* fixed 16F7X7 debugging
* fixed Picstart+ support [thanks to Mark Stanley]
* fixed debug executive name for some 18F devices [thanks to mkgrajek]
* fixed register view for 18F devices
* added icd2 support for 16F946
* fixed spurious errors with gpsim
* show warning when config generation is incomplete
0.13.1 (27 January 2007)
* proper fixed for debug vector write/read for 18F devices with icd2 [thanks to Martin Forster]
* fixed 16F877 debugging [thanks to Martin Forster]
* fixed for ICD2 programming (verifying would fail when the code is at a large offset) [reported by Luke Cole]
* fixed compilation with KDE 3.3
* use toggle menu items for tool views [idea by Christoph Schäfer]
* fixed view unsplitting [reported by Christoph Schäfer]
* rows of 16 bytes for eeprom hex view [idea by Gyula Kampfner]
* allow includes and better messages parsing for jalv2
0.13.0 (19 January 2007)
* more flexible interface (by using dockable windows)
* better editor navigation
* fixed bug in register watch
* debugging from a standalone file is now possible
* read/write 24C eeproms with direct programmers
* added support for 18F1230/1330, 18F2682/4682/2685/4685 (direct programmers + ICD2)
* added direct programming support for 18F2439/4439/2539/4539,
18F6310/6410/8310/8410, 18F6390/6490/8390/8490
* "as-we-read" verify
* more robust usb detection (hopefully)
* more flexible compilation configuration
* added support for CCS, JALV2, BoostC, BoostC++, and BoostBasic compilers
* support for GPSim 0.22
* less CPU usage and errors when verifying with serial ICD2 [fixed from Steve Moskovchenko]
* extend even more the erase timeout for serial ICD2 [report by Ramiro del Corro]
0.12.2 (16 October 2006)
* fixed register view while not debugging
* fixed compilation for Slackware
0.12.1 (5 October 2006)
* fixes for Qt4
* fixed crash in advanced dialog
* added French translation [thanks to Alain Portal]
* fixed for sdcc and custom or debugging linker scripts
* only use icd2 linker script with icd2 debugger
0.12.0 (1 October 2006)
* pinout schematic for some devices
* added LikeBack for fast feedback
* icd2 debugging for 18F devices (tested with 18F452)
* more robust icd2 programming (fixed timeout for long erase) [bug reported by lonely_soul]
* fixed register view for 18F devices
* added detailed I/O and combined registers into watch view
* added register write to watch view
* save/restore watched registers per project
* fixed some problems with gpsim debugging
* fixed "--target-self-powered" option for command-line programmer
* added register read/write and breakpoints to command-line programmer
* fixed launching of pikloops [bug reported by chcarver]
* fixed 30F devices detection [bug reported by Yuri Ovcharenko]
* fixed for custom libraries and custom script for PIC30 [bug reported by Yuri Ovcharenko]
* fixed config generator for some 30F devices [bug reported by Yuri Ovcharenko]
* fixed some issues with PICC integration [bugs reported by gduprey]
* fixed integration of SDCC 2.6.0 [bugs reported by ambro]
* much faster parsing and correct disassembly listing for coff files generated by picc
* speed-up interface
* fixed select all/find in editor [bug reported by gduprey]
0.11.3 (7 September 2006)
* fixed crashes due to dependence on libkio for piklab-prog
0.11.2 (6 September 2006)
* fixed compilation by detecting libncurses under Suse
* fixed custom direct programmer configuration not appearing in dialog
* fixed duplicated message boxes
* fixed "command-list" option for command-line programmer
* fixed crash in register view for 18F devices
* fixed device information view
0.11.1 (23 August 2006)
* fixed crashes with command-line programmer
* fixed debugging for custom-made ICD2 [thanks to Nagy László]
0.11.0 (19 August 2006)
* support for the Picstart+ programmer [many thanks to Nestor A. Marchesini for testing]
* added support for gpsim (mid-range devices only)
* speed-up coff file parsing at end of compilation with picc compilers
* correctly highlight C lines in disassembly listing
* fixed register view to work correctly in debugging
* fixed watch view: changed status of registers was not correctly updated
* added variable names in register and watch views
* improved breakpoints management: fixed interaction with program counter
display, invalid and reached indicators, breakpoints can be disabled,
and listing tab.
* added action to switch between header and implementation
* added "port", "firmware-dir", and "target-self-powered" options to command-line programmer
* command-line programmer can be compiled without kdelibs (Qt3 or Qt4)
* command-line programmer for Windows (Qt4): works for serial ICD2 and serial "direct" programmers
* interactive mode for command-line programmer with debugging support
0.10.0 (7 July 2006)
* added support for JAL compiler + editor syntax highlighting
* source files can be reordered by drag and drop in project manager
* added disassembly listing for PICC compilers
* added support for C18 compiler
* added support for C30 with Wine and with coff format
* added support for custom linker script in project (GPUtils/SDCC and C18)
* display file full path as tooltip in project manager
* speed-up serial ICD1/2 programming [help by Steve Moskovchenko]
* fixed alignment bug in ICD2 programming [reported by Steve Moskovchenko]
* fixed "verify only programmed" option for ICD2 programming
* improved breakpoints management (updated in all editors, persistent if editors are closed)
* ICD2 debugging supported with PICC compilers
* fixed bug in register watching
* fixed slow update on keystroke in editor [reported by zoiks]
* some fixes and enhancements in asm and disassembly highlighting
0.9.0 (29 May 2006)
* added calibration information and debug executive version to advanced dialog
* added osccal regeneration for PICkit1 and PICkit2 (12F629/675/630/676)
* fixed PICkit2 firmware upload
* support for new PICkit2 firmware
* fixed programming of 18F devices with PICkit2
* initial support of ICD1 (not tested at all)
* fixed bug in parallel direct programming [thanks to kein0r]
* fixed checksum computation for some devices
* added devices 12F615 16F616/16F631/677 18F2450/4450
* faster loading, smaller executable, and smaller memory footprint
* fixed crash opening config generator with auto device
* added native coff parser (remove reliance on gpvo) + fixed disassembly highlighting
* added native disassembler (remove reliance on gpdasm) + now includes user ids and eeprom data
* support development version of sdcc and gputils
0.8.0 (6 May 2006)
* added support for 16F716, 16HV785, and 16F87/88 with PICkit2
* added action button for memory ranges (read/program/verify/erase/clear/zero/reload)
* added option to preserve data eeprom and to blank check after erase
* icd2 debugging: fixed STATUS/FSR/PCL/PCLATH read/write + added WREG/PC/STATUS/bank in status bar
* icd2 debugging: disable watchdog timer
* several fixes for hex editor
* added checksum computation (with command-line too)
* added option to set user id to unprotected checksum
* added read-only/read-write toggle to editors
* only display first and last banks for 18C/F chips (too slow otherwise...)
* fixed dsPICS programming with ICD2 [thanks to Laurent Pinchard]
* fixed calibration programming for baseline devices
* added option to run tools with wine
* added "advanced" dialog to programmers (firmware version + voltages)
* added manual firmware uploading for ICD2 (with command-line too)
0.7.0 (23 April 2006)
* fixed "program calibration" to write second word when present
* speed-up direct programming for some devices
* fixed direct programming of 18F devices
* fixed direct programmers on parallel port [thanks to Andrea Fadda]
* added direct programming for all remaining 16F and 18F devices
but 18FXX39-X310-X410-X390-X490
* option to only verify programmed words for direct programming
* added support for 16F946 and 18F devices with pickit2
* added support for Pickit1 programmer (baseline and midrange devices)
* added 16C84, 16CR73/74/76/77 devices
* added configuration generator for dsPICs and PIC30 toolchain
* added "power device" toolbar/menu entry
* fixed some issues with libusb
* read/write/watch registers while debugging
0.6.1 (22 March 2006)
* warn when hex file cannot be saved [reported by freddy]
* tweak desktop file
* added mimetype for project file
* fixed lost calibration word for some 12F and 16F parts [reported by Xiaofan Chen]
* fixed crash when creating new hex file with "auto" device
0.6.0 (14 March 2006)
* save dialog sizes and splitter positions
* config generator (baseline, midrange and some 18F devices)
* support for pic30 toolchain
* support for PICC-Lite, PICC and PICC-18
* configurable executable paths
* save opened files per project
* fixed crash with "auto" device [reported by y2kmi]
* added 16F7X7 support for direct programmers
* warn if firmware version is not the one tested
* fixed osccal read/write with pickit2 [reported by Xiaofan Chen]
* fixed alignment bug in 18F programming [reported by Xiaofan Chen]
* added device view to project manager
* added register view to project manager
0.5.2 (1 March 2006)
* partial fixed for aligment bug in 18F programming [reported by Xiaofan Chen]
* fixed broken hex file save
0.5.1 (28 February 2006)
* fixed crash at startup [reported by Ed Bennett]
0.5.0 (24 February 2006)
* new project file format (xml)
* several fixes in user interface
* breapoints for ICD2 debugging of 16F parts
* support for Small Device C Compiler (sdcc)
* group config options for standalone file inside its own section
* fixed compilation for gcc>4.0.1
* added devices 16F506, 16F946, and 30F6010A/6011A/6012A/6013A/6014A/6015
* added 10F2XX, 12F5XX, 14000, all 12C and 16C parts support for direct programmers
* added 12F510, 16F59/627/628/685/687/689/690/7X/785/84A/91X,
18F24XX/25XX/44XX/45XX/6310/6390/8310/8390/6627/8627/6722/8722,
30F2011/2012/3011/3014/5011/5013 to icd2 programmer
* fixed configuration blank check for several 18F devices
0.4.2 (18 February 2006)
* if self-test failed, ask user if he wants to continue (ICD2)
* added support for 12F510, 16F54-57-59 and 16F7X7 for PICkit2
* fixed osccal and user ids read/write for some baseline chips with PICkit2 (12F508...)
* fixed osccal read/write for some mid-range chips with PICkit2 (12F675...)
* fixed osccal read/write for 12F675 with direct programmer
* fixed compilation issue
0.4.1 (14 February 2006)
* linker now generates coff files by default (fixed disassembly listing)
* warn when device not supported by gputils
* correctly display bang gap bits
0.4.0 (12 February 2006)
* option to only program memory than need to be programmed (speed-up)
* several fixes for editors
* disassembly listing
* warn if DEBUG configuration bit is on when not debugging
* added included files in project listview
* support for PICkit2 (baseline and midrange devices)
* option to program after successful build
* option to power off target after programming
* basic ICD2 debugging (start/interrupt/step)
* fixed for calibration words and band gap bits
0.3.2 (27 January 2006)
* fixed for 16F81X/F87/F88 and 16F87XA direct programming bug
* fixed compilation (gcc 3.4)
* command-line programmer should now work without any running X server
0.3.1 (22 January 2006)
* fixed freeze if serial cable disconnected from ICD2
0.3.0 (21 January 2006)
* protected areas are excluded from verification
* display code memory blocks in hex editor
* display protected areas in hex editor
* better configuration center
* make compilation framework more flexible
* show linker script in project listview
* stand alone files now act as pseudo-projects
* direct programmers now use global device data
* JDM-type serial programmer works
* fixed and simplify direct programmer configuration widget
* incorporate some fixes from pikdev 0.8.2
* fixed crash and bugs with ICD2 [reported by Xiaofan Chen]
* fixed detection of libusb [reported by Xiaofan Chen]
* fixed some FreeBSD compilation issues [help by Xiaofan Chen]
* make serial and usb operations more reliable
0.2.0 (11 December 2005)
* command line programmer
* use XML files for device data (hex editor is now independent from
selected programmer).
* enhanced device chooser: sorts devices by family;
information page (with link to device page on Microchip website and status).
* "connect" and "hold_reset" programmer action
* incorporate some fixes from pikdev 0.8.1
* enhanced hex editor: disable wheel scrolling on config comboboxes;
fixed memory display focus; added navigation keys; check compatibility with
device type.
* upload firmware for icd2
* icd2 over USB
0.1.0 (22 June 2005)
* convert config and new project windows to KDialogBase
* added ICD2 programmer infrastructure (from "lplab")
* reorganize in subprojects
* clean-up and factor code
* convert programmer window in hex editor
* lots of GUI fixes
This changelog is relative to pikdev 0.7.2

1161
Doxyfile

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
COMPILATION:
- "make -f Makefile.cvs" (usually not needed for distributed tarballs)
- "./configure --enable-debug=full" (check ./configure --help for other options)
- "make"
INSTALLATION:
- "make install" (as root)

@ -0,0 +1,13 @@
AUTOMAKE_OPTIONS = foreign 1.5
EXTRA_DIST = README COPYING Changelog
MAINTAINERCLEANFILES = configure.files subdirs
dist-hook:
cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin
distclean-local:
rm -rf autom4te.cache
rm -f svn-commit.*
SUBDIRS=$(TOPSUBDIRS)

@ -0,0 +1,12 @@
AUTOMAKE_OPTIONS = foreign 1.5
EXTRA_DIST = README COPYING Changelog
MAINTAINERCLEANFILES = configure.files subdirs
dist-hook:
cd $(top_distdir) && perl $(top_srcdir)/admin/am_edit -padmin
distclean-local:
rm -rf autom4te.cache
rm -f svn-commit.*

@ -0,0 +1,20 @@
all:
@echo "This Makefile is only for the SVN repository"
@echo ""
@if test ! -d admin; then \
echo "Please update this module!" ;\
exit 1 ;\
fi
@echo "Extract messages"
$(MAKE) -f admin/Makefile.common package-messages
cd po && sh merge.sh
@echo ""
@echo "Create configure & co"
$(MAKE) -f admin/Makefile.common cvs
messages:
@echo "Extract messages"
$(MAKE) -f admin/Makefile.common package-messages
cd po && sh merge.sh
.SILENT:

@ -0,0 +1,27 @@
Piklab: An integrated development environment for PIC microcontrollers
Copyright (C) 2005-2007 Nicolas Hadacek <hadacek@kde.org>
Copyright (C) 2006 Sébastien Laoût
Copyright (C) 2002-2005 Alain Gibaud
Copyright (C) 2003-2004 Stephen Landamore
Copyright (C) 2001-2005 Craig Franklin
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License along
with this program; if not, write to the Free Software Foundation, Inc.,
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
--------------------------------------------------------------------------------
BEWARE: this is beta software. BUGS are likely!!!
IMPORTANT: see http://piklab.sourceforge.net for support and notes.
FEEDBACK is greatly appreciated (go to http://piklab.sourceforge.net or
send me an email at hadacek@kde.org): report bugs, successes,...

145
TODO

@ -0,0 +1,145 @@
icd2: assert in progress when programming with icd2 debugger
TODO programmers:
* icd1/2: optimize programming/reading: only program/read what's necessary!!
* direct: alternate method to direct-program "Vdd first" chips (needed ?)
* pickit2: protocol for firmware 2.x
* support for other bootloaders (AN851, ...)
* look into xwisp2/avrdude
* pickit1/2: speed-up by not programming mask words and by programming 4/n words when possible...
* pickit2: now supports 16F886/887
* add promate2
* direct: support dsPIC
* add option to not autoload firmware (?)
* direct: support 16F88X devices
* icd2: 12F609/615 16F610 16F677(debug) 16F88X 30F1010/2020/2023
famid for 18J devices
* pickit2: configuration to set target voltage to different values (?)
* icd2: progress for firmware uploading
* psp: add 18F support
* psp: detection of programmer type (PSP, JuPIC, or Warp13)
* psp: for Warp13, there are some differences for 18F devices...
TODO debuggers:
* gpsim: add stopwatch feature + clock speed config
* icd2: fix 16FXXX debugging: init + reset + ...
* 18F1330-ICD ?
* icd2: how to read PORTB from 16F7X7
* device power toggle action: problem while running/debugging... (?)
* should be able to read/verify/blankcheck while debugging: restart debug: ask ?
* icd2: support more than one breakpoint for 18F
* advanced breakpoints (register, function, ...)
* add icd1 debugging
* support sdcdb (?)
* support ICD from CCS
* PIC30: no disassembly in disassembly listing
TODO interface:
* set breakpoint in disassembly listing, close, reopen: not displayed...
* escaping in string register entry
* add serial terminal
* "read all" registers is slow (gui refresh for each read)
* add PC and goto PC in breakpoint list view (?)
* add "random/set_range/..." actions to each range in hex editor
* more filters in device selector
* undo/redo + better selection in hex editor
* .o view: more complete (?)
* renaming of source files
* COFF disassembly highlighting does not properly highlight multiline comments for C
TODO toolchains:
* support CC8E
* PICC: no need to compile and assemble in two steps for C files
* PICC: test debugging (from C or ASM files)
* mix different compiler and assembler in a project... (subproject ?)
* support for MPASM/MPLINK (mpasm freezes my version of wine...)
* error/warning filter for C30/PICC/JAL/C18
* syntax highlighting for JAL: highlight assembler blocks
* better syntax highlighting for Boost Basic
* PICC Lite windows executable crashes with wine
* support dsPICC: demo windows only and not working with wine
* support C2C, C2C++, P2C: exception in wine...
* support Proton Basic compiler
* library project: other toolchains ?
TODO generators:
* fix cname generation for BSSEC/BSSIZ SSSEC/SSSIZ (none supported yet by gputils/sdcc ?)
* add missing template generators
* config generator: add/fix config names for gpasm/sdcc (18F) + picc + ...
TODO command-line:
* add "merge" commands to "piklab-hex"
* add utility to disassemble (?)
TODO misc:
* if CTRL+D in konsole: should restart it...
* check endianness: it should be alright since we are reading from hex file and outputing strings (?)
* add log settings: log file / timestamp
* allow saving hex to other formats
* shouldn't we always use the IHX32 format for devices 18 and up ???
* Vdd-frequency graphs ignore different osc/modes...
* code for UserId disassembly doesn't seem to be right...
DEVICES:
- finish checking device XML with XML Schema...
- make an automatic parser for file "gpprocessor.c" of gputils to extract coff codes.
- check list of devices against MPLAB for missing devices and discrepencies.
- config bits: check config bits from MPLAB
- vdd/freq: not sure I understand the Vdd range in 30F datasheets
- sometimes "vpp" depends on "vdd"...
- revision names...
- 16F630-ICD has lower Vdd requirements for read/write
- for 18F1230/1330 16F88X: Vdd-F graphs not available yet...
- 12F6XX-16F6XX-ICD have lower Vdd requirements for bulk erase
- checksums:
unknown : 16C641/C661/C84 18J 18F2XXX/4XXX
all wrong (?) : 16CE923/CE925 30F
protected wrong (?) : 16CR73/CR74/CR76/CR77 16F72/F73/F74/F76/F77 16F873A/874A
18F1230/1330
datasheet wrong (?) : 12F508(Off:cc=DC68)
16C55A (All:cc=F332) 16C56A(All:not XOR4)
16C712(size=3FF)
16F616 (All:bc=FFBE cc=CBD8)
18F4331(same as 18F2331)
18F2439/4439/6520/8520 (wrong program size)
blank value discrepencies : 18F6525
- 16C433: config bits datasheet do not agree with progsheet (used progsheet)
- 16CR54/16C557: status ?
- 16HV540: discrepency between datasheet and progsheet for CP bits
- 18F2585/4585/2680/4680: data sheet is wrong for block description (boot block size is variable)
- 18F6X10/6X90: discrepencies between datasheet and progsheet for PM and EBTR bits
- unknown devices (from gpasm) : 18F2681/F4681/F64J15/F84J15
- 16CR57A ?
- nr: PS501 PS810 PS700
- new devices:
33F
24F16/32/48
18F6628/8628/6723/8723 (compatible 18F8722)
- future devices:
16F526
18F23K20/24K20/25K20/26K20
18F43K20/44K20/45K20/46K20
24FJ256GA110
GPUTILS: 0.13.5
- 16C54A: _CP_ON doesn't yield 0x007 [fixed in trunk]
- 16C715: _CP_75 is missing [fixed in trunk]
- 16F737/767/777 16F87/88: _FCMEN_OFF doesn't yield 0xFFE [submitted]
- 16F883/884/886/887: BORV_21 doesn't yield 0xEFF
- 17C42A/C43/C44: _PMC_MODE doesn't yield 0x7FAF
- 18F1230/1330: BORV doesn't have the correct values in .inc file
- 18F258/458: BORV_25 should be BORV_20
- 18F2510: using 12F510 lkr (?)
- 18F6X10/6X90/8X10/8X90: missing PM/EBTR (if they exists on these devices ??)
- 18J: config bits commented in "inc" file
SDCC: 2.7.0
- 16CR620A/CR73/CR74/CR76/CR77: missing include
- 16F616/F747/F946: missing include
- 16F737/767/777/87/88: cf gputils
- 16F886/887: missing DEBUG define [fixed in trunk]
- 18F1320/2320/2525/4525: missing include
- 18F2221/2321/4221/4320: not supported by GPUtils 0.13.5
- 18F4455/4550: missing ENICPORT_ON
- 18F4620: missing XINST

File diff suppressed because it is too large Load Diff

863
aclocal.m4 vendored

@ -0,0 +1,863 @@
# generated automatically by aclocal 1.9.6 -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
# 2005 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
# Copyright (C) 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_AUTOMAKE_VERSION(VERSION)
# ----------------------------
# Automake X.Y traces this macro to ensure aclocal.m4 has been
# generated from the m4 files accompanying Automake X.Y.
AC_DEFUN([AM_AUTOMAKE_VERSION], [am__api_version="1.9"])
# AM_SET_CURRENT_AUTOMAKE_VERSION
# -------------------------------
# Call AM_AUTOMAKE_VERSION so it can be traced.
# This function is AC_REQUIREd by AC_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
[AM_AUTOMAKE_VERSION([1.9.6])])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
# therefore $ac_aux_dir as well) can be either absolute or relative,
# depending on how configure is run. This is pretty annoying, since
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
# source directory, any form will work fine, but in subdirectories a
# relative path needs to be adjusted first.
#
# $ac_aux_dir/missing
# fails when called from a subdirectory if $ac_aux_dir is relative
# $top_srcdir/$ac_aux_dir/missing
# fails if $ac_aux_dir is absolute,
# fails when called from a subdirectory in a VPATH build with
# a relative $ac_aux_dir
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
# harmless because $srcdir is `.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
# and then we would define $MISSING as
# MISSING="\${SHELL} $am_aux_dir/missing"
# This will work as long as MISSING is not called from configure, because
# unfortunately $(top_srcdir) has no meaning in configure.
# However there are other variables, like CC, which are often used in
# configure, and could therefore not use this "fixed" $ac_aux_dir.
#
# Another solution, used here, is to always expand $ac_aux_dir to an
# absolute PATH. The drawback is that using absolute paths prevent a
# configured tree to be moved without reconfiguration.
AC_DEFUN([AM_AUX_DIR_EXPAND],
[dnl Rely on autoconf to set up CDPATH properly.
AC_PREREQ([2.50])dnl
# expand $ac_aux_dir to an absolute path
am_aux_dir=`cd $ac_aux_dir && pwd`
])
# AM_CONDITIONAL -*- Autoconf -*-
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 7
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
[AC_PREREQ(2.52)dnl
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])
AC_SUBST([$1_FALSE])
if $2; then
$1_TRUE=
$1_FALSE='#'
else
$1_TRUE='#'
$1_FALSE=
fi
AC_CONFIG_COMMANDS_PRE(
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
AC_MSG_ERROR([[conditional "$1" was never defined.
Usually this means the macro was only invoked conditionally.]])
fi])])
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
# CC etc. in the Makefile, will ask for an AC_PROG_CC use...
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
# NAME is "CC", "CXX", "GCJ", or "OBJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
# modified to invoke _AM_DEPENDENCIES(CC); we would have a circular
# dependency, and given that the user is not expected to run this macro,
# just rely on AC_PROG_CC.
AC_DEFUN([_AM_DEPENDENCIES],
[AC_REQUIRE([AM_SET_DEPDIR])dnl
AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
[$1], CXX, [depcc="$CXX" am_compiler_list=],
[$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
[$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
[depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
[if test -z "$AMDEP_TRUE" && test -f "$am_depcomp"; then
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
# making a dummy file named `D' -- because `-MD' means `put the output
# in D'.
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
cp "$am_depcomp" conftest.dir
cd conftest.dir
# We will build objects and dependencies in a subdirectory because
# it helps to detect inapplicable dependency modes. For instance
# both Tru64's cc and ICC support -MD to output dependencies as a
# side effect of compilation, but ICC will put the dependencies in
# the current directory while Tru64 will put them in the object
# directory.
mkdir sub
am_cv_$1_dependencies_compiler_type=none
if test "$am_compiler_list" = ""; then
am_compiler_list=`sed -n ['s/^#*\([a-zA-Z0-9]*\))$/\1/p'] < ./depcomp`
fi
for depmode in $am_compiler_list; do
# Setup a source with many dependencies, because some compilers
# like to wrap large dependency lists on column 80 (with \), and
# we should not choose a depcomp mode which is confused by this.
#
# We need to recreate these files for each test, as the compiler may
# overwrite some of them when testing with obscure command lines.
# This happens at least with the AIX C compiler.
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
# Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
# Solaris 8's {/usr,}/bin/sh.
touch sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
case $depmode in
nosideeffect)
# after this tag, mechanisms are not by side-effect, so they'll
# only be used when explicitly requested
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
none) break ;;
esac
# We check with `-c' and `-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
# handle `-M -o', and we need to detect this.
if depmode=$depmode \
source=sub/conftest.c object=sub/conftest.${OBJEXT-o} \
depfile=sub/conftest.Po tmpdepfile=sub/conftest.TPo \
$SHELL ./depcomp $depcc -c -o sub/conftest.${OBJEXT-o} sub/conftest.c \
>/dev/null 2>conftest.err &&
grep sub/conftst6.h sub/conftest.Po > /dev/null 2>&1 &&
grep sub/conftest.${OBJEXT-o} sub/conftest.Po > /dev/null 2>&1 &&
${MAKE-make} -s -f confmf > /dev/null 2>&1; then
# icc doesn't choke on unknown options, it will just issue warnings
# or remarks (even with -Werror). So we grep stderr for any message
# that says an option was ignored or not supported.
# When given -MP, icc 7.0 and 7.1 complain thusly:
# icc: Command line warning: ignoring option '-M'; no argument required
# The diagnosis changed in icc 8.0:
# icc: Command line remark: option '-MP' not supported
if (grep 'ignoring option' conftest.err ||
grep 'not supported' conftest.err) >/dev/null 2>&1; then :; else
am_cv_$1_dependencies_compiler_type=$depmode
break
fi
fi
done
cd ..
rm -rf conftest.dir
else
am_cv_$1_dependencies_compiler_type=none
fi
])
AC_SUBST([$1DEPMODE], [depmode=$am_cv_$1_dependencies_compiler_type])
AM_CONDITIONAL([am__fastdep$1], [
test "x$enable_dependency_tracking" != xno \
&& test "$am_cv_$1_dependencies_compiler_type" = gcc3])
])
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
# This macro is AC_REQUIREd in _AM_DEPENDENCIES
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
])
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
[AC_ARG_ENABLE(dependency-tracking,
[ --disable-dependency-tracking speeds up one-time build
--enable-dependency-tracking do not reject slow dependency extractors])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
#serial 3
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[for mf in $CONFIG_FILES; do
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
# We used to match only the files named `Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
# So let's grep whole file.
if grep '^#.*generated by automake' $mf > /dev/null 2>&1; then
dirpart=`AS_DIRNAME("$mf")`
else
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
# from the Makefile without running `make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
test -z "am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
# When using ansi2knr, U may be empty or an underscore; expand it
U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
AS_MKDIR_P([$dirpart/$fdir])
# echo "creating $dirpart/$file"
echo '# dummy' > "$dirpart/$file"
done
done
])# _AM_OUTPUT_DEPENDENCY_COMMANDS
# AM_OUTPUT_DEPENDENCY_COMMANDS
# -----------------------------
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
# is enabled. FIXME. This creates each `.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
[test x"$AMDEP_TRUE" != x"" || _AM_OUTPUT_DEPENDENCY_COMMANDS],
[AMDEP_TRUE="$AMDEP_TRUE" ac_aux_dir="$ac_aux_dir"])
])
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 8
# AM_CONFIG_HEADER is obsolete. It has been replaced by AC_CONFIG_HEADERS.
AU_DEFUN([AM_CONFIG_HEADER], [AC_CONFIG_HEADERS($@)])
# Do all the work for Automake. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 12
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
# The call with PACKAGE and VERSION arguments is the old style
# call (pre autoconf-2.50), which is being phased out. PACKAGE
# and VERSION should now be passed to AC_INIT and removed from
# the call to AM_INIT_AUTOMAKE.
# We support both call styles for the transition. After
# the next Automake release, Autoconf can make the AC_INIT
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
[AC_PREREQ([2.58])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
AC_REQUIRE([AC_PROG_INSTALL])dnl
# test to see if srcdir already configured
if test "`cd $srcdir && pwd`" != "`pwd`" &&
test -f $srcdir/config.status; then
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
fi
# test whether we have cygpath
if test -z "$CYGPATH_W"; then
if (cygpath --version) >/dev/null 2>/dev/null; then
CYGPATH_W='cygpath -w'
else
CYGPATH_W=echo
fi
fi
AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
AM_MISSING_PROG(AUTOCONF, autoconf)
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
AM_MISSING_PROG(AUTOHEADER, autoheader)
AM_MISSING_PROG(MAKEINFO, makeinfo)
AM_PROG_INSTALL_SH
AM_PROG_INSTALL_STRIP
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
[_AM_DEPENDENCIES(CC)],
[define([AC_PROG_CC],
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
[_AM_DEPENDENCIES(CXX)],
[define([AC_PROG_CXX],
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
])
])
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
# loop where config.status creates the headers, so we can generate
# our stamp files there.
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
[# Compute $1's index in $config_headers.
_am_stamp_count=1
for _am_header in $config_headers :; do
case $_am_header in
$1 | $1:* )
break ;;
* )
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
esac
done
echo "timestamp for $1" >`AS_DIRNAME([$1])`/stamp-h[]$_am_stamp_count])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_SH
# ------------------
# Define $install_sh.
AC_DEFUN([AM_PROG_INSTALL_SH],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
install_sh=${install_sh-"$am_aux_dir/install-sh"}
AC_SUBST(install_sh)])
# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
[rm -rf .tst 2>/dev/null
mkdir .tst 2>/dev/null
if test -d .tst; then
am__leading_dot=.
else
am__leading_dot=_
fi
rmdir .tst 2>/dev/null
AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
AC_DEFUN([AM_MAKE_INCLUDE],
[am_make=${MAKE-make}
cat > confinc << 'END'
am__doit:
@echo done
.PHONY: am__doit
END
# If we don't find an include directive, just comment out the code.
AC_MSG_CHECKING([for style of include used by $am_make])
am__include="#"
am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
# We grep out `Entering directory' and `Leaving directory'
# messages which can occur if `w' ends up in MAKEFLAGS.
# In particular we don't look at `^make:' because GNU make might
# be invoked under some other name (usually "gmake"), in which
# case it prints its new name instead of `make'.
if test "`$am_make -s -f confmf 2> /dev/null | grep -v 'ing directory'`" = "done"; then
am__include=include
am__quote=
_am_result=GNU
fi
# Now try BSD make style include.
if test "$am__include" = "#"; then
echo '.include "confinc"' > confmf
if test "`$am_make -s -f confmf 2> /dev/null`" = "done"; then
am__include=.include
am__quote="\""
_am_result=BSD
fi
fi
AC_SUBST([am__include])
AC_SUBST([am__quote])
AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
[AC_REQUIRE([AM_MISSING_HAS_RUN])
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
# AM_MISSING_HAS_RUN
# ------------------
# Define MISSING if not defined so far and test if it supports --run.
# If it does, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
test x"${MISSING+set}" = xset || MISSING="\${SHELL} $am_aux_dir/missing"
# Use eval to expand $SHELL
if eval "$MISSING --run true"; then
am_missing_run="$MISSING --run "
else
am_missing_run=
AC_MSG_WARN([`missing' script is too old or missing])
fi
])
# Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_MKDIR_P
# ---------------
# Check whether `mkdir -p' is supported, fallback to mkinstalldirs otherwise.
#
# Automake 1.8 used `mkdir -m 0755 -p --' to ensure that directories
# created by `make install' are always world readable, even if the
# installer happens to have an overly restrictive umask (e.g. 077).
# This was a mistake. There are at least two reasons why we must not
# use `-m 0755':
# - it causes special bits like SGID to be ignored,
# - it may be too restrictive (some setups expect 775 directories).
#
# Do not use -m 0755 and let people choose whatever they expect by
# setting umask.
#
# We cannot accept any implementation of `mkdir' that recognizes `-p'.
# Some implementations (such as Solaris 8's) are not thread-safe: if a
# parallel make tries to run `mkdir -p a/b' and `mkdir -p a/c'
# concurrently, both version can detect that a/ is missing, but only
# one can create it and the other will error out. Consequently we
# restrict ourselves to GNU make (using the --version option ensures
# this.)
AC_DEFUN([AM_PROG_MKDIR_P],
[if mkdir -p --version . >/dev/null 2>&1 && test ! -d ./--version; then
# We used to keeping the `.' as first argument, in order to
# allow $(mkdir_p) to be used without argument. As in
# $(mkdir_p) $(somedir)
# where $(somedir) is conditionally defined. However this is wrong
# for two reasons:
# 1. if the package is installed by a user who cannot write `.'
# make install will fail,
# 2. the above comment should most certainly read
# $(mkdir_p) $(DESTDIR)$(somedir)
# so it does not work when $(somedir) is undefined and
# $(DESTDIR) is not.
# To support the latter case, we have to write
# test -z "$(somedir)" || $(mkdir_p) $(DESTDIR)$(somedir),
# so the `.' trick is pointless.
mkdir_p='mkdir -p --'
else
# On NextStep and OpenStep, the `mkdir' command does not
# recognize any option. It will interpret all options as
# directories to create, and then abort because `.' already
# exists.
for d in ./-p ./--version;
do
test -d $d && rmdir $d
done
# $(mkinstalldirs) is defined by Automake if mkinstalldirs exists.
if test -f "$ac_aux_dir/mkinstalldirs"; then
mkdir_p='$(mkinstalldirs)'
else
mkdir_p='$(install_sh) -d'
fi
fi
AC_SUBST([mkdir_p])])
# Helper functions for option handling. -*- Autoconf -*-
# Copyright (C) 2001, 2002, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 3
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
# ------------------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
# _AM_SET_OPTIONS(OPTIONS)
# ----------------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[AC_FOREACH([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
# -------------------------------------------
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
# Check to make sure that the build environment is sane. -*- Autoconf -*-
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005
# Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 4
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
# Just in case
sleep 1
echo timestamp > conftest.file
# Do `set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
set X `ls -Lt $srcdir/configure conftest.file 2> /dev/null`
if test "$[*]" = "X"; then
# -L didn't work.
set X `ls -t $srcdir/configure conftest.file`
fi
rm -f conftest.file
if test "$[*]" != "X $srcdir/configure conftest.file" \
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
# If neither matched, then we have a broken ls. This can happen
# if, for instance, CONFIG_SHELL is bash and it inherits a
# broken ls alias from the environment. This has actually
# happened. Such a system could not be considered "sane".
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
alias in your environment])
fi
test "$[2]" = conftest.file
)
then
# Ok.
:
else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
AC_MSG_RESULT(yes)])
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# AM_PROG_INSTALL_STRIP
# ---------------------
# One issue with vendor `install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
# always use install-sh in `make install-strip', and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
# Installed binaries are usually stripped using `strip' when the user
# run `make install-strip'. However `strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
# will honor the `STRIP' environment variable to overrule this program.
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\${SHELL} \$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
# Check how to create a tarball. -*- Autoconf -*-
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# serial 2
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
# FORMAT should be one of `v7', `ustar', or `pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
# $tardir.
# tardir=directory && $(am__tar) > result.tar
#
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
AC_DEFUN([_AM_PROG_TAR],
[# Always define AMTAR for backward compatibility.
AM_MISSING_PROG([AMTAR], [tar])
m4_if([$1], [v7],
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
[m4_case([$1], [ustar],, [pax],,
[m4_fatal([Unknown tar format])])
AC_MSG_CHECKING([how to create a $1 tar archive])
# Loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
# Do not fold the above two line into one, because Tru64 sh and
# Solaris sh will not grok spaces in the rhs of `-'.
for _am_tool in $_am_tools
do
case $_am_tool in
gnutar)
for _am_tar in tar gnutar gtar;
do
AM_RUN_LOG([$_am_tar --version]) && break
done
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
am__untar="$_am_tar -xf -"
;;
plaintar)
# Must skip GNU tar: if it does not support --format= it doesn't create
# ustar tarball either.
(tar --version) >/dev/null 2>&1 && continue
am__tar='tar chf - "$$tardir"'
am__tar_='tar chf - "$tardir"'
am__untar='tar xf -'
;;
pax)
am__tar='pax -L -x $1 -w "$$tardir"'
am__tar_='pax -L -x $1 -w "$tardir"'
am__untar='pax -r'
;;
cpio)
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
am__untar='cpio -i -H $1 -d'
;;
none)
am__tar=false
am__tar_=false
am__untar=false
;;
esac
# If the value was cached, stop now. We just wanted to have am__tar
# and am__untar set.
test -n "${am_cv_prog_tar_$1}" && break
# tar/untar a dummy directory, and stop if the command works
rm -rf conftest.dir
mkdir conftest.dir
echo GrepMe > conftest.dir/file
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
rm -rf conftest.dir
if test -s conftest.tar; then
AM_RUN_LOG([$am__untar <conftest.tar])
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
fi
done
rm -rf conftest.dir
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
m4_include([acinclude.m4])

@ -0,0 +1,18 @@
## adjust or comment the following lines to reflect your configuration
DEFINES += HAVE_USB
unix:DEFINES += HAVE_PPDEV
unix:DEFINES += HAVE_READLINE
## for directories with a space in their name, use the short filename format
## for e.g. "Program Files" should be "Progra~1"
win32: LIBUSB_PATH = "C:\Progra~1\LibUSB-Win32"
###############################################################################
DEFINES += NO_KDE QT_NO_ASCII_CAST
OBJECTS_DIR = .libs
MOC_DIR = .libs
QT = qt3support core xml network
CONFIG += qt thread warn_on console
unix:CONFIG += release #debug
win32:CONFIG += release
INCLUDEPATH += $${STOPDIR}/src $${STOPDIR}
DEPENDPATH += $${STOPDIR}/app.pro $${STOPDIR}/all.pro $${STOPDIR}/lib.pro

@ -0,0 +1,6 @@
include($${STOPDIR}/all.pro)
TEMPLATE = app
unix:QMAKE_CLEAN += $${TARGET}
win32:DESTDIR = .\
win32:QMAKE_CLEAN += $${TARGET}.exe

1561
config.guess vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,259 @@
/* config.h.in. Generated from configure.in by autoheader. */
/* Define to 1 if you have the <Carbon/Carbon.h> header file. */
#undef HAVE_CARBON_CARBON_H
/* Define if you have the CoreAudio API */
#undef HAVE_COREAUDIO
/* Define to 1 if you have the <crt_externs.h> header file. */
#undef HAVE_CRT_EXTERNS_H
/* Defines if your system has the crypt function */
#undef HAVE_CRYPT
/* Define to 1 if you have the <dlfcn.h> header file. */
#undef HAVE_DLFCN_H
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define if you have libjpeg */
#undef HAVE_LIBJPEG
/* Define if you have libpng */
#undef HAVE_LIBPNG
/* Define if you have a working libpthread (will enable threaded code) */
#undef HAVE_LIBPTHREAD
/* Define if you have libz */
#undef HAVE_LIBZ
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define if your system needs _NSGetEnviron to set up the environment */
#undef HAVE_NSGETENVIRON
/* Define if we can use ppbus for parallel port access */
#undef HAVE_PPBUS
/* Define if we can use ppdev for parallel port access */
#undef HAVE_PPDEV
/* Define if libreadline header is present. */
#undef HAVE_READLINE
/* Define if you have res_init */
#undef HAVE_RES_INIT
/* Define if you have the res_init prototype */
#undef HAVE_RES_INIT_PROTO
/* Define if you have a STL implementation by SGI */
#undef HAVE_SGI_STL
/* Define to 1 if you have the `snprintf' function. */
#undef HAVE_SNPRINTF
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define if you have strlcat */
#undef HAVE_STRLCAT
/* Define if you have the strlcat prototype */
#undef HAVE_STRLCAT_PROTO
/* Define if you have strlcpy */
#undef HAVE_STRLCPY
/* Define if you have the strlcpy prototype */
#undef HAVE_STRLCPY_PROTO
/* Define to 1 if you have the <sys/bitypes.h> header file. */
#undef HAVE_SYS_BITYPES_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define if libusb is available */
#undef HAVE_USB
/* Define to 1 if you have the <usb.h> header file. */
#undef HAVE_USB_H
/* Define to 1 if you have the `vsnprintf' function. */
#undef HAVE_VSNPRINTF
/* Suffix for lib directories */
#undef KDELIBSUFF
/* libusb version */
#undef LIBUSB_VERSION
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* The size of `char *', as computed by sizeof. */
#undef SIZEOF_CHAR_P
/* The size of `int', as computed by sizeof. */
#undef SIZEOF_INT
/* The size of `long', as computed by sizeof. */
#undef SIZEOF_LONG
/* The size of `short', as computed by sizeof. */
#undef SIZEOF_SHORT
/* The size of `size_t', as computed by sizeof. */
#undef SIZEOF_SIZE_T
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Defined if compiling without arts */
#undef WITHOUT_ARTS
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#undef WORDS_BIGENDIAN
/*
* jpeg.h needs HAVE_BOOLEAN, when the system uses boolean in system
* headers and I'm too lazy to write a configure test as long as only
* unixware is related
*/
#ifdef _UNIXWARE
#define HAVE_BOOLEAN
#endif
/*
* AIX defines FD_SET in terms of bzero, but fails to include <strings.h>
* that defines bzero.
*/
#if defined(_AIX)
#include <strings.h>
#endif
#if defined(HAVE_NSGETENVIRON) && defined(HAVE_CRT_EXTERNS_H)
# include <sys/time.h>
# include <crt_externs.h>
# define environ (*_NSGetEnviron())
#endif
#if !defined(HAVE_RES_INIT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
int res_init(void);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STRLCAT_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcat(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
#if !defined(HAVE_STRLCPY_PROTO)
#ifdef __cplusplus
extern "C" {
#endif
unsigned long strlcpy(char*, const char*, unsigned long);
#ifdef __cplusplus
}
#endif
#endif
/*
* On HP-UX, the declaration of vsnprintf() is needed every time !
*/
#if !defined(HAVE_VSNPRINTF) || defined(hpux)
#if __STDC__
#include <stdarg.h>
#include <stdlib.h>
#else
#include <varargs.h>
#endif
#ifdef __cplusplus
extern "C"
#endif
int vsnprintf(char *str, size_t n, char const *fmt, va_list ap);
#ifdef __cplusplus
extern "C"
#endif
int snprintf(char *str, size_t n, char const *fmt, ...);
#endif
#if defined(__SVR4) && !defined(__svr4__)
#define __svr4__ 1
#endif
/* type to use in place of socklen_t if not defined */
#undef kde_socklen_t
/* type to use in place of socklen_t if not defined (deprecated, use
kde_socklen_t) */
#undef ksize_t

@ -0,0 +1,379 @@
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by configure, which was
generated by GNU Autoconf 2.61. Invocation command line was
$ ./configure CFLAGS=-Wall -g -O2 LDFLAGS=-Wl,-z,defs -Wl,--as-needed --host=x86_64-linux-gnu --build=x86_64-linux-gnu --prefix=/opt/kde3 --with-extra-libs=/opt/kde3/lib --with-extra-includes=/opt/kde3/include/kde --mandir=/opt/kde3/share/man --infodir=/opt/kde3/share/info --enable-rpath
## --------- ##
## Platform. ##
## --------- ##
hostname = argus4
uname -m = x86_64
uname -r = 2.6.31-16-generic
uname -s = Linux
uname -v = #53-Ubuntu SMP Tue Dec 8 04:02:15 UTC 2009
/usr/bin/uname -p = unknown
/bin/uname -X = unknown
/bin/arch = unknown
/usr/bin/arch -k = unknown
/usr/convex/getsysinfo = unknown
/usr/bin/hostinfo = unknown
/bin/machine = unknown
/usr/bin/oslevel = unknown
/bin/universe = unknown
PATH: /opt/kde3/bin
PATH: /opt/kde3/games
PATH: /opt/kde3/bin
PATH: /home/eldarion/bin
PATH: /usr/local/sbin
PATH: /usr/local/bin
PATH: /usr/sbin
PATH: /usr/bin
PATH: /sbin
PATH: /bin
PATH: /usr/games
## ----------- ##
## Core tests. ##
## ----------- ##
configure:2156: checking build system type
configure:2174: result: x86_64-pc-linux-gnu
configure:2196: checking host system type
configure:2211: result: x86_64-pc-linux-gnu
configure:2233: checking target system type
configure:2248: result: x86_64-pc-linux-gnu
configure:2309: checking for a BSD-compatible install
configure:2365: result: /usr/bin/install -c
configure:2380: checking for -p flag to install
configure:2393: result: yes
configure:2404: checking whether build environment is sane
## ---------------- ##
## Cache variables. ##
## ---------------- ##
ac_cv_build=x86_64-pc-linux-gnu
ac_cv_env_CCC_set=
ac_cv_env_CCC_value=
ac_cv_env_CC_set=
ac_cv_env_CC_value=
ac_cv_env_CFLAGS_set=set
ac_cv_env_CFLAGS_value='-Wall -g -O2'
ac_cv_env_CPPFLAGS_set=set
ac_cv_env_CPPFLAGS_value=
ac_cv_env_CPP_set=
ac_cv_env_CPP_value=
ac_cv_env_CXXCPP_set=
ac_cv_env_CXXCPP_value=
ac_cv_env_CXXFLAGS_set=set
ac_cv_env_CXXFLAGS_value='-g -O2'
ac_cv_env_CXX_set=
ac_cv_env_CXX_value=
ac_cv_env_F77_set=
ac_cv_env_F77_value=
ac_cv_env_FFLAGS_set=set
ac_cv_env_FFLAGS_value='-g -O2'
ac_cv_env_LDFLAGS_set=set
ac_cv_env_LDFLAGS_value='-Wl,-z,defs -Wl,--as-needed'
ac_cv_env_LIBS_set=
ac_cv_env_LIBS_value=
ac_cv_env_XMKMF_set=
ac_cv_env_XMKMF_value=
ac_cv_env_build_alias_set=set
ac_cv_env_build_alias_value=x86_64-linux-gnu
ac_cv_env_host_alias_set=set
ac_cv_env_host_alias_value=x86_64-linux-gnu
ac_cv_env_target_alias_set=
ac_cv_env_target_alias_value=
ac_cv_host=x86_64-pc-linux-gnu
ac_cv_path_install='/usr/bin/install -c'
ac_cv_target=x86_64-pc-linux-gnu
## ----------------- ##
## Output variables. ##
## ----------------- ##
ACLOCAL=''
AMDEPBACKSLASH=''
AMDEP_FALSE=''
AMDEP_TRUE=''
AMTAR=''
AR=''
ARTSCCONFIG=''
AUTOCONF=''
AUTODIRS=''
AUTOHEADER=''
AUTOMAKE=''
AWK=''
BSD_FALSE=''
BSD_TRUE=''
CC=''
CCDEPMODE=''
CFLAGS='-Wall -g -O2'
CONF_FILES=''
CPP=''
CPPFLAGS=''
CXX=''
CXXCPP=''
CXXDEPMODE=''
CXXFLAGS='-g -O2'
CYGPATH_W=''
DCOPIDL2CPP=''
DCOPIDL=''
DCOPIDLNG=''
DCOP_DEPENDENCIES=''
DEFS=''
DEPDIR=''
ECHO='echo'
ECHO_C=''
ECHO_N='-n'
ECHO_T=''
EGREP=''
ENABLE_PERMISSIVE_FLAG=''
EXEEXT=''
F77=''
FFLAGS='-g -O2'
FRAMEWORK_COREAUDIO=''
GMSGFMT=''
GREP=''
HAVE_GCC_VISIBILITY=''
INSTALL_DATA='${INSTALL} -m 644'
INSTALL_PROGRAM='${INSTALL} $(INSTALL_STRIP_FLAG)'
INSTALL_SCRIPT='${INSTALL}'
INSTALL_STRIP_PROGRAM=''
KCFG_DEPENDENCIES=''
KCONFIG_COMPILER=''
KDECONFIG=''
KDE_CHECK_PLUGIN=''
KDE_EXTRA_RPATH=''
KDE_INCLUDES=''
KDE_LDFLAGS=''
KDE_MT_LDFLAGS=''
KDE_MT_LIBS=''
KDE_NO_UNDEFINED=''
KDE_PLUGIN=''
KDE_RPATH=''
KDE_USE_CLOSURE_FALSE=''
KDE_USE_CLOSURE_TRUE=''
KDE_USE_FINAL_FALSE=''
KDE_USE_FINAL_TRUE=''
KDE_USE_FPIE=''
KDE_USE_NMCHECK_FALSE=''
KDE_USE_NMCHECK_TRUE=''
KDE_USE_PIE=''
KDE_XSL_STYLESHEET=''
LDFLAGS='-Wl,-z,defs -Wl,--as-needed'
LDFLAGS_AS_NEEDED=''
LDFLAGS_NEW_DTAGS=''
LIBCOMPAT=''
LIBCRYPT=''
LIBDL=''
LIBJPEG=''
LIBOBJS=''
LIBPNG=''
LIBPTHREAD=''
LIBREADLINE_LIBS=''
LIBRESOLV=''
LIBS=''
LIBSM=''
LIBSOCKET=''
LIBTOOL=''
LIBUCB=''
LIBUSBCONFIG=''
LIBUSB_CFLAGS=''
LIBUSB_LIBS=''
LIBUTIL=''
LIBZ=''
LIB_KAB=''
LIB_KABC=''
LIB_KDECORE=''
LIB_KDED=''
LIB_KDEPIM=''
LIB_KDEPRINT=''
LIB_KDEUI=''
LIB_KDNSSD=''
LIB_KFILE=''
LIB_KFM=''
LIB_KHTML=''
LIB_KIMPROXY=''
LIB_KIO=''
LIB_KJS=''
LIB_KNEWSTUFF=''
LIB_KPARTS=''
LIB_KSPELL=''
LIB_KSYCOCA=''
LIB_KUNITTEST=''
LIB_KUTILS=''
LIB_POLL=''
LIB_QPE=''
LIB_QT=''
LIB_SMB=''
LIB_X11=''
LIB_XEXT=''
LIB_XRENDER=''
LINUX_FALSE=''
LINUX_TRUE=''
LN_S=''
LTLIBOBJS=''
MAKEINFO=''
MAKEKDEWIDGETS=''
MCOPIDL=''
MEINPROC=''
MOC=''
MSGFMT=''
NOOPT_CFLAGS=''
NOOPT_CXXFLAGS=''
NULL_FALSE=''
NULL_TRUE=''
OBJEXT=''
PACKAGE=''
PACKAGE_BUGREPORT=''
PACKAGE_NAME=''
PACKAGE_STRING=''
PACKAGE_TARNAME=''
PACKAGE_VERSION=''
PATH_SEPARATOR=':'
PERL=''
QTE_NORTTI=''
QT_INCLUDES=''
QT_LDFLAGS=''
RANLIB=''
SET_MAKE=''
SHELL='/bin/bash'
STRIP=''
TOPSUBDIRS=''
UIC=''
UIC_TR=''
USER_INCLUDES=''
USER_LDFLAGS=''
USE_EXCEPTIONS=''
USE_RTTI=''
USE_THREADS=''
VERSION=''
WOVERLOADED_VIRTUAL=''
XGETTEXT=''
XMKMF=''
XMLLINT=''
X_EXTRA_LIBS=''
X_INCLUDES=''
X_LDFLAGS=''
X_PRE_LIBS=''
X_RPATH=''
ac_ct_CC=''
ac_ct_CXX=''
ac_ct_F77=''
all_includes=''
all_libraries=''
am__fastdepCC_FALSE=''
am__fastdepCC_TRUE=''
am__fastdepCXX_FALSE=''
am__fastdepCXX_TRUE=''
am__include=''
am__leading_dot=''
am__quote=''
am__tar=''
am__untar=''
bindir='${exec_prefix}/bin'
build='x86_64-pc-linux-gnu'
build_alias='x86_64-linux-gnu'
build_cpu='x86_64'
build_os='linux-gnu'
build_vendor='pc'
datadir='${datarootdir}'
datarootdir='${prefix}/share'
doc_SUBDIR_included_FALSE=''
doc_SUBDIR_included_TRUE=''
docdir='${datarootdir}/doc/${PACKAGE}'
dvidir='${docdir}'
exec_prefix='NONE'
host='x86_64-pc-linux-gnu'
host_alias='x86_64-linux-gnu'
host_cpu='x86_64'
host_os='linux-gnu'
host_vendor='pc'
htmldir='${docdir}'
include_ARTS_FALSE=''
include_ARTS_TRUE=''
include_x11_FALSE=''
include_x11_TRUE=''
includedir='${prefix}/include'
infodir='/opt/kde3/share/info'
install_sh=''
kde_appsdir=''
kde_bindir=''
kde_confdir=''
kde_datadir=''
kde_htmldir=''
kde_icondir=''
kde_includes=''
kde_kcfgdir=''
kde_libraries=''
kde_libs_htmldir=''
kde_libs_prefix=''
kde_locale=''
kde_mimedir=''
kde_moduledir=''
kde_qtver=''
kde_servicesdir=''
kde_servicetypesdir=''
kde_sounddir=''
kde_styledir=''
kde_templatesdir=''
kde_wallpaperdir=''
kde_widgetdir=''
kdeinitdir=''
libdir='${exec_prefix}/lib'
libexecdir='${exec_prefix}/libexec'
localedir='${datarootdir}/locale'
localstatedir='${prefix}/var'
man_SUBDIR_included_FALSE=''
man_SUBDIR_included_TRUE=''
mandir='/opt/kde3/share/man'
mkdir_p=''
oldincludedir='/usr/include'
pdfdir='${docdir}'
po_SUBDIR_included_FALSE=''
po_SUBDIR_included_TRUE=''
prefix='/opt/kde3'
program_transform_name='s,x,x,'
psdir='${docdir}'
qt_includes=''
qt_libraries=''
sbindir='${exec_prefix}/sbin'
sharedstatedir='${prefix}/com'
src_SUBDIR_included_FALSE=''
src_SUBDIR_included_TRUE=''
sysconfdir='${prefix}/etc'
target='x86_64-pc-linux-gnu'
target_alias=''
target_cpu='x86_64'
target_os='linux-gnu'
target_vendor='pc'
unsermake_enable_pch_FALSE=''
unsermake_enable_pch_TRUE=''
x_includes='NONE'
x_libraries='NONE'
xdg_appsdir=''
xdg_directorydir=''
xdg_menudir=''
## ----------- ##
## confdefs.h. ##
## ----------- ##
#define PACKAGE_NAME ""
#define PACKAGE_TARNAME ""
#define PACKAGE_VERSION ""
#define PACKAGE_STRING ""
#define PACKAGE_BUGREPORT ""
configure: caught signal 2
configure: exit 1

1686
config.sub vendored

File diff suppressed because it is too large Load Diff

@ -0,0 +1,3 @@
./admin/configure.in.min
configure.in.in
configure.in.mid

@ -0,0 +1,370 @@
dnl =======================================================
dnl FILE: ./admin/configure.in.min
dnl =======================================================
dnl This file is part of the KDE libraries/packages
dnl Copyright (C) 2001 Stephan Kulow (coolo@kde.org)
dnl This file is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Library General Public
dnl License as published by the Free Software Foundation; either
dnl version 2 of the License, or (at your option) any later version.
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Library General Public License for more details.
dnl You should have received a copy of the GNU Library General Public License
dnl along with this library; see the file COPYING.LIB. If not, write to
dnl the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
dnl Boston, MA 02110-1301, USA.
# Original Author was Kalle@kde.org
# I lifted it in some mater. (Stephan Kulow)
# I used much code from Janos Farkas
dnl Process this file with autoconf to produce a configure script.
AC_INIT(acinclude.m4) dnl a source file from your sub dir
dnl This is so we can use kde-common
AC_CONFIG_AUX_DIR(admin)
dnl This ksh/zsh feature conflicts with `cd blah ; pwd`
unset CDPATH
dnl Checking host/target/build systems, for make, install etc.
AC_CANONICAL_SYSTEM
dnl Perform program name transformation
AC_ARG_PROGRAM
dnl Automake doc recommends to do this only here. (Janos)
AM_INIT_AUTOMAKE(piklab, 0.15.2) dnl searches for some needed programs
KDE_SET_PREFIX
dnl generate the config header
AM_CONFIG_HEADER(config.h) dnl at the distribution this done
dnl Checks for programs.
AC_CHECK_COMPILERS
AC_ENABLE_SHARED(yes)
AC_ENABLE_STATIC(no)
KDE_PROG_LIBTOOL
dnl for NLS support. Call them in this order!
dnl WITH_NLS is for the po files
AM_KDE_WITH_NLS
KDE_USE_QT(3)
AC_PATH_KDE
dnl =======================================================
dnl FILE: configure.in.in
dnl =======================================================
#MIN_CONFIG(3)
dnl PACKAGE set before
dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
dnl KDE_NEED_FLEX dnl __kdevelop__
dnl AC_PROG_YACC dnl __kdevelop__
# --------------------------------------------------------------------------
# check os
case "${host_os}" in
*linux* ) OSDIR=linux ;;
*bsd* ) OSDIR=bsd LDFLAGS="$LDFLAGS $LIBPTHREAD";;
* ) OSDIR=null ;;
esac
AM_CONDITIONAL(BSD, test x$OSDIR = xbsd)
AM_CONDITIONAL(LINUX, test x$OSDIR = xlinux)
AM_CONDITIONAL(NULL, test x$OSDIR = xnull)
AC_C_BIGENDIAN
# --------------------------------------------------------------------------
# check for parport header (linux)
AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
AC_TRY_COMPILE(
[#include <linux/ppdev.h>],
[ioctl (1,PPCLAIM,0)],
[ac_cv_c_ppdev="yes"],
[ac_cv_c_ppdev="no"])
)
if test "$ac_cv_c_ppdev" = "yes"
then
AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev for parallel port access])
fi
# check for ppbus header (FreeBSD)
AC_CACHE_CHECK([for ppbus header/ppi.h], ac_cv_c_ppbus,
AC_TRY_COMPILE(
[#include <dev/ppbus/ppi.h>],
[ioctl (1,PPIGCTRL,0)],
[ac_cv_c_ppbus="yes"],
[ac_cv_c_ppbus="no"])
)
if test "$ac_cv_c_ppbus" = "yes"
then
AC_DEFINE(HAVE_PPBUS, 1, [Define if we can use ppbus for parallel port access])
fi
# ----------------------------------------------------------------------------
# check for libusb
have_libusb=no
AC_ARG_ENABLE(libusb, AC_HELP_STRING([--disable-libusb],[do not use libusb]),
[ try_libusb="${enableval}" ], [ try_libusb=yes ] )
if test "x$try_libusb" != xno ; then
AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
if test "$LIBUSBCONFIG" = "yes" ; then
LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
LIBUSB_VERSION="`libusb-config --version`"
else
AC_MSG_WARN([libusb-config not found.])
fi
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
LIBS="$LDFLAGS $LIBUSB_LIBS"
AC_CHECK_HEADERS(usb.h, [],
[ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
AC_MSG_CHECKING([for usb_init])
AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
[ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
have_libusb=yes
fi
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)
if test "$have_libusb" = "yes"
then
AC_DEFINE(HAVE_USB, 1, [Define if libusb is available])
AC_DEFINE_UNQUOTED(LIBUSB_VERSION, "$LIBUSB_VERSION", [libusb version])
fi
# ----------------------------------------------------------------------------
# check which libcurses
CPPFLAGS="$CPPFLAGS -L/usr/lib"
AC_CHECK_LIB(curses, main, CURSESLIB="-lcurses",
[AC_CHECK_LIB(ncurses, main, CURSESLIB="-lncurses")]
)
# ----------------------------------------------------------------------------
# check for readline
have_libreadline=no
AC_ARG_ENABLE(libreadline, AC_HELP_STRING([--disable-libreadline],[do not use libreadline]),
[ try_libreadline="${enableval}" ], [ try_libreadline=yes ] )
if test "x$try_libreadline" != xno ; then
LIBREADLINE_LIBS="-lhistory -lreadline $CURSESLIB"
AC_CHECK_HEADER(readline/readline.h, HAVE_READLINE=true, [ AC_MSG_WARN([readline/readline.h not found]) ])
if test x${HAVE_READLINE} = xtrue ; then
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
LIBS="$LDFLAGS $LIBREADLINE_LIBS"
AC_MSG_CHECKING([for rl_initialize])
AC_TRY_LINK_FUNC(rl_initialize, [
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for using_history])
AC_TRY_LINK_FUNC(using_history, [
have_libreadline=yes
AC_MSG_RESULT([yes])
], [ AC_MSG_ERROR([libhistory not found]) ])
], [ AC_MSG_ERROR([libreadline not found]) ])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
fi
fi
AC_SUBST(LIBREADLINE_LIBS)
if test "$have_libreadline" = "yes"
then
AC_DEFINE(HAVE_READLINE, 1, [Define if libreadline header is present.])
fi
KDE_CREATE_SUBDIRSLIST
AM_CONDITIONAL(doc_SUBDIR_included, test "x$doc_SUBDIR_included" = xyes)
AM_CONDITIONAL(man_SUBDIR_included, test "x$man_SUBDIR_included" = xyes)
AM_CONDITIONAL(po_SUBDIR_included, test "x$po_SUBDIR_included" = xyes)
AM_CONDITIONAL(src_SUBDIR_included, test "x$src_SUBDIR_included" = xyes)
AC_CONFIG_FILES([ Makefile ])
AC_CONFIG_FILES([ doc/Makefile ])
AC_CONFIG_FILES([ man/Makefile ])
AC_CONFIG_FILES([ po/Makefile ])
AC_CONFIG_FILES([ src/Makefile ])
AC_CONFIG_FILES([ src/coff/Makefile ])
AC_CONFIG_FILES([ src/coff/base/Makefile ])
AC_CONFIG_FILES([ src/coff/xml/Makefile ])
AC_CONFIG_FILES([ src/common/Makefile ])
AC_CONFIG_FILES([ src/common/cli/Makefile ])
AC_CONFIG_FILES([ src/common/common/Makefile ])
AC_CONFIG_FILES([ src/common/global/Makefile ])
AC_CONFIG_FILES([ src/common/global/svn_revision/Makefile ])
AC_CONFIG_FILES([ src/common/gui/Makefile ])
AC_CONFIG_FILES([ src/common/port/Makefile ])
AC_CONFIG_FILES([ src/data/Makefile ])
AC_CONFIG_FILES([ src/data/app_data/Makefile ])
AC_CONFIG_FILES([ src/data/likeback/Makefile ])
AC_CONFIG_FILES([ src/devices/Makefile ])
AC_CONFIG_FILES([ src/devices/base/Makefile ])
AC_CONFIG_FILES([ src/devices/gui/Makefile ])
AC_CONFIG_FILES([ src/devices/list/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/base/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/gui/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/mem24/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/prog/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/xml/Makefile ])
AC_CONFIG_FILES([ src/devices/mem24/xml_data/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/base/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/gui/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/pic/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/prog/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/xml/Makefile ])
AC_CONFIG_FILES([ src/devices/pic/xml_data/Makefile ])
AC_CONFIG_FILES([ src/libgui/Makefile ])
AC_CONFIG_FILES([ src/piklab/Makefile ])
AC_CONFIG_FILES([ src/piklab-coff/Makefile ])
AC_CONFIG_FILES([ src/piklab-hex/Makefile ])
AC_CONFIG_FILES([ src/piklab-prog/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/base/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/checksum/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/generators/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/misc/Makefile ])
AC_CONFIG_FILES([ src/piklab-test/save_load_memory/Makefile ])
AC_CONFIG_FILES([ src/progs/Makefile ])
AC_CONFIG_FILES([ src/progs/base/Makefile ])
AC_CONFIG_FILES([ src/progs/bootloader/Makefile ])
AC_CONFIG_FILES([ src/progs/bootloader/base/Makefile ])
AC_CONFIG_FILES([ src/progs/bootloader/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/direct/Makefile ])
AC_CONFIG_FILES([ src/progs/direct/base/Makefile ])
AC_CONFIG_FILES([ src/progs/direct/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/direct/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/gpsim/Makefile ])
AC_CONFIG_FILES([ src/progs/gpsim/base/Makefile ])
AC_CONFIG_FILES([ src/progs/gpsim/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/icd1/Makefile ])
AC_CONFIG_FILES([ src/progs/icd1/base/Makefile ])
AC_CONFIG_FILES([ src/progs/icd1/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/icd1/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/icd2/Makefile ])
AC_CONFIG_FILES([ src/progs/icd2/base/Makefile ])
AC_CONFIG_FILES([ src/progs/icd2/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/icd2/icd2_data/Makefile ])
AC_CONFIG_FILES([ src/progs/icd2/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/list/Makefile ])
AC_CONFIG_FILES([ src/progs/manager/Makefile ])
AC_CONFIG_FILES([ src/progs/picdem_bootloader/Makefile ])
AC_CONFIG_FILES([ src/progs/picdem_bootloader/base/Makefile ])
AC_CONFIG_FILES([ src/progs/picdem_bootloader/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/picdem_bootloader/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit1/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit1/base/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit1/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit1/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2/base/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2_bootloader/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2_bootloader/base/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2_bootloader/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2_bootloader/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2v2/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2v2/base/Makefile ])
AC_CONFIG_FILES([ src/progs/pickit2v2/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/psp/Makefile ])
AC_CONFIG_FILES([ src/progs/psp/base/Makefile ])
AC_CONFIG_FILES([ src/progs/psp/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/psp/xml/Makefile ])
AC_CONFIG_FILES([ src/progs/sdcdb/Makefile ])
AC_CONFIG_FILES([ src/progs/sdcdb/base/Makefile ])
AC_CONFIG_FILES([ src/progs/tbl_bootloader/Makefile ])
AC_CONFIG_FILES([ src/progs/tbl_bootloader/base/Makefile ])
AC_CONFIG_FILES([ src/progs/tbl_bootloader/gui/Makefile ])
AC_CONFIG_FILES([ src/progs/tbl_bootloader/xml/Makefile ])
AC_CONFIG_FILES([ src/tools/Makefile ])
AC_CONFIG_FILES([ src/tools/base/Makefile ])
AC_CONFIG_FILES([ src/tools/boost/Makefile ])
AC_CONFIG_FILES([ src/tools/boost/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/c18/Makefile ])
AC_CONFIG_FILES([ src/tools/c18/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/cc5x/Makefile ])
AC_CONFIG_FILES([ src/tools/cc5x/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/ccsc/Makefile ])
AC_CONFIG_FILES([ src/tools/ccsc/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/custom/Makefile ])
AC_CONFIG_FILES([ src/tools/gputils/Makefile ])
AC_CONFIG_FILES([ src/tools/gputils/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/jal/Makefile ])
AC_CONFIG_FILES([ src/tools/jal/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/jalv2/Makefile ])
AC_CONFIG_FILES([ src/tools/jalv2/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/list/Makefile ])
AC_CONFIG_FILES([ src/tools/mpc/Makefile ])
AC_CONFIG_FILES([ src/tools/mpc/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/pic30/Makefile ])
AC_CONFIG_FILES([ src/tools/pic30/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/picc/Makefile ])
AC_CONFIG_FILES([ src/tools/picc/gui/Makefile ])
AC_CONFIG_FILES([ src/tools/sdcc/Makefile ])
AC_CONFIG_FILES([ src/tools/sdcc/gui/Makefile ])
AC_CONFIG_FILES([ src/xml_to_data/Makefile ])
dnl put here things which have to be done after all usual autoconf macros
dnl have been run, but before the Makefiles are created
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"
AC_OUTPUT
# Check if KDE_SET_PREFIX was called, and --prefix was passed to configure
if test -n "$kde_libs_prefix" -a -n "$given_prefix"; then
# And if so, warn when they don't match
if test "$kde_libs_prefix" != "$given_prefix"; then
# And if kde doesn't know about the prefix yet
echo ":"`kde-config --path exe`":" | grep ":$given_prefix/bin/:" 2>&1 >/dev/null
if test $? -ne 0; then
echo ""
echo "Warning: you chose to install this package in $given_prefix,"
echo "but KDE was found in $kde_libs_prefix."
echo "For this to work, you will need to tell KDE about the new prefix, by ensuring"
echo "that KDEDIRS contains it, e.g. export KDEDIRS=$given_prefix:$kde_libs_prefix"
echo "Then restart KDE."
echo ""
fi
fi
fi
if test x$GXX = "xyes" -a x$kde_have_gcc_visibility = "xyes" -a x$kde_cv_val_qt_gcc_visibility_patched = "xno"; then
echo ""
echo "Your GCC supports symbol visibility, but the patch for Qt supporting visibility"
echo "was not included. Therefore, GCC symbol visibility support remains disabled."
echo ""
echo "For better performance, consider including the Qt visibility supporting patch"
echo "located at:"
echo ""
echo "http://bugs.kde.org/show_bug.cgi?id=109386"
echo ""
echo "and recompile all of Qt and KDE. Note, this is entirely optional and"
echo "everything will continue to work just fine without it."
echo ""
fi
if test "$all_tests" = "bad"; then
if test ! "$cache_file" = "/dev/null"; then
echo ""
echo "Please remove the file $cache_file after changing your setup"
echo "so that configure will find the changes next time."
echo ""
fi
else
echo ""
echo "Good - your configure finished. Start make now"
echo ""
fi

@ -0,0 +1,122 @@
#MIN_CONFIG(3)
AM_INIT_AUTOMAKE(piklab, 0.15.2)
dnl CXXFLAGS="$NOOPT_CXXFLAGS" dnl __kdevelop[noopt]__
dnl CFLAGS="$NOOPT_CFLAGS" dnl __kdevelop[noopt]__
dnl CXXFLAGS="$CXXFLAGS $USE_EXCEPTIONS" dnl __kdevelop[exc]__
dnl KDE_NEED_FLEX dnl __kdevelop__
dnl AC_PROG_YACC dnl __kdevelop__
# --------------------------------------------------------------------------
# check os
case "${host_os}" in
*linux* ) OSDIR=linux ;;
*bsd* ) OSDIR=bsd LDFLAGS="$LDFLAGS $LIBPTHREAD";;
* ) OSDIR=null ;;
esac
AM_CONDITIONAL(BSD, test x$OSDIR = xbsd)
AM_CONDITIONAL(LINUX, test x$OSDIR = xlinux)
AM_CONDITIONAL(NULL, test x$OSDIR = xnull)
AC_C_BIGENDIAN
# --------------------------------------------------------------------------
# check for parport header (linux)
AC_CACHE_CHECK([for parport header/ppdev.h], ac_cv_c_ppdev,
AC_TRY_COMPILE(
[#include <linux/ppdev.h>],
[ioctl (1,PPCLAIM,0)],
[ac_cv_c_ppdev="yes"],
[ac_cv_c_ppdev="no"])
)
if test "$ac_cv_c_ppdev" = "yes"
then
AC_DEFINE(HAVE_PPDEV, 1, [Define if we can use ppdev for parallel port access])
fi
# check for ppbus header (FreeBSD)
AC_CACHE_CHECK([for ppbus header/ppi.h], ac_cv_c_ppbus,
AC_TRY_COMPILE(
[#include <dev/ppbus/ppi.h>],
[ioctl (1,PPIGCTRL,0)],
[ac_cv_c_ppbus="yes"],
[ac_cv_c_ppbus="no"])
)
if test "$ac_cv_c_ppbus" = "yes"
then
AC_DEFINE(HAVE_PPBUS, 1, [Define if we can use ppbus for parallel port access])
fi
# ----------------------------------------------------------------------------
# check for libusb
have_libusb=no
AC_ARG_ENABLE(libusb, AC_HELP_STRING([--disable-libusb],[do not use libusb]),
[ try_libusb="${enableval}" ], [ try_libusb=yes ] )
if test "x$try_libusb" != xno ; then
AC_CHECK_PROG([LIBUSBCONFIG], [libusb-config], [yes])
if test "$LIBUSBCONFIG" = "yes" ; then
LIBUSB_CFLAGS="$LIBUSB_CFLAGS `libusb-config --cflags`"
LIBUSB_LIBS="$LIBUSB_LIBS `libusb-config --libs`"
LIBUSB_VERSION="`libusb-config --version`"
else
AC_MSG_WARN([libusb-config not found.])
fi
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
CPPFLAGS="$CPPFLAGS $LIBUSB_CFLAGS"
LIBS="$LDFLAGS $LIBUSB_LIBS"
AC_CHECK_HEADERS(usb.h, [],
[ AC_MSG_ERROR([usb.h not found, use ./configure LIBUSB_CFLAGS=...]) ])
AC_MSG_CHECKING([for usb_init])
AC_TRY_LINK_FUNC(usb_init, [ AC_MSG_RESULT([yes]) ],
[ AC_MSG_ERROR([libusb not found, use ./configure LIBUSB_LIBS=...]) ])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
have_libusb=yes
fi
AC_SUBST(LIBUSB_CFLAGS)
AC_SUBST(LIBUSB_LIBS)
if test "$have_libusb" = "yes"
then
AC_DEFINE(HAVE_USB, 1, [Define if libusb is available])
AC_DEFINE_UNQUOTED(LIBUSB_VERSION, "$LIBUSB_VERSION", [libusb version])
fi
# ----------------------------------------------------------------------------
# check which libcurses
CPPFLAGS="$CPPFLAGS -L/usr/lib"
AC_CHECK_LIB(curses, main, CURSESLIB="-lcurses",
[AC_CHECK_LIB(ncurses, main, CURSESLIB="-lncurses")]
)
# ----------------------------------------------------------------------------
# check for readline
have_libreadline=no
AC_ARG_ENABLE(libreadline, AC_HELP_STRING([--disable-libreadline],[do not use libreadline]),
[ try_libreadline="${enableval}" ], [ try_libreadline=yes ] )
if test "x$try_libreadline" != xno ; then
LIBREADLINE_LIBS="-lhistory -lreadline $CURSESLIB"
AC_CHECK_HEADER(readline/readline.h, HAVE_READLINE=true, [ AC_MSG_WARN([readline/readline.h not found]) ])
if test x${HAVE_READLINE} = xtrue ; then
saved_CPPFLAGS="$CPPFLAGS"
saved_LIBS="$LIBS"
LIBS="$LDFLAGS $LIBREADLINE_LIBS"
AC_MSG_CHECKING([for rl_initialize])
AC_TRY_LINK_FUNC(rl_initialize, [
AC_MSG_RESULT([yes])
AC_MSG_CHECKING([for using_history])
AC_TRY_LINK_FUNC(using_history, [
have_libreadline=yes
AC_MSG_RESULT([yes])
], [ AC_MSG_ERROR([libhistory not found]) ])
], [ AC_MSG_ERROR([libreadline not found]) ])
CPPFLAGS="$saved_CPPFLAGS"
LIBS="$saved_LIBS"
fi
fi
AC_SUBST(LIBREADLINE_LIBS)
if test "$have_libreadline" = "yes"
then
AC_DEFINE(HAVE_READLINE, 1, [Define if libreadline header is present.])
fi

@ -0,0 +1,4 @@
dnl put here things which have to be done after all usual autoconf macros
dnl have been run, but before the Makefiles are created
CXXFLAGS="$CXXFLAGS $KDE_DEFAULT_CXXFLAGS"

@ -0,0 +1,3 @@
KDE_LANG = en
KDE_DOCS = piklab

@ -0,0 +1,67 @@
<?xml version="1.0" ?>
<!DOCTYPE book PUBLIC "-//KDE//DTD DocBook XML V4.2-Based Variant V1.1//EN" "dtd/kdex.dtd" [
<!ENTITY % imageobjectco.module "INCLUDE">
<!ENTITY piklab "<application>Piklab</application>">
<!ENTITY kappname "&piklab;">
<!ENTITY % addindex "IGNORE">
<!ENTITY % English "INCLUDE">
]>
<book lang="&language;">
<bookinfo>
<title>The &piklab; Handbook</title>
<authorgroup>
<author>
<personname>
<firstname>Nicolas</firstname>
<surname>Hadacek</surname>
</personname>
<email>hadacek@kde.org</email>
</author>
</authorgroup>
<!-- TRANS:ROLES_OF_TRANSLATORS -->
<copyright>
<year>2005</year>
<holder>Nicolas Hadacek</holder>
</copyright>
<!--<legalnotice>&FDLNotice;</legalnotice>-->
<date>2006-05-29</date>
<releaseinfo>0.1</releaseinfo>
<abstract>
<para>
&piklab; is an integrated development environment for applications based on Microchip PIC and
dsPIC microcontrollers similar to the MPLAB environment. Support for several compiler and
assembler toolchains is integrated. The ICD2 debugger, the PICkit1 and PICkit2 programmers,
and most direct programmers are supported. A command-line programmer "piklab-prog" is also available.
</para>
<para>
Check <ulink
url="http://piklab.sourceforge.net">&piklab;</ulink> website for up-to-date information and help.
</para>
</abstract>
<keywordset>
<keyword>KDE</keyword>
</keywordset>
</bookinfo>
</book>
<!--
Local Variables:
mode: xml
sgml-minimize-attributes:nil
sgml-general-insert-case:lower
sgml-indent-step:0
sgml-indent-data:nil
End:
-->

@ -0,0 +1,7 @@
include($${STOPDIR}/all.pro)
TEMPLATE = lib
CONFIG += staticlib
win32:DESTDIR = .\
unix:CLEAN_FILES += $${DESTDIR_TARGET}
win32:QMAKE_CLEAN += $${DESTDIR_TARGET} #not working ??

@ -0,0 +1,3 @@
man_MANS = piklab.1x piklab-prog.1 piklab-hex.1 piklab-coff.1
EXTRA_DIST = $(man_MANS)

@ -0,0 +1,130 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH "PIKLAB" "1" "January 25, 2008" "" ""
.SH "NAME"
piklab\-coff \- Command\-line utility to view COFF files.
.SH "SYNOPSIS"
.B piklab\-coff [Qt\-options] [KDE\-options] [options] [file]
.RI
.SH "DESCRIPTION"
This manual page documents briefly the
.B piklab\-coff command.
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBPiklab\-coff\fP is a command line tool to view COFF files.
.SH "OPTIONS"
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`\-').
A summary of options is included below.
Generic options:
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.TP
.B \-\-help\-qt
Show Qt specific options
.TP
.B \-\-help\-kde
Show KDE specific options
.TP
.B \-\-help\-all
Show all options
.TP
.B \-\-author
Show author information
.TP
.B \-\-license
Show license information
.TP
.B \-\-
End of options
.TP
.br
Options:
.TP
.B \-c, \-\-command <name>
Perform the requested command.
.TP
.B \-\-command\-list
Return the list of recognized commands.
.TP
.B \-\-debug
Display debug messages.
.TP
.B \-\-extra\-debug
Display extra debug messages.
.TP
.B \-\-max\-debug
Display all debug messages.
.TP
.B \-\-lowlevel\-debug
Display low level debug messages.
.TP
.B \-\-quiet
Do not display messages.
.TP
.B \-f, \-\-force
Overwrite files and answer "yes" to questions.
.TP
.B \-d, \-\-device <name>
Target device.
.TP
.B \-\-device\-list
Return the list of supported devices.
.sp 3
.SH "SEE ALSO"
.BR piklab (1),
.BR piklab\-prog (1),
.BR piklab\-hex (1).
.br
.SH "AUTHORS"
piklab was written by Nicolas Hadacek and many others, including:
* Alain Gibaud: author of Pikdev; main infrastructure; IDE interface; direct programmers; gputils integration.
* Keith Baker: direct programmer support for 16F7X devices.
* Xiaofan Chen: numerous tests of PICkit1/2 and ICD2 programmers.
* Craig Franklin: author of gputils (disassembler and coff parser).
* Manwlis Giannos: direct programmer support for PIC18FXX2/FXX8 devices.
* Stephen Landamore: author of LPLAB (microchip command\-line programmer).
* Brian C. Lane: original code for direct programming.
* Sébastion Laoût: author of Likeback.
* Nestor A. Marchesini: tests of PicStart+ programmer.
* Lorenz Mösenlechner and Matthias Kranz: USB support for ICD2 programmer.
* Mirko Panciri: direct programmers with bidirectionnal buffers.
* Sean A. Walberg: direct programmer support for 16F676/630 devices.
.B Translations:
* Michele Petrecca: Italian translation.
* Alain Portal: French translation.
* Stefan von Halenbach: German translation.
* Nagy Lázló: Hungarian translation.
.sp 3
.SH "COPYRIGHT"
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
.PP
This manual page was written by Miriam Ruiz <little_miry@yahoo.es>,
for the Debian project (but may be used by others).

@ -0,0 +1,97 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH "PIKLAB" "1" "April 11, 2007" "" ""
.SH "NAME"
piklab\-hex \- Tool to check INHEX\-files.
.SH "SYNOPSIS"
.B piklab\-hex [options] [command] [file].hex
.RI
.SH "DESCRIPTION"
This manual page documents briefly the
.B piklab\-hex command.
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBPiklab\-hex\fP is a command line tool to check files, if they are valid Hex\-files which comply with the INHEX\-Standard defined by Intel corporation.
.SH "OPTIONS"
This program follows the usual GNU command line syntax, with long
options starting with two dashes (`\-').
A summary of options is included below.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.TP
.B \-\-author
Show author information
.TP
.B \-\-license
Show license information
.TP
.B \-c [command]
Option to issue a command.
.TP
.SH "COMMANDS"
.TP
.B check Check file, if it is a valid intel\-hex\-file.
.TP
.B info Return information about hex file.
.TP
.B fix Clean hex file and fix errors (wrong CRC, truncated line, truncated file).
.TP
.B compare Compare two hex files.
.TP
.br
.sp 3
.SH "SEE ALSO"
.BR piklab (1),
.BR piklab\-prog (1),
.BR piklab\-coff (1).
.br
.SH "AUTHORS"
piklab was written by Nicolas Hadacek and many others, including:
* Alain Gibaud: author of Pikdev; main infrastructure; IDE interface; direct programmers; gputils integration.
* Keith Baker: direct programmer support for 16F7X devices.
* Xiaofan Chen: numerous tests of PICkit1/2 and ICD2 programmers.
* Craig Franklin: author of gputils (disassembler and coff parser).
* Manwlis Giannos: direct programmer support for PIC18FXX2/FXX8 devices.
* Stephen Landamore: author of LPLAB (microchip command\-line programmer).
* Brian C. Lane: original code for direct programming.
* Sébastion Laoût: author of Likeback.
* Nestor A. Marchesini: tests of PicStart+ programmer.
* Lorenz Mösenlechner and Matthias Kranz: USB support for ICD2 programmer.
* Mirko Panciri: direct programmers with bidirectionnal buffers.
* Sean A. Walberg: direct programmer support for 16F676/630 devices.
.B Translations:
* Michele Petrecca: Italian translation.
* Alain Portal: French translation.
* Stefan von Halenbach: German translation.
* Nagy Lázló: Hungarian translation.
.sp 3
.SH "COPYRIGHT"
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
.PP
This manual page was written by Stefan <vonHalenbach@users.sf.net>,
for the Debian project (but may be used by others).

@ -0,0 +1,164 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH "PIKLAB" "1" "April 11, 2007" "" ""
.SH "NAME"
piklab\-prog \- Commandline program for PIC\-microcontroller programming.
.SH "SYNOPSIS"
.B piklab\-prog [Qt\-options] [KDE\-options] [options] [file]
.RI
.br
.SH "DESCRIPTION"
This manual page documents briefly the
.B piklab\-prog command.
.PP
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBPiklab\-prog\fP is a command line tool, which can be used to program microcontrollers with program and data, stored in a HEX\-file to a connected programmer. It supports the most common serial, parallel and usb programmers, like ICD2, Pickit2, PicStart+) and debuggers (ICD2).
.SH "OPTIONS"
This program follows the usual GNU command line syntax, with long
options starting with two dashes (`\-').
A summary of options is included below.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.TP
.B \-\-help\-qt
Show Qt specific options
.TP
.B \-\-help\-kde
Show KDE specific options
.TP
.B \-\-help\-all
Show all options
.TP
.B \-\-author
Show author information
.TP
.B \-\-license
Show license information
.TP
.B \-\-
End of options
.br
.B Options:
.B \-c, \-\-command <name>
Perform the requested command.
.TP
.B \-\-command\-list
Return the list of recognized commands.
.TP
.B \-\-debug
Display debug messages.
.TP
.B \-\-extra\-debug
Display extra debug messages.
.TP
.B \-\-max\-debug
Display all debug messages.
.TP
.B \-\-quiet
Do not display messages.
.TP
.B \-f, \-\-force
Overwrite files and answer "yes" to questions.
.TP
.B \-i, \-\-cli
Interactive mode
.TP
.B \-r, \-\-range <name>
Memory range to operate on.
.TP
.B \-\-range\-list
Return the list of memory ranges.
.TP
.B \-p, \-\-programmer <name>
Programmer to use.
.TP
.B \-\-programmer\-list
Return the list of supported programmers.
.TP
.B \-d, \-\-device <name>
Target device.
.TP
.B \-\-device\-list
Return the list of supported devices.
.TP
.B \-f, \-\-format <name>
HEX output file format.
.TP
.B \-\-format\-list
Return the list of supported HEX file formats.
.TP
.B \-t, \-\-port <name>
Programmer port ("usb" or device such as "/dev/ttyS0")
.TP
.B \-\-port\-list
Return the list of detected ports.
.TP
.B \-\-firmware\-dir <dir>
Firmware directory.
.TP
.B \-\-target\-self\-powered
Indicates that device is self\-powered.
.br
.SH "Arguments:"
.B file <HEX\-filename for programming>.
.br
.sp 2
.SH "SEE ALSO"
.BR piklab\-prog (1),
.BR piklab\-hex (1),
.BR piklab\-coff (1),
.BR gputils (1),
.BR sdcc (1).
.br
.SH "AUTHORS"
piklab was written by Nicolas Hadacek and many others, including:
* Alain Gibaud: author of Pikdev; main infrastructure; IDE interface; direct programmers; gputils integration.
* Keith Baker: direct programmer support for 16F7X devices.
* Xiaofan Chen: numerous tests of PICkit1/2 and ICD2 programmers.
* Craig Franklin: author of gputils (disassembler and coff parser).
* Manwlis Giannos: direct programmer support for PIC18FXX2/FXX8 devices.
* Stephen Landamore: author of LPLAB (microchip command\-line programmer).
* Brian C. Lane: original code for direct programming.
* Sébastion Laoût: author of Likeback.
* Nestor A. Marchesini: tests of PicStart+ programmer.
* Lorenz Mösenlechner and Matthias Kranz: USB support for ICD2 programmer.
* Mirko Panciri: direct programmers with bidirectionnal buffers.
* Sean A. Walberg: direct programmer support for 16F676/630 devices.
.B Translations:
* Michele Petrecca: Italian translation.
* Alain Portal: French translation.
* Stefan von Halenbach: German translation.
* Nagy Lázló: Hungarian translation.
.sp 2
.SH "COPYRIGHT"
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
.PP
This manual page was written by Stefan <vonHalenbach@users.sf.net>,
for the Debian project (but may be used by others).

@ -0,0 +1,99 @@
.\" Hey, EMACS: -*- nroff -*-
.\" First parameter, NAME, should be all caps
.\" Second parameter, SECTION, should be 1-8, maybe w/ subsection
.\" other parameters are allowed: see man(7), man(1)
.\" Please adjust this date whenever revising the manpage.
.\"
.\" Some roff macros, for reference:
.\" .nh disable hyphenation
.\" .hy enable hyphenation
.\" .ad l left justify
.\" .ad b justify to both left and right margins
.\" .nf disable filling
.\" .fi enable filling
.\" .br insert line break
.\" .sp <n> insert n+1 empty lines
.\" for manpage-specific macros, see man(7)
.TH "PIKLAB" "1" "April 11, 2007" "" ""
.SH "NAME"
piklab \- IDE for PIC\-microcontroller development.
.TP
.SH "SYNOPSIS"
.B piklab [Qt\-options] [KDE\-options] [file]
.br
.\" TeX users may be more comfortable with the \fB<whatever>\fP and
.\" \fI<whatever>\fP escape sequences to invode bold face and italics,
.\" respectively.
\fBPiklab\fP is an integrated development environment for applications based on Microchip PIC and dsPIC microcontrollers
similar to the MPLAB environment. It integrates with several compiler and assembler toolchains (like gputils, sdcc, c18) and with the
simulator gpsim. It supports the most common programmers (serial, parallel, ICD2, Pickit2, PicStart+) and debuggers (ICD2).
.TP
.SH "OPTIONS"
These programs follow the usual GNU command line syntax, with long
options starting with two dashes (`\-').
A summary of options is included below.
.TP
.B \-h, \-\-help
Show summary of options.
.TP
.B \-v, \-\-version
Show version of program.
.TP
.B \-\-help\-qt
Show Qt specific options
.TP
.B \-\-help\-kde
Show KDE specific options
.TP
.B \-\-help\-all
Show all options
.TP
.B \-\-author
Show author information
.TP
.B \-\-license
Show license information
.TP
.B \-\-
End of options
.TP
.br
.sp 3
.SH "SEE ALSO"
.BR piklab\-prog (1),
.BR piklab\-hex (1),
.BR piklab\-coff (1),
.BR gputils (1),
.BR sdcc (1).
.br
.SH "AUTHORS"
piklab was written by Nicolas Hadacek and many others, including:
* Alain Gibaud: author of Pikdev; main infrastructure; IDE interface; direct programmers; gputils integration.
* Keith Baker: direct programmer support for 16F7X devices.
* Xiaofan Chen: numerous tests of PICkit1/2 and ICD2 programmers.
* Craig Franklin: author of gputils (disassembler and coff parser).
* Manwlis Giannos: direct programmer support for PIC18FXX2/FXX8 devices.
* Stephen Landamore: author of LPLAB (microchip command\-line programmer).
* Brian C. Lane: original code for direct programming.
* Sébastion Laoût: author of Likeback.
* Nestor A. Marchesini: tests of PicStart+ programmer.
* Lorenz Mösenlechner and Matthias Kranz: USB support for ICD2 programmer.
* Mirko Panciri: direct programmers with bidirectionnal buffers.
* Sean A. Walberg: direct programmer support for 16F676/630 devices.
.B Translations:
* Michele Petrecca: Italian translation.
* Alain Portal: French translation.
* Stefan von Halenbach: German translation.
* Nagy Lázló: Hungarian translation.
.sp 3
.SH "COPYRIGHT"
This is free software. You may redistribute copies of it under the terms of the GNU General Public License
<http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law.
.PP
This manual page was written by Stefan <vonHalenbach@users.sf.net>,
for the Debian project (but may be used by others).

@ -0,0 +1,96 @@
%define name piklab-prog-qt3
%define version 0.15.2
%define release %mkrel 1
Summary: Command-line programmer and debugger for PIC and dsPIC microcontrollers
Name: %{name}
Version: %{version}
Release: %{release}
Source0: piklab-%{version}.tar.bz2
License: GPL
Group: Development/Other
Url: http://piklab.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: qt3-devel
BuildRequires: libusb-devel libreadline-devel ncurses-devel
Conflicts: piklab piklab-prog-qt4
Packager: hadacek@kde.org
Provides: piklab-prog piklab-hex
%description
"piklab-prog" is a command-line programmer and debugger for PIC and dsPIC
microcontrollers. It supports GPSim, and several Microchip and direct
programmers.
"piklab-hex" is a command-line utility to manipulate hex files.
%prep
%setup -q -n piklab-%{version}
%build
cd %_builddir/%buildsubdir
qmake piklab-prog.pro
#%make uses -j3 which fails
%__make
%install
rm -rf %{buildroot}
%__mkdir_p %{buildroot}/%{_bindir}
cd %_builddir/%buildsubdir/src/piklab-prog
%__install -s -m 755 piklab-prog %{buildroot}/%{_bindir}/piklab-prog
cd %_builddir/%buildsubdir/src/piklab-hex
%__install -s -m 755 piklab-hex %{buildroot}/%{_bindir}/piklab-hex
%__mkdir_p %{buildroot}/%{_mandir}/man1
cd %_builddir/%buildsubdir/man
%__install -m 755 piklab-prog.1 %{buildroot}/%{_mandir}/man1/piklab-prog.1
%__install -m 755 piklab-hex.1 %{buildroot}/%{_mandir}/man1/piklab-hex.1
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,0755)
%doc README INSTALL COPYING Changelog TODO
%{_bindir}/*
%{_mandir}/man1/*
# --- changelog -----------------------------------------------------
%changelog
* Sun Nov 25 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.2-1mdv2008.0
- new upstream release
* Sun Nov 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.1-1mdv2008.0
- fixes
* Sat Oct 20 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.0-1mdv2007.0
- new release
* Fri Aug 17 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.5-1mdv2007.0
- fix
* Sun Aug 5 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.4-1mdv2007.0
- fixes
* Fri Jul 27 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.3-1mdk
- fixes + new features
* Mon Apr 9 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.2-1mdk
- fixes + new features
* Sun Mar 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.1-1mdk
- fixes + new feature
* Sun Mar 4 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.0-1mdk
- new version
* Thu Feb 8 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.3-1mdk
- fixes
* Wed Jan 31 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.2-1mdk
- fixes
* Sun Jan 28 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.1-1mdk
- fixes
* Fri Jan 19 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.0-1mdk
- new version
* Mon Oct 16 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.2-1mdk
- fixes
* Sun Oct 15 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.1-1mdk
- fixes
* Sun Oct 1 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.0-1mdk
- new version
* Tue Sep 5 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.2-1mdk
- more fixes
* Wed Aug 23 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.1-1mdk
- some fixes
* Sun Aug 20 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.0-1mdk
- new version

@ -0,0 +1,99 @@
%define name piklab-prog-qt4
%define version 0.15.2
%define release %mkrel 1
Summary: Command-line programmer and debugger for PIC and dsPIC microcontrollers
Name: %{name}
Version: %{version}
Release: %{release}
Source0: piklab-%{version}.tar.bz2
License: GPL
Group: Development/Other
Url: http://piklab.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: qt3-devel
BuildRequires: libusb-devel libreadline-devel ncurses-devel
Conflicts: piklab piklab-prog-qt3
Packager: hadacek@kde.org
Provides: piklab-prog piklab-hex
%description
"piklab-prog" is a command-line programmer and debugger for PIC and dsPIC
microcontrollers. It supports GPSim, and several Microchip and direct
programmers.
"piklab-hex" is a command-line utility to manipulate hex files.
%prep
%setup -q -n piklab-%{version}
%build
export QTDIR=%_prefix/%{_lib}/qt4
export LD_LIBRARY_PATH=$QTDIR/%{_lib}:$LD_LIBRARY_PATH
export PATH=$QTDIR/bin:$PATH
export QTLIB=$QTDIR/%{_lib}
cd %_builddir/%buildsubdir
qmake piklab-prog.pro
%make -j1
%install
rm -rf %{buildroot}
%__mkdir_p %{buildroot}/%{_bindir}
cd %_builddir/%buildsubdir/src/piklab-prog
%__install -s -m 755 piklab-prog %{buildroot}/%{_bindir}/piklab-prog
cd %_builddir/%buildsubdir/src/piklab-hex
%__install -s -m 755 piklab-hex %{buildroot}/%{_bindir}/piklab-hex
%__mkdir_p %{buildroot}/%{_mandir}/man1
cd %_builddir/%buildsubdir/man
%__install -m 755 piklab-prog.1 %{buildroot}/%{_mandir}/man1/piklab-prog.1
%__install -m 755 piklab-hex.1 %{buildroot}/%{_mandir}/man1/piklab-hex.1
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,0755)
%doc README INSTALL COPYING Changelog TODO
%{_bindir}/*
%{_mandir}/man1/*
# --- changelog -----------------------------------------------------
%changelog
* Sun Nov 25 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.2-1mdv2008.0
- new upstream release
* Sun Nov 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.1-1mdv2008.0
- fixes
* Sat Oct 20 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.0-1mdv2007.0
- new release
* Fri Aug 17 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.5-1mdv2007.0
- fix
* Sun Aug 5 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.4-1mdv2007.0
- fixes
* Fri Jul 27 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.3-1mdk
- fixes + new features
* Mon Apr 9 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.2-1mdk
- fixes + new features
* Sun Mar 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.1-1mdk
- fixes + new feature
* Sun Mar 4 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.0-1mdk
- new version
* Thu Feb 8 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.3-1mdk
- fixes
* Wed Jan 31 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.2-1mdk
- fixes
* Sun Jan 28 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.1-1mdk
- fixes
* Fri Jan 19 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.0-1mdk
- new version
* Mon Oct 16 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.2-1mdk
- fixes
* Sun Oct 15 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.1-1mdk
- fixes
* Sun Oct 1 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.0-1mdk
- new version
* Tue Sep 5 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.2-1mdk
- more fixes
* Wed Aug 23 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.1-1mdk
- some fixes
* Sun Aug 20 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.0-1mdk
- new version

@ -0,0 +1,2 @@
TEMPLATE = subdirs
SUBDIRS = src

@ -0,0 +1,265 @@
<!DOCTYPE kdevelop>
<kdevelop>
<general>
<author>Nicolas Hadacek</author>
<email>hadacek@kde.org</email>
<projectmanagement>KDevKDEAutoProject</projectmanagement>
<primarylanguage>C++</primarylanguage>
<keywords>
<keyword>KDE</keyword>
<keyword>Qt</keyword>
</keywords>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<version>$VERSION</version>
<description/>
<ignoreparts>
<part>kdevabbrev</part>
<part>kdevbookmarks</part>
<part>kdevclassview</part>
<part>kdevsnippet</part>
<part>kdevctags2</part>
<part>kdevdocumentation</part>
<part>kdevdoxygen</part>
<part>kdevfilegroups</part>
<part>kdevfileselector</part>
<part>kdevfileview</part>
<part>kdevopenwith</part>
<part>kdevpartexplorer</part>
<part>kdevquickopen</part>
<part>kdevscripting</part>
<part>kdevfilter</part>
<part>kdevtexttools</part>
<part>kdevtools</part>
<part>kdevvalgrind</part>
</ignoreparts>
<secondaryLanguages/>
<versioncontrol/>
<projectname>piklab</projectname>
<defaultencoding/>
</general>
<kdevautoproject>
<general>
<mainprogram>pikdev</mainprogram>
<activetarget>src/piklab/piklab</activetarget>
<useconfiguration>default</useconfiguration>
</general>
<configure>
<configargs>--prefix=/usr\s</configargs>
</configure>
<make>
<abortonerror>false</abortonerror>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin/>
<envvars>
<envvar value="1" name="WANT_AUTOCONF_2_5" />
<envvar value="1" name="WANT_AUTOMAKE_1_6" />
</envvars>
<prio>0</prio>
<runmultiplejobs>false</runmultiplejobs>
</make>
<compiler>
<cflags/>
<cxxflags>\s-O0</cxxflags>
</compiler>
<run>
<directoryradio>executable</directoryradio>
<customdirectory>/</customdirectory>
<mainprogram>src/piklab/piklab</mainprogram>
<programargs/>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
<runarguments>
<xml_to_data/>
<piklab/>
<piklab-prog/>
<pickit2_to_data/>
<usb_log_filter/>
<dev_parser/>
<xml_to_data_device/>
<html_generator/>
<xml_to_data_direct/>
<xml_to_data_icd2/>
<xml_to_data_pickit2/>
<xml_to_pic/>
<xml_to_mem24/>
<xml_to_data_pickit1/>
<xml_coff_parser/>
<syntax_xml_generator/>
<xml_direct_parser/>
<xml_icd2_parser/>
<xml_pickit2_parser/>
<xml_pickit1_parser/>
<xml_icd1_parser/>
<xml_psp_parser/>
</runarguments>
</run>
<configurations>
<default>
<envvars/>
<configargs>--enable-debug=full</configargs>
<builddir/>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompiler>kdevgccoptions</ccompiler>
<cxxcompiler>kdevgppoptions</cxxcompiler>
<f77compiler>kdevpgf77options</f77compiler>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags/>
<cxxflags>-pedantic</cxxflags>
<f77flags/>
</default>
</configurations>
</kdevautoproject>
<kdevfileview>
<groups>
<group pattern="*.h;*.hh;*.hxx;*.hpp;*.H" name="En-têtes" />
<group pattern="*.cpp;*.c;*.cc;*.C;*.cxx;*.ec;*.ecpp;*.lxx;*.l++;*.ll;*.l" name="Sources" />
<group pattern="*.kdevdlg;*.ui;*.rc;*.dlg" name="Interface utilisateur" />
<group pattern="*.po" name="Traductions" />
<group pattern="*" name="Autres" />
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidenonlocation>false</hidenonlocation>
</groups>
<tree>
<showvcsfields>true</showvcsfields>
<hidenonprojectfiles>false</hidenonprojectfiles>
<hidepatterns>*.o,*.lo,CVS</hidepatterns>
</tree>
</kdevfileview>
<kdevdoctreeview>
<ignoretocs>
<toc>gtk</toc>
<toc>gnustep</toc>
<toc>python</toc>
<toc>php</toc>
<toc>perl</toc>
</ignoretocs>
</kdevdoctreeview>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
</general>
<display>
<staticmembers>false</staticmembers>
<demanglenames>true</demanglenames>
<outputradix>10</outputradix>
</display>
</kdevdebugger>
<kdevcppsupport>
<references/>
<codecompletion>
<includeGlobalFunctions>false</includeGlobalFunctions>
<includeTypes>false</includeTypes>
<includeEnums>false</includeEnums>
<includeTypedefs>false</includeTypedefs>
<automaticCodeCompletion>false</automaticCodeCompletion>
<automaticArgumentsHint>false</automaticArgumentsHint>
<automaticHeaderCompletion>true</automaticHeaderCompletion>
<codeCompletionDelay>250</codeCompletionDelay>
<argumentsHintDelay>400</argumentsHintDelay>
<headerCompletionDelay>250</headerCompletionDelay>
<showOnlyAccessibleItems>false</showOnlyAccessibleItems>
<completionBoxItemOrder>0</completionBoxItemOrder>
<howEvaluationContextMenu>true</howEvaluationContextMenu>
<showCommentWithArgumentHint>true</showCommentWithArgumentHint>
<statusBarTypeEvaluation>false</statusBarTypeEvaluation>
<namespaceAliases>std=_GLIBCXX_STD;__gnu_cxx=std</namespaceAliases>
<processPrimaryTypes>true</processPrimaryTypes>
<processFunctionArguments>false</processFunctionArguments>
<preProcessAllHeaders>false</preProcessAllHeaders>
<parseMissingHeaders>false</parseMissingHeaders>
<resolveIncludePaths>true</resolveIncludePaths>
<alwaysParseInBackground>true</alwaysParseInBackground>
<usePermanentCaching>true</usePermanentCaching>
<alwaysIncludeNamespaces>false</alwaysIncludeNamespaces>
<includePaths>.;</includePaths>
<parseMissingHeadersExperimental>false</parseMissingHeadersExperimental>
<resolveIncludePathsUsingMakeExperimental>false</resolveIncludePathsUsingMakeExperimental>
</codecompletion>
<creategettersetter>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
<qt>
<used>true</used>
<version>3</version>
<root>/usr/lib/qt3</root>
<includestyle>3</includestyle>
<designerintegration>EmbeddedKDevDesigner</designerintegration>
<qmake>/usr/lib/qt3/bin/qmake</qmake>
<designer>/usr/bin/designer-qt3</designer>
<designerpluginpaths/>
</qt>
<splitheadersource>
<enabled>false</enabled>
<synchronize>true</synchronize>
<orientation>Vertical</orientation>
</splitheadersource>
</kdevcppsupport>
<kdevcvsservice>
<recursivewhenupdate>true</recursivewhenupdate>
<prunedirswhenupdate>true</prunedirswhenupdate>
<createdirswhenupdate>true</createdirswhenupdate>
<recursivewhencommitremove>true</recursivewhencommitremove>
<revertoptions>-C</revertoptions>
</kdevcvsservice>
<cppsupportpart>
<filetemplates>
<interfacesuffix>.h</interfacesuffix>
<implementationsuffix>.cpp</implementationsuffix>
</filetemplates>
</cppsupportpart>
<kdevfilecreate>
<filetypes/>
<useglobaltypes/>
</kdevfilecreate>
<kdevdocumentation>
<projectdoc>
<docsystem/>
<docurl/>
<usermanualurl/>
</projectdoc>
</kdevdocumentation>
<dist>
<custom>false</custom>
<bzip>false</bzip>
<archname/>
<appname>Piclab</appname>
<version>0.1</version>
<release/>
<vendor/>
<licence/>
<summary/>
<group/>
<packager/>
<description/>
<changelog/>
<devpackage>false</devpackage>
<docspackage>false</docspackage>
<appicon>false</appicon>
<arch>0</arch>
<genHTML>false</genHTML>
<useRPM>false</useRPM>
<ftpkde>false</ftpkde>
<appskde>false</appskde>
<url/>
</dist>
</kdevelop>

@ -0,0 +1,140 @@
%define name piklab
%define version 0.15.2
%define release %mkrel 1
Summary: IDE for applications based on PIC microcontrollers
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{version}.tar.bz2
License: GPL
Group: Development/Other
Url: http://piklab.sourceforge.net/
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
BuildRequires: kdelibs-devel
#BuildRequires: kdebase-devel
BuildRequires: libusb-devel libreadline-devel ncurses-devel
Packager: hadacek@kde.org
Conflicts: piklab-prog-qt3 piklab-prog-qt4
%description
Piklab is an integrated development environment for applications based on
PIC microcontrollers. Gputils tools are used for assembling. Microchip
programmers and several direct programmers are supported.
%prep
%setup -q -n %{name}-%{version}
%build
%configure
# --disable-rpath --with-qt-libraries=$QTDIR/%{_lib}
%make
%install
rm -rf %{buildroot}
%makeinstall
mkdir -p %{buildroot}%{_iconsdir} %{buildroot}%{_miconsdir} %{buildroot}%{_liconsdir}
convert -resize 16x16 piklab.xpm %{buildroot}%{_miconsdir}/%name.png
convert -resize 32x32 piklab.xpm %{buildroot}%{_iconsdir}/%name.png
convert -resize 48x48 piklab.xpm %{buildroot}%{_liconsdir}/%name.png
%find_lang %{name}
%clean
rm -rf %{buildroot}
%post
%{update_menus}
%postun
%{clean_menus}
%files -f %{name}.lang
%defattr(755,root,root)
%{_bindir}/*
%defattr(644,root,root,755)
%{_datadir}/apps/%{name}
%{_datadir}/applications/kde/piklab.desktop
%{_datadir}/icons/hicolor/*/*/*.png
%{_datadir}/mimelnk/application/x-piklab.desktop
%{_datadir}/apps/katepart/syntax/*
%{_mandir}/man1/*
%_docdir/HTML/en/%name
%{_miconsdir}/%name.png
%{_iconsdir}/%name.png
%{_liconsdir}/%name.png
%changelog
* Sun Nov 25 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.2-1mdv2008.0
- new upstream release
* Sun Nov 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.1-1mdv2008.0
- fixes
* Sat Oct 20 2007 Nicolas Hadacek <hadacek@kde.org> 0.15.0-1mdv2007.0
- new release
* Fri Aug 17 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.5-1mdv2007.0
- fix
* Sun Aug 5 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.4-1mdv2007.0
- fixes
* Fri Jul 27 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.3-1mdk
- fixes + new features
* Mon Apr 9 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.2-1mdk
- fixes + new features
* Sun Mar 11 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.1-1mdk
- fixes + new feature
* Sun Mar 4 2007 Nicolas Hadacek <hadacek@kde.org> 0.14.0-1mdk
- new version
* Thu Feb 8 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.3-1mdk
- fixes
* Wed Jan 31 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.2-1mdk
- fixes
* Sun Jan 28 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.1-1mdk
- fixes
* Fri Jan 19 2007 Nicolas Hadacek <hadacek@kde.org> 0.13.0-1mdk
- new version
* Mon Oct 16 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.2-1mdk
- fixes
* Sun Oct 15 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.1-1mdk
- fixes
* Sun Oct 1 2006 Nicolas Hadacek <hadacek@kde.org> 0.12.0-1mdk
- new version
* Tue Sep 7 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.2-2mdk
- fix linking of piklab-prog
* Tue Sep 5 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.2-1mdk
- more fixes
* Wed Aug 23 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.1-1mdk
- some fixes
* Sun Aug 20 2006 Nicolas Hadacek <hadacek@kde.org> 0.11.0-1mdk
- new version
* Thu Jul 6 2006 Nicolas Hadacek <hadacek@kde.org> 0.10.0-1mdk
- new version
* Mon May 29 2006 Nicolas Hadacek <hadacek@kde.org> 0.9.0-1mdk
- new version
* Sat May 6 2006 Nicolas Hadacek <hadacek@kde.org> 0.8.0-1mdk
- new version
* Sat Apr 22 2006 Nicolas Hadacek <hadacek@kde.org> 0.7.0-1mdk
- new version
* Wed Mar 23 2006 Nicolas Hadacek <hadacek@kde.org> 0.6.1-1mdk
- fixes
* Wed Mar 15 2006 Nicolas Hadacek <hadacek@kde.org> 0.6.0-1mdk
- new version
* Wed Mar 1 2006 Nicolas Hadacek <hadacek@kde.org> 0.5.2-1mdk
- some fixes
* Tue Feb 28 2006 Nicolas Hadacek <hadacek@kde.org> 0.5.1-1mdk
- some fixes
* Sun Feb 26 2006 Nicolas Hadacek <hadacek@kde.org> 0.5.0-1mdk
- new version
* Sat Feb 18 2006 Nicolas Hadacek <hadacek@kde.org> 0.4.2-1mdk
- some fixes
* Tue Feb 14 2006 Nicolas Hadacek <hadacek@kde.org> 0.4.1-1mdk
- some fixes
* Sun Feb 12 2006 Nicolas Hadacek <hadacek@kde.org> 0.4-1mdk
- new version
* Sun Jan 22 2006 Nicolas Hadacek <hadacek@kde.org> 0.3.1-1mdk
- freeze fix for serial ICD2
* Sat Jan 21 2006 Nicolas Hadacek <hadacek@kde.org> 0.3-1mdk
- new version
* Tue Dec 12 2005 Nicolas Hadacek <hadacek@kde.org> 0.2-1mdk
- new version
* Thu Jun 29 2005 Nicolas Hadacek <hadacek@kde.org> 0.1-1mdk
- initial release

@ -0,0 +1,104 @@
/* XPM */
static char * pikdev_xpm[] = {
"32 32 69 1",
" c None",
". c #585858",
"+ c #303030",
"@ c #FFFF00",
"# c #A0A0A4",
"$ c #DADADA",
"% c #BFBFBF",
"& c #2F2F2F",
"* c #808080",
"= c #FFFFFF",
"- c #BDBDBD",
"; c #000000",
"> c #B9B9B9",
", c #2B2B2B",
"' c #2D2D2D",
") c #2E2E2E",
"! c #C0C0C0",
"~ c #B4B4B4",
"{ c #272727",
"] c #292929",
"^ c #2A2A2A",
"/ c #C1C1C3",
"( c #B0B0B0",
"_ c #232323",
": c #252525",
"< c #1F1F1F",
"[ c #202020",
"} c #262626",
"| c #1C1C1C",
"1 c #222222",
"2 c #BABABA",
"3 c #DCDCDC",
"4 c #B6B6B6",
"5 c #1E1E1E",
"6 c #B1B1B1",
"7 c #9A9A9A",
"8 c #0F0F0F",
"9 c #101010",
"0 c #1A1A1A",
"a c #1B1B1B",
"b c #ADADAD",
"c c #E1E1E1",
"d c #969696",
"e c #0A0A0A",
"f c #0C0C0C",
"g c #171717",
"h c #181818",
"i c #A9A9A9",
"j c #D2D2D2",
"k c #919191",
"l c #060606",
"m c #080808",
"n c #141414",
"o c #151515",
"p c #A4A4A4",
"q c #8D8D8D",
"r c #020202",
"s c #040404",
"t c #111111",
"u c #A0A0A0",
"v c #8C8C8C",
"w c #010101",
"x c #050505",
"y c #090909",
"z c #0D0D0D",
"A c #9C9C9C",
"B c #979797",
"C c #939393",
"D c #8E8E8E",
" ",
" ",
" . ++ ",
" .@. +#$.+%&& ",
" .@@@. +*$=+-&&.; ",
" .@@@@@. +$=+-&&.;*. ",
" .@@@@@. ++.++-&&.;.++* ",
" .@@@@@.+#$.+>,')&#++!&& ",
" .@@@@@.$=+~{]^,')#/&&&& ",
" .@@@@@.+(_:;{]^,')&&&%; ",
" .@@@@@.<[;@:}{]^,')%;; ",
" +.@@@@@|;@@1_:}{]^2;;;; ",
" +*3.@@@@@@@@<[1_:}4;;;=; ",
" +$=+.@@@@@@@|5<[16;;;==. ",
" ++.++789@@@@@@0a|5b;;;===c. ",
" +#$=+def;@@@@@@gh0i;;;;;jc.. ",
" +*3=+klm;@@@@@@@nop;;;=; +.. ",
" +$=+qrs;@@@@@@@@tu;;;==. #+* ",
" .++v;;wrsxlmyefzA;;;===j. + ",
" + ;;v;;;wrsxlmyB;;;;;jj.. + ",
" + ;;;v;;;;wrsxC;;;=; +..# ",
" ;;;;v;;;;;wD;;;==. #+* ",
" ;;;;v;;;;v;;;$$6v. + ",
" ;;;;;v;;v;;;;;6v.. + ",
" ;;;;;vv;;;=; +..# ",
" ;;;;+.;;=$. #+* ",
" ;;;;.;=$6v. + ",
" ;;;.;;6v.. + ",
" ;.;+ ;..# ",
" #;* ",
" ; ",
" ; "};

@ -0,0 +1 @@
POFILES = AUTO

7356
po/cs.po

File diff suppressed because it is too large Load Diff

7290
po/de.po

File diff suppressed because it is too large Load Diff

6947
po/es.po

File diff suppressed because it is too large Load Diff

6898
po/fr.po

File diff suppressed because it is too large Load Diff

7293
po/hu.po

File diff suppressed because it is too large Load Diff

7331
po/it.po

File diff suppressed because it is too large Load Diff

@ -0,0 +1,15 @@
template=`find . -name "*.pot" | sed -e 's#^./\(.*\)$#\1#'`
files=`find . -name "*.po" | sed -e 's#^./\(.*\)$#\1#'`
test -n "$VERBOSE" && echo $files
for file in $files; do
echo merging $file
files=
if test ! -s $file; then
echo "ERROR: $file is empty!"
elif msgmerge --no-wrap -q -o $file $file $template; then
files="$files $file"
else
echo "ERROR: msgmerge failed for $file"
fi
done

File diff suppressed because it is too large Load Diff

@ -0,0 +1,8 @@
#define VERSION "0.15.2"
// adjust or comment the following lines to reflect your configuration
#if defined(Q_OS_WIN)
# define LIBUSB_VERSION "0.1.12.1"
#else
# define LIBUSB_VERSION "0.1.8"
#endif

@ -0,0 +1,10 @@
INCLUDES = $(all_includes)
METASOURCES = AUTO
SUBDIRS = common xml_to_data devices piklab-hex coff piklab-coff progs piklab-prog tools data libgui piklab piklab-test
messages:
$(EXTRACTRC) `find . -name \*.ui -o -name \*.rc` > rc.cpp
LIST=`find . -name \*.h -o -name \*.cpp -o -name \*.c`; \
if test -n "$$LIST"; then \
$(XGETTEXT) $$LIST --from-code=UTF-8 -o $(podir)/piklab.pot; \
fi

@ -0,0 +1 @@
SUBDIRS = xml base

@ -0,0 +1,13 @@
INCLUDES = -I$(top_srcdir)/src $(all_includes)
METASOURCES = AUTO
noinst_LTLIBRARIES = libcoff.la
libcoff_la_LDFLAGS = $(all_libraries)
libcoff_la_SOURCES = coff.cpp gpdis.cpp gpopcode.cpp disassembler.cpp \
coff_data.cpp text_coff.cpp cdb_parser.cpp coff_archive.cpp coff_object.cpp
libcoff_la_DEPENDENCIES = coff_data.cpp
noinst_DATA = coff.xml
coff_data.cpp: ../xml/xml_coff_parser coff.xml
../xml/xml_coff_parser
CLEANFILES = coff_data.cpp

@ -0,0 +1,6 @@
STOPDIR = ../../..
include($${STOPDIR}/lib.pro)
TARGET = coff
HEADERS += gpopcode.h disassembler.h coff.h coff_object.h coff_archive.h text_coff.h coff_data.h cdb_parser.h
SOURCES += gpopcode.cpp gpdis.cpp disassembler.cpp coff.cpp coff_object.cpp coff_archive.cpp text_coff.cpp coff_data.cpp cdb_parser.cpp

@ -0,0 +1,417 @@
/***************************************************************************
* Copyright (C) 2007 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "cdb_parser.h"
#include <ctype.h>
#include "common/global/pfile.h"
//----------------------------------------------------------------------------
const CDB::ScopeType::Data CDB::ScopeType::DATA[Nb_Types] = {
{ "G", I18N_NOOP("Global") },
{ "F", I18N_NOOP("File") },
{ "L", I18N_NOOP("Local") },
{ "S", I18N_NOOP("Structure") } // ??
};
const CDB::VarType::Data CDB::VarType::DATA[Nb_Types] = {
{ "DA", I18N_NOOP("Array") },
{ "DF", I18N_NOOP("Function") },
{ "DG", I18N_NOOP("Generic Pointer") },
{ "DC", I18N_NOOP("Code Pointer") },
{ "DX", I18N_NOOP("External RAM Pointer") },
{ "DD", I18N_NOOP("Internal RAM Pointer") },
{ "DP", I18N_NOOP("Paged Pointer") },
{ "DI", I18N_NOOP("Upper-128-byte Pointer") },
{ "SL", I18N_NOOP("Long") },
{ "SI", I18N_NOOP("Int") },
{ "SC", I18N_NOOP("Char") },
{ "SS", I18N_NOOP("Short") },
{ "SV", I18N_NOOP("Void") },
{ "SF", I18N_NOOP("Float") },
{ "ST", I18N_NOOP("Structure") },
{ "SX", I18N_NOOP("SBIT") },
{ "SB", I18N_NOOP("Bit Field") }
};
const CDB::Sign::Data CDB::Sign::DATA[Nb_Types] = {
{ "S", I18N_NOOP("Signed") },
{ "U", I18N_NOOP("Unsigned") }
};
const CDB::AddressSpaceType::Data CDB::AddressSpaceType::DATA[Nb_Types] = {
{ "A", I18N_NOOP("External Stack") },
{ "B", I18N_NOOP("Internal Stack") },
{ "C", I18N_NOOP("Code") },
{ "D", I18N_NOOP("Code / Static Segment") },
{ "E", I18N_NOOP("Lower-128-byte Internal RAM") },
{ "F", I18N_NOOP("External RAM") },
{ "G", I18N_NOOP("Internal RAM") },
{ "H", I18N_NOOP("Bit Addressable") },
{ "I", I18N_NOOP("SFR Space") },
{ "J", I18N_NOOP("SBIT Space") },
{ "R", I18N_NOOP("Register Space") },
{ "Z", I18N_NOOP("Function or Undefined Space") },
};
//----------------------------------------------------------------------------
CDB::Object::Object(const PURL::Url &url, Log::Base &log)
: _log(log)
{
PURL::File file(url, log);
if ( !file.openForRead() ) return;
QStringList lines = file.readLines();
for (_line=0; _line<uint(lines.count()); _line++) {
_col = 0;
_current = lines[_line];
if ( _current.isEmpty() ) continue;
char c;
if ( !readChar(c) ) return;
if ( !readAndCheckChar(':') ) return;
Record *record = 0;
bool ok;
switch (c) {
case 'M': ok = parseModuleRecord(record); break;
case 'F': ok = parseFunctionRecord(record); break;
case 'S': ok = parseSymbolRecord(record); break;
case 'T': ok = parseTypeRecord(record); break;
case 'L': ok = parseLinkerRecord(record); break;
default:
log.log(Log::LineType::Error, i18n("Unrecognized record"));
return;
}
if (!ok) {
delete record;
return;
}
_records.append(record);
}
}
CDB::Object::~Object()
{
for (uint i=0; i<uint(_records.count()); i++) delete _records[i];
}
void CDB::Object::log(Log::LineType type, const QString &message)
{
_log.log(type, message + " " + i18n("at line #%1, column #%2").arg(_line+1).arg(_col+1));
}
void CDB::Object::logMalformed(const QString &detail)
{
log(Log::LineType::Error, i18n("Malformed record: ") + detail);
}
bool CDB::Object::readChar(char &c)
{
if ( _col==uint(_current.length()) ) {
logMalformed(i18n("unexpected end of line"));
return false;
}
c = _current[_col].latin1();
_col++;
return true;
}
bool CDB::Object::readAndCheckChar(char c)
{
char r;
if ( !readChar(r) ) return false;
if ( r!=c ) {
logMalformed(i18n("was expecting '%1'").arg(c));
return false;
}
return true;
}
bool CDB::Object::getString(const QString &s, QString &r)
{
r = s;
if ( r.isEmpty() ) {
logMalformed(i18n("empty name"));
return false;
}
return true;
}
bool CDB::Object::readFixedLengthString(QString &s, uint size)
{
s = QString::null;
for (uint i=0; i<size; i++) {
char c;
if ( !readChar(c) ) return false;
s += c;
}
return true;
}
bool CDB::Object::readStoppedString(QString &name, char stop)
{
QString s;
for (;;) {
if ( _col==uint(_current.length()) ) {
if ( stop!=0 ) {
logMalformed(i18n("unexpected end of line"));
return false;
}
break;
}
if ( _current[_col]==stop ) break;
s += _current[_col];
_col++;
}
return getString(s, name);
}
bool CDB::Object::getUInt(const QString &s, uint &v)
{
bool ok;
v = s.toUInt(&ok);
if ( !ok ) logMalformed(i18n("was expecting an uint"));
return ok;
}
bool CDB::Object::readUInt(uint &v)
{
QString s;
for (;;) {
if ( _col==uint(_current.length()) ) break;
if ( !isdigit(_current[_col].latin1()) ) break;
s += _current[_col];
_col++;
}
return getUInt(s, v);
}
bool CDB::Object::readBool(bool &b)
{
char c;
if ( !readChar(c) ) return false;
if ( c=='0' ) b = false;
else if ( c=='1' ) b = true;
else {
logMalformed(i18n("was expecting a bool ('%1')").arg(c));
return false;
}
return true;
}
bool CDB::Object::readHex(uint &v)
{
QString s;
for (;;) {
if ( _col==uint(_current.length()) ) break;
if ( !isxdigit(_current[_col].latin1()) ) break;
s += _current[_col];
_col++;
}
return getUInt(s, v);
}
bool CDB::Object::parseModuleRecord(Record * &record)
{
ModuleRecord *mr = new ModuleRecord;
record = mr;
return readStoppedString(mr->filename, 0);
}
bool CDB::Object::parse(Scope &scope, QString &name)
{
QString s;
if ( !readFixedLengthString(s, 1) ) return false;
scope.type = ScopeType::fromKey(s);
switch (scope.type.type()) {
case ScopeType::Structure:
case ScopeType::Global: break;
case ScopeType::File:
case ScopeType::Local:
if ( !readStoppedString(scope.name, '$') ) return false;
break;
case ScopeType::Nb_Types:
logMalformed(i18n("unknown ScopeType"));
return false;
}
if ( !readAndCheckChar('$') ) return false;
if ( !readStoppedString(name, '$') ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(scope.level) ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(scope.block) ) return false;
return true;
}
bool CDB::Object::parse(TypeChain &typeChain)
{
uint nb;
if ( !readAndCheckChar('{') ) return false;
if ( !readUInt(nb) ) return false;
if ( !readAndCheckChar('}') ) return false;
QString s;
if ( !readStoppedString(s, ':') ) return false;
QStringList list = QStringList::split(',', s, true);
for (uint i=0; i<uint(list.count()); i++) {
DCLType type;
QString key = list[i].mid(0, 2);
type.type = VarType::fromKey(key);
switch (type.type.type()) {
case VarType::Array:
case VarType::BitField:
if ( !getUInt(list[i].mid(2), type.nb) ) return false;
break;
case VarType::Structure:
if ( !getString(list[i].mid(2), type.name) ) return false;
break;
case VarType::Nb_Types:
logMalformed(i18n("unknown DCLType"));
return false;
default: break;
}
typeChain.types.append(type);
}
if ( !readAndCheckChar(':') ) return false;
if ( !readFixedLengthString(s, 1) ) return false;
typeChain.sign = Sign::fromKey(s);
if ( typeChain.sign==Sign::Nb_Types ) {
logMalformed(i18n("unknown Sign"));
return false;
}
return true;
}
bool CDB::Object::parse(AddressSpace &as)
{
QString s;
if ( !readFixedLengthString(s, 1) ) return false;
as.type = AddressSpaceType::fromKey(s);
if ( as.type==AddressSpaceType::Nb_Types ) {
logMalformed(i18n("unknown AddressSpaceType"));
return false;
}
if ( !readAndCheckChar(',') ) return false;
if ( !readBool(as.onStack) ) return false;
if ( !readAndCheckChar(',') ) return false;
if ( !readUInt(as.stackOffset) ) return false;
if ( as.type==AddressSpaceType::Register ) {
if ( !readAndCheckChar(',') ) return false;
if ( !readAndCheckChar('[') ) return false;
if ( !readStoppedString(s, ']') ) return false;
as.registers = QStringList::split(',', s, true);
if ( as.registers.count()==0 ) {
logMalformed(i18n("no register defined"));
return false;
}
if ( !readAndCheckChar(']') ) return false;
}
return true;
}
bool CDB::Object::parse(SymbolRecord &sr)
{
if ( !parse(sr.scope, sr.name) ) return false;
if ( !readAndCheckChar('(') ) return false;
if ( !parse(sr.typeChain) ) return false;
if ( !readAndCheckChar(')') ) return false;
if ( !readAndCheckChar(',') ) return false;
if ( !parse(sr.addressSpace) ) return false;
return true;
}
bool CDB::Object::parse(TypeMember &tm)
{
if ( !readAndCheckChar('(') ) return false;
if ( !readAndCheckChar('{') ) return false;
if ( !readUInt(tm.offset) ) return false;
if ( !readAndCheckChar('}') ) return false;
if ( !readAndCheckChar('S') ) return false;
if ( !readAndCheckChar(':') ) return false;
if ( !parse(tm.symbol) ) return false;
if ( !readAndCheckChar(')') ) return false;
return true;
}
bool CDB::Object::parseSymbolRecord(Record * &record)
{
SymbolRecord *sr = new SymbolRecord;
record = sr;
if ( !parse(*sr) ) return false;
return true;
}
bool CDB::Object::parseFunctionRecord(Record * &record)
{
FunctionRecord *fr = new FunctionRecord;
record = fr;
if ( !parse(*fr) ) return false;
if ( !readAndCheckChar(',') ) return false;
if ( !readBool(fr->isInterruptHandler) ) return false;
if ( !readAndCheckChar(',') ) return false;
if ( !readUInt(fr->interruptHandler) ) return false;
if ( !readAndCheckChar(',') ) return false;
if ( !readUInt(fr->registerBank) ) return false;
return true;
}
bool CDB::Object::parseTypeRecord(Record * &record)
{
TypeRecord *tr = new TypeRecord;
record = tr;
if ( !readAndCheckChar('F') ) return false;
if ( !readStoppedString(tr->filename, '$') ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readStoppedString(tr->name, '[') ) return false;
if ( !readAndCheckChar('[') ) return false;
for (;;) {
TypeMember tm;
if ( !parse(tm) ) return false;
tr->members.append(tm);
if ( _current[_col]==']' ) break;
}
if ( !readAndCheckChar(']') ) return false;
return true;
}
bool CDB::Object::parseLinkerRecord(Record * &record)
{
LinkerRecord *lr = new LinkerRecord;
record = lr;
char c;
if ( !readChar(c) ) return false;
switch (c) {
case 'A':
lr->type = LinkerRecord::AsmLine;
if ( !readAndCheckChar('$') ) return false;
if ( !readStoppedString(lr->filename, '$') ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(lr->line) ) return false;
break;
case 'C':
lr->type = LinkerRecord::CLine;
if ( !readAndCheckChar('$') ) return false;
if ( !readStoppedString(lr->filename, '$') ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(lr->line) ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(lr->level) ) return false;
if ( !readAndCheckChar('$') ) return false;
if ( !readUInt(lr->block) ) return false;
break;
case 'X':
lr->type = LinkerRecord::EndAddress;
if ( !parse(lr->scope, lr->name) ) return false;
break;
default:
lr->type = LinkerRecord::Address;
if ( !parse(lr->scope, lr->name) ) return false;
break;
}
if ( !readAndCheckChar(':') ) return false;
if ( !readHex(lr->address) ) return false;
return true;
}

@ -0,0 +1,166 @@
/***************************************************************************
* Copyright (C) 2007 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef SDCC_CDB_PARSER_H
#define SDCC_CDB_PARSER_H
#include "common/common/key_enum.h"
#include "common/global/log.h"
#include "common/global/purl.h"
namespace CDB
{
//----------------------------------------------------------------------------
class Record
{
public:
};
class ModuleRecord : public Record
{
public:
QString filename;
};
BEGIN_DECLARE_ENUM(ScopeType)
Global = 0, File, Local, Structure
END_DECLARE_ENUM_STD(ScopeType)
class Scope
{
public:
ScopeType type;
QString name; // file or function name
uint level, block;
};
BEGIN_DECLARE_ENUM(VarType)
Array = 0, Function, GenericPointer, CodePointer, ExternalRamPointer,
InternalRamPointer, PagedPointer, Upper128bytesPointer, Long, Int, Char,
Short, Void, Float, Structure, Sbit, BitField
END_DECLARE_ENUM_STD(VarType)
class DCLType
{
public:
VarType type;
uint nb; // for Array and BitField
QString name; // for Structure
};
BEGIN_DECLARE_ENUM(Sign)
Signed = 0, Unsigned
END_DECLARE_ENUM_STD(Sign)
class TypeChain
{
public:
QValueVector<DCLType> types;
Sign sign;
};
BEGIN_DECLARE_ENUM(AddressSpaceType)
ExternalStack = 0, InternalStack, Code, CodeStaticSegment,
Lower128bytesInternalRam, ExternalRam, InternalRam, BitAddressable,
SFR, SBIT, Register, FunctionOrUndefined
END_DECLARE_ENUM_STD(AddressSpaceType)
class AddressSpace {
public:
AddressSpaceType type;
bool onStack;
uint stackOffset; // valid if onStack is true
QStringList registers; // for Register type
};
class SymbolRecord : public Record
{
public:
QString name;
Scope scope;
TypeChain typeChain;
AddressSpace addressSpace;
};
class FunctionRecord : public SymbolRecord
{
public:
bool isInterruptHandler;
uint interruptHandler, registerBank; // if isInterruptHandler is true
};
class TypeMember
{
public:
uint offset;
SymbolRecord symbol;
};
class TypeRecord : public Record
{
public:
QString filename, name;
QValueVector<TypeMember> members;
};
class LinkerRecord : public Record
{
public:
enum Type { Address = 0, EndAddress, AsmLine, CLine, Nb_Types };
Type type;
Scope scope; // for Address and EndAddress
QString name; // for Address and EndAddress
uint address;
uint line; // for AsmLine and CLine
QString filename; // for AsmLine and CLine
uint block, level; // for CLine
};
//----------------------------------------------------------------------------
class Object
{
public:
Object(const PURL::Url &url, Log::Base &log);
virtual ~Object();
private:
Log::Base &_log;
QString _current;
uint _line, _col;
QValueVector<Record *> _records;
void log(Log::LineType type, const QString &message);
void logMalformed(const QString &detail);
bool readBool(bool &b);
bool getUInt(const QString &s, uint &r);
bool readUInt(uint &v);
bool readChar(char &c);
bool readAndCheckChar(char c);
bool getString(const QString &s, QString &r);
bool readStoppedString(QString &s, char stop);
bool readFixedLengthString(QString &s, uint size);
bool readHex(uint &v);
bool parse(Scope &scope, QString &name);
bool parse(TypeChain &typeChain);
bool parse(TypeRecord &typeRecord);
bool parse(SymbolRecord &sr);
bool parse(AddressSpace &addressSpace);
bool parse(TypeMember &typeMember);
bool parseModuleRecord(Record * &record);
bool parseFunctionRecord(Record * &record);
bool parseSymbolRecord(Record * &record);
bool parseTypeRecord(Record * &record);
bool parseLinkerRecord(Record * &record);
};
} // namespace
#endif

@ -0,0 +1,97 @@
/***************************************************************************
* Copyright (C) 2006-2007 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "coff.h"
#include <time.h>
#include "common/common/misc.h"
#include "devices/list/device_list.h"
#include "devices/base/device_group.h"
#include "devices/pic/base/pic_register.h"
#include "coff_data.h"
#include "common/global/pfile.h"
//----------------------------------------------------------------------------
const CoffType::Data CoffType::DATA[Nb_Types] = {
{ "archive", I18N_NOOP("Archive") },
{ "object", I18N_NOOP("Object") }
};
const Coff::Format::Data Coff::Format::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Old Microchip"), 0x1234, { 20, 16, 40, 18, 16, 12 } },
{ 0, I18N_NOOP("PIC30"), 0x1236, { 20, 28, 40, 18, 8, 10 } }, // from PIC30 binutils "coff.h" file
{ 0, I18N_NOOP("New Microchip"), 0x1240, { 20, 18, 40, 20, 16, 12 } } // (C18 >= 3.0)
};
CoffType Coff::identify(const PURL::Url &url, Log::Base &log)
{
PURL::File file(url, log);
if ( !file.openForRead() ) return CoffType::Nb_Types;
QByteArray data = file.readAll();
if ( log.hasError() ) return CoffType::Nb_Types;
uint offset = 0;
Format format;
Q_UINT32 magic;
return identify(data, offset, log, format, magic);
}
CoffType Coff::identify(const QByteArray &data, uint &offset, Log::Base &log, Format &format, Q_UINT32 &magic)
{
QString id = "!<arch>\012";
if ( data.count()>=id.length() ) {
QString s = QString::fromAscii(data.data(), id.length());
if ( s==id ) {
offset += id.length();
return CoffType::Archive;
}
}
if ( !getULong(data, offset, 2, log, magic) ) return CoffType::Nb_Types;
log.log(Log::DebugLevel::Extra, QString("COFF format: %1").arg(toHexLabel(magic, 4)));
format = Format::Nb_Types;
FOR_EACH(Format, f) if ( magic==f.data().magic ) format = f;
return CoffType::Object;
}
//----------------------------------------------------------------------------
bool Coff::getULong(const QByteArray &data, uint &offset, uint nbBytes, Log::Base &log, Q_UINT32 &v)
{
bool ok;
v = ::getULong(data, offset, nbBytes, &ok);
if ( !ok ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbBytes).arg(data.count()));
return false;
}
offset += nbBytes;
return true;
}
bool Coff::getString(const QByteArray &data, uint &offset, uint nbChars, Log::Base &log, QString &name)
{
if ( !checkAvailable(data, offset, nbChars) ) {
log.log(Log::LineType::Error, i18n("COFF file is truncated (offset: %1 nbBytes: %2 size:%3).").arg(offset).arg(nbChars).arg(data.count()));
return false;
}
name = QString::fromAscii(data.data()+offset, nbChars);
offset += nbChars;
return true;
}
//----------------------------------------------------------------------------
bool Coff::Base::initParse(CoffType type, QByteArray &data, uint &offset, Log::Base &log)
{
PURL::File file(_url, log);
if ( !file.openForRead() ) return false;
data = file.readAll();
if ( log.hasError() ) return false;
if ( identify(data, offset, log, _format, _magic)!=type ) {
log.log(Log::LineType::Error, i18n("Could not recognize file (magic number is %1).").arg(toHexLabel(_magic, 4)));
return false;
}
return true;
}

@ -0,0 +1,64 @@
/***************************************************************************
* Copyright (C) 2006-2007 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef COFF_H
#define COFF_H
#include "common/global/global.h"
#include "devices/pic/base/pic.h"
#include "common/global/purl.h"
#include "common/global/log.h"
BEGIN_DECLARE_ENUM(CoffType)
Archive = 0, Object
END_DECLARE_ENUM_STD(CoffType)
//----------------------------------------------------------------------------
namespace Coff
{
extern bool getString(const QByteArray &data, uint &offset, uint nbChars, Log::Base &log, QString &name);
extern bool getULong(const QByteArray &data, uint &offset, uint nbBytes, Log::Base &log, Q_UINT32 &v);
//----------------------------------------------------------------------------
enum SizeType { HeaderSize = 0, OptHeaderSize, SectionHeaderSize, SymbolSize,
LineNumberSize, RelocationSize, Nb_SizeTypes };
struct FormatData {
const char *key, *label;
uint magic;
uint sizes[Nb_SizeTypes];
};
BEGIN_DECLARE_ENUM(Format)
OldMicrochip = 0, PIC30, NewMicrochip
END_DECLARE_ENUM(Format, FormatData)
extern CoffType identify(const PURL::Url &url, Log::Base &log);
extern CoffType identify(const QByteArray &data, uint &offset, Log::Base &log, Format &format, Q_UINT32 &magic);
//----------------------------------------------------------------------------
class Base
{
public:
Base(const PURL::Url &url) : _url(url) {}
virtual ~Base() {}
virtual bool parse(Log::Base &log) = 0;
PURL::Url url() const { return _url; }
uint magic() const { return _magic; }
virtual Log::KeyList information() const = 0;
protected:
PURL::Url _url;
Format _format;
Q_UINT32 _magic;
bool initParse(CoffType type, QByteArray &data, uint &offset, Log::Base &log);
};
} // namespace
#endif

@ -0,0 +1,342 @@
<!-- ************************************************************************* -->
<!-- * Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> * -->
<!-- * * -->
<!-- * This program is free software; you can redistribute it and/or modify * -->
<!-- * it under the terms of the GNU General Public License as published by * -->
<!-- * the Free Software Foundation; either version 2 of the License, or * -->
<!-- * (at your option) any later version. * -->
<!-- *************************************************************************/-->
<!DOCTYPE piklab>
<type name="coff">
<device name="10f200" id="0xf200" />
<device name="10f202" id="0xf202" />
<device name="10f204" id="0xf204" />
<device name="10f206" id="0xf206" />
<device name="10f220" id="0xf220" />
<device name="10f222" id="0xf222" />
<device name="12c508" id="0x2508" />
<device name="12c508a" id="0x508a" />
<device name="12c509" id="0x2509" />
<device name="12c509a" id="0x509a" />
<device name="12c671" id="0x2671" />
<device name="12c672" id="0x2672" />
<device name="12ce518" id="0x2518" />
<device name="12ce519" id="0x2519" />
<device name="12ce673" id="0x2673" />
<device name="12ce674" id="0x2674" />
<device name="12cr509a" id="0xd09a" />
<device name="12f508" id="0x2508" />
<device name="12f509" id="0x2509" />
<device name="12f510" id="0x2510" />
<device name="12f629" id="0x2629" />
<device name="12f635" id="0x2635" />
<device name="12f675" id="0x2675" />
<device name="12f683" id="0x2683" />
<device name="14000" id="0x4000" />
<!-- <device name="16c5x" id="0x658a" /> -->
<!-- <device name="16cxx" id="0x6c77" /> -->
<device name="16c432" id="0x6432" />
<device name="16c433" id="0x6433" />
<device name="16c505" id="0x2505" />
<device name="16c52" id="0x6c52" />
<device name="16c54" id="0x6c54" />
<device name="16c54a" id="0x654a" />
<device name="16c54b" id="0x654b" />
<device name="16c54c" id="0x654c" />
<device name="16c55" id="0x6c55" />
<device name="16c55a" id="0x655a" />
<device name="16c554" id="0x6554" />
<device name="16c557" id="0x6557" />
<device name="16c558" id="0x6558" />
<device name="16c56" id="0x6c56" />
<device name="16c56a" id="0x656a" />
<device name="16c57" id="0x6c57" />
<device name="16c57c" id="0x657c" />
<device name="16c58a" id="0x658a" />
<device name="16c58b" id="0x658b" />
<device name="16c61" id="0x6c61" />
<device name="16c62" id="0x6c62" />
<device name="16c62a" id="0x662a" />
<device name="16c62b" id="0x662b" />
<device name="16c620" id="0x6620" />
<device name="16c620a" id="0x620a" />
<device name="16c621" id="0x6621" />
<device name="16c621a" id="0x621a" />
<device name="16c622" id="0x6622" />
<device name="16c622a" id="0x622a" />
<device name="16c63" id="0x6c63" />
<device name="16c63a" id="0x663a" />
<device name="16c64" id="0x6c64" />
<device name="16c64a" id="0x664a" />
<device name="16c642" id="0x6642" />
<device name="16c65" id="0x6c65" />
<device name="16c65a" id="0x665a" />
<device name="16c65b" id="0x665b" />
<device name="16c66" id="0x6c66" />
<device name="16c662" id="0x6662" />
<device name="16c67" id="0x6c67" />
<device name="16c71" id="0x6c71" />
<device name="16c710" id="0x6710" />
<device name="16c711" id="0x6711" />
<device name="16c712" id="0x6712" />
<device name="16c715" id="0x6715" />
<device name="16c716" id="0x6716" />
<device name="16c717" id="0x6717" />
<device name="16c72" id="0x6c72" />
<device name="16c72a" id="0x672a" />
<device name="16c73" id="0x673a" />
<device name="16c73a" id="0x673a" />
<device name="16c73b" id="0x673b" />
<device name="16c74" id="0x6c74" />
<device name="16c745" id="0x6745" />
<!-- <device name="16c747" id="0x6747" /> -->
<device name="16c74a" id="0x674a" />
<device name="16c74b" id="0x674b" />
<device name="16c76" id="0x6c76" />
<device name="16c765" id="0x6765" />
<device name="16c77" id="0x6c77" />
<device name="16c770" id="0x6770" />
<device name="16c771" id="0x6771" />
<device name="16c773" id="0x6773" />
<device name="16c774" id="0x6774" />
<device name="16c781" id="0x6781" />
<device name="16c782" id="0x6782" />
<device name="16c84" id="0x6c84" />
<device name="16c923" id="0x6923" />
<device name="16c924" id="0x6924" />
<device name="16c925" id="0x6925" />
<device name="16c926" id="0x6926" />
<device name="16ce623" id="0x6623" />
<device name="16ce624" id="0x6624" />
<device name="16ce625" id="0x6625" />
<!-- <device name="16cr54" id="0xdc54" /> -->
<device name="16cr54a" id="0xd54a" />
<device name="16cr54b" id="0xd54b" />
<device name="16cr54c" id="0xdc54" />
<device name="16cr56a" id="0xd56a" />
<!-- <device name="16cr57a" id="0xd57a" /> -->
<device name="16cr57b" id="0xd57b" />
<device name="16cr57c" id="0xd57c" />
<device name="16cr58a" id="0xd58a" />
<device name="16cr58b" id="0xd58b" />
<device name="16cr62" id="0xdc62" />
<device name="16cr620a" id="0xd20a" />
<device name="16cr63" id="0x6d63" />
<device name="16cr64" id="0xdc64" />
<device name="16cr65" id="0x6d65" />
<device name="16cr72" id="0x6d72" />
<device name="16cr83" id="0xdc83" />
<device name="16cr84" id="0xdc84" />
<device name="16f505" id="0x654f" />
<device name="16f54" id="0x654f" />
<device name="16f57" id="0x657f" />
<device name="16f59" id="0x659f" />
<device name="16f610" id="0x6610" />
<device name="16f627" id="0x6627" />
<device name="16f627a" id="0x627a" />
<device name="16f628" id="0x6628" />
<device name="16f628a" id="0x628a" />
<device name="16f630" id="0x6630" />
<device name="16f636" id="0x6636" />
<device name="16f639" id="0x6639" />
<device name="16f648a" id="0x648a" />
<device name="16f676" id="0x6676" />
<device name="16f684" id="0x6684" />
<device name="16f685" id="0x6685" />
<device name="16f687" id="0x6687" />
<device name="16f688" id="0x6688" />
<device name="16f689" id="0x6689" />
<device name="16f690" id="0x6690" />
<device name="16f716" id="0x716f" />
<device name="16f72" id="0x672f" />
<device name="16f73" id="0x673f" />
<device name="16f737" id="0x737f" />
<device name="16f74" id="0x674f" />
<device name="16f747" id="0x6747" />
<device name="16f76" id="0x676f" />
<device name="16f767" id="0x767f" />
<device name="16f77" id="0x677f" />
<device name="16f777" id="0x777f" />
<device name="16f785" id="0x785f" />
<device name="16f818" id="0x818f" />
<device name="16f819" id="0x819f" />
<device name="16f83" id="0x6c83" />
<device name="16f84" id="0x6f84" />
<device name="16f84a" id="0x684a" />
<device name="16f87" id="0x687f" />
<device name="16f870" id="0x870f" />
<device name="16f871" id="0x871f" />
<device name="16f872" id="0x872f" />
<device name="16f873" id="0x873f" />
<device name="16f873a" id="0x873a" />
<device name="16f874" id="0x874f" />
<device name="16f874a" id="0x874a" />
<device name="16f876" id="0x876f" />
<device name="16f876a" id="0x876a" />
<device name="16f877" id="0x877f" />
<device name="16f877a" id="0x877a" />
<device name="16f88" id="0x688f" />
<device name="16f882" id="0x882f" />
<device name="16f883" id="0x883f" />
<device name="16f884" id="0x884f" />
<device name="16f886" id="0x886f" />
<device name="16f887" id="0x887f" />
<device name="16f913" id="0x913f" />
<device name="16f914" id="0x914f" />
<device name="16f916" id="0x916f" />
<device name="16f917" id="0x917f" />
<device name="16hv540" id="0x6540" />
<!-- <device name="17cxx" id="0x7756" /> -->
<device name="17c42" id="0x7c42" />
<device name="17c42a" id="0x742a" />
<device name="17c43" id="0x7c43" />
<device name="17c44" id="0x7c44" />
<device name="17c752" id="0x7752" />
<device name="17c756" id="0x7756" />
<device name="17c756a" id="0x756a" />
<device name="17c762" id="0x7762" />
<device name="17c766" id="0x7766" />
<device name="17cr42" id="0xe42a" />
<device name="17cr43" id="0xec43" />
<device name="18c242" id="0x8242" />
<device name="18c252" id="0x8252" />
<device name="18c442" id="0x8442" />
<device name="18c452" id="0x8452" />
<device name="18c601" id="0x8601" />
<device name="18c658" id="0x8658" />
<device name="18c801" id="0x8801" />
<device name="18c858" id="0x8858" />
<device name="18f1220" id="0xa122" />
<device name="18f1230" id="0xa123 0x1230" />
<!-- <device name="18f1231" id="0x1231" /> -->
<device name="18f1320" id="0xa132" />
<device name="18f1330" id="0xa133 0x1330" />
<!-- <device name="18f1331" id="0x1331" /> -->
<device name="18f2220" id="0xa222" />
<device name="18f2221" id="0x2221" />
<device name="18f2320" id="0xa232" />
<device name="18f2321" id="0x2321" />
<device name="18f2331" id="0x2331" />
<device name="18f2410" id="0x2410" />
<device name="18f242" id="0x242f" />
<device name="18f2420" id="0x2420" />
<device name="18f2431" id="0x2431" />
<device name="18f2439" id="0x2439" />
<device name="18f2450" id="0x2450" />
<device name="18f2455" id="0x2455" />
<device name="18f248" id="0x8248" />
<device name="18f2480" id="0x2480" />
<device name="18f24J10" id="0xD410" />
<device name="18f2510" id="0x2510" />
<device name="18f2515" id="0x2515" />
<device name="18f252" id="0x252f" />
<device name="18f2520" id="0x2520" />
<device name="18f2525" id="0x2525" />
<device name="18f2539" id="0x2539" />
<device name="18f2550" id="0x2550" />
<device name="18f258" id="0x8258" />
<device name="18f2580" id="0x2580" />
<device name="18f2585" id="0x2585" />
<device name="18f25J10" id="0xD510" />
<device name="18f2610" id="0x2610 0xa261" />
<device name="18f2620" id="0x2620 0xa262" />
<device name="18f2680" id="0x2680" />
<!-- <device name="18f2681" id="0x2681" /> -->
<device name="18f2682" id="0x2682" />
<device name="18f2685" id="0x2685" />
<device name="18f4220" id="0xa422" />
<device name="18f4221" id="0x4221" />
<device name="18f4320" id="0xa432" />
<device name="18f4321" id="0x4321" />
<device name="18f4331" id="0x4331" />
<device name="18f4410" id="0x4410" />
<device name="18f442" id="0x442f" />
<device name="18f4420" id="0x4420" />
<device name="18f4431" id="0x4431" />
<device name="18f4439" id="0x4439" />
<device name="18f4450" id="0x4450" />
<device name="18f4455" id="0x4455" />
<device name="18f448" id="0x8448" />
<device name="18f4480" id="0x4480" />
<device name="18f44J10" id="0xE410" />
<device name="18f4510" id="0x4510" />
<device name="18f4515" id="0x4515" />
<device name="18f452" id="0x452f" />
<device name="18f4520" id="0x4520" />
<device name="18f4525" id="0x4525" />
<device name="18f4539" id="0x4539" />
<device name="18f4550" id="0x4550" />
<device name="18f458" id="0x8458" />
<device name="18f4580" id="0x4580" />
<device name="18f4585" id="0x4585" />
<device name="18f45J10" id="0xE510" />
<device name="18f4610" id="0xa461 0x4610" />
<device name="18f4620" id="0xa462 0x4620" />
<device name="18f4680" id="0x4680" />
<!-- <device name="18f4681" id="0x4681" /> -->
<device name="18f4682" id="0x4682" />
<device name="18f4685" id="0x4685" />
<device name="18f6310" id="0xa631 0x6310" />
<device name="18f6390" id="0xa639 0x6390" />
<device name="18f6410" id="0xa641 0x6410" />
<device name="18f6490" id="0xa649 0x6490" />
<!-- <device name="18f64j15" id="0xb415" /> -->
<device name="18f6520" id="0xa652" />
<device name="18f6525" id="0x6525" />
<device name="18f6527" id="0x6527" />
<device name="18f6585" id="0x6585" />
<device name="18f65j10" id="0xb510" />
<device name="18f65j15" id="0xb515" />
<device name="18f6620" id="0xa662" />
<device name="18f6621" id="0xa621" />
<device name="18f6622" id="0xf622" />
<device name="18f6627" id="0xa627 0x6627" />
<device name="18f6680" id="0x6680" />
<device name="18f66j10" id="0xb610" />
<device name="18f66j15" id="0xb615" />
<device name="18f66j60" id="0xb660" />
<device name="18f66j65" id="0xb665" />
<device name="18f6720" id="0xa672" />
<device name="18f6722" id="0x6722" />
<device name="18f67j10" id="0xb710" />
<device name="18f67j60" id="0xb760" />
<device name="18f8310" id="0x8310" />
<device name="18f8390" id="0x8390" />
<device name="18f8410" id="0x8410" />
<device name="18f8490" id="0x8490" />
<!-- <device name="18f84j15" id="0xc415" /> -->
<device name="18f8520" id="0xa852" />
<device name="18f8525" id="0x8525" />
<device name="18f8527" id="0x8527" />
<device name="18f8585" id="0x8585" />
<device name="18f85j10" id="0xc510" />
<device name="18f85j15" id="0xc515" />
<device name="18f8620" id="0xa862" />
<device name="18f8621" id="0x8621" />
<device name="18f8622" id="0x8622" />
<device name="18f8627" id="0x8627" />
<device name="18f8680" id="0x8680" />
<device name="18f86j10" id="0xc610" />
<device name="18f86j15" id="0xc615" />
<device name="18f86j60" id="0xc660" />
<device name="18f86j65" id="0xc665" />
<device name="18f8720" id="0xa872" />
<device name="18f8722" id="0x8721" />
<device name="18f87j10" id="0xc710" />
<device name="18f87j60" id="0xc760" />
<device name="18f96j60" id="0xd660" />
<device name="18f96j65" id="0xd665" />
<device name="18f97j60" id="0xd760" />
<!--
<device name="rf509af" id="0x6509" />
<device name="rf509ag" id="0x7509" />
<device name="rf675f" id="0x3675" />
<device name="rf675h" id="0x4675" />
<device name="rf675k" id="0x5675" />
<device name="sx18" id="0x0018" />
<device name="sx20" id="0x0020" />
<device name="sx28" id="0x0028" />
-->
</type>

@ -0,0 +1,129 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "coff_archive.h"
//----------------------------------------------------------------------------
Coff::Member::Member(const QByteArray &data, uint &offset, Log::Base &log)
{
// parse header
QString s;
if ( !getString(data, offset, 256, log, s) ) return;
int i = s.find('/');
if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("Member name not terminated by '/' (\"%1\").").arg(s));
return;
}
_name = s.mid(0, i);
if ( !getString(data, offset, 12, log, s) ) return; // mtime
if ( !getString(data, offset, 10, log, s) ) return;
i = s.find('l');
if ( i==-1 ) {
log.log(Log::LineType::Error, i18n("File size not terminated by 'l' (\"%1\").").arg(s));
return;
}
bool ok;
_nbBytes = s.mid(0, i).toUInt(&ok);
if ( !ok ) {
log.log(Log::LineType::Error, i18n("Wrong format for file size \"%1\".").arg(s));
return;
}
Q_UINT32 v;
if ( !getULong(data, offset, 2, log, v) ) return;
log.log(Log::DebugLevel::Extra, i18n("Magic number: %1").arg(toHexLabel(v, 4)));
// if ( v!=0x600A ) {
// log.log(Log::LineType::Error, i18n("Wrong magic for Microchip archive (\"%1\").").arg(toHexLabel(v, 4)));
// return;
// }
offset += _nbBytes;
}
//----------------------------------------------------------------------------
Coff::Archive::Archive(const PURL::Url &url)
: Base(url)
{}
bool Coff::Archive::parse(Log::Base &log)
{
QByteArray data;
uint offset = 0, symbolEnd = 0;
Member *symbol = 0;
if ( !initParse(CoffType::Archive, data, offset, log) ) return false;
for (;;) {
if ( offset==uint(data.count()) ) break; // end of archive
uint start = offset;
Member *member = new Member(data, offset, log);
if ( log.hasError() ) return false;
if ( member->name().isEmpty() ) {
symbolEnd = offset;
symbol = member;
} else {
_members[member->name()] = member;
_offsets[start] = member;
}
}
if (symbol) {
if ( !readSymbols(data, symbolEnd - symbol->nbBytes(), log) ) return false;
delete symbol;
}
return true;
}
Coff::Archive::~Archive()
{
QMap<QString, Member *>::const_iterator it;
for (it=_members.begin(); it!=_members.end(); ++it) delete it.data();
}
bool Coff::Archive::readSymbols(const QByteArray &data, uint offset, Log::Base &log)
{
Q_UINT32 nb;
if ( !getULong(data, offset, 4, log, nb) ) return false;
QValueVector<Member *> members(nb);
for (uint i=0; i<nb; i++) {
Q_UINT32 start;
if ( !getULong(data, offset, 4, log, start) ) return false;
if ( !_offsets.contains(start) ) {
log.log(Log::LineType::Error, i18n("Unknown file member offset: %1").arg(toHexLabel(start, 8)));
return false;
}
members[i] = _offsets[start];
}
for (uint i=0; i<nb; i++) {
QString name(data.data() + offset);
offset += name.length() + 1;
_symbols[name] = members[i];
}
return true;
}
Log::KeyList Coff::Archive::information() const
{
Log::KeyList keys(i18n("Information:"));
keys.append(i18n("No. of file members:"), QString::number(members().count()));
keys.append(i18n("No. of symbols:"), QString::number(symbols().count()));
return keys;
}
Log::KeyList Coff::Archive::membersInformation() const
{
Log::KeyList keys(i18n("File Members:"));
QMap<QString, Member *>::const_iterator it;
for (it=members().begin(); it!=members().end(); ++it)
keys.append(it.key(), i18n("size: %1 bytes").arg(it.data()->nbBytes()));
return keys;
}
Log::KeyList Coff::Archive::symbolsInformation() const
{
Log::KeyList keys(i18n("Symbols:"));
QMap<QString, Member *>::const_iterator it;
for (it=symbols().begin(); it!=symbols().end(); ++it)
keys.append(it.key(), it.data()->name());
return keys;
}

@ -0,0 +1,53 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef COFF_ARCHIVE_H
#define COFF_ARCHIVE_H
#include "coff.h"
namespace Coff
{
//----------------------------------------------------------------------------
class Member
{
public:
Member(const QByteArray &data, uint &offset, Log::Base &log);
QString name() const { return _name; }
uint nbBytes() const { return _nbBytes; }
private:
QString _name;
uint _nbBytes;
};
//----------------------------------------------------------------------------
class Archive : public Base
{
public:
Archive(const PURL::Url &url);
virtual ~Archive();
virtual bool parse(Log::Base &log);
const QMap<QString, Member *>members() const { return _members; }
const QMap<QString, Member *>symbols() const { return _symbols; }
virtual Log::KeyList information() const;
Log::KeyList membersInformation() const;
Log::KeyList symbolsInformation() const;
private:
QMap<QString, Member *> _members; // name -> Member *
QMap<uint, Member *> _offsets; // offset -> Member *
QMap<QString, Member *> _symbols; // name -> Member *
bool readSymbols(const QByteArray &data, uint offset, Log::Base &log);
};
} // namespace
#endif

@ -0,0 +1,22 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef COFF_DATA_H
#define COFF_DATA_H
namespace Coff
{
enum { MAX_NB_IDS = 2 };
struct Data {
uint ids[MAX_NB_IDS];
};
extern QString findId(uint id);
} // namespace
#endif

@ -0,0 +1,658 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "coff_object.h"
#include "common/common/misc.h"
#include "devices/list/device_list.h"
#include "devices/base/device_group.h"
#include "devices/pic/base/pic_register.h"
#include "coff_data.h"
#include "common/global/pfile.h"
//----------------------------------------------------------------------------
bool Coff::getName(const QByteArray &data, uint &offset, uint nbChars, uint stringTableOffset,
Log::Base &log, QString &name)
{
Q_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return false;
if ( v!=0 ) { // name is not in string table
offset -= 4;
return getString(data, offset, nbChars, log, name);
}
if ( !getULong(data, offset, 4, log, v) ) return false;
// ### do a sanity check here
name = QString(data.data()+stringTableOffset+v);
return true;
}
const Coff::OptHeaderFormat::Data Coff::OptHeaderFormat::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Old Microchip") },
{ 0, I18N_NOOP("New Microchip") },
{ 0, I18N_NOOP("PICC Compiler") },
{ 0, I18N_NOOP("CCS Compiler") }
};
const Coff::OptHeaderData Coff::OPT_HEADER_DATA[] = {
{ 0x5678, OptHeaderFormat::OldMicrochip, true },
{ 0x0000, OptHeaderFormat::NewMicrochip, true },
{ 0x0001, OptHeaderFormat::NewMicrochip, true }, // PIC30 with debug
{ 0x1388, OptHeaderFormat::Picc, false }, // PICC
{ 0x1B78, OptHeaderFormat::Ccsc, false }, // CCSC
{ 0x0000, OptHeaderFormat::Nb_Types, false }
};
//----------------------------------------------------------------------------
const Coff::AuxSymbolType::Data Coff::AuxSymbolType::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Direct") },
{ 0, I18N_NOOP("File") },
{ 0, I18N_NOOP("Indentifier") },
{ 0, I18N_NOOP("Section") }
};
Coff::AuxSymbol *Coff::AuxSymbol::factory(const Object &object, AuxSymbolType type, const QByteArray &data, uint offset, uint stringTableOffset, Log::Base &log)
{
switch (type.type()) {
case AuxSymbolType::Direct: return new AuxSymbolDirect(object, data, offset, stringTableOffset, log);
case AuxSymbolType::File: return new AuxSymbolFile(object, data, offset, stringTableOffset, log);
case AuxSymbolType::Identifier: return new AuxSymbolIdentifier(object, data, offset, stringTableOffset, log);
case AuxSymbolType::Section: return new AuxSymbolSection(object, data, offset, stringTableOffset, log);
case AuxSymbolType::Nb_Types: return new AuxSymbolUnknown(object);
}
Q_ASSERT(false);
return 0;
}
Coff::AuxSymbolDirect::AuxSymbolDirect(const Object &object, const QByteArray &data, uint start, uint stringTableOffset, Log::Base &log)
: AuxSymbol(object)
{
uint offset = start;
Q_UINT32 v;
if ( !getULong(data, offset, 1, log, v) ) return;
_command = v;
if ( !getULong(data, offset, 4, log, v) ) return;
_string = QString(data.data()+stringTableOffset+v);
}
Coff::AuxSymbolFile::AuxSymbolFile(const Object &object, const QByteArray &data, uint start, uint stringTableOffset, Log::Base &log)
: AuxSymbol(object)
{
uint offset = start;
Q_UINT32 v;
if ( object.format()==Format::PIC30 ) {
if ( !getName(data, offset, 14, stringTableOffset, log, _filename) ) return;
_line = 0;
} else {
if ( !getULong(data, offset, 4, log, v) ) return;
_filename = QString(data.data()+stringTableOffset+v);
if ( !getULong(data, offset, 4, log, v) ) return;
_line = v;
}
}
Coff::AuxSymbolIdentifier::AuxSymbolIdentifier(const Object &object, const QByteArray &data, uint start, uint stringTableOffset, Log::Base &log)
: AuxSymbol(object)
{
uint offset = start;
Q_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return;
_string = QString(data.data()+stringTableOffset+v);
}
Coff::AuxSymbolSection::AuxSymbolSection(const Object &object, const QByteArray &data, uint start, uint, Log::Base &log)
: AuxSymbol(object)
{
uint offset = start;
Q_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return;
_length = v;
if ( !getULong(data, offset, 2, log, v) ) return;
_nbRelocations = v;
if ( !getULong(data, offset, 2, log, v) ) return;
_nbLineNumbers = v;
}
//----------------------------------------------------------------------------
const Coff::SymbolSectionType::Data Coff::SymbolSectionType::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Inside Section") },
{ 0, I18N_NOOP("Undefined Section") },
{ 0, I18N_NOOP("Absolute Value") },
{ 0, I18N_NOOP("Debug Symbol") }
};
const Coff::SymbolClass::Data Coff::SymbolClass::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Automatic Variable"), 1 },
{ 0, I18N_NOOP("External Symbol"), 2 },
{ 0, I18N_NOOP("Static Symbol"), 3 },
{ 0, I18N_NOOP("Register Variable"), 4 },
{ 0, I18N_NOOP("External Definition"), 5 },
{ 0, I18N_NOOP("Label"), 6 },
{ 0, I18N_NOOP("Undefined Label"), 7 },
{ 0, I18N_NOOP("Member of Structure"), 8 },
{ 0, I18N_NOOP("Function Argument"), 9 },
{ 0, I18N_NOOP("Structure Tag"), 10 },
{ 0, I18N_NOOP("Member of Union"), 11 },
{ 0, I18N_NOOP("Union Tag"), 12 },
{ 0, I18N_NOOP("Type Definition"), 13 },
{ 0, I18N_NOOP("Undefined Static"), 14 },
{ 0, I18N_NOOP("Enumeration Tag"), 15 },
{ 0, I18N_NOOP("Member of Enumeration"), 16 },
{ 0, I18N_NOOP("Register Parameter"), 17 },
{ 0, I18N_NOOP("Bit Field"), 18 },
{ 0, I18N_NOOP("Auto Argument"), 19 },
{ 0, I18N_NOOP("Dummy Entry (end of block)"), 20 },
{ 0, I18N_NOOP("Beginning or End of Block"), 100 },
{ 0, I18N_NOOP("Beginning or End of Function"), 101 },
{ 0, I18N_NOOP("End of Structure"), 102 },
{ 0, I18N_NOOP("Filename"), 103 },
{ 0, I18N_NOOP("Line Number"), 104 },
{ 0, I18N_NOOP("Duplicate Tag"), 105 },
{ 0, I18N_NOOP("Section"), 109 }
};
const Coff::SymbolType::Data Coff::SymbolType::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Void"), 0x0001 },
{ 0, I18N_NOOP("Char"), 0x0010 },
{ 0, I18N_NOOP("Short"), 0x0011 },
{ 0, I18N_NOOP("Int"), 0x0100 },
{ 0, I18N_NOOP("Long"), 0x0101 },
{ 0, I18N_NOOP("Float"), 0x0110 },
{ 0, I18N_NOOP("Double"), 0x0111 },
{ 0, I18N_NOOP("Structure"), 0x1000 },
{ 0, I18N_NOOP("Union"), 0x1001 },
{ 0, I18N_NOOP("Enumeration"), 0x1010 },
{ 0, I18N_NOOP("Member Of Enumeration"), 0x1011 },
{ 0, I18N_NOOP("Unsigned Char"), 0x1100 },
{ 0, I18N_NOOP("Unsigned Short"), 0x1101 },
{ 0, I18N_NOOP("Unsigned Int"), 0x1110 },
{ 0, I18N_NOOP("Unsigned Long"), 0x1111 },
{ 0, I18N_NOOP("Long Double"), 0x10000 }
};
const Coff::SymbolDerivedType::Data Coff::SymbolDerivedType::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Pointer"), 0x010000 },
{ 0, I18N_NOOP("Function"), 0x100000 },
{ 0, I18N_NOOP("Array"), 0x110000 }
};
Coff::Symbol::Symbol(const Object &object, const QByteArray &data, uint start,
uint stringTableOffset, const QString &lastFilename, Log::Base &log)
: BaseSymbol(object)
{
uint offset = start;
Q_UINT32 v;
if ( !getName(data, offset, 8, stringTableOffset, log, _name) ) return;
if ( !getULong(data, offset, 4, log, v) ) return;
_value = v;
if ( !getULong(data, offset, 2, log, v) ) return;
_section = v;
uint nb = (object.format()==Format::NewMicrochip ? 4 : 2);
if ( !getULong(data, offset, nb, log, v) ) return;
_type = SymbolType::Nb_Types;
FOR_EACH(SymbolType, type)
if ( (v & 0x001111)==type.data().id ) { _type = type; break; }
_dtype = SymbolDerivedType::Nb_Types;
FOR_EACH(SymbolDerivedType, dtype)
if ( (v & 0x110000)==dtype.data().id ) { _dtype = dtype; break; }
if ( !getULong(data, offset, 1, log, v) ) return;
_sclass = SymbolClass::Nb_Types;
FOR_EACH(SymbolClass, sclass)
if ( v==sclass.data().id ) { _sclass = sclass; break; }
if ( !getULong(data, offset, 1, log, v) ) return;
uint nbAux = v;
//qDebug("symbol: %s value=%s type=%i dtype=%i class=%i nbAux=%i section=%i", _name.latin1(), toHexLabel(_value, 4).latin1(), _type, _dtype, _class, nbAux, _section);
AuxSymbolType auxType = AuxSymbolType::Nb_Types;
if ( _name==".direct" ) auxType = AuxSymbolType::Direct;
else if ( _name==".ident" ) auxType = AuxSymbolType::Identifier;
else if ( _sclass==SymbolClass::Filename ) auxType = AuxSymbolType::File;
else if ( _sclass==SymbolClass::Section ) auxType = AuxSymbolType::Section;
if ( auxType!=AuxSymbolType::Nb_Types && nbAux==0 ) log.log(Log::LineType::Warning, i18n("Symbol without needed auxilliary symbol (type=%1)").arg(auxType.type()));
Q_ASSERT( (offset-start)==object.size(SymbolSize) );
_aux.resize(nbAux);
for (uint i=0; i<nbAux; i++) {
_aux[i] = AuxSymbol::factory(object, auxType, data, offset, stringTableOffset, log);
offset += object.size(SymbolSize);
if ( log.hasError() ) return;
}
_filename = lastFilename;
for (uint i=0; i<uint(_aux.count()); i++)
if ( _aux[i]->type()==AuxSymbolType::File ) _filename = static_cast<AuxSymbolFile *>(_aux[i])->filename();
}
Coff::SymbolSectionType Coff::Symbol::sectionType() const
{
switch (_section) {
case 0x0000: return SymbolSectionType::UndefinedSection;
case 0xFFFF: return SymbolSectionType::AbsoluteValue;
case 0xFFFE: return SymbolSectionType::DebugSymbol;
}
return SymbolSectionType::InsideSection;
}
//----------------------------------------------------------------------------
Coff::Relocation::Relocation(const Object &object, const Section &section,
const QByteArray &data, uint start, Log::Base &log)
: Element(object), _symbol(0)
{
uint offset = start;
Q_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return;
_address = v;
if ( _address>section.size() ) log.log(Log::LineType::Warning, i18n("Relocation address beyong section size: %1/%2").arg(v).arg(section.size()));
if ( !getULong(data, offset, 4, log, v) ) return;
if ( v>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Relocation has unknown symbol: %1").arg(v));
return;
}
if ( object.symbol(v)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Relocation is an auxiliary symbol: %1").arg(v));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(v));
if ( object.format()!=Format::PIC30 ) {
if ( !getULong(data, offset, 2, log, v) ) return;
_offset = short(v);
}
if ( !getULong(data, offset, 2, log, v) ) return;
_type = v;
//qDebug("reloc %s: address=%s offset=%i type=%i", _symbol->_name.latin1(), toHexLabel(_address, 4).latin1(), _offset, _type);
}
//----------------------------------------------------------------------------
Coff::CodeLine::CodeLine(const Object &object, const Section &section,
const QByteArray &data, uint start, const QString &lastFilename, Log::Base &log)
: Element(object), _section(section), _symbol(0)
{
uint offset = start;
Q_UINT32 v;
if ( !getULong(data, offset, 4, log, v) ) return;
uint tmp = v;
if ( object.format()==Format::PIC30 ) {
if ( !getULong(data, offset, 4, log, v) ) return;
_line = v;
if ( _line!=0 ) {
_address = tmp;
_filename = lastFilename;
//qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1());
} else {
if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp));
return;
}
if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(tmp));
_filename = _symbol->filename();
//qDebug("code line %i: %s", _line, _symbol->_name.latin1());
}
} else {
if ( tmp>=object.nbSymbols() ) {
log.log(Log::LineType::Error, i18n("Codeline has unknown symbol: %1").arg(tmp));
return;
}
if ( object.symbol(tmp)->isAuxSymbol() ) {
log.log(Log::LineType::Error, i18n("Codeline is an auxiliary symbol: %1").arg(tmp));
return;
}
_symbol = static_cast<const Symbol *>(object.symbol(tmp));
_filename = _symbol->filename();
if ( !getULong(data, offset, 2, log, v) ) return;
_line = v;
if ( object.optHeaderFormat()==OptHeaderFormat::Picc && _line>=2 ) _line -= 2; // #### ??
if ( !getULong(data, offset, 4, log, v) ) return;
_address = v;
if ( !getULong(data, offset, 2, log, v) ) return;
// flags
if ( !getULong(data, offset, 4, log, v) ) return;
// function index
//qDebug("code line %i: %s", _line, toHexLabel(_address, nbChars(_address)).latin1());
}
// if ( _symbol && _symbol->_class!=Symbol::CFile )
// log.log(Log::LineType::Warning, i18n("Line without file symbol associated (%1:%2 %3).")
// .arg(_section._name).arg(toHexLabel(_address, nbChars(_address))).arg(_symbol->_class));
}
//----------------------------------------------------------------------------
const Coff::SectionType::Data Coff::SectionType::DATA[Nb_Types] = {
{ 0, I18N_NOOP("Config") },
{ 0, I18N_NOOP("Device ID") },
{ 0, I18N_NOOP("User IDs") },
{ 0, I18N_NOOP("Uninitialized Data") },
{ 0, I18N_NOOP("Initialized Data") },
{ 0, I18N_NOOP("Rom Data") },
{ 0, I18N_NOOP("Code") }
};
Coff::Section::Section(const Device::Data &device, const Object &object,
const QByteArray &data, uint start, uint stringTableOffset, Log::Base &log)
: Element(object)
{
uint offset = start;
Q_UINT32 v;
if ( !getName(data, offset, 8, stringTableOffset, log, _name) ) return;
if ( !getULong(data, offset, 4, log, v) ) return;
_address = v;
if ( !getULong(data, offset, 4, log, v) ) return;
//if ( _address!=v ) log.log(Log::LineType::Warning, i18n("Virtual address (%1) does not match physical address (%2) in %3.")
// .arg(toHexLabel(v, 4)).arg(toHexLabel(_address, 4)).arg(_name));
if ( !getULong(data, offset, 4, log, v) ) return;
_size = v;
if ( !getULong(data, offset, 4, log, v) ) return;
uint dataOffset = v;
if ( !getULong(data, offset, 4, log, v) ) return;
uint relocationOffset = v;
if ( !getULong(data, offset, 4, log, v) ) return;
uint lineNumberOffset = v;
if ( !getULong(data, offset, 2, log, v) ) return;
uint nbRelocations = v;
if ( !getULong(data, offset, 2, log, v) ) return;
uint nbLineNumbers = v;
if ( !getULong(data, offset, 4, log, v) ) return;
_flags = v;
// read data
Q_ASSERT ( device.group().name()=="pic" );
const Pic::Data &pdata = static_cast<const Pic::Data &>(device);
//qDebug("section %s: address=%s size=%i flags=%i", _name.data(), toHexLabel(_address, 4).latin1(), _size, int(_flags));
if ( _size!=0 && dataOffset!=0 ) {
uint inc = 1;
uint nbWords = _size;
uint nbBytesWord = 1;
bool b = ( (_flags & FText) || (_flags & FDataRom) );
if (b) {
nbBytesWord = pdata.nbBytesWord(Pic::MemoryRangeType::Code);
nbWords /= nbBytesWord;
inc = pdata.addressIncrement(Pic::MemoryRangeType::Code);
}
for (uint i=0; i<nbWords; i++) {
Address address = _address + inc*i;
if ( !getULong(data, dataOffset, nbBytesWord, log, v) ) return;
_instructions[address].value = v;
}
for (uint i=0; i<nbWords; i++) {
Address address = _address + inc*i;
BitValue op = _instructions[address].value;
if ( _flags & FText ) {
char buffer[512];
buffer[0] = 0;
BitValue op2 = ((i+1)<nbWords ? _instructions[address+inc].value : 0);
uint nbop = disassemble(op.toUInt(), op2.toUInt(), address.toUInt()/inc, pdata.architecture(), buffer, 512);
_instructions[address].disasm = QString(buffer);
_instructions[address].opcode = toHex(op, pdata.nbCharsWord(Pic::MemoryRangeType::Code));
if ( nbop==2 ) {
_instructions[address+inc].opcode = toHex(op2, pdata.nbCharsWord(Pic::MemoryRangeType::Code));
i++;
}
//qDebug(" %s: %s (%s %s)", toHex(address, 4).data(), _data[address].disasm.data(), _data[address].opcode.data(), (nbop==2 ? _data[address+inc].opcode.data() : ""));
} else if ( _flags & FDataRom ) _instructions[address].opcode = toHex(op, 4);
else if ( _flags & FData ) _instructions[address].opcode = toHex(op.maskWith(0xFF), 2);
}
}
// read relocations
if ( relocationOffset!=0 ) {
_relocations.resize(nbRelocations);
for (uint i=0; i<nbRelocations; i++) {
_relocations[i] = new Relocation(object, *this, data, relocationOffset, log);
relocationOffset += object.size(RelocationSize);
if ( log.hasError() ) return;
}
}
// read line numbers
if ( lineNumberOffset!=0 ) {
QString lastFilename;
_lines.resize(nbLineNumbers);
for (uint i=0; i<nbLineNumbers; i++) {
_lines[i] = new CodeLine(object, *this, data, lineNumberOffset, lastFilename, log);
lastFilename = _lines[i]->filename();
lineNumberOffset += object.size(LineNumberSize);
if ( log.hasError() ) return;
}
}
}
Coff::Section::~Section()
{
for (uint i=0; i<uint(_relocations.count()); i++) delete _relocations[i];
for (uint i=0; i<uint(_lines.count()); i++) delete _lines[i];
}
Coff::SectionType Coff::Section::type() const
{
if ( _name==".config" ) return SectionType::Config;
if ( _name==".devid" ) return SectionType::DeviceId;
if ( _name==".idlocs" ) return SectionType::UserIds;
if ( _flags & FText ) return SectionType::Code;
if ( _flags & FData ) return SectionType::InitializedData;
if ( _flags & FBSS ) return SectionType::UninitializedData;
if ( _flags & FDataRom ) return SectionType::DataRom;
return SectionType::Nb_Types;
}
//----------------------------------------------------------------------------
Coff::Object::Object(const Device::Data *device, const PURL::Url &url)
: Base(url), _device(device)
{}
bool Coff::Object::parse(Log::Base &log)
{
// header
QByteArray data;
uint offset = 0;
if ( !initParse(CoffType::Object, data, offset, log) ) return false;
if ( _format==Format::Nb_Types ) {
log.log(Log::LineType::Error, i18n("COFF format not supported: magic number is %1.").arg(toHexLabel(_magic, 4)));
return false;
}
log.log(Log::DebugLevel::Extra, QString("COFF format: %1").arg(toHexLabel(_magic, 4)));
if ( !parseHeader(data, offset, log) ) return false;
// optionnal header
Q_ASSERT( offset==size(HeaderSize) );
if ( !getULong(data, offset, 2, log, _optHeaderMagic) ) return false;
log.log(Log::DebugLevel::Extra, QString("COFF optionnal header format: %1").arg(toHexLabel(_optHeaderMagic, 4)));
_optHeaderFormat = OptHeaderFormat::Nb_Types;
uint i = 0;
for (; OPT_HEADER_DATA[i].optHeaderFormat!=OptHeaderFormat::Nb_Types; i++) if ( _optHeaderMagic==OPT_HEADER_DATA[i].magic ) break;
_optHeaderFormat = OPT_HEADER_DATA[i].optHeaderFormat;
if ( _optHeaderFormat==OptHeaderFormat::Nb_Types ) {
log.log(Log::LineType::Warning, i18n("Optional header format not supported: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2;
} else if ( !OPT_HEADER_DATA[i].parsed ) {
log.log(Log::DebugLevel::Normal, QString("Optional header not parsed: magic number is %1.").arg(toHexLabel(_optHeaderMagic, 4)));
offset += size(OptHeaderSize)-2;
} else if ( !parseOptionnalHeader(data, offset, log) ) return false;
// parse symbol table
uint stringTableOffset = _symbolOffset + _nbSymbols*size(SymbolSize);
QString lastFilename;
_symbols.resize(_nbSymbols);
for (uint i=0; i<_nbSymbols; i++) {
Symbol *s = new Symbol(*this, data, _symbolOffset, stringTableOffset, lastFilename, log);
if ( log.hasError() ) return false;
if ( !s->filename().isEmpty() ) lastFilename = s->filename();
_symbols[i] = s;
_msymbols[s->name()] = s;
_symbolOffset += size(SymbolSize);
for (uint k=0; k<uint(s->auxSymbols().count()); k++) {
i++;
_symbols[i] = s->auxSymbols()[k];
_symbolOffset += size(SymbolSize);
}
}
// parse sections
Q_ASSERT( offset==(size(HeaderSize) + size(OptHeaderSize)) );
_sections.resize(_nbSections);
for (uint i=0; i<_nbSections; i++) {
_sections[i] = new Section(*_device, *this, data, offset, stringTableOffset, log);
offset += size(SectionHeaderSize);
if ( log.hasError() ) return false;
}
// extract filenames
for (uint i=0; i<_nbSymbols; i++) {
if ( _symbols[i]==0 || _symbols[i]->isAuxSymbol() ) continue;
QString s = static_cast<const Symbol *>(_symbols[i])->filename();
if ( s.isEmpty() || s=="fake" || _filenames.contains(s) ) continue;
_filenames.append(s);
}
// extract variables
for (uint i=0; i<nbSymbols(); i++) {
if ( _symbols[i]==0 || _symbols[i]->isAuxSymbol() ) continue;
const Symbol *sym = static_cast<const Symbol *>(_symbols[i]);
if ( sym->symbolClass()!=SymbolClass::Static ) continue;
if ( sym->sectionType()!=SymbolSectionType::InsideSection ) continue;
QString name = sym->name();
if ( name.startsWith("_$_") || name.startsWith("__") || name.startsWith(".") ) continue; // special variables (?)
_variables[name] = sym->value() & 0xFFF; // #### ??
}
return true;
}
bool Coff::Object::parseHeader(const QByteArray &data, uint &offset, Log::Base &log)
{
Q_UINT32 v;
if ( !getULong(data, offset, 2, log, v) ) return false;
_nbSections = v;
if ( !getULong(data, offset, 4, log, v) ) return false;
// time_t time = v;
if ( !getULong(data, offset, 4, log, v) ) return false;
_symbolOffset = v;
if ( !getULong(data, offset, 4, log, v) ) return false;
_nbSymbols = v;
if ( !getULong(data, offset, 2, log, v) ) return false;
if ( v!=size(OptHeaderSize) ) {
log.log(Log::LineType::Error, i18n("Optionnal header size is not %1: %2").arg(size(OptHeaderSize)).arg(v));
return false;
}
if ( !getULong(data, offset, 2, log, v) ) return false;
_flags = Flags(v);
return true;
}
bool Coff::Object::parseOptionnalHeader(const QByteArray &data, uint &offset, Log::Base &log)
{
Q_UINT32 v;
int nb = (_format==Format::NewMicrochip ? 4 : 2);
if ( !getULong(data, offset, nb, log, v) ) return false; // version stamp
if ( _format==Format::PIC30 ) {
if ( !getULong(data, offset, 4, log, v) ) return false; // text size in bytes, padded to firmware boundary
if ( !getULong(data, offset, 4, log, v) ) return false; // initialized data "
if ( !getULong(data, offset, 4, log, v) ) return false; // uninitialized data "
if ( !getULong(data, offset, 4, log, v) ) return false; // entry point
if ( !getULong(data, offset, 4, log, v) ) return false; // offset of text
if ( !getULong(data, offset, 4, log, v) ) return false; // offset of data
if ( _device==0 ) _device = Device::lister().data("30F2010"); // for e.g.
} else {
if ( !getULong(data, offset, 4, log, v) ) return false;
// #### at least for C18 compiler, it can be compiled for generic processor: in such case
// the pic type will be 18C452 in non-extended mode and 18F4620 for extended mode...
QString name = Coff::findId(v);
log.log(Log::DebugLevel::Normal, QString("Device name: \"%1\"").arg(name));
if ( name.isEmpty() ) {
log.log(Log::DebugLevel::Normal, QString("Unknown processor type: %1").arg(toHexLabel(v, 4)));
log.log(Log::LineType::Error, i18n("Could not determine processor (%1).").arg(toHexLabel(v, 4)));
return false;
} else if ( _device==0 ) _device = Device::lister().data(name);
else if ( name!=_device->name() ) log.log(Log::DebugLevel::Normal, QString("Different processor name: %1").arg(name));
if ( !getULong(data, offset, 4, log, v) ) return false;
const Pic::Data *pdata = static_cast<const Pic::Data *>(_device);
if (pdata) {
uint nbBits = pdata->nbBitsWord(Pic::MemoryRangeType::Code) / pdata->addressIncrement(Pic::MemoryRangeType::Code);
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, QString("Rom width is not %1: %2").arg(nbBits).arg(v));
}
if ( !getULong(data, offset, 4, log, v) ) return false;
if (pdata) {
uint nbBits = pdata->registersData().nbBits();
if ( v!=nbBits ) log.log(Log::DebugLevel::Normal, QString("Ram width is not %1: %2").arg(nbBits).arg(v));
}
}
return true;
}
Coff::Object::~Object()
{
for (uint i=0; i<nbSymbols(); i++) delete _symbols[i];
for (uint i=0; i<nbSections(); i++) delete _sections[i];
}
QString Coff::Object::variableName(Address address) const
{
QMap<QString, Address>::const_iterator it;
for (it=_variables.begin(); it!=_variables.end(); ++it)
if ( it.data()==address ) return it.key();
return QString::null;
}
//----------------------------------------------------------------------------
QValueVector<Pic::RegisterNameData> Pic::sfrList(const Pic::Data &data)
{
QValueVector<Pic::RegisterNameData> list;
const Pic::RegistersData &rdata = data.registersData();
for (uint i=0; i<rdata.nbRegisters(); i++) {
uint address = rdata.nbBytes() * i;
Pic::RegisterType type = rdata.type(address);
Device::RegisterProperties rp = rdata.properties(address);
if ( !(rp & Device::Readable) ) continue;
Register::TypeData rtd(address, rdata.nbChars());
if ( type==Pic::Sfr ) list.append(Pic::RegisterNameData(rdata.label(address), rtd));
}
QMap<QString, Pic::CombinedData>::const_iterator it;
for (it=rdata.combined.begin(); it!=rdata.combined.end(); ++it) {
Register::TypeData td(it.key(), it.data().address, it.data().nbChars);
list.append(Pic::RegisterNameData(it.key(), td));
}
if ( data.architecture()==Pic::Architecture::P16X )
list.append(Pic::RegisterNameData("WREG", Register::TypeData("WREG", rdata.nbChars())));
qHeapSort(list);
return list;
}
QValueVector<Pic::RegisterNameData> Pic::gprList(const Pic::Data &data, const Coff::Object *coff)
{
QValueVector<Pic::RegisterNameData> list;
const Pic::RegistersData &rdata = data.registersData();
for (uint i=0; i<rdata.nbRegisters(); i++) {
uint address = rdata.nbBytes() * i;
Pic::RegisterType type = rdata.type(address);
Device::RegisterProperties rp = rdata.properties(address);
if ( !(rp & Device::Readable) ) continue;
if (type==Pic::Gpr ) {
QString s = toHexLabel(address, rdata.nbCharsAddress());
if (coff) {
QString name = coff->variableName(address);
if ( !name.isEmpty() ) s += " (" + name + ")";
}
Register::TypeData rtd(address, rdata.nbChars());
list.append(Pic::RegisterNameData(s, rtd));
}
}
return list;
}
QValueVector<Pic::RegisterNameData> Pic::variableList(const Pic::Data &data, const Coff::Object &coff)
{
QValueVector<Pic::RegisterNameData> list;
const Pic::RegistersData &rdata = data.registersData();
QMap<QString, Address> variables = coff.variables();
QMap<QString, Address>::const_iterator vit;
for (vit=variables.begin(); vit!=variables.end(); ++vit) {
Register::TypeData rtd(vit.data(), rdata.nbChars());
list.append(Pic::RegisterNameData(vit.key() + " (" + toHexLabel(vit.data(), rdata.nbCharsAddress()) + ")", rtd));
}
qHeapSort(list);
return list;
}

@ -0,0 +1,322 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef COFF_OBJECT_H
#define COFF_OBJECT_H
#include "coff.h"
#include "devices/base/register.h"
namespace Coff
{
//----------------------------------------------------------------------------
extern bool getName(const QByteArray &data, uint &offset, uint nbChars, uint stringTableOffset, Log::Base &log, QString &name);
extern int disassemble(long int opcode, long int opcode2, int org, Pic::Architecture architecture, char *buffer, size_t sizeof_buffer);
BEGIN_DECLARE_ENUM(OptHeaderFormat)
OldMicrochip = 0, NewMicrochip, Picc, Ccsc
END_DECLARE_ENUM_STD(OptHeaderFormat)
struct OptHeaderData {
uint magic;
OptHeaderFormat optHeaderFormat;
bool parsed;
};
extern const OptHeaderData OPT_HEADER_DATA[];
class Object;
class Section;
//----------------------------------------------------------------------------
class Element
{
public:
Element(const Object &object) : _object(object) {}
virtual ~Element() {}
protected:
const Object &_object;
};
//----------------------------------------------------------------------------
class BaseSymbol : public Element
{
public:
BaseSymbol(const Object &object) : Element(object) {}
virtual bool isAuxSymbol() const = 0;
};
BEGIN_DECLARE_ENUM(AuxSymbolType)
Direct = 0, File, Identifier, Section
END_DECLARE_ENUM_STD(AuxSymbolType)
class AuxSymbol : public BaseSymbol
{
public:
virtual bool isAuxSymbol() const { return true; }
static AuxSymbol *factory(const Object &object, AuxSymbolType type, const QByteArray &data,
uint offset, uint stringTableOffset, Log::Base &log);
public:
AuxSymbol(const Object &object) : BaseSymbol(object) {}
virtual AuxSymbolType type() const = 0;
};
class AuxSymbolDirect : public AuxSymbol
{
public:
AuxSymbolDirect(const Object &object, const QByteArray &data, uint offset, uint stringTableOffset, Log::Base &log);
virtual AuxSymbolType type() const { return AuxSymbolType::Direct; }
private:
uchar _command;
QString _string;
};
class AuxSymbolFile : public AuxSymbol
{
public:
AuxSymbolFile(const Object &object, const QByteArray &data, uint offset, uint stringTableOffset, Log::Base &log);
virtual AuxSymbolType type() const { return AuxSymbolType::File; }
QString filename() const { return _filename; }
uint line() const { return _line; }
private:
uint _line;
QString _filename;
};
class AuxSymbolIdentifier : public AuxSymbol
{
public:
AuxSymbolIdentifier(const Object &object, const QByteArray &data, uint offset, uint stringTableOffset, Log::Base &log);
virtual AuxSymbolType type() const { return AuxSymbolType::Identifier; }
QString string() const { return _string; }
private:
QString _string;
};
class AuxSymbolSection : public AuxSymbol
{
public:
AuxSymbolSection(const Object &object, const QByteArray &data, uint offset, uint stringTableOffset, Log::Base &log);
virtual AuxSymbolType type() const { return AuxSymbolType::Section; }
private:
uint _length, _nbRelocations, _nbLineNumbers;
};
class AuxSymbolUnknown : public AuxSymbol
{
public:
AuxSymbolUnknown(const Object &object) : AuxSymbol(object) {}
virtual AuxSymbolType type() const { return AuxSymbolType::Nb_Types; }
};
//----------------------------------------------------------------------------
BEGIN_DECLARE_ENUM(SymbolSectionType)
InsideSection = 0, UndefinedSection, AbsoluteValue, DebugSymbol
END_DECLARE_ENUM_STD(SymbolSectionType)
struct SymbolClassData {
const char *key, *label;
uint id;
};
BEGIN_DECLARE_ENUM(SymbolClass)
Automatic = 0, External, Static, Register, ExternalDefinition,
Label, UndefinedLabel, MemberOfStructure, FunctionArgument, StructureTag,
MemberOfUnion, UnionTag, TypeDefinition, UndefinedStatic, EnumerationTag,
MemberOfEnumeration, RegisterParameter, BitField, AutoArgument, EndOfBlock,
BeginEndOfBlock, BeginEndOfFunction, EndOfStructure, Filename, LineNumber,
DuplicateTag, Section
END_DECLARE_ENUM(SymbolClass, SymbolClassData)
struct SymbolTypeData {
const char *key, *label;
uint id;
};
BEGIN_DECLARE_ENUM(SymbolType)
Void = 0, Char, Short, Int, Long, Float, Double, Struct, Union,
Enum, MemberOfEnum, UChar, UShort, UInt, ULong, LongDouble
END_DECLARE_ENUM(SymbolType, SymbolTypeData)
struct SymbolDerivedTypeData {
const char *key, *label;
uint id;
};
BEGIN_DECLARE_ENUM(SymbolDerivedType)
Pointer = 0, Function, Array
END_DECLARE_ENUM(SymbolDerivedType, SymbolDerivedTypeData)
class Symbol : public BaseSymbol
{
public:
Symbol(const Object &object, const QByteArray &data, uint offset, uint stringTableOffset,
const QString &lastFilename, Log::Base &log);
virtual bool isAuxSymbol() const { return false; }
QString name() const { return _name; }
QString filename() const { return _filename; }
const QValueVector<AuxSymbol *> &auxSymbols() const { return _aux; }
SymbolClass symbolClass() const { return _sclass; }
SymbolSectionType sectionType() const;
SymbolType type() const { return _type; }
SymbolDerivedType derivedType() const { return _dtype; }
uint value() const { return _value; }
uint section() const { Q_ASSERT( sectionType()==SymbolSectionType::InsideSection ); return _section; }
private:
QString _name, _filename;
uint _value, _section;
SymbolClass _sclass;
SymbolType _type;
SymbolDerivedType _dtype;
QValueVector<AuxSymbol *> _aux;
};
//----------------------------------------------------------------------------
class Relocation : public Element
{
public:
Relocation(const Object &object, const Section &section, const QByteArray &data,
uint offset, Log::Base &log);
private:
ulong _address, _type;
short _offset;
const Symbol *_symbol;
};
//----------------------------------------------------------------------------
class CodeLine : public Element
{
public:
CodeLine(const Object &object, const Section &section, const QByteArray &data,
uint offset, const QString &lastFilename, Log::Base &log);
const Section &section() const { return _section; }
QString filename() const { return _filename; }
uint line() const { return _line; }
Address address() const { return _address; }
const Symbol *symbol() const { return _symbol; }
private:
const Section &_section;
uint _line;
Address _address;
QString _filename;
const Symbol *_symbol;
};
//----------------------------------------------------------------------------
BEGIN_DECLARE_ENUM(SectionType)
Config = 0, DeviceId, UserIds, UninitializedData, InitializedData, DataRom, Code
END_DECLARE_ENUM_STD(SectionType)
class Section : public Element
{
public:
class InstructionData {
public:
BitValue value;
QString opcode, disasm;
};
public:
Section(const Device::Data &device, const Object &object, const QByteArray &data, uint offset,
uint stringTableOffset, Log::Base &log);
~Section();
SectionType type() const;
QString name() const { return _name; }
Address address() const { return _address; }
uint size() const { return _size; }
uint flags() const { return _flags; }
const QMap<Address, InstructionData> &instructions() const { return _instructions; }
const QValueVector<Relocation *> &relocations() const { return _relocations; }
const QValueVector<CodeLine *> &lines() const { return _lines; }
private:
QString _name;
Address _address;
uint _size, _flags;
QMap<Address, InstructionData> _instructions;
QValueVector<Relocation *> _relocations;
QValueVector<CodeLine *> _lines;
enum Flag { FText = 0x00020, FData = 0x00040, FBSS = 0x00080, FDataRom = 0x00100,
FAbs = 0x01000, FShared = 0x02000, FOverlay = 0x04000, FAccess = 0x08000,
FActivationRecord = 0x10000 };
};
//----------------------------------------------------------------------------
class Object : public Base
{
public:
Object(const Device::Data *device, const PURL::Url &url);
virtual ~Object();
virtual bool parse(Log::Base &log);
Format format() const { return _format; }
const Device::Data *device() const { return _device; }
uint size(SizeType stype) const { return _format.data().sizes[stype]; }
OptHeaderFormat optHeaderFormat() const { return _optHeaderFormat; }
uint optHeaderMagic() const { return _optHeaderMagic; }
uint nbSymbols() const { return _symbols.count(); }
const BaseSymbol *symbol(uint i) const { return _symbols[i]; }
const Symbol *symbol(const QString &name) const { return (_msymbols.contains(name) ? _msymbols[name] : 0); }
uint nbSections() const { return _sections.count(); }
const Section *section(uint i) const { return _sections[i]; }
const QStringList &filenames() const { return _filenames; }
const QMap<QString, Address> &variables() const { return _variables; }
QString variableName(Address address) const;
enum Flag { RelocationStripped = 0x0001, Executable = 0x0002, LineNumberStripped = 0x0004,
SymbolStripped = 0x0080, Extended18 = 0x4000, Generic = 0x8000 };
Q_DECLARE_FLAGS(Flags, Flag)
protected:
Q_UINT32 _optHeaderMagic;
OptHeaderFormat _optHeaderFormat;
const Device::Data *_device;
uint _nbSections, _nbSymbols, _symbolOffset;
Flags _flags;
QValueVector<BaseSymbol *> _symbols;
QMap<QString, Symbol *> _msymbols; // name -> Symbol *
QValueVector<Section *> _sections;
QStringList _filenames;
QMap<QString, Address> _variables; // name -> address
virtual bool parseHeader(const QByteArray &data, uint &offset, Log::Base &log);
virtual bool parseOptionnalHeader(const QByteArray &data, uint &offset, Log::Base &log);
};
Q_DECLARE_OPERATORS_FOR_FLAGS(Object::Flags)
} // namespace
//----------------------------------------------------------------------------
namespace Pic
{
class RegisterNameData
{
public:
RegisterNameData() {}
RegisterNameData(const QString &label, const Register::TypeData &data) : _label(label), _data(data) {}
QString label() const { return _label; }
const Register::TypeData &data() const { return _data; }
bool operator <(const RegisterNameData &rnd) const { return _label<rnd._label; };
private:
QString _label;
Register::TypeData _data;
};
extern QValueVector<RegisterNameData> sfrList(const Pic::Data &data);
extern QValueVector<RegisterNameData> gprList(const Pic::Data &data, const Coff::Object *coff);
extern QValueVector<RegisterNameData> variableList(const Pic::Data &data, const Coff::Object &coff);
} // namespace
#endif

@ -0,0 +1,289 @@
/***************************************************************************
* Copyright (C) 2006-2007 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "disassembler.h"
#include <qregexp.h>
#include "devices/base/device_group.h"
#include "devices/pic/pic/pic_memory.h"
#include "coff_object.h"
//-----------------------------------------------------------------------------
QString SourceLine::comment(PURL::SourceFamily family, const QString &text)
{
switch (family.type()) {
case PURL::SourceFamily::Asm: return "; " + text;
case PURL::SourceFamily::C: return "/* " + text + " */";
case PURL::SourceFamily::JAL: return "-- " + text;
case PURL::SourceFamily::Cpp: return "// " + text;
case PURL::SourceFamily::Basic: return "' " + text;
case PURL::SourceFamily::Nb_Types: break;
}
Q_ASSERT(false);
return QString::null;
}
namespace SourceLine
{
class LineData {
public:
LineData() : group(-1) {}
QString text, comment;
int group;
};
} // namespace
QStringList SourceLine::lines(PURL::SourceFamily family, const List &list, uint nbSpaces)
{
QValueList<LineData> lines;
QValueList<uint> groupCommentColumn;
groupCommentColumn.append(0);
List::const_iterator it;
for (it=list.begin(); it!=list.end(); ++it) {
LineData data;
switch((*it).type) {
case Indented:
data.text = repeat(" ", nbSpaces);
case NotIndented:
if ( (*it).code.isEmpty() && !(*it).comment.isEmpty() ) data.text += comment(family, (*it).comment);
else {
data.text += (*it).code;
data.comment = (*it).comment;
data.group = groupCommentColumn.count() - 1;
groupCommentColumn[data.group] = qMax(groupCommentColumn[data.group], uint(data.text.length()));
}
break;
case Separator:
data.text = comment(family, "-----------------------------------------------------------------------");
groupCommentColumn.append(0);
break;
case Empty:
break;
case Title:
data.text = comment(family, (*it).comment);
break;
}
lines += data;
}
QStringList slines;
QValueList<LineData>::const_iterator lit;
for (lit=lines.begin(); lit!=lines.end(); ++lit) {
if ( (*lit).group==-1 || (*lit).comment.isEmpty() ) slines += (*lit).text;
else {
uint col = groupCommentColumn[(*lit).group] + 1;
slines += (*lit).text.leftJustify(col, ' ') + comment(family, (*lit).comment);
}
}
return slines;
}
QString SourceLine::text(PURL::SourceFamily family, const List &list, uint nbSpaces)
{
return lines(family, list, nbSpaces).join("\n") + "\n";
}
QString SourceLine::transformConfigName(const Pic::Data &data, uint wordIndex, const QString &name)
{
if ( !data.is18Family() ) return name;
bool ok;
(void)fromHexLabel(name, &ok);
if (ok) return name;
QString s = name + '_';
if ( data.name()=="18C601" || data.name()=="18C801" || data.name().startsWith("18F" ) )
s += QString::number(wordIndex/2+1) + (wordIndex%2==0 ? 'L' : 'H');
else s += QString::number(wordIndex);
return s;
}
QStringList SourceLine::ignoredConfigNames(const Pic::Data &data, uint wordIndex)
{
QStringList cnames;
const QStringList &names = data.config()._words[wordIndex].ignoredCNames;
for (uint i=0; i<uint(names.count()); i++) cnames += transformConfigName(data, wordIndex, names[i]);
return cnames;
}
QStringList SourceLine::extraConfigNames(const Pic::Data &data, uint wordIndex, const Pic::Config::Value &value)
{
QStringList cnames;
const QStringList &names = value.configNames[Pic::ConfigNameType::Extra];
for (uint i=0; i<uint(names.count()); i++) cnames += transformConfigName(data, wordIndex, names[i]);
return cnames;
}
QStringList SourceLine::configNames(Pic::ConfigNameType type, const Pic::Memory &memory, uint word, bool &ok)
{
ok = true;
const Pic::Data &data = memory.device();
const Pic::Config &config = data.config();
BitValue v = memory.normalizedWord(Pic::MemoryRangeType::Config, word);
const Pic::Config::Word &cword = config._words[word];
QStringList cnames;
for (uint k=0; k<uint(cword.masks.count()); k++) {
const Pic::Config::Mask &cmask = cword.masks[k];
if ( cmask.value.isInside(cword.pmask) ) continue; // protected bits
for (int l=cmask.values.count()-1; l>=0; l--) {
const Pic::Config::Value &cvalue = cmask.values[l];
if ( !cvalue.value.isInside(v) ) continue;
QStringList vcnames = cvalue.configNames[type];
if ( vcnames.isEmpty() && type!=Pic::ConfigNameType::Default ) vcnames = cvalue.configNames[Pic::ConfigNameType::Default];
for (uint i=0; i<uint(vcnames.count()); i++) {
if ( vcnames[i].isEmpty() ) ok = false;
else cnames += transformConfigName(data, word, vcnames[i]);
}
break;
}
}
return cnames;
}
//-----------------------------------------------------------------------------
QString GPUtils::toDeviceName(const QString &device)
{
if ( device.startsWith("PS") ) return device.lower();
return "p" + device.lower();
}
SourceLine::List GPUtils::includeLines(const Device::Data &data)
{
SourceLine::List lines;
QString include = toDeviceName(data.name());
if ( data.name()=="12CR509A" ) include = "p12c509a";
else if ( QRegExp("16CR?5.?[A-C]?").exactMatch(data.name()) ) include = "p16c5x";
else if ( QRegExp("16F5.?").exactMatch(data.name()) ) include = "p16f5x";
else if ( data.name()=="16CR620A" ) include = "p16c620a";
lines.appendIndentedCode("#include <" + include + ".inc>");
return lines;
}
SourceLine::List GPUtils::generateConfigLines(const Pic::Memory &memory, bool &ok)
{
SourceLine::List lines;
const Pic::Data &data = memory.device();
const Pic::Config &config = data.config();
for (uint i=0; i<data.nbWords(Pic::MemoryRangeType::Config); i++) {
const Pic::Config::Word &cword = config._words[i];
QStringList cnames = SourceLine::configNames(Pic::ConfigNameType::Default, memory, i, ok);
if ( cnames.isEmpty() ) continue;
QString code = "__CONFIG ";
if ( !cword.name.isEmpty() ) code += "_" + cword.name + ", ";
code += cnames.join(" & ");
lines.appendIndentedCode(code);
}
return lines;
}
SourceLine::List GPUtils::disassemble(const Pic::Memory &memory)
{
SourceLine::List lines;
const Pic::Data &data = memory.device();
// includes
lines += includeLines(data);
lines.appendNotIndentedCode("processor " + toDeviceName(data.name()));
// memory config
bool isDefault = true;
for (uint k=0; k<data.nbWords(Pic::MemoryRangeType::Config); k++) {
BitValue op = memory.normalizedWord(Pic::MemoryRangeType::Config, k);
BitValue mask = data.config()._words[k].usedMask();
if ( !mask.isInside(op) ) isDefault = false; // this is not completely correct but otherwise empty config is written...
}
if ( !isDefault ) {
lines.appendEmpty();
lines.appendSeparator();
bool ok;
lines += generateConfigLines(memory, ok);
}
// user ids
QString tmp;
for (uint k=0; k<data.nbWords(Pic::MemoryRangeType::UserId); k++) {
BitValue op = memory.normalizedWord(Pic::MemoryRangeType::UserId, k);
BitValue mask = data.userIdRecommendedMask();
if ( mask.isInside(op) ) continue;
if ( data.is18Family() ) {
Address ad = data.range(Pic::MemoryRangeType::UserId).start + data.range(Pic::MemoryRangeType::UserId).hexFileOffset + k*data.addressIncrement(Pic::MemoryRangeType::UserId);
lines.appendIndentedCode("__IDLOCS " + toHexLabel(ad, data.nbCharsAddress()) + ", " + toHexLabel(op, data.nbCharsWord(Pic::MemoryRangeType::UserId)));
} else tmp += toHex(op.nybble(0), 1);
}
if ( !tmp.isEmpty() ) {
lines.appendEmpty();
lines.appendSeparator();
lines.appendIndentedCode("__IDLOCS 0x" + tmp);
}
// memory code
lines.appendEmpty();
lines.appendSeparator();
lines.appendTitle("code memory");
bool first = true, newOrg = true;
uint nb = data.nbWords(Pic::MemoryRangeType::Code);
for (uint k=0; k<nb; k++) {
BitValue op = memory.normalizedWord(Pic::MemoryRangeType::Code, k);
BitValue mask = data.mask(Pic::MemoryRangeType::Code);
if ( mask.isInside(op) ) newOrg = true;
else {
if (newOrg) {
if ( !first ) tmp += '\n';
first = false;
Address org = data.range(Pic::MemoryRangeType::Code).start + data.range(Pic::MemoryRangeType::Code).hexFileOffset + k*data.addressIncrement(Pic::MemoryRangeType::Code);
lines.appendNotIndentedCode("org " + toHexLabel(org, data.nbCharsAddress()));
newOrg = false;
}
char buffer[512];
buffer[0] = 0;
BitValue op2 = ((k+1)<nb ? memory.word(Pic::MemoryRangeType::Code, k+1) : 0);
uint n = Coff::disassemble(op.toUInt(), op2.toUInt(), k, data.architecture(), buffer, 512);
lines.appendIndentedCode(QString(buffer));
if ( n==2 ) k++;
}
}
// eeprom data
lines.appendEmpty();
lines.appendSeparator();
lines.appendTitle("eeprom memory");
newOrg = true;
nb = data.nbWords(Pic::MemoryRangeType::Eeprom);
for (uint k=0; k<nb; k++) {
BitValue op = memory.normalizedWord(Pic::MemoryRangeType::Eeprom, k);
BitValue mask = data.mask(Pic::MemoryRangeType::Eeprom);
if ( mask.isInside(op) ) newOrg = true;
else {
if (newOrg) {
Address org = data.range(Pic::MemoryRangeType::Eeprom).start + data.range(Pic::MemoryRangeType::Eeprom).hexFileOffset + k*data.addressIncrement(Pic::MemoryRangeType::Eeprom);
lines.appendNotIndentedCode("org " + toHexLabel(org, data.nbCharsAddress()));
newOrg = false;
}
lines.appendIndentedCode("de " + toHexLabel(op, data.nbCharsWord(Pic::MemoryRangeType::Eeprom)));
}
}
lines.appendNotIndentedCode("end");
return lines;
}
//-----------------------------------------------------------------------------
SourceLine::List Tool::SourceGenerator::templateSourceFile(PURL::ToolType type, const Device::Data &data, bool &ok) const
{
SourceLine::List lines;
lines.appendSeparator();
lines.appendTitle(i18n("Template source file generated by piklab"));
lines += includeLines(type, data);
lines.appendEmpty();
lines.appendSeparator();
lines.appendTitle(i18n("Configuration bits: adapt to your setup and needs"));
Device::Memory *memory = data.group().createMemory(data);
lines += configLines(type, *memory, ok);
delete memory;
lines.appendEmpty();
lines += sourceFileContent(type, data, ok);
return lines;
}

@ -0,0 +1,80 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#ifndef DISASSEMBLER_H
#define DISASSEMBLER_H
#include "common/common/purl_base.h"
#include "devices/pic/base/pic_config.h"
namespace Device { class Data; class Memory; }
namespace Pic { class Data; class Memory; }
//-----------------------------------------------------------------------------
namespace SourceLine
{
enum Type { Indented, NotIndented, Title, Separator, Empty };
class Data {
public:
Data(Type _type = Empty, const QString &_code = QString::null, const QString &_comment = QString::null)
: type(_type), code(_code), comment(_comment) {}
Type type;
QString code, comment;
};
class List : public QValueList<Data>
{
public:
List() {}
void appendSeparator() { append(Separator); }
void appendEmpty() { append(Empty); }
void appendTitle(const QString &text) { append(Data(Title, QString::null, text)); }
void appendIndentedCode(const QString &code, const QString &comment = QString::null) { append(Data(Indented, code, comment)); }
void appendNotIndentedCode(const QString &code, const QString &comment = QString::null) { append(Data(NotIndented, code, comment)); }
};
extern QString comment(PURL::SourceFamily family, const QString &text);
extern QStringList lines(PURL::SourceFamily family, const List &list, uint nbSpaces);
extern QString text(PURL::SourceFamily family, const List &list, uint nbSpaces);
extern QString transformConfigName(const Pic::Data &data, uint wordIndex, const QString &name);
extern QStringList ignoredConfigNames(const Pic::Data &data, uint wordIndex);
extern QStringList extraConfigNames(const Pic::Data &data, uint wordIndex, const Pic::Config::Value &value);
extern QStringList configNames(Pic::ConfigNameType type, const Pic::Memory &memory, uint word, bool &ok);
} // namespace
//-----------------------------------------------------------------------------
namespace GPUtils
{
extern QString toDeviceName(const QString &device);
extern SourceLine::List includeLines(const Device::Data &data);
extern SourceLine::List generateConfigLines(const Pic::Memory &memory, bool &ok);
extern SourceLine::List disassemble(const Pic::Memory &memory);
} // namespace
//-----------------------------------------------------------------------------
namespace Tool
{
class SourceGenerator
{
public:
SourceGenerator() {}
virtual ~SourceGenerator() {}
virtual SourceLine::List configLines(PURL::ToolType type, const Device::Memory &memory, bool &ok) const = 0;
SourceLine::List templateSourceFile(PURL::ToolType type, const Device::Data &data, bool &ok) const;
virtual SourceLine::List sourceFileContent(PURL::ToolType type, const Device::Data &data, bool &ok) const = 0;
virtual SourceLine::List includeLines(PURL::ToolType type, const Device::Data &data) const = 0;
};
} // namespace
#endif

@ -0,0 +1,349 @@
/* Disassemble memory
Copyright (C) 2001, 2002, 2003, 2004, 2005
Craig Franklin
This file is part of gputils.
gputils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
gputils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with gputils; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include <assert.h>
#include "devices/pic/base/pic.h"
#include "coff_object.h"
#include "gpopcode.h"
#define DECODE_ARG0 snprintf(buffer, sizeof_buffer, "%s", instruction->name)
#define DECODE_ARG1(ARG1) snprintf(buffer, sizeof_buffer, "%s\t%#lx", \
instruction->name,\
ARG1)
#define DECODE_ARG1WF(ARG1, ARG2) snprintf(buffer, sizeof_buffer, "%s\t%#lx, %s", \
instruction->name,\
ARG1, \
(ARG2 ? "f" : "w"))
#define DECODE_ARG2(ARG1, ARG2) snprintf(buffer, sizeof_buffer, "%s\t%#lx, %#lx", \
instruction->name,\
ARG1, \
ARG2)
#define DECODE_ARG3(ARG1, ARG2, ARG3) snprintf(buffer, sizeof_buffer, "%s\t%#lx, %#lx, %#lx", \
instruction->name,\
ARG1, \
ARG2, \
ARG3)
bool gp_decode_mnemonics = false;
bool gp_decode_extended = false;
int Coff::disassemble(long int opcode, long int opcode2,
int org,
Pic::Architecture architecture,
char *buffer,
size_t sizeof_buffer)
{
int i;
int value;
struct insn *instruction = NULL;
int num_words = 1;
switch (architecture.type()) {
case Pic::Architecture::P24F:
case Pic::Architecture::P24H:
case Pic::Architecture::P30F:
case Pic::Architecture::P33F:
snprintf(buffer, sizeof_buffer, "--");
return 0;
case Pic::Architecture::P10X:
for(i = 0; i < num_op_12c5xx; i++) {
if((op_12c5xx[i].mask & opcode) == op_12c5xx[i].opcode) {
instruction = &op_12c5xx[i];
break;
}
}
break;
/* case PROC_CLASS_SX:
for(i = 0; i < num_op_sx; i++) {
if((op_sx[i].mask & opcode) == op_sx[i].opcode) {
instruction = &op_sx[i];
break;
}
}
break;
*/
case Pic::Architecture::P16X:
for(i = 0; i < num_op_16cxx; i++) {
if((op_16cxx[i].mask & opcode) == op_16cxx[i].opcode) {
instruction = &op_16cxx[i];
break;
}
}
break;
case Pic::Architecture::P17C:
for(i = 0; i < num_op_17cxx; i++) {
if((op_17cxx[i].mask & opcode) == op_17cxx[i].opcode) {
instruction = &op_17cxx[i];
break;
}
}
break;
case Pic::Architecture::P18C:
case Pic::Architecture::P18F:
case Pic::Architecture::P18J:
if (gp_decode_mnemonics) {
for(i = 0; i < num_op_18cxx_sp; i++) {
if((op_18cxx_sp[i].mask & opcode) == op_18cxx_sp[i].opcode) {
instruction = &op_18cxx_sp[i];
break;
}
}
}
if (instruction == NULL) {
for(i = 0; i < num_op_18cxx; i++) {
if((op_18cxx[i].mask & opcode) == op_18cxx[i].opcode) {
instruction = &op_18cxx[i];
break;
}
}
}
if ((instruction == NULL) && (gp_decode_extended)) {
/* might be from the extended instruction set */
for(i = 0; i < num_op_18cxx_ext; i++) {
if((op_18cxx_ext[i].mask & opcode) == op_18cxx_ext[i].opcode) {
instruction = &op_18cxx_ext[i];
break;
}
}
}
break;
default:
assert(0);
}
if (instruction == NULL) {
snprintf(buffer, sizeof_buffer, "dw\t%#lx ;unknown opcode", opcode);
return num_words;
}
switch (instruction->classType)
{
case INSN_CLASS_LIT3_BANK:
DECODE_ARG1((opcode & 0x7) << 5);
break;
case INSN_CLASS_LIT3_PAGE:
DECODE_ARG1((opcode & 0x7) << 9);
break;
case INSN_CLASS_LIT1:
DECODE_ARG1(opcode & 1);
break;
case INSN_CLASS_LIT4:
DECODE_ARG1(opcode & 0xf);
break;
case INSN_CLASS_LIT4S:
DECODE_ARG1((opcode & 0xf0) >> 4);
break;
case INSN_CLASS_LIT6:
DECODE_ARG1(opcode & 0x3f);
break;
case INSN_CLASS_LIT8:
case INSN_CLASS_LIT8C12:
case INSN_CLASS_LIT8C16:
DECODE_ARG1(opcode & 0xff);
break;
case INSN_CLASS_LIT9:
DECODE_ARG1(opcode & 0x1ff);
break;
case INSN_CLASS_LIT11:
DECODE_ARG1(opcode & 0x7ff);
break;
case INSN_CLASS_LIT13:
DECODE_ARG1(opcode & 0x1fff);
break;
case INSN_CLASS_LITFSR:
DECODE_ARG2(((opcode >> 6) & 0x3), (opcode & 0x3f));
break;
case INSN_CLASS_RBRA8:
value = opcode & 0xff;
/* twos complement number */
if (value & 0x80) {
value = -((value ^ 0xff) + 1);
}
DECODE_ARG1((unsigned long)(org + value + 1) * 2);
break;
case INSN_CLASS_RBRA11:
value = opcode & 0x7ff;
/* twos complement number */
if (value & 0x400) {
value = -((value ^ 0x7ff) + 1);
}
DECODE_ARG1((unsigned long)(org + value + 1) * 2);
break;
case INSN_CLASS_LIT20:
{
long int dest;
num_words = 2;
dest = (opcode2 & 0xfff) << 8;
dest |= opcode & 0xff;
DECODE_ARG1(dest * 2);
}
break;
case INSN_CLASS_CALL20:
{
long int dest;
num_words = 2;
dest = (opcode2 & 0xfff) << 8;
dest |= opcode & 0xff;
snprintf(buffer, sizeof_buffer, "%s\t%#lx, %#lx",
instruction->name,
dest * 2,
(opcode >> 8) & 1);
}
break;
case INSN_CLASS_FLIT12:
{
long int k;
long int file;
num_words = 2;
k = opcode2 & 0xff;
k |= ((opcode & 0xf) << 8);
file = (opcode >> 4) & 0x3;
DECODE_ARG2(file, k);
}
break;
case INSN_CLASS_FF:
{
long int file1;
long int file2;
num_words = 2;
file1 = opcode & 0xfff;
file2 = opcode2 & 0xfff;
DECODE_ARG2(file1, file2);
}
break;
case INSN_CLASS_FP:
DECODE_ARG2((opcode & 0xff), ((opcode >> 8) & 0x1f));
break;
case INSN_CLASS_PF:
DECODE_ARG2(((opcode >> 8) & 0x1f), (opcode & 0xff));
break;
case INSN_CLASS_SF:
{
long int offset;
long int file;
num_words = 2;
offset = opcode & 0x7f;
file = opcode2 & 0xfff;
DECODE_ARG2(offset, file);
}
break;
case INSN_CLASS_SS:
{
long int offset1;
long int offset2;
num_words = 2;
offset1 = opcode & 0x7f;
offset2 = opcode2 & 0x7f;
DECODE_ARG2(offset1, offset2);
}
break;
case INSN_CLASS_OPF5:
DECODE_ARG1(opcode & 0x1f);
break;
case INSN_CLASS_OPWF5:
DECODE_ARG1WF((opcode & 0x1f), ((opcode >> 5) & 1));
break;
case INSN_CLASS_B5:
DECODE_ARG2((opcode & 0x1f), ((opcode >> 5) & 7));
break;
case INSN_CLASS_B8:
DECODE_ARG2((opcode & 0xff), ((opcode >> 8) & 7));
break;
case INSN_CLASS_OPF7:
DECODE_ARG1(opcode & 0x7f);
break;
case INSN_CLASS_OPF8:
DECODE_ARG1(opcode & 0xff);
break;
case INSN_CLASS_OPWF7:
DECODE_ARG1WF((opcode & 0x7f), ((opcode >> 7) & 1));
break;
case INSN_CLASS_OPWF8:
DECODE_ARG1WF((opcode & 0xff), ((opcode >> 8) & 1));
break;
case INSN_CLASS_B7:
DECODE_ARG2((opcode & 0x7f), ((opcode >> 7) & 7));
break;
case INSN_CLASS_OPFA8:
DECODE_ARG2((opcode & 0xff), ((opcode >> 8) & 1));
break;
case INSN_CLASS_BA8:
DECODE_ARG3((opcode & 0xff), ((opcode >> 9) & 7), ((opcode >> 8) & 1));
break;
case INSN_CLASS_OPWFA8:
DECODE_ARG3((opcode & 0xff), ((opcode >> 9) & 1), ((opcode >> 8) & 1));
break;
case INSN_CLASS_IMPLICIT:
DECODE_ARG0;
break;
case INSN_CLASS_TBL:
{
char op[5];
switch(opcode & 0x3)
{
case 0:
strncpy(op, "*", sizeof(op));
break;
case 1:
strncpy(op, "*+", sizeof(op));
break;
case 2:
strncpy(op, "*-", sizeof(op));
break;
case 3:
strncpy(op, "+*", sizeof(op));
break;
default:
assert(0);
}
snprintf(buffer,
sizeof_buffer,
"%s\t%s",
instruction->name,
op);
}
break;
case INSN_CLASS_TBL2:
DECODE_ARG2(((opcode >> 9) & 1), (opcode & 0xff));
break;
case INSN_CLASS_TBL3:
DECODE_ARG3(((opcode >> 9) & 1),
((opcode >> 8) & 1),
(opcode & 0xff));
break;
default:
assert(0);
}
return num_words;
}

@ -0,0 +1,348 @@
/* GNU PIC opcode definitions
Copyright (C) 2001, 2002, 2003, 2004, 2005
Craig Franklin
This file is part of gputils.
gputils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
gputils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with gputils; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#include "gpopcode.h"
/* FIXME: use const struct */
/* PIC 12-bit instruction set */
struct insn op_12c5xx[] = {
{ "addwf", 0xfc0, 0x1c0, INSN_CLASS_OPWF5 },
{ "andlw", 0xf00, 0xe00, INSN_CLASS_LIT8 },
{ "andwf", 0xfc0, 0x140, INSN_CLASS_OPWF5 },
{ "bcf", 0xf00, 0x400, INSN_CLASS_B5 },
{ "bsf", 0xf00, 0x500, INSN_CLASS_B5 },
{ "btfsc", 0xf00, 0x600, INSN_CLASS_B5 },
{ "btfss", 0xf00, 0x700, INSN_CLASS_B5 },
{ "call", 0xf00, 0x900, INSN_CLASS_LIT8C12 },
{ "clrf", 0xfe0, 0x060, INSN_CLASS_OPF5 },
{ "clrw", 0xfff, 0x040, INSN_CLASS_IMPLICIT },
{ "clrwdt", 0xfff, 0x004, INSN_CLASS_IMPLICIT },
{ "comf", 0xfc0, 0x240, INSN_CLASS_OPWF5 },
{ "decf", 0xfc0, 0x0c0, INSN_CLASS_OPWF5 },
{ "decfsz", 0xfc0, 0x2c0, INSN_CLASS_OPWF5 },
{ "goto", 0xe00, 0xa00, INSN_CLASS_LIT9 },
{ "incf", 0xfc0, 0x280, INSN_CLASS_OPWF5 },
{ "incfsz", 0xfc0, 0x3c0, INSN_CLASS_OPWF5 },
{ "iorlw", 0xf00, 0xd00, INSN_CLASS_LIT8 },
{ "iorwf", 0xfc0, 0x100, INSN_CLASS_OPWF5 },
{ "movf", 0xfc0, 0x200, INSN_CLASS_OPWF5 },
{ "movlw", 0xf00, 0xc00, INSN_CLASS_LIT8 },
{ "movwf", 0xfe0, 0x020, INSN_CLASS_OPF5 },
{ "nop", 0xfff, 0x000, INSN_CLASS_IMPLICIT },
{ "option", 0xfff, 0x002, INSN_CLASS_IMPLICIT },
{ "retlw", 0xf00, 0x800, INSN_CLASS_LIT8 },
{ "return", 0xfff, 0x800, INSN_CLASS_IMPLICIT }, /* FIXME: special mnemonic */
{ "rlf", 0xfc0, 0x340, INSN_CLASS_OPWF5 },
{ "rrf", 0xfc0, 0x300, INSN_CLASS_OPWF5 },
{ "sleep", 0xfff, 0x003, INSN_CLASS_IMPLICIT },
{ "subwf", 0xfc0, 0x080, INSN_CLASS_OPWF5 },
{ "swapf", 0xfc0, 0x380, INSN_CLASS_OPWF5 },
{ "tris", 0xff8, 0x000, INSN_CLASS_OPF5 },
{ "xorlw", 0xf00, 0xf00, INSN_CLASS_LIT8 },
{ "xorwf", 0xfc0, 0x180, INSN_CLASS_OPWF5 }
};
const int num_op_12c5xx = TABLE_SIZE(op_12c5xx);
/* Scenix SX has a superset of the PIC 12-bit instruction set */
/*
* It would be nice if there was a more elegant way to do this,
* either by adding a flags field to struct insn, or by allowing a
* processor to have more than one associated table.
*/
struct insn op_sx[] = {
{ "addwf", 0xfc0, 0x1c0, INSN_CLASS_OPWF5 },
{ "andlw", 0xf00, 0xe00, INSN_CLASS_LIT8 },
{ "andwf", 0xfc0, 0x140, INSN_CLASS_OPWF5 },
{ "bank", 0xff8, 0x018, INSN_CLASS_LIT3_BANK }, /* SX only */
{ "bcf", 0xf00, 0x400, INSN_CLASS_B5 },
{ "bsf", 0xf00, 0x500, INSN_CLASS_B5 },
{ "btfsc", 0xf00, 0x600, INSN_CLASS_B5 },
{ "btfss", 0xf00, 0x700, INSN_CLASS_B5 },
{ "call", 0xf00, 0x900, INSN_CLASS_LIT8C12 },
{ "clrf", 0xfe0, 0x060, INSN_CLASS_OPF5 },
{ "clrw", 0xfff, 0x040, INSN_CLASS_IMPLICIT },
{ "clrwdt", 0xfff, 0x004, INSN_CLASS_IMPLICIT },
{ "comf", 0xfc0, 0x240, INSN_CLASS_OPWF5 },
{ "decf", 0xfc0, 0x0c0, INSN_CLASS_OPWF5 },
{ "decfsz", 0xfc0, 0x2c0, INSN_CLASS_OPWF5 },
{ "goto", 0xe00, 0xa00, INSN_CLASS_LIT9 },
{ "incf", 0xfc0, 0x280, INSN_CLASS_OPWF5 },
{ "incfsz", 0xfc0, 0x3c0, INSN_CLASS_OPWF5 },
{ "iorlw", 0xf00, 0xd00, INSN_CLASS_LIT8 },
{ "iorwf", 0xfc0, 0x100, INSN_CLASS_OPWF5 },
{ "iread", 0xfff, 0x041, INSN_CLASS_IMPLICIT }, /* SX only */
{ "mode", 0xff0, 0x050, INSN_CLASS_LIT4 }, /* SX only */
{ "movf", 0xfc0, 0x200, INSN_CLASS_OPWF5 },
{ "movlw", 0xf00, 0xc00, INSN_CLASS_LIT8 },
{ "movmw", 0xfff, 0x042, INSN_CLASS_IMPLICIT }, /* SX only */
{ "movwf", 0xfe0, 0x020, INSN_CLASS_OPF5 },
{ "movwm", 0xfff, 0x043, INSN_CLASS_IMPLICIT }, /* SX only */
{ "nop", 0xfff, 0x000, INSN_CLASS_IMPLICIT },
{ "option", 0xfff, 0x002, INSN_CLASS_IMPLICIT },
{ "page", 0xff8, 0x010, INSN_CLASS_LIT3_PAGE }, /* SX only */
{ "reti", 0xfff, 0x00e, INSN_CLASS_IMPLICIT }, /* SX only */
{ "retiw", 0xfff, 0x00f, INSN_CLASS_IMPLICIT }, /* SX only */
{ "retlw", 0xf00, 0x800, INSN_CLASS_LIT8 },
{ "retp", 0xfff, 0x00d, INSN_CLASS_IMPLICIT }, /* SX only */
{ "return", 0xfff, 0x00c, INSN_CLASS_IMPLICIT }, /* SX only */
{ "rlf", 0xfc0, 0x340, INSN_CLASS_OPWF5 },
{ "rrf", 0xfc0, 0x300, INSN_CLASS_OPWF5 },
{ "sleep", 0xfff, 0x003, INSN_CLASS_IMPLICIT },
{ "subwf", 0xfc0, 0x080, INSN_CLASS_OPWF5 },
{ "swapf", 0xfc0, 0x380, INSN_CLASS_OPWF5 },
{ "tris", 0xff8, 0x000, INSN_CLASS_OPF5 },
{ "xorlw", 0xf00, 0xf00, INSN_CLASS_LIT8 },
{ "xorwf", 0xfc0, 0x180, INSN_CLASS_OPWF5 }
};
const int num_op_sx = TABLE_SIZE(op_sx);
/* PIC 14-bit instruction set */
struct insn op_16cxx[] = {
{ "addlw", 0x3e00, 0x3e00, INSN_CLASS_LIT8 },
{ "addwf", 0x3f00, 0x0700, INSN_CLASS_OPWF7 },
{ "andlw", 0x3f00, 0x3900, INSN_CLASS_LIT8 },
{ "andwf", 0x3f00, 0x0500, INSN_CLASS_OPWF7 },
{ "bcf", 0x3c00, 0x1000, INSN_CLASS_B7 },
{ "bsf", 0x3c00, 0x1400, INSN_CLASS_B7 },
{ "btfsc", 0x3c00, 0x1800, INSN_CLASS_B7 },
{ "btfss", 0x3c00, 0x1c00, INSN_CLASS_B7 },
{ "call", 0x3800, 0x2000, INSN_CLASS_LIT11 },
{ "clrf", 0x3f80, 0x0180, INSN_CLASS_OPF7 },
{ "clrw", 0x3fff, 0x0103, INSN_CLASS_IMPLICIT },
{ "clrwdt", 0x3fff, 0x0064, INSN_CLASS_IMPLICIT },
{ "comf", 0x3f00, 0x0900, INSN_CLASS_OPWF7 },
{ "decf", 0x3f00, 0x0300, INSN_CLASS_OPWF7 },
{ "decfsz", 0x3f00, 0x0b00, INSN_CLASS_OPWF7 },
{ "goto", 0x3800, 0x2800, INSN_CLASS_LIT11 },
{ "incf", 0x3f00, 0x0a00, INSN_CLASS_OPWF7 },
{ "incfsz", 0x3f00, 0x0f00, INSN_CLASS_OPWF7 },
{ "iorlw", 0x3f00, 0x3800, INSN_CLASS_LIT8 },
{ "iorwf", 0x3f00, 0x0400, INSN_CLASS_OPWF7 },
{ "movf", 0x3f00, 0x0800, INSN_CLASS_OPWF7 },
{ "movlw", 0x3c00, 0x3000, INSN_CLASS_LIT8 },
{ "movwf", 0x3f80, 0x0080, INSN_CLASS_OPF7 },
{ "nop", 0x3f9f, 0x0000, INSN_CLASS_IMPLICIT },
{ "option", 0x3fff, 0x0062, INSN_CLASS_IMPLICIT },
{ "retfie", 0x3fff, 0x0009, INSN_CLASS_IMPLICIT },
{ "retlw", 0x3c00, 0x3400, INSN_CLASS_LIT8 },
{ "return", 0x3fff, 0x0008, INSN_CLASS_IMPLICIT },
{ "rlf", 0x3f00, 0x0d00, INSN_CLASS_OPWF7 },
{ "rrf", 0x3f00, 0x0c00, INSN_CLASS_OPWF7 },
{ "sleep", 0x3fff, 0x0063, INSN_CLASS_IMPLICIT },
{ "sublw", 0x3e00, 0x3c00, INSN_CLASS_LIT8 },
{ "subwf", 0x3f00, 0x0200, INSN_CLASS_OPWF7 },
{ "swapf", 0x3f00, 0x0e00, INSN_CLASS_OPWF7 },
{ "tris", 0x3ff8, 0x0060, INSN_CLASS_OPF7 },
{ "xorlw", 0x3f00, 0x3a00, INSN_CLASS_LIT8 },
{ "xorwf", 0x3f00, 0x0600, INSN_CLASS_OPWF7 }
};
const int num_op_16cxx = TABLE_SIZE(op_16cxx);
/* PIC 16-bit instruction set */
struct insn op_17cxx[] = {
{ "addlw", 0xff00, 0xb100, INSN_CLASS_LIT8 },
{ "addwf", 0xfe00, 0x0e00, INSN_CLASS_OPWF8 },
{ "addwfc", 0xfe00, 0x1000, INSN_CLASS_OPWF8 },
{ "andlw", 0xff00, 0xb500, INSN_CLASS_LIT8 },
{ "andwf", 0xfe00, 0x0a00, INSN_CLASS_OPWF8 },
{ "bcf", 0xf800, 0x8800, INSN_CLASS_B8 },
{ "bsf", 0xf800, 0x8000, INSN_CLASS_B8 },
{ "btfsc", 0xf800, 0x9800, INSN_CLASS_B8 },
{ "btfss", 0xf800, 0x9000, INSN_CLASS_B8 },
{ "btg", 0xf800, 0x3800, INSN_CLASS_B8 },
{ "call", 0xe000, 0xe000, INSN_CLASS_LIT13 },
{ "clrf", 0xfe00, 0x2800, INSN_CLASS_OPWF8 },
{ "clrwdt", 0xffff, 0x0004, INSN_CLASS_IMPLICIT },
{ "comf", 0xfe00, 0x1200, INSN_CLASS_OPWF8 },
{ "cpfseq", 0xff00, 0x3100, INSN_CLASS_OPF8 },
{ "cpfsgt", 0xff00, 0x3200, INSN_CLASS_OPF8 },
{ "cpfslt", 0xff00, 0x3000, INSN_CLASS_OPF8 },
{ "daw", 0xfe00, 0x2e00, INSN_CLASS_OPWF8 },
{ "decf", 0xfe00, 0x0600, INSN_CLASS_OPWF8 },
{ "decfsz", 0xfe00, 0x1600, INSN_CLASS_OPWF8 },
{ "dcfsnz", 0xfe00, 0x2600, INSN_CLASS_OPWF8 },
{ "goto", 0xe000, 0xc000, INSN_CLASS_LIT13 },
{ "incf", 0xfe00, 0x1400, INSN_CLASS_OPWF8 },
{ "incfsz", 0xfe00, 0x1e00, INSN_CLASS_OPWF8 },
{ "infsnz", 0xfe00, 0x2400, INSN_CLASS_OPWF8 },
{ "iorlw", 0xff00, 0xb300, INSN_CLASS_LIT8 },
{ "iorwf", 0xfe00, 0x0800, INSN_CLASS_OPWF8 },
{ "lcall", 0xff00, 0xb700, INSN_CLASS_LIT8C16 },
{ "movfp", 0xe000, 0x6000, INSN_CLASS_FP },
{ "movpf", 0xe000, 0x4000, INSN_CLASS_PF },
{ "movlb", 0xff00, 0xb800, INSN_CLASS_LIT8 },
{ "movlr", 0xfe00, 0xba00, INSN_CLASS_LIT4S },
{ "movlw", 0xff00, 0xb000, INSN_CLASS_LIT8 },
{ "movwf", 0xff00, 0x0100, INSN_CLASS_OPF8 },
{ "mullw", 0xff00, 0xbc00, INSN_CLASS_LIT8 },
{ "mulwf", 0xff00, 0x3400, INSN_CLASS_OPF8 },
{ "negw", 0xfe00, 0x2c00, INSN_CLASS_OPWF8 },
{ "nop", 0xffff, 0x0000, INSN_CLASS_IMPLICIT },
{ "retfie", 0xffff, 0x0005, INSN_CLASS_IMPLICIT },
{ "retlw", 0xff00, 0xb600, INSN_CLASS_LIT8 },
{ "return", 0xffff, 0x0002, INSN_CLASS_IMPLICIT },
{ "rlcf", 0xfe00, 0x1a00, INSN_CLASS_OPWF8 },
{ "rlncf", 0xfe00, 0x2200, INSN_CLASS_OPWF8 },
{ "rrcf", 0xfe00, 0x1800, INSN_CLASS_OPWF8 },
{ "rrncf", 0xfe00, 0x2000, INSN_CLASS_OPWF8 },
{ "setf", 0xfe00, 0x2a00, INSN_CLASS_OPWF8 },
{ "sleep", 0xffff, 0x0003, INSN_CLASS_IMPLICIT },
{ "sublw", 0xff00, 0xb200, INSN_CLASS_LIT8 },
{ "subwf", 0xfe00, 0x0400, INSN_CLASS_OPWF8 },
{ "subwfb", 0xfe00, 0x0200, INSN_CLASS_OPWF8 },
{ "swapf", 0xfe00, 0x1c00, INSN_CLASS_OPWF8 },
{ "tablrd", 0xfc00, 0xa800, INSN_CLASS_TBL3 },
{ "tablwt", 0xfc00, 0xac00, INSN_CLASS_TBL3 },
{ "tlrd", 0xfc00, 0xa000, INSN_CLASS_TBL2 },
{ "tlwt", 0xfc00, 0xa400, INSN_CLASS_TBL2 },
{ "tstfsz", 0xff00, 0x3300, INSN_CLASS_OPF8 },
{ "xorlw", 0xff00, 0xb400, INSN_CLASS_LIT8 },
{ "xorwf", 0xfe00, 0x0c00, INSN_CLASS_OPWF8 }
};
const int num_op_17cxx = TABLE_SIZE(op_17cxx);
struct insn op_18cxx[] = {
{ "addlw", 0xff00, 0x0f00, INSN_CLASS_LIT8 },
{ "addwf", 0xfc00, 0x2400, INSN_CLASS_OPWFA8 },
{ "addwfc", 0xfc00, 0x2000, INSN_CLASS_OPWFA8 },
{ "andlw", 0xff00, 0x0b00, INSN_CLASS_LIT8 },
{ "andwf", 0xfc00, 0x1400, INSN_CLASS_OPWFA8 },
{ "bc", 0xff00, 0xe200, INSN_CLASS_RBRA8 },
{ "bcf", 0xf000, 0x9000, INSN_CLASS_BA8 },
{ "bn", 0xff00, 0xe600, INSN_CLASS_RBRA8 },
{ "bnc", 0xff00, 0xe300, INSN_CLASS_RBRA8 },
{ "bnn", 0xff00, 0xe700, INSN_CLASS_RBRA8 },
{ "bnov", 0xff00, 0xe500, INSN_CLASS_RBRA8 },
{ "bnz", 0xff00, 0xe100, INSN_CLASS_RBRA8 },
{ "bov", 0xff00, 0xe400, INSN_CLASS_RBRA8 },
{ "bra", 0xf800, 0xd000, INSN_CLASS_RBRA11 },
{ "bsf", 0xf000, 0x8000, INSN_CLASS_BA8 },
{ "btfsc", 0xf000, 0xb000, INSN_CLASS_BA8 },
{ "btfss", 0xf000, 0xa000, INSN_CLASS_BA8 },
{ "btg", 0xf000, 0x7000, INSN_CLASS_BA8 },
{ "bz", 0xff00, 0xe000, INSN_CLASS_RBRA8 },
{ "call", 0xfe00, 0xec00, INSN_CLASS_CALL20 },
{ "clrf", 0xfe00, 0x6a00, INSN_CLASS_OPFA8 },
{ "clrwdt", 0xffff, 0x0004, INSN_CLASS_IMPLICIT },
{ "comf", 0xfc00, 0x1c00, INSN_CLASS_OPWFA8 },
{ "cpfseq", 0xfe00, 0x6200, INSN_CLASS_OPFA8 },
{ "cpfsgt", 0xfe00, 0x6400, INSN_CLASS_OPFA8 },
{ "cpfslt", 0xfe00, 0x6000, INSN_CLASS_OPFA8 },
{ "daw", 0xffff, 0x0007, INSN_CLASS_IMPLICIT },
{ "decf", 0xfc00, 0x0400, INSN_CLASS_OPWFA8 },
{ "decfsz", 0xfc00, 0x2c00, INSN_CLASS_OPWFA8 },
{ "dcfsnz", 0xfc00, 0x4c00, INSN_CLASS_OPWFA8 },
{ "goto", 0xff00, 0xef00, INSN_CLASS_LIT20 },
{ "incf", 0xfc00, 0x2800, INSN_CLASS_OPWFA8 },
{ "incfsz", 0xfc00, 0x3c00, INSN_CLASS_OPWFA8 },
{ "infsnz", 0xfc00, 0x4800, INSN_CLASS_OPWFA8 },
{ "iorlw", 0xff00, 0x0900, INSN_CLASS_LIT8 },
{ "iorwf", 0xfc00, 0x1000, INSN_CLASS_OPWFA8 },
{ "lfsr", 0xffc0, 0xee00, INSN_CLASS_FLIT12 },
{ "movf", 0xfc00, 0x5000, INSN_CLASS_OPWFA8 },
{ "movff", 0xf000, 0xc000, INSN_CLASS_FF },
{ "movlb", 0xff00, 0x0100, INSN_CLASS_LIT8 },
{ "movlw", 0xff00, 0x0e00, INSN_CLASS_LIT8 },
{ "movwf", 0xfe00, 0x6e00, INSN_CLASS_OPFA8 },
{ "mullw", 0xff00, 0x0d00, INSN_CLASS_LIT8 },
{ "mulwf", 0xfe00, 0x0200, INSN_CLASS_OPFA8 },
{ "negf", 0xfe00, 0x6c00, INSN_CLASS_OPFA8 },
{ "nop", 0xffff, 0x0000, INSN_CLASS_IMPLICIT },
{ "pop", 0xffff, 0x0006, INSN_CLASS_IMPLICIT },
{ "push", 0xffff, 0x0005, INSN_CLASS_IMPLICIT },
{ "rcall", 0xf800, 0xd800, INSN_CLASS_RBRA11 },
{ "reset", 0xffff, 0x00ff, INSN_CLASS_IMPLICIT },
{ "retfie", 0xfffe, 0x0010, INSN_CLASS_LIT1 },
{ "retlw", 0xff00, 0x0c00, INSN_CLASS_LIT8 },
{ "return", 0xfffe, 0x0012, INSN_CLASS_LIT1 },
{ "rlcf", 0xfc00, 0x3400, INSN_CLASS_OPWFA8 },
{ "rlncf", 0xfc00, 0x4400, INSN_CLASS_OPWFA8 },
{ "rrcf", 0xfc00, 0x3000, INSN_CLASS_OPWFA8 },
{ "rrncf", 0xfc00, 0x4000, INSN_CLASS_OPWFA8 },
{ "setf", 0xfe00, 0x6800, INSN_CLASS_OPFA8 },
{ "sleep", 0xffff, 0x0003, INSN_CLASS_IMPLICIT },
{ "subfwb", 0xfc00, 0x5400, INSN_CLASS_OPWFA8 },
{ "sublw", 0xff00, 0x0800, INSN_CLASS_LIT8 },
{ "subwf", 0xfc00, 0x5c00, INSN_CLASS_OPWFA8 },
{ "subwfb", 0xfc00, 0x5800, INSN_CLASS_OPWFA8 },
{ "swapf", 0xfc00, 0x3800, INSN_CLASS_OPWFA8 },
{ "tblrd", 0xfffc, 0x0008, INSN_CLASS_TBL },
{ "tblwt", 0xfffc, 0x000c, INSN_CLASS_TBL },
{ "tstfsz", 0xfe00, 0x6600, INSN_CLASS_OPFA8 },
{ "xorlw", 0xff00, 0x0a00, INSN_CLASS_LIT8 },
{ "xorwf", 0xfc00, 0x1800, INSN_CLASS_OPWFA8 }
};
const int num_op_18cxx = TABLE_SIZE(op_18cxx);
/* PIC 16-bit "Special" instruction set */
struct insn op_18cxx_sp[] = {
{ "clrc", 0xffff, 0x90d8, INSN_CLASS_IMPLICIT },
{ "clrdc", 0xffff, 0x92d8, INSN_CLASS_IMPLICIT },
{ "clrn", 0xffff, 0x98d8, INSN_CLASS_IMPLICIT },
{ "clrov", 0xffff, 0x96d8, INSN_CLASS_IMPLICIT },
{ "clrw", 0xffff, 0x6ae8, INSN_CLASS_IMPLICIT },
{ "clrz", 0xffff, 0x94d8, INSN_CLASS_IMPLICIT },
{ "setc", 0xffff, 0x80d8, INSN_CLASS_IMPLICIT },
{ "setdc", 0xffff, 0x82d8, INSN_CLASS_IMPLICIT },
{ "setn", 0xffff, 0x88d8, INSN_CLASS_IMPLICIT },
{ "setov", 0xffff, 0x86d8, INSN_CLASS_IMPLICIT },
{ "setz", 0xffff, 0x84d8, INSN_CLASS_IMPLICIT },
{ "skpc", 0xffff, 0xa0d8, INSN_CLASS_IMPLICIT },
{ "skpdc", 0xffff, 0xa2d8, INSN_CLASS_IMPLICIT },
{ "skpn", 0xffff, 0xa8d8, INSN_CLASS_IMPLICIT },
{ "skpov", 0xffff, 0xa6d8, INSN_CLASS_IMPLICIT },
{ "skpz", 0xffff, 0xa4d8, INSN_CLASS_IMPLICIT },
{ "skpnc", 0xffff, 0xb0d8, INSN_CLASS_IMPLICIT },
{ "skpndc", 0xffff, 0xb2d8, INSN_CLASS_IMPLICIT },
{ "skpnn", 0xffff, 0xb8d8, INSN_CLASS_IMPLICIT },
{ "skpnov", 0xffff, 0xb6d8, INSN_CLASS_IMPLICIT },
{ "skpnz", 0xffff, 0xb4d8, INSN_CLASS_IMPLICIT },
{ "tgc", 0xffff, 0x70d8, INSN_CLASS_IMPLICIT },
{ "tgdc", 0xffff, 0x72d8, INSN_CLASS_IMPLICIT },
{ "tgn", 0xffff, 0x78d8, INSN_CLASS_IMPLICIT },
{ "tgov", 0xffff, 0x76d8, INSN_CLASS_IMPLICIT },
{ "tgz", 0xffff, 0x74d8, INSN_CLASS_IMPLICIT }
};
const int num_op_18cxx_sp = TABLE_SIZE(op_18cxx_sp);
/* PIC 16-bit Extended instruction set */
struct insn op_18cxx_ext[] = {
{ "addfsr", 0xff00, 0xe800, INSN_CLASS_LITFSR },
{ "addulnk", 0xffc0, 0xe8c0, INSN_CLASS_LIT6 },
{ "callw", 0xffff, 0x0014, INSN_CLASS_IMPLICIT },
{ "movsf", 0xff80, 0xeb00, INSN_CLASS_SF },
{ "movss", 0xff80, 0xeb80, INSN_CLASS_SS },
{ "pushl", 0xff00, 0xea00, INSN_CLASS_LIT8 },
{ "subfsr", 0xff00, 0xe900, INSN_CLASS_LITFSR },
{ "subulnk", 0xffc0, 0xe9c0, INSN_CLASS_LIT6 }
};
const int num_op_18cxx_ext = TABLE_SIZE(op_18cxx_ext);

@ -0,0 +1,107 @@
/* GNU PIC opcode definitions
Copyright (C) 2001, 2002, 2003, 2004, 2005
Craig Franklin
This file is part of gputils.
gputils is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.
gputils is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with gputils; see the file COPYING. If not, write to
the Free Software Foundation, 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA. */
#ifndef __GPOPCODE_H__
#define __GPOPCODE_H__
enum insn_class {
INSN_CLASS_LIT1, /* bit 0 contains a 1 bit literal */
INSN_CLASS_LIT4S, /* Bits 7:4 contain a 4 bit literal, bits 3:0 are unused */
INSN_CLASS_LIT6, /* bits 5:0 contain an 6 bit literal */
INSN_CLASS_LIT8, /* bits 7:0 contain an 8 bit literal */
INSN_CLASS_LIT8C12, /* bits 7:0 contain an 8 bit literal, 12 bit CALL */
INSN_CLASS_LIT8C16, /* bits 7:0 contain an 8 bit literal, 16 bit CALL */
INSN_CLASS_LIT9, /* bits 8:0 contain a 9 bit literal */
INSN_CLASS_LIT11, /* bits 10:0 contain an 11 bit literal */
INSN_CLASS_LIT13, /* bits 12:0 contain an 11 bit literal */
INSN_CLASS_LITFSR, /* bits 5:0 contain an 6 bit literal for fsr 7:6 */
INSN_CLASS_IMPLICIT, /* instruction has no variable bits at all */
INSN_CLASS_OPF5, /* bits 4:0 contain a register address */
INSN_CLASS_OPWF5, /* as above, but bit 5 has a destination flag */
INSN_CLASS_B5, /* as for OPF5, but bits 7:5 have bit number */
INSN_CLASS_OPF7, /* bits 6:0 contain a register address */
INSN_CLASS_OPWF7, /* as above, but bit 7 has destination flag */
INSN_CLASS_B7, /* as for OPF7, but bits 9:7 have bit number */
INSN_CLASS_OPF8, /* bits 7:0 contain a register address */
INSN_CLASS_OPFA8, /* bits 7:0 contain a register address & bit has access flag */
INSN_CLASS_OPWF8, /* as above, but bit 8 has dest flag */
INSN_CLASS_OPWFA8, /* as above, but bit 9 has dest flag & bit 8 has access flag */
INSN_CLASS_B8, /* like OPF7, but bits 9:11 have bit number */
INSN_CLASS_BA8, /* like OPF7, but bits 9:11 have bit number & bit 8 has access flag */
INSN_CLASS_LIT20, /* 20bit lit, bits 7:0 in first word bits 19:8 in second */
INSN_CLASS_CALL20, /* Like LIT20, but bit 8 has fast push flag */
INSN_CLASS_RBRA8, /* Bits 7:0 contain a relative branch address */
INSN_CLASS_RBRA11, /* Bits 10:0 contain a relative branch address */
INSN_CLASS_FLIT12, /* LFSR, 12bit lit loaded into 1 of 4 FSRs */
INSN_CLASS_FF, /* two 12bit file addresses */
INSN_CLASS_FP, /* Bits 7:0 contain a register address, bits 12:8 contains a peripheral address */
INSN_CLASS_PF, /* Bits 7:0 contain a register address, bits 12:8 contains a peripheral address */
INSN_CLASS_SF, /* 7 bit offset added to FSR2, fetched memory placed at 12 bit address */
INSN_CLASS_SS, /* two 7 bit offsets, memory moved using FSR2 */
INSN_CLASS_TBL, /* a table read or write instruction */
INSN_CLASS_TBL2, /* a table read or write instruction.
Bits 7:0 contains a register address; Bit 8 is unused;
Bit 9, table byte select. (0:lower ; 1:upper) */
INSN_CLASS_TBL3, /* a table read or write instruction.
Bits 7:0 contains a register address;
Bit 8, 1 if increment pointer, 0 otherwise;
Bit 9, table byte select. (0:lower ; 1:upper) */
INSN_CLASS_FUNC, /* instruction is an assembler function */
INSN_CLASS_LIT3_BANK, /* SX: bits 3:0 contain a 3 bit literal, shifted 5 bits */
INSN_CLASS_LIT3_PAGE, /* SX: bits 3:0 contain a 3 bit literal, shifted 9 bits */
INSN_CLASS_LIT4 /* SX: bits 3:0 contain a 4 bit literal */
};
struct insn {
const char *name;
long int mask;
long int opcode;
enum insn_class classType;
//int attribs;
};
#define TABLE_SIZE(X) (sizeof(X) / sizeof(X[0]))
extern struct insn op_12c5xx[];
extern const int num_op_12c5xx;
extern struct insn op_sx[];
extern const int num_op_sx;
extern struct insn op_16cxx[];
extern const int num_op_16cxx;
extern struct insn op_17cxx[];
extern const int num_op_17cxx;
extern struct insn op_18cxx[];
extern const int num_op_18cxx;
extern struct insn op_18cxx_sp[];
extern const int num_op_18cxx_sp;
extern struct insn op_18cxx_ext[];
extern const int num_op_18cxx_ext;
#endif

@ -0,0 +1,262 @@
/***************************************************************************
* Copyright (C) 2006 Nicolas Hadacek <hadacek@kde.org> *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
***************************************************************************/
#include "text_coff.h"
#include "common/global/pfile.h"
namespace Coff
{
class CodeData {
public:
QString address, opcode, disasm1, disasm2;
};
class LineData {
public:
QValueVector<CodeData> codes;
QString lineNumber, lineText;
};
class FileData {
public:
PURL::Url url;
bool read;
QValueVector<LineData> lines;
};
}
Coff::TextObject::TextObject(const Device::Data *device, const PURL::Url &url)
: Object(device, url), _initialized(true)
{}