Author Topic: Win9x build/support of CB  (Read 17758 times)

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Win9x build/support of CB
« on: January 04, 2006, 09:49:12 pm »
Facts :
 - official CB : unicode
 - Win9X : no unicode

MS solution :
 - MSLU allows Unicode programs to run on Win9x
 - tipically : only for MSVC

Open Souce Solution : http://libunicows.sourceforge.net/

--> License trouble might be happening ? ok or not ok ?

Quote
Usage
=======

1) Add the unicows import library BEFORE other win32 libraries on your command
line. For example, if your command line for Mingw32 was

    c++ foo.o bar.o -o foo -lkernel32 -luser32 -lgdi32 -lcomdlg32

change it to

    c++ foo.o bar.o -o foo -lunicows -lkernel32 -luser32 -lgdi32 -lcomdlg32

No other change is neccessary, you don't have to include any special headers in
your source files.


2) Download Unicows runtime from

    http://www.microsoft.com/downloads/release.asp?releaseid=30039
   
or
   
    http://download.microsoft.com/download/platformsdk/Redist/1.0/W9XMe/EN-US/unicows.exe
   
Extract unicows.dll from the package and distribute it with your application.
Do *not* install it to Windows system directory, always copy the DLL to your
application's directory! (Nobody wants any more of DLL hell...).
 
If your application uses Common Controls DLL (very likely) or Rich Edit control,
make sure the installer installs new enough versions that fully support Unicode
(Common Controls DLL version 5.80 and RichEdit 4.0).

Next make sure wx is ok for this libunicows :
Quote
// Set wxUSE_UNICODE_MSLU to 1 if you're compiling wxWidgets in Unicode mode
// and want to run your programs under Windows 9x and not only NT/2000/XP.
// This setting enables use of unicows.dll from MSLU (MS Layer for Unicode, see
// http://www.microsoft.com/globaldev/handson/dev/mslu_announce.mspx). Note
// that you will have to modify the makefiles to include unicows.lib import
// library as the first library (see installation instructions in install.txt
// to learn how to do it when building the library or samples).
//
// If your compiler doesn't have unicows.lib, you can get a version of it at
// http://libunicows.sourceforge.net
I am not sure on how to interpret this : do I have to set this in projects using wx and/or on the command line where I issue the instructions to build the wx dll ??

Next :
 - add 1 or 2 libs to the sdk target : libshfolder.a and libshell32.a


So we need to settle this once and for all, and make these things part of the official builds.


Or not ?

Lieven

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #1 on: January 04, 2006, 09:57:26 pm »
Personally, am not fond of yet another hack... what's wrong with building Windows98 binaries in ANSI?
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #2 on: January 04, 2006, 09:59:11 pm »
For sure you'll have to compile wxWidgets with that macro set to 1 and modify the Makefile too so it'll link against that library as the first one, before issuing make.

You'll need to test if you also need to link against it in the Code::Blocks project file.

Adding or not libshell32.a could be checked quickly. Just delete codeblocks.dll from devel, add only libshfolder.a to sdk, compile sdk only (so it'll just re-link) and try in 9x.

thomas: the idea is to provide just one build that works in both 9x and NT, and that is also UNICODE.

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Win9x build/support of CB
« Reply #3 on: January 04, 2006, 10:02:58 pm »
... what's wrong with building Windows98 binaries in ANSI?
nothing - it's common practice for a lot of applications nowadays

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Win9x build/support of CB
« Reply #4 on: January 04, 2006, 10:05:08 pm »
thomas: the idea is to provide just one build that works in both 9x and NT, and that is also UNICODE.

IMHO, there will be debug issues as C::B uses GDB 6.3.

Michael
 

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #5 on: January 04, 2006, 10:05:46 pm »
the project files to build ansi are gone also from svn !!
Yiannis said it is unicode now.

That's why I want to raise this in this topic, to figure out how and if ...

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Win9x build/support of CB
« Reply #6 on: January 04, 2006, 10:07:17 pm »
the project files to build ansi are gone also from svn ...

it's not - just edit  WX_SUFFIX custom variable
« Last Edit: January 04, 2006, 10:09:15 pm by tiwag »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #7 on: January 04, 2006, 10:13:04 pm »
Umm...? The current project is the former UNI project, so you can very well build an ANSI version with that one, it was made for that purpose... :)


