[SCM] Lisaac compiler branch, master, updated. lisaac-0.12-532-gfe89c99

Benoit Sonntag sonntag at icps.u-strasbg.fr
Thu Nov 12 02:44:49 UTC 2009


The following commit has been merged in the master branch:
commit fe89c99239a7f8b4779255fe54143d35219e9184
Author: Benoit Sonntag <sonntag at icps.u-strasbg.fr>
Date:   Thu Nov 12 03:44:44 2009 +0100

    Add make.lip.sample

diff --git a/make.lip.sample b/make.lip.sample
new file mode 100644
index 0000000..82538d7
--- /dev/null
+++ b/make.lip.sample
@@ -0,0 +1,324 @@
+///////////////////////////////////////////////////////////////////////////////
+//                            Lisaac Installer                               //
+//                                                                           //
+//                   LSIIT - ULP - CNRS - INRIA - FRANCE                     //
+//                                                                           //
+//   This program is free software: you can redistribute it and/or modify    //
+//   it under the terms of the GNU General Public License as published by    //
+//   the Free Software Foundation, either version 3 of the License, or       //
+//   (at your option) any later version.                                     //
+//                                                                           //
+//   This program is distributed in the hope that it will be useful,         //
+//   but WITHOUT ANY WARRANTY; without even the implied warranty of          //
+//   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the           //
+//   GNU General Public License for more details.                            //
+//                                                                           //
+//   You should have received a copy of the GNU General Public License       //
+//   along with this program.  If not, see <http://www.gnu.org/licenses/>.   //
+//                                                                           //
+//                     http://isaacproject.u-strasbg.fr/                     //
+///////////////////////////////////////////////////////////////////////////////  
+
+// file LIP : LIsaac Path directory and make LIsaac Project system.
+
+Section Private
+  
+  //
+  // Compiler variables.
+  //
+  
+  // File information.
+  + lisaac:STRING;      // is environment variable value (auto-loading).
+  + input_file:STRING;  // is input file name value without extension (auto-loading, if possible).
+  + output_file:STRING; // is output file name value without extension (auto-loading, if possible).
+  
+  // Debug information.
+  + debug_level:INTEGER := 15;
+  + debug_with_code:BOOLEAN := TRUE; 
+  + is_all_warning:BOOLEAN;
+    
+  // Optimization.
+  + is_optimization:BOOLEAN;
+  + inline_level:INTEGER := 15;
+  
+  // Generate code.
+  + is_cop:BOOLEAN; // Correct value after compilation.
+  
+  // Other.
+  + is_statistic:BOOLEAN;
+  + is_quiet:BOOLEAN;
+  
+  //
+  // Other variables.
+  //
+  
+  + option_gcc:STRING;  
+  + lib_gcc:STRING;
+  
+  + target:STRING := "unix";
+    
+  //
+  // Service
+  //
+  
+  - path_li p:STRING <-
+  (
+    path (lisaac + p);
+  );
+  
+  + exit_success_code:INTEGER := 0;
+  
+  + exit_failure_code:INTEGER := 1;
+  
+  + lib_os:STRING := "lib/internal/os_support/";
+  
+  + lib_extra:STRING    := "lib/extra/*";
+  + lib_unstable:STRING := "lib/unstable/*";
+  
+  //
+  // Directory.
+  //
+  
+  - standard_path <-
+  // Standard library.
+  (    
+    path_li "lib/standard/*";    
+    path_li "lib/internal/portable/*";    
+    path_li lib_extra;
+    path_li lib_unstable;
+  );
+  
+  //
+  // Target path.
+  //
+  
+  - unix_target <-
+  (
+    path_li (lib_os + "unix/system/");
+    path_li (lib_os + "unix/file_system/");
+    path_li (lib_os + "unix/video/");
+  );
+  
+  - windows_target <-
+  (
+    path_li (lib_os + "unix/system/");
+    path_li (lib_os + "windows/file_system/");
+    path_li (lib_os + "unix/file_system/");  // BSBS: ??
+    path_li (lib_os + "windows/video/");
+  );
+
+  - dos_target <-
+  (
+    path_li (lib_os + "unix/system/");
+    path_li (lib_os + "unix/file_system/"); // BSBS: ??    
+    path_li (lib_os + "dos/file_system/");
+    path_li (lib_os + "dos/video/");
+  );
+  
+  - get_target <-
+  (
+    (target = "dos").if {
+      dos_target;
+    };
+    (target = "windows").if {
+      windows_target;
+    };
+    (target = "unix").if {
+      unix_target;
+    };
+    (target = "").if {
+      "Target code needed.\n".print;
+      die_with_code exit_failure_code;
+    };
+  );
+    
+  - add_lib lib:STRING <-
+  (
+    (target = "windows").if {
+      run "echo int main(){ return(1); } > __tmp__.c";    
+      (run ("gcc __tmp__.c -o __tmp__ " + lib + " > NUL") = 0).if {
+        lib_gcc := lib_gcc + " " + lib;
+        run "del __tmp__.c __tmp__.exe";
+      } else {
+        "\nERROR: `" + lib + "' library for GCC not found.\n".print;
+        run "del __tmp__.c";
+        die_with_code exit_failure_code;
+      };    
+    } else {
+      run "echo \"int main(){ return(1); }\" > __tmp__.c";    
+      (run ("gcc __tmp__.c -o __tmp__ " + lib + " 2> /dev/null") = 0).if {
+        lib_gcc := lib_gcc + " " + lib;
+        run "rm __tmp__.c __tmp__";
+      } else {
+        ("\nERROR: `" + lib + "' library for GCC not found.\n").print;
+        run "rm __tmp__.c";
+        die_with_code exit_failure_code;
+      };    
+    };
+  );
+  
+  - execute cmd:STRING <-
+  (
+    (! is_quiet).if {
+      "run `".print;
+      cmd.print;
+      "'\n".print;
+    };
+    (run cmd != 0).if {
+      "FAILURE!\n".print;
+    };
+  );
+  
+  //
+  // Execute function.
+  //
+  
+  - general_front_end <-
+  (
+    standard_path;
+    get_target;    
+  );
+  
+  - general_back_end <-
+  (
+    (target = "dos").if {
+      (is_cop).if {
+        "Warning: COP not yet implemented\n".print;
+      };
+      execute ("gcc " + output_file + ".c -o " + output_file + ".exe " + option_gcc + lib_gcc); 
+    };
+    (target = "windows").if {
+      (is_cop).if {
+        "Warning: COP not yet implemented\n".print;
+      };
+      execute ("gcc " + output_file + ".c -o " + output_file + ".exe " + option_gcc + lib_gcc);
+    };
+    (target = "unix").if {      
+      (is_cop).if {
+        lib_gcc := lib_gcc + " -lpthread";
+      };
+      execute ("gcc " + output_file + ".c -o " + output_file + " -lm " + option_gcc + lib_gcc);
+    };
+  );
+  
+  - front_end <-
+  // Executed by compiler, before compilation step.
+  (
+    general_front_end;
+  );
+  
+  - back_end <-
+  // Executed by compiler, after compilation step.
+  (
+    general_back_end;
+  );
+  
+Section Public
+  
+   
+  //
+  // Debug information.
+  // 
+    
+  - no_debug <-  
+  // No debug information.
+  (
+    debug_level := 0;
+    debug_with_code := FALSE;
+  );
+  
+  - debug level:INTEGER <-
+  // Fix debug level (default: 15)
+  (
+    ((level < 1) | (level > 20)).if {
+      "Incorrect debug level.\n".print;
+      die_with_code exit_failure_code;
+    };
+    debug_level := level;
+  );
+  
+  - without_source <-
+  // Debug mode without source code.
+  (
+    debug_with_code := FALSE;
+  );
+  
+  - all_warning <-
+  // All warning (deferred detect, ...).
+  (
+    is_all_warning := TRUE;
+  );
+  
+  //
+  // Optimization.
+  //
+  
+  - boost <-
+  // Full optimization.
+  (
+    no_debug;
+    is_optimization := TRUE;
+    option_gcc := option_gcc + " -O3 -fomit-frame-pointer";
+  );
+  
+  - i level:INTEGER <-
+  // Inlining level [1..5000] (default: 15)
+  (
+    ((level < 1) | (level > 5000)).if {
+      "Incorrect inlining level.\n".print;
+      exit;
+    };
+    inline_level := level;
+  );
+    
+  //
+  // Generate code.
+  //
+  
+  - o outputfile:STRING <-  
+  // Change output file (default: `input_file').
+  (
+    output_file := outputfile;
+  );
+  
+  - target idf:STRING <-
+  // Target for backend (unix,windows,dos)
+  (
+    target := idf;
+  );
+  
+  - gcc option:STRING <-
+  // Add option for GCC.
+  (
+    option_gcc := option_gcc + " " + option;
+  );
+  
+  //
+  // Other.
+  //
+  
+  - q <-
+  // Quiet operation.
+  (
+    is_quiet := TRUE;
+  );
+  
+  - s <-
+  // Statistic information.
+  (
+    is_statistic := TRUE;
+  );
+  
+  - help <-
+  // Help
+  (
+    help_command;
+    die_with_code exit_success_code;
+  );
+  
+  - version <-
+  // Version
+  (
+    compiler_version;
+    die_with_code exit_success_code;
+  );
\ No newline at end of file

-- 
Lisaac compiler



More information about the Lisaac-commits mailing list