Commit 445b2ff0 authored by Erwan Jahier's avatar Erwan Jahier

lurette 0.139 Wed, 18 Jun 2003 10:59:43 +0200 by jahier

Parent-Version:      0.138
Version-Log:

Make it work under cygwin.

Add the possibility of setting extra env var to link external libs or c files.

Project-Description: Lurette
parent 30692c60
This diff is collapsed.
#!/bin/sh
#
CURRENT_DIR=$PWD
cd share
./configure --prefix $CURRENT_DIR
......@@ -36,3 +36,11 @@ SOURCES_LURETTE_LIB = \
$(LURETTE_PATH)/source/env.mli $(LURETTE_PATH)/source/env.ml
ALL_SOURCES = $(SOURCES_LURETTE_LIB) $(SOURCES_OCAML)
ifeq ($(HOST_TYPE),cygwin)
EXE := .exe
else
EXE :=
endif
*********** BUGS
* gnuplot-rif sous cygwin ne marche pas.
*********** A faire maintenant
* Nouvelle syntaxe pour lucky
- les noeuds sont des string
- les formules ont la syntaxe lustre
- syntaxe concrete :
les declarations de types:
typedef {
Ident : TypeExp ;
ex_array : bool ^ 3 ;
ex_struct : {a:bool; b: float} ;
ex_enum : (bleu, blanc, rouge) ;
}
les declarations de variables:
inputs { -- (resp output, locals)
Ident : type [-Flag = Exp ]* ;
v : float -min 1 -max 10 -default 5 ;
u : bool -alias (v > 6) ;
}
Exp = Feuille | ( Arbre )
Flag = -min | -max | -default | -alias
Les noeuds :
InitialNode ::=
initial { Ident }
Nodes ::=
nodes {
Ident : <stable | transient> [-NodeFlag = Value]* ;
}
N.B. pour l'instant pas de NodeFlag
Les transitions :
Transitions ::=
transitions {
Ident -> Ident [-TransFlag = Exp]* ;
ex_etat1 -> ex_etat2 -weight 3 -formula (x >= 4)
}
(1) Portage pour scade, esterel ...
-> structure, tableau, types structures, etc.
......
......@@ -6,6 +6,11 @@ ifndef BIN_INSTALL_DIR
BIN_INSTALL_DIR := ../../$(HOST_TYPE)/bin
endif
ifeq ($(WIN32),cygwin)
EXE := .exe
else
EXE :=
endif
THREAD=
# THREAD=-thread threads.cma
......@@ -23,7 +28,7 @@ xlurette: dummy
ocamlc -c -i -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlc -c -pp "camlp4o" -I +lablgtk $(THREAD) -c xlurette_glade_main.ml
ocamlc $(THREAD) \
-I +lablgtk -I +str -o xlurette str.cma unix.cma lablgtk.cma gtkInit.cmo \
-I +lablgtk -I +str -o xlurette$(EXE) str.cma unix.cma lablgtk.cma gtkInit.cmo \
xlurette_glade_callbacks.cmo xlurette_glade_interface.cmo xlurette_glade_main.cmo
opt: dummy
......@@ -36,41 +41,14 @@ opt: dummy
ocamlopt.opt -verbose -c -I +lablgtk -labels -c xlurette_glade_interface.ml
ocamlopt.opt -verbose -c -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlopt.opt -verbose -c -pp "camlp4o" -I +lablgtk $(THREAD) -c xlurette_glade_main.ml
ocamlopt.opt -verbose -I +lablgtk -I +str -labels -o xlurette unix.cmxa lablgtk.cmxa gtkInit.cmx \
xlurette_glade_callbacks.cmx xlurette_glade_interface.cmx xlurette_glade_main.cmx
cyg: dummy
mlglade xlurette.glade
mv xlurette_glade_interface.ml xlurette_glade_interface.ml0
cat xlurette_glade_interface.ml0 \
| sed -e 's/\"pixmaps\//(Filename.concat (Unix.getenv \"LURETTE_PATH\") (Filename.concat \"share\" (Filename.concat \"pixmaps\" \"/' \
| sed -e 's/.xpm\"/.xpm\")))/' \
> xlurette_glade_interface.ml
ocamlopt.opt -c -I +lablgtk -labels -c xlurette_glade_interface.ml
ocamlopt.opt -c -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlopt.opt -c -pp "camlp4o" -I +lablgtk $(THREAD) -c xlurette_glade_main.ml
ocamlopt.opt -I +lablgtk -I +str -labels -o xlurette unix.cmxa lablgtk.cmxa gtkInit.cmx \
ocamlopt.opt -verbose -I +lablgtk -I +str -labels -o xlurette$(EXE) unix.cmxa lablgtk.cmxa gtkInit.cmx \
xlurette_glade_callbacks.cmx xlurette_glade_interface.cmx xlurette_glade_main.cmx
opt.exe: cyg
opt_opt: dummy
mlglade xlurette.glade
mv xlurette_glade_interface.ml xlurette_glade_interface.ml0
cat xlurette_glade_interface.ml0 \
| sed -e 's/\"pixmaps\//((Unix.getenv \"LURETTE_PATH\") \^ \"\/share\/pixmaps\/\" \^ \"/' \
| sed -e 's/.xpm\"/.xpm\")/' \
> xlurette_glade_interface.ml
ocamlopt.opt -c -I +lablgtk -labels -c xlurette_glade_interface.ml
ocamlopt.opt -c -I +lablgtk -labels -c xlurette_glade_callbacks.ml
ocamlopt.opt -pp "camlp4o" -c -I +lablgtk $(THREAD) -c xlurette_glade_main.ml
ocamlopt.opt -I +lablgtk -I +str -labels -o xlurette unix.cmxa lablgtk.cmxa gtkInit.cmx \
xlurette_glade_callbacks.cmx xlurette_glade_interface.cmx xlurette_glade_main.cmx
all: opt$(EXE) cp
all: opt cp
cp:
cp xlurette$(EXE) $(BIN_INSTALL_DIR)
......
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -7,8 +7,9 @@
#
# LURETTE_PATH ougth to be set by users
#
# EXTRA_LIBS, EXTRA_LIBDIRS, and EXTRA_INCLUDEDIRS may optonaly be set by users
# if they use external libs
# SUT, SUT_DIR, ORACLE, ORACLE_DIR, LURETTE_TMP_DIR,
# USER_TESTING_DIR, EXTRA_LIBS, EXTRA_LIBDIRS, EXTRA_INCLUDEDIRS,
# and EXTRA_CFILES are set up by lurettetop
#
# Academic lustre
......@@ -22,7 +23,7 @@ LIBDIRS = -L@LURETTEPATH@/@HOST_TYPE@/lib -L$(LURETTE_TMP_DIR) $(EXTRA_LIBDIRS)
LIBS = -lgmp -lm $(EXTRA_LIBS)
SOURCES_C = $(LURETTE_TMP_DIR)/ocaml2c_stubs.c $(SUT_DIR)/$(SUT).c \
SOURCES_C = $(LURETTE_TMP_DIR)/ocaml2c_stubs.c $(EXTRA_CFILES) $(SUT_DIR)/$(SUT).c \
lurette__sut.c $(ORACLE_DIR)/$(ORACLE).c \
$(LURETTE_TMP_DIR)/lurette__oracle.c \
$(LURETTE_TMP_DIR)/lurette_exe.c $(LURETTE_TMP_DIR)/call_lurette_main.c
......@@ -64,8 +65,7 @@ CFLAGS_0= #-Xc -DSIM
MEMORIES=$(SCADE_INSTALL_DIR)/lib/memories.c
LIB_TCL=$(SCADE_INSTALL_DIR)/lib/$(SCADE_OS_NAME)/libtcl.so
LIB_GC=$(SCADE_INSTALL_DIR)/lib/$(SCADE_OS_NAME)/libgc.so
LIB_GC=$(SCADE_INSTALL_DIR)@LIB_GC@
LIB_OS= -lm
......@@ -89,6 +89,9 @@ NODE_OBJ = \
EXTERNAL_FUNCTIONS = \
$(NODE_OBJECTS)/$(HOST_TYPE)/LibMathAdvanced.o
ifndef CC
CC := gcc
endif
# DEBUG=-g
DEBUG=
......@@ -131,13 +134,14 @@ $(NODE_OBJECTS)/$(HOST_TYPE)/LibMathAdvanced.o : $(SCADE_INSTALL_DIR)/libraries/
-c $(CFLAGS) $(SCADE_INSTALL_DIR)/libraries/libmathadvanced/LibMathAdvanced.c \
-o $(NODE_OBJECTS)/$(HOST_TYPE)/LibMathAdvanced.o
$(NODE_OBJECTS)/$(HOST_TYPE)/memories.o: $(MEMORIES)
$(CC) -I$(SCADE_LIB_DIR) -c $(MEMORIES) -o $@
scade: $(NODE_OBJ)
$(LINKER) $(DEBUG) $(LIBDIRS) $(INCLUDEDIRS) $(NODE_OBJ) $(LDFLAGS) \
$(LIB_TCL) $(LIB_GC) $(LIB_OS) -llurette_lib_nc $(LIBS) -o lurette
$(CC) $(DEBUG) $(LIBDIRS) $(INCLUDEDIRS) $(NODE_OBJ) $(LDFLAGS) \
$(LIB_GC) $(LIB_OS) $(EXTRA_CFILES) -llurette_lib_nc $(LIBS) -o lurette
......
This diff is collapsed.
......@@ -162,26 +162,26 @@ AC_SUBST(EC2C)
case "$HOST_TYPE" in
cygwin)
AC_CHECK_PROG(SCADE2LUSTREBIN,scade2lustre_bin.exe,scade2lustre_bin.exe,no)
AC_CHECK_PROG(SCADE2LUSTREBIN,SCADE2LUSTRE.EXE,SCADE2LUSTRE.EXE,no)
if test "$SCADE2LUSTREBIN" = no ; then
AC_MSG_WARN(*** Cannot find scade2lustre_bin.exe the scade to lustre compiler.)
AC_MSG_WARN(*** Cannot find SCADE2LUSTRE.EXE the scade to lustre compiler.)
fi
SCADE2LUSTRE=scade2lustre_bin.exe
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_bin.exe,lustre2C_bin.exe,no)
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_bin.exe
LUSTRE2C=LUSTRE2C.EXE
AC_CHECK_PROG(SCADE_CG,scade_cg,scade_cg,no)
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 the scade compiler.)
AC_MSG_WARN(*** Cannot find SCADE_CG.EXE the scade compiler.)
fi
SCADE_CG=
SCADE_CG=SCADE_CG.EXE
;;
sparc-sun)
......@@ -222,13 +222,31 @@ PIXMAP_DIR="$LURETTE_PATH"/share/pixmaps/
case "$HOST_TYPE" in
cygwin)
# gtk is compiled in native windows ...
# 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`
# PIXMAP_DIR=`echo $PIXMAP_DIR | sed s/'\/cygdrive\/'// | sed s/'\/'// | sed s/'\/'/'\\\\'/g | sed s/'\\'/:/`
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
;;
cygwin)
LIB_GC=$SCADE_INSTALL_DIR/bin/gc.dll
;;
*)
LIB_GC=
esac
AC_SUBST(LIB_GC)
#-----------------------------------------------------------------------------#
# Misc tools
......
;;; lucky.el - Major mode for ima source in Emacs
(require 'font-lock)
; version of lucky-mode
(defconst lucky-mode-version "0.1")
(defvar lucky-mode-map nil
"Keymap for lustre major mode.")
;;; Font-lock -----------------------------------------------------
(defvar lucky-font-lock-keywords nil
"Regular expression used by Font-lock mode.")
(setq lucky-font-lock-keywords
'(
("(*.*$" . font-lock-comment-face)
("\\<\\(weight\\|max\\|min\\|default\\|cond\\|max\\|With\\)\\>" . font-lock-string-face)
("\\<\\(IfThenElse\\|IfThenElseNum\\|Dec\\|Return_not_sig\\|Return_sig\\|Draw_between\\|Draw_gauss\\|Set\\|Set_between\\|+\\|*\\|-\\|/\\|mod\\)\\>"
. font-lock-keyword-face)
("[][;,()|{}@^!:#*=<>&/%+~?---]\\.?\\|\\.\\." . font-lock-function-name-face)
("\\<\\(true\\|and\\|or\\|if\\|then\\|else\\|pre\\|and\\|and\\|||\\|not\\|false\\|eps\\|!\\)\\>" . font-lock-reference-face)
("\\<\\(bool\\|int\\|real\\|float\\)\\(\\^.+\\)?\\>" . font-lock-variable-name-face)
("\\(\\<\\(inputs\\|outputs\\|alias_def\\|start_node\\|alias\\|locals\\|transitions\\|start_node\\|transient\\|stable\\|arcs_nb\\|nodes_nb\\|=\\)\\>\\|->\\)" .
font-lock-function-name-face)))
(defun lucky-font-mode ()
"Initialisation of font-lock for Lucky mode."
(make-local-variable 'font-lock-defaults)
(setq font-lock-defaults
'(lucky-font-lock-keywords t)))
; font-lock isn't used if in a console
(if window-system
(prog2
(add-hook 'lucky-mode-hook
'turn-on-font-lock)
(add-hook 'lucky-mode-hook
'lucky-font-mode)))
;;; Major-mode
(defun lucky-mode ()
" emacs mode for lucky programs "
(interactive)
(kill-all-local-variables)
(setq major-mode 'lucky-mode)
(setq mode-name "Lucky")
(use-local-map lucky-mode-map)
(run-hooks 'lucky-mode-hook))
(setq comment-start "(*")
(setq comment-end "*)")
(provide 'lucky)
;;; lucky.el ends here...
......@@ -7,14 +7,14 @@ export LURETTE_PATH=@LURETTEPATH@
export PIXMAP_DIR=@PIXMAP_DIR@
export path=@LURETTEPATH@/@HOST_TYPE@/bin $path
export PATH=@LURETTEPATH@/@HOST_TYPE@/bin $PATH
export path=@LURETTEPATH@@HOST_TYPE@/bin:$path
export PATH=@LURETTEPATH@@HOST_TYPE@/bin:$PATH
export PS_VIEWER=@GV@
export DOT=@LURETTEPATH@/@HOST_TYPE@/bin/dot
export DOT=@LURETTEPATH@@HOST_TYPE@/bin/dot
export LUS2EC=@LUS2EC@
export EC2C=@EC2C@
export SIM2CHRO=@LURETTEPATH@/@HOST_TYPE@/bin/sim2chrogtk
export SIM2CHRO=@LURETTEPATH@@HOST_TYPE@/bin/sim2chrogtk
export HOST_TYPE=@HOST_TYPE@
# scade
......
/* XPM */
static char * button_close_xpm[] = {
"12 12 33 1",
" c None",
". c #D60E0C",
"+ c #868290",
"@ c #BABAC4",
"# c #A09EAC",
"$ c #666274",
"% c #B1AEB7",
"& c #767284",
"* c #92929C",
"= c #EEEEEC",
"- c #CACACC",
"; c #A6A6AC",
"> c #6F6D7C",
", c #B8B6BC",
"' c #7A7A84",
") c #8E8C98",
"! c #C4C4CC",
"~ c #9D9AA4",
"{ c #D4D2D8",
"] c #B6B2BC",
"^ c #9A96A4",
"/ c #AEAAB4",
"( c #827E8C",
"_ c #C2BEC4",
": c #8A8694",
"< c #6A666C",
"[ c #9696A4",
"} c #CECED4",
"| c #AAAAB4",
"1 c #7E7E8C",
"2 c #BEBEC4",
"3 c #A2A2AC",
"4 c #787684",
"============",
"=...$>>&4..<",
"=$...&41..:<",
"=>...1:+..^<",
"=&'...)..^#<",
"=++:..^..;/<",
"=)*..^../%,<",
"=~^../...@2<",
"=3../]]...-<",
"=/..,@_...{<",
"=.._!--}...<",
"$$<<<<$<<<<<"};
/* XPM */
static char *magick[] = {
/* columns rows colors chars-per-pixel */
"20 22 5 1",
" c Gray0",
". c #666699",
"X c Gray60",
"o c Gray100",
"O c None",
/* pixels */
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO",
"OOO OOOO ",
"OOO........ OOO.....",
"OOO........ OOO.....",
"OOO.. OOO.. OOO.. XX",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
"OOO.. OOO.. OOO.. OO",
" .. OOO.. .. OO",
"..... OOO........ OO",
"..... OOO........ OO",
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO",
"OOOOOOOOOOOOOOOOOOOO"
};
/* XPM */
static char * delete_xpm[] = {
"24 24 56 1",
" c None",
". c #000000",
"+ c #BCA189",
"@ c #7C6149",
"# c #7D624A",
"$ c #D9C9BB",
"% c #34291F",
"& c #BDA28A",
"* c #7B6049",
"= c #362A20",
"- c #060503",
"; c #654F3C",
"> c #7A6049",
", c #725944",
"' c #0E0B08",
") c #463729",
"! c #A78363",
"~ c #795F48",
"{ c #5A6156",
"] c #8B9585",
"^ c #A17E60",
"/ c #725A43",
"( c #070504",
"_ c #ACB8A4",
": c #403226",
"< c #9D7B5D",
"[ c #030302",
"} c #84795F",
"| c #715943",
"1 c #2D231A",
"2 c #AAA07D",
"3 c #EBD8A9",
"4 c #CFCAA6",
"5 c #CFCFCF",
"6 c #B0A27F",
"7 c #9A8F71",
"8 c #80826E",
"9 c #2A2D28",
"0 c #9B987C",
"a c #555555",
"b c #65614D",
"c c #757764",
"d c #85856E",
"e c #AAAA8D",
"f c #BABEA4",
"g c #8D8870",
"h c #C6B890",
"i c #676450",
"j c #7C765E",
"k c #B1AD8E",
"l c #DBD0A7",
"m c #898166",
"n c #6D6F5C",
"o c #8E917B",
"p c #95957B",
"q c #75735D",
" ",
" ",
" .. ",
" .+@. ",
" .#$+. ",
" %&$*. ",
" .@$+= ",
" -&&;. ",
" .>&,' ",
" . ... )!~. ",
" .{].. -^/( ",
" . .]___.:<[ ",
" . .}.____|1 ",
" . .23.____. ",
" . . .}333.____. ",
" ...45}33.____. ",
". . ..64.3333.__]. ",
" ...789033633.]a. ",
" ...bc.defgh33h.. ",
" ..idj.0kl2m. ",
" ...nopq9. ",
" .... ",
" ",
" "};
/* XPM */
static char *magick[] = {
/* columns rows colors chars-per-pixel */
"24 24 2 1",
" c Gray0",
". c None",
/* pixels */
"........................",
"........................",
"........................",
"........................",
"........................",
"........................",
"....... .... ..........",
"....... .. .........",
"........ . ..........",
"........ ...........",
"......... ............",
"......... ...........",
"........ ..........",
"........ . .........",
"....... ... ........",
"....... ..... .........",
"........................",
"........................",
"........................",
"........................",
"........................",
"........................",
"........................",
"........................"
};
/* XPM */
static char *delete[] = {
/* width height num_colors chars_per_pixel */
" 15 15 4 1",
/* colors */
". c #808080",
"# c #800000",
"a c #ffffff",
"b c #c0c0c0",
/* pixels */
"bbbbbbbbbbbbbbb",
"b##abbbbbbbb##a",
"b####abbbbb##ab",
"bb####abbb##abb",
"bbbb###ab#abbbb",
"bbbbb#####abbbb",
"bbbbbb###abbbbb",
"bbbbb#####abbbb",
"bbbb###ab##abbb",
"bbb###abbb##abb",
"bb###abbbbb#abb",
"bb###abbbbbb#ab",
"bbb#abbbbbbbbbb",
"bbb#abbbbbbbbbb",
"bbbbbbbbbbbbbbb",
};
/* XPM */
static char * gnuplot_rif_xpm[] = {
"20 22 4 1",
" c None",
". c #000000",
"+ c #EADF0E",
"@ c #999999",
" ",
" ",
" ",
" ",
" ........ .....",
" ++++++++. +++++",
" ++++++++. +++++",
" ++. ++. ++.@@",
" ++. ++. ++. ",
" ++. ++. ++. ",
" ++. ++. ++. ",
" ++. ++. ++. ",
" ++. ++. ++. ",
" ++. ++. ++. ",
" ++. ++. ++. ",
"...++. ++....++. ",
"+++++. ++++++++. ",
"+++++. ++++++++. ",
" ",
" ",
" ",
" "};
/* XPM */
static char * halt_xpm[] = {
"16 14 12 1",
" c None",
". c #767E80",
"+ c #317791",
"@ c #FFFFFF",