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

Last change on this file since 1018 was 1018, checked in by Sam Hocevar, 13 years ago
  • Do not output unnecessary libraries in caca-output config.
  • Property svn:keywords set to Id
File size: 1.7 KB
Line 
1#! /bin/sh
2
3##  config script for libcaca -- Sam Hocevar <sam@zoy.org>
4##  $Id: caca-config.in 1018 2006-09-09 17:31:43Z sam $
5
6prefix=@prefix@
7exec_prefix=@exec_prefix@
8
9lib_dir=@libdir@
10include_dir=@includedir@
11
12usage()
13{
14  cat <<EOF
15Usage: caca-config [OPTIONS] [LIBRARIES]
16Options:
17   [--prefix[=DIR]]
18   [--exec-prefix[=DIR]]
19   [--version]
20   [--libs]
21   [--ldflags]
22   [--cflags]
23EOF
24  exit $1
25}
26
27libs=""
28
29if test $# -eq 0
30then
31  usage 1 1>&2
32fi
33
34while test $# -gt 0
35do
36  case "$1" in
37    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
38    *) optarg= ;;
39  esac
40
41  case $1 in
42    --prefix=*)
43      prefix=$optarg
44      local_prefix=yes
45      ;;
46    --prefix)
47      echo_prefix=yes
48      ;;
49    --exec-prefix=*)
50      exec_prefix=$optarg
51      exec_prefix_set=yes
52      local_prefix=yes
53      ;;
54    --exec-prefix)
55      echo_exec_prefix=yes
56      ;;
57    --version)
58      echo @VERSION@
59      exit 0
60      ;;
61    --cflags)
62      echo_cflags=yes
63      ;;
64    --ldflags)
65      echo_ldflags=yes
66      ;;
67    --libs | --plugin-libs)
68      echo_libs=yes
69      ;;
70    cucul)
71      libs="$libs -lcucul"
72      ;;
73    caca)
74      libs="$libs -lcaca -lcucul"
75      ;;
76    *)
77      usage 1 1>&2
78      ;;
79  esac
80  shift
81done
82
83if test "$libs" = ""
84then
85  libs="-lcaca -lcucul"
86fi
87
88if test "$local_prefix" = "yes"
89then
90  if test "$exec_prefix_set" != "yes"
91  then
92    exec_prefix=$prefix
93  fi
94fi
95
96if test "$echo_prefix" = "yes"
97then
98  echo $prefix
99fi
100
101if test "$echo_exec_prefix" = "yes"
102then
103  echo $exec_prefix
104fi
105
106if test "$echo_cflags" = "yes"
107then
108  cflags="-I$include_dir/"
109  echo $cflags
110fi
111
112if test "$echo_ldflags" = "yes"
113then
114  ldflags="-L$lib_dir"
115  echo $ldflags
116fi
117
118if test "$echo_libs" = "yes"
119then
120  echo -L@libdir@ $libs
121fi
122
Note: See TracBrowser for help on using the repository browser.