MINGW newLISP compile

Started by HPW, September 15, 2004, 02:30:02 AM

Previous topic - Next topic

HPW

Hello Lutz,



After having a running setup for compiling the previous borland version, I now want to be able to compile the GCC version.



Can you post a description what to do to get it run?



Where to download what?

How to install on Windows?

Any setting of path/enviroment?

How to compile?





PS: This time hurricane Ivan seems to (hopefully) miss you!

(from http://www.weather.com/index.html">http://www.weather.com/index.html)
Hans-Peter

Lutz

#1
For the MinGW compiler the only file yo install you need is: MinGW-3.1.0-1.exe from http://www.mingw.org/">http://www.mingw.org/ go to the download page and look for that file in the 'current' section.



You will need a make utility, you can use the file 'mingw32-make-3.80.0-3.exe' from the same page. This will install  ming32-make.exe, which you can rename to make.exe or simply do:



c:newlispnewlisp-8.1.7> MinGWbinming32-make -f makefile-mingw



If you rename you can also put c:MinWWbin in your pass. And then just do:



c:newlispnewlisp-8.1.7> make mingw



Don't get stressed if certain qa routines like the once launching another process don't work right away, test those features by hand, e.g.  net-receive-udp. I am working on improving those routines accross platforms.



Before compilong the DLL remove all *.o files first. There is also a 'make  clean' but that will only work with more other stuff installed.



Lutz



ps: Ivan missed us going more to the west

Lutz

#2
I think 'mingw32-make.exe' is already contained in the first 'MinGW-3.1.0-1.ex' installation, so you may not need the other file.



Lutz

HPW

#3
Lutz,



Thanks for the info. Will try it.



And what about the WINCE-compile.

As we know, you have had some trouble to get it work.

So a final todo-list how to get it compiled would be also nice.

(I know that I should test, still in search for hardware)

;-)
Hans-Peter

Lutz

#4
You only need to install arm-wince-pe.rar from http://mamaich.kasone.com/">http://mamaich.kasone.com/ for other info see the headers in makefile_wince and makefile_wincedll.



Lutz

HPW

#5
Got it compiled!



But your call has 2 typos!



Here corrected:

c:newlispnewlisp-8.1.7> MinGWbinmingw32-make -f makefile_mingw

c:newlispnewlisp-8.1.7> MinGWbinmingw32-make -f makefile_mingwdll



When compiling DLL I get some warnings:
Quote
c:/MinGW/bin/dllwrap *.o --enable-stdcall-fixup --def win32dll.def -o newlisp.dll -lws2_32

Warning: resolving _WEP by linking to _WEP@4

Use --enable-stdcall-fixup to disable these warnings

Use --disable-stdcall-fixup to disable these fixups

Warning: resolving _dllEvalStr by linking to _dllEvalStr@4

Warning: resolving _dllName by linking to _dllName@4

Warning: resolving _newlispEvalStr by linking to _newlispEvalStr@4

Warning: resolving _WEP by linking to _WEP@4

Use --enable-stdcall-fixup to disable these warnings

Use --disable-stdcall-fixup to disable these fixups

Warning: resolving _dllEvalStr by linking to _dllEvalStr@4

Warning: resolving _dllName by linking to _dllName@4

Warning: resolving _newlispEvalStr by linking to _newlispEvalStr@4

c:/MinGW/bin/strip newlisp.dll


Anything to worry or normal output?

Resulting DLL is correct in size and works.
Hans-Peter

pjot

#6
A little off-topic, but maybe nice to know: compiling with MinGW delivers a smaller binary compared with a Borland compilation. However, it is possible to decrease the size of the resulting newLisp binary with almost 50% by using UPX.



The nice thing of UPX is that you can run the compressed .exe just as if it were the original .exe without any noticable performance loss.



I compressed newLisp.exe using UPX, and it decreased from 171520 to 80896 bytes (ratio 47.16%). Also it is possible to compress DLL's and Linux binary's. Testing my newLisp programs after UPX compression showed no problems at all.



The website of the free UPX compression tool can be found at:



http://upx.sourceforge.net">http://upx.sourceforge.net

Lutz

#7
Hans-Peter:  don't worry about those warnings, I get the same, and they don't seem to be dangerous. All my tests on the mingwdll flavor are passed fine.



The --enable-stdcall-fixup warning seems to be a MinGW mistake becuase i *do* specify that option.



The other warnings have to do with the form of the 'win32dll.def' file and also may be a MinGW problem, when generating win32dll.def with 'pexports.exe newlisp.dll'  the def file generated gives the same error messages. The generated file will have the same form, but without the ordinals @1 - @4.



Peter: thanks for the tip about UPX



Lutz

HPW

#8
I used a runtime-compressor for newLISP.DLL since I started with the neobook plugin.



I do not use UPX for my plugins because a decompressor exists.

With other runtime-compressors you get some kind of protection.
Hans-Peter