August 31, 2006
On Thu, 31 Aug 2006 09:28:51 +0200, Anders F Björklund wrote:

> Jona Joachim wrote:
> 
>>>It should have worked out of the box, using GNU Make ? ("gmake")
>> 
>> Unfortunately it doesn't work out of the box. There are always small changes that have to be made when porting to FreeBSD.
> 
> Yeah, isn't that always the case ? :-) (well, I tried my best...)
> Need to get around to setting up that FreeBSD environment some day.

That can be dangerous, perhaps you will like it so much that you will stick with it ;)

>> For example FreeBSD people tend to add version numbers to executables so that you can install multiple versions of a software in parallel. wx-config becomes wxgtk2-2.6-config. The good part is that you don't really have to worry about this: if you don't define the WX_CONFIG variable it will be defined automatically by the ports framework if you tell it that you plan to use wxWidgets.
> 
> That is why I introduced the WX_CONFIG parameter, so that any platforms that deviate from the standard wxWidgets name ("wx-config") can set it.

Perhaps you should check if WX_CONFIG is set and only set it if it is not already set because the way it is now you overwrite the WX_CONFIG variable. Perhaps you could do the same for the MAKE variable.

> I have several wx configs, and wx-config is a symlink to the one I use ?

I always had a symlink from sdl11-config to sdl-config but I nearly forgot some patches when porting SGE because of this so I decided to remove the symlink.

>> Furthermore the FreeBSD port of gdc doesn't come with gdmd. That's why I had to set DMD=gdc. I will change the syntax of the parameters.
> 
> OK, so the FreeBSD port sounds broken (it should ship the gdmd wrapper)

I checked again to be sure. It only installs the gdc and cc1d binaries.

>> A lot of small changes like these have to be made.
> 
> Thankful for any patches you have, I do want wxD to work on FreeBSD too.
> 
> http://sourceforge.net/tracker/?atid=729441&group_id=133831&func=browse

I put my FreeBSD specific patches here: http://webplaza.pt.lu/~mpjjjjsj/files/wxD/patch-wxd-Makefile http://webplaza.pt.lu/~mpjjjjsj/files/wxD/patch-wxd-wx-Makefile http://webplaza.pt.lu/~mpjjjjsj/files/wxD/patch-wxd-wxc-Makefile

Here is also the Makefile of the port in case you're interested:
http://webplaza.pt.lu/~mpjjjjsj/files/wxD/Makefile
Strangely I have to rename the GNUmakefiles to Makefile because gmake
doesn't find them otherwise when run from the port. Perhaps it is called
with -f Makefile, I don't know.

Furthermore
$(INSTALL) -p *.d $(libdir)/d/wx/
doesn't work:

install -p *.d /var/tmp/wxd/lib/d/wx/
install: wrong number or types of arguments
usage: install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 file2
       install [-bCcpSsv] [-B suffix] [-f flags] [-g group] [-m mode]
               [-o owner] file1 ... fileN directory
       install -d [-v] [-g group] [-m mode] [-o owner] directory ...

I tried
$(INSTALL) -p `ls -1 | grep -v Makefile` $(libdir)/d/wx/
but it returns the same error.

Jona

August 31, 2006
Jona Joachim wrote:

>>Need to get around to setting up that FreeBSD environment some day.
> 
> That can be dangerous, perhaps you will like it so much that you will
> stick with it ;)

Nah - thanks to the wonders of virtualization, I can have it all ! :-)

>>That is why I introduced the WX_CONFIG parameter, so that any platforms
>>that deviate from the standard wxWidgets name ("wx-config") can set it.
> 
> Perhaps you should check if WX_CONFIG is set and only set it if it is not
> already set because the way it is now you overwrite the WX_CONFIG
> variable. Perhaps you could do the same for the MAKE variable.

I'll try to come up with something clever, but it'll require /bin/sh

For some reason FreeBSD comes with the drain-bamaged csh by default,
and that won't do. It doesn't have to be bash, but something usable...

