Commit 14d77b6c authored by Claes Sjofors's avatar Claes Sjofors

BuildOptions adapted to ARM

parent 1eefe36c
...@@ -2669,7 +2669,6 @@ char *cdh_OpSysToStr( pwr_mOpSys opsys) ...@@ -2669,7 +2669,6 @@ char *cdh_OpSysToStr( pwr_mOpSys opsys)
static char str[32]; static char str[32];
switch( opsys) { switch( opsys) {
case pwr_mOpSys_VAX_ELN: strcpy( str, "vax_eln"); break;
case pwr_mOpSys_VAX_VMS: strcpy( str, "vax_vms"); break; case pwr_mOpSys_VAX_VMS: strcpy( str, "vax_vms"); break;
case pwr_mOpSys_AXP_VMS: strcpy( str, "axp_vms"); break; case pwr_mOpSys_AXP_VMS: strcpy( str, "axp_vms"); break;
case pwr_mOpSys_PPC_LYNX: strcpy( str, "ppc_lynx"); break; case pwr_mOpSys_PPC_LYNX: strcpy( str, "ppc_lynx"); break;
...@@ -2677,6 +2676,37 @@ char *cdh_OpSysToStr( pwr_mOpSys opsys) ...@@ -2677,6 +2676,37 @@ char *cdh_OpSysToStr( pwr_mOpSys opsys)
case pwr_mOpSys_PPC_LINUX: strcpy( str, "ppc_linux"); break; case pwr_mOpSys_PPC_LINUX: strcpy( str, "ppc_linux"); break;
case pwr_mOpSys_X86_LINUX: strcpy( str, "x86_linux"); break; case pwr_mOpSys_X86_LINUX: strcpy( str, "x86_linux"); break;
case pwr_mOpSys_X86_64_LINUX: strcpy( str, "x86_64_linux"); break; case pwr_mOpSys_X86_64_LINUX: strcpy( str, "x86_64_linux"); break;
case pwr_mOpSys_X86_64_MACOS: strcpy( str, "x86_64_macos"); break;
case pwr_mOpSys_ARM_LINUX: strcpy( str, "arm_linux"); break;
case pwr_mOpSys_X86_64_FREEBSD: strcpy( str, "x86_64_freebsd"); break;
default: strcpy( str, "");
}
return str;
}
//! Convert operating system to directory string
/*!
For example pwr_mOpSys_X86_LINUX will be converted to "os_linux/hw_x86".
A pointer to a static string is returned.
\param opsys Operating system.
\return String
*/
char *cdh_OpSysToDirStr( pwr_mOpSys opsys)
{
static char str[80];
switch( opsys) {
case pwr_mOpSys_VAX_VMS: strcpy( str, "os_vms/hw_vax"); break;
case pwr_mOpSys_AXP_VMS: strcpy( str, "os_vms/hw_axp"); break;
case pwr_mOpSys_PPC_LYNX: strcpy( str, "os_lynx/hw_ppc"); break;
case pwr_mOpSys_X86_LYNX: strcpy( str, "os_lynx/hw_x86"); break;
case pwr_mOpSys_PPC_LINUX: strcpy( str, "os_linux/hw_ppc"); break;
case pwr_mOpSys_X86_LINUX: strcpy( str, "os_linux/hw_x86"); break;
case pwr_mOpSys_X86_64_LINUX: strcpy( str, "os_linux/hw_x86_64"); break;
case pwr_mOpSys_X86_64_MACOS: strcpy( str, "os_macos/hw_x86_64"); break;
case pwr_mOpSys_ARM_LINUX: strcpy( str, "os_linux/hw_arm"); break;
case pwr_mOpSys_X86_64_FREEBSD: strcpy( str, "os_freebsd/hw_x86_64"); break;
default: strcpy( str, ""); default: strcpy( str, "");
} }
return str; return str;
......
...@@ -1045,6 +1045,8 @@ cdh_StrncpyCutOff( ...@@ -1045,6 +1045,8 @@ cdh_StrncpyCutOff(
char *cdh_OpSysToStr( pwr_mOpSys opsys); char *cdh_OpSysToStr( pwr_mOpSys opsys);
char *cdh_OpSysToDirStr( pwr_mOpSys opsys);
pwr_sAttrRef cdh_ArefToCastAref( pwr_sAttrRef *arp); pwr_sAttrRef cdh_ArefToCastAref( pwr_sAttrRef *arp);
pwr_sAttrRef cdh_ArefToDisableAref( pwr_sAttrRef *arp); pwr_sAttrRef cdh_ArefToDisableAref( pwr_sAttrRef *arp);
......
...@@ -684,6 +684,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -684,6 +684,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
char path[80]; char path[80];
int path_file_created = 0; int path_file_created = 0;
pwr_tString80 custom_platform; pwr_tString80 custom_platform;
pwr_mOpSys custom_os;
syntax_error = 0; syntax_error = 0;
strcpy( null_nodename, "-"); strcpy( null_nodename, "-");
...@@ -1336,7 +1337,7 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -1336,7 +1337,7 @@ pwr_tStatus lfu_SaveDirectoryVolume(
lfu_check_appl_file( nodename_ptr, *bus_number_ptr); lfu_check_appl_file( nodename_ptr, *bus_number_ptr);
lfu_check_opt_file( nodename_ptr, *bus_number_ptr, (pwr_mOpSys) os); // lfu_check_opt_file( nodename_ptr, *bus_number_ptr, (pwr_mOpSys) os);
/* Find the volumes in this node */ /* Find the volumes in this node */
sts = ldh_GetChild( ldhses, nodeobjid, &volobjid); sts = ldh_GetChild( ldhses, nodeobjid, &volobjid);
...@@ -2075,11 +2076,11 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2075,11 +2076,11 @@ pwr_tStatus lfu_SaveDirectoryVolume(
distr_options = (lfu_mDistrOpt)((int)distr_options | lfu_mDistrOpt_NoRootVolume); distr_options = (lfu_mDistrOpt)((int)distr_options | lfu_mDistrOpt_NoRootVolume);
strcpy( custom_platform, "-"); strcpy( custom_platform, "-");
custom_os = pwr_mOpSys__;
/* Find any CustomBuild for this node */ /* Find any CustomBuild for this node */
class_vect[0] = pwr_cClass_CustomBuild; class_vect[0] = pwr_cClass_CustomBuild;
class_vect[1] = pwr_cClass_BuildOptions; class_vect[1] = 0;
class_vect[2] = 0;
objcount = 0; objcount = 0;
objlist = 0; objlist = 0;
...@@ -2103,12 +2104,13 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2103,12 +2104,13 @@ pwr_tStatus lfu_SaveDirectoryVolume(
switch ( ccid) { switch ( ccid) {
case pwr_cClass_CustomBuild: { case pwr_cClass_CustomBuild: {
char *platform_p; char *platform_p;
pwr_tMask *os_p;
sts = ldh_ObjidToName( ldhses, applobjid, ldh_eName_Object, sts = ldh_ObjidToName( ldhses, applobjid, ldh_eName_Object,
appl_name, sizeof(appl_name), &size); appl_name, sizeof(appl_name), &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
/* Check Source attribute */ /* Get Platform attribute */
sts = ldh_GetObjectPar( ldhses, applobjid, "DevBody", sts = ldh_GetObjectPar( ldhses, applobjid, "DevBody",
"Platform", &platform_p, &size); "Platform", &platform_p, &size);
if (EVEN(sts)) return sts; if (EVEN(sts)) return sts;
...@@ -2116,14 +2118,54 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2116,14 +2118,54 @@ pwr_tStatus lfu_SaveDirectoryVolume(
if ( strcmp( platform_p, "") != 0) if ( strcmp( platform_p, "") != 0)
strncpy( custom_platform, platform_p, sizeof(custom_platform)); strncpy( custom_platform, platform_p, sizeof(custom_platform));
free( platform_p); free( platform_p);
/* Get OperatingSystem attribute */
sts = ldh_GetObjectPar( ldhses, applobjid, "DevBody",
"OperatingSystem", (char **)&os_p, &size);
if (EVEN(sts)) return sts;
custom_os = (pwr_mOpSys) *os_p;
free( os_p);
break; break;
} }
default: ;
}
}
/* Find any BuildOptions for this node */
class_vect[0] = pwr_cClass_BuildOptions;
class_vect[1] = 0;
objcount = 0;
objlist = 0;
sts = trv_create_ctx( &trvctx, ldhses, nodeobjid, class_vect, NULL,
NULL);
if ( EVEN(sts)) return sts;
sts = trv_object_search( trvctx,
&utl_objidlist_insert, &objlist,
&objcount, 0, 0, 0);
if ( EVEN (sts)) return sts;
sts = trv_delete_ctx( trvctx);
for ( obj_ptr = objlist; obj_ptr; obj_ptr = obj_ptr->next) {
applobjid = obj_ptr->objid;
sts = ldh_GetObjectClass( ldhses, applobjid, &ccid);
if ( EVEN(sts)) return sts;
switch ( ccid) {
case pwr_cClass_BuildOptions: { case pwr_cClass_BuildOptions: {
pwr_sClass_BuildOptions *bop; pwr_sClass_BuildOptions *bop;
int size; int size;
pwr_tString80 ar, opt; pwr_tString80 ar, opt;
char str[2000] = ""; char str[2000] = "";
FILE *optfile; FILE *optfile;
char dir[80];
if ( os == pwr_mOpSys_CustomBuild && custom_os == pwr_mOpSys__)
break;
sts = ldh_GetObjectBody( ldhses, applobjid, "RtBody", (void **)&bop, &size); sts = ldh_GetObjectBody( ldhses, applobjid, "RtBody", (void **)&bop, &size);
if ( EVEN(sts)) return sts; if ( EVEN(sts)) return sts;
...@@ -2140,10 +2182,17 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2140,10 +2182,17 @@ pwr_tStatus lfu_SaveDirectoryVolume(
sprintf( &str[strlen(str)], "%s ", opt); sprintf( &str[strlen(str)], "%s ", opt);
} }
if ( bop->SystemModules & pwr_mBuildOptionsMask_IoUser) if ( bop->SystemModules & pwr_mBuildOptionsMask_IoUser)
sprintf( &str[strlen(str)], "$pwrp_obj/rt_io_user.o "); sprintf( &str[strlen(str)], "$pwrp_obj/rt_io_user.o ");
else else {
sprintf( &str[strlen(str)], "$pwr_obj/rt_io_user.o "); if ( os == pwr_mOpSys_CustomBuild)
sprintf( &str[strlen(str)], "$pwrb_root/%s/exp/obj/rt_io_user.o ",
cdh_OpSysToDirStr( (pwr_mOpSys)custom_os));
else
sprintf( &str[strlen(str)], "$pwrb_root/%s/exp/obj/rt_io_user.o ",
cdh_OpSysToDirStr( (pwr_mOpSys)os));
}
for ( int i = 0; i < (int)(sizeof(bop->Archives)/sizeof(bop->Archives[0])); i++) { for ( int i = 0; i < (int)(sizeof(bop->Archives)/sizeof(bop->Archives[0])); i++) {
dcli_trim( opt, bop->Archives[i]); dcli_trim( opt, bop->Archives[i]);
...@@ -2198,7 +2247,11 @@ pwr_tStatus lfu_SaveDirectoryVolume( ...@@ -2198,7 +2247,11 @@ pwr_tStatus lfu_SaveDirectoryVolume(
free( (char *)bop); free( (char *)bop);
sprintf( fname, load_cNameOpt, "$pwrp_exe/", nodename_ptr, *bus_number_ptr); if ( os == pwr_mOpSys_CustomBuild)
sprintf( dir, "$pwrp_root/bld/%s/exe/", cdh_OpSysToStr( (pwr_mOpSys)custom_os));
else
sprintf( dir, "$pwrp_root/bld/%s/exe/", cdh_OpSysToStr( (pwr_mOpSys)os));
sprintf( fname, load_cNameOpt, dir, nodename_ptr, *bus_number_ptr);
dcli_translate_filename( fname, fname); dcli_translate_filename( fname, fname);
optfile = fopen( fname, "w"); optfile = fopen( fname, "w");
if ( optfile == 0) { if ( optfile == 0) {
......
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