Commits

Shlomi Fish committed 617eb06

Some fixes for the build system.

This was done to overcome problems with perl-5.16.0 and problem unrelated
to that (but encountered now).

  • Participants
  • Parent commits 3d557c7
  • Branches conversion-to-cmake

Comments (0)

Files changed (4)

File src/wml_backend/p3_eperl/CMakeLists.txt

 )
 
 SET_TARGET_PROPERTIES(${EXE}
-    PROPERTIES LINK_FLAGS "${perl_ccdlflags} ${perl_ldflaags} -L${perl_archlib}/CORE ${perl_dla} -lperl ${perl_libs}"
+    PROPERTIES LINK_FLAGS "${perl_ccdlflags} ${perl_ldflags} -L${perl_archlib}/CORE ${perl_dla} -lperl ${perl_libs}"
 )
 
 SET_TARGET_PROPERTIES(${EXE}

File src/wml_backend/p3_eperl/eperl_perl5.h

 #  define PL_curstash curstash
 #endif
 
-#ifndef WITH_THR
+#if !defined(WITH_THR) && (PERL_VERSION < 16)
 #  define PL_defoutgv defoutgv
 #endif
 

File src/wml_docs/CMakeLists.txt

 
 ENDFOREACH(MYSTD ${STDS})
 
-SET (TAGS_POD "${CMAKE_CURRENT_BINARY_DIR}/wml_tags.pod")
+SET (TAGS_POD "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod")
 ADD_CUSTOM_COMMAND(
     OUTPUT "${TAGS_POD}"
     COMMAND ${PERL_EXECUTABLE}
     ARGS "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.pl"
+        "--src" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.in"
+        "--dest" "${TAGS_POD}"
+        "--main" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.main"
+        "--incl" "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.incl"
     DEPENDS "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.pod.in" 
             "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.main"
             "${CMAKE_CURRENT_SOURCE_DIR}/wml_tags.L.incl" 

File src/wml_docs/wml_tags.pod.pl

 ##  Copyright (c) 1998,1999 Ralf S. Engelschall, All Rights Reserved. 
 ##
 
-open(OUT, ">wml_tags.pod");
-open(IN, "<wml_tags.pod.in");
-while (<IN>) {
+use strict;
+use warnings;
+
+use Getopt::Long;
+
+my ($src, $dest, $main, $incl);
+GetOptions(
+    'src=s' => \$src,
+    'dest=s' => \$dest,
+    'main=s' => \$main,
+    'incl=s' => \$incl,
+) or "Die! Wrong parameters!";
+
+open my $out_fh, '>', $dest
+    or die "Cannot open output_file '$dest'. $!";
+open my $in_fh, '<', $src
+    or die "Cannot open input_file '$src'. $!";
+
+my (@L);
+while (<$in_fh>) {
     if (m|^%%CORE%%|) {
-        open(TMP, "<wml_tags.L.main");
+        open( my $tmp_fh, '<', $main)
+            or die "Cannot open main file - '$main' - $!";
         @L = ();
-        while (<TMP>) { 
+        while (<$tmp_fh>) { 
             next if (m|^\s*$|);
             push(@L, $_);
         }
-        close(TMP);
+        close($tmp_fh);
         @L = sort(@L);
-        $n = 0;
-        foreach $l (@L) {
-            print OUT " ".$l; 
+        my $n = 0;
+        foreach my $l (@L) {
+            print {$out_fh} " ".$l; 
             $n++;
             if (($n % 10) == 0) {
                 $n = 0;
-                print OUT "\n";
+                print {$out_fh} "\n";
             }
         }
     }
     if (m|^%%INCL%%|) {
-        open(TMP, "<wml_tags.L.incl");
+        open(my $tmp_fh, '<', $incl)
+            or die "Cannot open incl file - '$incl' - $!";
         @L = ();
-        while (<TMP>) { 
+        while (<$tmp_fh>) { 
             next if (m|^\s*$|);
             push(@L, $_);
         }
-        close(TMP);
+        close($tmp_fh);
         @L = sort(@L);
-        $n = 0;
-        foreach $l (@L) {
-            print OUT " ".$l; 
+        my $n = 0;
+        foreach my $l (@L) {
+            print {$out_fh} " ".$l; 
             $n++;
             if (($n % 10) == 0) {
                 $n = 0;
-                print OUT "\n";
+                print {$out_fh} "\n";
             }
         }
     }
     else {
-        print OUT $_;
+        print {$out_fh} $_;
     }
 }
-close(IN);
-close(OUT);
+close($in_fh);
+close($out_fh);
 
 ##EOF##