>>OK, so the FreeBSD port sounds broken (it should ship the gdmd wrapper)
> 
> I checked again to be sure. It only installs the gdc and cc1d binaries.

The tarball from http://dgcc.sourceforge.net is OK, so it's a Port bug.

> Strangely I have to rename the GNUmakefiles to Makefile because gmake
> doesn't find them otherwise when run from the port. Perhaps it is called
> with -f Makefile, I don't know.

Probably because it is calling "make" and not "gmake" ? (MAKE=gmake)

They are called GNUmakefile so that Digital Mars Make will miss them.

> Furthermore
> $(INSTALL) -p *.d $(libdir)/d/wx/
> doesn't work:

It requires GNU Install, so you need "coreutils" and a INSTALL=ginstall
(I must confess that I didn't test installing it, just building Samples)

Should probably have written explicity that it requires the GNU tools,
even if we do support the Digital Mars tools as well out of kindness.

--anders
August 31, 2006
On Thu, 31 Aug 2006 17:28:35 +0200, Anders F Björklund wrote:

> Jona Joachim wrote:
>> Perhaps you should check if WX_CONFIG is set and only set it if it is not already set because the way it is now you overwrite the WX_CONFIG variable. Perhaps you could do the same for the MAKE variable.
> 
> I'll try to come up with something clever, but it'll require /bin/sh
> 
> For some reason FreeBSD comes with the drain-bamaged csh by default, and that won't do. It doesn't have to be bash, but something usable...

sh is part of the FreeBSD base system so that will be fine. What's wrong with csh?

>> Strangely I have to rename the GNUmakefiles to Makefile because gmake doesn't find them otherwise when run from the port. Perhaps it is called with -f Makefile, I don't know.
> 
> Probably because it is calling "make" and not "gmake" ? (MAKE=gmake)

It actually calls gmake. In the port Makefile you can read USE_GMAKE=yes
I even put MAKE=gmake in the patches which is not a good idea since it
will only find gmake if it's in the path. The port sets this
variable automatically if you define USE_GMAKE.

>> Furthermore
>> $(INSTALL) -p *.d $(libdir)/d/wx/
>> doesn't work:
> 
> It requires GNU Install, so you need "coreutils" and a INSTALL=ginstall (I must confess that I didn't test installing it, just building Samples)

Ok, I'll try that

Jona
August 31, 2006
Jona Joachim wrote:
> The Linux version of DMD still produces Linux ELF binaries. I don't think
> the FreeBSD version of ld can link Linux object files.

So there's a pile of work to be done to support FreeBSD. Sigh - why does everyone have to invent their own omf?
August 31, 2006
Jona Joachim wrote:

>>For some reason FreeBSD comes with the drain-bamaged csh by default,
>>and that won't do. It doesn't have to be bash, but something usable...
> 
> What's wrong with csh?

Error redirects don't work it seems ? I recall a lot of fighting with
tcsh in Mac OS X 10.2, that all went away with Mac OS X 10.3 and bash

> It actually calls gmake. In the port Makefile you can read USE_GMAKE=yes
> I even put MAKE=gmake in the patches which is not a good idea since it
> will only find gmake if it's in the path. The port sets this
> variable automatically if you define USE_GMAKE.

I'll try your Port, and will follow up by email / on the wxD pages.
The code and programs work fine, it's just a little Make juggling...

--anders
August 31, 2006
On Thu, 31 Aug 2006 20:27:37 +0200, Anders F Björklund wrote:

> Jona Joachim wrote:
> 
>>>For some reason FreeBSD comes with the drain-bamaged csh by default, and that won't do. It doesn't have to be bash, but something usable...
>> 
>> What's wrong with csh?
> 
> Error redirects don't work it seems ? I recall a lot of fighting with tcsh in Mac OS X 10.2, that all went away with Mac OS X 10.3 and bash
> 
>> It actually calls gmake. In the port Makefile you can read USE_GMAKE=yes
>> I even put MAKE=gmake in the patches which is not a good idea since it
>> will only find gmake if it's in the path. The port sets this
>> variable automatically if you define USE_GMAKE.
> 
> I'll try your Port, and will follow up by email / on the wxD pages. The code and programs work fine, it's just a little Make juggling...

Yes. I also know why install failed. There's no need for ginstall, BSD
install handles it fine but you forgot
$(INSTALL) -d $(libdir)/d/wx/

Jona
August 31, 2006
Jona Joachim wrote:

>>The code and programs work fine, it's just a little Make juggling...
> 
> Yes. I also know why install failed. There's no need for ginstall, BSD
> install handles it fine but you forgot
> $(INSTALL) -d $(libdir)/d/wx/

Thanks, silly typo there... (fixed, but it's the files that were wrong)

---anders
August 31, 2006
On Thu, 31 Aug 2006 20:27:37 +0200, Anders F Björklund wrote:

> Jona Joachim wrote:
> 
>>>For some reason FreeBSD comes with the drain-bamaged csh by default, and that won't do. It doesn't have to be bash, but something usable...
>> 
>> What's wrong with csh?
> 
> Error redirects don't work it seems ? I recall a lot of fighting with tcsh in Mac OS X 10.2, that all went away with Mac OS X 10.3 and bash
> 
>> It actually calls gmake. In the port Makefile you can read USE_GMAKE=yes
>> I even put MAKE=gmake in the patches which is not a good idea since it
>> will only find gmake if it's in the path. The port sets this
>> variable automatically if you define USE_GMAKE.
> 
> I'll try your Port, and will follow up by email / on the wxD pages. The code and programs work fine, it's just a little Make juggling...
> 
> --anders

I corrected some stuff. The port should now build and install correctly.

Here is a gzipped tarball of the port: http://webplaza.pt.lu/~mpjjjjsj/files/wxd.tar.gz

Here is an i386 binary package: http://webplaza.pt.lu/~mpjjjjsj/files/wxd-0.07.tbz
August 31, 2006
On Thu, 31 Aug 2006 10:55:44 -0700, Walter Bright wrote:

> Jona Joachim wrote:
>> The Linux version of DMD still produces Linux ELF binaries. I don't think the FreeBSD version of ld can link Linux object files.
> 
> So there's a pile of work to be done to support FreeBSD. Sigh - why does everyone have to invent their own omf?

Yeah, it's really not making things easy.
Personally I have no idea how much different the FreeBSD ABI is from the
Linux one. I don't have the knowledge and skills to write a compiler
either.

I only know of a document which explains how FreeBSD loads Linux binaries [1] but this won't help you very much.

However if some day you have some spare time and decide to port DMD to
FreeBSD I am sure that the FreeBSD community will give you all necessary
details if you ask.
About 2 weeks ago somebody wrote on the FreeBSD questions mailing list
that he had talked to a RealPlayer developer and she told him that they
would love to provide native FreeBSD binaries if some FreeBSD experts
assist them. Less than 12h later somebody volunteered to help out.


[1]:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/linuxemu-advanced.html
http://www.freebsd.org/cgi/getmsg.cgi?fetch=1697235+0+/usr/local/www/db/text/1999/freebsd-chat/19990607.freebsd-chat

August 31, 2006
Jona Joachim wrote:

> I corrected some stuff. The port should now build and install correctly.
> 
> Here is a gzipped tarball of the port:
> http://webplaza.pt.lu/~mpjjjjsj/files/wxd.tar.gz

Thanks for the files. The patches and the workarounds should not
be needed with wxD 0.08 (wonder about the DESTDIR changes though,
those shouldn't really be necessary, will have to investigate it)

But I'll make sure to test a Port on the PC-BSD before release...
As it is now, wxD is in a Alpha release and only supports static
linking of the wx libraries. With the Beta release, that'll change.

Also - had a contribution for wXAUI, so that's going into 0.08 too.

--anders