- surf_exit();
- return 0;
-}
-#ifdef _WIN32
-void
-generate_borland_project(borland_project_t project)
-{
- char* binary_path; /* the path of the generated binary file */
- char* obj_path; /* the path of the generated object file */
- char* lib_files; /* a list of the libraries used in the borland project */
- char* main_source; /* the name of the bpf file used by the borland project */
- char* file_name; /* the file name of the main source file */
- char* include_path; /* the include path */
-
-
- /* create the borland project file */
- borland_project_create(project);
-
- /* write the xml document header */
- borland_project_write_xml_header(project);
-
- /* write the xml comment to identify a borland project file */
- borland_project_write_xml_comment(project);
-
- /* write the begin of the node PROJECT */
- borland_project_begin_xml_node(project,"PROJECT");
-
- /* write the begin of node MACROS */
- borland_project_begin_xml_node(project,"MACROS");
-
- /* write the borland project version */
- borland_project_write_xml_element(project,"VERSION",project->version);
-
- /* construct and write the borland project binary path */
- binary_path = xbt_new0(char,strlen(project->name) + strlen(project->bin_dir) + 6);
- sprintf(binary_path,"%s\\%s.exe",project->bin_dir,project->name);
- borland_project_write_xml_element(project,"PROJECT",binary_path);
- xbt_free(binary_path);
-
- /* construct an write the object files to generate by the compiler */
- obj_path = xbt_new0(char,strlen(project->name) + strlen(project->obj_dir) + 6);
- sprintf(binary_path,"%s\\%s.obj",project->obj_dir,project->name);
- borland_project_write_xml_element(project,"OBJFILES",obj_path);
- xbt_free(obj_path);
-
- /* write the resource files used by the compiler (no resource file used) */
- borland_project_write_xml_element(project,"RESFILES","");
-
- /* write the IDL files of the project (no IDL files used) */
- borland_project_write_xml_element(project,"IDLFILES","");
-
- /* write the IDLGENFILES element (not used) */
- borland_project_write_xml_element(project,"IDLGENFILES","");
-
- /* write the DEFFILE element (not used) */
- borland_project_write_xml_element(project,"DEFFILE","");
-
- /* write the RESDEPEN element (not used, no resource file used) */
- borland_project_write_xml_element(project,"RESDEPEN","$(RESFILES)");
-
- /* construct and write the list of libraries used by the project */
- /*
- lib_files = xbt_new0(char,(2 * (strlen(project->lib_dir) + 1)) + strlen("simgrid.lib") + strlen("libgras.lib") + 3);
- sprintf(lib_files,"%s\\simgrid.lib %s\\libgras.lib",project->lib_dir,project->lib_dir);
- */
-
- lib_files = xbt_new0(char,(2 * (strlen(project->lib_dir) + 1)) + strlen("simgrid.lib") + 2);
- sprintf(lib_files,"%s\\simgrid.lib",project->lib_dir);
-
- borland_project_write_xml_element(project,"LIBFILES",lib_files);
- xbt_free(lib_files);
-
- /* write the SPARELIBS element (not used) */
- borland_project_write_xml_element(project,"SPARELIBS","");
-
- /* write the PACKAGES element (no package used) */
- borland_project_write_xml_element(project,"PACKAGES","");
-
- /* write the PATHCPP element (the path of the source files of the project)*/
- borland_project_write_xml_element(project,"PATHCPP",".;");
-
- /* write the PATHPAS element (not used) */
- borland_project_write_xml_element(project,"PATHPAS","");
-
- /* write the PATHRC element (not used) */
- borland_project_write_xml_element(project,"PATHRC","");
-
- /* write the PATHASM element (not used) */
- borland_project_write_xml_element(project,"PATHASM","");
-
- /* write the DEBUGLIBPATH element (the path for debug) */
- borland_project_write_xml_element(project,"DEBUGLIBPATH","$(BCB)\\lib\\debug");
-
- /* write the RELEASELIBPATH element (the path for release) */
- borland_project_write_xml_element(project,"RELEASELIBPATH","$(BCB)\\lib\\release");
-
- /* specify the linker to use */
- borland_project_write_xml_element(project,"LINKER","ilink32");
-
- /* write the USERDEFINES element (user definitions (#define _DEBUG))*/
- borland_project_write_xml_element(project,"USERDEFINES","_DEBUG");
-
- /* write the SYSDEFINES element (use the system definitions, not used strict ANSI and no use the VCL)*/
- borland_project_write_xml_element(project,"SYSDEFINES","NO_STRICT;_NO_VCL");
-
- /* construct and write the MAINSOURCE element */
- main_source = xbt_new0(char,strlen(project->name) + 5);
- sprintf(main_source,"%s.bpf",project->name);
- /* write the main source file to use in the borland project file */
- borland_project_write_xml_element(project,"MAINSOURCE",main_source);
-
- /* create the bpf file used by the borland project */
- borland_project_create_main_file(main_source);
-
- /* FIXME resolve the include path */
- /* write the INCLUDEPATH element */
-
- if(!__gras_path){
- __gras_path = xbt_new0(char,MAX_PATH);
- find_file_path("C:\\","gras.h",__gras_path);
- }
-
- include_path = xbt_new0(char,strlen("$(BCB)\\include") + strlen(__gras_path) + 2);
- sprintf(include_path,"$(BCB)\\include;%s",__gras_path);
-
- borland_project_write_xml_element(project,"INCLUDEPATH",include_path);
-
- xbt_free(include_path);
-
- /* write the LIBPATH element (no librarie paths specified)*/
- borland_project_write_xml_element(project,"LIBPATH","$(BCB)\\lib;$(BCB)\\lib\\obj");
-
- /*
- * write the WARNINGS element :
- * -w-sus (-w-8075) disabled the suspect conversion pointer warning
- * -w-rvl (-w-8070) disabled the function must return warning
- * -w-rch (-w-8066) disabled the warning which specify that we can't attain the code
- * -w-pia (-w-8060) disabled the warning that detect a possible bad assignement
- * -w-pch (-w-8058) disabled the warning throw when the compiler can't precompile a header file
- * -w-par (-w-8057) disabled the warning that detect an unused variable
- * -w-csu (-w-8012) disabled the warning that detect a comparison between a signed number and an unsigned number
- * -w-ccc (-w-8008) disabled the warning that detect une conditon which is always true
- * -w-aus (-w-8008) disabled the warning that detect an affected value which is never used
- */
- borland_project_write_xml_element(project,"WARNINGS","-w-sus -w-rvl -w-rch -w-pia -w-pch -w-par -w-csu -w-ccc -w-aus");
-
- /* write the OTHERFILES element (no other files used used) */
- borland_project_write_xml_element(project,"OTHERFILES","");
-
- /* write the end of the node MACROS */
- borland_project_end_xml_node(project,"MACROS");
-
- /* write the begin of the node OPTIONS */
- borland_project_begin_xml_node(project,"OPTIONS");
-
- /* FIXME check the idlcflags
- /* write the IDLCFLAGS element */
- borland_project_write_xml_element(project,"IDLCFLAGS","");
-
- /*
- * write the CFLAG1 element (compiler options ) :
- *
- * -Od this flag disable all compiler optimisation
- * -H this flag specify the name of the file which will contain the precompiled header
- * -Hc this flag specify to the compiler to cach the precompiled header
- * -Vx this flag specify to the compiler to allow the empty structures
- * -Ve this flag specify to the compiler to allow the empty base classes
- * -X- this flag activate the auto-depend informations of the compiler
- * -r- this flag disabled the use of the processor register
- * -a1 this flag specify that the data must be aligned on one byte
- * -b- this flag specify that the enums are the smallest size of the integer
- * -k (used during debug)
- * -y this flag generate the line number for debug
- * -v this flag enabled the debugging of the source files
- * -vi check the expansion of the inline functions
- * -tWC specify that it's a console application
- * -tWM- specify that the application is not multithread
- * -c generate the object file, no link
- */
- borland_project_write_xml_element(project,"CFLAG1","-Od -H=$(BCB)\\lib\\vcl60.csm -Hc -Vx -Ve -X- -r- -a1 -b- -k -y -v -vi- -tWC -tWM- -c");