source: trunk/ORBit2-2.14.0/orbit2-config.in

Last change on this file was 92, checked in by cinc, 19 years ago

Orbit2 modified for use with NOM

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