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