The webseite at the following link gives an explanation on how to build a definition for 3.2.5
How to build a JBOSS 3.2.5 Server Definition for Eclipse Web Tools Platform
If you want a definition for 4.0.x, you can just follow the document - it is quite detailed.
I have also provided a org.eclipse.jst.server.generic.serverdefinitions_1.0.0.zip that contains a definition for 4.0.3sp1 as well.
Don't forget to run eclipse -clean or you won't see the fruit of your work.
The config is still not yet complete. There are a few libraries missing that are needed for starting the server from within eclipse.
When those are included, there is still a problem with parsing of login-config.xml
org.jboss.security.auth.login.ParseException: Encountered "Was expecting one of:
As the server starts nicely standalone, this seems to be a eclipse related problem.