Objective-C patches for KDevelop 1.1 in 'KDKOBJC-0.1.tar.gz'

Richard Dale Richard_Dale at tipitina.demon.co.uk
Tue Feb 29 21:40:28 UTC 2000

I've ftp'd 'KDKOBJC-0.1.tar.gz' to the KDevelop incoming directory. It contains
various patches to support Objective-C development with KDevelop 1.1 in the KDE
environment, and six KDevelop projects to cover the GNUstep 0.65 source tree.

-rw-rw-r-- duke/duke      6326 2000-02-29 16:09 README
-rw-rw-r-- duke/duke    196483 2000-02-29 14:58 gdb-4.17-objc-unoff-980505.patch
-rw-rw-r-- duke/duke     17969 2000-02-29 14:14 gnustep.kdevprj
-rw-rw-r-- duke/duke     62165 2000-02-29 14:14 gnustepbase.kdevprj
-rw-rw-r-- duke/duke     94400 2000-02-29 14:14 gnustepgui.kdevprj
-rw-rw-r-- duke/duke     14925 2000-02-29 14:13 gnusteptesting.kdevprj
-rw-rw-r-- duke/duke      7832 2000-02-29 14:14 gnustepxdps.kdevprj
-rw-rw-r-- duke/duke      9598 2000-02-29 14:14 gnustepxgps.kdevprj
-rw-rw-r-- duke/duke     24461 2000-02-29 14:15 kdedoc-1.17objc.patch
-rw-rw-r-- duke/duke     58893 2000-02-29 14:15 kdevelop-1.1objc.patch
-rw-rw-r-- duke/duke      3321 2000-02-29 14:15 kwriteautocopy.patch
-rw-rw-r-- duke/duke      3141 2000-02-29 14:15 kwriteobjc.patch
-rw-rw-r-- duke/duke       111 2000-02-29 14:18 objc.m4
-rw-rw-r-- duke/duke      5668 2000-02-29 14:15 objc.tar.gz
-rw-r--r-- duke/duke       883 2000-02-29 14:17 x-objcsrc.kdelnk               

The text in the 'README' file is included below.

-- Richard


Here are patches to provide Objective-C support for the KDevelop IDE,
the KWrite text editor and the KDoc javadoc-like documentation
extraction tool.

*	kdevelop-1.1objc.patch

*	kwriteobjc.patch
*	kwriteautocopy.patch

*	kdedoc-1.17objc.patch

The '..objc' patches add Objective-C support - syntax highlighting,
class browser, '.m' files as source and so on.

The '..autocopy' patch fixes kwrite's copy and paste behaviour so it
is similar to OPENSTEP or the Mac. Normally, if you just select some
text it automatically copies it to the clipboard (without using the
copy command on the edit menu).

The KDoc patch adds Objective-C parsing, and Objective-C versions of
the @see and @ref directives. eg '@ref -[Array count]' or '@see