Personally, I think (and I may be wrong of course) that people using Windows 98 are rather a minority, and they know that they are using an outdated OS, and thus they have to expect (and are expecting) some drawback when it comes to new technologies. Unicode is one such issue, and gdb 6.3 is another.
I mean seriously, you (almost) cannot buy a PC without buying XP for several years now.

My point is that to make it half-way work for a few people, we have to add yet another hack for everybody. This means increased download size, possibly reduced stability, and increased load times for everybody.
So it may be worth a consideration if you maybe just have to accept that Windows98 and Unicode don't do together (at least not easily).
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #8 on: January 04, 2006, 10:20:29 pm »
the project files to build ansi are gone also from svn ...

it's not - just edit  WX_SUFFIX custom variable
And probably the global var "wx" ? Since it will need to link with other libs and include another setup.h, (if so, feasible and cumbersome),  can someone acknowledge this or tell me otherwise ?
[EDIT] : is probably ok

So I see suggestion to keep providing an ansi build for the win9x product line.
« Last Edit: January 04, 2006, 10:24:00 pm by killerbot »

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #9 on: January 04, 2006, 10:23:14 pm »
No, just WX_SUFFIX will do (and define undefine wxUSE_UNICODE of course).
« Last Edit: January 04, 2006, 10:27:22 pm by thomas »
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Michael

  • Lives here!
  • ****
  • Posts: 1608
Re: Win9x build/support of CB
« Reply #10 on: January 04, 2006, 10:29:52 pm »
My point is that to make it half-way work for a few people, we have to add yet another hack for everybody. This means increased download size, possibly reduced stability, and increased load times for everybody.
So it may be worth a consideration if you maybe just have to accept that Windows98 and Unicode don't do together (at least not easily).

May be a poll could be useful to get an idea (for inaccurate it would be) of how many users are using C::B and then decide what to do next.

@killerbot: An ANSI build will still have GDB issue. And I am not sure if you can solve this (anyway I hope to be wrong :)).

Michael

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #11 on: January 04, 2006, 10:34:55 pm »
could wx project , build for ansi and unicode coexist without renaming dirs ?

- some objects files go into gcc_mswudll (unicode) and gcc_mswdll(ansi) : ok here,
and then in <wx>\lib\gcc_dll we have some files in the subdir mswu(unicode) and mws (ansi), also ok.
and some files in some lib files in <wx>\lib\gcc_dll :
libwxexpot.a
libwxjpeg.a
libwxpng.a
libwxtiff.a
libwxzlib.a
------------------
libwxmsw26u.a
libwxregexu.a
wxmsw26u_gcc_cb.dll
------------------
libwxmsw26.aµ
libwxregex.a
wxmsw26_gcc_cb.dll

So if :
libwxexpot.a
libwxjpeg.a
libwxpng.a
libwxtiff.a
libwxzlib.a
don't provide conflicts when linked from ansi CB or unicode CB, things should be fine. Who knows the answer to this one ??

Because then I am also more in favour for building ansi and unicode as seperate builds.

Lieven

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #12 on: January 04, 2006, 10:35:46 pm »
PS : all this to started out for fixing a bug for file associations ;-) ;-)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #13 on: January 04, 2006, 10:38:40 pm »
You will have to move the output folder before building the second time, but the wx libraries can very well be under the same common root. I have it that way on my system, works without any kind of problems.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #14 on: January 04, 2006, 10:39:50 pm »
You will have to move the output folder before building the second time, but the wx libraries can very well be under the same common root. I have it that way on my system, works without any kind of problems.

