Re: [AD] MSVC long paths with spaces |
[ Thread Index |
Date Index
| More lists.liballeg.org/allegro-developers Archives
]
On Saturday 08 January 2005 11:09, Michal Molhanec wrote:
> So here is a real patch. It modifies fix.bat, msvc._tx and adds one new
> file. The msvc._tx includes parts written by Phil Shenk submitted here
> by Evert. As it doesn't modify any makefile I hope it does not brake
> anything :-). Tested on WinXP + MSVC 7.1 (.NET 2003) + MinGW 3.4.2 and
> on Win98 + MSVC 6.0 + MinGW 3.3.1 (it's not needed on this platform, but
> it still works). My English in docs patch needs probably some
cleaning :-)
Commited the attached patch, which is only slightly different where the
wording in the docs is concerned.
Evert
? keyboard.dat
? language.dat
? src/fonttxt.c
Index: fix.bat
===================================================================
RCS file: /cvsroot/alleg/allegro/fix.bat,v
retrieving revision 1.12
diff -u -r1.12 fix.bat
--- fix.bat 21 Sep 2003 12:44:13 -0000 1.12
+++ fix.bat 16 Jan 2005 11:50:59 -0000
@@ -4,13 +4,21 @@
rem and if possible converting text files from LF to CR/LF format.
rem Test if there are too many args.
-if [%3] == [] goto arg2
+if [%4] == [] goto arg3
+goto help
+
+:arg3
+rem Test if third arg is ok.
+if [%3] == [--quick] goto arg2
+if [%3] == [--msvcpaths] goto arg2
+if [%3] == [] goto arg2
goto help
:arg2
rem Test if second arg is ok.
-if [%2] == [--quick] goto arg1
-if [%2] == [] goto arg1
+if [%2] == [--quick] goto arg1
+if [%2] == [--msvcpaths] goto arg1
+if [%2] == [] goto arg1
goto help
:arg1
@@ -69,18 +77,39 @@
:help
echo.
-echo Usage: fix platform [--quick]
+echo Usage: fix platform [--quick] [--msvcpaths]
echo.
echo Where platform is one of: bcc32, djgpp, mingw32, msvc or watcom.
+echo.
echo The --quick parameter is used to turn off LF to CR/LF conversion.
echo.
+echo Use the --msvcpaths parameter if your MSVCDir variable contains
+echo spaces (you can view content of that variable by typing
+echo SET MSVCDir
+echo on the command line). Remember that this will only work if you
+echo have MinGW gcc in your PATH.
+echo.
goto end
+:convertmsvcdir
+echo Converting MSVCDir path...
+gcc -s -o msvchelp.exe misc/msvchelp.c
+msvchelp MSVCDir
+del msvchelp.exe
+echo include makefile.helper >> makefile
+goto realtail
+
:tail
+
+if [%3] == [--msvcpaths] goto convertmsvcdir
+if [%2] == [--msvcpaths] goto convertmsvcdir
+
+:realtail
rem Generate last line of makefile and optionally convert CR/LF.
echo include makefile.all >> makefile
if [%2] == [--quick] goto done
+if [%3] == [--quick] goto done
if [%1] == [bcc32] goto done
if [%1] == [mingw32] goto done
Index: docs/src/build/msvc._tx
===================================================================
RCS file: /cvsroot/alleg/allegro/docs/src/build/msvc._tx,v
retrieving revision 1.4
diff -u -r1.4 msvc._tx
--- docs/src/build/msvc._tx 26 Nov 2003 14:02:40 -0000 1.4
+++ docs/src/build/msvc._tx 16 Jan 2005 11:51:00 -0000
@@ -48,12 +48,13 @@
<li>MinGW: compiler (mingw-runtime, gcc, binutils).<br>
GNU make.<br>
Optional: GNU sed. Used by "<tt>make depend</tt>" and "<tt>fixdll.bat</tt>".<br>
- Optional: GNU sort (textutils). Used by "<tt>fixdll.bat</tt>".<br><br>
+ Optional: GNU sort (textutils). Used by "<tt>fixdll.bat</tt>".<br>
+ Optional: w32api. See next section about details.<br><br>
<li>Cygwin: compiler (cygwin, gcc, binutils).<br>
GNU make.<br>
Optional: GNU sed. Used by "<tt>make depend</tt>" and "<tt>fixdll.sh</tt>"<br>
- Optional: GNU sort (textutils). Used by "<tt>fixdll.sh</tt>".<br><bt>
+ Optional: GNU sort (textutils). Used by "<tt>fixdll.sh</tt>".<br><br>
</ul></ul>
Allegro should work ok with MSVC versions 4, 5, 6 and 7.
@@ -79,6 +80,9 @@
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.
+ Remember that the chosen set of tools have to be on your PATH during the
+ building of Allegro.
+
@heading
@@ -94,6 +98,27 @@
Windows 2000, you will have to run this file every time you open a DOS box
or configure the environment variables in Control Panel/System/Environment.
+ The make process needs all the path variables to be in DOS 8.3 format, and
+ since MSVC is usually installed in something like
+ "<tt>C:\Program Files\Microsoft\Microsoft Visual Studio .NET 2003</tt>",
+ this will cause a problem. Run "<tt>echo %MSVCDir%</tt>" from the command
+ line to see if you have this problem. If you are using MSVC 6 or lower the
+ output should already be in DOS 8.3 format so you should not have any
+ troubles. With higher versions of MSVC it will probably show the long path
+ with spaces. There are two solutions for this.
+
+ If you have chosen MinGW and have installed it with the w32api package
+ you can solve this problem simply by passing to <tt>--msvcpaths</tt>
+ parameter to <tt>fix.bat</tt> (see below).
+
+ Otherwise if you are using <tt>vcvars32.bat</tt>, you will have to
+ edit it so that it sets the 8.3 paths, not the long versions.
+ To get 8.3 path names, you can use the command prompt (<tt>cmd.exe</tt>).
+ Type in "<tt>dir /x</tt>" to get a listing of the 8.3 file and directory
+ names alongside of their full names. You can also use the DOS prompt
+ (<tt>command.exe</tt>) and "<tt>dir</tt>", but this will only show
+ you the 8.3 names.
+
If you are using Cygwin as the GNU environment, start the Cygwin bash shell
from the command prompt (if you used the command prompt to run <tt>vcvars32.bat</tt>
then you must start Cygwin in the same command-prompt window you used to
@@ -103,7 +128,9 @@
Go to the directory where you have installed Allegro by using '<tt>cd</tt>'.
If you are using Cygwin, type "<tt>./fix.sh msvc --utod</tt>". Otherwise (i.e if
- you are using DJGPP or MinGW), type "<tt>fix.bat msvc</tt>".
+ you are using DJGPP or MinGW), type "<tt>fix.bat msvc</tt>". If you are
+ using MinGW and want the <tt>fix.bat</tt> to solve problems with long paths,
+ type "<tt>fix.bat msvc --msvcpaths</tt>".
If you are compiling from CVS, before continuing you must run both
"<tt>make depend</tt>" and "<tt>misc/fixdll.sh</tt>" as explained below, or the build will