Code cleanup
This commit is contained in:
parent
55bfac966f
commit
b631f7825c
@ -174,6 +174,7 @@ unsigned int enum_string_short(unsigned int last, const String * strings[],
|
|||||||
/* configure */
|
/* configure */
|
||||||
static void _configure_detect(Configure * configure);
|
static void _configure_detect(Configure * configure);
|
||||||
static HostKernel _detect_kernel(HostOS os, char const * release);
|
static HostKernel _detect_kernel(HostOS os, char const * release);
|
||||||
|
static void _configure_detect_extensions(Configure * configure);
|
||||||
static void _configure_detect_programs(Configure * configure);
|
static void _configure_detect_programs(Configure * configure);
|
||||||
static int _configure_load(Prefs * prefs, char const * directory,
|
static int _configure_load(Prefs * prefs, char const * directory,
|
||||||
configArray * ca);
|
configArray * ca);
|
||||||
@ -196,6 +197,7 @@ int configure(Prefs * prefs, char const * directory)
|
|||||||
return error_print(PROGNAME);
|
return error_print(PROGNAME);
|
||||||
cfgr.prefs = prefs;
|
cfgr.prefs = prefs;
|
||||||
_configure_detect(&cfgr);
|
_configure_detect(&cfgr);
|
||||||
|
_configure_detect_extensions(&cfgr);
|
||||||
_configure_detect_programs(&cfgr);
|
_configure_detect_programs(&cfgr);
|
||||||
if((ret = _configure_load(prefs, directory, ca)) == 0)
|
if((ret = _configure_load(prefs, directory, ca)) == 0)
|
||||||
{
|
{
|
||||||
@ -277,6 +279,23 @@ static HostKernel _detect_kernel(HostOS os, char const * release)
|
|||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void _configure_detect_extensions(Configure * configure)
|
||||||
|
{
|
||||||
|
configure->extensions.soext = ".so";
|
||||||
|
/* platform-specific */
|
||||||
|
switch(configure->os)
|
||||||
|
{
|
||||||
|
case HO_MACOSX:
|
||||||
|
configure->extensions.soext = ".dylib";
|
||||||
|
break;
|
||||||
|
case HO_WIN32:
|
||||||
|
configure->extensions.soext = ".dll";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static void _configure_detect_programs(Configure * configure)
|
static void _configure_detect_programs(Configure * configure)
|
||||||
{
|
{
|
||||||
configure->programs.ar = "ar";
|
configure->programs.ar = "ar";
|
||||||
@ -438,11 +457,7 @@ String const * configure_get_config(Configure * configure,
|
|||||||
/* configure_get_soext */
|
/* configure_get_soext */
|
||||||
String const * configure_get_soext(Configure * configure)
|
String const * configure_get_soext(Configure * configure)
|
||||||
{
|
{
|
||||||
if(configure->os == HO_MACOSX)
|
return configure->extensions.soext;
|
||||||
return ".dylib";
|
|
||||||
else if(configure->os == HO_WIN32)
|
|
||||||
return ".dll";
|
|
||||||
return ".so";
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -148,6 +148,10 @@ typedef struct _Configure
|
|||||||
HostOS os;
|
HostOS os;
|
||||||
HostKernel kernel;
|
HostKernel kernel;
|
||||||
struct
|
struct
|
||||||
|
{
|
||||||
|
char const * soext;
|
||||||
|
} extensions;
|
||||||
|
struct
|
||||||
{
|
{
|
||||||
char const * ar;
|
char const * ar;
|
||||||
char const * as;
|
char const * as;
|
||||||
|
Loading…
Reference in New Issue
Block a user