You are viewing a plain text version of this content. The canonical link for it is here.
Posted to c-users@xalan.apache.org by Matthew Hoyt <mh...@ca.ibm.com> on 2003/06/13 16:35:09 UTC

"Sane includes" for Xalan




I am proposing that Xalan follow Xerces, and many other projects, and
restructure to enable proper support for "sane includes".    I am looking
for approval to implement, test and contribute this change to Xalan.

Why?

Currently users have two options if they want to place the Xalan headers in
a standard location (e.g. /usr/local/include)

(A)  Copy the Xalan subdirectories under xml-xalan/c/src to the include
directory.   This has the negative effect of polluting the include
directory, especially since some of the Xalan directories have generic
names (e.g. PlatformSupport).

(B) Create a "xalanc" directory to contains the source subdirectories.
Besides containing the Xalan subdirectories, it also makes user code
clearer.
      E.g:   "#include <xalanc/XPath/XObject.hpp>" versus original
"#include <XPath/XObject.hpp>.
The problem with option (B), is that the Xalan header files do not use this
method,  so when compiling 2 include directives are required.
      E.g:   -I/usr/local/include    -I/usr/local/include/xalanc
To free users from having to specify the second directive, we should
configure the Xalan header files to be aware of the "xalanc" directory.

How?

To do this, I propose we follow Xerces and insert a 'xalanc' directory
between xml-xalan/c/src and its subdirectories in the repository.   The
Makefile and each header file would have to be configured to look in
"#include <xalan/.../....>".

Xerces moved to this structure a couple of years ago.   Murry Cumming who
drove this change in that project. (original post:
http://marc.theaimsgroup.com/?l=xerces-c-dev&m=99442706532719&w=2).
Based on that discussion, her is a summary of the concerns:

* This is not a functional change, but it will bring Xalan in line with
other projects and make it easier to install/use in UNIX-type environments.
* Existing user code does not have to be changed.   Using both include path
options in (B) will allow existing code to compile.   Changing
Makefiles/build scripts to  accmodate this change should be minor, as each
release requires users to change the Xalan library name to link anway.
*  Window's Visual Studio projects need to be updated, as well the
documentation.
*  This change goes needs to be coordinated with the on-going effort to
improve the build/make/install of Xalan.
*  The main drawback is that within CVS, historical information related to
the source files would no longer be directly accessible because the
location of the files in the repository would change.

 I have also posted this message to xalan-dev list.

-Matt.

Matthew Hoyt
IBM Toronto Lab
email: mhoyt@ca.ibm.com
phone: 905 413 3076



Re: "Sane includes" for Xalan

Posted by Berin Lautenbach <be...@ozemail.com.au>.
David/Matthew,

Attached is a bash script and a sed script which will convert the source
and VC++ project files to the new directory structure.  (Not the
makefile though - it's simpler just to edit.)

Would appreciate if you could both cast your eye over them and see if
there is anything I have missed.  I have run this against current CVS
(as at time of sending) and then compiled up (and executed) the
TransformToXerces sample.

The TransformToXerces sample has been compiled under VC6++ and Linux (gcc).

Here is how I propose to transition over :

David - I will need you to nominate a point in time when you are happy
for me to run the script such that there will be no changes made to the
C code until I e-mail back that all is done.  (I need the C part of the
CVS "frozen", otherwise we may lose things as I move the directories.)

Then I will :

1.  update my local copy of xalan against CVS at that point in time.
2.  run the script under Cygwin, compile the projects under the new
structure and run some quick tests under VC++.
3.  upload the changes to cvs.apache.org.  This will require
deleting all the old files from cvs and then importing the new src
structure.
4.  update src on linux machine and modify the makefile to operate
correctly.  (This is simply a matter of adding "xalanc" to the *_SRC 
variables at the top of Makefile.in.)
5.  compile the samples under Linux and validate they appear to work
correctly.
6.  commit linux changes back to CVS.
7.  E-mail to Xalan-dev "unfreezing" the CVS.

I'll then need someone to test the ICU compiles - I don't have an ICU
build setup here.  (Really must set that up.)

Thoughts?  Any suggested date/time?

Cheers,
      Berin



Berin Lautenbach wrote:
> Matthew Hoyt wrote:
> 
>>
>>
>>
>> I am proposing that Xalan follow Xerces, and many other projects, and
>> restructure to enable proper support for "sane includes".    I am looking
>> for approval to implement, test and contribute this change to Xalan.
> 
> 
> For all the reasons you discussed, I have been working on exactly this 
> for the next release.  To me it's the pre-cursor to re-doing the 
> make/configure system.  The problem is more one of logistics than work. 
>  (Although getting free time has been a big problem of late.)
> 
> We also discussed taking a more makefile approach to the problem, and 
> creating the xalanc directory during build time.  This is what is done 
> in the xml-security-c library, but it's a pain in the proverbial because 
> of what it does to VC++.
> 
> Cheers,
>     Berin
> 
> 



Re: "Sane includes" for Xalan

Posted by Berin Lautenbach <be...@ozemail.com.au>.
Matthew Hoyt wrote:
> 
> 
> 
> I am proposing that Xalan follow Xerces, and many other projects, and
> restructure to enable proper support for "sane includes".    I am looking
> for approval to implement, test and contribute this change to Xalan.

For all the reasons you discussed, I have been working on exactly this 
for the next release.  To me it's the pre-cursor to re-doing the 
make/configure system.  The problem is more one of logistics than work. 
  (Although getting free time has been a big problem of late.)

We also discussed taking a more makefile approach to the problem, and 
creating the xalanc directory during build time.  This is what is done 
in the xml-security-c library, but it's a pain in the proverbial because 
of what it does to VC++.

Cheers,
	Berin


Re: "Sane includes" for Xalan

Posted by Berin Lautenbach <be...@ozemail.com.au>.
Matthew Hoyt wrote:
> 
> 
> 
> I am proposing that Xalan follow Xerces, and many other projects, and
> restructure to enable proper support for "sane includes".    I am looking
> for approval to implement, test and contribute this change to Xalan.

For all the reasons you discussed, I have been working on exactly this 
for the next release.  To me it's the pre-cursor to re-doing the 
make/configure system.  The problem is more one of logistics than work. 
  (Although getting free time has been a big problem of late.)

We also discussed taking a more makefile approach to the problem, and 
creating the xalanc directory during build time.  This is what is done 
in the xml-security-c library, but it's a pain in the proverbial because 
of what it does to VC++.

Cheers,
	Berin