LJ Archive

CodeWarrior for Red Hat Linux, GNU Edition, Version 4

Jason Kroll

Issue #66, October 1999

Metrowerks is releasing two versions of CodeWarrior for Red Hat Linux (with SuSE releases to follow): the GNU Edition and the Professional Edition. The GNU Edition is the subject for today.

  • Manufacturer: Metrowerks

  • E-mail: sales@metrowerks.com

  • URL: http://metrowerks.com/

  • Price: $99 US

  • Reviewer: Jason Kroll

CodeWarrior is an integrated development environment (IDE) which has existed on several platforms for a number of years and has just recently been made available for Linux. Metrowerks is releasing two versions of CodeWarrior for Red Hat Linux (with SuSE releases to follow): the GNU Edition and the Professional Edition. The GNU Edition is the subject for today.

The IDE

An integrated development environment, as in the case of CodeWarrior, is a graphical environment incorporating the main elements of software development. This includes managing the project, dependencies, libraries, editing code, compiling, debugging, linking and all of the usual coding tasks. It does not include paint programs or other multimedia tools that could be used in software development. Essentially, the idea of the IDE (not to be confused with Integrated Drive Electronics) is to combine all these things under one interface for easy project management. This is a different approach from using Emacs in one virtual console while running gcc in another and editing the Makefile in a third. An IDE will presumably take care of the entire project, and one can easily call up whichever parts of the program need editing and have the computer keep track of changes to the Makefile (or what would be the Makefile). This approach has its advantages and disadvantages.

The Advantage

The principal advantage of the IDE is that it is easy; the program takes care of everything and lets you concentrate exclusively on your code. On machines without the make command, this can be completely wonderful, and even on Linux, many users have wished that someone would port CodeWarrior. Now it is available, and the development environment is basically the same as on other platforms, so migrating from other operating systems (or between, if you must) is even easier.

Because development is such a large part of the Linux movement, people are very sensitive to all sorts of programming issues, including devout preferences for certain keystrokes over others and one editor over another. CodeWarrior is flexible in these areas, allowing (or requiring) third-party products such as editors and debuggers. However, some shortcomings are applicable to the open-source, multi-platform world of GNU/Linux.

Development Issues

One advantage of the CodeWarrior IDE is that it eliminates the complications involved in writing and maintaining a Makefile. Probably the main disadvantage is that it eliminates the advanced functionality and power that go along with the Makefile. This means that on one level, anything you write with CodeWarrior cannot be compiled on non-CodeWarrior systems unless you write your own Makefile to correspond with the CodeWarrior .mpc file (not a difficult task). The other side of this problem is that if you want to use CodeWarrior to hack some typical open-source software, you have to convert the Makefile first. Frankly, this is often quite difficult, and it defeats a large part of the purpose of an IDE—you might do just as well or better with Emacs/vi/joe/pico in one window and a terminal running make in another.

One possible solution would be for Metrowerks to add a Makefile importer and exporter. (Macintosh and Windows versions are said to have a Makefile importer, though I have not had a chance to use it.) If there were an open-source version of this converter for Linux, developers who use CodeWarrior could easily cooperate with those who use other IDEs or the usual combination of Emacs (or vi) and make. A two-way converter may be a mildly difficult undertaking, considering the flexibility of make (with configure) compared to .mpc which is quite specialized. Still, it would be nice. So, although CodeWarrior may make cross-platform development much easier, it may slightly complicate cross-UNIX development. KDE developers in particular may be annoyed that it is difficult to use extended C++ class libraries like Qt. (I had trouble getting KDE programs to compile.)

Serious programmers may find other limitations. For example, third-party products (such as the debugger) are not integrated into the IDE, they are just loaded for you. Also, CodeWarrior does not support the Gnome/KDE drag-and-drop standards (who expects this?), and there seems to be no support for languages outside of C/C++ except as provided by egcs (for example, you can write in assembler). Also, if you would like to use KAI's C++ or any compiler other than gcc/egcs, the GNU Edition of CodeWarrior does not support it—this edition is based exclusively on free development tools. Now that we know what CodeWarrior is not, we can take a look at what CodeWarrior does have to offer.

Installation

Although installing the CodeWarrior IDE is quite simple (./install.sh from the root directory of the CD-ROM), getting a fully functioning system can be a bit complicated and involves some compilation. That is, if you want DDD (DataDisplayDebugger, a graphical front end for several debuggers including gdb), you have to get it from the CD-ROM, and if you want to do C++ development, you have to get egcs-1.1.2 from the CD-ROM, compile and install it (unless you have these things already). Also, you must edit your profile (or make symlinks) so that egcs will be used instead of gcc. Probably anyone fluent enough in Linux to develop projects, which need to be managed and integrated, can also unpack a .tgz file using tar -xzf and run make. Still, these things ought to have automatic installation available—ease of use is supposedly one of the benefits of commercial software. Since CodeWarrior currently exists for only Red Hat 5.2 and 6.0 (with SuSE soon to come), it should not be that difficult to make an easier, automatic installation program.

