Hi,
cross-development with GRX has always required some manual hacking: You have to adjust compiler, linker, etc. manually, and when you try to use, for instance, makefile.dj2 under GNU/Linux, `make clean' fails because the shell does not like `if exist foo.o del foo.o'.
The attached `diff' patches the configure script and the makefiles such that all this works automatically. :-)
If you do not cross-compile, you should not notice the difference, but, as I do not have a self-hosting DJGPP or MINGW intalled, I did not test this.
How this works: - The target directory is now named INSTALLDIR for all platforms. (This makes it much easier and less error-prone to configure it automatically.) - There is a new variable CROSS_PLATFORM which contains the prefix for the cross development tools (e.g. "i386-mingw32-" when you want to use i386-mingw32-gcc instead of plain gcc). - There is a new variable HAVE_UNIX_TOOLS. When set to "y", the DJ2 and W32 makefiles use "rm" instead of "del", "cp" instead of "copy", etc. This is needed for cross-development, but it is also useful if you are working with a self-hosting DJGPP or mingw32. - You can edit all this in makedefs.grx. In addition, the configure script has been adapted to set these variables automatically if you feed it with a GCC-style target specification such as "--target=i386-pc-msdosdjgpp".
Have fun,
Peter
Peter Gerwinski wrote:
cross-development with GRX has always required some manual hacking: You have to adjust compiler, linker, etc. manually, and when you try to use, for instance, makefile.dj2 under GNU/Linux, `make clean' fails because the shell does not like `if exist foo.o del foo.o'.
The attached `diff' patches the configure script and the makefiles such that all this works automatically. :-)
Just a few small notes:
The diff contained two changes to reset your own configuration values to the defaults (USE_INOUTP_FRAMEDRIVERS and INSTALLDIR) and a diff of makedefs.orig. These resulted in two failed hunks and a failed patch, but harmless.
The core problem is that configuring GRX (manually or automatically) modifies files which are also distributed. This makes patch generation a bit harder. I've also had this problem when I made patches. I'm thinking about letting configure create a file `makefile' which includes makedefs.<target> and does the configured settings. This would solve this problem at least when using configure.
BTW, one could think about setting HAVE_UNIX_TOOLS=y unconditionally from configure since configure requires Unix tools anyway. But I'm not changing it. (However, I'm adding some quoting in configure, just to be paranoid.)
You missed a few `' and one command.com style command (mostly in the uninstall rules which I suppose you don't use; me neither). I hope I caught them all now.
The attached patch is to be applied instead of Peter's patch (it omits the spurious hunks).
Frank
Just a small update, to be applied on top of my corrected version of Peter Gerwinski's patch of 2004-04-26:
- configure: recognize `mingw32' as a target description.
- Use `$(PC)' instead of `gpc' in makefiles, and set it appropriately when configured for cross-compiling. Use `$(CC)' in a few places where `gcc' was used.
- Remove some old instances of `GRXMain' from Pascal makefiles.
Frank