Revision 18119,
2.2 KB
checked in by ghudson, 22 years ago
(diff) |
Merge with oaf 0.6.10.
|
Line | |
---|
1 | #! /bin/sh |
---|
2 | |
---|
3 | prefix=@prefix@ |
---|
4 | exec_prefix=@exec_prefix@ |
---|
5 | exec_prefix_set=no |
---|
6 | includedir=@includedir@ |
---|
7 | libdir=@libdir@ |
---|
8 | |
---|
9 | usage() |
---|
10 | { |
---|
11 | cat <<EOF |
---|
12 | Usage: oaf-config [OPTION]... |
---|
13 | |
---|
14 | Known values for OPTION are: |
---|
15 | |
---|
16 | --prefix=DIR change OAF prefix [default $prefix] |
---|
17 | --exec-prefix=DIR change OAF 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 | EOF |
---|
23 | |
---|
24 | exit $1 |
---|
25 | } |
---|
26 | |
---|
27 | if test $# -eq 0; then |
---|
28 | usage 1 |
---|
29 | fi |
---|
30 | |
---|
31 | cflags=false |
---|
32 | libs=false |
---|
33 | |
---|
34 | while test $# -gt 0; do |
---|
35 | case "$1" in |
---|
36 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
---|
37 | *) optarg= ;; |
---|
38 | esac |
---|
39 | |
---|
40 | case "$1" in |
---|
41 | --prefix=*) |
---|
42 | prefix=$optarg |
---|
43 | if test $exec_prefix_set = no ; then |
---|
44 | exec_prefix=$optarg |
---|
45 | fi |
---|
46 | ;; |
---|
47 | |
---|
48 | --prefix) |
---|
49 | echo $prefix |
---|
50 | ;; |
---|
51 | |
---|
52 | --exec-prefix=*) |
---|
53 | exec_prefix=$optarg |
---|
54 | exec_prefix_set=yes |
---|
55 | ;; |
---|
56 | |
---|
57 | --exec-prefix) |
---|
58 | echo $exec_prefix |
---|
59 | ;; |
---|
60 | |
---|
61 | --version) |
---|
62 | echo @VERSION@ |
---|
63 | exit 0 |
---|
64 | ;; |
---|
65 | |
---|
66 | --help) |
---|
67 | usage 0 |
---|
68 | ;; |
---|
69 | |
---|
70 | --cflags) |
---|
71 | cflags=true |
---|
72 | ;; |
---|
73 | |
---|
74 | --libs) |
---|
75 | libs=true |
---|
76 | ;; |
---|
77 | |
---|
78 | *) |
---|
79 | usage |
---|
80 | exit 1 |
---|
81 | ;; |
---|
82 | esac |
---|
83 | shift |
---|
84 | done |
---|
85 | |
---|
86 | the_libs="$the_libs -L$libdir -loaf `@ORBIT_CONFIG@ --use-service=name --libs server` @INTLLIBS@" |
---|
87 | |
---|
88 | if test $includedir != /usr/include ; then |
---|
89 | the_flags="$the_flags -I$includedir `@ORBIT_CONFIG@ --cflags server`" |
---|
90 | else |
---|
91 | the_flags="$the_flags `@ORBIT_CONFIG@ --cflags server`" |
---|
92 | fi |
---|
93 | |
---|
94 | if $cflags; then |
---|
95 | all_flags="$the_flags" |
---|
96 | fi |
---|
97 | |
---|
98 | if $libs; then |
---|
99 | all_flags="$all_flags $services $the_libs" |
---|
100 | fi |
---|
101 | |
---|
102 | if test -z "$all_flags" || test "x$all_flags" = "x "; then |
---|
103 | exit 1 |
---|
104 | fi |
---|
105 | |
---|
106 | # Straight out any possible duplicates, but be careful to |
---|
107 | # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz' |
---|
108 | other_flags= |
---|
109 | rev_libs= |
---|
110 | for i in $all_flags; do |
---|
111 | case "$i" in |
---|
112 | # a library, save it for later, in reverse order |
---|
113 | -l*) rev_libs="$i $rev_libs" ;; |
---|
114 | *) |
---|
115 | case " $other_flags " in |
---|
116 | *\ $i\ *) ;; # already there |
---|
117 | *) other_flags="$other_flags $i" ;; # add it to output |
---|
118 | esac ;; |
---|
119 | esac |
---|
120 | done |
---|
121 | |
---|
122 | ord_libs= |
---|
123 | for i in $rev_libs; do |
---|
124 | case " $ord_libs " in |
---|
125 | *\ $i\ *) ;; # already there |
---|
126 | *) ord_libs="$i $ord_libs" ;; # add it to output in reverse order |
---|
127 | esac |
---|
128 | done |
---|
129 | |
---|
130 | echo $other_flags $ord_libs |
---|
131 | |
---|
132 | exit 0 |
---|
Note: See
TracBrowser
for help on using the repository browser.