Commit dbdb6c52 authored by John van Groningen's avatar John van Groningen
Browse files

Merge branch 'implib-support-for-windows' into 'master'

Add support for .implib on Windows

See merge request !15
parents 58b02cee 3a725fa5
Pipeline #46017 passed with stage
in 14 seconds
......@@ -251,6 +251,9 @@ P_NODE first_project_node,last_project_node,main_project_node;
struct object_file_list {
struct object_file_list * object_file_next;
#ifdef _WINDOWS_
int object_file_is_library;
#endif
#if !defined (GNU_C)
char object_file_name[];
#else
......@@ -1014,10 +1017,8 @@ static int get_version_and_options_of_abc_file (P_NODE project_node,int *version
enum dependency_type {
NO_DEPENDENCY,
ABC_DEPENDENCY,
OBJECT_FILE_DEPENDENCY
#ifndef _WINDOWS_
,LIBRARY_DEPENDENCY
#endif
OBJECT_FILE_DEPENDENCY,
LIBRARY_DEPENDENCY
};
static int get_dependency_or_imported_object_or_library_file_of_abc_file (char *file_name,int max_length)
......@@ -1042,13 +1043,10 @@ static int get_dependency_or_imported_object_or_library_file_of_abc_file (char *
{
dependency_type=OBJECT_FILE_DEPENDENCY;
break;
}
#ifndef _WINDOWS_
else if (last_char_was ('l') && last_char_was ('i') && last_char_was ('b')){
} else if (last_char_was ('l') && last_char_was ('i') && last_char_was ('b')){
dependency_type=LIBRARY_DEPENDENCY;
break;
}
#endif
} else if (last_char_was ('e') && last_char_was ('n') && last_char_was ('d')
&& last_char_was ('i') && last_char_was ('n') && last_char_was ('f')
&& last_char_was ('o'))
......@@ -1090,7 +1088,11 @@ static void close_abc_file (void)
fclose (abc_file);
}
static void add_imported_object_file_to_project_node (char *object_file_name,P_NODE project_node)
static void add_imported_object_file_to_project_node (char *object_file_name,P_NODE project_node
#ifdef _WINDOWS_
,int is_library
#endif
)
{
int object_file_name_size;
struct object_file_list *new_imported_object_file,**object_file_h;
......@@ -1121,6 +1123,10 @@ static void add_imported_object_file_to_project_node (char *object_file_name,P_N
#endif
new_imported_object_file->object_file_name[object_file_name_size]='\0';
}
#ifdef _WINDOWS_
new_imported_object_file->object_file_is_library=is_library;
#endif
new_imported_object_file->object_file_next=NULL;
......@@ -1314,15 +1320,22 @@ static int project_node_is_abc_up_to_date (P_NODE project_node)
*/
}
} else if (dependency_type==OBJECT_FILE_DEPENDENCY)
add_imported_object_file_to_project_node (dependent_module,project_node);
#ifndef _WINDOWS_
add_imported_object_file_to_project_node (dependent_module,project_node
#ifdef _WINDOWS_
,0
#endif
);
else if (dependency_type==LIBRARY_DEPENDENCY){
if (dependent_module[0]=='-' && dependent_module[1]=='l')
add_library (dependent_module);
#ifdef _WINDOWS_
else
add_imported_object_file_to_project_node (dependent_module,project_node,1);
#else
else if (strchr (dependent_module,'.')!=NULL)
add_imported_object_file_to_project_node (dependent_module,project_node);
}
#endif
}
}
}
......@@ -2310,15 +2323,22 @@ static void get_dependencies (P_NODE project_node)
if (dependency_type==ABC_DEPENDENCY)
add_dependency (&dependency_list,dependent_module);
else if (dependency_type==OBJECT_FILE_DEPENDENCY)
add_imported_object_file_to_project_node (dependent_module,project_node);
#ifndef _WINDOWS_
add_imported_object_file_to_project_node (dependent_module,project_node
#ifdef _WINDOWS_
,0
#endif
);
else if (dependency_type==LIBRARY_DEPENDENCY){
if (dependent_module[0]=='-' && dependent_module[1]=='l')
add_library (dependent_module);
#ifdef _WINDOWS_
else
add_imported_object_file_to_project_node (dependent_module,project_node,1);
#else
else if (strchr (dependent_module,'.')!=NULL)
add_imported_object_file_to_project_node (dependent_module,project_node);
}
#endif
}
} while (dependency_type!=NO_DEPENDENCY);
close_abc_file();
......@@ -3263,15 +3283,33 @@ static char **add_imported_object_files (P_NODE first_project_node,char *o_file_
}
#ifdef QUOTE_SPAWN_ARGUMENTS
file_name=memory_allocate (strlen (o_file_name)+3);
file_name=memory_allocate (strlen (o_file_name)+3+(imported_object_file->object_file_is_library ? 2 : 0));
file_name[0]='\"';
strcpy (file_name+1,o_file_name);
strcat (file_name+1,"\"");
if (imported_object_file->object_file_is_library){
file_name[1]='-';
file_name[2]='l';
strcpy (file_name+3,o_file_name);
strcat (file_name+3,"\"");
} else {
strcpy (file_name+1,o_file_name);
strcat (file_name+1,"\"");
}
#else
# ifdef _WINDOWS_
file_name=memory_allocate (strlen (o_file_name)+1+(imported_object_file->object_file_is_library ? 2 : 0));
if (imported_object_file->object_file_is_library){
file_name[0]='-';
file_name[1]='l';
strcpy (file_name+2,o_file_name);
} else
strcpy (file_name,o_file_name);
# else
file_name=memory_allocate (strlen (o_file_name)+1);
strcpy (file_name,o_file_name);
# endif
#endif
*arg++=file_name;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment