Commit aeb373f8 authored by U-nestor\Claes's avatar U-nestor\Claes

More cygwin changes

parent a43e6737
......@@ -56,16 +56,13 @@
echo "User $user"
eval `ipcs -s|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm sem %s;", $2
}'`
eval `ipcs -s|grep ^s|grep "[ \t]$user[ \t]"|awk '{ printf "ipcrm -s %s;", $2 }'`
# remove message queues
eval `ipcs -q|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm msg %s;", $2
}'`
eval `ipcs -q|grep ^q|grep "[ \t]$user[ \t]"|awk '{ printf "ipcrm -q %s;", $2 }'`
# remove shared memory
eval `ipcs -m|grep ^0x|grep "[ \t]$user[ \t]"|awk '{printf "ipcrm shm %s;", $2
}'`
eval `ipcs -m|grep ^m|grep "[ \t]$user[ \t]"|awk '{ printf "ipcrm -m %s;", $2 }'`
if [ -e $pwrp_exe/pwrp_stop.sh ]; then
source $pwrp_exe/pwrp_stop.sh
......
......@@ -479,8 +479,10 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
return NULL;
}
ret = close(tfd);
#if !defined OS_CYGWIN
unlink(tfname);
#endif
sect = (dbs_sSect*)(base + dbs_dAlign(sizeof(dbs_sFile)));
vrp = (dbs_sVolRef*)(base + sect[dbs_eSect_volref].offset);
nVolRef = sect[dbs_eSect_volref].size / dbs_dAlign(sizeof(dbs_sVolRef));
......@@ -492,6 +494,7 @@ dbs_Map(pwr_tStatus *sts, const char *filename)
mep->vrp = vrp;
mep->nVolRef = nVolRef;
mep->base = base;
strncpy(mep->tfname, tfname, sizeof(tfname));
vep = mep->venv;
vep->mp = mep;
......@@ -606,6 +609,9 @@ dbs_Unmap(pwr_tStatus *sts, dbs_sMenv *mep)
if (mep->flags.b.isMapped) {
munmap(mep->base, mep->size);
mep->flags.b.isMapped = 0;
#if defined OS_CYGWIN
unlink(mep->tfname);
#endif
return TRUE;
} else if (mep->f != NULL) {
printf("ERROR, dbs_Unmap, trying to unmap a non mapped file\n");
......
......@@ -579,7 +579,8 @@ struct dbs_sMenv {
pwr_tUInt32 size; /**< size of mapped file */
char *base;
dbs_sVolRef *vrp;
dbs_sVenv venv[1];
char tfname[40];
dbs_sVenv venv[1];
};
......
......@@ -618,7 +618,8 @@ struct dbs_sScObject {
% pwr_tUInt32 size; /**< size of mapped file */
% char *base;
% dbs_sVolRef *vrp;
% dbs_sVenv venv[1];
% char tfname[40];
% dbs_sVenv venv[1];
%};
%
%
......
......@@ -19,7 +19,7 @@ pwra_set_func()
# Command is "set base"
basename=$2
basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "[[:<:]]"$basename"[[:>:]]" | grep "^"%base"[[:>:]]" | awk '{print $3}'`
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\b"$basename"\b" | grep "^"%base"\b" | awk '{print $3}'`
if [ -z $baseroot ]; then
echo "Unable to find base '$2'"
return
......@@ -60,14 +60,14 @@ pwra_set_func()
# Command is "set project"
project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"[[:>:]]" | awk '{print $2}'`
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"\b" | awk '{print $2}'`
basename=${basename//\./\\.}
if [ -z $basename ]; then
echo "Unable to find project '$2'"
return
fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "[[:<:]]"$basename"[[:>:]]" | grep "^"%base"[[:>:]]" | awk '{print $3}'`
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "\b"$basename"\b" | grep "^"%base"\b" | awk '{print $3}'`
if [ -z $baseroot ]; then
echo "Unable to find base '$2'"
return
......@@ -117,6 +117,7 @@ EOF
pwra_parse ()
{
unamestr=`eval uname`
onamestr=`eval uname -o`
machine=`eval uname -m`
if [ $unamestr == "Darwin" ]; then
os="os_macos"
......@@ -127,6 +128,9 @@ pwra_parse ()
elif [ $unamestr == "OpenBSD" ]; then
os="os_openbsd"
hw="hw_x86_64"
elif [ $onamestr == "Cygwin" ]; then
os="os_cygwin"
hw="hw_x86"
else
if [ $machine != "x86_64" ]; then
machine="x86"
......
#! /bin/bash
#
#
#
pwra_set_func()
{
local cmd
local baseroot
local project
if [ -z $1 ]; then
echo "Qualifier is missing"
return
fi
cmd="base"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
# Command is "set base"
basename=$2
basename=${basename//\./\\.}
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "[[:<:]]"$basename"[[:>:]]" | grep "^"%base"[[:>:]]" | awk '{print $3}'`
if [ -z $baseroot ]; then
echo "Unable to find base '$2'"
return
fi
baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist"
elif [ "$3" != "cross" ]; then
if [ ! -e $baseroot/$os/$hw/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot"
return
fi
source $baseroot/$os/$hw/exp/exe/pwrp_env.sh set baseroot $baseroot
fi
return
fi
cmd="baseroot"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
# Command is "set baseroot"
baseroot=$2
baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist"
else
if [ ! -e $baseroot/$os/$hw/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot"
return
fi
source $baseroot/$os/$hw/exp/exe/pwrp_env.sh set baseroot $baseroot
fi
return
fi
cmd="project"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
# Command is "set project"
project=$2
basename=`eval cat $pwra_db/pwr_projectlist.dat | grep "^"$project"[[:>:]]" | awk '{print $2}'`
basename=${basename//\./\\.}
if [ -z $basename ]; then
echo "Unable to find project '$2'"
return
fi
baseroot=`eval cat $pwra_db/pwr_projectlist.dat | grep "[[:<:]]"$basename"[[:>:]]" | grep "^"%base"[[:>:]]" | awk '{print $3}'`
if [ -z $baseroot ]; then
echo "Unable to find base '$2'"
return
fi
baseroot=${baseroot%/}
if [ ! -e "$baseroot" ]; then
echo "Base $baseroot doesn't exist"
else
if [ ! -e $baseroot/$os/$hw/exp/exe/pwrp_env.sh ]; then
echo "Not a base directory: $baseroot"
return
fi
source $baseroot/$os/$hw/exp/exe/pwrp_env.sh set baseroot $baseroot
source $baseroot/$os/$hw/exp/exe/pwrp_env.sh set project $project
export PS1='\u@\h/$pwrp_projectname/-.\W> '
fi
return
fi
if [ -z $pwr_exe ]; then
echo "No project is defined"
return
fi
source $pwr_exe/pwrp_env.sh set $1 $2 $3
}
pwra_help_func()
{
source $pwr_exe/pwrp_env.sh $@
cat << EOF
pwra_env.sh - Utilities for pwr project environment
help - Display help
set base 'distribution' - Setup environment to proview base distribution
set baseroot 'root' - Setup environment to proview base distribution
EOF
}
pwra_parse ()
{
unamestr=`eval uname`
machine=`eval uname -m`
if [ $unamestr == "Darwin" ]; then
os="os_macos"
hw="hw_x86_64"
elif [ $unamestr == "FreeBSD" ]; then
os="os_freebsd"
hw="hw_x86_64"
elif [ $unamestr == "OpenBSD" ]; then
os="os_openbsd"
hw="hw_x86_64"
else
if [ $machine != "x86_64" ]; then
machine="x86"
fi
os="os_linux"
hw="hw_"$machine
fi
local cmd
cmd="help"
if [ -z $1 ] || [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
pwra_help_func $2 $3
return
fi
cmd="set"
if [ $1 = $cmd ] || [ ${cmd#$1} != $cmd ]; then
pwra_set_func $2 $3
return
fi
if [ -z $pwr_exe ]; then
echo "No project is defined"
return
fi
source $pwr_exe/pwrp_env.sh $@
}
pwra_parse $@
......@@ -376,7 +376,7 @@ else
pwre_config_check_lib libX11 LIBX11 lib lib 0 "/usr/lib/libX11.a"
pwre_config_check_include antlr ANTLR 1 "/usr/local/include/antlr/CommonAST.hpp"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk/gtk.h"
pwre_config_check_include gtk GTK 1 "/usr/local/include/gtk-2.0/gtk.h:/usr/local/include/gtk-2.0/gtk/gtk.h:/usr/include/gtk-2.0/gtk"
pwre_config_check_include jni JNI 1 "$jdk/include/jni.h"
pwre_config_check_include jni JNI 0 "$jdk/include/win32/jni_md.h"
pwre_config_check_include alsa ALSA 1 "/usr/include/alsa/asoundlib.h"
......
......@@ -194,7 +194,7 @@ CompileRtNode()
$Libs \
$ld_opt \
$pwr_obj/pwr_msg_rt.o $pwr_obj/pwr_msg_co.o \
-lrt -lpwr_remote -lpwr_nmps -lpwr_rt -lpwr_co -lrpcsvc -lpwr_msg_dummy -lpthread -lm
-lrt -lpwr_remote -lpwr_nmps -lpwr_rt -lpwr_co -lpwr_msg_dummy -ltirpc -lpthread -lm
then
echo "-- Plc program linked for $OsStr $say_linkdebug $OutFile"
gcg_status=$gcg__success
......
......@@ -1304,7 +1304,8 @@ pwr_tStatus lfu_SaveDirectoryVolume(
os == pwr_mOpSys_X86_64_LINUX ||
os == pwr_mOpSys_X86_64_MACOS ||
os == pwr_mOpSys_X86_64_FREEBSD ||
os == pwr_mOpSys_X86_64_OPENBSD )) {
os == pwr_mOpSys_X86_64_OPENBSD ||
os == pwr_mOpSys_X86_CYGWIN )) {
char msg[200];
sprintf( msg, "Error in NodeConfig object '%s', OperatingSystem is not valid", nodeconfig_name);
MsgWindow::message( 'E', msg, msgw_ePop_Default);
......
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