*** empty log message ***
[m17n/m17n-lib.git] / m17n-config.in
index 5d05972..f69517c 100644 (file)
@@ -1,6 +1,6 @@
 #!/bin/sh
 # m17n-config -- helper script for the m17n library.   -*- coding: euc-jp; -*-
-# Copyright (C) 2003, 2004
+# Copyright (C) 2003, 2004, 2006, 2007
 #   National Institute of Advanced Industrial Science and Technology (AIST)
 #   Registration Number H15PRO112
 # See the end for copying conditions.
@@ -10,7 +10,8 @@ exec_prefix=@exec_prefix@
 
 help ()
 {
-  echo "Usage: $0 [CORE | GUI] [--version | --cflags | --libs | --libtool]"
+  echo "Usage: $0 [API-LEVEL ...] [--version | --cflags | --libs | --libtool]"
+  echo "  API-LEVEL is CORE, SHELL (default), GUI, or FLT"
 }
 
 if test $# -eq 0; then
@@ -18,13 +19,50 @@ if test $# -eq 0; then
   exit 0
 fi
 
-LIBNAME=-lm17n
-
+while true; do
 case $1 in
-CORE) LIBNAME="-lm17n-core"; shift;;
- GUI) LIBNAME="-lm17n-core -lm17n -lm17n-gui"; shift;;
-   X) LIBNAME="-lm17n-core -lm17n -lm17n-gui"; shift;;
+CORE) if test "x$API" = "x"; then 
+        API="CORE"; LIBTOOLNAME="m17n-core";
+      fi;
+      shift;;
+
+SHELL) if test "x$API" != "xGUI"; then
+         API="FLT"; LIBSHELL=" -lm17n"
+         if test "x$LIBFLT" = "x"; then
+           LIBTOOLNAME="m17n";
+         else
+           LIBTOOLNAME="m17n m17n-flt";
+        fi
+       fi;
+       shift;;
+
+FLT) if test "x$API" != "xGUI"; then
+       API="FLT"; LIBFLT=" -lm17n-flt"
+       if test "x$LIBSHELL" = "x"; then
+         LIBTOOLNAME="m17n-flt";
+       else
+         LIBTOOLNAME="m17n m17n-flt";
+       fi
+     fi;
+     shift;;
+
+GUI|X) API="GUI";
+       LIBSHELL=" -lm17n"; LIBFLT=" -lm17n-flt"; LIBGUI=" -lm17n-gui";
+       LIBTOOLNAME="m17n-gui";
+       shift;;
+
+*) break;;
 esac
+done
+
+LIBNAME="-lm17n-core"
+
+if test "x$API" = "x"; then
+  LIBNAME="$LIBNAME -lm17n"
+  LIBTOOLNAME="m17n"
+else
+  LIBNAME="$LIBNAME$LIBSHELL$LIBFLT$LIBGUI"
+fi
 
 case $1 in
 --version)
@@ -43,9 +81,10 @@ case $1 in
   fi;;
 
 --libtool)
-  echo "@libdir@/lib${LIBNAME}.la"
-  ;;
-
+  for name in $LIBTOOLNAME; do
+    echo -n "@libdir@/lib${name}.la "
+  done;
+  echo;;
 *)
     help
     exit 1;;
@@ -57,19 +96,18 @@ cat > /dev/null <<EOF
 /***ja @page m17n-config m17n ¥é¥¤¥Ö¥é¥ê¤Î¥³¥ó¥Ñ¥¤¥ë¡¦¥ê¥ó¥¯¥ª¥×¥·¥ç¥ó¤Îɽ¼¨ */
 
 /***
-@section synopsis SYNOPSIS
+@section m17n-config-synopsis SYNOPSIS
 
-m17n-config [CORE | X] [--cflags | --libs | --libtool] [--version]
+m17n-config [API-LEVEL ...] [--cflags | --libs | --libtool] [--version]
 
-@section description DESCRIPTION
+@section m17n-config-description DESCRIPTION
 
 The shell script m17n-config prints compile and link options for a
 program that uses the m17n library.
 
 By default, the printed options are for such a program that uses SHELL
-API of the libray.  But, if the first argument is "CORE", the options
-are for a program that uses only CORE API, if the first argument "X",
-the options are for a program that uses GUI API on X window.
+API of the libray.  But, if the first argument is "CORE", "GUI", or
+"FLT", the options are for a program that uses the corresponding API.
 
 The other arguments are as follows.
 
@@ -102,5 +140,5 @@ EOF
 
 # You should have received a copy of the GNU Lesser General Public
 # License along with the m17n library; if not, write to the Free
-# Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-# 02111-1307, USA.
+# Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+# Boston, MA 02110-1301, USA.