EDIT:
Of course it would be a snap to add WX_PREFIX to the output directory too, then you don't have *anything* to consider.
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #15 on: January 04, 2006, 10:44:09 pm »
but then we also have to adjust the CB cbp files/makefiles.
This is also part of my point, it should be possible to build both with very little changes, either you have 2 different directories where you have wx-ansi and wx-unicode, but then you need to change the cbp/make files. Or am I missing something, I feel my brain is giving up on me.

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #16 on: January 04, 2006, 10:59:50 pm »
I am starting to think, that both ansi and unicode builds of WX can happen in the same wx project tree without renaming them, I suspect those import libs mentioned above that don't have an extra 'u' in their name to be unicode independent (no string manipulation).

Will try to build an ansi version and see what happens, crash boom bang or shaky da hippiediehop ?

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #17 on: January 04, 2006, 11:02:10 pm »
I can tell you what happens... it works just fine. I am doing that regularly. :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #18 on: January 04, 2006, 11:06:00 pm »
I can tell you what happens... it works just fine. I am doing that regularly. :)

hah, finally a good answer ;-)

I was just scared when I have read the wiki several weeks ago.

So for now, I will skip testing an unicode build on win98 (since I don't have it, and had to bother someone else), I will also create ansi builds and try to test the bugfix with that (well have someone do it for me ;-)  ).

Nevertheless, we should  make up our minds how we are going to officialy provide the win9x customer base ...

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Win9x build/support of CB
« Reply #19 on: January 05, 2006, 01:35:16 am »
Sigh...us poor 98 users...left in the dust, all alone with our sad, crippled machines... :(
Personally, I think that if C::B is really meant to be as cross-platform as possible, it only makes sense to have a build available for older versions of Windows, whether that be via libunicows or a separate ANSI build.  But then, I'm biased.

I will skip testing an unicode build on win98 (since I don't have it, and had to bother someone else), I will also create ansi builds and try to test the bugfix with that (well have someone do it for me ;-)  ).

Incidentally, Lieven and everyone else, I'm still happy to test stuff on 98, and help make sure that CB is in fact compatible with it.
« Last Edit: January 05, 2006, 03:58:19 am by duncanka »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #20 on: January 05, 2006, 02:08:26 am »
I wonder if someone was interested in seeing this:



Really, this time it'sn't me playing with MS Paint (well, I cut the screenshot using it, nothing else) :P

Really, believe it, it's GDB 6.3 running on Windows 98, and it no longer depends on that NT-only DLL.

Anyone interested in the url?

[Edit by Rick: Fixed the broken url.]
« Last Edit: January 05, 2006, 03:33:02 am by rickg22 »

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #21 on: January 05, 2006, 02:24:44 am »
[edit]
Rick: Thanks for fixing the link :D
[/edit]

Please report how it works. Those using any Windows NT (NT4/2k/XP/2k3/Vista) are free to update to that version too, I did already, but haven't tried yet.
« Last Edit: January 05, 2006, 04:25:49 am by Ceniza »

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Win9x build/support of CB
« Reply #22 on: January 05, 2006, 04:26:25 am »
If you'ven't noticed, the link is there, but since the idea is to help, here's again: gdb.

Please report how it works. Those using any Windows NT (NT4/2k/XP/2k3/Vista) are free to update to that version too, I did already, but haven't tried yet.
:shock: :shock: It works!!! HOORAY!! :D :D :D (Using Win98SE)
Thank you so much for pointing this out!

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #23 on: January 05, 2006, 07:17:23 am »
so what's left to decide is (since GDB no issue ):

1) CB as seperate ansi, or CB as libunicows (or no CB for win9x)
2) as much support as possible for it in the cbp/make files, so very little needs to be changed by hand if you want to build them both !!!


Lieven

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #24 on: January 05, 2006, 07:39:31 am »
Rick told me there's a bug when debugging with a Unicode version of Code::Blocks, so it should be ANSI in the meanwhile.

Someone with access to the project files in SVN should add those libraries to target SDK. Those won't hurt the current Unicode build but will help 9x builds.

After that, dunno, providing Unicode and ANSI is twice the work, twice the time. Only ANSI wouldn't be a problem, but they relly want us to convert to Unicode. And, at the end, using libunicows seems to be a hack.

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Win9x build/support of CB
« Reply #25 on: January 05, 2006, 07:46:06 am »
so what's left to decide is (since GDB no issue ):

1) CB as seperate ansi, or CB as libunicows (or no CB for win9x)
2) as much support as possible for it in the cbp/make files, so very little needs to be changed by hand if you want to build them both !!!

