From: mquinson Date: Thu, 2 Dec 2010 14:04:24 +0000 (+0000) Subject: Kill ancient files which were used back in the age to compile with windows, and add... X-Git-Tag: v3.6_beta2~1023 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5c23b3c88c9cdd5b27935f5444462d71f2f52efa Kill ancient files which were used back in the age to compile with windows, and add an experimental file for cmake cross compilation git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8889 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/SimGridConfig.js b/SimGridConfig.js deleted file mode 100644 index 9ab4a6b5e5..0000000000 --- a/SimGridConfig.js +++ /dev/null @@ -1,190 +0,0 @@ -// SimGrid configuration file for Windows. -// Register all environement variables needed for the compilation of SimGrid library -// and all the tesh suite, examples and test suites. - - -// FIXME declare the include directory in the environment of the compilation. - -// Test if the string s is in the array a. -function ArrayContains(a, s) -{ - var i = 0; - - for(i = 0; i < a.length; i++) - if(a[i] == s) - return true; - - return false; -} - -// SimGrid configuration file for Windows. -// Register all environement variables needed for the compilation of SimGrid library -// and all the tesh suite, examples and test suites. - -var Shell; -var UserEnv; -var FileSystem; - - -var DebugLibraryPath; // The path of the SimGrid debug library -var ReleaseLibraryPath; // The path of the SimGrid release library - -var Lib; // The value of the environment variable LIB -var Include; // The value of the environment variable INCLUDE -var Libs; // SimGrid library name (the value of the environment variable LIBS). - - -var VCInstallDir; // Visual C install directory -var SGBuildDir; // This build directory -var JNIIncludeDir; // The path of the jni.h header - -var Args = WScript.Arguments; - -// check the arguments to be sure it's right -if (Args.Count() < 3) -{ - WScript.Echo("SimGrid Configuration."); - WScript.Echo("Configure the environment of the compilation of SimGrid library"); - WScript.Echo("\n\tUsage: CScript SimGridConfig.js "); - WScript.Quit(1); -} - -SGBuildDir = Args.Item(0); -VCInstallDir = Args.Item(1); -JNIIncludeDir = Args.Item(2); - -var FileSystem = new ActiveXObject("Scripting.FileSystemObject"); - -// Build the 2 paths of SimGrid library paths (debug and release) -ReleaseLibraryPath = SGBuildDir + "build\\vc7\\simgrid\\Release"; -DebugLibraryPath = SGBuildDir + "build\\vc7\\simgrid\\Debug"; - -// Check the directories specified as parameters of the script. - -if(!FileSystem.FolderExists(SGBuildDir)) -{ - WScript.Echo("Not a directory `(" + SGBuildDir + ")'"); - WScript.Quit(2); -} -else if(!FileSystem.FolderExists(VCInstallDir)) -{ - WScript.Echo("Not a directory `(" + VCInstallDir + ")'"); - WScript.Quit(3); -} -else if(!FileSystem.FolderExists(JNIIncludeDir)) -{ - WScript.Echo("Not a directory `(" + JNIIncludeDir + ")'"); - WScript.Quit(5); -} - -Shell = WScript.CreateObject("Wscript.Shell"); -UserEnv = Shell.Environment("USER"); - -WScript.Echo("Configuration of SimGrig Library Compilation in progress..."); -WScript.Echo("Build directory : " + SGBuildDir); -WScript.Echo("Visual C install directory : " + VCInstallDir); -WScript.Echo("Java Native Interface include directory : " + JNIIncludeDir); - - -// Build the content of the environment variable LIB. -Lib = UserEnv("LIB"); - -if(typeof(UserEnv("LIB")) != "undefined" && Lib.length > 0) -{ - var a = Lib.split(";"); - - if(!ArrayContains(a,DebugLibraryPath)) - Lib = Lib + DebugLibraryPath + ";";; - - if(!ArrayContains(a,ReleaseLibraryPath)) - Lib = Lib + ReleaseLibraryPath + ";"; - - if(!ArrayContains(a, VCInstallDir + "lib")) - Lib = Lib + VCInstallDir + "lib" + ";"; - - if(!ArrayContains(a, VCInstallDir + "PlatformSDK\\Lib")) - Lib = Lib + VCInstallDir + "PlatformSDK\\Lib" + ";"; -} -else -{ - // SimGrid librairy paths - Lib = DebugLibraryPath + ";"; - Lib = Lib + ReleaseLibraryPath + ";"; - // Visual C library paths. - Lib = Lib + VCInstallDir + "lib" + ";"; - Lib = Lib + VCInstallDir + "PlatformSDK\\Lib" + ";"; - -} - -// Build the content of the environment variable INCLUDE. -Include = UserEnv("INCLUDE"); - -if(typeof(UserEnv("INCLUDE")) != "undefined" && Include.length > 0) -{ - - var a = Include.split(";"); - - // Add the Visual C include directories - if(!ArrayContains(a, VCInstallDir + "include")) - Include = Include + VCInstallDir + "include" + ";"; - - if(!ArrayContains(a,VCInstallDir + "PlatformSDK\\include")) - Include = Include + VCInstallDir + "PlatformSDK\\include" + ";"; - - - // Add the SimGrid include directories - if(!ArrayContains(a,SGBuildDir + "src")) - Include = Include + SGBuildDir + "src" + ";"; - - if(!ArrayContains(a,SGBuildDir + "include")) - Include = Include + SGBuildDir + "include" + ";"; - - if(!ArrayContains(a,SGBuildDir + "src\\include")) - Include = Include + SGBuildDir + "src\\include" + ";"; - - // Add the JNI include directories. - if(!ArrayContains(a,JNIIncludeDir)) - Include = Include + JNIIncludeDir + ";"; - - if(!ArrayContains(a,JNIIncludeDir + "awin32")) - Include = Include + JNIIncludeDir + "win32" + ";"; - -} -else -{ - // Visual C include directories - Include = VCInstallDir + "include" + ";"; - Include = Include + VCInstallDir + "PlatformSDK\\include" + ";"; - // SimGrid include directories. - Include = Include + SGBuildDir + "src" + ";"; - Include = Include + SGBuildDir + "include" + ";" ; - Include = Include + SGBuildDir + "src\\include" + ";"; - // JNI include directories. - Include = Include + JNIIncludeDir + ";"; - Include = Include + JNIIncludeDir + "win32" + ";"; - -} - -// Build the content of the environment variable LIBS. -Libs = UserEnv("LIBS"); - -if(typeof(UserEnv("LIBS")) != "undefined" && Libs.length > 0) -{ - var a = Libs.split(";"); - - if(!ArrayContains(a, "simgrid.lib")) - Libs = Libs + "simgrid.lib" + ";"; -} -else -{ - Libs = "simgrid.lib" + ";"; -} - -// Update the environment variables. -UserEnv("LIB") = Lib; -UserEnv("INCLUDE") = Include; -UserEnv("LIBS") = Libs; - - - -WScript.Echo("Configuration successeded"); diff --git a/TeshConfig.js b/TeshConfig.js deleted file mode 100644 index 8105290b2b..0000000000 --- a/TeshConfig.js +++ /dev/null @@ -1,129 +0,0 @@ -// Tesh configuration file for Windows. -// Register all environement variables needed by Tesh -// during its compilation and during the running of Tesh files. - - -// Test if the string s is in the array a. -function ArrayContains(a, s) -{ - var i = 0; - - for(i = 0; i < a.length; i++) - if(a[i] == s) - return true; - - return false; -} - -// SimGrid configuration file for Windows. -// Register all environement variables needed for the compilation of SimGrid library -// and all the tesh suite, examples and test suites. - -var Shell; -var UserEnv; -var FileSystem; - -var SGBuildDir; // This build directory -var TeshDir; -var TeshExampleDir; -var TeshSuiteDir; -var TestSuiteDir; -var ExampleDir; -var SrcDir; - -var Path; -var Include; - -var Args = WScript.Arguments; - -// check the arguments to be sure it's right -if (Args.Count() < 1) -{ - WScript.Echo("Tesh Configuration."); - WScript.Echo("Configure the environment of Tesh (mini test shell)"); - WScript.Echo("\n\tUsage: CScript TeshConfig.js "); - WScript.Quit(1); -} - -SGBuildDir = Args.Item(0); -TeshVersion = Args.Item(1); - -var FileSystem = new ActiveXObject("Scripting.FileSystemObject"); - -// Check the directories specified as parameters of the script. - -if(!FileSystem.FolderExists(SGBuildDir)) -{ - WScript.Echo("Not a directory `(" + SGBuildDir + ")'"); - WScript.Quit(2); -} - - - -// Build the directories - -TeshDir = SGBuildDir + "tools\\tesh" + TeshVersion; -TeshExampleDir = TeshDir + "\\examples"; -TeshSuiteDir = SGBuildDir + "teshsuite"; -TestSuiteDir = SGBuildDir + "testsuite"; -ExampleDir = SGBuildDir + "examples"; -SrcDir = ExampleDir + "\\msg"; - - -Shell = WScript.CreateObject("Wscript.Shell"); -UserEnv = Shell.Environment("USER"); - -WScript.Echo("Configuration of Tesh Library Compilation in progress..."); -WScript.Echo("Build directory : " + SGBuildDir); - - -// Include Tesh in the Path -Path = UserEnv("PATH"); - -if(typeof(UserEnv("PATH")) != "undefined" && Path.length > 0) -{ - var a = Path.split(";"); - - // Add the Visual C include directories - if(!ArrayContains(a, TeshDir)) - Path = Path + TeshDir + ";"; -} -else -{ - Path = TeshDir + ";"; -} - -Include = UserEnv("INCLUDE"); - -if(typeof(UserEnv("INCLUDE")) != "undefined" && Include.length > 0) -{ - var a = Include.split(";"); - - // Add the Visual C include directories - if(!ArrayContains(a, TeshDir + "\\include")) - Include = Include + TeshDir + "\\include" + ";"; - - if(!ArrayContains(a, TeshDir + "\\w32\\include")) - Include = Include + TeshDir + "\\w32\\include" + ";"; -} -else -{ - Include = TeshDir + "\\include"; - Include = Include + ";" + TeshDir + "\\w32\\include" + ";"; -} - -// Build environement of Tesh. -UserEnv("TESH") = "tesh"; -UserEnv("TESH_DIR") = TeshDir; -UserEnv("TESHEXAMPLE_DIR") = TeshExampleDir; -UserEnv("TESHSUITE_DIR") = TeshSuiteDir; -UserEnv("TESTSUITE_DIR") = TestSuiteDir; -UserEnv("EXAMPLE_DIR") = ExampleDir; -UserEnv("SRCDIR") = SrcDir; -UserEnv("INCLUDE") = Include; - - -UserEnv("PATH") = Path; - - -WScript.Echo("Configuration successeded"); diff --git a/toolchain.win32 b/toolchain.win32 new file mode 100644 index 0000000000..9957143f45 --- /dev/null +++ b/toolchain.win32 @@ -0,0 +1,30 @@ +# This is an experimental toolchain file for cmake, to use when you +# want to cross compile from linux to windows. For that, you'll need +# some packages like mingw32-binutils and mingw32-runtime. + +# Then, you want to use those commands to cross compile out of source: +# cd win32 +# cmake -DCMAKE_TOOLCHAIN_FILE=../toolchain.win32 -Dwith_context=windows .. + +# the name of the target operating system +SET(CMAKE_SYSTEM_NAME Windows) + +SET(WIN32 1) + +# Manual setting of values that are detected when not cross-compiling +SET(SIZEOF_MAX 8) +SET(GRAS_THISARCH 3) # FIXME: that's windows 32 bits, 64bits must be detected + +# which compilers to use for C and C++ +SET(CMAKE_C_COMPILER i586-mingw32msvc-gcc) +SET(CMAKE_CXX_COMPILER i586-mingw32msvc-g++) + +# here is the target environment located +SET(CMAKE_FIND_ROOT_PATH /usr/i586-mingw32msvc) + +# adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment, search +# programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)