annotate lib/swig/swigwin-2.0.11/Tools/config/ax_path_generic.m4 @ 2169:5b27c035a241

small cleaning
author Ritor1
date Mon, 20 Jan 2014 00:02:22 +0600
parents b3009adc0e2f
children
rev   line source
1899
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
1 # ===========================================================================
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
2 # http://www.gnu.org/software/autoconf-archive/ax_path_generic.html
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
3 # ===========================================================================
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
4 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
5 # SYNOPSIS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
6 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
7 # AX_PATH_GENERIC(LIBRARY,[MINIMUM-VERSION,[SED-EXPR-EXTRACTOR]],[ACTION-IF-FOUND],[ACTION-IF-NOT-FOUND],[CONFIG-SCRIPTS],[CFLAGS-ARG],[LIBS-ARG])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
8 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
9 # DESCRIPTION
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
10 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
11 # Runs the LIBRARY-config script and defines LIBRARY_CFLAGS and
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
12 # LIBRARY_LIBS unless the user had predefined them in the environment.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
13 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
14 # The script must support `--cflags' and `--libs' args. If MINIMUM-VERSION
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
15 # is specified, the script must also support the `--version' arg. If the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
16 # `--with-library-[exec-]prefix' arguments to ./configure are given, it
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
17 # must also support `--prefix' and `--exec-prefix'. Prefereable use
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
18 # CONFIG-SCRIPTS as config script, CFLAGS-ARG instead of `--cflags` and
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
19 # LIBS-ARG instead of `--libs`, if given.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
20 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
21 # The SED-EXPR-EXTRACTOR parameter representes the expression used in sed
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
22 # to extract the version number. Use it if your 'foo-config --version'
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
23 # dumps something like 'Foo library v1.0.0 (alfa)' instead of '1.0.0'.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
24 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
25 # The macro respects LIBRARY_CONFIG, LIBRARY_CFLAGS and LIBRARY_LIBS
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
26 # variables. If the first one is defined, it specifies the name of the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
27 # config script to use. If the latter two are defined, the script is not
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
28 # ran at all and their values are used instead (if only one of them is
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
29 # defined, the empty value of the remaining one is still used).
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
30 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
31 # Example:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
32 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
33 # AX_PATH_GENERIC(Foo, 1.0.0)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
34 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
35 # would run `foo-config --version' and check that it is at least 1.0.0, if
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
36 # successful the following variables would be defined and substituted:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
37 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
38 # FOO_CFLAGS to `foo-config --cflags`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
39 # FOO_LIBS to `foo-config --libs`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
40 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
41 # Example:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
42 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
43 # AX_PATH_GENERIC([Bar],,,[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
44 # AC_MSG_ERROR([Cannot find Bar library])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
45 # ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
46 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
47 # would check for bar-config program, defining and substituting the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
48 # following variables:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
49 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
50 # BAR_CFLAGS to `bar-config --cflags`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
51 # BAR_LIBS to `bar-config --libs`
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
52 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
53 # Example:
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
54 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
55 # ./configure BAZ_LIBS=/usr/lib/libbaz.a
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
56 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
57 # would link with a static version of baz library even if `baz-config
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
58 # --libs` returns just "-lbaz" that would normally result in using the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
59 # shared library.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
60 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
61 # This macro is a rearranged version of AC_PATH_GENERIC from Angus Lees.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
62 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
63 # LICENSE
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
64 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
65 # Copyright (c) 2009 Francesco Salvestrini <salvestrini@users.sourceforge.net>
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
66 #
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
67 # Copying and distribution of this file, with or without modification, are
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
68 # permitted in any medium without royalty provided the copyright notice
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
69 # and this notice are preserved. This file is offered as-is, without any
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
70 # warranty.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
71
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
72 #serial 11
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
73
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
74 AU_ALIAS([AC_PATH_GENERIC], [AX_PATH_GENERIC])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
75 AC_DEFUN([AX_PATH_GENERIC],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
76 AC_REQUIRE([AC_PROG_SED])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
77
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
78 dnl we're going to need uppercase and lowercase versions of the
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
79 dnl string `LIBRARY'
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
80 pushdef([UP], translit([$1], [a-z], [A-Z]))dnl
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
81 pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
82
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
83 AC_ARG_WITH(DOWN-prefix,[AS_HELP_STRING([--with-]DOWN[-prefix=PREFIX], [Prefix where $1 is installed (optional)])],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
84 DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
85 AC_ARG_WITH(DOWN-exec-prefix,[AS_HELP_STRING([--with-]DOWN[-exec-prefix=EPREFIX], [Exec prefix where $1 is installed (optional)])],
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
86 DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="")
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
87
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
88 AC_ARG_VAR(UP[]_CONFIG, [config script used for $1])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
89 AC_ARG_VAR(UP[]_CFLAGS, [CFLAGS used for $1])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
90 AC_ARG_VAR(UP[]_LIBS, [LIBS used for $1])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
91
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
92 AS_IF([test x$UP[]_CFLAGS != x -o x$UP[]_LIBS != x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
93 dnl Don't run config script at all, use user-provided values instead.
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
94 AC_SUBST(UP[]_CFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
95 AC_SUBST(UP[]_LIBS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
96 :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
97 $4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
98 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
99 AS_IF([test x$DOWN[]_config_exec_prefix != x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
100 DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
101 AS_IF([test x${UP[]_CONFIG+set} != xset],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
102 UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
103 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
104 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
105 AS_IF([test x$DOWN[]_config_prefix != x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
106 DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
107 AS_IF([test x${UP[]_CONFIG+set} != xset],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
108 UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
109 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
110 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
111
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
112 AC_PATH_PROGS(UP[]_CONFIG,[$6 DOWN-config],[no])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
113 AS_IF([test "$UP[]_CONFIG" = "no"],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
114 :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
115 $5
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
116 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
117 dnl Get the CFLAGS from LIBRARY-config script
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
118 AS_IF([test x"$7" = x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
119 UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
120 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
121 UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args $7`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
122 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
123
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
124 dnl Get the LIBS from LIBRARY-config script
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
125 AS_IF([test x"$8" = x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
126 UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
127 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
128 UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args $8`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
129 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
130
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
131 AS_IF([test x"$2" != x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
132 dnl Check for provided library version
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
133 AS_IF([test x"$3" != x],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
134 dnl Use provided sed expression
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
135 DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e $3`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
136 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
137 DOWN[]_version="`$UP[]_CONFIG $DOWN[]_config_args --version | $SED -e 's/^\ *\(.*\)\ *$/\1/'`"
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
138 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
139
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
140 AC_MSG_CHECKING([for $1 ($DOWN[]_version) >= $2])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
141 AX_COMPARE_VERSION($DOWN[]_version,[ge],[$2],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
142 AC_MSG_RESULT([yes])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
143
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
144 AC_SUBST(UP[]_CFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
145 AC_SUBST(UP[]_LIBS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
146 :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
147 $4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
148 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
149 AC_MSG_RESULT([no])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
150 :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
151 $5
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
152 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
153 ],[
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
154 AC_SUBST(UP[]_CFLAGS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
155 AC_SUBST(UP[]_LIBS)
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
156 :
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
157 $4
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
158 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
159 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
160 ])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
161
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
162 popdef([UP])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
163 popdef([DOWN])
b3009adc0e2f Adding swig, gitignore, hgignore
Nomad
parents:
diff changeset
164 ])