I'm not familiar with MSLU and whatnot, but if it would be a pain to maintain the framework for an ANSI version, might it be easier to provide a non-Unicode build that just uses unicows?  In other words, still a second build, but without most of the project/makefile adjustments (though it would still be more compile time, certainly).

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #26 on: January 05, 2006, 07:49:31 am »
Well, if the choices are "Unicode + ANSI" and "Unicode + libunicows", I vote "Unicode + ANSI".

Offline duncanka

  • Multiple posting newcomer
  • *
  • Posts: 53
Re: Win9x build/support of CB
« Reply #27 on: January 05, 2006, 07:53:17 am »
Well, if the choices are "Unicode + ANSI" and "Unicode + libunicows", I vote "Unicode + ANSI".
OK :)  Just wondering out loud.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #28 on: January 05, 2006, 09:34:52 am »
Someone with access to the project files in SVN should add those libraries to target SDK. Those won't hurt the current Unicode build but will help 9x builds.
That is not so certain. Adding the libraries to the project already means applying the hack.

I am very much against using this stuff. It tampers during startup and you don't really know what happens (ok, you do know what generally happens, but you know what I mean). This does not necessarily add to stability. Also, the documentation states that it requires a certain link order (before any other MS libraries), so I am not sure if it is possible to simply add it to the sdk target at all. Since wxWidgets links with MS libraries, you very likely have no other choice than to build wxWidgets with it.

It loads shared libraries at runtime which might otherwise have been subject to prefetching. I don't know if prefetching makes a big difference, but you'd think that they don't build such a feature if it isn't good for anything. True enough, Code::Blocks loads its plugins at runtime too, but in this case, we cannot avoid it.

Lastly, we need a proprietary MS dll in addition which has licensing terms that are very obviously not GPL compatible and has many other issues which are no trifles.
I am not even certain if redistributing the unicows runtime is legal for us at all (not under the conditions which apply for us).
I know that I am being pedantic here, but it is not me who writes perverse licenses...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5501
Re: Win9x build/support of CB
« Reply #29 on: January 05, 2006, 09:39:56 am »
@Thomas, very good arguments, but even if we want to have a seperate ansi build, 2 more libs need to be added, and probably these can always be added (even for unicode build), it's shfolder (and maybe the shell ) lib. So that does not even have to do with unicows.

One thing can (all cbp files) be made geenral enough so you can build an ansi and an unicode with it, and not having conflicts where they put their obj's and deliverables ? Same might apply to the normal build, and maybe optimized builds ? Because now no opt ?, debug info which gets stripped off in the update process.

Lieven

Offline tiwag

  • Developer
  • Lives here!
  • *****
  • Posts: 1196
  • sailing away ...
    • tiwag.cb
Re: Win9x build/support of CB
« Reply #30 on: January 05, 2006, 09:45:55 am »
for this we have global variables - we can move the WX_SUFFIX and the wxUSE_UNICODE
for example to #CB_BOPT  (C::B build options ) and use in all contrib project files ...

Offline Ceniza

  • Developer
  • Lives here!
  • *****
  • Posts: 1441
    • CenizaSOFT
Re: Win9x build/support of CB
« Reply #31 on: January 05, 2006, 09:52:09 am »
thomas: what I meant was to add libshfolder.a and libshell32.a to the sdk target. It has nothing to do with libunicows.

If that's also a hack for you then don't do it, we'll do it every time we build an ANSI version of Code::Blocks that works with 9x.

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Win9x build/support of CB
« Reply #32 on: January 05, 2006, 10:02:22 am »
thomas: what I meant was to add libshfolder.a and libshell32.a to the sdk target. It has nothing to do with libunicows.
Ooops, did not read properly there, as it seems ;)
I guess we have no choice but to use these, since we use SHGetFolderPath. So if it should be able to run on Windows98 at all...
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."