Re: [AD] Patch for makefile issue when compiling MSVC with Cygwin

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Nice work guys.

I finally got to test the MSVC 6 build under Win98/DJGPP and Win2000/Cygwin, and in both cases, it works.

The only thing I have my doubts about is using "ifeq ($(TERM), cygwin)" to test to see if ALLEGRO_USE_CYGWIN should be set. In build/mingw32.txt, it tells the user to place "export ALLEGRO_USE_CYGWIN=1" in '/etc/profile'. In the interests of consistency, I think we should mention this in build/msvc.txt as well so we don't have to bother with ifeq ($(TERM), cygwin)

Anyway, here's a list of the changes made by the four attatched patches:

makefile.vc
+ Removed the check for ifeq ($(TERM), cygwin) - just used ifdef ALLEGRO_USE_CYGWIN instead.

fix.bat
+ Added two comments to clarify what's going on. One is a reminder that in DOS/Windows environment-variables are case-insensitive (this is in case anyone wonders how MSVC6's %MSVCDIR% variable is handled).

mingw32._tx
+ Fixed a typo: followin -> following
+ Added in the Cygwin part: "When setup asks you which line endings you want, select unix-style instead of DOS."

msvc._tx
+ Mention a bit about putting export ALLEGRO_USE_CYGWIN=1 in /etc/profile

Incidentally, I think that an earlier version of the fix that just involves changing one file (I think the last version of the makefile.vc patch that I posted) should be placed on the website until 4.2.2 is released. This is so that anyone having trouble building 4.2.1 for MSVC with Cygwin can just patch one file instead of having to patch two (or three if you include msvc.tx_) files.

AE.
--- mingw32._tx.old	2005-12-31 11:18:52.000000000 +0100
+++ mingw32._tx	2007-01-07 15:15:24.053214400 +0100
@@ -185,9 +185,10 @@
 <blockquote>
    1. Make sure you have a working Cygwin installation. You can download the
       <tt>setup.exe</tt> program from '<link>http://sources.redhat.com/cygwin/</a>'.
-      You will need the followin packages: bash, binutils, cygwin, cygutils,
+      You will need the following packages: bash, binutils, cygwin, cygutils,
       fileutils, gcc, gdb, login, make, man, mingw-runtime, sed, sh-utils,
-      texinfo, textutils and w32api.
+      texinfo, textutils and w32api. When setup asks you which line endings you
+      want, select unix-style instead of DOS.
 
    2. Get the minimal DirectX 7 SDK for MinGW. (<tt>dx70_mgw.zip</tt>) Download it
       from '<link>http://alleg.sourceforge.net/wip.html</a>' and unzip it to a
--- msvc._tx.old	2007-01-05 22:57:52.000000000 +0100
+++ msvc._tx	2007-01-07 15:29:01.859161600 +0100
@@ -80,7 +80,11 @@
    If you choose Cygwin, get <tt>setup.exe</tt> from '<link>http://sources.redhat.com/cygwin/</a>'.
    Start the Cygwin setup program and download the required packages. Then
    install the packages (run <tt>setup.exe</tt> once more). When setup asks you which
-   line endings you want, select unix-style instead of DOS.
+   line endings you want, select unix-style instead of DOS. Put the following text in
+   '<tt>/etc/profile</tt>' (<tt>c:\cygwin\etc\profile</tt>)
+<textblock>
+	 export ALLEGRO_USE_CYGWIN=1
+<endblock>
 
    Remember that the chosen set of tools have to be on your PATH during the
    building of Allegro.
--- makefile.vc.old	2007-01-05 22:55:48.000000000 +0100
+++ makefile.vc	2007-01-07 14:48:18.495777600 +0100
@@ -32,8 +32,7 @@
 
 PLATFORM_DIR = obj/msvc
 
-ifeq ($(TERM), cygwin)
-   ALLEGRO_USE_CYGWIN=1
+ifdef ALLEGRO_USE_CYGWIN
    UNIX_TOOLS = 1
 endif
 
--- fix.bat.old	2007-01-05 22:57:22.000000000 +0100
+++ fix.bat	2007-01-07 14:44:59.780038400 +0100
@@ -109,8 +109,10 @@
 :msvccommon
 echo MAKEFILE_INC = makefile.vc >> makefile
 echo #define ALLEGRO_MSVC >> include\allegro\platform\alplatf.h
+REM MSVC 8 uses %VCINSTALLDIR% instead of %MSVCDir%
 if "%MSVCDir%" == "" set MSVCDir=%VCINSTALLDIR%
 if "%MSVCDir%" == "" echo Your MSVCDir environment variable is not set!
+REM MSVC 6 uses MSVCDIR, but DOS/Windows environment-variables are case-insensitive
 
 REM msvc6 does not need this, msvc is fallback so we should do it anyway
 if [%1] == [msvc6]         goto skipconvert


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/