Commit 6aa46494 authored by claes's avatar claes

pwre config argument --version added to set fix loadfile version

parent a74479d1
......@@ -67,10 +67,8 @@
# define SET_VERSION(a, b, c, d) ((pwr_tVersion)((a << 24) + (a << 16) + (a << 8) + a))
#endif
#define pwrv_cBuildTimeStr "14-JAN-2011 20:00:00"
#define pwrv_cPwrVersionStr "V4.8.1"
#define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 1)
#define pwrv_cPwrVersionStr "V4.8.2"
#define pwrv_cPwrVersion SET_VERSION('V', 4, 8, 2)
#define pwrv_cWbdbVersionShortStr "V48"
#define pwrv_cPwrCopyright "Copyright (C) 2005-2011 SSAB Oxelsund"
......
......@@ -83,7 +83,7 @@ int dcli_get_defaultfilename(
char *outname,
const char *ext);
#if defined (OS_LYNX) || defined(OS_LINUX) || defined(OS_MACOS) || defined OS_FREEBSD
int dcli_replace_env( char *str, char *newstr);
int dcli_replace_env( const char *str, char *newstr);
#endif
char *dcli_fgetname( FILE *fp, char *name, char *def_name);
int dcli_translate_filename( char *out, const char *in);
......
......@@ -150,7 +150,7 @@ int dcli_get_defaultfilename(
* will be detected.
*
**************************************************************************/
int dcli_replace_env( char *str, char *newstr)
int dcli_replace_env( const char *str, char *newstr)
{
char *s;
char *t;
......
......@@ -150,7 +150,7 @@ sub configure()
exit 1;
}
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh";
my $fname = $ENV{"pwre_bin"} . "/pwre_configure.sh"." ".$_[0]." ".$_[1]." ".$_[2];
system( $fname);
}
......
#!/bin/bash
pwre_help()
{
cat <<EOF
pwre_configure.h
Arguments
--help Display help.
--version State fix version of loadfiles, eg
pwre configure --version "29-MAY-2011 16:00:00"
EOF
}
pwre_config_init()
{
d=`eval date +\"%F %X\"`
......@@ -217,7 +231,6 @@ let lib_cnt=0
let i=0
hwpl=`eval uname -i`
# Bash
if [ "$SHELL" != "/bin/bash" ] && [ "$SHELL" != "/usr/local/bin/bash" ]; then
echo "Config error: Default shell has to be bash"
......@@ -250,10 +263,25 @@ if test ! -e $pwre_croot; then
exit
fi
# Options
if [ "$1" = "--help" ]; then
pwre_help
exit
elif [ "$1" = "--version" ] && [ "$2" != "" ] && [ "$3" != "" ]; then
buildversion=$2" "$3
fi
pwre_create_blddir
pwre_create_makedir
pwre_config_init
if [ "$buildversion" != "" ]; then
echo "export PWRE_CONF_BUILDVERSION=\"$buildversion\"" >> $cfile
else
echo "export PWRE_CONF_BUILDVERSION=\"0\"" >> $cfile
fi
if test $pwre_hw == "hw_arm"; then
......
......@@ -352,7 +352,22 @@ elif [ $OpSys -eq $OpSys_X86_LINUX ]; then
Compile$FileTypeStr
exit $gcg_status
elif [ $CurrentOpSys -eq $OpSys_X86_64_LINUX ]; then
echo "-- Not built for x86_linux"
# echo "-- Trying to build for x86_linux"
export pwr_exe=$pwrb_root/os_linux/hw_x86/exp/exe
export pwr_lib=$pwrb_root/os_linux/hw_x86/exp/lib
export pwr_obj=$pwrb_root/os_linux/hw_x86/exp/obj
export pwrp_exe=$pwrp_root/bld/x86_linux/exe
export pwrp_lib=$pwrp_root/bld/x86_linux/lib
export pwrp_obj=$pwrp_root/bld/x86_linux/obj
cc_cmd="$cc -c -x c -w -m32 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
ldxx="g++ -m32 -fPIC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
fi
elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
......@@ -368,7 +383,22 @@ elif [ $OpSys -eq $OpSys_X86_64_LINUX ]; then
Compile$FileTypeStr
exit $gcg_status
elif [ $CurrentOpSys -eq $OpSys_X86_LINUX ]; then
echo "-- Not built for x86_64_linux"
# echo "-- Trying to build for x86_64_linux"
export pwr_exe=$pwrb_root/os_linux/hw_x86_64/exp/exe
export pwr_lib=$pwrb_root/os_linux/hw_x86_64/exp/lib
export pwr_obj=$pwrb_root/os_linux/hw_x86_64/exp/obj
export pwrp_exe=$pwrp_root/bld/x86_64_linux/exe
export pwrp_lib=$pwrp_root/bld/x86_64_linux/lib
export pwrp_obj=$pwrp_root/bld/x86_64_linux/obj
cc_cmd="$cc -c -x c -w -m64 -fPIC $cc_debug -D_REENTRANT -DOS_LINUX -I$pwr_inc -I$pwrp_inc -I$pwrp_tmp $PWR_EXT_INC"
ldxx="g++ -m64 -fPIC"
FileTypeStr="`echo $vFileType| cut -f $FileTypeIdx -d ,`"
# Execute build command
Compile$FileTypeStr
exit $gcg_status
fi
elif [ $OpSys -eq $OpSys_AXP_VMS ]; then
......
......@@ -273,8 +273,8 @@ dcli_tCmdTable wnav_command_table[] = {
"/LASTCHILD", "/VOLUME", "/ALL",
"/CLASS", "/DEBUG", "/NODECONFIG",
"/NAME", "/IDENTITY", "/FILES", "/OUT", "/IGNORE",
"/DIRECTORY", "/BUILDVERSION", "/DATABASE", "/SERVER",
"/PLCPGM", "/HIERARCHY", "/FROM_PLCPGM", "/TEMPLATE", ""}
"/DIRECTORY", "/DATABASE", "/SERVER",
"/PLCPGM", "/HIERARCHY", "/FROM_PLCPGM", "/TEMPLATE", ""}
},
{
"NEW",
......@@ -4014,9 +4014,9 @@ static int wnav_create_func( void *client_data,
pwr_tFileName outstr;
char *outstr_p;
int ignore;
int buildversion;
pwr_tStatus sts;
pwr_tTime buildtime, *timep;
char *s;
// Command is "CREATE SNAPSHOT"
......@@ -4032,15 +4032,22 @@ static int wnav_create_func( void *client_data,
outstr_p = 0;
ignore = ODD( dcli_get_qualifier( "/IGNORE", 0, 0));
buildversion = ODD( dcli_get_qualifier( "/BUILDVERSION", 0, 0));
if ( buildversion) {
time_AsciiToA( pwrv_cBuildTimeStr, &buildtime);
timep = &buildtime;
if ( (s = getenv( "PWRE_CONF_BUILDVERSION"))) {
if ( strcmp( s, "") == 0 ||
strcmp( s, "0") == 0)
timep = 0;
else {
if ( ODD(time_AsciiToA( s, &buildtime)))
timep = &buildtime;
else {
wnav->message('E', "Syntax error in PWRE_CONF_BUILDVERSION");
return WNAV__SYNTAX;
}
}
}
else
timep = 0;
sts = wnav_wccm_get_wbctx_cb( wnav, &wnav->wbctx);
if ( EVEN(sts)) return sts;
......
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