Re: scons-msvc adventure

2006-06-02 Thread Bo Peng

I agree with Angus that, even if this glob think is easier to maintain
than the explicit file listing, it's easy to have some temporary .C
files in there. So I would say that this is error prone.

That said, it is just a matter of education... if I know that I should
not put temporary files in there then I will not.


I agree as well, but there are always tradeoffs.

1. Listing filenames once is OK, but multiple times? No. I will need
to put filenames in the MSVCproject function, and I am not in
particular fond of putting filelist globally (namely a huge block of
filenames at the beginning of SConscript. ).

2. It is a bit too early to say that but this will allow me to apply
the scons system to lyx1.4 with minimal changes.

3. Side affects are usually easy to avoid. For example, you can copy
the old copy to file.old, not file_old.C.

Anyway, it is easy to switch back. Let us first focus on the
MSVCproject issue, if msvc compiles all right.

Bo


Re: scons-msvc adventure

2006-06-02 Thread Bo Peng

I got this error:

Warning: Can not locate any spell checker
Checking for the number of args for mkdir... one
Checking for arg types for select... yes
IOError: [Errno 2] No such file or directory: '.\\src\\config.h':
  File "C:\sandbox\lyx\lyx-devel\development\scons\SConstruct", line 1067:
utils.endConfigH(TOP_SRC_DIR)
  File "C:\sandbox\lyx\lyx-devel\development\scons\scons_utils.py", line 138:
writeToFile(os.path.join(top_src_dir, config_h), config_content +
  File "C:\sandbox\lyx\lyx-devel\development\scons\scons_utils.py", line 26:
file = open(filename, 'w')


That is strange.  .\\src\\config.h seems to be the right path for
config.h if you are running from the top level directory. What will
happen if you manually run the following?

python
open(os.path.join('.', 'src', 'config.h'), 'w')

Bo


Re: scons-msvc adventure

2006-06-02 Thread Bo Peng

| Anyway, many people prefer to list source files explicitly. If you are
| one of them, you still get a chance to persuade me.

Not all files in a folder is part of a build.
(not even all source files...)



I know, that is why I have to have include and exclude options for the
globSource function.

Bo


Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-02 Thread younes . a
Quoting Bo Peng <[EMAIL PROTECTED]>:

> > No AFAIK, this is a MSVC2005 feature.
> > > I am
> > > worried about the existence of QtXXX.dll.manifest. qt-mt.dll.manifest
> > > for all the Q../Free qt3/qt4 compiled with msvc2003/2005.
> > mscv2003 will not generate a manifest, I guess.
>
> You mean if I used my old 2003 cd, I would be free of these trouble
> (and be happier)?

You will be happier but think about all the people who cannot buy msvc2003. Or
is there a free version also?

> It is not a good news that I have to handle msvc2003/2005 differently.

Yes.

> Has anyone tested msvc2003? Otherwise, the vc patch will be delayed
> since I will have to test msvc2003 myself.

Why don't we just focus on msvc2005?

Abdel.


Re: scons-msvc adventure

2006-06-02 Thread Abdelrazak Younes

Bo Peng wrote:

Please test the attached patch. msvc2005 works here, with intl support.

There is one BIG change. namely, I am trying to use the glob module to
find source files, instead of listing all filenames. The performance
penalty should not be noticable. This change will allow me to add
source files to the msvcproject function easier, and it should allow
me to build lyx1.4.x with minimal changes to the scons system.

Anyway, many people prefer to list source files explicitly. If you are
one of them, you still get a chance to persuade me.


I agree with Angus that, even if this glob think is easier to maintain 
than the explicit file listing, it's easy to have some temporary .C 
files in there. So I would say that this is error prone.


That said, it is just a matter of education... if I know that I should 
not put temporary files in there then I will not.


Abdel.



Re: scons-msvc adventure

2006-06-02 Thread Angus Leeming

Bo Peng wrote:

Please test the attached patch. msvc2005 works here, with intl support.

There is one BIG change. namely, I am trying to use the glob module to
find source files, instead of listing all filenames. The performance
penalty should not be noticable. This change will allow me to add
source files to the msvcproject function easier, and it should allow
me to build lyx1.4.x with minimal changes to the scons system.

Anyway, many people prefer to list source files explicitly. If you are
one of them, you still get a chance to persuade me.


glob may make your life easier now, but in the long run it will make the 
project more maintainable if you list files explicitly.


Think what happens if I'm hacking the sources and have multiple foo_try1.C, 
foo_try2.C, ... files lying around.


Angus



Re: scons-msvc adventure

2006-06-02 Thread Peter Kümmel
Peter Kümmel wrote:
> Bo Peng wrote:
>> Please test the attached patch. msvc2005 works here, with intl support.
> 
> Great! On XP with correctly generated manifest files?
> 
> I'll test it.

I got this error:

Warning: Can not locate any spell checker
Checking for the number of args for mkdir... one
Checking for arg types for select... yes
IOError: [Errno 2] No such file or directory: '.\\src\\config.h':
  File "C:\sandbox\lyx\lyx-devel\development\scons\SConstruct", line 1067:
utils.endConfigH(TOP_SRC_DIR)
  File "C:\sandbox\lyx\lyx-devel\development\scons\scons_utils.py", line 138:
writeToFile(os.path.join(top_src_dir, config_h), config_content +
  File "C:\sandbox\lyx\lyx-devel\development\scons\scons_utils.py", line 26:
file = open(filename, 'w')


Re: scons-msvc adventure

2006-06-02 Thread Lars Gullik Bjønnes
"Bo Peng" <[EMAIL PROTECTED]> writes:

| Please test the attached patch. msvc2005 works here, with intl support.
| 
| There is one BIG change. namely, I am trying to use the glob module to
| find source files, instead of listing all filenames. The performance
| penalty should not be noticable. This change will allow me to add
| source files to the msvcproject function easier, and it should allow
| me to build lyx1.4.x with minimal changes to the scons system.
| 
| Anyway, many people prefer to list source files explicitly. If you are
| one of them, you still get a chance to persuade me.

Not all files in a folder is part of a build.
(not even all source files...)

-- 
Lgb



Re: scons-msvc adventure

2006-06-02 Thread Peter Kümmel
Bo Peng wrote:
> Please test the attached patch. msvc2005 works here, with intl support.

Great! On XP with correctly generated manifest files?

I'll test it.


> There is one BIG change. namely, I am trying to use the glob module to
> find source files, instead of listing all filenames. The performance
> penalty should not be noticable. This change will allow me to add
> source files to the msvcproject function easier, and it should allow
> me to build lyx1.4.x with minimal changes to the scons system.
> 
> Anyway, many people prefer to list source files explicitly. If you are
> one of them, you still get a chance to persuade me.
> 
> Cheers,
> Bo



Re: scons-msvc adventure

2006-06-01 Thread Bo Peng

Please test the attached patch. msvc2005 works here, with intl support.

There is one BIG change. namely, I am trying to use the glob module to
find source files, instead of listing all filenames. The performance
penalty should not be noticable. This change will allow me to add
source files to the msvcproject function easier, and it should allow
me to build lyx1.4.x with minimal changes to the scons system.

Anyway, many people prefer to list source files explicitly. If you are
one of them, you still get a chance to persuade me.

Cheers,
Bo
Index: development/scons/SConscript
===
--- development/scons/SConscript	(revision 13980)
+++ development/scons/SConscript	(working copy)
@@ -9,6 +9,8 @@
 # Full author contact details are available in file CREDITS.
 
 import os, sys
+sys.path.append('config')
+from scons_utils import globSource
 
 Import('env')
 
@@ -28,6 +30,7 @@
 build_po = 'po' in targets or 'install' in targets or 'all' in targets
 build_qt3 = (build_lyx and env['frontend'] == 'qt3') or 'qt3' in targets
 build_qt4 = (build_lyx and env['frontend'] == 'qt4') or 'qt4' in targets
+build_msvc_projects = env['USE_VC'] and 'msvc_projects' in targets
 
 
 # now, if rebuild_targets is specified, do not rebuild some targets
@@ -80,53 +83,32 @@
 
   filesystem = boostenv.StaticLibrary(
 target = '$LOCALLIBPATH/included_boost_filesystem',
-source = ["$BUILDDIR/boost/filesystem/src/%s" % x for x in Split('''
-  convenience.cpp
-  exception.cpp
-  operations_posix_windows.cpp
-  path_posix_windows.cpp
-''')]
+source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/filesystem/src'), 
+  pattern = '*.cpp', build_dir = '$BUILDDIR/boost/filesystem/src')
   )
 
   print 'Processing files in boost/libs/regex/src...'
 
   regex = boostenv.StaticLibrary(
 target = '$LOCALLIBPATH/included_boost_regex',
-source = ["$BUILDDIR/boost/regex/src/%s" % x for x in Split('''
-  cpp_regex_traits.cpp
-  c_regex_traits.cpp
-  cregex.cpp
-  fileiter.cpp
-  instances.cpp
-  regex.cpp
-  regex_raw_buffer.cpp
-  regex_traits_defaults.cpp
-  w32_regex_traits.cpp
-''')]
+source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/regex/src'), pattern = '*.cpp',
+  build_dir = '$BUILDDIR/boost/regex/src')
   )
 
   print 'Processing files in boost/libs/signals/src...'
 
   signals = boostenv.StaticLibrary(
 target = '$LOCALLIBPATH/included_boost_signals',
-source = ["$BUILDDIR/boost/signals/src/%s" % x for x in Split('''
-  connection.cpp
-  named_slot_map.cpp
-  signal_base.cpp
-  slot.cpp
-  trackable.cpp
-''')]
+source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/signals/src'), pattern = '*.cpp',
+  build_dir = '$BUILDDIR/boost/signals/src')
   )
 
   print 'Processing files in boost/libs/iostreams/src...'
 
   iostreams = boostenv.StaticLibrary(
 target = '$LOCALLIBPATH/included_boost_iostreams',
-source = ["$BUILDDIR/boost/iostreams/src/%s" % x for x in Split('''
-  file_descriptor.cpp
-  mapped_file.cpp
-  zlib.cpp
-''') ]
+source = globSource(dir = env.subst('$TOP_SRC_DIR/boost/libs/iostreams/src'), pattern = '*.cpp',
+  build_dir = '$BUILDDIR/boost/iostreams/src')
   )
   Alias('boost', filesystem)
   Alias('boost', regex)
