File: xmlada-config

package info (click to toggle)
libxmlada1 1.0-2
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 2,704 kB
  • ctags: 94
  • sloc: ada: 22,582; sh: 1,804; makefile: 142; xml: 140; perl: 128
file content (98 lines) | stat: -rw-r--r-- 2,207 bytes parent folder | download
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
96
97
98
#!/bin/sh
# Customised for Debian GNU/Linux by Ludovic Brenta
# <ludovic.brenta@insalien.org>.  But it is better to use the GNAT
# project file, /usr/share/ada/adainclude/xmlada.gpr.

cflags="-aI/usr/share/ada/adainclude/xmlada -aO/usr/lib/ada/adalib/xmlada"
libs="-lxmlada"
static_libs="/usr/lib/libxmlada.a"

MAJOR=1
MINOR=0

usage()
{
   cat <<EOF
Usage: xmlada-config [OPTIONS]
Options:
        No option:
            Output all the flags (compiler and linker) required
            to compiler your program
        [--prefix]
            Output the directory in which XML/Ada is installed
        [--version|-v]
            Output the version of XML/Ada
        [--libs]
            Output the linker flags to use for XML/Ada
        [--cflags]
            Output the compiler flags to use for XML/Ada
        [--sax]
            Output all the flags to usr for XML/Ada, provided
            you are not using the DOM module.
        [--static]
            Output all the flags (compiler and linker) required to
            compile a static version of your program
        [--static-sax]
            Output all the flags (compiler and linker) required to
            compile a static version of your program, omitting the
            DOM module.
EOF
}

# Can have the following values:
#   0 = none
#   1 = cflags
#   2 = libs
#   3 = sax
#   4 = full
#   5 = static
output_type=full
while test $# -gt 0; do
  case "$1" in
  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
  *) optarg= ;;
  esac

  case $1 in
    --help|-h)
      usage 1>&2
      exit 1
      ;;
    --prefix)
      echo $prefix
      output_type=none
      ;;
    --version|-v)
      echo XmlAda ${MAJOR}.${MINOR}
      exit 0
      ;;
    --libs)
      output_type=libs
      ;;
    --sax)
      output_type=sax
      ;;
    --cflags)
      output_type=cflags
      ;;
    --static)
      output_type=static
      ;;
    --static-sax)
      output_type=static_sax
      ;;
    *)
      usage 1>&2
      exit 1
      ;;
  esac
  shift
done

case $output_type in
   cflags) echo $cflags ;;
   libs)   echo $libs;;
   sax|full)          echo $cflags -largs $libs;;
   static|static_sax) echo $cflags -largs $static_libs;;
esac