File: gp2c-dbg.in

package info (click to toggle)
gp2c 0.0.5pl2-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,508 kB
  • ctags: 1,114
  • sloc: ansic: 8,284; sh: 544; lex: 337; yacc: 158; makefile: 135
file content (57 lines) | stat: -rw-r--r-- 1,513 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/sh -e
#Copyright (C) 2001-2006  The PARI group.
#
#This file is part of the GP2C package.
#
#PARI/GP is free software; you can redistribute it and/or modify it under the
#terms of the GNU General Public License as published by the Free Software
#Foundation. It is distributed in the hope that it will be useful, but WITHOUT
#ANY WARRANTY WHATSOEVER.
#
#Check the License for details. You should have received a copy of it, along
#with the package; see the file 'COPYING'. If not, write to the Free Software
#Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.

name="stdin";
for p in "$@"; do
case "$p" in
  -h|--help) cat <<EOF
gp2c-dbg <options> <file.gp>
Compile file.gp with gp2c and launch a debugger session of gp
with functions of file.gp added.
<options> are passed to gp2c

ENVIRONMENT:
GP2C: path to the GP2C compiler, default: @mybindir@/gp2c
GP_DBG: path to the GP calculator, default: @GP_PATH@
GP2C_DBG: command to start the debugger, default: gdb --args
EOF
exit
;;
  -l|-t|-v)  exec $GP2C "$@" ;;
  -*) ;; #We discard options
  *) name=$p;;
esac
done

if test "x$GP2C" = "x"; then 
  GP2C="@mybindir@/gp2c"
fi

if test "x$GP_DBG" = "x"; then 
  GP_DBG="@GP_PATH_DBG@"
fi

if test "x$GP2C_DBG" = "x"; then 
  GP2C_DBG="gdb --args"
fi

case $name in 
*.c) name=${name%.c};;
*) $GP2C "$@" >$name.c;;
esac

command=`printf "@PARI_MODULE_DEBUG@" $name $name $name $name`
eval $command || exit $?
grep "^GP;" $name.c | sed 's/^GP;//' >$name.run
$GP2C_DBG $GP_DBG $name.run