@@ -145,7 +127,7 @@
   intlenv = env.Copy()
   # we need the original C compiler for these files
   intlenv['CC'] = intlenv['C_COMPILER']
-  intlenv['CCFLAGS'] = intlenv['C_CCFLAGS'].split()
+  intlenv['CCFLAGS'] = intlenv['C_CCFLAGS']
   intlenv['CPPPATH'] += ['intl']
   
   intlenv.Append(CCFLAGS = [
@@ -172,32 +154,9 @@
   intl = intlenv.StaticLibrary(
 target = '$LOCALLIBPATH/included_intl',
 LIBS = ['c'],
-source = ["$BUILDDIR/intl/%s" % x for x in Split('''
-  bindtextdom.c
-  dcgettext.c
-  dgettext.c
-  gettext.c
-  finddomain.c
-  loadmsgcat.c
-  localealias.c
-  textdomain.c
-  l10nflist.c
-  explodename.c
-  dcigettext.c
-  dcngettext.c
-  dngettext.c
-  ngettext.c
-  plural.c
-  plural-exp.c
-  localcharset.c
-  relocatable.c
-  localename.c
-  log.c
-  printf.c
-  osdep.c
-  os2compat.c
-  intl-compat.c
-''')]
+source = globSource(dir = env.subst('$TOP_SRC_DIR/intl'), pattern = '*.c',
+  exclude = ['vasnprintf.c', 'printf-parse.c', 'printf-args.c', 'os2compat.c'],
+  build_dir = '$BUILDDIR/intl')
   )
   Alias('intl', intl)
 
@@ -217,36 +176,9 @@
 
   supports = env.StaticLibrary(
 target = '$LOCALLIBPATH/supports',
-source = ['$BUILDDIR/common/support/%s' % x for x in Split('''
-  FileMonitor.C
-  abort.C
-  chdir.C
-  convert.C
-  copy.C
-  environment.C
-  filefilterlist.C
-  filename.C
-  filetools.C
-  forkedcall.C
-  forkedcallqueue.C
-  forkedcontr.C
-  fs_extras.C
-  g

Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Bo Peng

No AFAIK, this is a MSVC2005 feature.
> I am
> worried about the existence of QtXXX.dll.manifest. qt-mt.dll.manifest
> for all the Q../Free qt3/qt4 compiled with msvc2003/2005.
mscv2003 will not generate a manifest, I guess.


You mean if I used my old 2003 cd, I would be free of these trouble
(and be happier)?

It is not a good news that I have to handle msvc2003/2005 differently.
Has anyone tested msvc2003? Otherwise, the vc patch will be delayed
since I will have to test msvc2003 myself.

Bo


Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Abdelrazak Younes

Bo Peng wrote:

mt.exe /manifest lyx.exe.manifest /outputresource:lyx.exe;1


This lyx.exe.manifest is *not* the menifest generated from link
/MANIFEST, rather a copy of libGui4.dll.manifest, right?

Right.

I would like
to add to the scons system things like

mt.exe /manigest:/path/to/qt/lib/libQtGui4.dll.manifest /out

will this work?

Yes, I think so.

Also, does msvc2003 use this manifest system?

No AFAIK, this is a MSVC2005 feature.

I am
worried about the existence of QtXXX.dll.manifest. qt-mt.dll.manifest
for all the Q../Free qt3/qt4 compiled with msvc2003/2005.

mscv2003 will not generate a manifest, I guess.

Abdel.



Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Bo Peng

mt.exe /manifest lyx.exe.manifest /outputresource:lyx.exe;1


This lyx.exe.manifest is *not* the menifest generated from link
/MANIFEST, rather a copy of libGui4.dll.manifest, right? I would like
to add to the scons system things like

mt.exe /manigest:/path/to/qt/lib/libQtGui4.dll.manifest /out

will this work? Also, does msvc2003 use this manifest system? I am
worried about the existence of QtXXX.dll.manifest. qt-mt.dll.manifest
for all the Q../Free qt3/qt4 compiled with msvc2003/2005.

Cheers,
Bo


Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Abdelrazak Younes

Abdelrazak Younes wrote:

Bo Peng wrote:

That is really great.

I do not have access to the windows system right now, could you check
for me if designer.exe.manifest is the same as QtGui4.dll.manifest?


Yes they are identical. Note that QtGui4.dll.manifest was in the lib 
subdir whereas designer.exe.manifest is in the bin/ subdir along 
designer.exe.



Logically speaking, we should use that one.



Also, have your tried to embed the manifest file to lyx.exe? Which
commands did you use?


Note this one, I'll try again tomorrow.


I have tried finally and it works with the following command:

mt.exe /manifest lyx.exe.manifest /outputresource:lyx.exe;1

After that, lyx.exe will start correctly without having the 
lyx.exe.manifest file alongside to it.


Abdel.



Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Abdelrazak Younes

Bo Peng wrote:

Also, if possible, please also test a few optimization options through
CCFLAGS. I plan to put some of them in.


There is a recent error with  MSVC support:

AttributeError: 'NoneType' object has no attribute 'split':
 File "SConstruct", line 401:
   env.Tool('msvc')
 File "D:\program\Python24\scons-0.96.92\SCons\Environment.py", line 1108:
   tool(self)
 File "D:\program\Python24\scons-0.96.92\SCons\Tool\__init__.py", line 135:
   apply(self.generate, ( env, ) + args, kw)
 File "D:\program\Python24\scons-0.96.92\SCons\Tool\msvc.py", line 728:
   env.PrependENVPath('INCLUDE', include_path)
 File "D:\program\Python24\scons-0.96.92\SCons\Environment.py", line 1022:
   nv = SCons.Util.PrependPath(orig, newpath, sep)
 File "D:\program\Python24\scons-0.96.92\SCons\Util.py", line 672:
   paths = string.split(paths, sep)
 File "D:\program\Python24\lib\string.py", line 292:
   return s.split(sep, maxsplit)

Abdel.



Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Abdelrazak Younes

Bo Peng wrote:

That is really great.

I do not have access to the windows system right now, could you check
for me if designer.exe.manifest is the same as QtGui4.dll.manifest?


Yes they are identical. Note that QtGui4.dll.manifest was in the lib 
subdir whereas designer.exe.manifest is in the bin/ subdir along 
designer.exe.



Logically speaking, we should use that one.



Also, have your tried to embed the manifest file to lyx.exe? Which
commands did you use?


Note this one, I'll try again tomorrow.


 Also, if you move the lyx.exe or qtgui4.dll, or
msvcrt.dll to another place, will lyx.exe still start?


The way I see it, there's two solutions:
1) distribute lyx.exe.manifest alongside lyx.exe (the manifest must be 
the exact same name as the exe).

2) attach the manifest into the exe with the mt tool:

mt.exe /manifest lyx.exe.manifest /output...

Warning: Don't use '-' but '/'!!!

The Qt libraries should be distributed with the exe. For the libraries 
MSVC  libraires there are two solutions:


1) Install them with the MS distributable tools
2) put them alongside lyx.exe together with a specially tailored 
Microsoft.VC80.CRT.manifest file.




Thank you very much for figuring this out. I have kind of lost my
patience on this issue.


I was close to loose mine also. Bloody Microsoft.

Abdel.



Cheers,
Bo





Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Bo Peng

Also, if possible, please also test a few optimization options through
CCFLAGS. I plan to put some of them in.

Bo


Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Bo Peng

That is really great.

I do not have access to the windows system right now, could you check
for me if designer.exe.manifest is the same as QtGui4.dll.manifest?
Logically speaking, we should use that one.

Also, have your tried to embed the manifest file to lyx.exe? Which
commands did you use?  Also, if you move the lyx.exe or qtgui4.dll, or
msvcrt.dll to another place, will lyx.exe still start?

Thank you very much for figuring this out. I have kind of lost my
patience on this issue.

Cheers,
Bo


Re: scons-msvc adventure

2006-06-01 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Peter Kümmel wrote:
> People, please don't start an endless
> discussion about this. It's Peter choice to work on that and anybody is
> free to ignore it.

But it is also ok to me to wait and see what happens with the
scons-msvc-project support, just now where a solution to
the manifest problem is in sight.

Peter



Re: scons-msvc adventure

2006-06-01 Thread Abdelrazak Younes

Peter Kümmel wrote:

OK, when there are no objections, I would like to see my files in svn. :)
  


Very good.


Is it required that you copy the CMakeList all other the tree or could
they just reside in trunk/development/cmake/?



This is the current status, but I could change it.
  


IMHO, it would be better yes. People, please don't start an endless 
discussion about this. It's Peter choice to work on that and anybody is 
free to ignore it.



If you agree with that then I can put it in for you. Then you should
probably ask SVN trunk read/write access to Lars.



Thanks Abdel, but the cmake files are now outdated and I would like
to change the build process to avoid the copying of files.

I will ask Lars for the svn access.
  

Fine for me.

Abdel.



Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Abdelrazak Younes

Peter Kümmel wrote:

Abdelrazak Younes wrote:

I have done it!
It was so bloody simple that I can't understand why it didn't come to us
earlier.
I just took designer.exe.manifest and renamed it to lyx.exe.manifest
and, oh miracle, lyx starts!!!

manifest file to put along lyx.exe attached.

Abdel.



Congratulation, sometimes the solution is so simple that one couldn't believe 
it.


:-)


And what is the difference to the manifest files generated by the scons build 
process?


The manifest file of designer contains the version information of the 
Microsoft.VC80.CRT libraries. The scons generated file (not really scons 
but link.exe) did not:






Abdel.



Re: MANIFEST PROBLEM SOLVED!!! (was Re: scons-msvc adventure)

2006-06-01 Thread Peter Kümmel
Abdelrazak Younes wrote:
> I have done it!
> It was so bloody simple that I can't understand why it didn't come to us
> earlier.
> I just took designer.exe.manifest and renamed it to lyx.exe.manifest
> and, oh miracle, lyx starts!!!
> 
> manifest file to put along lyx.exe attached.
> 
> Abdel.
> 

Congratulation, sometimes the solution is so simple that one couldn't believe 
it.

And what is the difference to the manifest files generated by the scons build 
process?

Peter


Re: scons-msvc adventure

2006-06-01 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Peter Kümmel wrote:
>> They use cmake. ;)
>>   
> Man, if you are serious about maintaining cmake, Lars didn't object to
> put it in svn along scons provided it does not pollute the rest of the
> tree (the same as scons):
> 
> * files only in trunk/development/cmake/ *
> 

OK, when there are no objections, I would like to see my files in svn. :)

> Is it required that you copy the CMakeList all other the tree or could
> they just reside in trunk/development/cmake/?
> 

This is the current status, but I could change it.


> If you agree with that then I can put it in for you. Then you should
> probably ask SVN trunk read/write access to Lars.
> 
> Abdel.
> 

Thanks Abdel, but the cmake files are now outdated and I would like
to change the build process to avoid the copying of files.

I will ask Lars for the svn access.

Peter


Re: scons-msvc adventure

2006-06-01 Thread Abdelrazak Younes

Peter Kümmel wrote:

They use cmake. ;)
  
Man, if you are serious about maintaining cmake, Lars didn't object to 
put it in svn along scons provided it does not pollute the rest of the 
tree (the same as scons):


* files only in trunk/development/cmake/ *

Is it required that you copy the CMakeList all other the tree or could 
they just reside in trunk/development/cmake/?


If you agree with that then I can put it in for you. Then you should 
probably ask SVN trunk read/write access to Lars.


Abdel.




Re: scons-msvc adventure

2006-06-01 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Peter Kümmel wrote:
>> Abdelrazak Younes wrote:
>>  
 I just submitted a patch with two minor scons bug fixes and some
 changes to the msvc build. It now requires official zlib package and
 link to zdll.lib,  you will have to adjust it by yourself if you still
 want to use mingw/zlib.
   
>>> Where is this official package?
>>> 
>>
>> Maybe the dll package from zlib.net?
>> http://www.zlib.net/zlib123-dll.zip
>>   
> 
> Ah Thanks!
>> Manifest:
>> A other idea I had is to have a look at the makefiles of qmake
>> (qt4/qmake/Makefile.win32-msvc2005) because I'm sure qmake works on XP.
>>   
> Yes and qmake generates manifest files for all the included demos and
> tools. By the way, if KDE4 developers use MSVC2005 how come they did not
> have this problem or did they?
> 

They use cmake. ;)

>> Commits:
>> Is [EMAIL PROTECTED] still the correct address to get informed
>> about commits (it's now svn)?
>>   
> Yes.
> 
>> And it is possible to get not only the commit message but also a diff?
>>   
> 
> Not yet apparently but I have been told it will come then the web
> interface is ready.
> 

So I have to wait 

> Abdel.
> 
> 



Re: scons-msvc adventure

2006-06-01 Thread Abdelrazak Younes

Peter Kümmel wrote:

Abdelrazak Younes wrote:
  

I just submitted a patch with two minor scons bug fixes and some
changes to the msvc build. It now requires official zlib package and
link to zdll.lib,  you will have to adjust it by yourself if you still
want to use mingw/zlib.
  

Where is this official package?



Maybe the dll package from zlib.net?
http://www.zlib.net/zlib123-dll.zip
  


Ah Thanks!

Manifest:
A other idea I had is to have a look at the makefiles of qmake
(qt4/qmake/Makefile.win32-msvc2005) because I'm sure qmake works on XP.
  
Yes and qmake generates manifest files for all the included demos and 
tools. By the way, if KDE4 developers use MSVC2005 how come they did not 
have this problem or did they?



Commits:
Is [EMAIL PROTECTED] still the correct address to get informed
about commits (it's now svn)?
  

Yes.


And it is possible to get not only the commit message but also a diff?
  


Not yet apparently but I have been told it will come then the web 
interface is ready.


Abdel.



Re: scons-msvc adventure

2006-06-01 Thread Peter Kümmel
Abdelrazak Younes wrote:
>> I just submitted a patch with two minor scons bug fixes and some
>> changes to the msvc build. It now requires official zlib package and
>> link to zdll.lib,  you will have to adjust it by yourself if you still
>> want to use mingw/zlib.
> 
> Where is this official package?

Maybe the dll package from zlib.net?
http://www.zlib.net/zlib123-dll.zip

Manifest:
A other idea I had is to have a look at the makefiles of qmake
(qt4/qmake/Makefile.win32-msvc2005) because I'm sure qmake works on XP.

Commits:
Is [EMAIL PROTECTED] still the correct address to get informed
about commits (it's now svn)?
And it is possible to get not only the commit message but also a diff?

Peter


Re: scons-msvc adventure

2006-06-01 Thread Abdelrazak Younes

Bo Peng wrote:

Hi,

I just submitted a patch with two minor scons bug fixes and some
changes to the msvc build. It now requires official zlib package and
link to zdll.lib,  you will have to adjust it by yourself if you still
want to use mingw/zlib.


Where is this official package?

Abdel.



Re: scons-msvc adventure

2006-05-31 Thread Bo Peng

Hi,

I just submitted a patch with two minor scons bug fixes and some
changes to the msvc build. It now requires official zlib package and
link to zdll.lib,  you will have to adjust it by yourself if you still
want to use mingw/zlib.

The reason why I use the official one is that the header file can be
included without problem. Linking is also fine, except, of course the
manifest problem.

Bo


Re: scons-msvc adventure

2006-05-31 Thread Abdelrazak Younes

Peter Kümmel wrote:

Abdelrazak Younes wrote:

Bo Peng wrote:

So you do not have any of Abdel's manifest problem, just by using
patched mingw zlib?

Just for clarification I have the same fix to zlib in my tree and still
have the problem. I think it's related to the MSxxx.dll that you are
using. I have tried some libraries download from the internet and the
the libraries found in my local WINDOWS directory. The first ones
complains about some _decode_pointer funtion; the second set complains
about missing manifests.

Peter could you tell me which libraries you are using? Could you send it
to me privately?


Did you get my private mail, or is it lost in your spam filter?


I got it but there was no attachment to it ;-)

Abdel.



Re: scons-msvc adventure

2006-05-31 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Bo Peng wrote:
>>
>> So you do not have any of Abdel's manifest problem, just by using
>> patched mingw zlib?
> 
> Just for clarification I have the same fix to zlib in my tree and still
> have the problem. I think it's related to the MSxxx.dll that you are
> using. I have tried some libraries download from the internet and the
> the libraries found in my local WINDOWS directory. The first ones
> complains about some _decode_pointer funtion; the second set complains
> about missing manifests.
> 
> Peter could you tell me which libraries you are using? Could you send it
> to me privately?

Did you get my private mail, or is it lost in your spam filter?

Peter



Re: scons-msvc adventure

2006-05-31 Thread Abdelrazak Younes

Bo Peng wrote:


Calling Scons again made it to the end!

To run it I had to install two libraries: msvcr80.dll and msvcp80.dll.
But then, lyx still complains about missing Entry point:


If that 'permission denied' is the source of the problem, there is
nothing scons can do. Anyway, I have experienced such problems
randomly with mingw/cygwin.


This is weird...

Abdel.



Re: scons-msvc adventure

2006-05-31 Thread Abdelrazak Younes

Bo Peng wrote:


So you do not have any of Abdel's manifest problem, just by using
patched mingw zlib?


Just for clarification I have the same fix to zlib in my tree and still 
have the problem. I think it's related to the MSxxx.dll that you are 
using. I have tried some libraries download from the internet and the 
the libraries found in my local WINDOWS directory. The first ones 
complains about some _decode_pointer funtion; the second set complains 
about missing manifests.


Peter could you tell me which libraries you are using? Could you send it 
to me privately?


Thanks,
Abdel.



Re: scons-msvc adventure

2006-05-30 Thread Bo Peng

I have done that but the error persist. The following explains that a
manifest file is _mandatory_ to any MSVC 2005 generated executable or
library:

http://msdn2.microsoft.com/en-us/library/ms235591.aspx


But why did Peter succeeded? His lyx-qt4.exe starts correctly, and I
am certain that there is no manifest support in scons (or his patch).

Bo


Re: scons-msvc adventure

2006-05-30 Thread Bo Peng


Calling Scons again made it to the end!

To run it I had to install two libraries: msvcr80.dll and msvcp80.dll.
But then, lyx still complains about missing Entry point:


If that 'permission denied' is the source of the problem, there is
nothing scons can do. Anyway, I have experienced such problems
randomly with mingw/cygwin.

Bo


Re: scons-msvc adventure

2006-05-30 Thread Bo Peng


Why is there no default reply address adjusted to lyx-devel?
Too often I get duplicated emails, because one have to press
the reply all button.


Lars (or Angus?) pointed me to a web article about this  and
basically, if your mail server/filter/client can not handle such
duplicated emails, you should switch to another one.

Bo


Re: scons-msvc adventure

2006-05-30 Thread Bo Peng

I've successfully compiled, linked, and started lyx_qt4.exe
using scons on windows with msvc.

But I've used the gnuwin32 package (without renaming), and I have
to fix the unistd.h including in zconf.h (#if 1 -> #if 0), but this
could also be fixed by adding somewhere a dummy unistd.h.


I will try your patch.


But generating project files seems much more complicated than
changing a command line parameter. :(


As far as I can tell, it is only a function call away (kind of).
Basically, I need to move all source file definitions out of the if
build_xxx blocks and have a new if build_msvc target, and put the call
to the env.MSVCProject (?) there.

Of course, this can only be done after we make sure command line compiles fine.

Bo


Re: scons-msvc adventure

2006-05-30 Thread Bo Peng

I've succesfully compiled, linked, and started lyx_qt4.exe.

I've used the gnuwin32 package without renaming, but I have
to fix the unistd.h including. (#if 1 -> #if 0), but this
could also be fix by adding somewhere a dummy unistd.h.

Here is a diff against head:

Index: development/scons/SConstruct
===
--- development/scons/SConstruct(Revision 13964)
+++ development/scons/SConstruct(Arbeitskopie)
@@ -551,10 +551,20 @@
   env['HAS_PKG_CONFIG'] = env_cache['HAS_PKG_CONFIG']

 # zlib? This is required. (fast_start assumes the existance of zlib)
-if not fast_start and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
-print 'Did not find libz or zlib.h, exiting!'
+#if not fast_start and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
+if not fast_start:
+  if not use_vc and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
+print 'Did not find libz.lib or zlib.h, exiting!'
 Exit(1)
-
+  if use_vc:
+if not conf.CheckHeader('zlib.h'):
+  print 'Did not find zlib.h, exiting!'
+  Exit(1)
+if not conf.CheckLib('zlib'):
+  print 'Did not find zlib.lib, exiting!'
+  Exit(1)
+
+
 # qt libraries?
 if not fast_start:
   #

   env_functions = [
 ('asprintf', 'HAVE_ASPRINTF'),
 ('wprintf', 'HAVE_WPRINTF'),
@@ -1124,11 +1137,10 @@
 if platform_name in ['win32', 'cygwin']:
   # the final link step needs stdc++ to succeed under mingw
   # FIXME: shouldn't g++ automatically link to stdc++?
-  env['SYSTEM_LIBS'] = ['shlwapi', 'z']
   if use_vc:
-env['SYSTEM_LIBS'].extend(['gdi32', 'shell32', 'advapi32'])
+ env['SYSTEM_LIBS'] = ['shlwapi', 'gdi32', 'shell32', 'advapi32', 'zlib']
   else:
-env['SYSTEM_LIBS'].append('stdc++')
+ env['SYSTEM_LIBS'] = ['shlwapi', 'stdc++', 'z']
 else:
   env['SYSTEM_LIBS'] = ['z']



So you do not have any of Abdel's manifest problem, just by using
patched mingw zlib?

Bo


Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Peter Kümmel wrote:

Abdelrazak Younes wrote:

Abdelrazak Younes wrote:

To run it I had to install two libraries: msvcr80.dll and msvcp80.dll.
But then, lyx still complains about missing Entry point:

---
lyx.exe - Entry Point Not Found
---
The procedure entry point _decode_pointer could not be located in the
dynamic link library MSVCR80.dll.


Maybe you have in your search PATH the mingw-qt/bin folder
before the msvc-qt/bin. Then it helps to temporary rename
the qt-mingw folder.


I have done that but the error persist. The following explains that a 
manifest file is _mandatory_ to any MSVC 2005 generated executable or 
library:


http://msdn2.microsoft.com/en-us/library/ms235591.aspx

It is recommended that a C/C++ application (or library) have its 
manifest embedded inside the final binary because this ensures proper 
runtime behavior in most scenarios. Visual Studio by default tries to 
embed the manifest when building a project from source files; see 
Manifest Generation in Visual Studio for more details. However if an 
application is built using nmake, some changes to the existing makefile 
are necessary. This section demonstrates how to change existing 
makefiles to automatically embed the manifest inside the final binary.

Two approaches

There are two ways to embed the manifest inside an application or library.

*

  If you are not doing an incremental build you can directly embed 
the manifest using a command line similar to the following as a 
post-build step:


  mt.exe –manifest MyApp.exe.manifest -outputresource:MyApp.exe;1

  or

  mt.exe –manifest MyLibrary.dll.manifest 
-outputresource:MyLibrary.dll;2


  (1 for an EXE, 2 for a DLL.)
*

  If you are doing an increment build, directly editing the 
resource as shown above will disable incremental building and cause a 
full rebuild; therefore a different approach should be taken:

  o

Link the binary to generate the MyApp.exe.manifest file.
  o

Convert the manifest to a resource file.
  o

Re-link (incrementally) to embed the manifest resource into 
the binary.




Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Abdelrazak Younes wrote:


I found other dll version of the required dlls deed inside my WINDOWS 
directory. Putting them along lyx.exe now gives me the following error:


---
Microsoft Visual C++ Runtime Library
---
Runtime Error!

Program: D:\program\lyx-msvc\bin\lyx.exe

R6034

An application has made an attempt to load the C runtime library 
incorrectly.

Please contact the application's support team for more information.


This link talk about a manifest file:
http://msdn2.microsoft.com/en-us/library/ms235560.aspx

This link explains how to generate one but I fail to understand how:
http://msdn2.microsoft.com/en-us/library/ms235229.aspx

Is this some kind of MS anti piracy file or something?

Abdel



Re: scons-msvc adventure

2006-05-30 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Abdelrazak Younes wrote:
>> To run it I had to install two libraries: msvcr80.dll and msvcp80.dll.
>> But then, lyx still complains about missing Entry point:
>>
>> ---
>> lyx.exe - Entry Point Not Found
>> ---
>> The procedure entry point _decode_pointer could not be located in the
>> dynamic link library MSVCR80.dll.
> 

Maybe you have in your search PATH the mingw-qt/bin folder
before the msvc-qt/bin. Then it helps to temporary rename
the qt-mingw folder.

Peter


Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Abdelrazak Younes wrote:
To run it I had to install two libraries: msvcr80.dll and msvcp80.dll. 
But then, lyx still complains about missing Entry point:


---
lyx.exe - Entry Point Not Found
---
The procedure entry point _decode_pointer could not be located in the 
dynamic link library MSVCR80.dll.


I found other dll version of the required dlls deed inside my WINDOWS 
directory. Putting them along lyx.exe now gives me the following error:


---
Microsoft Visual C++ Runtime Library
---
Runtime Error!

Program: D:\program\lyx-msvc\bin\lyx.exe

R6034

An application has made an attempt to load the C runtime library 
incorrectly.

Please contact the application's support team for more information.


---
OK
---

Clicking on OK then gives me:

---
lyx.exe - Application Error
---
The application failed to initialize properly (0xc142). Click on OK 
to terminate the application.

---
OK
---

Any idea Peter?

Abdel.



Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Bo Peng wrote:

Dear all,

The basic support for msvc2003/2005 is now in svn. Please test.


env_subst(["msvc\common\support\package.C"], 
["D:\devel\lyx\trunk\src\support\package.C.in"])
cl /nologo /TP /EHsc /wd4819 /wd4996 /ID:\program\GnuWin32\include 
/ID:\program\Aspell-0.60.4\include /ID:\devel\lyx\trunk\boost 
/ID:\devel\lyx\trunk\src /c D:\devel\lyx\trunk\src\support\rename.C 
/Fomsvc\common\support\rename.obj
cl /nologo /TP /EHsc /wd4819 /wd4996 /ID:\program\GnuWin32\include 
/ID:\program\Aspell-0.60.4\include /ID:\devel\lyx\trunk\boost 
/ID:\devel\lyx\trunk\src /c msvc\common\support\package.C 
/Fomsvc\common\support\package.obj

rename.C
package.C
c1xx : fatal error C1083: Cannot open source file: 
'msvc\commocn\support\package.l /nologo /TP /EHsc /wd4819 /wd4996 
/ID:\program\GnuWin32\include /ID:\program\
Aspell-0.60.4\include /ID:\devel\lyx\trunk\boost 
/ID:\devel\lyx\trunk\src /c D:\devel\lyx\trunk\src\support\socktools.C 
/Fomsvc\common\support\socktools.obj

C': Permission denied
cl /nologo /TP /EHsc /wd4819 /wd4996 /ID:\program\GnuWin32\include 
/ID:\program\Aspell-0.60.4\include /ID:\devel\lyx\trunk\boost 
/ID:\devel\lyx\trunk\src /c D:\devel\lyx\trunk\src\support\systemcall.C 
/Fomsvc\common\support\systemcall.obj

scons: *** [msvc\common\support\package.obj] Error 2
socktools.C
systemcall.C
scons: building terminated because of errors.

The weird thing is that when I launch package.C compilation by hand, it 
worked:


cl /nologo /TP /EHsc /wd4819 /wd4996 /ID:\program\GnuWin32\include 
/ID:\program\Aspell-0.60.4\include /ID:\devel\lyx\trunk\boost 
/ID:\devel\lyx\trunk\src /c "msvc\common\support\package.C" 
/Fomsvc\common\support\package.obj


Calling Scons again made it to the end!

To run it I had to install two libraries: msvcr80.dll and msvcp80.dll. 
But then, lyx still complains about missing Entry point:


---
lyx.exe - Entry Point Not Found
---
The procedure entry point _decode_pointer could not be located in the 
dynamic link library MSVCR80.dll.



Any idea?
Abdel.



Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Peter Kümmel wrote:

Abdelrazak Younes wrote:

Peter Kümmel wrote:

I've successfully compiled, linked, and started lyx_qt4.exe
using scons on windows with msvc.

But I've used the gnuwin32 package (without renaming), and I have

I was doing the exact same fix ;-)



Fixing SConstruct or zconf.h?


Fixing the zlib naming.


to fix the unistd.h including in zconf.h (#if 1 -> #if 0), but this
could also be fixed by adding somewhere a dummy unistd.h.


But generating project files seems much more complicated than
changing a command line parameter. :(


Here is a diff against head:

Please send further patches as attachment, it's easier to apply.



No problem :)


Actually could you repost this one as copying and paste it to a file 
does not apply cleanly here... Sorry for the repetition.



Why is there no default reply address adjusted to lyx-devel?
Too often I get duplicated emails, because one have to press
the reply all button.


I have been bitten by this this also and I remember there were some 
reasons for it but I don't remember which. Nowadays I am not even 
subscribed to the list, I only use the gmane news interface and I only 
hit "reply" ;-)


Abdel.



Re: scons-msvc adventure

2006-05-30 Thread Peter Kümmel
Abdelrazak Younes wrote:
> Peter Kümmel wrote:
>> I've successfully compiled, linked, and started lyx_qt4.exe
>> using scons on windows with msvc.
>>
>> But I've used the gnuwin32 package (without renaming), and I have
> 
> I was doing the exact same fix ;-)
> 

Fixing SConstruct or zconf.h?

>> to fix the unistd.h including in zconf.h (#if 1 -> #if 0), but this
>> could also be fixed by adding somewhere a dummy unistd.h.
>>
>>
>> But generating project files seems much more complicated than
>> changing a command line parameter. :(
>>
>>
>> Here is a diff against head:
> 
> Please send further patches as attachment, it's easier to apply.


No problem :)


Why is there no default reply address adjusted to lyx-devel?
Too often I get duplicated emails, because one have to press
the reply all button.

Peter




Re: scons-msvc adventure

2006-05-30 Thread Abdelrazak Younes

Peter Kümmel wrote:

I've successfully compiled, linked, and started lyx_qt4.exe
using scons on windows with msvc.

But I've used the gnuwin32 package (without renaming), and I have


I was doing the exact same fix ;-)


to fix the unistd.h including in zconf.h (#if 1 -> #if 0), but this
could also be fixed by adding somewhere a dummy unistd.h.


But generating project files seems much more complicated than
changing a command line parameter. :(


Here is a diff against head:


Please send further patches as attachment, it's easier to apply.

Thanks,
Abdel.



Re: scons-msvc adventure

2006-05-30 Thread Peter Kümmel

I've successfully compiled, linked, and started lyx_qt4.exe
using scons on windows with msvc.

But I've used the gnuwin32 package (without renaming), and I have
to fix the unistd.h including in zconf.h (#if 1 -> #if 0), but this
could also be fixed by adding somewhere a dummy unistd.h.


But generating project files seems much more complicated than
changing a command line parameter. :(


Here is a diff against head:

Index: development/scons/SConstruct
===
--- development/scons/SConstruct(Revision 13964)
+++ development/scons/SConstruct(Arbeitskopie)
@@ -551,10 +551,20 @@
   env['HAS_PKG_CONFIG'] = env_cache['HAS_PKG_CONFIG']

 # zlib? This is required. (fast_start assumes the existance of zlib)
-if not fast_start and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
-print 'Did not find libz or zlib.h, exiting!'
+#if not fast_start and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
+if not fast_start:
+  if not use_vc and not conf.CheckLibWithHeader('z', 'zlib.h', 'C'):
+print 'Did not find libz.lib or zlib.h, exiting!'
 Exit(1)
-
+  if use_vc:
+if not conf.CheckHeader('zlib.h'):
+  print 'Did not find zlib.h, exiting!'
+  Exit(1)
+if not conf.CheckLib('zlib'):
+  print 'Did not find zlib.lib, exiting!'
+  Exit(1)
+
+
 # qt libraries?
 if not fast_start:
   #

   env_functions = [
 ('asprintf', 'HAVE_ASPRINTF'),
 ('wprintf', 'HAVE_WPRINTF'),
@@ -1124,11 +1137,10 @@
 if platform_name in ['win32', 'cygwin']:
   # the final link step needs stdc++ to succeed under mingw
   # FIXME: shouldn't g++ automatically link to stdc++?
-  env['SYSTEM_LIBS'] = ['shlwapi', 'z']
   if use_vc:
-env['SYSTEM_LIBS'].extend(['gdi32', 'shell32', 'advapi32'])
+ env['SYSTEM_LIBS'] = ['shlwapi', 'gdi32', 'shell32', 'advapi32', 'zlib']
   else:
-env['SYSTEM_LIBS'].append('stdc++')
+ env['SYSTEM_LIBS'] = ['shlwapi', 'stdc++', 'z']
 else:
   env['SYSTEM_LIBS'] = ['z']



Bo Peng wrote:
> Dear all,
> 
> The basic support for msvc2003/2005 is now in svn. Please test.
> 
> Step 1: install scons-0.96.92
> 
> Step 2: add
> boost/boost/type_traits/detail/is_function_ptr_tester.hpp
> boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
> boost/boost/detail/interlocked.hpp
> boost/boost/regex/v4/w32_regex_traits.hpp
> 
> Step 3: download the official zlib dll package, unzip to (for example)
> d:\msvc-libs . copy zdll.lib to z.lib (cheating)
> 
> I need help on this issue. This rename seems to make the built lyx
> unusable.
> 
> step 4: svn update
> 
> Step 5: run command:
> scons -f development/scons/SConstruct use_vc=yes frontend=qt4
>   qt_dir=d:/qt/4.1.3-vc2005
>   extra_inc_path=d:/MSVC-Libs/include
>   extra_lib_path=d:/MSVC-Libs/lib
>   boost=included
>   nls=no warnings=no
> 
> 
> Cheers,
> Bo
> 
> 



Re: scons-msvc adventure

2006-05-30 Thread Angus Leeming
Bo Peng <[EMAIL PROTECTED]> writes:
> Index: src/support/package.C.in
> ===
> --- src/support/package.C.in  (revision 13941)
> +++ src/support/package.C.in  (working copy)
>  -26,7 +26,11 
> 
>  #if defined (USE_WINDOWS_PACKAGING)
>  # include "support/os_win32.h"
> +// PATH_MAX is not defined? (msvc)
> +#ifndef PATH_MAX
> +#define PATH_MAX 512
>   #endif
> +#endif

I think that it's perfectly reasonable to use MAX_PATH in the Windows-specific
bits of this file. I tried to do that (with Rob Bearman's prompting) first time
around, but PATH_MAX slips back in occassionaly...

Angus



Re: scons-msvc adventure

2006-05-30 Thread Andre Poenitz
On Fri, May 26, 2006 at 02:39:43PM -0500, Bo Peng wrote:
> Anyway, the .C suffix problem is again in the way. Does anyone know
> how to let cl know the source file is a C++ file?

There is a command line switch. Forgot which.

Andre'


Re: scons-msvc adventure

2006-05-29 Thread Bo Peng

Dear all,

The basic support for msvc2003/2005 is now in svn. Please test.

Step 1: install scons-0.96.92

Step 2: add
boost/boost/type_traits/detail/is_function_ptr_tester.hpp
boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
boost/boost/detail/interlocked.hpp
boost/boost/regex/v4/w32_regex_traits.hpp

Step 3: download the official zlib dll package, unzip to (for example)
d:\msvc-libs . copy zdll.lib to z.lib (cheating)

I need help on this issue. This rename seems to make the built lyx unusable.

step 4: svn update

Step 5: run command:
scons -f development/scons/SConstruct use_vc=yes frontend=qt4
  qt_dir=d:/qt/4.1.3-vc2005
  extra_inc_path=d:/MSVC-Libs/include
  extra_lib_path=d:/MSVC-Libs/lib
  boost=included
  nls=no warnings=no


Cheers,
Bo


Re: scons-msvc adventure

2006-05-29 Thread Bo Peng

> I have this macro defined. If my test works right, then msvc does not
> have it. This piece of code is supposed to fix this so fixing it again
> in config.h does not sound right.
>

MSVC has it, the test should not fail with msvc.


MSVC does detect it now. I am not sure what happened previously
(msvc2003?). Anyway, the fix is necessary.


Yes, including cerror is better.


It is done. If you know some previous windows compilers that do not
have this header, we should cook up a HAVE_CERRNO test.



I haven't tried to include the correct header with the posix ifdef.


PATH_MAX is now defined in the source (if it is undefined).

A scons patch will be applied soon (after the boost issue is fixed).
You do not have to apply the old patch then.

Now the headache is msvc+intl.

Bo


Re: scons-msvc adventure

2006-05-29 Thread Peter Kümmel
Bo Peng wrote:
>> HAVE_DECL_ISTREAMBUF_ITERATOR
> 
> I have this macro defined. If my test works right, then msvc does not
> have it. This piece of code is supposed to fix this so fixing it again
> in config.h does not sound right.
> 

MSVC has it, the test should not fail with msvc.

>> > # include 
>> > +# include 
>> >
>> Seems msvc haven't defined a macro, here my patch:
>>
>> +#  ifndef ESRCH
>> +#   define  ESRCH 3
>> +#  endif
> 
> Hard-coding the value of ESRCH does not look right. If cerrno exists,
> we should include it. I guess I can do a HAVE_CERRNO test and fix this
> problem.
> 

Yes, including cerror is better.

>> You could fix this in config.h, don't use mkdir bit _mkdir:
>>
>> #ifdef _WIN32
>> #undef HAVE_MKDIR // use _mkdir instead
>> #endif
>> #ifdef _MSC_VER
>> #undef HAVE_OPEN  // use _open instead
>> #endif
> 
> This looks fine.
> 
>>
>> isn't config.h the better place?
>>
>> #ifdef _MSC_VER
>> #define PATH_MAX 512
>> #endif
> 
> So msvc does not define this at all?

I haven't tried to include the correct header with the posix ifdef.

> 
>> I've not compiled intl, what's the functionality of intl?
> 
> intl directory has a copy of gettext library, it is used when nls=yes
> and gettext=included. It needs more macro definitions than lyx itself,
> and is tricky to compile right. There is supposed to be a
> Makefile.msvc so that I can follow, but my msvc just can not compile
> that piece of code.
> 
> Cheers,
> Bo
> 
> 



Re: scons-msvc adventure

2006-05-28 Thread Abdelrazak Younes

Bo Peng wrote:

you could disable it by defining BOOST_ALL_NO_LIB, and then
linking against the libs generated by your build process.


Thanks, Peter.   lyx now builds and links fine (except for included 
gettext).


So, Abdel, could you verify the attached patch? You need to


Sorry Bo, I don't have the time... I have to fill in my income tax 
dossier... :-(
Maybe sometime next week. Concerning the qt4 change there seems OK and 
BulletsModule is not functional anyway so please go ahead yourself.


Abdel.



Re: scons-msvc adventure

2006-05-28 Thread Bo Peng

> +using std::ifstream;
> using std::istream_iterator;
>  using std::ios;
>



I think you could fix this by the configure process:

Test code:

#include 
#include 
typedef std::istreambuf_iterator type;
int main(){return 0;}
macro:

HAVE_DECL_ISTREAMBUF_ITERATOR


I have this macro defined. If my test works right, then msvc does not
have it. This piece of code is supposed to fix this so fixing it again
in config.h does not sound right.


> # include 
> +# include 
>
Seems msvc haven't defined a macro, here my patch:

+#  ifndef ESRCH
+#   define  ESRCH 3
+#  endif


Hard-coding the value of ESRCH does not look right. If cerrno exists,
we should include it. I guess I can do a HAVE_CERRNO test and fix this
problem.



You could fix this in config.h, don't use mkdir bit _mkdir:

#ifdef _WIN32
#undef HAVE_MKDIR // use _mkdir instead
#endif
#ifdef _MSC_VER
#undef HAVE_OPEN  // use _open instead
#endif


This looks fine.



isn't config.h the better place?

#ifdef _MSC_VER
#define PATH_MAX 512
#endif


So msvc does not define this at all?


I've not compiled intl, what's the functionality of intl?


intl directory has a copy of gettext library, it is used when nls=yes
and gettext=included. It needs more macro definitions than lyx itself,
and is tricky to compile right. There is supposed to be a
Makefile.msvc so that I can follow, but my msvc just can not compile
that piece of code.

Cheers,
Bo


Re: scons-msvc adventure

2006-05-28 Thread Peter Kümmel
Bo Peng wrote:
> Index: src/support/lyxsum.C
> ===
> --- src/support/lyxsum.C(revision 13941)
> +++ src/support/lyxsum.C(working copy)
> @@ -122,6 +122,7 @@
> }
> #else
> 
> +using std::ifstream;
> using std::istream_iterator;
>  using std::ios;
> 
> 

I think you could fix this by the configure process:

Test code:

#include 
#include 
typedef std::istreambuf_iterator type;
int main(){return 0;}
macro:

HAVE_DECL_ISTREAMBUF_ITERATOR

> This looks necessary. Can I add this, JMarc?
> 
> 
> Index: src/support/forkedcall.C
> ===
> --- src/support/forkedcall.C(revision 13941)
> +++ src/support/forkedcall.C(working copy)
> @@ -44,6 +44,7 @@
>  # define SIGKILL 9
> # include 
> # include 
> +# include 
> 
> #else
> # include 
> 
> 
> This is needed for error code, I do not know why mingw does not need
> this. Is it safe to move cerrno out of the ifdef?
> 
> 
Seems msvc haven't defined a macro, here my patch:

+#  ifndef ESRCH
+#   define  ESRCH 3
+#  endif

> Index: src/support/mkdir.C
> ===
> --- src/support/mkdir.C(revision 13941)
> +++ src/support/mkdir.C(working copy)
> @@ -24,6 +24,7 @@
>  #endif
>  #ifdef _WIN32
> # include 
> +# include 
>  #endif
> 
>  int lyx::support::mkdir(std::string const & pathname, unsigned long int
> mode)
> Index: src/support/tempname.C
> 
> 
> Under windows, mkdir is in direct.h. I guess this is needed.

You could fix this in config.h, don't use mkdir bit _mkdir:

#ifdef _WIN32
#undef HAVE_MKDIR // use _mkdir instead
#endif

> 
> 
> ===
> --- src/support/tempname.C(revision 13941)
> +++ src/support/tempname.C(working copy)
> @@ -38,6 +38,11 @@
>  # endif
>  #endif
> 
> +#if (!defined S_IRUSR)
> +   #define S_IRUSR   S_IREAD
> +   #define S_IWUSR   S_IWRITE
> +#endif
> +
> using boost::scoped_array;
> 
> using std::string;
> 
> 
> I need expert opinions here. Where can I get S_IRUSR under msvc? lyx
> was compiled with msvc before so I guess I need to do something in
> SConstruct.
> 
> 

Also here, you could fix this by config.h.

#ifdef _MSC_VER
#undef HAVE_OPEN  // use _open instead
#endif


> Index: src/support/package.C.in
> ===
> --- src/support/package.C.in(revision 13941)
> +++ src/support/package.C.in(working copy)
> @@ -26,7 +26,11 @@
> 
> #if defined (USE_WINDOWS_PACKAGING)
> # include "support/os_win32.h"
> +// PATH_MAX is not defined? (msvc)
> +#ifndef PATH_MAX
> +#define PATH_MAX 512
>  #endif
> +#endif
> 
>  #include 
>  #include 
> 
> 
> I can not find PATH_MAX but this thing should be there somewhere. Can
> anyone help?
> 
> 

isn't config.h the better place?

#ifdef _MSC_VER
#define PATH_MAX 512
#endif

> At least, I can not build included intl with msvc. Peter, do you know
> the command line options and needed macros? My attempt stops at
> gettextP.c
> 

I've not compiled intl, what's the functionality of intl?

Peter



Re: scons-msvc adventure

2006-05-27 Thread Bo Peng

you could disable it by defining BOOST_ALL_NO_LIB, and then
linking against the libs generated by your build process.


Thanks, Peter.   lyx now builds and links fine (except for included gettext).

So, Abdel, could you verify the attached patch? You need to

Step 1: install scons-0.96.92

Step 2: add
boost/boost/type_traits/detail/is_function_ptr_tester.hpp
boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
boost/boost/detail/interlocked.hpp
boost/boost/regex/v4/w32_regex_traits.hpp

Step 3: download the official zlib dll package, unzip to (for example)
d:\msvc-libs . copy zdll.lib to z.lib (cheating)

Step 4: apply the attached patch. Note that many of the changes are
temporary and might break scons on other systems.


Step 5: run command:

scons -f development/scons/SConstruct use_vc=yes frontend=qt4

 qt_dir=d:/qt/4.1.3-vc2005
 extra_inc_path=d:/MSVC-Libs/include
 extra_lib_path=d:/MSVC-Libs/lib
 boost=included
 nls=no warnings=no


Despite the scons changes, I need to address the following problems in
the lyx source:

Index: src/frontends/qt4/BulletsModule.C
===
--- src/frontends/qt4/BulletsModule.C   (revision 13941)
+++ src/frontends/qt4/BulletsModule.C   (working copy)
@@ -250,6 +250,7 @@
default:
return standard_->pixmap(row,col);
}*/
+return QPixmap();
}


Abdel: could you fix this?


Index: src/support/lyxsum.C
===
--- src/support/lyxsum.C(revision 13941)
+++ src/support/lyxsum.C(working copy)
@@ -122,6 +122,7 @@
}
#else

+using std::ifstream;
using std::istream_iterator;
 using std::ios;


This looks necessary. Can I add this, JMarc?


Index: src/support/forkedcall.C
===
--- src/support/forkedcall.C(revision 13941)
+++ src/support/forkedcall.C(working copy)
@@ -44,6 +44,7 @@
 # define SIGKILL 9
# include 
# include 
+# include 

#else
# include 


This is needed for error code, I do not know why mingw does not need
this. Is it safe to move cerrno out of the ifdef?


Index: src/support/mkdir.C
===
--- src/support/mkdir.C (revision 13941)
+++ src/support/mkdir.C (working copy)
@@ -24,6 +24,7 @@
 #endif
 #ifdef _WIN32
# include 
+# include 
 #endif

 int lyx::support::mkdir(std::string const & pathname, unsigned long int mode)
Index: src/support/tempname.C


Under windows, mkdir is in direct.h. I guess this is needed.


===
--- src/support/tempname.C  (revision 13941)
+++ src/support/tempname.C  (working copy)
@@ -38,6 +38,11 @@
 # endif
 #endif

+#if (!defined S_IRUSR)
+   #define S_IRUSR   S_IREAD
+   #define S_IWUSR   S_IWRITE
+#endif
+
using boost::scoped_array;

using std::string;


I need expert opinions here. Where can I get S_IRUSR under msvc? lyx
was compiled with msvc before so I guess I need to do something in
SConstruct.


Index: src/support/package.C.in
===
--- src/support/package.C.in(revision 13941)
+++ src/support/package.C.in(working copy)
@@ -26,7 +26,11 @@

#if defined (USE_WINDOWS_PACKAGING)
# include "support/os_win32.h"
+// PATH_MAX is not defined? (msvc)
+#ifndef PATH_MAX
+#define PATH_MAX 512
 #endif
+#endif

 #include 
 #include 


I can not find PATH_MAX but this thing should be there somewhere. Can
anyone help?


At least, I can not build included intl with msvc. Peter, do you know
the command line options and needed macros? My attempt stops at
gettextP.c

#ifdef _LIBC
# include 
# define SWAP(i) bswap_32 (i)
#else
static inline nls_uint32
SWAP (i)
nls_uint32 i;
{
 return (i << 24) | ((i & 0xff00) << 8) | ((i >> 8) & 0xff00) | (i >> 24);
}
#endi

I think this SWAP function is indeed a bit strange.


Cheers,
Bo
Index: development/scons/SConscript
===
--- development/scons/SConscript	(revision 13941)
+++ development/scons/SConscript	(working copy)
@@ -95,6 +95,7 @@
   intlenv = env.Copy()
   # we need the original C compiler for these files
   intlenv['CC'] = intlenv['C_COMPILER']
+  intlenv['CCFLAGS'] = intlenv['C_CCFLAGS']
   intlenv['CPPPATH'] += ['intl']
   
   intlenv.Append(CCFLAGS = [
@@ -452,7 +453,6 @@
   ControlVSpace.C
   ControlWrap.C
   helper_funcs.C
-  helper_funcs.h
 ''')]
 )
   Alias('controllers', controllers)
@@ -734,7 +734,7 @@
 '-DQT_GENUINE_STR',
 '-DQT_NO_STL',
 '-DQT3_SUPPORT',
-'-Winvalid-pch']
+]
   )
 
   qt4_ui_files = ['$BUILDDIR/common/frontends/qt4/ui/%s' % x for x in Split('''
@@ -1175,7 +1175,7 @@
   #
   lyx = env.Program(
 target = '$BUILDDIR/$frontend/lyx',
-source = [],
+source = ['$BUILDDIR/common/main.C'],
 LIBS = [
   'lyxbase_pre',
   'mathe

Re: scons-msvc adventure

2006-05-27 Thread Peter Kümmel
Bo Peng wrote:
>> How must I call scons? Could you please post a complete command
>> which I can use (after fixing the paths)?
>> Do I have to add all the qt_* settings to the command?
>> This I have done but then it asks for extra_inc_path1.
> 
> Hi, Peter,
> 
> Thank you very much for the info. Here is what I get right now.
> 
> Step 1: install scons-0.96.92
> 
> Step 2: add
> boost/boost/type_traits/detail/is_function_ptr_tester.hpp
> boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
> boost/boost/detail/interlocked.hpp
> boost/boost/regex/v4/w32_regex_traits.hpp
> I do not add these to the patch because they are too big.
> 
> Step 3: download the official zlib dll package, unzip to (for example)
> d:\msvc-libs . copy zdll.lib to z.lib (cheating)
> 
> Step 4: apply the attached patch. Note that many of the changes are
> temporary and might break scons on other systems.
> 
> Step 5: run command:
> 
>> scons -f development/scons/SConstruct frontend=qt4
>> qt_dir=d:/qt/4.1.3-vc2005 use_vc=yes
>> extra_inc_path=d:/MSVC-Libs/include extra_lib_path=d:/MSVC-Libs/lib
>> boost=included nls=no
> 

Hi Bo,

thanks for the recipe! I'll try it in the next days.

> I come to the last linking step, and a strange error saying
> libboost_filesystem-vc80-mt-s-1_33.1.lib does not exist, while the
> command line asks to link to included_boost_filesystem.lib.

auto-linking of boost is enabled:

http://boost.org/more/getting_started.html#auto-link

you could disable it by defining BOOST_ALL_NO_LIB, and then
linking against the libs generated by your build process.

Peter



Re: scons-msvc adventure

2006-05-27 Thread Bo Peng

How must I call scons? Could you please post a complete command
which I can use (after fixing the paths)?
Do I have to add all the qt_* settings to the command?
This I have done but then it asks for extra_inc_path1.


Hi, Peter,

Thank you very much for the info. Here is what I get right now.

Step 1: install scons-0.96.92

Step 2: add
boost/boost/type_traits/detail/is_function_ptr_tester.hpp
boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
boost/boost/detail/interlocked.hpp
boost/boost/regex/v4/w32_regex_traits.hpp
I do not add these to the patch because they are too big.

Step 3: download the official zlib dll package, unzip to (for example)
d:\msvc-libs . copy zdll.lib to z.lib (cheating)

Step 4: apply the attached patch. Note that many of the changes are
temporary and might break scons on other systems.

Step 5: run command:


scons -f development/scons/SConstruct frontend=qt4 qt_dir=d:/qt/4.1.3-vc2005 
use_vc=yes extra_inc_path=d:/MSVC-Libs/include extra_lib_path=d:/MSVC-Libs/lib 
boost=included nls=no


I come to the last linking step, and a strange error saying
libboost_filesystem-vc80-mt-s-1_33.1.lib does not exist, while the
command line asks to link to included_boost_filesystem.lib.

Bo
Index: development/scons/SConscript
===
--- development/scons/SConscript	(revision 13941)
+++ development/scons/SConscript	(working copy)
@@ -95,6 +95,7 @@
   intlenv = env.Copy()
   # we need the original C compiler for these files
   intlenv['CC'] = intlenv['C_COMPILER']
+  intlenv['CCFLAGS'] = intlenv['C_CCFLAGS']
   intlenv['CPPPATH'] += ['intl']
   
   intlenv.Append(CCFLAGS = [
@@ -452,7 +453,6 @@
   ControlVSpace.C
   ControlWrap.C
   helper_funcs.C
-  helper_funcs.h
 ''')]
 )
   Alias('controllers', controllers)
