BMK modifications

BlitzMax Forums/BlitzMax Programming/BMK modifications

Brucey(Posted 2007) [#1]
Hallo :-)

I'm updating my tweaked BMK to support the new MinGW that the next BlitzMax will use.

Dream, what are those compiler options you recommend?

I also need to add a new command-line flag to allow for custom appstubs (since hacking the OS X appstub is getting tiresome) - thanks to Blueapples for that spark of inspiration ;-)


Brucey(Posted 2007) [#2]
okay... this works for me :-)

bmk makeapp -t gui -d -b bah.appstub splash.bmx

..using a custom (ie. not brl.appstub) appstub module to build an app with.
Therefore, on Mac, one can now build both Cocoa (MaxGUI etc) and Carbon (wxWidgets) BlitzMax apps without needing to hack any official modules. Nice...

All it needs now is adding to the IDE as another build option, with perhaps the stub name in the IDE Options... pah...


grable(Posted 2007) [#3]
How about adding this to your bmk?

in file bmk_make.bmx at line 215
If imp.StartsWith( "-dll:") Then
	ext_files.AddLast RealPath(imp[5..])
Else
	ext_files.AddLast imp
EndIf
Continue


And you can statically import dlls like so:
Import "-dll:dlltest.dll"

Extern
	Function ShowMessage()
EndExtern

ShowMessage()


Neat huh? =)

its the same as running pexports+dlltool+ranlib (but why do it manually when ld does it for you? hehehe)


Brucey(Posted 2007) [#4]
Hey, that's cool :-)

Any more?


MGE(Posted 2007) [#5]
There really needs to be some kind of noob tutorial for all these mods, with their pros/cons, etc, step by step, etc, etc. Oh well..perhaps I'm asking too much. ;)


LarsG(Posted 2007) [#6]
what they really need, is to be officially integrated into the new bmk/IDE. :)


Dreamora(Posted 2007) [#7]
I use the -march=pentium-m flag instead of the pentium1 flag used in the original BMK.
This adds MMX, SSE and SSE2 flag.
Due to libpng, I needed to use disable flag for MMX again, libpng will blow up otherwise.


iprice(Posted 2007) [#8]
Where do I have to modify the bmk sources to add this?


Matthew Smith(Posted 2007) [#9]
Check the Src folder in the help tree (MaxIDE)


iprice(Posted 2007) [#10]
I checked it, I'd like to know which var I have to change. cc, bcc or another one (I assume its the bmk_make source)?


Dreamora(Posted 2007) [#11]
search for -march and you will see.
Should be the opt when I remember correctly.


Filax(Posted 2007) [#12]
Does it work with blitzmax 1.26 ?


Derron(Posted 2007) [#13]
@faktor


1) open "blitzmaxinstalldir/src/bmk/bmk_util.bmx"
2) search "function compileC"
3) search ?Win32 ... "opts:+"
4) replace like you wish
5) build the file (F5)
6) copy the new "bmk.exe" into "blitzmaxinstalldir/bin"

7) open BlIDE
8) select "Modules - Advanced Modules Builder" (or so)
9) click on "inverse selection"
10) deselect all things with "jpg", "tga", "png" (brl.pngloader and so on)
11) deselect axe.maxgui (or where it was included)
12) press "build modules"
13) wait until finished

14) all modules are now compiled using your installed mingw/gcc-version and the settings made in the "bmk_util.bmx"-file



Didn't test if step 10 and 11 are needed in v1.26.


bye
MB


iprice(Posted 2007) [#14]
Thanks, I now have

opts:+" -march=pentium-m -ffast-math -fno-exceptions -O3 -fomit-frame-pointer"

Edit: ok, didn't work with all the those flags...

Edit2: opts:+" -march=pentium-m -ffast-math -fno-exceptions" didn't work, too...


Dreamora(Posted 2007) [#15]
you need to add the mmx deactivation flag, otherwise the png lib and a few others won't compile.

haven't tested the modified bmk with BM 1.26 yet.


Muttley(Posted 2007) [#16]
As Dreamora says, try:

opts:+" -march=pentium-m -mno-mmx -ffast-math -fno-exceptions -O3 -fomit-frame-pointer"


iprice(Posted 2007) [#17]
That didn't do the trick either...

Still get:

D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(png.c.release.win32.x86.o)(.text+0x7b8):png.c: undefined reference to `png_mmx_support'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xa1d):pngread.c: undefined reference to `png_combine_row'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xc04):pngread.c: undefined reference to `png_read_filter_row'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xc7d):pngread.c: undefined reference to `png_do_read_interlace'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xc97):pngread.c: undefined reference to `png_combine_row'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xcbf):pngread.c: undefined reference to `png_combine_row'
D:/BlitzMax/mod/pub.mod/libpng.mod/libpng.release.win32.x86.a(pngread.c.release.win32.x86.o)(.text+0xcd2):pngread.c: undefined reference to `png_combine_row'


Derron(Posted 2007) [#18]
Just compile all files except the image-modules (and gui).

For this - I prefer using the blide-advanced-module-builder (inverse selection like the steps above mention it).


@f4ktor - einfach alle anderen Module kompilieren, die PNG&Co-Module deaktivieren und nicht mit durch den G++ jagen.


bye
MB


andre72(Posted 2007) [#19]
Can somebody can give me a hint please where to find the compiler options for the fasm ...
Google couldn't help.

Also I tried to use fasm 1.67.23 which seems to don't work with BM ...
Any changes to make it working or isn't it compatible?


Gabriel(Posted 2007) [#20]
what they really need, is to be officially integrated into the new bmk/IDE. :)

Amen.


Dreamora(Posted 2007) [#21]
Can somebody can give me a hint please where to find the compiler options for the fasm ...


start of by crawling down the calling tree of the makeapp command argument case


andre72(Posted 2007) [#22]
Thanks Dreamora - but I mean the options for the fasm.
At the fasm docs are not so much description for...


grable(Posted 2007) [#23]
Can somebody can give me a hint please where to find the compiler options for the fasm ...

Im not sure there are any of value, the only ones i can find for v1.67.23 are:
 -m <limit>  set the limit in kilobytes for the memory available to assembler
 -p <limit>  set the maximum allowed number of passes



andre72(Posted 2007) [#24]
Yes grable you're right - also the only ones I found at the source too.
So I think there's no way to tune up - thanks---


SebHoll(Posted 2007) [#25]
I use the -march=pentium-m flag instead of the pentium1 flag used in the original BMK.
This adds MMX, SSE and SSE2 flag.
Due to libpng, I needed to use disable flag for MMX again, libpng will blow up otherwise.


I made the tweak you recommended for enabling MMX, SSE and SSE2, but also found the same problem with libpng. However, I managed to fix it by copying the the latest libpng (v1.2.22) source files into the BlitzMax\mod\pub.mod\libpng.mod\ directory, and rebuilding modules.