shithub: puzzles

Download patch

ref: b0ad387d0567089bb7b24a15e3ea6a6910c13a19
parent: f55dc67f4305d9e4cfaa89e5c7ad34da6c75d5a4
author: Simon Tatham <anakin@pobox.com>
date: Mon Jan 18 19:56:37 EST 2010

Patch inspired by one from James H: remove spurious references to
$mw (it should only ever have been used in the Cygwin makefile), and
move the libraries to the end of the link line in the Unix makefile
for better portability.

[originally from svn r8853]

--- a/mkfiles.pl
+++ b/mkfiles.pl
@@ -1111,8 +1111,8 @@
     &splitline("CFLAGS := -O2 -Wall -Werror -ansi -pedantic -g " .
 	       (join " ", map {"-I$dirpfx$_"} @srcdirs) .
 	       " `\$(GTK_CONFIG) --cflags` \$(CFLAGS)")."\n".
-    "XLDFLAGS = `\$(GTK_CONFIG) --libs`\n".
-    "ULDFLAGS =#\n".
+    "XLIBS = `\$(GTK_CONFIG) --libs`\n".
+    "ULIBS =#\n".
     "INSTALL=install\n",
     "INSTALL_PROGRAM=\$(INSTALL)\n",
     "INSTALL_DATA=\$(INSTALL)\n",
@@ -1130,8 +1130,8 @@
       $objstr = &objects($p, "X.o", undef, undef);
       print &splitline($prog . ": " . $objstr), "\n";
       $libstr = &objects($p, undef, undef, "-lX");
-      print &splitline("\t\$(CC)" . $mw . " \$(${type}LDFLAGS) -o \$@ " .
-                       $objstr . " $libstr", 69), "\n\n";
+      print &splitline("\t\$(CC) -o \$@ $objstr $libstr \$(${type}LIBS)", 69),
+	  "\n\n";
     }
     foreach $d (&deps("X.o", undef, $dirpfx, "/")) {
       print &splitline(sprintf("%s: %s", $d->{obj}, join " ", @{$d->{deps}})),
@@ -1380,7 +1380,7 @@
       $objstr =~ s/gtk\.o/nestedvm\.o/g;
       print &splitline($prog . ".mips: " . $objstr), "\n";
       $libstr = &objects($p, undef, undef, "-lX");
-      print &splitline("\t\$(CC)" . $mw . " \$(${type}LDFLAGS) -o \$@ " .
+      print &splitline("\t\$(CC) \$(${type}LDFLAGS) -o \$@ " .
                        $objstr . " $libstr -lm", 69), "\n\n";
     }
     foreach $d (&deps("X.o", undef, $dirpfx, "/")) {