@@ -734,7 +734,7 @@
 '-DQT_GENUINE_STR',
 '-DQT_NO_STL',
 '-DQT3_SUPPORT',
-'-Winvalid-pch']
+]
   )
 
   qt4_ui_files = ['$BUILDDIR/common/frontends/qt4/ui/%s' % x for x in Split('''
@@ -1175,7 +1175,7 @@
   #
   lyx = env.Program(
 target = '$BUILDDIR/$frontend/lyx',
-source = [],
+source = ['$BUILDDIR/common/main.C'],
 LIBS = [
   'lyxbase_pre',
   'mathed',
Index: development/scons/SConstruct
===
--- development/scons/SConstruct	(revision 13941)
+++ development/scons/SConstruct	(working copy)
@@ -256,7 +256,9 @@
   BoolOption('std_debug', '(NA) Whether or not turn on stdlib debug', False),
   # using x11?
   BoolOption('X11', 'Use x11 windows system', default_with_x),
-  # 
+  # use MS VC++ to build lyx
+  BoolOption('use_vc', 'Use MS VC++ to build lyx', False),
+  #
   PathOption('qt_dir', 'Path to qt directory', None),
   #
   PathOption('qt_include_path', 'Path to qt include directory', None),
@@ -332,7 +334,7 @@
 # Setting up environment
 #-
 
-env = Environment(options = opts)
+env = Environment(options = opts, ENV=os.environ)
 
 # Determine the frontend to use, which may be loaded
 # from option cache
@@ -341,11 +343,14 @@
 env['frontend'] = frontend
 #
 use_X11 = env.get('X11', default_with_x)
+use_vc = env.get('use_vc', False)
 
 
 # set individual variables since I do not really like ENV = os.environ
 env['ENV']['PATH'] = os.environ.get('PATH')
 env['ENV']['HOME'] = os.environ.get('HOME')
+env['ENV']['LIB'] = os.environ.get('LIB')
+env['ENV']['INCLUDE'] = os.environ.get('INCLUDE')
 env['TOP_SRC_DIR'] = TOP_SRC_DIR
 env['SCONS_DIR'] = SCONS_DIR
 # install to default_prefix by default
@@ -373,9 +378,12 @@
 # this is a bit out of place (after auto-configration) but 
 # it is required to do the tests. Since Tool('mingw') will 
 # reset CCFLAGS etc, this should be before getEnvVariable
-if platform_name == 'win32':
+if platform_name == 'win32' and not use_vc:
   env.Tool('mingw')
   env.AppendUnique(CPPPATH = ['#c:/MinGW/include'])
+elif use_vc:
+  env.Tool('msvc')
+  env.Tool('mslink')
 
 
 # speed up source file processing
@@ -482,12 +490,20 @@
 #
 # save the old c compiler
 env['C_COMPILER'] = env['CC']
-if env.has_key('CXX') and env['CXX']:
-  env['CC'] = env['CXX']
-  env['LINK'] = env['CXX']
-else:
-  env['CC'] = 'g++'
-  env['LINK'] = 'g++'
+env['C_CCFLAGS'] = env.subst('$CCFLAGS')
+# if we use ms vc, the commands are fine (cl.exe and link.exe)
+if not use_vc:
+  if env.has_key('CXX') and env['CXX']:
+env['CC'] = env.subst('$CXX')
+env['LINK'] = env.subst('$CXX')
+  else:
+env['CC'] = 'g++'
+env['LINK'] = 'g++'
+else: 
+  # C4819: The file contains a character that cannot be represented 
+  #   in the current code page (number)
+  # C4996: foo was decleared deprecated
+  env.Append(CCFLAGS=['/TP', '/EHsc', '/wd4819', '/wd4996'])
 
 
 #--
@@ -502,6 +518,7 @@
 'CheckSelectArgType' : utils.checkSelectArgType,
 'CheckBoostLibraries' : utils.checkBo

Re: scons-msvc adventure

2006-05-27 Thread Bo Peng

Lars (or others),

Would you agree to add

boost/boost/type_traits/detail/is_function_ptr_tester.hpp
boost/boost/type_traits/detail/is_mem_fun_pointer_tester.hpp
boost/boost/detail/interlocked.hpp
boost/boost/regex/v4/w32_regex_traits.hpp

for vc2003/2005 support? If you want me to do it, please tell me the
commands to set the properties properly.

Bo


Re: scons-msvc adventure

2006-05-27 Thread Peter Kümmel
Bo Peng wrote:
> Let us start a new thread.
> 
> Right now, I have told scons to build lyx, but it fails at the very
> first command:

How must I call scons? Could you please post a complete command
which I can use (after fixing the paths)?
Do I have to add all the qt_* settings to the command?
This I have done but then it asks for extra_inc_path1.


Re: scons-msvc adventure

2006-05-27 Thread Peter Kümmel
Bo Peng wrote:
> Another problem:
> 
> The mingw-libs zconf.h, line 289 assumes the existence of unistd.h.
> This is not true for msvc. I am trying the official zlib1.dll package
> but the lib name will be different (and I can no longer use -lz).
> 
> Bo
> 
> 
There is a ifdef where you could disable the including of unistd.h,
(ok, this is a hack) :)


Re: scons-msvc adventure

2006-05-27 Thread Peter Kümmel
Bo Peng wrote:
>> The option is /TP. As the error message indicates you should use /EHsc to
>> get exception handling (which is turned off for a reason I cannot
>> imagine),
> 
> Adding /EHsc does not fix the problem.
> detail/is_function_ptr_tester.hpp is still needed, as well as other
> three boost files.
> 
> Bo
> 
> 

There are also some missing boost files, check
lyx-cmake/put to see which files you have to add
to the boost folders.


Re: scons-msvc adventure

2006-05-27 Thread Peter Kümmel
Bo Peng wrote:
> Thank you. This option works.
> 
> Any idea how to get pid_t? I think it is in sys/types.h under linux,
> but msvc types.h may not have it.  This causes problems in
> src/support/forkedcall.h etc.
> 
> Bo
> 
> 
msvc lacks some symbols, you could have a look at
lyx-cmake/config.h.cmake (the config.h template), there
you see which symbols I've added to fix those errors.
here the relevant lines:

#ifdef _MSC_VER
#undef HAVE_OPEN  // use _open instead
#define pid_t int
#define PATH_MAX 512
#endif

#ifdef _WIN32
#undef HAVE_MKDIR // use _mkdir instead
#define NO_COMPRESSION 1
#define NO_ZLIB 1
#endif

#define BOOST_ALL_NO_LIB 1





Re: scons-msvc adventure

2006-05-26 Thread Bo Peng

Another problem:

The mingw-libs zconf.h, line 289 assumes the existence of unistd.h.
This is not true for msvc. I am trying the official zlib1.dll package
but the lib name will be different (and I can no longer use -lz).

Bo


Re: scons-msvc adventure

2006-05-26 Thread Bo Peng

Well, yes since it is the missing header that caused the error. The
obvious solution is to include the proper boost includes. If you already
do it might be a little bit more complicated to debug this.



The files are needed with a definition of
BOOST_TEMPLATE_PARTIAL_SPECILIZATION, then the problem seems to be
with my vc2003. Using vc2005 may solve this problem.

It would be nice to add these files to support vc2003 though.

Cheers,
Bo


Re: scons-msvc adventure

2006-05-26 Thread Michael Abshoff
> Adding /EHsc does not fix the problem.
> detail/is_function_ptr_tester.hpp is still needed, as well as other
> three boost files.
>
> Bo
>

Well, yes since it is the missing header that caused the error. The
obvious solution is to include the proper boost includes. If you already
do it might be a little bit more complicated to debug this.

The funny thing about not compiling with /EHsc is that on the first
exception thrown your program will just crash :) - it took me a while to
figure out why when I first saw this since I came from the Linux/Unix
world and couldn't understand why MSVC would produce faulty output,
especially since using exception in C++ isn't exactly unusual.

Cheers,

Michael



Re: scons-msvc adventure

2006-05-26 Thread Michael Abshoff
> Thank you. This option works.
>
> Any idea how to get pid_t? I think it is in sys/types.h under linux,
> but msvc types.h may not have it.  This causes problems in
> src/support/forkedcall.h etc.
>
> Bo
>

Hey Bo,

it should be defined in windows.h. Under
http://support.microsoft.com/default.aspx?scid=KB;en-us;178893&; you will
find some sample code (I couldn't find anything more useful in a hurry).
Notice that dwPID is a DWORD on Windows.

Cheers,

Michael



Re: scons-msvc adventure

2006-05-26 Thread Bo Peng

The option is /TP. As the error message indicates you should use /EHsc to
get exception handling (which is turned off for a reason I cannot
imagine),


Adding /EHsc does not fix the problem.
detail/is_function_ptr_tester.hpp is still needed, as well as other
three boost files.

Bo


Re: scons-msvc adventure

2006-05-26 Thread Bo Peng

Thank you. This option works.

Any idea how to get pid_t? I think it is in sys/types.h under linux,
but msvc types.h may not have it.  This causes problems in
src/support/forkedcall.h etc.

Bo


Re: scons-msvc adventure

2006-05-26 Thread Michael Abshoff
> Let us start a new thread.
>
> Right now, I have told scons to build lyx, but it fails at the very
> first command:
>
> cl  /ID:\zlib\include /Iboost /Isrc /c src\Bidi.C /Fodebug\common
> \Bidi.obj
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
> 80x86
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
>
> Bidi.C
> C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstddef(17)
> : err
> or C2143: syntax error : missing '{' before ':'
> C:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\cstddef(17)
> : err
> or C2059: syntax error : ':'
>
>
> If I rename the file to .cpp, I get
>
> D:\lyx-msvc>cl /DEF:_STD_USING /ID:\zlib\include /Iboost /Isrc /c
> src\Bidi.cpp /
> Fodebug\common
> Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
> 80x86
> Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.
>
> Bidi.cpp
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\ostream(574) : wa
> rning C4530: C++ exception handler used, but unwind semantics are not
> enabled. S
> pecify /EHsc
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\istream(828) : wa
> rning C4530: C++ exception handler used, but unwind semantics are not
> enabled. S
> pecify /EHsc
> C:\Program Files\Microsoft Visual Studio .NET
> 2003\Vc7\include\istream(1064) : w
> arning C4530: C++ exception handler used, but unwind semantics are not
> enabled.
> Specify /EHsc
> boost\boost\type_traits\is_function.hpp(21) : fatal error C1083: Cannot
> open inc
> lude file: 'boost/type_traits/detail/is_function_ptr_tester.hpp': No such
> file o
> r directory
>
>
> Anyway, the .C suffix problem is again in the way. Does anyone know
> how to let cl know the source file is a C++ file?


The option is /TP. As the error message indicates you should use /EHsc to
get exception handling (which is turned off for a reason I cannot
imagine),

Cheers,

Michael

>
> Bo
>