One element of installation which long-time free software users may find amusing is the license. When you start the install.sh script, you are greeted by several pages' worth of a “licensing agreement” which you must accept or the software won't install. The language is a bit pushy legalese, but somehow it's awfully funny to find something like this on Linux. (After all, who ever reads that stuff when Netscape first starts up?) I don't know if these last-minute licenses are legally binding, although you can supposedly return the software to the dealer and obtain a refund if you disagree. Either way, the software is more useful if you choose to install it.

Look and Feel

Figure 1. CodeWarrior Screenshot

Ideally, an integrated development environment should be a pleasant one. This means users should like the various menus, buttons, windows, bars, other functional interfaces, the debugger and most of all the editor (unless you spend more time in the debugger). CodeWarrior's editor is neat enough; it puts comments, keywords and strings in different colors than the main code, which is nice for some people. (Actually, it would be neat if console editors did this more easily.) In fact, you can customize all sorts of coloration into the editor. It does not, however, automatically parse and produce attractive C code the way Emacs does. Also, scrolling the page with the scroll bar or the PageUp/PageDown keys leaves the cursor where it was, so once you find the correct line, it gets lost when you press a cursor key (you must click with the mouse to get your cursor to the right location). This could be good or bad, depending on whether you tend to scroll through the code and either forget where you began or forget which line you found.

As far as windows and menus are concerned, everything is laid out in logical places and the menu entries are diverse enough to offer a lot of varied functionality, while at the same time there are not more entries than there ought to be. The file menu is straightforward and simple, although the scroll bar does not scroll through files in real time; that is, it updates the screen when you've finished moving the bar. The Search menu has much to offer for searching, the Project menu contains a whole bunch of project-oriented functions (this is where you “make”), the Debug has many apparently permanently ghosted options (the debugger is not integrated with CodeWarrior—only loaded by it), there is a Window menu for dealing with the numerous windows of code, and an Info menu which actually has some configuration options for the IDE. All in all, it's actually fairly easy and obvious to get around and code. People who have never used CodeWarrior before may nevertheless find it familiar, and perhaps somewhat eerie, when the machine knows exactly what to do despite being given somewhat vague instructions.

Application Demo

As a short and clever method for introducing people to the CodeWarrior IDE, Metrowerks has included an Application Tutorial which is a version of GNUGO, edited to include a couple of bugs so that you can learn the debugger. The application tutorial goes through the steps of importing the source-code package into CodeWarrior, editing, compiling and debugging it. One curious quality of the 70-page manual in which these instructions are detailed is that often the details are not exactly correct. Still, it is not difficult to figure out what is actually meant (for example, select “Break at” instead of “Set Breakpoint”).

The “walk-through” is just that, plain and simple, yet adequate to introduce a user to the steps of program development. The learning curve is, well, short. From the moment CodeWarrior booted, I could intuit everything I would need to do. The names of functions are self-explanatory, the software never once crashed or froze (even temporarily), and the only thing that confused me was I had to change permissions on the source directory (chmod 777, actually) before I could get started. Also, I appreciate that Metrowerks chose GNUGO for the demo program because this excellent game is often overlooked.

For Red Hat Linux

At this time, CodeWarrior is available only for Red Hat Linux, which is bound to raise some eyebrows. What would happen to Linux if commercial vendors made their products available only to users of certain distributions? While it is true that distributors sometimes put important files in different places, normal software tends to compile across distributions and across hardware platforms, so it seems that CodeWarrior ought to work with any distribution. It should not be more difficult than making some symlinks or running make, so Metrowerks may have other reasons.

While the reason for choosing Red Hat seems clear (largest market share in the U.S.), the decision to support only one vendor was quite strange and seemed a bit scandalous. I hope no one switches distributions just for the ability to run CodeWarrior. However, the news on this front is that SuSE and Metrowerks have announced that they intend to produce and market CodeWarrior for SuSE. While it remains a mystery why CodeWarrior is so distribution-specific, the speculation is that Metrowerks cannot give tech support to so many distributions, and relies on the distributors to do so. It would be strange for a distributor to support someone else's product, and it is better to have an unsupported product than no product at all, but this may be the situation. Smaller distributors are at a disadvantage, so hopefully this practice will be abandoned before it becomes widespread.

Prognosis

Many people have been waiting for years to see CodeWarrior show up for Linux, and for these people and anyone who likes integrated development environments in general (very popular on Windows), this resembles what they have been wanting. In terms of functionality, it is not yet entirely comparable to CodeWarrior for Macintosh or Windows, and limitations to the GNU Edition are present. However, many coders are excited to find out what future releases and the Professional Edition will have in store. You may also want to take a look at the open-source Code Crusader and Cygnus Code Fusion. Software development firms could become especially fond of an IDE like CodeWarrior, and if this problem of Makefile vs .mpc is resolved, it will become a viable option for individual, at-home developers who want to contribute to the GNU/Linux world of open-source software.

In any event, we can hope that CodeWarrior's presence on our platform will make programming easier, thereby inspiring more programmers. The world of GNU/Linux is extremely different from that of Macintosh and Windows, and CodeWarrior will need to make many adaptations to be successful. Hopefully, this product is first in a line of efforts to bring the immensely popular CodeWarrior IDE to Linux.

Jason Kroll still thinks GNU/Linux is the best thing to happen to computers since monitors. He can be reached at info@linuxjournal.com.

LJ Archive