source: trunk/third/libIDL/libIDL-config.in @ 18251

Revision 18251, 1.9 KB checked in by ghudson, 22 years ago (diff)
This commit was generated by cvs2svn to compensate for changes in r18250, which included commits to RCS files with non-trunk default branches.
RevLine 
[18250]1#! /bin/sh
2
3prefix=@prefix@
4exec_prefix=@exec_prefix@
5exec_prefix_set=no
6
7usage()
8{
9        cat <<EOF
10Usage: libIDL-config [OPTIONS]
11Options:
12        [--prefix[=DIR]]
13        [--exec-prefix[=DIR]]
14        [--version]
15        [--libs]
16        [--cflags]
17EOF
18        exit $1
19}
20
21if test $# -eq 0; then
22        usage 1 1>&2
23fi
24
25while test $# -gt 0; do
26  case "$1" in
27  -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
28  *) optarg= ;;
29  esac
30
31  case $1 in
32    --prefix=*)
33      prefix=$optarg
34      if test $exec_prefix_set = no ; then
35        exec_prefix=$optarg
36      fi
37      ;;
38    --prefix)
39      echo_prefix=yes
40      ;;
41    --exec-prefix=*)
42      exec_prefix=$optarg
43      exec_prefix_set=yes
44      ;;
45    --exec-prefix)
46      echo_exec_prefix=yes
47      ;;
48    --version)
49      echo @LIBIDL_VERSION@
50      exit 0
51      ;;
52    --cflags)
53      includes="-I@includedir@/libIDL-2.0"
54      echo_cflags=yes
55      ;;
56    --libs)
57      echo_libs=yes
58      ;;
59    *)
60      usage 1 1>&2
61      ;;
62  esac
63  shift
64done
65
66all_flags=
67
68if test "$echo_prefix" = "yes"; then
69        echo $prefix
70fi
71if test "$echo_exec_prefix" = "yes"; then
72        echo $exec_prefix
73fi
74if test "$echo_cflags" = "yes"; then
75        all_flags="$all_flags $includes $cflags `glib-config --cflags`"
76fi
77if test "$echo_libs" = "yes"; then
78        all_flags="$all_flags -L@libdir@ -lIDL `glib-config --libs`"
79fi
80
81# Straight out any possible duplicates, but be careful to
82# get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
83other_flags=
84rev_libs=
85for i in $all_flags; do
86    case "$i" in
87    # a library, save it for later, in reverse order
88    -l*) rev_libs="$i $rev_libs" ;;
89    *)
90        case " $other_flags " in
91        *\ $i\ *) ;;                            # already there
92        *) other_flags="$other_flags $i" ;;     # add it to output
93        esac ;;
94    esac
95done
96
97ord_libs=
98for i in $rev_libs; do
99    case " $ord_libs " in
100    *\ $i\ *) ;;                        # already there
101    *) ord_libs="$i $ord_libs" ;;       # add it to output in reverse order
102    esac
103done
104
105echo $other_flags $ord_libs
106
107exit 0
Note: See TracBrowser for help on using the repository browser.