]> asedeno.scripts.mit.edu Git - PuTTY.git/blobdiff - mkfiles.pl
Cross-reference all the host key docs.
[PuTTY.git] / mkfiles.pl
index 3ce0e24ddb9aca0c05e018a0cf753a9e777251a9..46ae3189985639de744429c174763db9a6203e88 100755 (executable)
@@ -45,9 +45,10 @@ open IN, "Recipe" or do {
 };
 
 # HACK: One of the source files in `charset' is auto-generated by
-# sbcsgen.pl. We need to generate that _now_, before attempting
-# dependency analysis.
+# 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;';
 
 @srcdirs = ("./");
 
@@ -134,7 +135,7 @@ while (<IN>) {
     } elsif (($i =~ /^\[([A-Z]*)\]$/) and defined $prog) {
       $type = substr($i,1,(length $i)-2);
       die "unrecognised program type for $prog [$type]\n"
-          if ! grep { $type eq $_ } qw(G C X U MX UT);
+          if ! grep { $type eq $_ } qw(G C X U MX XT UT);
     } else {
       push @$listref, $i;
     }
@@ -677,12 +678,13 @@ if (defined $makefiles{'vc'}) {
        }
     }
     print "\n";
-    foreach $srcdir ("", @srcdirs) {
+    foreach $real_srcdir ("", @srcdirs) {
+        $srcdir = $real_srcdir;
         if ($srcdir ne "") {
             $srcdir =~ s!/!\\!g;
             $srcdir = $dirpfx . $srcdir;
             $srcdir =~ s!\\\.\\!\\!;
-            $srcdir = "{$srcdir}"
+            $srcdir = "{$srcdir}";
         }
         # The double colon at the end of the line makes this a
         # 'batch-mode inference rule', which means that nmake will
@@ -1355,7 +1357,7 @@ if (defined $makefiles{'gtk'}) {
     "# building with GTK 1.2, or you can set it to `pkg-config gtk+-2.0 x11'\n".
     "# if you want to enforce 2.0. The default is to try 2.0 and fall back\n".
     "# to 1.2 if it isn't found.\n".
-    "GTK_CONFIG = sh -c 'pkg-config gtk+-2.0 x11 \$\$0 2>/dev/null || gtk-config \$\$0'\n".
+    "GTK_CONFIG = sh -c 'pkg-config gtk+-3.0 x11 \$\$0 2>/dev/null || pkg-config gtk+-2.0 x11 \$\$0 2>/dev/null || gtk-config \$\$0'\n".
     "\n".
     "-include Makefile.local\n".
     "\n".
@@ -1391,15 +1393,17 @@ if (defined $makefiles{'gtk'}) {
     ".SUFFIXES:\n".
     "\n".
     "\n";
-    print &splitline("all:" . join "", map { " $_" } &progrealnames("X:U:UT"));
+    print &splitline("all:" . join "", map { " $_" }
+                     &progrealnames("X:XT:U:UT"));
     print "\n\n";
-    foreach $p (&prognames("X:U:UT")) {
+    foreach $p (&prognames("X:XT:U:UT")) {
       ($prog, $type) = split ",", $p;
+      ($ldflags = $type) =~ s/T$//;
       $objstr = &objects($p, "X.o", undef, undef);
       print &splitline($prog . ": " . $objstr), "\n";
       $libstr = &objects($p, undef, undef, "-lX");
       print &splitline("\t\$(CC) -o \$@ " .
-                       $objstr . " \$(${type}LDFLAGS) $libstr", 69), "\n\n";
+                       $objstr . " \$(${ldflags}LDFLAGS) $libstr", 69), "\n\n";
     }
     foreach $d (&deps("X.o", undef, $dirpfx, "/", "gtk")) {
       if ($forceobj{$d->{obj_orig}}) {
@@ -1413,7 +1417,7 @@ if (defined $makefiles{'gtk'}) {
     print "\n";
     print &def($makefile_extra{'gtk'}->{'end'});
     print "\nclean:\n".
-    "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:U:UT")) . "\n";
+    "\trm -f *.o". (join "", map { " $_" } &progrealnames("X:XT:U:UT")) . "\n";
     print "\nFORCE:\n";
     select STDOUT; close OUT;
 }
@@ -1524,7 +1528,7 @@ if (defined $makefiles{'am'}) {
     print "endif\n\n";
 
     @noinstcliprogs = ("noinst_PROGRAMS", "=");
-    foreach $p (&prognames("UT")) {
+    foreach $p (&prognames("XT:UT")) {
       ($prog, $type) = split ",", $p;
       push @noinstcliprogs, $prog;
     }
@@ -1556,9 +1560,9 @@ if (defined $makefiles{'am'}) {
     print &splitline(join " ", "noinst_LIBRARIES", "=",
                      sort { $a cmp $b } values %amspeciallibs), "\n\n";
 
-    foreach $p (&prognames("X:U:UT")) {
+    foreach $p (&prognames("X:XT:U:UT")) {
       ($prog, $type) = split ",", $p;
-      print "if HAVE_GTK\n" if $type eq "X";
+      print "if HAVE_GTK\n" if $type eq "X" || $type eq "XT";
       @progsources = ("${prog}_SOURCES", "=");
       %sourcefiles = ();
       @ldadd = ();
@@ -1572,13 +1576,13 @@ if (defined $makefiles{'am'}) {
       }
       push @progsources, sort { $a cmp $b } keys %sourcefiles;
       print &splitline(join " ", @progsources), "\n";
-      if ($type eq "X") {
+      if ($type eq "X" || $type eq "XT") {
         push @ldadd, "\$(GTK_LIBS)";
       }
       if (@ldadd) {
         print &splitline(join " ", "${prog}_LDADD", "=", @ldadd), "\n";
       }
-      print "endif\n" if $type eq "X";
+      print "endif\n" if $type eq "X" || $type eq "XT";
       print "\n";
     }
     print &def($makefile_extra{'am'}->{'end'});