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

Last change on this file since 202 was 202, checked in by Sam Hocevar, 16 years ago
  • debian/control: + Changed section to libs/libdevel instead of games/games. + Changed package name to libcaca-dev.
  • debian/rules: + Use debian/compat instead of DH_COMPAT. + Install README, BUGS and TODO into /usr/share/doc.
  • caca-config.in: + First version of the config script.
  • configure.ac src/Makefile.am: + Build a static PIC library as well.
  • README TODO: + Various updates.
  • Property svn:keywords set to Id
File size: 1.9 KB
Line 
1#! /bin/sh
2
3##  config script for libcaca -- Sam Hocevar <sam@zoy.org>
4##  $Id: caca-config.in 202 2003-11-20 16:54:04Z sam $
5
6prefix=@prefix@
7exec_prefix=@exec_prefix@
8
9lib_dir=@libdir@
10include_dir=@includedir@
11
12@USE_SLANG_TRUE@libs_slang="-lslang"
13@USE_NCURSES_TRUE@libs_ncurses="-lncurses"
14libs="$libs_slang $libs_ncurses"
15
16usage()
17{
18  cat <<EOF
19Usage: caca-config [OPTIONS] [LIBRARIES]
20Options:
21   [--prefix[=DIR]]
22   [--exec-prefix[=DIR]]
23   [--version]
24   [--libs]
25   [--plugin-libs]
26   [--ldflags]
27   [--cflags]
28EOF
29  exit $1
30}
31
32if test $# -eq 0
33then
34  usage 1 1>&2
35fi
36
37while test $# -gt 0
38do
39  case "$1" in
40    -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
41    *) optarg= ;;
42  esac
43
44  case $1 in
45    --prefix=*)
46      prefix=$optarg
47      local_prefix=yes
48      ;;
49    --prefix)
50      echo_prefix=yes
51      ;;
52    --exec-prefix=*)
53      exec_prefix=$optarg
54      exec_prefix_set=yes
55      local_prefix=yes
56      ;;
57    --exec-prefix)
58      echo_exec_prefix=yes
59      ;;
60    --version)
61      echo @VERSION@
62      exit 0
63      ;;
64    --cflags)
65      echo_cflags=yes
66      ;;
67    --ldflags)
68      echo_ldflags=yes
69      ;;
70@NEED_PIC_TRUE@    --libs)
71@NEED_PIC_FALSE@    --libs | --plugin-libs)
72      echo_libs=yes
73      ;;
74@NEED_PIC_TRUE@    --plugin-libs)
75@NEED_PIC_TRUE@      echo_plugin_libs=yes
76@NEED_PIC_TRUE@      ;;
77    *)
78      usage 1 1>&2
79      ;;
80  esac
81  shift
82done
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@ -lcaca $libs
117fi
118
119@NEED_PIC_TRUE@if test "$echo_plugin_libs" = "yes"
120@NEED_PIC_TRUE@then
121@NEED_PIC_TRUE@  echo -L@libdir@ -lcaca_pic $libs
122@NEED_PIC_TRUE@fi
123
Note: See TracBrowser for help on using the repository browser.