Alexandre Lision | ddd731e | 2014-01-31 11:50:08 -0500 | [diff] [blame^] | 1 | #!/bin/sh |
| 2 | # Copyright (C) 2006-2007 David Sugar, Tycho Softworks. |
| 3 | # |
| 4 | # This file is free software; as a special exception the author gives |
| 5 | # unlimited permission to copy and/or distribute it, with or without |
| 6 | # modifications, as long as this notice is preserved. |
| 7 | # |
| 8 | # This program is distributed in the hope that it will be useful, but |
| 9 | # WITHOUT ANY WARRANTY, to the extent permitted by law; without even the |
| 10 | # implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 11 | |
| 12 | prefix=@prefix@ |
| 13 | exec_prefix=@exec_prefix@ |
| 14 | includedir=@includedir@ |
| 15 | |
| 16 | if [ "`ldd /bin/sh | grep lib64`" = "" ] |
| 17 | then |
| 18 | libdir=${exec_prefix}/lib |
| 19 | else |
| 20 | libdir=${exec_prefix}/lib64 |
| 21 | fi |
| 22 | |
| 23 | usage() |
| 24 | { |
| 25 | cat <<EOF |
| 26 | Usage: ucommon-config [OPTION] |
| 27 | |
| 28 | Known values for OPTION are: |
| 29 | |
| 30 | --prefix=DIR change ucommon prefix [default $prefix] |
| 31 | --exec-prefix=DIR change ucommon exec prefix [default $exec_prefix] |
| 32 | --libs print library linking information |
| 33 | --clink print c model linking information |
| 34 | --minimal linking without usecure |
| 35 | --cflags print pre-processor and compiler flags |
| 36 | --includes print framework include directory |
| 37 | --plugins print framework plugin directory |
| 38 | --model print the linking model used |
| 39 | --help display this help and exit |
| 40 | --version output version information |
| 41 | EOF |
| 42 | |
| 43 | exit $1 |
| 44 | } |
| 45 | |
| 46 | if test $# -eq 0; then |
| 47 | usage 1 |
| 48 | fi |
| 49 | |
| 50 | cflags=false |
| 51 | libs=false |
| 52 | |
| 53 | while test $# -gt 0; do |
| 54 | case "$1" in |
| 55 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; |
| 56 | *) optarg= ;; |
| 57 | esac |
| 58 | |
| 59 | case "$1" in |
| 60 | --prefix=*) |
| 61 | prefix=$optarg |
| 62 | includedir=$prefix/include |
| 63 | libdir=$prefix/lib |
| 64 | ;; |
| 65 | |
| 66 | --prefix) |
| 67 | echo $prefix |
| 68 | ;; |
| 69 | |
| 70 | --exec-prefix=*) |
| 71 | exec_prefix=$optarg |
| 72 | libdir=$exec_prefix/lib |
| 73 | ;; |
| 74 | |
| 75 | --exec-prefix) |
| 76 | echo $exec_prefix |
| 77 | ;; |
| 78 | |
| 79 | --version) |
| 80 | echo @VERSION@ |
| 81 | exit 0 |
| 82 | ;; |
| 83 | |
| 84 | --help) |
| 85 | usage 0 |
| 86 | ;; |
| 87 | |
| 88 | --cflags) |
| 89 | echo @UCOMMON_FLAGS@ |
| 90 | ;; |
| 91 | |
| 92 | --libtool-libs) |
| 93 | if [ -r ${libdir}/libucommon.la ] ; then |
| 94 | echo ${libdir}/libucommon.la ; fi |
| 95 | ;; |
| 96 | |
| 97 | --model) |
| 98 | echo @UCOMMON_MODEL@ |
| 99 | ;; |
| 100 | |
| 101 | --clink) |
| 102 | echo @UCOMMON_CLINK@ |
| 103 | ;; |
| 104 | |
| 105 | --libs) |
| 106 | echo -lusecure -lucommon @SECURE_LIBS@ @UCOMMON_LINKED@ |
| 107 | ;; |
| 108 | |
| 109 | --minimal) |
| 110 | echo -lucommon @UCOMMON_LINKED@ |
| 111 | ;; |
| 112 | |
| 113 | --includes) |
| 114 | echo @UCOMMON_INCLUDES@ |
| 115 | ;; |
| 116 | |
| 117 | *) |
| 118 | usage |
| 119 | exit 1 |
| 120 | ;; |
| 121 | esac |
| 122 | shift |
| 123 | done |
| 124 | |
| 125 | exit 0 |