c3f8156c8a4d594973e9ee281644afb965946e16
[m17n/m17n-lib.git] / m17n-config.in
1 #!/bin/sh
2 # m17n-config -- helper script for the m17n library.    -*- coding: euc-jp; -*-
3 # Copyright (C) 2003, 2004
4 #   National Institute of Advanced Industrial Science and Technology (AIST)
5 #   Registration Number H15PRO112
6 # See the end for copying conditions.
7
8 prefix=@prefix@
9 exec_prefix=@exec_prefix@
10
11 help ()
12 {
13   echo "Usage: $0 [CORE | GUI] [--version | --cflags | --libs | --libtool]"
14 }
15
16 if test $# -eq 0; then
17   help 1>&2
18   exit 0
19 fi
20
21 case $1 in
22 CORE) LIBNAME="-lm17n-core"; LIBTOOLNAME="m17n-core"; shift;;
23 GUI|X) LIBNAME="-lm17n-core -lm17n -lm17n-gui"; LIBTOOLNAME="m17n-gui"; shift;;
24 *) LIBNAME="-lm17n-core -lm17n"; LIBTOOLNAME="m17n"; ;;
25 esac
26
27 case $1 in
28 --version)
29   echo "@PACKAGE_VERSION@";;
30
31 --libs)
32   if test "@libdir@" != "/usr/lib"; then
33     echo "-L@libdir@ ${LIBNAME}"
34   else
35     echo "${LIBNAME}"
36   fi;;
37
38 --cflags)
39   if test "@includedir@" != "/usr/include"; then
40     echo "-I@includedir@"
41   fi;;
42
43 --libtool)
44   echo "@libdir@/lib${LIBTOOLNAME}.la"
45   ;;
46
47 *)
48     help
49     exit 1;;
50 esac
51 exit 0
52
53 cat > /dev/null <<EOF
54 /***en @page m17n-config Print compile/link options of the m17n library */
55 /***ja @page m17n-config m17n ¥é¥¤¥Ö¥é¥ê¤Î¥³¥ó¥Ñ¥¤¥ë¡¦¥ê¥ó¥¯¥ª¥×¥·¥ç¥ó¤Îɽ¼¨ */
56
57 /***
58 @section m17n-config-synopsis SYNOPSIS
59
60 m17n-config [CORE | GUI] [--cflags | --libs | --libtool] [--version]
61
62 @section m17n-config-description DESCRIPTION
63
64 The shell script m17n-config prints compile and link options for a
65 program that uses the m17n library.
66
67 By default, the printed options are for such a program that uses SHELL
68 API of the libray.  But, if the first argument is "CORE", the options
69 are for a program that uses only CORE API, if the first argument "GUI",
70 the options are for a program that uses GUI API.
71
72 The other arguments are as follows.
73
74 - --cflags\n
75         Print compile option (e.g. -I/usr/local/include)
76 - --libs\n
77         Print link option (e.g. -L/usr/local/lib -lm17n)
78 - --libtool\n
79         Print libtool option (e.g. /usr/local/lib/libm17n.la)
80 - --version\n
81         Print version number of the m17n library.
82 */ 
83 EOF
84
85 # Copyright (C) 2003, 2004
86 #   National Institute of Advanced Industrial Science and Technology (AIST)
87 #   Registration Number H15PRO112
88
89 # This file is part of the m17n library.
90
91 # The m17n library is free software; you can redistribute it and/or
92 # modify it under the terms of the GNU Lesser General Public License
93 # as published by the Free Software Foundation; either version 2.1 of
94 # the License, or (at your option) any later version.
95
96 # The m17n library is distributed in the hope that it will be useful,
97 # but WITHOUT ANY WARRANTY; without even the implied warranty of
98 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
99 # Lesser General Public License for more details.
100
101 # You should have received a copy of the GNU Lesser General Public
102 # License along with the m17n library; if not, write to the Free
103 # Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
104 # 02111-1307, USA.