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

Last change on this file since 2900 was 2821, checked in by Sam Hocevar, 14 years ago

Starting refactoring to get rid of libcucul. The initial reason for the
split is rendered moot by the plugin system: when enabled, binaries do
not link directly with libX11 or libGL. I hope this is a step towards
more consisteny and clarity.

  • Property svn:keywords set to Id
File size: 1.6 KB
Line 
1#! /bin/sh
2
3##  config script for libcaca -- Sam Hocevar <sam@zoy.org>
4##  $Id: caca-config.in 2821 2008-09-27 13:12:46Z 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    caca)
71      libs="$libs -lcaca"
72      ;;
73    *)
74      usage 1 1>&2
75      ;;
76  esac
77  shift
78done
79
80if test "$libs" = ""
81then
82  libs="-lcaca"
83fi
84
85if test "$local_prefix" = "yes"
86then
87  if test "$exec_prefix_set" != "yes"
88  then
89    exec_prefix=$prefix
90  fi
91fi
92
93if test "$echo_prefix" = "yes"
94then
95  echo $prefix
96fi
97
98if test "$echo_exec_prefix" = "yes"
99then
100  echo $exec_prefix
101fi
102
103if test "$echo_cflags" = "yes"
104then
105  cflags="-I$include_dir/"
106  echo $cflags
107fi
108
109if test "$echo_ldflags" = "yes"
110then
111  ldflags="-L$lib_dir"
112  echo $ldflags
113fi
114
115if test "$echo_libs" = "yes"
116then
117  echo -L@libdir@ $libs
118fi
119
Note: See TracBrowser for help on using the repository browser.