]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - mkfiles.pl
Fix error reporting pointer parameters in winsecur.c.
[PuTTY.git] / mkfiles.pl
index 1e9303270d4c910c26b87510f00c9f51fbcaac84..1570f2564b1af2ce225849dcc5bf206566a43368 100755 (executable)
@@ -47,8 +47,8 @@ open IN, "Recipe" or do {
 # HACK: One of the source files in `charset' is auto-generated by
 # sbcsgen.pl, and licence.h is likewise generated by licence.pl. We
 # need to generate those _now_, before attempting dependency analysis.
-eval 'chdir "charset"; require "sbcsgen.pl"; chdir ".."; select STDOUT;';
-eval 'require "licence.pl"; select STDOUT;';
+eval 'chdir "charset"; require "./sbcsgen.pl"; chdir ".."; select STDOUT;';
+eval 'require "./licence.pl"; select STDOUT;';
 
 @srcdirs = ("./");
 
@@ -441,10 +441,10 @@ $orig_dir = cwd;
 if (defined $makefiles{'cygwin'}) {
     $dirpfx = &dirpfx($makefiles{'cygwin'}, "/");
 
-    ##-- CygWin makefile
+    ##-- MinGW/CygWin makefile (called 'cygwin' for historical reasons)
     open OUT, ">$makefiles{'cygwin'}"; select OUT;
     print
-    "# Makefile for $project_name under Cygwin, MinGW, or Winelib.\n".
+    "# Makefile for $project_name under MinGW, Cygwin, or Winelib.\n".
     "#\n# This file was created by `mkfiles.pl' from the `Recipe' file.\n".
     "# DO NOT EDIT THIS FILE DIRECTLY; edit Recipe or mkfiles.pl instead.\n";
     # gcc command line option is -D not /D
@@ -455,6 +455,7 @@ if (defined $makefiles{'cygwin'}) {
     "# You can define this path to point at your tools if you need to\n".
     "# TOOLPATH = c:\\cygwin\\bin\\ # or similar, if you're running Windows\n".
     "# TOOLPATH = /pkg/mingw32msvc/i386-mingw32msvc/bin/\n".
+    "# TOOLPATH = i686-w64-mingw32-\n".
     "CC = \$(TOOLPATH)gcc\n".
     "RC = \$(TOOLPATH)windres\n".
     "# Uncomment the following two lines to compile under Winelib\n".
@@ -463,11 +464,11 @@ if (defined $makefiles{'cygwin'}) {
     "# You may also need to tell windres where to find include files:\n".
     "# RCINC = --include-dir c:\\cygwin\\include\\\n".
     "\n".
-    &splitline("CFLAGS = -mno-cygwin -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT".
-      " -D_NO_OLDNAMES -DNO_MULTIMON -DNO_HTMLHELP -DNO_SECUREZEROMEMORY " .
+    &splitline("CFLAGS = -Wall -O2 -D_WINDOWS -DDEBUG -DWIN32S_COMPAT".
+      " -D_NO_OLDNAMES " .
               (join " ", map {"-I$dirpfx$_"} @srcdirs)) .
               "\n".
-    "LDFLAGS = -mno-cygwin -s\n".
+    "LDFLAGS = -s\n".
     &splitline("RCFLAGS = \$(RCINC) --define WIN32=1 --define _WIN32=1 ".
       "--define WINVER=0x0400 ".(join " ", map {"-I$dirpfx$_"} @srcdirs))."\n".
     "\n".
@@ -645,7 +646,7 @@ if (defined $makefiles{'vc'}) {
       "CFLAGS = /nologo /W3 /O1 " .
       (join " ", map {"-I$dirpfx$_"} @srcdirs) .
       " /D_WINDOWS /D_WIN32_WINDOWS=0x500 /DWINVER=0x500 /D_CRT_SECURE_NO_WARNINGS\n".
-      "LFLAGS = /incremental:no /fixed\n".
+      "LFLAGS = /incremental:no /dynamicbase /nxcompat\n".
       "RCFLAGS = ".(join " ", map {"-I$dirpfx$_"} @srcdirs).
       " -DWIN32 -D_WIN32 -DWINVER=0x0400\n".
       "\n".
@@ -675,7 +676,7 @@ if (defined $makefiles{'vc'}) {
            print "$objlines[$i]\n";
        }
        print "<<\n";
-       print "\tlink \$(LFLAGS) \$(XLFLAGS) -out:\$(BUILDDIR)$prog.exe -map:\$(BUILDDIR)$prog.map -nologo -subsystem:$subsys \@$inlinefilename\n\n";
+       print "\tlink \$(LFLAGS) \$(XLFLAGS) -out:\$(BUILDDIR)$prog.exe -map:\$(BUILDDIR)$prog.map -nologo -subsystem:$subsys\$(SUBSYSVER) \@$inlinefilename\n\n";
     }
     foreach $d (&deps("\$(BUILDDIR)X.obj", "\$(BUILDDIR)X.res", $dirpfx, "\\", "vc")) {
         $extradeps = $forceobj{$d->{obj_orig}} ? ["*.c","*.h","*.rc"] : [];
@@ -1516,7 +1517,8 @@ if (defined $makefiles{'am'}) {
     # auto-generated parts of this makefile, but Recipe might like to
     # have it available as a variable so that mandatory-rebuild things
     # (version.o) can conveniently be made to depend on it.
-    @sources = ("allsources", "=", sort keys %allsourcefiles);
+    @sources = ("allsources", "=",
+                sort grep {$_ ne "empty.h"} keys %allsourcefiles);
     print &splitline(join " ", @sources), "\n\n";
 
     @cliprogs = ("bin_PROGRAMS", "=");