GNOME Bugzilla – Bug 503602
Glib nmake makefile doesn't work.
Last modified: 2007-12-21 10:18:53 UTC
Please describe the problem: There are compilation errors when you try to build glib using nmake (the visual c++ make util, on windows). Steps to reproduce: 1. checkout the code from svn 2. run win32-fixup.pl 3. run nmake -f makefile.msc Actual results: there are build errors. Expected results: It should build glib. Does this happen every time? yes Other information:
Created attachment 100955 [details] [review] patch for the build folder (inside the glib folder, from an external svn repo)
Created attachment 100956 [details] [review] part of the patch that can be applied to the glib folder.
I'm getting a lot of output like: NMAKE : fatal error U1073: don't know how to make '\.obj' Stop. NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\nmake.exe"' : return code '0x2' Stop. NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\nmake.exe"' : return code '0x2' Stop. C:\cygwin\home\cody\gnome\glib-2.14.4>nmake -nologo -f makefile.msc sub-one THIS=gmodule TARGET=all cl -G5 -GF -MD -W3 -nologo -Ox -Zd -FImsvc_recommended_pragmas.h -I .. -I . -I ..\glib -DHAVE_CONFIG_H -DG_LOG_DOMAIN=\"GModule\" -LD -Felibgmodule-2.0-0.dll gmodule.obj gmodule.res ..\glib\glib-2.0.lib /link /machine:ix86 /implib:gmodule-2.0.lib /def:gmodule.def 'cl' is not recognized as an internal or external command, operable program or batch file. NMAKE : fatal error U1077: 'cl' : return code '0x1' Stop. NMAKE : fatal error U1077: '"c:\Program Files\Microsoft Visual Studio .NET 2003\SDK\v1.1\Bin\nmake.exe"' : return code '0x2' Stop. I obviously don't have stuff setup correctly to test this. Can you give some more information on how to build with nmake? Maybe I just don't have paths setup right or something, but it might be more than that. I'm not sure. I've tried under both a DOS prompt window and from a cygwin window and the results are the same.
there is glib/trunk/README.win32 describing some of the build configuration. Of course it does not describe how to setup the compiler. There usually is a "Visual Studio xxxx Command Prompt"-link installed which sets up PATH end some other environment variables, so that at least 'cl' should not fail. (cl is the command line version of the msvc compiler.
Yeah, I misread the output from the Visual Studio prompt. I'm getting: NMAKE : fatal error U1073: don't know how to make '\.obj' NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2' NMAKE : fatal error U1077: '"C:\Program Files\Microsoft Visual Studio .NET 2003\VC7\BIN\nmake.exe"' : return code '0x2' Stop.
Cody: now I notice taht you are trying to build from a tarball. You'll have better luck from SVN with at least the following fix: Revision: 6076 Author: hans Date: 15:38:26, Sonntag, 9. Dezember 2007 Message: 2007-12-09 Hans Breuer <hans@breuer.org> * **/makefile.msc glib/makefile.msc.in : removed -GD to compile with msvc9 (vs2008) with less complains * glibconfig.h.win32.in : #define G_HAVE_ISO_VARARGS 1 for msv8 (vs2005) and above * glib/gfileutils.c : s/stricmp/_stricmp/ * msvc_recommended_pragmas.h : work around Microsoft's premature attempt to deprecate the C-Library * tests/makefile.msc.in : added checksum-test ---- Modified : /trunk/ChangeLog Modified : /trunk/gio/makefile.msc Modified : /trunk/glib/gfileutils.c Modified : /trunk/glib/gnulib/makefile.msc Modified : /trunk/glib/pcre/makefile.msc Modified : /trunk/glibconfig.h.win32.in Modified : /trunk/msvc_recommended_pragmas.h Modified : /trunk/tests/makefile.msc.in
Comment on attachment 100955 [details] [review] patch for the build folder (inside the glib folder, from an external svn repo) the patch is just changing some versions/file placements. They seem as arbitrary as the ones already in svn. It is expected to adapt win32/make.msc to the users installation
Lieven: some of the change I've not applied, e.g. disabling the gio build is not necessary anymore. The other things just got committed. Thanks. 2007-12-09 Hans Breuer <hans@breuer.org> * tests/gio-ls.c : adapt to recent api changes * tests/testglib.c : variable declaration at the beginning of a block (Lieven van der Heide, #503602) * win32-fixup.pl : process *.rc.in as well; substitute LT_CURRENT_MINUS_AGE * glib/makefile.msc.in : alphabetic sorting of OBJECTS