source: libcaca/trunk/caca-config.in @ 4333

Last change on this file since 4333 was 4333, checked in by Sam Hocevar, 8 years ago

Large source code cleanup, getting rid of spaces, tabs, and svn keywords.

  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/sh
2
3##  config script for libcaca -- Sam Hocevar <sam@hocevar.net>
4
5prefix=@prefix@
6exec_prefix=@exec_prefix@
7
8lib_dir=@libdir@
9include_dir=@includedir@
10
11usage()
12{
13  cat <<EOF
14Usage: caca-config [OPTIONS] [LIBRARIES]
15Options:
16   [--prefix[=DIR]]
17   [--exec-prefix[=DIR]]
18   [--version]
19   [--libs]
20   [--ldflags]
21   [--cflags]
22EOF
23  exit $1
24}
25
26libs=""
27
28if test $# -eq 0
29then
30  usage 1 1>&2
31fi
32
33while test $# -gt 0
34do
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      local_prefix=yes
44      ;;
45    --prefix)
46      echo_prefix=yes
47      ;;
48    --exec-prefix=*)
49      exec_prefix=$optarg
50      exec_prefix_set=yes
51      local_prefix=yes
52      ;;
53    --exec-prefix)
54      echo_exec_prefix=yes
55      ;;
56    --version)
57      echo @VERSION@
58      exit 0
59      ;;
60    --cflags)
61      echo_cflags=yes
62      ;;
63    --ldflags)
64      echo_ldflags=yes
65      ;;
66    --libs | --plugin-libs)
67      echo_libs=yes
68      ;;
69    caca)
70      libs="$libs -lcaca"
71      ;;
72    *)
73      usage 1 1>&2
74      ;;
75  esac
76  shift
77done
78
79if test "$libs" = ""
80then
81  libs="-lcaca"
82fi
83
84if test "$local_prefix" = "yes"
85then
86  if test "$exec_prefix_set" != "yes"
87  then
88    exec_prefix=$prefix
89  fi
90fi
91
92if test "$echo_prefix" = "yes"
93then
94  echo $prefix
95fi
96
97if test "$echo_exec_prefix" = "yes"
98then
99  echo $exec_prefix
100fi
101
102if test "$echo_cflags" = "yes"
103then
104  cflags="-I$include_dir/"
105  echo $cflags
106fi
107
108if test "$echo_ldflags" = "yes"
109then
110  ldflags="-L$lib_dir"
111  echo $ldflags
112fi
113
114if test "$echo_libs" = "yes"
115then
116  echo -L@libdir@ $libs
117fi
118
Note: See TracBrowser for help on using the repository browser.