1#!/bin/sh 2 3prefix=@prefix@ 4exec_prefix=@exec_prefix@ 5includedir=@includedir@ 6libdir=@libdir@ 7exec_prefix_set=no 8 9usage() 10{ 11 cat <<EOF 12Usage: libusb-config [OPTIONS] [LIBRARIES] 13Options: 14 [--prefix[=DIR]] 15 [--exec-prefix[=DIR]] 16 [--version] 17 [--libs] 18 [--cflags] 19EOF 20 exit $1 21} 22 23if test $# -eq 0; then 24 usage 1 1>&2 25fi 26 27while test $# -gt 0; do 28 case "$1" in 29 -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 30 *) optarg= ;; 31 esac 32 33 case $1 in 34 --prefix=*) 35 prefix=$optarg 36 if test $exec_prefix_set = no ; then 37 exec_prefix=$optarg 38 fi 39 ;; 40 --prefix) 41 echo_prefix=yes 42 ;; 43 --exec-prefix=*) 44 exec_prefix=$optarg 45 exec_prefix_set=yes 46 ;; 47 --exec-prefix) 48 echo_exec_prefix=yes 49 ;; 50 --version) 51 echo @LIBUSB01_VERSION@ 52 exit 0 53 ;; 54 --cflags) 55 if test "$includedir" != /usr/include ; then 56 includes="-I$includedir" 57 fi 58 echo_cflags=yes 59 ;; 60 --libs) 61 echo_libs=yes 62 ;; 63 *) 64 usage 1 1>&2 65 ;; 66 esac 67 shift 68done 69 70if test "$echo_prefix" = "yes"; then 71 echo $prefix 72fi 73if test "$echo_exec_prefix" = "yes"; then 74 echo $exec_prefix 75fi 76if test "$echo_cflags" = "yes"; then 77 echo $includes 78fi 79if test "$echo_libs" = "yes"; then 80 echo -L$libdir -lusb 81fi 82