Isolated the generation of static libraries as a platform capability
This commit is contained in:
parent
7a95945a01
commit
a415d0adf1
@ -410,6 +410,20 @@ static int _configure_do(Configure * configure, configArray * ca)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* accessors */
|
||||||
|
/* configure_can_library_static */
|
||||||
|
int configure_can_library_static(Configure * configure)
|
||||||
|
{
|
||||||
|
switch(configure->os)
|
||||||
|
{
|
||||||
|
case HO_WIN32:
|
||||||
|
return 0;
|
||||||
|
default:
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/* configure_get_config */
|
/* configure_get_config */
|
||||||
String const * configure_get_config(Configure * configure,
|
String const * configure_get_config(Configure * configure,
|
||||||
String const * section, String const * variable)
|
String const * section, String const * variable)
|
||||||
|
@ -167,6 +167,8 @@ typedef struct _Configure
|
|||||||
int configure(Prefs * prefs, char const * directory);
|
int configure(Prefs * prefs, char const * directory);
|
||||||
|
|
||||||
/* accessors */
|
/* accessors */
|
||||||
|
int configure_can_library_static(Configure * configure);
|
||||||
|
|
||||||
String const * configure_get_config(Configure * configure,
|
String const * configure_get_config(Configure * configure,
|
||||||
String const * section, String const * variable);
|
String const * section, String const * variable);
|
||||||
String const * configure_get_soext(Configure * configure);
|
String const * configure_get_soext(Configure * configure);
|
||||||
|
@ -351,16 +351,19 @@ static int _variables_targets_library(Configure * configure, FILE * fp,
|
|||||||
soname = string_new_append(target, soext, ".0", NULL);
|
soname = string_new_append(target, soext, ".0", NULL);
|
||||||
if(soname == NULL)
|
if(soname == NULL)
|
||||||
return 1;
|
return 1;
|
||||||
|
if(configure_can_library_static(configure))
|
||||||
|
/* generate a static library */
|
||||||
|
fprintf(fp, "%s%s%s", " $(OBJDIR)", target, ".a");
|
||||||
if(configure->os == HO_MACOSX)
|
if(configure->os == HO_MACOSX)
|
||||||
fprintf(fp, " %s%s%s%s%s%s%s%s%s%s%s", "$(OBJDIR)", target,
|
fprintf(fp, "%s%s%s%s%s%s%s%s%s", " $(OBJDIR)", soname,
|
||||||
".a $(OBJDIR)", soname, " $(OBJDIR)", target,
|
" $(OBJDIR)", target, ".0", soext, " $(OBJDIR)",
|
||||||
".0", soext, " $(OBJDIR)", target, soext);
|
target, soext);
|
||||||
else if(configure->os == HO_WIN32)
|
else if(configure->os == HO_WIN32)
|
||||||
fprintf(fp, "%s%s", " $(OBJDIR)", soname);
|
fprintf(fp, "%s%s", " $(OBJDIR)", soname);
|
||||||
else
|
else
|
||||||
fprintf(fp, " %s%s%s%s%s%s%s%s%s", "$(OBJDIR)", target,
|
fprintf(fp, "%s%s%s%s%s%s%s", " $(OBJDIR)", soname,
|
||||||
".a $(OBJDIR)", soname, ".0 $(OBJDIR)", soname,
|
".0 $(OBJDIR)", soname, " $(OBJDIR)", target,
|
||||||
" $(OBJDIR)", target, soext);
|
soext);
|
||||||
string_delete(soname);
|
string_delete(soname);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@ -1143,7 +1146,7 @@ static int _target_library(Configure * configure, FILE * fp,
|
|||||||
if(_target_flags(configure, fp, target) != 0)
|
if(_target_flags(configure, fp, target) != 0)
|
||||||
return 1;
|
return 1;
|
||||||
soext = configure_get_soext(configure);
|
soext = configure_get_soext(configure);
|
||||||
if(configure->os != HO_WIN32)
|
if(configure_can_library_static(configure))
|
||||||
{
|
{
|
||||||
/* generate a static library */
|
/* generate a static library */
|
||||||
fprintf(fp, "\n%s%s%s%s%s", "$(OBJDIR)", target, ".a: $(", target,
|
fprintf(fp, "\n%s%s%s%s%s", "$(OBJDIR)", target, ".a: $(", target,
|
||||||
@ -1975,7 +1978,7 @@ static int _install_target_library(Configure * configure, FILE * fp,
|
|||||||
return 0;
|
return 0;
|
||||||
soext = configure_get_soext(configure);
|
soext = configure_get_soext(configure);
|
||||||
fprintf(fp, "%s%s\n", "\t$(MKDIR) $(DESTDIR)", path);
|
fprintf(fp, "%s%s\n", "\t$(MKDIR) $(DESTDIR)", path);
|
||||||
if(configure->os != HO_WIN32)
|
if(configure_can_library_static(configure))
|
||||||
fprintf(fp, "%s%s%s%s/%s%s", "\t$(INSTALL) -m 0644 $(OBJDIR)",
|
fprintf(fp, "%s%s%s%s/%s%s", "\t$(INSTALL) -m 0644 $(OBJDIR)",
|
||||||
target, ".a $(DESTDIR)", path, target, ".a\n");
|
target, ".a $(DESTDIR)", path, target, ".a\n");
|
||||||
if((p = config_get(configure->config, target, "soname")) != NULL)
|
if((p = config_get(configure->config, target, "soname")) != NULL)
|
||||||
@ -2362,7 +2365,7 @@ static int _uninstall_target_library(Configure * configure, FILE * fp,
|
|||||||
const String rm_destdir[] = "$(RM) -- $(DESTDIR)";
|
const String rm_destdir[] = "$(RM) -- $(DESTDIR)";
|
||||||
|
|
||||||
soext = configure_get_soext(configure);
|
soext = configure_get_soext(configure);
|
||||||
if(configure->os != HO_WIN32)
|
if(configure_can_library_static(configure))
|
||||||
fprintf(fp, format, rm_destdir, path, target, ".a\n", "", "");
|
fprintf(fp, format, rm_destdir, path, target, ".a\n", "", "");
|
||||||
if((p = config_get(configure->config, target, "soname")) != NULL)
|
if((p = config_get(configure->config, target, "soname")) != NULL)
|
||||||
soname = string_new(p);
|
soname = string_new(p);
|
||||||
|
Loading…
Reference in New Issue
Block a user