Commit ccf44dd9 authored by Erwan Jahier's avatar Erwan Jahier
Browse files

Some work to make the non-reg tests work on win32.

It is a bit tricky because all the tools are compiled with the mingw
compiler, which means that all the system calls are done via the DOS
convention. Therefore, we need  to use :

- the rigth path conventions
- .bat instead of .sh scripts
parent 47fa7fe5
......@@ -39,6 +39,7 @@ slink:
cpcomp:
cp `which lus2lic$(EXE)` $(BIN_INSTALL_DIR)
cp `which lus2ec` $(BIN_INSTALL_DIR)
cp `which ecexe$(EXE)` $(BIN_INSTALL_DIR)
cp `which ec2c$(EXE)` $(BIN_INSTALL_DIR)
cp `which simec$(EXE)` $(BIN_INSTALL_DIR)
......
......@@ -31,9 +31,9 @@ EXE :=
HOST_TYPE=$(HOSTTYPE)
# Where to install bins, libs, and include files
PRE_RELEASE_DIR=$(LURETTE_PATH)/pre_release/$(HOSTTYPE)/
BIN_INSTALL_DIR = $(PRE_RELEASE_DIR)/bin
LIB_INSTALL_DIR = $(PRE_RELEASE_DIR)/lib
INC_INSTALL_DIR = $(PRE_RELEASE_DIR)/include
BIN_INSTALL_DIR=$(PRE_RELEASE_DIR)/bin
LIB_INSTALL_DIR=$(PRE_RELEASE_DIR)/lib
INC_INSTALL_DIR=$(PRE_RELEASE_DIR)/include
CPP=cpp
GCC=gcc
GPP=g++
......@@ -95,7 +95,7 @@ ifeq ($(HOSTTYPE),mac)
else
ifeq ($(HOSTTYPE),cross-win32)
ifeq ($(HOSTTYPE),win32)
# DEBUG= -Wl,--subsystem,windows -mwindows
# generate native win32 code using a cross compiler (source set_cross)
......
......@@ -166,7 +166,7 @@ ifdef WIN32
EXE := .exe
endif
ifeq ($(HOSTTYPE),cross-win32)
ifeq ($(HOSTTYPE),win32)
# XXX R1 : fait planter Makefile.luc4c en mode cross-win32!!!
EXE :=
endif
......
Je note ici toutes les choses que je remarque au sujet de win32...
- ZZZ attention, les binaires ne sont plus mis sous $LURETTE_PATH/$HOST_TYPE/bin
mais sous $LURETTE_PATH/bin
- pour pouvoir faire fonctionner luciole, il faut un gcc mingw
sur croix, il y en a un là :
GCC="c:\Program Files\Esterel Technologies\SCADE 6.1.2\SCADE Suite\mingw\bin\gcc.exe"
- liens symboliques : je n'ai pas besoin de lancer le script ~/script/lnsw, car
les liens unix et les liens win32 ne se chevauchent pas. sous win32, un fichier
toto.lnk est créé, et utilisé, bien qu'on ne voit que le fichier toto.
s'il existe un lien unix appelé toto, win32 l'ignore et point bien vers toto.lnk.
- une commande utile : taskkill /F /IM <nom du process>
- lus2ec ne marche avec une version compilée sous mingw car les
appels systeme sont affectué dans un environnement DOS. il faudrait
ecrire un lus2ec.bat qui va bien. Bon, d'un autre coté, lus2lic qui
ne se base pas sur un script sh fonctionne bien.
- pour pouvoir utiliser lurette depuis scade, il faut lancer scade depuis une console
apres avoir lancé un "win.bat" qui positionne les chemins comme il faut.
......@@ -19,7 +22,7 @@ trouve jamais gen_stubs (alors que ce meme lurettetop trouve tout ce qui lui
quand il est appele depuis scade...).
- il ne faut pas oublié de positionner la variable HOSTTYPE.
- obselete ? il ne faut pas oublier de positionner la variable HOSTTYPE.
bouton "démarrer"
-> menu "Parametres"
......
......@@ -16,7 +16,7 @@ unset LC_ALL LC_CTYPE LC_COLLATE LC_MESSAGES LC_MONETARY LC_NUMERIC LC_TIME
case `./config.guess` in
i*86-pc-linux-*) HOST_TYPE=linux ;;
sparc-sun-solaris2.*) HOST_TYPE=sparc-sun ;;
i*86-*-cygwin) HOST_TYPE=cygwin ;;
i*86-*-cygwin) HOST_TYPE=win32 ;;
i*86-apple*) HOST_TYPE=mac ;;
*) AC_MSG_ERROR(Unsupported architecture);;
esac
......@@ -123,12 +123,49 @@ CYGWIN*)
esac
#-----------------------------------------------------------------------------#
EXE=
SCADE_OS_NAME=$V_WHOAMI
AC_SUBST(SCADE_OS_NAME)
case "$HOST_TYPE" in
sparc-sun)
LDL="-lsocket -lnsl -ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
;;
cygwin)
LDL="-ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
;;
win32)
LDL="-ldl -lstdc++"
NOCYGWIN=-mno-cygwin
WIN32LIB=-lws2_32
LINKER=gcc
EXE=.exe
;;
mac)
LIB_GC=
LDL=-ldl
NOCYGWIN=
WIN32LIB=
LINKER=g++
;;
*)
LIB_GC=
LDL="-ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
esac
AC_SUBST(LIB_GC)
AC_SUBST(LDL)
AC_SUBST(LINKER)
AC_SUBST(NOCYGWIN)
AC_SUBST(WIN32LIB)
#-----------------------------------------------------------------------------#
# Ask user for path to more libs and headers
......@@ -147,78 +184,15 @@ AC_SUBST(MORE_LIB)
#-----------------------------------------------------------------------------#
# Lustre tools
LUS2LIC=lus2lic$(EXE)
LUS2EC=lus2ec$(EXE)
EC2C=ec2c$(EXE)
LUS2LIC=lus2lic$EXE
LUS2EC=lus2ec$EXE
EC2C=ec2c$EXE
AC_SUBST(LUS2LIC)
AC_SUBST(LUS2EC)
AC_SUBST(EC2C)
#-----------------------------------------------------------------------------#
# Scade tools
case "$HOST_TYPE" in
win32|cygwin)
AC_CHECK_PROG(SCADE2LUSTREBIN,SCADE2LUSTRE.EXE,SCADE2LUSTRE.EXE,no)
if test "$SCADE2LUSTREBIN" = no ; then
AC_MSG_WARN(*** Cannot find SCADE2LUSTRE.EXE the scade to lustre compiler.)
fi
SCADE2LUSTRE=SCADE2LUSTRE.EXE
AC_PATH_PROG(S2L,scade2lustre_bin.exe)
SCADE_INSTALL_DIR=`echo $S2L | sed 's/bin\/scade2lustre_bin.exe//'`
AC_CHECK_PROG(LUSTRE2C,LUSTRE2C.EXE,LUSTRE2C.EXE,no)
if test "$LUSTRE2C" = no ; then
AC_MSG_WARN(*** Cannot find lustre2C the scade/lustre to c compiler.)
fi
LUSTRE2C=LUSTRE2C.EXE
AC_CHECK_PROG(SCADE_CG,SCADE_CG.EXE,SCADE_CG.EXE,no)
if test "$SCADE_CG" = no ; then
AC_MSG_WARN(*** Cannot find SCADE_CG.EXE the scade compiler.)
fi
SCADE_CG=SCADE_CG.EXE
AC_CHECK_PROG(SCADE,SCADE.EXE,SCADE.EXE,no)
if test "$SCADE" = no ; then
AC_MSG_WARN(*** Cannot find SCADE.EXE the scade compiler.)
fi
SCADE=SCADE.EXE
;;
*)
AC_CHECK_PROG(SCADE2LUSTRE,scade2lustre,scade2lustre,no)
if test "$SCADE2LUSTRE" = no ; then
AC_MSG_WARN(*** Cannot find scade2lustre the scade to lustre compiler.)
SCADE2LUSTRE=$SCADE2LUSTRE
fi
AC_PATH_PROG(S2L,scade2lustre)
SCADE_INSTALL_DIR=`echo $S2L | sed 's/bin\/scade2lustre//'`
AC_CHECK_PROG(LUSTRE2C,lustre2C,lustre2C,no)
if test "$LUSTRE2C" = no ; then
AC_MSG_WARN(*** Cannot find lustre2C the scade/lustre to c compiler.)
LUSTRE2C=$LUSTRE2C
fi
AC_CHECK_PROG(SCADE_CG,scade_cg,scade_cg,no)
if test "$SCADE_CG" = no ; then
AC_MSG_WARN(*** Cannot find scade_cg the scade compiler.)
SCADE_CG=$SCADE_CG
fi
;;
esac
AC_SUBST(SCADE2LUSTRE)
AC_SUBST(LUSTRE2C)
AC_SUBST(SCADE_CG)
AC_SUBST(SCADE_INSTALL_DIR)
#-----------------------------------------------------------------------------#
# test whether socket works
......@@ -237,67 +211,6 @@ AC_CHECK_FUNC(socket, :, [
#AC_CHECK_FUNC(gethostent, , AC_CHECK_LIB(nsl, gethostent))
# AC_CHECK_FUNC(setsockopt, , AC_CHECK_LIB(socket, setsockopt))
#-----------------------------------------------------------------------------#
PIXMAP_DIR="$LURETTEPATH"/bin/pixmaps/
case "$HOST_TYPE" in
win32)
# gtk is compiled in native windows ...
# ??? ougth to work ???
#PIXMAP_DIR=`cygpath -w $PIXMAP_DIR | sed s/'\\'/'\\\\'/g`
PIXMAP_DIR=`echo $PIXMAP_DIR | sed s/'\/cygdrive\/'// | sed s/'\/'/':\/'/ | sed s/'\/'/'\\\\\\\\'/g`
echo "PIXMAP_DIR = $PIXMAP_DIR"
;;
esac
AC_SUBST(PIXMAP_DIR)
#-----------------------------------------------------------------------------#
case "$HOST_TYPE" in
sparc-sun)
LIB_GC=$SCADE_INSTALL_DIR/lib/$SCADE_OS_NAME/libgc.so
LDL="-lsocket -lnsl -ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
;;
cygwin)
LIB_GC=$SCADE_INSTALL_DIR/bin/gc.dll
LDL="-ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
;;
win32)
LIB_GC=$SCADE_INSTALL_DIR/bin/gc.dll
LDL="-ldl -lstdc++"
NOCYGWIN=-mno-cygwin
WIN32LIB=-lws2_32
LINKER=gcc
;;
mac)
LIB_GC=
LDL=-ldl
NOCYGWIN=
WIN32LIB=
LINKER=g++
;;
*)
LIB_GC=
LDL="-ldl -lstdc++"
NOCYGWIN=
WIN32LIB=
LINKER=gcc
esac
AC_SUBST(LIB_GC)
AC_SUBST(LDL)
AC_SUBST(LINKER)
AC_SUBST(NOCYGWIN)
AC_SUBST(WIN32LIB)
#-----------------------------------------------------------------------------#
# Misc tools
......@@ -347,7 +260,6 @@ AC_OUTPUT(Makefile.lurette set_env_var xlurette.sh lurettetop.sh show_luc.sh ge
# if the user ask to install files in a other place.
[ test -d $LURETTEPATH/bin/ ] || (echo "Creating $LURETTEPATH/bin/..." && mkdir $LURETTEPATH/bin)
[ test -d $LURETTEPATH/bin/pixmaps ] || (echo "Creating $LURETTEPATH/bin/pixmaps..." && mkdir $LURETTEPATH/bin/pixmaps)
[ test -d $LURETTEPATH/lib/ ] || (echo "Creating $LURETTEPATH/lib/..." && mkdir $LURETTEPATH/lib)
[ test -d $LURETTEPATH/include/ ] || (echo "Creating $LURETTEPATH/include/..." && mkdir $LURETTEPATH/include )
......@@ -379,8 +291,6 @@ install -m a+x,a+r,u+w ./lurettetop.sh "$LURETTEPATH/bin/lurettetop"
install -m a+x,a+r,u+w ./show_luc.sh "$LURETTEPATH/bin/show_luc"
install -m a+x,a+r,u+w ./xlurette.sh "$LURETTEPATH/bin/xlurette"
install -m a+x,a+r,u+w ./gen_stubs.sh "$LURETTEPATH/bin/gen_stubs"
install -D -v ./pixmaps/* "$PIXMAP_DIR"
install ./set_env_var "$LURETTEPATH/bin"
......
......@@ -4,11 +4,6 @@
LURETTE_PATH="@LURETTEPATH@"
export LURETTE_PATH
if test -z "$PIXMAP_DIR" ; then
PIXMAP_DIR=@PIXMAP_DIR@
export PIXMAP_DIR
fi
path=@LURETTEPATH@/bin:$path
export path
......@@ -23,37 +18,65 @@ if test -z "$PS_VIEWER" ; then
PS_VIEWER=@GV@
export PS_VIEWER
fi
if test -z "$PS_VIEWER_DOS" ; then
PS_VIEWER_DOS=@GV@
export PS_VIEWER_DOS
fi
if test -z "$PDF_VIEWER" ; then
PDF_VIEWER=@PDF@
export PDF_VIEWER
fi
if test -z "$PDF_VIEWER_DOS" ; then
PDF_VIEWER_DOS=@PDF@
export PDF_VIEWER_DOS
fi
if test -z "$DOT" ; then
DOT=dot
export DOT
fi
if test -z "$DOT_DOS" ; then
DOT_DOS=dot
export DOT_DOS
fi
if test -z "$LUS2LIC" ; then
LUS2LIC=@LURETTEPATH@/bin/@LUS2LIC@
export LUS2LIC
fi
if test -z "$LUS2LIC_DOS" ; then
LUS2LIC_DOS=@LUS2LIC@
export LUS2LIC_DOS
fi
if test -z "$LUS2EC" ; then
LUS2EC=@LUS2EC@
export LUS2EC
fi
if test -z "$LUS2EC_DOS" ; then
LUS2EC_DOS=@LUS2EC@
export LUS2EC_DOS
fi
if test -z "$EC2C" ; then
EC2C=@EC2C@
export EC2C
fi
if test -z "$EC2C_DOS" ; then
EC2C_DOS=@EC2C@
export EC2C_DOS
fi
if test -z "$SIM2CHRO" ; then
SIM2CHRO="@LURETTEPATH@/bin/sim2chrogtk"
export SIM2CHRO
fi
if test -z "$SIM2CHRO_DOS" ; then
SIM2CHRO=sim2chrogtk
export SIM2CHRO_DOS
fi
if test -z "$HOSTTYPE" ; then
......@@ -65,49 +88,35 @@ if test -z "$GNUPLOT" ; then
GNUPLOT=gnuplot
export GNUPLOT
fi
if test -z "$GNUPLOT_DOS" ; then
GNUPLOT_DOS=gnuplot
export GNUPLOT_DOS
fi
if test -z "$GNUPLOTRIF" ; then
GNUPLOTRIF="@LURETTEPATH@/bin/gnuplot-rif"
export GNUPLOTRIF
fi
if test -z "$GNUPLOTRIF_DOS" ; then
GNUPLOTRIF_DOS=gnuplot-rif
export GNUPLOTRIF_DOS
fi
if test -z "$AWK" ; then
AWK=@AWK@
export AWK
fi
# scade
if test -z "$SCADE2LUSTRE" ; then
SCADE2LUSTRE=@SCADE2LUSTRE@
export SCADE2LUSTRE
fi
if test -z "$SCADE_CG" ; then
SCADE_CG=@SCADE_CG@
export SCADE_CG
fi
if test -z "$SCADE" ; then
SCADE_CG=@SCADE@
export SCADE
if test -z "$AWK_DOS" ; then
AWK_DOS=$AWK
export AWK_DOS
fi
if test -z "$LUSTRE2C" ; then
LUSTRE2C=@LUSTRE2C@
export LUSTRE2C
if test -z "$GCC" ; then
GCC=gcc@EXE@ -mno-cygwin
export GCC
fi
if test -z "$SCADE_INSTALL_DIR" ; then
SCADE_INSTALL_DIR=@SCADE_INSTALL_DIR@
export SCADE_INSTALL_DIR
if test -z "$GCC_DOS" ; then
GCC_DOS=$GCC
export GCC_DOS
fi
if test -z "$SCADE_COMPIL_OPTION" ; then
SCADE_COMPIL_OPTION="-noexp @ALL@"
export SCADE_COMPIL_OPTION
fi
# Other options migth also work.
# e.g., " -exp @ALL@ " also works, but not " -blockexp "
......@@ -13,10 +13,6 @@
OCAML_BINDIR=$(shell dirname $(OCAMLC))
ifeq ($(HOST_TYPE),win32)
GMP_INSTALL=/cygdrive/c/lurette/$(HOSTTYPE)
CC = gcc -mno-cygwin
else
ifeq ($(HOST_TYPE),cygwin)
GMP_INSTALL=/cygdrive/c/lurette/$(HOSTTYPE)
CC = gcc
......@@ -30,10 +26,11 @@ ifeq ($(HOST_TYPE),mac)
CC = gcc -I$(OCAMLLIB) -L $(OCAMLLIB)
GMP_INSTALL=/sw
else
ifeq ($(HOST_TYPE),cross-win32)
ifeq ($(HOST_TYPE),win32)
AR = /usr/bin/i586-mingw32msvc-ar
CC = /usr/bin/i586-mingw32msvc-gcc
CC = /usr/bin/i586-mingw32msvc-gcc -I$(OCAMLLIB) -L $(OCAMLLIB)
GCC=$CC
GMP_INSTALL=$(LURETTE_PATH)/working/$(HOSTTYPE)
else
CC = gcc
......@@ -42,7 +39,6 @@ endif
endif
endif
endif
endif
CURDIR = $(shell pwd)
# (where to install Polka)
......
......@@ -19,7 +19,7 @@ ifeq ($(HOSTTYPE),cygwin)
FENV=$(OBJDIR)/fenv.c $(OBJDIR)/fenv.h
endif
ifeq ($(HOSTTYPE),cross-win32)
ifeq ($(HOSTTYPE),win32)
# 2 functions were undefined in the mingw fenv lib (fedisableexcept and feenableexcept).
FENV=$(OBJDIR)/mingw_fenv.c $(OBJDIR)/mingw_fenv.h
......@@ -36,9 +36,9 @@ ifeq ($(HOSTTYPE),cross-win32)
endif
ifeq ($(HOST_TYPE),win32)
IDLFLAGS=-nocpp
endif
# ifeq ($(HOST_TYPE),win32)
# IDLFLAGS=-nocpp
# endif
ifeq ($(HOST_TYPE),mac)
IDLFLAGS=-nocpp
endif
......
......@@ -77,7 +77,7 @@ endif
MORE_LIB=
FLEXDLL_O=
ifeq ($(HOSTTYPE),cross-win32)
ifeq ($(HOSTTYPE),win32)
FLEXDLL_O=$(LOCAL_INSTALL)/lib/flexdll_mingw.o
FLEXDLL_O=dummy_flex.o
# DD = dot dot :)
......
......@@ -291,12 +291,12 @@ let (make_luciole : string -> vars -> vars ->
let luciole_ic = Unix.in_channel_of_descr luciole_stdout_in in
let luciole_oc = Unix.out_channel_of_descr luciole_stdin_out in
let _ =
Unix.set_nonblock luciole_stdin_out;
Unix.set_nonblock luciole_stdout_out;
if Sys.os_type <> "Win32" then Unix.set_nonblock luciole_stdin_out;
if Sys.os_type <> "Win32" then Unix.set_nonblock luciole_stdout_out;
set_binary_mode_in luciole_ic false;
set_binary_mode_out luciole_oc false;
in
let prog = "simec_trap" in
let prog = "simec_trap" ^ (if Sys.os_type="Win32" then ".bat" else "") in
let args = [dro_file; string_of_int (Unix.getpid())] in
let pid =
match Util.my_create_process
......@@ -308,7 +308,7 @@ let (make_luciole : string -> vars -> vars ->
| Util.KO -> failwith ("error when calling simec_trap" ^ dro_file);
| Util.OK -> assert false
| Util.PID pid ->
debug_msg ("simec_trap " ^ dro_file ^ ": ok\n");
debug_msg (prog ^ " " ^ dro_file ^ ": ok\n");
pid
in
let kill msg =
......@@ -358,7 +358,7 @@ let (make_luciole : string -> vars -> vars ->
debug_msg ("luciole process has terminated \n");
failwith "luciole process has terminated"
);
while String.sub !rstr 0 1 = "#" do
while String.length !rstr = 0 || String.sub !rstr 0 1 = "#" do
debug_msg ("Skipping " ^ !rstr ^ "...\n");
rstr := input_line luciole_ic
done;
......
......@@ -81,8 +81,8 @@ let (c2dro: string -> bool) =
let include_dir = Filename.concat lurette_path "include" in
try
let cc = try mygetenv "GCC" with Not_found -> "gcc" in
ignore (Util.my_create_process ~std_out:Unix.stderr ~wait:true cc
[cfile; "-shared"; "-o"; dro; "-I"; include_dir ]);
ignore (Util.my_create_process ~std_out:Unix.stderr ~wait:true cc
[cfile; "-shared"; "-o"; dro; "-I"; include_dir ]);
true
with e ->
print_string (Printexc.to_string e);
......
Supports Markdown
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