source: trunk/third/ORBit/orbit-config.in @ 16733

Revision 16733, 2.6 KB checked in by ghudson, 23 years ago (diff)
Merge with ORBit 0.5.12 (removing ATHTOOLROOT support).
Line 
1#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5exec_prefix_set=no
6includedir=@includedir@/orbit-1.0
7libdir=@libdir@
8
9usage()
10{
11    cat <<EOF
12Usage: orbit-config [OPTION]... [TARGET]...
13
14Known values for OPTION are:
15
16  --prefix=DIR          change ORBit prefix [default $prefix]
17  --exec-prefix=DIR     change ORBit executable prefix [default $exec_prefix]
18  --libs                print library linking information
19  --cflags              print pre-processor and compiler flags
20  --help                display this help and exit
21  --version             output version information
22
23  --use-service=SRVC    the service SRVC will be used
24 
25Known values for SRVC are:
26   
27    name                module CosNaming, interfaces LNameComponent, LName
28
29Known values for TARGET are:
30
31    client              (calls glib-config)
32    server              (calls glib-config)
33EOF
34
35    exit $1
36}
37
38if test $# -eq 0; then
39    usage 1
40fi
41
42cflags=false
43libs=false
44
45while test $# -gt 0; do
46    case "$1" in
47    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
48    *) optarg= ;;
49    esac
50
51    case "$1" in
52    --prefix=*)
53        prefix=$optarg
54        if test $exec_prefix_set = no ; then
55            exec_prefix=$optarg
56        fi
57        ;;
58
59    --prefix)
60        echo $prefix
61        ;;
62
63    --exec-prefix=*)
64        exec_prefix=$optarg
65        exec_prefix_set=yes
66        ;;
67
68    --exec-prefix)
69        echo $exec_prefix
70        ;;
71
72    --version)
73        echo @PACKAGE@ @ORBIT_VERSION@
74        exit 0
75        ;;
76
77    --help)
78        usage 0
79        ;;
80
81    --cflags)
82        cflags=true
83        ;;
84
85    --libs)
86        libs=true
87        ;;
88
89    client|server)
90        the_libs="$the_libs -L$libdir -lORBit -lIIOP -lORBitutil `glib-config --libs` @LIBS@ -lm"
91        the_flags="$the_flags `glib-config --cflags` "
92        test "x$includedir" = "x/usr/include" \
93          || the_flags="$the_flags -I$includedir "
94        ;;
95
96   --use-service=*)
97        case $optarg in
98            name)
99                services="$services -lORBitCosNaming"
100                ;;
101            *)
102                usage
103                exit 1
104                ;;
105        esac
106        ;;
107
108    *)
109        usage
110        exit 1
111        ;;
112    esac
113    shift
114done
115
116if $cflags; then
117    all_flags="$the_flags"
118fi
119
120if $libs; then
121    all_flags="$all_flags $services $the_libs"
122fi
123
124if test -z "$all_flags" || test "x$all_flags" = "x "; then
125    exit 1
126fi
127
128# Straight out any possible duplicates, but be careful to
129# get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
130other_flags=
131rev_libs=
132for i in $all_flags; do
133    case "$i" in
134    # a library, save it for later, in reverse order
135    -l*) rev_libs="$i $rev_libs" ;;
136    *)
137        case " $other_flags " in
138        *\ $i\ *) ;;                            # already there
139        *) other_flags="$other_flags $i" ;;     # add it to output
140        esac ;;
141    esac
142done
143
144ord_libs=
145for i in $rev_libs; do
146    case " $ord_libs " in
147    *\ $i\ *) ;;                        # already there
148    *) ord_libs="$i $ord_libs" ;;       # add it to output in reverse order
149    esac
150done
151
152echo $other_flags $ord_libs
153
154exit 0
Note: See TracBrowser for help on using the repository browser.