I've also included Matthias Klose's gdb patch to enable Objective-C
debugging (please follow the instructions inside the patch for

* gdb-4.17-objc-unoff-980505.patch

I've created six KDevelop projects to cover the entire GNUstep 0.65
source tree (everything under the 'core' directory):

*	./core/Testing/gnusteptesting.kdevprj
*	./core/base/gnustepbase.kdevprj
*	./core/gui/gnustepgui.kdevprj
*	./core/xdps/gnustepxdps.kdevprj
*	./core/xgps/gnustepxgps.kdevprj
*	./core/gnustep.kdevprj

This file is my attempt at defining a KDE mime type for Objective-C.
The kfm file manager can then tell that a '.m' file is an Objective-C

*	x-objcsrc.kdelnk

This file is a Objective-C autoconf file to provide an empty
implementation of the macro 'AC_PROG_OBJC' which was missing
from my version of Linux.It does nothing but print out "check
not implemented yet".

* objc.m4


Follow the intructions on http://www.gnustep.org on how to obtain
the GNUstep source, and install GNUstep 0.65 onto your machine.

Download KDevelop-1.1 from the KDevelop web site at
http://www.kdevelop.org. You will find instructions there on the other
resources needed to install KDevelop. KDoc 1.17 is also on the KDevelop
site (note the patch will not work with KDoc 2.0, so ensure you have the
older version).

KWrite is on the KDE web site (http://www.kde.org) in
kdeutils-1.1.2/kwrite. You don't need to have KWrite to use KDevelop,
but it's handy to have a separate text editor with the same language
syntax highlighting as the IDE.

Copy the six KDevelop projects to the directories in the GNUstep
source code tree as above.

Copy kdevelop-1.1objc.patch and objc.tar.gz to the directory above KDevelop-1.1

	$ cd  kdevelop-1.1
	$ patch -p1 < ../kdevelop-1.1objc.patch
	$ cp ../objc.tar.gz kdevelop/templates
	$ ./configure
	$ make
	$ make install
Copy the KDoc patch to the directory above kdoc
	$ cd kdedoc
	$ patch -p1 < ../kdedoc1.17objc.patch
	$ ./configure
	$ make
	$ make install

Copy kwriteobjc.patch and kwriteautocopy.patch to the directory above

	$ cd kdeutils-1.1.2
	$ ./configure
	$ cd kwrite
	$ patch -p1 < ../kwriteobjc.patch
	$ patch -p1 < ../kwriteautocopy.patch
	$ make
	$ make install

Copy the KDE mime definition file 'x-objcsrc.kdelnk' to

Copy the autoconf file 'objc.m4' to /usr/share/aclocal

Edit /usr/bin/automake (version 1.4a) to fix a bug, change the
following line:

$configure_vars{$1} = $filename . ':' . $.;


$configure_vars{$1} = $filename . ':' . $.;


Start up KDevelop, choose the 'Options->Syntax Highlighting' menu
remove the '*.h' pattern from the C++ syntax highlighting option, then
choose Objective-C syntax highlighting, add a '*.h' pattern. This is
so the editor will assume '.h' files are Objective-C rather than C++.

Open up a GNUstep project, and have fun exploring with the excellent
class browser. Generate the api documentation by using the
'Project->Make API-Doc' menu command to invoke kdoc. Then have some
more fun browsing the HTML documentation. Marvel at the class
hierarchy diagrams from the 'Show graphical class view' menu option.
No protocol inheritance I'm afraid though - the size of the
GNUstep hierarchy with protocols appeared to choke the diagram drawing

For the purposes of browsing, category names are converted into class
names by concatenationg "<class name> '(' <category name> ')'"
together, and considering the category to be a sub-class of <class

You can either create a project which uses existing GNUstep makefiles
as a 'custom project' (such as the six projects covering the GNUstep
source tree). Or you can create a new 'Terminal Objective-C'
type project, and allow KDevelop to use automake to automatically
generate the makesfiles etc. The top level of a 'Terminal Objective-C'
project is a main() f'n containing the line 'NSLog(@"Hello, World!");'

For new projects, I added the following to Project->Compiler options to
pick up the GNUstep headers from my home area:


And I added this to Project->Linker options to pick up the GNUstep libraries
from my home area:


This internal debugger uses gdb. I haven't found any problems in using
a 'patched for Objective-C' gdb version. Stack frames appear with method
calls with square brackets and so on.

The KDevelop patch removes the '-nx' option from the gdb command used by the
internal debugger, so gdb will read '.gdbinit' files on start up. I
set up the following in '$HOME/.gdbinit', to define the environment
variables that the script 'GNUstep.sh' sets up:

set environment LD_LIBRARY_PATH /home/duke/src/gnustep/core/Libraries/powerpc/linux-gnu/gnu-gnu-gnu-xgps
set environment GNUSTEP_ROOT /home/duke/src/gnustep/core
set environment GNUSTEP_PATHPREFIX_LIST /home/duke/src/gnustep/core
set environment GNUSTEP_HOST_CPU powerpc
set environment GNUSTEP_NETWORK_ROOT /home/duke/src/gnustep/core/Network
set environment LIBRARY_COMBO gnu-gnu-gnu-xgps
set environment GNUSTEP_LOCAL_ROOT /home/duke/src/gnustep/core/Local
set environment GNUSTEP_SYSTEM_ROOT /home/duke/src/gnustep/coreduke


Welcome at the email address below..

-- Richard Dale (Richard_Dale at tipitina.demon.co.uk)

More information about the KDevelop-devel mailing list