File: quick_start_GDL.sh.in

package info (click to toggle)
gnudatalanguage 1.1.3-1
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 80,832 kB
  • sloc: cpp: 198,435; ansic: 47,740; sh: 691; python: 474; makefile: 149; xml: 69; f90: 28
file content (95 lines) | stat: -rwxr-xr-x 2,663 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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/bin/bash
#
# must be run as a BASH Shell
#
# AC: improved shell to avoid "big" when sourcing (or ".") this file ...
# echo "(ba)sh or source ? "$BASH_SOURCE
#
# AC 01/10/2010: we can keep the current $GDL_PATH using -g [--gdl_path]
#

if [ $BASH_SOURCE != $0 ] ; then
   echo "Please run this script throw one in the 2 next commands:"
   echo "1/    ./quick_run_GDL.sh"
   echo "2/    bash ./quick_run_GDL.sh"
   return
fi
#
# AC 2011/08/19 to avoid conflict with other IDL/GDL environmments
# which have been setup before
#
REF_IDL_PATH=${IDL_PATH}
REF_GDL_PATH=${GDL_PATH}
REF_IDL_STARTUP=${IDL_STARTUP}
REF_GDL_STARTUP=${GDL_STARTUP}
#
IDL_PATH=""
GDL_PATH=""
IDL_STARTUP=""
GDL_STARTUP=""
#
if [ -z $flag_help ] ;     then flag_help=0 ; fi
if [ -z $flag_quiet ] ;    then flag_quiet=0 ; fi
if [ -z $flag_valgrind ] ; then flag_valgrind=0 ; fi
if [ -z $flag_gdl_path ] ; then flag_gdl_path=0 ; fi
# 
while getopts ":ghqv-:" opt ; do
    case $opt in 
	- ) case $OPTARG in
	    quiet* )    echo "Quiet keyword swith ON"
	                flag_quiet=1 ;;
	    gdl_path)   echo "Keeping GDL_PATH swith ON"
	                flag_gdl_path=1 ;;
	    help* )     echo "Help keyword swith ON"
                        flag_help=1 ;;
	    valgrind* ) echo "Valgrind keyword swith ON"
                        flag_valgrind=1 ;;
	    ? )         echo "option illegal -$OPTARG
	                exit ;;
	    * )         echo "option illegal -$OPTARG
	                exit
	esac ;;
    q )  echo "Quiet keyword swith ON"
         flag_quiet=1 ;;
    g )  echo "Keeping GDL_PATH swith ON"
         flag_gdl_path=1 ;; 
    h )  echo "Help keyword swith ON"
         flag_help=1 ;;
    v* ) echo "Valgrind keyword swith ON"
         flag_valgrind=1 ;;
    ? )  echo "option illegal -$OPTARG"
         exit ;;
    esac
done
#
if [ "$flag_help" -eq 1 ] ; then
    echo "Usage: gdl -g [--gdl_path] -h [--help] -q [--quiet] -v [--valgrind]"
    exit
fi
#
if [ "$flag_quiet" -eq 0 ] ; then
    echo "Running current GDL with CMAKE_SOURCE_DIR/src/pro and CMAKE_SOURCE_DIR/testsuite in GDL_PATH"
fi
#
if [ "$flag_gdl_path" -eq 0 ] ; then
    export GDL_PATH='+${CMAKE_SOURCE_DIR}/src/pro/:+${CMAKE_SOURCE_DIR}/testsuite/'
else
    export GDL_PATH='+${CMAKE_SOURCE_DIR}/src/pro/:+${CMAKE_SOURCE_DIR}/testsuite/:${REF_GDL_PATH}'
fi
#
if [ "$flag_quiet" -eq 0 ] ; then
    echo $GDL_PATH
fi
#
if [ "$flag_valgrind" -eq 1 ] ; then
    valgrind ${CMAKE_BINARY_DIR}/src/gdl
else
    ${CMAKE_BINARY_DIR}/src/gdl
fi
#
# restoring initial envionment
#
export IDL_PATH=${REF_IDL_PATH}
export GDL_PATH=${REF_GDL_PATH}
export IDL_STARTUP=${REF_IDL_STARTUP}
export GDL_STARTUP=${REF_GDL_STARTUP}