Initial release
[adaptation/ap_samsung/gst-plugins-s5pc2xx.git] / common / m4 / as-libtool-tags.m4
1 dnl as-libtool-tags.m4 0.1.4
2
3 dnl autostars m4 macro for selecting libtool "tags" (languages)
4
5 dnl Andy Wingo does not claim credit for this macro
6 dnl backported from libtool 1.6 by Paolo Bonzini
7 dnl see http://lists.gnu.org/archive/html/libtool/2003-12/msg00007.html
8
9 dnl $Id: as-libtool-tags.m4,v 1.3 2006-04-01 15:30:56 thomasvs Exp $
10
11 dnl AS_LIBTOOL_TAGS([tags...])
12
13 dnl example
14 dnl AS_LIBTOOL_TAGS([]) for only C (no fortran, etc)
15
16 dnl When AC_LIBTOOL_TAGS is used, I redefine _LT_AC_TAGCONFIG
17 dnl to be more similar to the libtool 1.6 implementation, which
18 dnl uses an m4 loop and m4 case instead of a shell loop.  This
19 dnl way the CXX/GCJ/F77/RC tests are not always expanded.
20
21 dnl AS_LIBTOOL_TAGS
22 dnl ---------------
23 dnl tags to enable
24 AC_DEFUN([AS_LIBTOOL_TAGS],
25 [m4_define([_LT_TAGS],[$1])
26 m4_define([_LT_AC_TAGCONFIG], [
27   # redefined LT AC TAGCONFIG
28   if test -f "$ltmain"; then
29     if test ! -f "${ofile}"; then
30       AC_MSG_WARN([output file `$ofile' does not exist])
31     fi
32
33     if test -z "$LTCC"; then
34       eval "`$SHELL ${ofile} --config | grep '^LTCC='`"
35       if test -z "$LTCC"; then
36         AC_MSG_WARN([output file `$ofile' does not look like a libtool script])
37       else
38         AC_MSG_WARN([using `LTCC=$LTCC', extracted from `$ofile'])
39       fi
40     fi
41
42     AC_FOREACH([_LT_TAG], _LT_TAGS,
43       echo THOMAS: tag _LT_TAG
44       [m4_case(_LT_TAG,
45       [CXX], [
46     if test -n "$CXX" && test "X$CXX" != "Xno"; then
47       echo "THOMAS: YAY CXX"
48       AC_LIBTOOL_LANG_CXX_CONFIG
49       available_tags="$available_tags _LT_TAG"
50     fi],
51       [F77], [
52     if test -n "$F77" && test "X$F77" != "Xno"; then
53       AC_LIBTOOL_LANG_F77_CONFIG
54       available_tags="$available_tags _LT_TAG"
55     fi],
56       [GCJ], [
57     if test -n "$GCJ" && test "X$GCJ" != "Xno"; then
58       AC_LIBTOOL_LANG_GCJ_CONFIG
59       available_tags="$available_tags _LT_TAG"
60     fi],
61       [RC], [
62     if test -n "$RC" && test "X$RC" != "Xno"; then
63       AC_LIBTOOL_LANG_RC_CONFIG
64       available_tags="$available_tags _LT_TAG"
65     fi],
66       [m4_errprintn(m4_location[: error: invalid tag name: ]"_LT_TAG")
67       m4_exit(1)])
68     ])
69     echo THOMAS: available tags: $available_tags
70   fi
71   # Now substitute the updated list of available tags.
72   if eval "sed -e 's/^available_tags=.*\$/available_tags=\"$available_tags\"/' \"$ofile\" > \"${ofile}T\""; then
73     mv "${ofile}T" "$ofile"
74     chmod +x "$ofile"
75     AC_MSG_NOTICE([updated available libtool tags with $available_tags.])
76   else
77     rm -f "${ofile}T"
78     AC_MSG_ERROR([unable to update list of available tagged configurations.])
79
80   fi
81
82 ])dnl _LT_AC_TAG_CONFIG
83 ])