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