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

Revision 15271, 2.5 KB checked in by ghudson, 24 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r15270, which included commits to RCS files with non-trunk default branches.
Line 
1#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5exec_prefix_set=no
6includedir=@includedir@
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` -I$includedir "
92        ;;
93
94   --use-service=*)
95        case $optarg in
96            name)
97                services="$services -lORBitCosNaming"
98                ;;
99            *)
100                usage
101                exit 1
102                ;;
103        esac
104        ;;
105
106    *)
107        usage
108        exit 1
109        ;;
110    esac
111    shift
112done
113
114if $cflags; then
115    all_flags="$the_flags"
116fi
117
118if $libs; then
119    all_flags="$all_flags $services $the_libs"
120fi
121
122if test -z "$all_flags" || test "x$all_flags" = "x "; then
123    exit 1
124fi
125
126# Straight out any possible duplicates, but be careful to
127# get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
128other_flags=
129rev_libs=
130for i in $all_flags; do
131    case "$i" in
132    # a library, save it for later, in reverse order
133    -l*) rev_libs="$i $rev_libs" ;;
134    *)
135        case " $other_flags " in
136        *\ $i\ *) ;;                            # already there
137        *) other_flags="$other_flags $i" ;;     # add it to output
138        esac ;;
139    esac
140done
141
142ord_libs=
143for i in $rev_libs; do
144    case " $ord_libs " in
145    *\ $i\ *) ;;                        # already there
146    *) ord_libs="$i $ord_libs" ;;       # add it to output in reverse order
147    esac
148done
149
150echo $other_flags $ord_libs
151
152exit 0
Note: See TracBrowser for help on using the repository browser.