Roll src/third_party/WebKit 4aace46:1b4a5ed (svn 202009:202010)
[chromium-blink-merge.git] / third_party / libxslt / xslt-config.in
blob45c3e28f2f12f86861102f3b0f3f2367f5b1a3cc
1 #! /bin/sh
3 prefix=@prefix@
4 exec_prefix=@exec_prefix@
5 exec_prefix_set=no
6 includedir=@includedir@
7 libdir=@libdir@
9 usage()
11 cat <<EOF
12 Usage: xslt-config [OPTION]...
14 Known values for OPTION are:
16 --prefix=DIR change XSLT prefix [default $prefix]
17 --exec-prefix=DIR change XSLT executable prefix [default $exec_prefix]
18 --libs print library linking information
19 --cflags print pre-processor and compiler flags
20 --plugins print plugin directory
21 --help display this help and exit
22 --version output version information
23 EOF
25 exit $1
28 if test $# -eq 0; then
29 usage 1
32 cflags=false
33 libs=false
35 while test $# -gt 0; do
36 case "$1" in
37 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
38 *) optarg= ;;
39 esac
41 case "$1" in
42 --prefix=*)
43 prefix=$optarg
44 if test $exec_prefix_set = no ; then
45 exec_prefix=$optarg
49 --prefix)
50 echo $prefix
53 --exec-prefix=*)
54 exec_prefix=$optarg
55 exec_prefix_set=yes
58 --exec-prefix)
59 echo $exec_prefix
62 --version)
63 echo @VERSION@
64 exit 0
67 --plugins)
68 echo @LIBXSLT_DEFAULT_PLUGINS_PATH@
69 exit 0
72 --help)
73 usage 0
76 --cflags)
77 cflags=true
80 --libs)
81 libs=true
85 usage
86 exit 1
88 esac
89 shift
90 done
92 the_libs="@XSLT_LIBDIR@ @XSLT_LIBS@ @EXTRA_LIBS@"
93 if test "$includedir" != "/usr/include"; then
94 the_flags="$the_flags -I$includedir `@XML_CONFIG@ --cflags`"
95 else
96 the_flags="$the_flags `@XML_CONFIG@ --cflags`"
99 if $cflags; then
100 all_flags="$the_flags"
103 if $libs; then
104 all_flags="$all_flags $services $the_libs"
107 if test -z "$all_flags" || test "x$all_flags" = "x "; then
108 exit 1
111 # Straight out any possible duplicates, but be careful to
112 # get `-lfoo -lbar -lbaz' for `-lfoo -lbaz -lbar -lbaz'
113 other_flags=
114 rev_libs=
115 for i in $all_flags; do
116 case "$i" in
117 # a library, save it for later, in reverse order
118 -l*) rev_libs="$i $rev_libs" ;;
120 case " $other_flags " in
121 *\ $i\ *) ;; # already there
122 *) other_flags="$other_flags $i" ;; # add it to output
123 esac ;;
124 esac
125 done
127 ord_libs=
128 for i in $rev_libs; do
129 case " $ord_libs " in
130 *\ $i\ *) ;; # already there
131 *) ord_libs="$i $ord_libs" ;; # add it to output in reverse order
132 esac
133 done
135 echo $other_flags $ord_libs
137 exit 0