| 21 | | |
| 22 | | # gettext.m4 serial 60 (gettext-0.17) |
| 23 | | dnl Copyright (C) 1995-2007 Free Software Foundation, Inc. |
| 24 | | dnl This file is free software; the Free Software Foundation |
| 25 | | dnl gives unlimited permission to copy and/or distribute it, |
| 26 | | dnl with or without modifications, as long as this notice is preserved. |
| 27 | | dnl |
| 28 | | dnl This file can can be used in projects which are not available under |
| 29 | | dnl the GNU General Public License or the GNU Library General Public |
| 30 | | dnl License but which still want to provide support for the GNU gettext |
| 31 | | dnl functionality. |
| 32 | | dnl Please note that the actual code of the GNU gettext library is covered |
| 33 | | dnl by the GNU Library General Public License, and the rest of the GNU |
| 34 | | dnl gettext package package is covered by the GNU General Public License. |
| 35 | | dnl They are *not* in the public domain. |
| 36 | | |
| 37 | | dnl Authors: |
| 38 | | dnl Ulrich Drepper <drepper@cygnus.com>, 1995-2000. |
| 39 | | dnl Bruno Haible <haible@clisp.cons.org>, 2000-2006. |
| 40 | | |
| 41 | | dnl Macro to add for using GNU gettext. |
| 42 | | |
| 43 | | dnl Usage: AM_GNU_GETTEXT([INTLSYMBOL], [NEEDSYMBOL], [INTLDIR]). |
| 44 | | dnl INTLSYMBOL can be one of 'external', 'no-libtool', 'use-libtool'. The |
| 45 | | dnl default (if it is not specified or empty) is 'no-libtool'. |
| 46 | | dnl INTLSYMBOL should be 'external' for packages with no intl directory, |
| 47 | | dnl and 'no-libtool' or 'use-libtool' for packages with an intl directory. |
| 48 | | dnl If INTLSYMBOL is 'use-libtool', then a libtool library |
| 49 | | dnl $(top_builddir)/intl/libintl.la will be created (shared and/or static, |
| 50 | | dnl depending on --{enable,disable}-{shared,static} and on the presence of |
| 51 | | dnl AM-DISABLE-SHARED). If INTLSYMBOL is 'no-libtool', a static library |
| 52 | | dnl $(top_builddir)/intl/libintl.a will be created. |
| 53 | | dnl If NEEDSYMBOL is specified and is 'need-ngettext', then GNU gettext |
| 54 | | dnl implementations (in libc or libintl) without the ngettext() function |
| 55 | | dnl will be ignored. If NEEDSYMBOL is specified and is |
| 56 | | dnl 'need-formatstring-macros', then GNU gettext implementations that don't |
| 57 | | dnl support the ISO C 99 <inttypes.h> formatstring macros will be ignored. |
| 58 | | dnl INTLDIR is used to find the intl libraries. If empty, |
| 59 | | dnl the value `$(top_builddir)/intl/' is used. |
| 60 | | dnl |
| 61 | | dnl The result of the configuration is one of three cases: |
| 62 | | dnl 1) GNU gettext, as included in the intl subdirectory, will be compiled |
| 63 | | dnl and used. |
| 64 | | dnl Catalog format: GNU --> install in $(datadir) |
| 65 | | dnl Catalog extension: .mo after installation, .gmo in source tree |
| 66 | | dnl 2) GNU gettext has been found in the system's C library. |
| 67 | | dnl Catalog format: GNU --> install in $(datadir) |
| 68 | | dnl Catalog extension: .mo after installation, .gmo in source tree |
| 69 | | dnl 3) No internationalization, always use English msgid. |
| 70 | | dnl Catalog format: none |
| 71 | | dnl Catalog extension: none |
| 72 | | dnl If INTLSYMBOL is 'external', only cases 2 and 3 can occur. |
| 73 | | dnl The use of .gmo is historical (it was needed to avoid overwriting the |
| 74 | | dnl GNU format catalogs when building on a platform with an X/Open gettext), |
| 75 | | dnl but we keep it in order not to force irrelevant filename changes on the |
| 76 | | dnl maintainers. |
| 77 | | dnl |
| 78 | | AC_DEFUN([AM_GNU_GETTEXT], |
| 79 | | [ |
| 80 | | dnl Argument checking. |
| 81 | | ifelse([$1], [], , [ifelse([$1], [external], , [ifelse([$1], [no-libtool], , [ifelse([$1], [use-libtool], , |
| 82 | | [errprint([ERROR: invalid first argument to AM_GNU_GETTEXT |
| 83 | | ])])])])]) |
| 84 | | ifelse([$2], [], , [ifelse([$2], [need-ngettext], , [ifelse([$2], [need-formatstring-macros], , |
| 85 | | [errprint([ERROR: invalid second argument to AM_GNU_GETTEXT |
| 86 | | ])])])]) |
| 87 | | define([gt_included_intl], |
| 88 | | ifelse([$1], [external], |
| 89 | | ifdef([AM_GNU_GETTEXT_][INTL_SUBDIR], [yes], [no]), |
| 90 | | [yes])) |
| 91 | | define([gt_libtool_suffix_prefix], ifelse([$1], [use-libtool], [l], [])) |
| 92 | | gt_NEEDS_INIT |
| 93 | | AM_GNU_GETTEXT_NEED([$2]) |
| 94 | | |
| 95 | | AC_REQUIRE([AM_PO_SUBDIRS])dnl |
| 96 | | ifelse(gt_included_intl, yes, [ |
| 97 | | AC_REQUIRE([AM_INTL_SUBDIR])dnl |
| 98 | | ]) |
| 99 | | |
| 100 | | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. |
| 101 | | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 102 | | AC_REQUIRE([AC_LIB_RPATH]) |
| 103 | | |
| 104 | | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
| 105 | | dnl Ideally we would do this search only after the |
| 106 | | dnl if test "$USE_NLS" = "yes"; then |
| 107 | | dnl if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then |
| 108 | | dnl tests. But if configure.in invokes AM_ICONV after AM_GNU_GETTEXT |
| 109 | | dnl the configure script would need to contain the same shell code |
| 110 | | dnl again, outside any 'if'. There are two solutions: |
| 111 | | dnl - Invoke AM_ICONV_LINKFLAGS_BODY here, outside any 'if'. |
| 112 | | dnl - Control the expansions in more detail using AC_PROVIDE_IFELSE. |
| 113 | | dnl Since AC_PROVIDE_IFELSE is only in autoconf >= 2.52 and not |
| 114 | | dnl documented, we avoid it. |
| 115 | | ifelse(gt_included_intl, yes, , [ |
| 116 | | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
| 117 | | ]) |
| 118 | | |
| 119 | | dnl Sometimes, on MacOS X, libintl requires linking with CoreFoundation. |
| 120 | | gt_INTL_MACOSX |
| 121 | | |
| 122 | | dnl Set USE_NLS. |
| 123 | | AC_REQUIRE([AM_NLS]) |
| 124 | | |
| 125 | | ifelse(gt_included_intl, yes, [ |
| 126 | | BUILD_INCLUDED_LIBINTL=no |
| 127 | | USE_INCLUDED_LIBINTL=no |
| 128 | | ]) |
| 129 | | LIBINTL= |
| 130 | | LTLIBINTL= |
| 131 | | POSUB= |
| 132 | | |
| 133 | | dnl Add a version number to the cache macros. |
| 134 | | case " $gt_needs " in |
| 135 | | *" need-formatstring-macros "*) gt_api_version=3 ;; |
| 136 | | *" need-ngettext "*) gt_api_version=2 ;; |
| 137 | | *) gt_api_version=1 ;; |
| 138 | | esac |
| 139 | | gt_func_gnugettext_libc="gt_cv_func_gnugettext${gt_api_version}_libc" |
| 140 | | gt_func_gnugettext_libintl="gt_cv_func_gnugettext${gt_api_version}_libintl" |
| 141 | | |
| 142 | | dnl If we use NLS figure out what method |
| 143 | | if test "$USE_NLS" = "yes"; then |
| 144 | | gt_use_preinstalled_gnugettext=no |
| 145 | | ifelse(gt_included_intl, yes, [ |
| 146 | | AC_MSG_CHECKING([whether included gettext is requested]) |
| 147 | | AC_ARG_WITH(included-gettext, |
| 148 | | [ --with-included-gettext use the GNU gettext library included here], |
| 149 | | nls_cv_force_use_gnu_gettext=$withval, |
| 150 | | nls_cv_force_use_gnu_gettext=no) |
| 151 | | AC_MSG_RESULT($nls_cv_force_use_gnu_gettext) |
| 152 | | |
| 153 | | nls_cv_use_gnu_gettext="$nls_cv_force_use_gnu_gettext" |
| 154 | | if test "$nls_cv_force_use_gnu_gettext" != "yes"; then |
| 155 | | ]) |
| 156 | | dnl User does not insist on using GNU NLS library. Figure out what |
| 157 | | dnl to use. If GNU gettext is available we use this. Else we have |
| 158 | | dnl to fall back to GNU NLS library. |
| 159 | | |
| 160 | | if test $gt_api_version -ge 3; then |
| 161 | | gt_revision_test_code=' |
| 162 | | #ifndef __GNU_GETTEXT_SUPPORTED_REVISION |
| 163 | | #define __GNU_GETTEXT_SUPPORTED_REVISION(major) ((major) == 0 ? 0 : -1) |
| 164 | | #endif |
| 165 | | changequote(,)dnl |
| 166 | | typedef int array [2 * (__GNU_GETTEXT_SUPPORTED_REVISION(0) >= 1) - 1]; |
| 167 | | changequote([,])dnl |
| 168 | | ' |
| 169 | | else |
| 170 | | gt_revision_test_code= |
| 171 | | fi |
| 172 | | if test $gt_api_version -ge 2; then |
| 173 | | gt_expression_test_code=' + * ngettext ("", "", 0)' |
| 174 | | else |
| 175 | | gt_expression_test_code= |
| 176 | | fi |
| 177 | | |
| 178 | | AC_CACHE_CHECK([for GNU gettext in libc], [$gt_func_gnugettext_libc], |
| 179 | | [AC_TRY_LINK([#include <libintl.h> |
| 180 | | $gt_revision_test_code |
| 181 | | extern int _nl_msg_cat_cntr; |
| 182 | | extern int *_nl_domain_bindings;], |
| 183 | | [bindtextdomain ("", ""); |
| 184 | | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_domain_bindings], |
| 185 | | [eval "$gt_func_gnugettext_libc=yes"], |
| 186 | | [eval "$gt_func_gnugettext_libc=no"])]) |
| 187 | | |
| 188 | | if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" != "yes"; }; then |
| 189 | | dnl Sometimes libintl requires libiconv, so first search for libiconv. |
| 190 | | ifelse(gt_included_intl, yes, , [ |
| 191 | | AM_ICONV_LINK |
| 192 | | ]) |
| 193 | | dnl Search for libintl and define LIBINTL, LTLIBINTL and INCINTL |
| 194 | | dnl accordingly. Don't use AC_LIB_LINKFLAGS_BODY([intl],[iconv]) |
| 195 | | dnl because that would add "-liconv" to LIBINTL and LTLIBINTL |
| 196 | | dnl even if libiconv doesn't exist. |
| 197 | | AC_LIB_LINKFLAGS_BODY([intl]) |
| 198 | | AC_CACHE_CHECK([for GNU gettext in libintl], |
| 199 | | [$gt_func_gnugettext_libintl], |
| 200 | | [gt_save_CPPFLAGS="$CPPFLAGS" |
| 201 | | CPPFLAGS="$CPPFLAGS $INCINTL" |
| 202 | | gt_save_LIBS="$LIBS" |
| 203 | | LIBS="$LIBS $LIBINTL" |
| 204 | | dnl Now see whether libintl exists and does not depend on libiconv. |
| 205 | | AC_TRY_LINK([#include <libintl.h> |
| 206 | | $gt_revision_test_code |
| 207 | | extern int _nl_msg_cat_cntr; |
| 208 | | extern |
| 209 | | #ifdef __cplusplus |
| 210 | | "C" |
| 211 | | #endif |
| 212 | | const char *_nl_expand_alias (const char *);], |
| 213 | | [bindtextdomain ("", ""); |
| 214 | | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
| 215 | | [eval "$gt_func_gnugettext_libintl=yes"], |
| 216 | | [eval "$gt_func_gnugettext_libintl=no"]) |
| 217 | | dnl Now see whether libintl exists and depends on libiconv. |
| 218 | | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" != yes; } && test -n "$LIBICONV"; then |
| 219 | | LIBS="$LIBS $LIBICONV" |
| 220 | | AC_TRY_LINK([#include <libintl.h> |
| 221 | | $gt_revision_test_code |
| 222 | | extern int _nl_msg_cat_cntr; |
| 223 | | extern |
| 224 | | #ifdef __cplusplus |
| 225 | | "C" |
| 226 | | #endif |
| 227 | | const char *_nl_expand_alias (const char *);], |
| 228 | | [bindtextdomain ("", ""); |
| 229 | | return * gettext ("")$gt_expression_test_code + _nl_msg_cat_cntr + *_nl_expand_alias ("")], |
| 230 | | [LIBINTL="$LIBINTL $LIBICONV" |
| 231 | | LTLIBINTL="$LTLIBINTL $LTLIBICONV" |
| 232 | | eval "$gt_func_gnugettext_libintl=yes" |
| 233 | | ]) |
| 234 | | fi |
| 235 | | CPPFLAGS="$gt_save_CPPFLAGS" |
| 236 | | LIBS="$gt_save_LIBS"]) |
| 237 | | fi |
| 238 | | |
| 239 | | dnl If an already present or preinstalled GNU gettext() is found, |
| 240 | | dnl use it. But if this macro is used in GNU gettext, and GNU |
| 241 | | dnl gettext is already preinstalled in libintl, we update this |
| 242 | | dnl libintl. (Cf. the install rule in intl/Makefile.in.) |
| 243 | | if { eval "gt_val=\$$gt_func_gnugettext_libc"; test "$gt_val" = "yes"; } \ |
| 244 | | || { { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; } \ |
| 245 | | && test "$PACKAGE" != gettext-runtime \ |
| 246 | | && test "$PACKAGE" != gettext-tools; }; then |
| 247 | | gt_use_preinstalled_gnugettext=yes |
| 248 | | else |
| 249 | | dnl Reset the values set by searching for libintl. |
| 250 | | LIBINTL= |
| 251 | | LTLIBINTL= |
| 252 | | INCINTL= |
| 253 | | fi |
| 254 | | |
| 255 | | ifelse(gt_included_intl, yes, [ |
| 256 | | if test "$gt_use_preinstalled_gnugettext" != "yes"; then |
| 257 | | dnl GNU gettext is not found in the C library. |
| 258 | | dnl Fall back on included GNU gettext library. |
| 259 | | nls_cv_use_gnu_gettext=yes |
| 260 | | fi |
| 261 | | fi |
| 262 | | |
| 263 | | if test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 264 | | dnl Mark actions used to generate GNU NLS library. |
| 265 | | BUILD_INCLUDED_LIBINTL=yes |
| 266 | | USE_INCLUDED_LIBINTL=yes |
| 267 | | LIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LIBICONV $LIBTHREAD" |
| 268 | | LTLIBINTL="ifelse([$3],[],\${top_builddir}/intl,[$3])/libintl.[]gt_libtool_suffix_prefix[]a $LTLIBICONV $LTLIBTHREAD" |
| 269 | | LIBS=`echo " $LIBS " | sed -e 's/ -lintl / /' -e 's/^ //' -e 's/ $//'` |
| 270 | | fi |
| 271 | | |
| 272 | | CATOBJEXT= |
| 273 | | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
| 274 | | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 275 | | dnl Mark actions to use GNU gettext tools. |
| 276 | | CATOBJEXT=.gmo |
| 277 | | fi |
| 278 | | ]) |
| 279 | | |
| 280 | | if test -n "$INTL_MACOSX_LIBS"; then |
| 281 | | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
| 282 | | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 283 | | dnl Some extra flags are needed during linking. |
| 284 | | LIBINTL="$LIBINTL $INTL_MACOSX_LIBS" |
| 285 | | LTLIBINTL="$LTLIBINTL $INTL_MACOSX_LIBS" |
| 286 | | fi |
| 287 | | fi |
| 288 | | |
| 289 | | if test "$gt_use_preinstalled_gnugettext" = "yes" \ |
| 290 | | || test "$nls_cv_use_gnu_gettext" = "yes"; then |
| 291 | | AC_DEFINE(ENABLE_NLS, 1, |
| 292 | | [Define to 1 if translation of program messages to the user's native language |
| 293 | | is requested.]) |
| 294 | | else |
| 295 | | USE_NLS=no |
| 296 | | fi |
| 297 | | fi |
| 298 | | |
| 299 | | AC_MSG_CHECKING([whether to use NLS]) |
| 300 | | AC_MSG_RESULT([$USE_NLS]) |
| 301 | | if test "$USE_NLS" = "yes"; then |
| 302 | | AC_MSG_CHECKING([where the gettext function comes from]) |
| 303 | | if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
| 304 | | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
| 305 | | gt_source="external libintl" |
| 306 | | else |
| 307 | | gt_source="libc" |
| 308 | | fi |
| 309 | | else |
| 310 | | gt_source="included intl directory" |
| 311 | | fi |
| 312 | | AC_MSG_RESULT([$gt_source]) |
| 313 | | fi |
| 314 | | |
| 315 | | if test "$USE_NLS" = "yes"; then |
| 316 | | |
| 317 | | if test "$gt_use_preinstalled_gnugettext" = "yes"; then |
| 318 | | if { eval "gt_val=\$$gt_func_gnugettext_libintl"; test "$gt_val" = "yes"; }; then |
| 319 | | AC_MSG_CHECKING([how to link with libintl]) |
| 320 | | AC_MSG_RESULT([$LIBINTL]) |
| 321 | | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCINTL]) |
| 322 | | fi |
| 323 | | |
| 324 | | dnl For backward compatibility. Some packages may be using this. |
| 325 | | AC_DEFINE(HAVE_GETTEXT, 1, |
| 326 | | [Define if the GNU gettext() function is already present or preinstalled.]) |
| 327 | | AC_DEFINE(HAVE_DCGETTEXT, 1, |
| 328 | | [Define if the GNU dcgettext() function is already present or preinstalled.]) |
| 329 | | fi |
| 330 | | |
| 331 | | dnl We need to process the po/ directory. |
| 332 | | POSUB=po |
| 333 | | fi |
| 334 | | |
| 335 | | ifelse(gt_included_intl, yes, [ |
| 336 | | dnl If this is used in GNU gettext we have to set BUILD_INCLUDED_LIBINTL |
| 337 | | dnl to 'yes' because some of the testsuite requires it. |
| 338 | | if test "$PACKAGE" = gettext-runtime || test "$PACKAGE" = gettext-tools; then |
| 339 | | BUILD_INCLUDED_LIBINTL=yes |
| 340 | | fi |
| 341 | | |
| 342 | | dnl Make all variables we use known to autoconf. |
| 343 | | AC_SUBST(BUILD_INCLUDED_LIBINTL) |
| 344 | | AC_SUBST(USE_INCLUDED_LIBINTL) |
| 345 | | AC_SUBST(CATOBJEXT) |
| 346 | | |
| 347 | | dnl For backward compatibility. Some configure.ins may be using this. |
| 348 | | nls_cv_header_intl= |
| 349 | | nls_cv_header_libgt= |
| 350 | | |
| 351 | | dnl For backward compatibility. Some Makefiles may be using this. |
| 352 | | DATADIRNAME=share |
| 353 | | AC_SUBST(DATADIRNAME) |
| 354 | | |
| 355 | | dnl For backward compatibility. Some Makefiles may be using this. |
| 356 | | INSTOBJEXT=.mo |
| 357 | | AC_SUBST(INSTOBJEXT) |
| 358 | | |
| 359 | | dnl For backward compatibility. Some Makefiles may be using this. |
| 360 | | GENCAT=gencat |
| 361 | | AC_SUBST(GENCAT) |
| 362 | | |
| 363 | | dnl For backward compatibility. Some Makefiles may be using this. |
| 364 | | INTLOBJS= |
| 365 | | if test "$USE_INCLUDED_LIBINTL" = yes; then |
| 366 | | INTLOBJS="\$(GETTOBJS)" |
| 367 | | fi |
| 368 | | AC_SUBST(INTLOBJS) |
| 369 | | |
| 370 | | dnl Enable libtool support if the surrounding package wishes it. |
| 371 | | INTL_LIBTOOL_SUFFIX_PREFIX=gt_libtool_suffix_prefix |
| 372 | | AC_SUBST(INTL_LIBTOOL_SUFFIX_PREFIX) |
| 373 | | ]) |
| 374 | | |
| 375 | | dnl For backward compatibility. Some Makefiles may be using this. |
| 376 | | INTLLIBS="$LIBINTL" |
| 377 | | AC_SUBST(INTLLIBS) |
| 378 | | |
| 379 | | dnl Make all documented variables known to autoconf. |
| 380 | | AC_SUBST(LIBINTL) |
| 381 | | AC_SUBST(LTLIBINTL) |
| 382 | | AC_SUBST(POSUB) |
| 383 | | ]) |
| 384 | | |
| 385 | | |
| 386 | | dnl gt_NEEDS_INIT ensures that the gt_needs variable is initialized. |
| 387 | | m4_define([gt_NEEDS_INIT], |
| 388 | | [ |
| 389 | | m4_divert_text([DEFAULTS], [gt_needs=]) |
| 390 | | m4_define([gt_NEEDS_INIT], []) |
| 391 | | ]) |
| 392 | | |
| 393 | | |
| 394 | | dnl Usage: AM_GNU_GETTEXT_NEED([NEEDSYMBOL]) |
| 395 | | AC_DEFUN([AM_GNU_GETTEXT_NEED], |
| 396 | | [ |
| 397 | | m4_divert_text([INIT_PREPARE], [gt_needs="$gt_needs $1"]) |
| 398 | | ]) |
| 399 | | |
| 400 | | |
| 401 | | dnl Usage: AM_GNU_GETTEXT_VERSION([gettext-version]) |
| 402 | | AC_DEFUN([AM_GNU_GETTEXT_VERSION], []) |
| 403 | | |
| 404 | | # iconv.m4 serial AM6 (gettext-0.17) |
| 405 | | dnl Copyright (C) 2000-2002, 2007 Free Software Foundation, Inc. |
| 406 | | dnl This file is free software; the Free Software Foundation |
| 407 | | dnl gives unlimited permission to copy and/or distribute it, |
| 408 | | dnl with or without modifications, as long as this notice is preserved. |
| 409 | | |
| 410 | | dnl From Bruno Haible. |
| 411 | | |
| 412 | | AC_DEFUN([AM_ICONV_LINKFLAGS_BODY], |
| 413 | | [ |
| 414 | | dnl Prerequisites of AC_LIB_LINKFLAGS_BODY. |
| 415 | | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 416 | | AC_REQUIRE([AC_LIB_RPATH]) |
| 417 | | |
| 418 | | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 419 | | dnl accordingly. |
| 420 | | AC_LIB_LINKFLAGS_BODY([iconv]) |
| 421 | | ]) |
| 422 | | |
| 423 | | AC_DEFUN([AM_ICONV_LINK], |
| 424 | | [ |
| 425 | | dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and |
| 426 | | dnl those with the standalone portable GNU libiconv installed). |
| 427 | | AC_REQUIRE([AC_CANONICAL_HOST]) dnl for cross-compiles |
| 428 | | |
| 429 | | dnl Search for libiconv and define LIBICONV, LTLIBICONV and INCICONV |
| 430 | | dnl accordingly. |
| 431 | | AC_REQUIRE([AM_ICONV_LINKFLAGS_BODY]) |
| 432 | | |
| 433 | | dnl Add $INCICONV to CPPFLAGS before performing the following checks, |
| 434 | | dnl because if the user has installed libiconv and not disabled its use |
| 435 | | dnl via --without-libiconv-prefix, he wants to use it. The first |
| 436 | | dnl AC_TRY_LINK will then fail, the second AC_TRY_LINK will succeed. |
| 437 | | am_save_CPPFLAGS="$CPPFLAGS" |
| 438 | | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INCICONV]) |
| 439 | | |
| 440 | | AC_CACHE_CHECK([for iconv], am_cv_func_iconv, [ |
| 441 | | am_cv_func_iconv="no, consider installing GNU libiconv" |
| 442 | | am_cv_lib_iconv=no |
| 443 | | AC_TRY_LINK([#include <stdlib.h> |
| 444 | | #include <iconv.h>], |
| 445 | | [iconv_t cd = iconv_open("",""); |
| 446 | | iconv(cd,NULL,NULL,NULL,NULL); |
| 447 | | iconv_close(cd);], |
| 448 | | am_cv_func_iconv=yes) |
| 449 | | if test "$am_cv_func_iconv" != yes; then |
| 450 | | am_save_LIBS="$LIBS" |
| 451 | | LIBS="$LIBS $LIBICONV" |
| 452 | | AC_TRY_LINK([#include <stdlib.h> |
| 453 | | #include <iconv.h>], |
| 454 | | [iconv_t cd = iconv_open("",""); |
| 455 | | iconv(cd,NULL,NULL,NULL,NULL); |
| 456 | | iconv_close(cd);], |
| 457 | | am_cv_lib_iconv=yes |
| 458 | | am_cv_func_iconv=yes) |
| 459 | | LIBS="$am_save_LIBS" |
| 460 | | fi |
| 461 | | ]) |
| 462 | | if test "$am_cv_func_iconv" = yes; then |
| 463 | | AC_CACHE_CHECK([for working iconv], am_cv_func_iconv_works, [ |
| 464 | | dnl This tests against bugs in AIX 5.1 and HP-UX 11.11. |
| 465 | | am_save_LIBS="$LIBS" |
| 466 | | if test $am_cv_lib_iconv = yes; then |
| 467 | | LIBS="$LIBS $LIBICONV" |
| 468 | | fi |
| 469 | | AC_TRY_RUN([ |
| 470 | | #include <iconv.h> |
| 471 | | #include <string.h> |
| 472 | | int main () |
| 473 | | { |
| 474 | | /* Test against AIX 5.1 bug: Failures are not distinguishable from successful |
| 475 | | returns. */ |
| 476 | | { |
| 477 | | iconv_t cd_utf8_to_88591 = iconv_open ("ISO8859-1", "UTF-8"); |
| 478 | | if (cd_utf8_to_88591 != (iconv_t)(-1)) |
| 479 | | { |
| 480 | | static const char input[] = "\342\202\254"; /* EURO SIGN */ |
| 481 | | char buf[10]; |
| 482 | | const char *inptr = input; |
| 483 | | size_t inbytesleft = strlen (input); |
| 484 | | char *outptr = buf; |
| 485 | | size_t outbytesleft = sizeof (buf); |
| 486 | | size_t res = iconv (cd_utf8_to_88591, |
| 487 | | (char **) &inptr, &inbytesleft, |
| 488 | | &outptr, &outbytesleft); |
| 489 | | if (res == 0) |
| 490 | | return 1; |
| 491 | | } |
| 492 | | } |
| 493 | | #if 0 /* This bug could be worked around by the caller. */ |
| 494 | | /* Test against HP-UX 11.11 bug: Positive return value instead of 0. */ |
| 495 | | { |
| 496 | | iconv_t cd_88591_to_utf8 = iconv_open ("utf8", "iso88591"); |
| 497 | | if (cd_88591_to_utf8 != (iconv_t)(-1)) |
| 498 | | { |
| 499 | | static const char input[] = "\304rger mit b\366sen B\374bchen ohne Augenma\337"; |
| 500 | | char buf[50]; |
| 501 | | const char *inptr = input; |
| 502 | | size_t inbytesleft = strlen (input); |
| 503 | | char *outptr = buf; |
| 504 | | size_t outbytesleft = sizeof (buf); |
| 505 | | size_t res = iconv (cd_88591_to_utf8, |
| 506 | | (char **) &inptr, &inbytesleft, |
| 507 | | &outptr, &outbytesleft); |
| 508 | | if ((int)res > 0) |
| 509 | | return 1; |
| 510 | | } |
| 511 | | } |
| 512 | | #endif |
| 513 | | /* Test against HP-UX 11.11 bug: No converter from EUC-JP to UTF-8 is |
| 514 | | provided. */ |
| 515 | | if (/* Try standardized names. */ |
| 516 | | iconv_open ("UTF-8", "EUC-JP") == (iconv_t)(-1) |
| 517 | | /* Try IRIX, OSF/1 names. */ |
| 518 | | && iconv_open ("UTF-8", "eucJP") == (iconv_t)(-1) |
| 519 | | /* Try AIX names. */ |
| 520 | | && iconv_open ("UTF-8", "IBM-eucJP") == (iconv_t)(-1) |
| 521 | | /* Try HP-UX names. */ |
| 522 | | && iconv_open ("utf8", "eucJP") == (iconv_t)(-1)) |
| 523 | | return 1; |
| 524 | | return 0; |
| 525 | | }], [am_cv_func_iconv_works=yes], [am_cv_func_iconv_works=no], |
| 526 | | [case "$host_os" in |
| 527 | | aix* | hpux*) am_cv_func_iconv_works="guessing no" ;; |
| 528 | | *) am_cv_func_iconv_works="guessing yes" ;; |
| 529 | | esac]) |
| 530 | | LIBS="$am_save_LIBS" |
| 531 | | ]) |
| 532 | | case "$am_cv_func_iconv_works" in |
| 533 | | *no) am_func_iconv=no am_cv_lib_iconv=no ;; |
| 534 | | *) am_func_iconv=yes ;; |
| 535 | | esac |
| 536 | | else |
| 537 | | am_func_iconv=no am_cv_lib_iconv=no |
| 538 | | fi |
| 539 | | if test "$am_func_iconv" = yes; then |
| 540 | | AC_DEFINE(HAVE_ICONV, 1, |
| 541 | | [Define if you have the iconv() function and it works.]) |
| 542 | | fi |
| 543 | | if test "$am_cv_lib_iconv" = yes; then |
| 544 | | AC_MSG_CHECKING([how to link with libiconv]) |
| 545 | | AC_MSG_RESULT([$LIBICONV]) |
| 546 | | else |
| 547 | | dnl If $LIBICONV didn't lead to a usable library, we don't need $INCICONV |
| 548 | | dnl either. |
| 549 | | CPPFLAGS="$am_save_CPPFLAGS" |
| 550 | | LIBICONV= |
| 551 | | LTLIBICONV= |
| 552 | | fi |
| 553 | | AC_SUBST(LIBICONV) |
| 554 | | AC_SUBST(LTLIBICONV) |
| 555 | | ]) |
| 556 | | |
| 557 | | AC_DEFUN([AM_ICONV], |
| 558 | | [ |
| 559 | | AM_ICONV_LINK |
| 560 | | if test "$am_cv_func_iconv" = yes; then |
| 561 | | AC_MSG_CHECKING([for iconv declaration]) |
| 562 | | AC_CACHE_VAL(am_cv_proto_iconv, [ |
| 563 | | AC_TRY_COMPILE([ |
| 564 | | #include <stdlib.h> |
| 565 | | #include <iconv.h> |
| 566 | | extern |
| 567 | | #ifdef __cplusplus |
| 568 | | "C" |
| 569 | | #endif |
| 570 | | #if defined(__STDC__) || defined(__cplusplus) |
| 571 | | size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); |
| 572 | | #else |
| 573 | | size_t iconv(); |
| 574 | | #endif |
| 575 | | ], [], am_cv_proto_iconv_arg1="", am_cv_proto_iconv_arg1="const") |
| 576 | | am_cv_proto_iconv="extern size_t iconv (iconv_t cd, $am_cv_proto_iconv_arg1 char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);"]) |
| 577 | | am_cv_proto_iconv=`echo "[$]am_cv_proto_iconv" | tr -s ' ' | sed -e 's/( /(/'` |
| 578 | | AC_MSG_RESULT([$]{ac_t:- |
| 579 | | }[$]am_cv_proto_iconv) |
| 580 | | AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, |
| 581 | | [Define as const if the declaration of iconv() needs const.]) |
| 582 | | fi |
| 583 | | ]) |
| 584 | | |
| 585 | | # intlmacosx.m4 serial 1 (gettext-0.17) |
| 586 | | dnl Copyright (C) 2004-2007 Free Software Foundation, Inc. |
| 587 | | dnl This file is free software; the Free Software Foundation |
| 588 | | dnl gives unlimited permission to copy and/or distribute it, |
| 589 | | dnl with or without modifications, as long as this notice is preserved. |
| 590 | | dnl |
| 591 | | dnl This file can can be used in projects which are not available under |
| 592 | | dnl the GNU General Public License or the GNU Library General Public |
| 593 | | dnl License but which still want to provide support for the GNU gettext |
| 594 | | dnl functionality. |
| 595 | | dnl Please note that the actual code of the GNU gettext library is covered |
| 596 | | dnl by the GNU Library General Public License, and the rest of the GNU |
| 597 | | dnl gettext package package is covered by the GNU General Public License. |
| 598 | | dnl They are *not* in the public domain. |
| 599 | | |
| 600 | | dnl Checks for special options needed on MacOS X. |
| 601 | | dnl Defines INTL_MACOSX_LIBS. |
| 602 | | AC_DEFUN([gt_INTL_MACOSX], |
| 603 | | [ |
| 604 | | dnl Check for API introduced in MacOS X 10.2. |
| 605 | | AC_CACHE_CHECK([for CFPreferencesCopyAppValue], |
| 606 | | gt_cv_func_CFPreferencesCopyAppValue, |
| 607 | | [gt_save_LIBS="$LIBS" |
| 608 | | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" |
| 609 | | AC_TRY_LINK([#include <CoreFoundation/CFPreferences.h>], |
| 610 | | [CFPreferencesCopyAppValue(NULL, NULL)], |
| 611 | | [gt_cv_func_CFPreferencesCopyAppValue=yes], |
| 612 | | [gt_cv_func_CFPreferencesCopyAppValue=no]) |
| 613 | | LIBS="$gt_save_LIBS"]) |
| 614 | | if test $gt_cv_func_CFPreferencesCopyAppValue = yes; then |
| 615 | | AC_DEFINE([HAVE_CFPREFERENCESCOPYAPPVALUE], 1, |
| 616 | | [Define to 1 if you have the MacOS X function CFPreferencesCopyAppValue in the CoreFoundation framework.]) |
| 617 | | fi |
| 618 | | dnl Check for API introduced in MacOS X 10.3. |
| 619 | | AC_CACHE_CHECK([for CFLocaleCopyCurrent], gt_cv_func_CFLocaleCopyCurrent, |
| 620 | | [gt_save_LIBS="$LIBS" |
| 621 | | LIBS="$LIBS -Wl,-framework -Wl,CoreFoundation" |
| 622 | | AC_TRY_LINK([#include <CoreFoundation/CFLocale.h>], [CFLocaleCopyCurrent();], |
| 623 | | [gt_cv_func_CFLocaleCopyCurrent=yes], |
| 624 | | [gt_cv_func_CFLocaleCopyCurrent=no]) |
| 625 | | LIBS="$gt_save_LIBS"]) |
| 626 | | if test $gt_cv_func_CFLocaleCopyCurrent = yes; then |
| 627 | | AC_DEFINE([HAVE_CFLOCALECOPYCURRENT], 1, |
| 628 | | [Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the CoreFoundation framework.]) |
| 629 | | fi |
| 630 | | INTL_MACOSX_LIBS= |
| 631 | | if test $gt_cv_func_CFPreferencesCopyAppValue = yes || test $gt_cv_func_CFLocaleCopyCurrent = yes; then |
| 632 | | INTL_MACOSX_LIBS="-Wl,-framework -Wl,CoreFoundation" |
| 633 | | fi |
| 634 | | AC_SUBST([INTL_MACOSX_LIBS]) |
| 635 | | ]) |
| 636 | | |
| 637 | | # lib-ld.m4 serial 3 (gettext-0.13) |
| 638 | | dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. |
| 639 | | dnl This file is free software; the Free Software Foundation |
| 640 | | dnl gives unlimited permission to copy and/or distribute it, |
| 641 | | dnl with or without modifications, as long as this notice is preserved. |
| 642 | | |
| 643 | | dnl Subroutines of libtool.m4, |
| 644 | | dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision |
| 645 | | dnl with libtool.m4. |
| 646 | | |
| 647 | | dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. |
| 648 | | AC_DEFUN([AC_LIB_PROG_LD_GNU], |
| 649 | | [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, |
| 650 | | [# I'd rather use --version here, but apparently some GNU ld's only accept -v. |
| 651 | | case `$LD -v 2>&1 </dev/null` in |
| 652 | | *GNU* | *'with BFD'*) |
| 653 | | acl_cv_prog_gnu_ld=yes ;; |
| 654 | | *) |
| 655 | | acl_cv_prog_gnu_ld=no ;; |
| 656 | | esac]) |
| 657 | | with_gnu_ld=$acl_cv_prog_gnu_ld |
| 658 | | ]) |
| 659 | | |
| 660 | | dnl From libtool-1.4. Sets the variable LD. |
| 661 | | AC_DEFUN([AC_LIB_PROG_LD], |
| 662 | | [AC_ARG_WITH(gnu-ld, |
| 663 | | [ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], |
| 664 | | test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) |
| 665 | | AC_REQUIRE([AC_PROG_CC])dnl |
| 666 | | AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 667 | | # Prepare PATH_SEPARATOR. |
| 668 | | # The user is always right. |
| 669 | | if test "${PATH_SEPARATOR+set}" != set; then |
| 670 | | echo "#! /bin/sh" >conf$$.sh |
| 671 | | echo "exit 0" >>conf$$.sh |
| 672 | | chmod +x conf$$.sh |
| 673 | | if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then |
| 674 | | PATH_SEPARATOR=';' |
| 675 | | else |
| 676 | | PATH_SEPARATOR=: |
| 677 | | fi |
| 678 | | rm -f conf$$.sh |
| 679 | | fi |
| 680 | | ac_prog=ld |
| 681 | | if test "$GCC" = yes; then |
| 682 | | # Check if gcc -print-prog-name=ld gives a path. |
| 683 | | AC_MSG_CHECKING([for ld used by GCC]) |
| 684 | | case $host in |
| 685 | | *-*-mingw*) |
| 686 | | # gcc leaves a trailing carriage return which upsets mingw |
| 687 | | ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; |
| 688 | | *) |
| 689 | | ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; |
| 690 | | esac |
| 691 | | case $ac_prog in |
| 692 | | # Accept absolute paths. |
| 693 | | [[\\/]* | [A-Za-z]:[\\/]*)] |
| 694 | | [re_direlt='/[^/][^/]*/\.\./'] |
| 695 | | # Canonicalize the path of ld |
| 696 | | ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` |
| 697 | | while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do |
| 698 | | ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` |
| 699 | | done |
| 700 | | test -z "$LD" && LD="$ac_prog" |
| 701 | | ;; |
| 702 | | "") |
| 703 | | # If it fails, then pretend we aren't using GCC. |
| 704 | | ac_prog=ld |
| 705 | | ;; |
| 706 | | *) |
| 707 | | # If it is relative, then search for the first ld in PATH. |
| 708 | | with_gnu_ld=unknown |
| 709 | | ;; |
| 710 | | esac |
| 711 | | elif test "$with_gnu_ld" = yes; then |
| 712 | | AC_MSG_CHECKING([for GNU ld]) |
| 713 | | else |
| 714 | | AC_MSG_CHECKING([for non-GNU ld]) |
| 715 | | fi |
| 716 | | AC_CACHE_VAL(acl_cv_path_LD, |
| 717 | | [if test -z "$LD"; then |
| 718 | | IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" |
| 719 | | for ac_dir in $PATH; do |
| 720 | | test -z "$ac_dir" && ac_dir=. |
| 721 | | if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then |
| 722 | | acl_cv_path_LD="$ac_dir/$ac_prog" |
| 723 | | # Check to see if the program is GNU ld. I'd rather use --version, |
| 724 | | # but apparently some GNU ld's only accept -v. |
| 725 | | # Break only if it was the GNU/non-GNU ld that we prefer. |
| 726 | | case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in |
| 727 | | *GNU* | *'with BFD'*) |
| 728 | | test "$with_gnu_ld" != no && break ;; |
| 729 | | *) |
| 730 | | test "$with_gnu_ld" != yes && break ;; |
| 731 | | esac |
| 732 | | fi |
| 733 | | done |
| 734 | | IFS="$ac_save_ifs" |
| 735 | | else |
| 736 | | acl_cv_path_LD="$LD" # Let the user override the test with a path. |
| 737 | | fi]) |
| 738 | | LD="$acl_cv_path_LD" |
| 739 | | if test -n "$LD"; then |
| 740 | | AC_MSG_RESULT($LD) |
| 741 | | else |
| 742 | | AC_MSG_RESULT(no) |
| 743 | | fi |
| 744 | | test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) |
| 745 | | AC_LIB_PROG_LD_GNU |
| 746 | | ]) |
| 747 | | |
| 748 | | # lib-link.m4 serial 13 (gettext-0.17) |
| 749 | | dnl Copyright (C) 2001-2007 Free Software Foundation, Inc. |
| 750 | | dnl This file is free software; the Free Software Foundation |
| 751 | | dnl gives unlimited permission to copy and/or distribute it, |
| 752 | | dnl with or without modifications, as long as this notice is preserved. |
| 753 | | |
| 754 | | dnl From Bruno Haible. |
| 755 | | |
| 756 | | AC_PREREQ(2.54) |
| 757 | | |
| 758 | | dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and |
| 759 | | dnl the libraries corresponding to explicit and implicit dependencies. |
| 760 | | dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and |
| 761 | | dnl augments the CPPFLAGS variable. |
| 762 | | dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname |
| 763 | | dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. |
| 764 | | AC_DEFUN([AC_LIB_LINKFLAGS], |
| 765 | | [ |
| 766 | | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 767 | | AC_REQUIRE([AC_LIB_RPATH]) |
| 768 | | define([Name],[translit([$1],[./-], [___])]) |
| 769 | | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 770 | | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 771 | | AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ |
| 772 | | AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 773 | | ac_cv_lib[]Name[]_libs="$LIB[]NAME" |
| 774 | | ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" |
| 775 | | ac_cv_lib[]Name[]_cppflags="$INC[]NAME" |
| 776 | | ac_cv_lib[]Name[]_prefix="$LIB[]NAME[]_PREFIX" |
| 777 | | ]) |
| 778 | | LIB[]NAME="$ac_cv_lib[]Name[]_libs" |
| 779 | | LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" |
| 780 | | INC[]NAME="$ac_cv_lib[]Name[]_cppflags" |
| 781 | | LIB[]NAME[]_PREFIX="$ac_cv_lib[]Name[]_prefix" |
| 782 | | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 783 | | AC_SUBST([LIB]NAME) |
| 784 | | AC_SUBST([LTLIB]NAME) |
| 785 | | AC_SUBST([LIB]NAME[_PREFIX]) |
| 786 | | dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the |
| 787 | | dnl results of this search when this library appears as a dependency. |
| 788 | | HAVE_LIB[]NAME=yes |
| 789 | | undefine([Name]) |
| 790 | | undefine([NAME]) |
| 791 | | ]) |
| 792 | | |
| 793 | | dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) |
| 794 | | dnl searches for libname and the libraries corresponding to explicit and |
| 795 | | dnl implicit dependencies, together with the specified include files and |
| 796 | | dnl the ability to compile and link the specified testcode. If found, it |
| 797 | | dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and |
| 798 | | dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and |
| 799 | | dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs |
| 800 | | dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. |
| 801 | | dnl Sets and AC_SUBSTs the LIB${NAME}_PREFIX variable to nonempty if libname |
| 802 | | dnl was found in ${LIB${NAME}_PREFIX}/$acl_libdirstem. |
| 803 | | AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], |
| 804 | | [ |
| 805 | | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 806 | | AC_REQUIRE([AC_LIB_RPATH]) |
| 807 | | define([Name],[translit([$1],[./-], [___])]) |
| 808 | | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 809 | | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 810 | | |
| 811 | | dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME |
| 812 | | dnl accordingly. |
| 813 | | AC_LIB_LINKFLAGS_BODY([$1], [$2]) |
| 814 | | |
| 815 | | dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, |
| 816 | | dnl because if the user has installed lib[]Name and not disabled its use |
| 817 | | dnl via --without-lib[]Name-prefix, he wants to use it. |
| 818 | | ac_save_CPPFLAGS="$CPPFLAGS" |
| 819 | | AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) |
| 820 | | |
| 821 | | AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ |
| 822 | | ac_save_LIBS="$LIBS" |
| 823 | | LIBS="$LIBS $LIB[]NAME" |
| 824 | | AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) |
| 825 | | LIBS="$ac_save_LIBS" |
| 826 | | ]) |
| 827 | | if test "$ac_cv_lib[]Name" = yes; then |
| 828 | | HAVE_LIB[]NAME=yes |
| 829 | | AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) |
| 830 | | AC_MSG_CHECKING([how to link with lib[]$1]) |
| 831 | | AC_MSG_RESULT([$LIB[]NAME]) |
| 832 | | else |
| 833 | | HAVE_LIB[]NAME=no |
| 834 | | dnl If $LIB[]NAME didn't lead to a usable library, we don't need |
| 835 | | dnl $INC[]NAME either. |
| 836 | | CPPFLAGS="$ac_save_CPPFLAGS" |
| 837 | | LIB[]NAME= |
| 838 | | LTLIB[]NAME= |
| 839 | | LIB[]NAME[]_PREFIX= |
| 840 | | fi |
| 841 | | AC_SUBST([HAVE_LIB]NAME) |
| 842 | | AC_SUBST([LIB]NAME) |
| 843 | | AC_SUBST([LTLIB]NAME) |
| 844 | | AC_SUBST([LIB]NAME[_PREFIX]) |
| 845 | | undefine([Name]) |
| 846 | | undefine([NAME]) |
| 847 | | ]) |
| 848 | | |
| 849 | | dnl Determine the platform dependent parameters needed to use rpath: |
| 850 | | dnl acl_libext, |
| 851 | | dnl acl_shlibext, |
| 852 | | dnl acl_hardcode_libdir_flag_spec, |
| 853 | | dnl acl_hardcode_libdir_separator, |
| 854 | | dnl acl_hardcode_direct, |
| 855 | | dnl acl_hardcode_minus_L. |
| 856 | | AC_DEFUN([AC_LIB_RPATH], |
| 857 | | [ |
| 858 | | dnl Tell automake >= 1.10 to complain if config.rpath is missing. |
| 859 | | m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([config.rpath])]) |
| 860 | | AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS |
| 861 | | AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld |
| 862 | | AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host |
| 863 | | AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir |
| 864 | | AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ |
| 865 | | CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ |
| 866 | | ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh |
| 867 | | . ./conftest.sh |
| 868 | | rm -f ./conftest.sh |
| 869 | | acl_cv_rpath=done |
| 870 | | ]) |
| 871 | | wl="$acl_cv_wl" |
| 872 | | acl_libext="$acl_cv_libext" |
| 873 | | acl_shlibext="$acl_cv_shlibext" |
| 874 | | acl_libname_spec="$acl_cv_libname_spec" |
| 875 | | acl_library_names_spec="$acl_cv_library_names_spec" |
| 876 | | acl_hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" |
| 877 | | acl_hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" |
| 878 | | acl_hardcode_direct="$acl_cv_hardcode_direct" |
| 879 | | acl_hardcode_minus_L="$acl_cv_hardcode_minus_L" |
| 880 | | dnl Determine whether the user wants rpath handling at all. |
| 881 | | AC_ARG_ENABLE(rpath, |
| 882 | | [ --disable-rpath do not hardcode runtime library paths], |
| 883 | | :, enable_rpath=yes) |
| 884 | | ]) |
| 885 | | |
| 886 | | dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and |
| 887 | | dnl the libraries corresponding to explicit and implicit dependencies. |
| 888 | | dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. |
| 889 | | dnl Also, sets the LIB${NAME}_PREFIX variable to nonempty if libname was found |
| 890 | | dnl in ${LIB${NAME}_PREFIX}/$acl_libdirstem. |
| 891 | | AC_DEFUN([AC_LIB_LINKFLAGS_BODY], |
| 892 | | [ |
| 893 | | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
| 894 | | define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], |
| 895 | | [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) |
| 896 | | dnl Autoconf >= 2.61 supports dots in --with options. |
| 897 | | define([N_A_M_E],[m4_if(m4_version_compare(m4_defn([m4_PACKAGE_VERSION]),[2.61]),[-1],[translit([$1],[.],[_])],[$1])]) |
| 898 | | dnl By default, look in $includedir and $libdir. |
| 899 | | use_additional=yes |
| 900 | | AC_LIB_WITH_FINAL_PREFIX([ |
| 901 | | eval additional_includedir=\"$includedir\" |
| 902 | | eval additional_libdir=\"$libdir\" |
| 903 | | ]) |
| 904 | | AC_LIB_ARG_WITH([lib]N_A_M_E[-prefix], |
| 905 | | [ --with-lib]N_A_M_E[-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib |
| 906 | | --without-lib]N_A_M_E[-prefix don't search for lib$1 in includedir and libdir], |
| 907 | | [ |
| 908 | | if test "X$withval" = "Xno"; then |
| 909 | | use_additional=no |
| 910 | | else |
| 911 | | if test "X$withval" = "X"; then |
| 912 | | AC_LIB_WITH_FINAL_PREFIX([ |
| 913 | | eval additional_includedir=\"$includedir\" |
| 914 | | eval additional_libdir=\"$libdir\" |
| 915 | | ]) |
| 916 | | else |
| 917 | | additional_includedir="$withval/include" |
| 918 | | additional_libdir="$withval/$acl_libdirstem" |
| 919 | | fi |
| 920 | | fi |
| 921 | | ]) |
| 922 | | dnl Search the library and its dependencies in $additional_libdir and |
| 923 | | dnl $LDFLAGS. Using breadth-first-seach. |
| 924 | | LIB[]NAME= |
| 925 | | LTLIB[]NAME= |
| 926 | | INC[]NAME= |
| 927 | | LIB[]NAME[]_PREFIX= |
| 928 | | rpathdirs= |
| 929 | | ltrpathdirs= |
| 930 | | names_already_handled= |
| 931 | | names_next_round='$1 $2' |
| 932 | | while test -n "$names_next_round"; do |
| 933 | | names_this_round="$names_next_round" |
| 934 | | names_next_round= |
| 935 | | for name in $names_this_round; do |
| 936 | | already_handled= |
| 937 | | for n in $names_already_handled; do |
| 938 | | if test "$n" = "$name"; then |
| 939 | | already_handled=yes |
| 940 | | break |
| 941 | | fi |
| 942 | | done |
| 943 | | if test -z "$already_handled"; then |
| 944 | | names_already_handled="$names_already_handled $name" |
| 945 | | dnl See if it was already located by an earlier AC_LIB_LINKFLAGS |
| 946 | | dnl or AC_LIB_HAVE_LINKFLAGS call. |
| 947 | | uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` |
| 948 | | eval value=\"\$HAVE_LIB$uppername\" |
| 949 | | if test -n "$value"; then |
| 950 | | if test "$value" = yes; then |
| 951 | | eval value=\"\$LIB$uppername\" |
| 952 | | test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" |
| 953 | | eval value=\"\$LTLIB$uppername\" |
| 954 | | test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" |
| 955 | | else |
| 956 | | dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined |
| 957 | | dnl that this library doesn't exist. So just drop it. |
| 958 | | : |
| 959 | | fi |
| 960 | | else |
| 961 | | dnl Search the library lib$name in $additional_libdir and $LDFLAGS |
| 962 | | dnl and the already constructed $LIBNAME/$LTLIBNAME. |
| 963 | | found_dir= |
| 964 | | found_la= |
| 965 | | found_so= |
| 966 | | found_a= |
| 967 | | eval libname=\"$acl_libname_spec\" # typically: libname=lib$name |
| 968 | | if test -n "$acl_shlibext"; then |
| 969 | | shrext=".$acl_shlibext" # typically: shrext=.so |
| 970 | | else |
| 971 | | shrext= |
| 972 | | fi |
| 973 | | if test $use_additional = yes; then |
| 974 | | dir="$additional_libdir" |
| 975 | | dnl The same code as in the loop below: |
| 976 | | dnl First look for a shared library. |
| 977 | | if test -n "$acl_shlibext"; then |
| 978 | | if test -f "$dir/$libname$shrext"; then |
| 979 | | found_dir="$dir" |
| 980 | | found_so="$dir/$libname$shrext" |
| 981 | | else |
| 982 | | if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
| 983 | | ver=`(cd "$dir" && \ |
| 984 | | for f in "$libname$shrext".*; do echo "$f"; done \ |
| 985 | | | sed -e "s,^$libname$shrext\\\\.,," \ |
| 986 | | | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ |
| 987 | | | sed 1q ) 2>/dev/null` |
| 988 | | if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then |
| 989 | | found_dir="$dir" |
| 990 | | found_so="$dir/$libname$shrext.$ver" |
| 991 | | fi |
| 992 | | else |
| 993 | | eval library_names=\"$acl_library_names_spec\" |
| 994 | | for f in $library_names; do |
| 995 | | if test -f "$dir/$f"; then |
| 996 | | found_dir="$dir" |
| 997 | | found_so="$dir/$f" |
| 998 | | break |
| 999 | | fi |
| 1000 | | done |
| 1001 | | fi |
| 1002 | | fi |
| 1003 | | fi |
| 1004 | | dnl Then look for a static library. |
| 1005 | | if test "X$found_dir" = "X"; then |
| 1006 | | if test -f "$dir/$libname.$acl_libext"; then |
| 1007 | | found_dir="$dir" |
| 1008 | | found_a="$dir/$libname.$acl_libext" |
| 1009 | | fi |
| 1010 | | fi |
| 1011 | | if test "X$found_dir" != "X"; then |
| 1012 | | if test -f "$dir/$libname.la"; then |
| 1013 | | found_la="$dir/$libname.la" |
| 1014 | | fi |
| 1015 | | fi |
| 1016 | | fi |
| 1017 | | if test "X$found_dir" = "X"; then |
| 1018 | | for x in $LDFLAGS $LTLIB[]NAME; do |
| 1019 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1020 | | case "$x" in |
| 1021 | | -L*) |
| 1022 | | dir=`echo "X$x" | sed -e 's/^X-L//'` |
| 1023 | | dnl First look for a shared library. |
| 1024 | | if test -n "$acl_shlibext"; then |
| 1025 | | if test -f "$dir/$libname$shrext"; then |
| 1026 | | found_dir="$dir" |
| 1027 | | found_so="$dir/$libname$shrext" |
| 1028 | | else |
| 1029 | | if test "$acl_library_names_spec" = '$libname$shrext$versuffix'; then |
| 1030 | | ver=`(cd "$dir" && \ |
| 1031 | | for f in "$libname$shrext".*; do echo "$f"; done \ |
| 1032 | | | sed -e "s,^$libname$shrext\\\\.,," \ |
| 1033 | | | sort -t '.' -n -r -k1,1 -k2,2 -k3,3 -k4,4 -k5,5 \ |
| 1034 | | | sed 1q ) 2>/dev/null` |
| 1035 | | if test -n "$ver" && test -f "$dir/$libname$shrext.$ver"; then |
| 1036 | | found_dir="$dir" |
| 1037 | | found_so="$dir/$libname$shrext.$ver" |
| 1038 | | fi |
| 1039 | | else |
| 1040 | | eval library_names=\"$acl_library_names_spec\" |
| 1041 | | for f in $library_names; do |
| 1042 | | if test -f "$dir/$f"; then |
| 1043 | | found_dir="$dir" |
| 1044 | | found_so="$dir/$f" |
| 1045 | | break |
| 1046 | | fi |
| 1047 | | done |
| 1048 | | fi |
| 1049 | | fi |
| 1050 | | fi |
| 1051 | | dnl Then look for a static library. |
| 1052 | | if test "X$found_dir" = "X"; then |
| 1053 | | if test -f "$dir/$libname.$acl_libext"; then |
| 1054 | | found_dir="$dir" |
| 1055 | | found_a="$dir/$libname.$acl_libext" |
| 1056 | | fi |
| 1057 | | fi |
| 1058 | | if test "X$found_dir" != "X"; then |
| 1059 | | if test -f "$dir/$libname.la"; then |
| 1060 | | found_la="$dir/$libname.la" |
| 1061 | | fi |
| 1062 | | fi |
| 1063 | | ;; |
| 1064 | | esac |
| 1065 | | if test "X$found_dir" != "X"; then |
| 1066 | | break |
| 1067 | | fi |
| 1068 | | done |
| 1069 | | fi |
| 1070 | | if test "X$found_dir" != "X"; then |
| 1071 | | dnl Found the library. |
| 1072 | | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" |
| 1073 | | if test "X$found_so" != "X"; then |
| 1074 | | dnl Linking with a shared library. We attempt to hardcode its |
| 1075 | | dnl directory into the executable's runpath, unless it's the |
| 1076 | | dnl standard /usr/lib. |
| 1077 | | if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/$acl_libdirstem"; then |
| 1078 | | dnl No hardcoding is needed. |
| 1079 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1080 | | else |
| 1081 | | dnl Use an explicit option to hardcode DIR into the resulting |
| 1082 | | dnl binary. |
| 1083 | | dnl Potentially add DIR to ltrpathdirs. |
| 1084 | | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 1085 | | haveit= |
| 1086 | | for x in $ltrpathdirs; do |
| 1087 | | if test "X$x" = "X$found_dir"; then |
| 1088 | | haveit=yes |
| 1089 | | break |
| 1090 | | fi |
| 1091 | | done |
| 1092 | | if test -z "$haveit"; then |
| 1093 | | ltrpathdirs="$ltrpathdirs $found_dir" |
| 1094 | | fi |
| 1095 | | dnl The hardcoding into $LIBNAME is system dependent. |
| 1096 | | if test "$acl_hardcode_direct" = yes; then |
| 1097 | | dnl Using DIR/libNAME.so during linking hardcodes DIR into the |
| 1098 | | dnl resulting binary. |
| 1099 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1100 | | else |
| 1101 | | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then |
| 1102 | | dnl Use an explicit option to hardcode DIR into the resulting |
| 1103 | | dnl binary. |
| 1104 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1105 | | dnl Potentially add DIR to rpathdirs. |
| 1106 | | dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 1107 | | haveit= |
| 1108 | | for x in $rpathdirs; do |
| 1109 | | if test "X$x" = "X$found_dir"; then |
| 1110 | | haveit=yes |
| 1111 | | break |
| 1112 | | fi |
| 1113 | | done |
| 1114 | | if test -z "$haveit"; then |
| 1115 | | rpathdirs="$rpathdirs $found_dir" |
| 1116 | | fi |
| 1117 | | else |
| 1118 | | dnl Rely on "-L$found_dir". |
| 1119 | | dnl But don't add it if it's already contained in the LDFLAGS |
| 1120 | | dnl or the already constructed $LIBNAME |
| 1121 | | haveit= |
| 1122 | | for x in $LDFLAGS $LIB[]NAME; do |
| 1123 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1124 | | if test "X$x" = "X-L$found_dir"; then |
| 1125 | | haveit=yes |
| 1126 | | break |
| 1127 | | fi |
| 1128 | | done |
| 1129 | | if test -z "$haveit"; then |
| 1130 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" |
| 1131 | | fi |
| 1132 | | if test "$acl_hardcode_minus_L" != no; then |
| 1133 | | dnl FIXME: Not sure whether we should use |
| 1134 | | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1135 | | dnl here. |
| 1136 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" |
| 1137 | | else |
| 1138 | | dnl We cannot use $acl_hardcode_runpath_var and LD_RUN_PATH |
| 1139 | | dnl here, because this doesn't fit in flags passed to the |
| 1140 | | dnl compiler. So give up. No hardcoding. This affects only |
| 1141 | | dnl very old systems. |
| 1142 | | dnl FIXME: Not sure whether we should use |
| 1143 | | dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" |
| 1144 | | dnl here. |
| 1145 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1146 | | fi |
| 1147 | | fi |
| 1148 | | fi |
| 1149 | | fi |
| 1150 | | else |
| 1151 | | if test "X$found_a" != "X"; then |
| 1152 | | dnl Linking with a static library. |
| 1153 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" |
| 1154 | | else |
| 1155 | | dnl We shouldn't come here, but anyway it's good to have a |
| 1156 | | dnl fallback. |
| 1157 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" |
| 1158 | | fi |
| 1159 | | fi |
| 1160 | | dnl Assume the include files are nearby. |
| 1161 | | additional_includedir= |
| 1162 | | case "$found_dir" in |
| 1163 | | */$acl_libdirstem | */$acl_libdirstem/) |
| 1164 | | basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e "s,/$acl_libdirstem/"'*$,,'` |
| 1165 | | LIB[]NAME[]_PREFIX="$basedir" |
| 1166 | | additional_includedir="$basedir/include" |
| 1167 | | ;; |
| 1168 | | esac |
| 1169 | | if test "X$additional_includedir" != "X"; then |
| 1170 | | dnl Potentially add $additional_includedir to $INCNAME. |
| 1171 | | dnl But don't add it |
| 1172 | | dnl 1. if it's the standard /usr/include, |
| 1173 | | dnl 2. if it's /usr/local/include and we are using GCC on Linux, |
| 1174 | | dnl 3. if it's already present in $CPPFLAGS or the already |
| 1175 | | dnl constructed $INCNAME, |
| 1176 | | dnl 4. if it doesn't exist as a directory. |
| 1177 | | if test "X$additional_includedir" != "X/usr/include"; then |
| 1178 | | haveit= |
| 1179 | | if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1180 | | if test -n "$GCC"; then |
| 1181 | | case $host_os in |
| 1182 | | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
| 1183 | | esac |
| 1184 | | fi |
| 1185 | | fi |
| 1186 | | if test -z "$haveit"; then |
| 1187 | | for x in $CPPFLAGS $INC[]NAME; do |
| 1188 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1189 | | if test "X$x" = "X-I$additional_includedir"; then |
| 1190 | | haveit=yes |
| 1191 | | break |
| 1192 | | fi |
| 1193 | | done |
| 1194 | | if test -z "$haveit"; then |
| 1195 | | if test -d "$additional_includedir"; then |
| 1196 | | dnl Really add $additional_includedir to $INCNAME. |
| 1197 | | INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" |
| 1198 | | fi |
| 1199 | | fi |
| 1200 | | fi |
| 1201 | | fi |
| 1202 | | fi |
| 1203 | | dnl Look for dependencies. |
| 1204 | | if test -n "$found_la"; then |
| 1205 | | dnl Read the .la file. It defines the variables |
| 1206 | | dnl dlname, library_names, old_library, dependency_libs, current, |
| 1207 | | dnl age, revision, installed, dlopen, dlpreopen, libdir. |
| 1208 | | save_libdir="$libdir" |
| 1209 | | case "$found_la" in |
| 1210 | | */* | *\\*) . "$found_la" ;; |
| 1211 | | *) . "./$found_la" ;; |
| 1212 | | esac |
| 1213 | | libdir="$save_libdir" |
| 1214 | | dnl We use only dependency_libs. |
| 1215 | | for dep in $dependency_libs; do |
| 1216 | | case "$dep" in |
| 1217 | | -L*) |
| 1218 | | additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` |
| 1219 | | dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. |
| 1220 | | dnl But don't add it |
| 1221 | | dnl 1. if it's the standard /usr/lib, |
| 1222 | | dnl 2. if it's /usr/local/lib and we are using GCC on Linux, |
| 1223 | | dnl 3. if it's already present in $LDFLAGS or the already |
| 1224 | | dnl constructed $LIBNAME, |
| 1225 | | dnl 4. if it doesn't exist as a directory. |
| 1226 | | if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
| 1227 | | haveit= |
| 1228 | | if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
| 1229 | | if test -n "$GCC"; then |
| 1230 | | case $host_os in |
| 1231 | | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
| 1232 | | esac |
| 1233 | | fi |
| 1234 | | fi |
| 1235 | | if test -z "$haveit"; then |
| 1236 | | haveit= |
| 1237 | | for x in $LDFLAGS $LIB[]NAME; do |
| 1238 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1239 | | if test "X$x" = "X-L$additional_libdir"; then |
| 1240 | | haveit=yes |
| 1241 | | break |
| 1242 | | fi |
| 1243 | | done |
| 1244 | | if test -z "$haveit"; then |
| 1245 | | if test -d "$additional_libdir"; then |
| 1246 | | dnl Really add $additional_libdir to $LIBNAME. |
| 1247 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" |
| 1248 | | fi |
| 1249 | | fi |
| 1250 | | haveit= |
| 1251 | | for x in $LDFLAGS $LTLIB[]NAME; do |
| 1252 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1253 | | if test "X$x" = "X-L$additional_libdir"; then |
| 1254 | | haveit=yes |
| 1255 | | break |
| 1256 | | fi |
| 1257 | | done |
| 1258 | | if test -z "$haveit"; then |
| 1259 | | if test -d "$additional_libdir"; then |
| 1260 | | dnl Really add $additional_libdir to $LTLIBNAME. |
| 1261 | | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" |
| 1262 | | fi |
| 1263 | | fi |
| 1264 | | fi |
| 1265 | | fi |
| 1266 | | ;; |
| 1267 | | -R*) |
| 1268 | | dir=`echo "X$dep" | sed -e 's/^X-R//'` |
| 1269 | | if test "$enable_rpath" != no; then |
| 1270 | | dnl Potentially add DIR to rpathdirs. |
| 1271 | | dnl The rpathdirs will be appended to $LIBNAME at the end. |
| 1272 | | haveit= |
| 1273 | | for x in $rpathdirs; do |
| 1274 | | if test "X$x" = "X$dir"; then |
| 1275 | | haveit=yes |
| 1276 | | break |
| 1277 | | fi |
| 1278 | | done |
| 1279 | | if test -z "$haveit"; then |
| 1280 | | rpathdirs="$rpathdirs $dir" |
| 1281 | | fi |
| 1282 | | dnl Potentially add DIR to ltrpathdirs. |
| 1283 | | dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. |
| 1284 | | haveit= |
| 1285 | | for x in $ltrpathdirs; do |
| 1286 | | if test "X$x" = "X$dir"; then |
| 1287 | | haveit=yes |
| 1288 | | break |
| 1289 | | fi |
| 1290 | | done |
| 1291 | | if test -z "$haveit"; then |
| 1292 | | ltrpathdirs="$ltrpathdirs $dir" |
| 1293 | | fi |
| 1294 | | fi |
| 1295 | | ;; |
| 1296 | | -l*) |
| 1297 | | dnl Handle this in the next round. |
| 1298 | | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` |
| 1299 | | ;; |
| 1300 | | *.la) |
| 1301 | | dnl Handle this in the next round. Throw away the .la's |
| 1302 | | dnl directory; it is already contained in a preceding -L |
| 1303 | | dnl option. |
| 1304 | | names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` |
| 1305 | | ;; |
| 1306 | | *) |
| 1307 | | dnl Most likely an immediate library name. |
| 1308 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" |
| 1309 | | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" |
| 1310 | | ;; |
| 1311 | | esac |
| 1312 | | done |
| 1313 | | fi |
| 1314 | | else |
| 1315 | | dnl Didn't find the library; assume it is in the system directories |
| 1316 | | dnl known to the linker and runtime loader. (All the system |
| 1317 | | dnl directories known to the linker should also be known to the |
| 1318 | | dnl runtime loader, otherwise the system is severely misconfigured.) |
| 1319 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" |
| 1320 | | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" |
| 1321 | | fi |
| 1322 | | fi |
| 1323 | | fi |
| 1324 | | done |
| 1325 | | done |
| 1326 | | if test "X$rpathdirs" != "X"; then |
| 1327 | | if test -n "$acl_hardcode_libdir_separator"; then |
| 1328 | | dnl Weird platform: only the last -rpath option counts, the user must |
| 1329 | | dnl pass all path elements in one option. We can arrange that for a |
| 1330 | | dnl single library, but not when more than one $LIBNAMEs are used. |
| 1331 | | alldirs= |
| 1332 | | for found_dir in $rpathdirs; do |
| 1333 | | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$found_dir" |
| 1334 | | done |
| 1335 | | dnl Note: acl_hardcode_libdir_flag_spec uses $libdir and $wl. |
| 1336 | | acl_save_libdir="$libdir" |
| 1337 | | libdir="$alldirs" |
| 1338 | | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
| 1339 | | libdir="$acl_save_libdir" |
| 1340 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1341 | | else |
| 1342 | | dnl The -rpath options are cumulative. |
| 1343 | | for found_dir in $rpathdirs; do |
| 1344 | | acl_save_libdir="$libdir" |
| 1345 | | libdir="$found_dir" |
| 1346 | | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
| 1347 | | libdir="$acl_save_libdir" |
| 1348 | | LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" |
| 1349 | | done |
| 1350 | | fi |
| 1351 | | fi |
| 1352 | | if test "X$ltrpathdirs" != "X"; then |
| 1353 | | dnl When using libtool, the option that works for both libraries and |
| 1354 | | dnl executables is -R. The -R options are cumulative. |
| 1355 | | for found_dir in $ltrpathdirs; do |
| 1356 | | LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" |
| 1357 | | done |
| 1358 | | fi |
| 1359 | | ]) |
| 1360 | | |
| 1361 | | dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, |
| 1362 | | dnl unless already present in VAR. |
| 1363 | | dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes |
| 1364 | | dnl contains two or three consecutive elements that belong together. |
| 1365 | | AC_DEFUN([AC_LIB_APPENDTOVAR], |
| 1366 | | [ |
| 1367 | | for element in [$2]; do |
| 1368 | | haveit= |
| 1369 | | for x in $[$1]; do |
| 1370 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1371 | | if test "X$x" = "X$element"; then |
| 1372 | | haveit=yes |
| 1373 | | break |
| 1374 | | fi |
| 1375 | | done |
| 1376 | | if test -z "$haveit"; then |
| 1377 | | [$1]="${[$1]}${[$1]:+ }$element" |
| 1378 | | fi |
| 1379 | | done |
| 1380 | | ]) |
| 1381 | | |
| 1382 | | dnl For those cases where a variable contains several -L and -l options |
| 1383 | | dnl referring to unknown libraries and directories, this macro determines the |
| 1384 | | dnl necessary additional linker options for the runtime path. |
| 1385 | | dnl AC_LIB_LINKFLAGS_FROM_LIBS([LDADDVAR], [LIBSVALUE], [USE-LIBTOOL]) |
| 1386 | | dnl sets LDADDVAR to linker options needed together with LIBSVALUE. |
| 1387 | | dnl If USE-LIBTOOL evaluates to non-empty, linking with libtool is assumed, |
| 1388 | | dnl otherwise linking without libtool is assumed. |
| 1389 | | AC_DEFUN([AC_LIB_LINKFLAGS_FROM_LIBS], |
| 1390 | | [ |
| 1391 | | AC_REQUIRE([AC_LIB_RPATH]) |
| 1392 | | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
| 1393 | | $1= |
| 1394 | | if test "$enable_rpath" != no; then |
| 1395 | | if test -n "$acl_hardcode_libdir_flag_spec" && test "$acl_hardcode_minus_L" = no; then |
| 1396 | | dnl Use an explicit option to hardcode directories into the resulting |
| 1397 | | dnl binary. |
| 1398 | | rpathdirs= |
| 1399 | | next= |
| 1400 | | for opt in $2; do |
| 1401 | | if test -n "$next"; then |
| 1402 | | dir="$next" |
| 1403 | | dnl No need to hardcode the standard /usr/lib. |
| 1404 | | if test "X$dir" != "X/usr/$acl_libdirstem"; then |
| 1405 | | rpathdirs="$rpathdirs $dir" |
| 1406 | | fi |
| 1407 | | next= |
| 1408 | | else |
| 1409 | | case $opt in |
| 1410 | | -L) next=yes ;; |
| 1411 | | -L*) dir=`echo "X$opt" | sed -e 's,^X-L,,'` |
| 1412 | | dnl No need to hardcode the standard /usr/lib. |
| 1413 | | if test "X$dir" != "X/usr/$acl_libdirstem"; then |
| 1414 | | rpathdirs="$rpathdirs $dir" |
| 1415 | | fi |
| 1416 | | next= ;; |
| 1417 | | *) next= ;; |
| 1418 | | esac |
| 1419 | | fi |
| 1420 | | done |
| 1421 | | if test "X$rpathdirs" != "X"; then |
| 1422 | | if test -n ""$3""; then |
| 1423 | | dnl libtool is used for linking. Use -R options. |
| 1424 | | for dir in $rpathdirs; do |
| 1425 | | $1="${$1}${$1:+ }-R$dir" |
| 1426 | | done |
| 1427 | | else |
| 1428 | | dnl The linker is used for linking directly. |
| 1429 | | if test -n "$acl_hardcode_libdir_separator"; then |
| 1430 | | dnl Weird platform: only the last -rpath option counts, the user |
| 1431 | | dnl must pass all path elements in one option. |
| 1432 | | alldirs= |
| 1433 | | for dir in $rpathdirs; do |
| 1434 | | alldirs="${alldirs}${alldirs:+$acl_hardcode_libdir_separator}$dir" |
| 1435 | | done |
| 1436 | | acl_save_libdir="$libdir" |
| 1437 | | libdir="$alldirs" |
| 1438 | | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
| 1439 | | libdir="$acl_save_libdir" |
| 1440 | | $1="$flag" |
| 1441 | | else |
| 1442 | | dnl The -rpath options are cumulative. |
| 1443 | | for dir in $rpathdirs; do |
| 1444 | | acl_save_libdir="$libdir" |
| 1445 | | libdir="$dir" |
| 1446 | | eval flag=\"$acl_hardcode_libdir_flag_spec\" |
| 1447 | | libdir="$acl_save_libdir" |
| 1448 | | $1="${$1}${$1:+ }$flag" |
| 1449 | | done |
| 1450 | | fi |
| 1451 | | fi |
| 1452 | | fi |
| 1453 | | fi |
| 1454 | | fi |
| 1455 | | AC_SUBST([$1]) |
| 1456 | | ]) |
| 1457 | | |
| 1458 | | # lib-prefix.m4 serial 5 (gettext-0.15) |
| 1459 | | dnl Copyright (C) 2001-2005 Free Software Foundation, Inc. |
| 1460 | | dnl This file is free software; the Free Software Foundation |
| 1461 | | dnl gives unlimited permission to copy and/or distribute it, |
| 1462 | | dnl with or without modifications, as long as this notice is preserved. |
| 1463 | | |
| 1464 | | dnl From Bruno Haible. |
| 1465 | | |
| 1466 | | dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and |
| 1467 | | dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't |
| 1468 | | dnl require excessive bracketing. |
| 1469 | | ifdef([AC_HELP_STRING], |
| 1470 | | [AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], |
| 1471 | | [AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) |
| 1472 | | |
| 1473 | | dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed |
| 1474 | | dnl to access previously installed libraries. The basic assumption is that |
| 1475 | | dnl a user will want packages to use other packages he previously installed |
| 1476 | | dnl with the same --prefix option. |
| 1477 | | dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate |
| 1478 | | dnl libraries, but is otherwise very convenient. |
| 1479 | | AC_DEFUN([AC_LIB_PREFIX], |
| 1480 | | [ |
| 1481 | | AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) |
| 1482 | | AC_REQUIRE([AC_PROG_CC]) |
| 1483 | | AC_REQUIRE([AC_CANONICAL_HOST]) |
| 1484 | | AC_REQUIRE([AC_LIB_PREPARE_MULTILIB]) |
| 1485 | | AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) |
| 1486 | | dnl By default, look in $includedir and $libdir. |
| 1487 | | use_additional=yes |
| 1488 | | AC_LIB_WITH_FINAL_PREFIX([ |
| 1489 | | eval additional_includedir=\"$includedir\" |
| 1490 | | eval additional_libdir=\"$libdir\" |
| 1491 | | ]) |
| 1492 | | AC_LIB_ARG_WITH([lib-prefix], |
| 1493 | | [ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib |
| 1494 | | --without-lib-prefix don't search for libraries in includedir and libdir], |
| 1495 | | [ |
| 1496 | | if test "X$withval" = "Xno"; then |
| 1497 | | use_additional=no |
| 1498 | | else |
| 1499 | | if test "X$withval" = "X"; then |
| 1500 | | AC_LIB_WITH_FINAL_PREFIX([ |
| 1501 | | eval additional_includedir=\"$includedir\" |
| 1502 | | eval additional_libdir=\"$libdir\" |
| 1503 | | ]) |
| 1504 | | else |
| 1505 | | additional_includedir="$withval/include" |
| 1506 | | additional_libdir="$withval/$acl_libdirstem" |
| 1507 | | fi |
| 1508 | | fi |
| 1509 | | ]) |
| 1510 | | if test $use_additional = yes; then |
| 1511 | | dnl Potentially add $additional_includedir to $CPPFLAGS. |
| 1512 | | dnl But don't add it |
| 1513 | | dnl 1. if it's the standard /usr/include, |
| 1514 | | dnl 2. if it's already present in $CPPFLAGS, |
| 1515 | | dnl 3. if it's /usr/local/include and we are using GCC on Linux, |
| 1516 | | dnl 4. if it doesn't exist as a directory. |
| 1517 | | if test "X$additional_includedir" != "X/usr/include"; then |
| 1518 | | haveit= |
| 1519 | | for x in $CPPFLAGS; do |
| 1520 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1521 | | if test "X$x" = "X-I$additional_includedir"; then |
| 1522 | | haveit=yes |
| 1523 | | break |
| 1524 | | fi |
| 1525 | | done |
| 1526 | | if test -z "$haveit"; then |
| 1527 | | if test "X$additional_includedir" = "X/usr/local/include"; then |
| 1528 | | if test -n "$GCC"; then |
| 1529 | | case $host_os in |
| 1530 | | linux* | gnu* | k*bsd*-gnu) haveit=yes;; |
| 1531 | | esac |
| 1532 | | fi |
| 1533 | | fi |
| 1534 | | if test -z "$haveit"; then |
| 1535 | | if test -d "$additional_includedir"; then |
| 1536 | | dnl Really add $additional_includedir to $CPPFLAGS. |
| 1537 | | CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" |
| 1538 | | fi |
| 1539 | | fi |
| 1540 | | fi |
| 1541 | | fi |
| 1542 | | dnl Potentially add $additional_libdir to $LDFLAGS. |
| 1543 | | dnl But don't add it |
| 1544 | | dnl 1. if it's the standard /usr/lib, |
| 1545 | | dnl 2. if it's already present in $LDFLAGS, |
| 1546 | | dnl 3. if it's /usr/local/lib and we are using GCC on Linux, |
| 1547 | | dnl 4. if it doesn't exist as a directory. |
| 1548 | | if test "X$additional_libdir" != "X/usr/$acl_libdirstem"; then |
| 1549 | | haveit= |
| 1550 | | for x in $LDFLAGS; do |
| 1551 | | AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) |
| 1552 | | if test "X$x" = "X-L$additional_libdir"; then |
| 1553 | | haveit=yes |
| 1554 | | break |
| 1555 | | fi |
| 1556 | | done |
| 1557 | | if test -z "$haveit"; then |
| 1558 | | if test "X$additional_libdir" = "X/usr/local/$acl_libdirstem"; then |
| 1559 | | if test -n "$GCC"; then |
| 1560 | | case $host_os in |
| 1561 | | linux*) haveit=yes;; |
| 1562 | | esac |
| 1563 | | fi |
| 1564 | | fi |
| 1565 | | if test -z "$haveit"; then |
| 1566 | | if test -d "$additional_libdir"; then |
| 1567 | | dnl Really add $additional_libdir to $LDFLAGS. |
| 1568 | | LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" |
| 1569 | | fi |
| 1570 | | fi |
| 1571 | | fi |
| 1572 | | fi |
| 1573 | | fi |
| 1574 | | ]) |
| 1575 | | |
| 1576 | | dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, |
| 1577 | | dnl acl_final_exec_prefix, containing the values to which $prefix and |
| 1578 | | dnl $exec_prefix will expand at the end of the configure script. |
| 1579 | | AC_DEFUN([AC_LIB_PREPARE_PREFIX], |
| 1580 | | [ |
| 1581 | | dnl Unfortunately, prefix and exec_prefix get only finally determined |
| 1582 | | dnl at the end of configure. |
| 1583 | | if test "X$prefix" = "XNONE"; then |
| 1584 | | acl_final_prefix="$ac_default_prefix" |
| 1585 | | else |
| 1586 | | acl_final_prefix="$prefix" |
| 1587 | | fi |
| 1588 | | if test "X$exec_prefix" = "XNONE"; then |
| 1589 | | acl_final_exec_prefix='${prefix}' |
| 1590 | | else |
| 1591 | | acl_final_exec_prefix="$exec_prefix" |
| 1592 | | fi |
| 1593 | | acl_save_prefix="$prefix" |
| 1594 | | prefix="$acl_final_prefix" |
| 1595 | | eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" |
| 1596 | | prefix="$acl_save_prefix" |
| 1597 | | ]) |
| 1598 | | |
| 1599 | | dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the |
| 1600 | | dnl variables prefix and exec_prefix bound to the values they will have |
| 1601 | | dnl at the end of the configure script. |
| 1602 | | AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], |
| 1603 | | [ |
| 1604 | | acl_save_prefix="$prefix" |
| 1605 | | prefix="$acl_final_prefix" |
| 1606 | | acl_save_exec_prefix="$exec_prefix" |
| 1607 | | exec_prefix="$acl_final_exec_prefix" |
| 1608 | | $1 |
| 1609 | | exec_prefix="$acl_save_exec_prefix" |
| 1610 | | prefix="$acl_save_prefix" |
| 1611 | | ]) |
| 1612 | | |
| 1613 | | dnl AC_LIB_PREPARE_MULTILIB creates a variable acl_libdirstem, containing |
| 1614 | | dnl the basename of the libdir, either "lib" or "lib64". |
| 1615 | | AC_DEFUN([AC_LIB_PREPARE_MULTILIB], |
| 1616 | | [ |
| 1617 | | dnl There is no formal standard regarding lib and lib64. The current |
| 1618 | | dnl practice is that on a system supporting 32-bit and 64-bit instruction |
| 1619 | | dnl sets or ABIs, 64-bit libraries go under $prefix/lib64 and 32-bit |
| 1620 | | dnl libraries go under $prefix/lib. We determine the compiler's default |
| 1621 | | dnl mode by looking at the compiler's library search path. If at least |
| 1622 | | dnl of its elements ends in /lib64 or points to a directory whose absolute |
| 1623 | | dnl pathname ends in /lib64, we assume a 64-bit ABI. Otherwise we use the |
| 1624 | | dnl default, namely "lib". |
| 1625 | | acl_libdirstem=lib |
| 1626 | | searchpath=`(LC_ALL=C $CC -print-search-dirs) 2>/dev/null | sed -n -e 's,^libraries: ,,p' | sed -e 's,^=,,'` |
| 1627 | | if test -n "$searchpath"; then |
| 1628 | | acl_save_IFS="${IFS= }"; IFS=":" |
| 1629 | | for searchdir in $searchpath; do |
| 1630 | | if test -d "$searchdir"; then |
| 1631 | | case "$searchdir" in |
| 1632 | | */lib64/ | */lib64 ) acl_libdirstem=lib64 ;; |
| 1633 | | *) searchdir=`cd "$searchdir" && pwd` |
| 1634 | | case "$searchdir" in |
| 1635 | | */lib64 ) acl_libdirstem=lib64 ;; |
| 1636 | | esac ;; |
| 1637 | | esac |
| 1638 | | fi |
| 1639 | | done |
| 1640 | | IFS="$acl_save_IFS" |
| 1641 | | fi |
| 1642 | | ]) |
| 1643 | | |
| 1644 | | # libtool.m4 - Configure libtool for the host system. -*-Autoconf-*- |
| 1645 | | # |
| 1646 | | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, |
| 1647 | | # 2006, 2007, 2008 Free Software Foundation, Inc. |
| 1648 | | # Written by Gordon Matzigkeit, 1996 |
| 1649 | | # |
| 1650 | | # This file is free software; the Free Software Foundation gives |
| 1651 | | # unlimited permission to copy and/or distribute it, with or without |
| 1652 | | # modifications, as long as this notice is preserved. |
| 1653 | | |
| 1654 | | m4_define([_LT_COPYING], [dnl |
| 1655 | | # Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, |
| 1656 | | # 2006, 2007, 2008 Free Software Foundation, Inc. |
| 1657 | | # Written by Gordon Matzigkeit, 1996 |
| 1658 | | # |
| 1659 | | # This file is part of GNU Libtool. |
| 1660 | | # |
| 1661 | | # GNU Libtool is free software; you can redistribute it and/or |
| 1662 | | # modify it under the terms of the GNU General Public License as |
| 1663 | | # published by the Free Software Foundation; either version 2 of |
| 1664 | | # the License, or (at your option) any later version. |
| 1665 | | # |
| 1666 | | # As a special exception to the GNU General Public License, |
| 1667 | | # if you distribute this file as part of a program or library that |
| 1668 | | # is built using GNU Libtool, you may include this file under the |
| 1669 | | # same distribution terms that you use for the rest of that program. |
| 1670 | | # |
| 1671 | | # GNU Libtool is distributed in the hope that it will be useful, |
| 1672 | | # but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 1673 | | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 1674 | | # GNU General Public License for more details. |
| 1675 | | # |
| 1676 | | # You should have received a copy of the GNU General Public License |
| 1677 | | # along with GNU Libtool; see the file COPYING. If not, a copy |
| 1678 | | # can be downloaded from http://www.gnu.org/licenses/gpl.html, or |
| 1679 | | # obtained by writing to the Free Software Foundation, Inc., |
| 1680 | | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 1681 | | ]) |
| 1682 | | |
| 1683 | | # serial 56 LT_INIT |
| 1684 | | |
| 1685 | | |
| 1686 | | # LT_PREREQ(VERSION) |
| 1687 | | # ------------------ |
| 1688 | | # Complain and exit if this libtool version is less that VERSION. |
| 1689 | | m4_defun([LT_PREREQ], |
| 1690 | | [m4_if(m4_version_compare(m4_defn([LT_PACKAGE_VERSION]), [$1]), -1, |
| 1691 | | [m4_default([$3], |
| 1692 | | [m4_fatal([Libtool version $1 or higher is required], |
| 1693 | | 63)])], |
| 1694 | | [$2])]) |
| 1695 | | |
| 1696 | | |
| 1697 | | # _LT_CHECK_BUILDDIR |
| 1698 | | # ------------------ |
| 1699 | | # Complain if the absolute build directory name contains unusual characters |
| 1700 | | m4_defun([_LT_CHECK_BUILDDIR], |
| 1701 | | [case `pwd` in |
| 1702 | | *\ * | *\ *) |
| 1703 | | AC_MSG_WARN([Libtool does not cope well with whitespace in `pwd`]) ;; |
| 1704 | | esac |
| 1705 | | ]) |
| 1706 | | |
| 1707 | | |
| 1708 | | # LT_INIT([OPTIONS]) |
| 1709 | | # ------------------ |
| 1710 | | AC_DEFUN([LT_INIT], |
| 1711 | | [AC_PREREQ([2.58])dnl We use AC_INCLUDES_DEFAULT |
| 1712 | | AC_BEFORE([$0], [LT_LANG])dnl |
| 1713 | | AC_BEFORE([$0], [LT_OUTPUT])dnl |
| 1714 | | AC_BEFORE([$0], [LTDL_INIT])dnl |
| 1715 | | m4_require([_LT_CHECK_BUILDDIR])dnl |
| 1716 | | |
| 1717 | | dnl Autoconf doesn't catch unexpanded LT_ macros by default: |
| 1718 | | m4_pattern_forbid([^_?LT_[A-Z_]+$])dnl |
| 1719 | | m4_pattern_allow([^(_LT_EOF|LT_DLGLOBAL|LT_DLLAZY_OR_NOW|LT_MULTI_MODULE)$])dnl |
| 1720 | | dnl aclocal doesn't pull ltoptions.m4, ltsugar.m4, or ltversion.m4 |
| 1721 | | dnl unless we require an AC_DEFUNed macro: |
| 1722 | | AC_REQUIRE([LTOPTIONS_VERSION])dnl |
| 1723 | | AC_REQUIRE([LTSUGAR_VERSION])dnl |
| 1724 | | AC_REQUIRE([LTVERSION_VERSION])dnl |
| 1725 | | AC_REQUIRE([LTOBSOLETE_VERSION])dnl |
| 1726 | | m4_require([_LT_PROG_LTMAIN])dnl |
| 1727 | | |
| 1728 | | dnl Parse OPTIONS |
| 1729 | | _LT_SET_OPTIONS([$0], [$1]) |
| 1730 | | |
| 1731 | | # This can be used to rebuild libtool when needed |
| 1732 | | LIBTOOL_DEPS="$ltmain" |
| 1733 | | |
| 1734 | | # Always use our own libtool. |
| 1735 | | LIBTOOL='$(SHELL) $(top_builddir)/libtool' |
| 1736 | | AC_SUBST(LIBTOOL)dnl |
| 1737 | | |
| 1738 | | _LT_SETUP |
| 1739 | | |
| 1740 | | # Only expand once: |
| 1741 | | m4_define([LT_INIT]) |
| 1742 | | ])# LT_INIT |
| 1743 | | |
| 1744 | | # Old names: |
| 1745 | | AU_ALIAS([AC_PROG_LIBTOOL], [LT_INIT]) |
| 1746 | | AU_ALIAS([AM_PROG_LIBTOOL], [LT_INIT]) |
| 1747 | | dnl aclocal-1.4 backwards compatibility: |
| 1748 | | dnl AC_DEFUN([AC_PROG_LIBTOOL], []) |
| 1749 | | dnl AC_DEFUN([AM_PROG_LIBTOOL], []) |
| 1750 | | |
| 1751 | | |
| 1752 | | # _LT_CC_BASENAME(CC) |
| 1753 | | # ------------------- |
| 1754 | | # Calculate cc_basename. Skip known compiler wrappers and cross-prefix. |
| 1755 | | m4_defun([_LT_CC_BASENAME], |
| 1756 | | [for cc_temp in $1""; do |
| 1757 | | case $cc_temp in |
| 1758 | | compile | *[[\\/]]compile | ccache | *[[\\/]]ccache ) ;; |
| 1759 | | distcc | *[[\\/]]distcc | purify | *[[\\/]]purify ) ;; |
| 1760 | | \-*) ;; |
| 1761 | | *) break;; |
| 1762 | | esac |
| 1763 | | done |
| 1764 | | cc_basename=`$ECHO "X$cc_temp" | $Xsed -e 's%.*/%%' -e "s%^$host_alias-%%"` |
| 1765 | | ]) |
| 1766 | | |
| 1767 | | |
| 1768 | | # _LT_FILEUTILS_DEFAULTS |
| 1769 | | # ---------------------- |
| 1770 | | # It is okay to use these file commands and assume they have been set |
| 1771 | | # sensibly after `m4_require([_LT_FILEUTILS_DEFAULTS])'. |
| 1772 | | m4_defun([_LT_FILEUTILS_DEFAULTS], |
| 1773 | | [: ${CP="cp -f"} |
| 1774 | | : ${MV="mv -f"} |
| 1775 | | : ${RM="rm -f"} |
| 1776 | | ])# _LT_FILEUTILS_DEFAULTS |
| 1777 | | |
| 1778 | | |
| 1779 | | # _LT_SETUP |
| 1780 | | # --------- |
| 1781 | | m4_defun([_LT_SETUP], |
| 1782 | | [AC_REQUIRE([AC_CANONICAL_HOST])dnl |
| 1783 | | AC_REQUIRE([AC_CANONICAL_BUILD])dnl |
| 1784 | | _LT_DECL([], [host_alias], [0], [The host system])dnl |
| 1785 | | _LT_DECL([], [host], [0])dnl |
| 1786 | | _LT_DECL([], [host_os], [0])dnl |
| 1787 | | dnl |
| 1788 | | _LT_DECL([], [build_alias], [0], [The build system])dnl |
| 1789 | | _LT_DECL([], [build], [0])dnl |
| 1790 | | _LT_DECL([], [build_os], [0])dnl |
| 1791 | | dnl |
| 1792 | | AC_REQUIRE([AC_PROG_CC])dnl |
| 1793 | | AC_REQUIRE([LT_PATH_LD])dnl |
| 1794 | | AC_REQUIRE([LT_PATH_NM])dnl |
| 1795 | | dnl |
| 1796 | | AC_REQUIRE([AC_PROG_LN_S])dnl |
| 1797 | | test -z "$LN_S" && LN_S="ln -s" |
| 1798 | | _LT_DECL([], [LN_S], [1], [Whether we need soft or hard links])dnl |
| 1799 | | dnl |
| 1800 | | AC_REQUIRE([LT_CMD_MAX_LEN])dnl |
| 1801 | | _LT_DECL([objext], [ac_objext], [0], [Object file suffix (normally "o")])dnl |
| 1802 | | _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl |
| 1803 | | dnl |
| 1804 | | m4_require([_LT_FILEUTILS_DEFAULTS])dnl |
| 1805 | | m4_require([_LT_CHECK_SHELL_FEATURES])dnl |
| 1806 | | m4_require([_LT_CMD_RELOAD])dnl |
| 1807 | | m4_require([_LT_CHECK_MAGIC_METHOD])dnl |
| 1808 | | m4_require([_LT_CMD_OLD_ARCHIVE])dnl |
| 1809 | | m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl |
| 1810 | | |
| 1811 | | _LT_CONFIG_LIBTOOL_INIT([ |
| 1812 | | # See if we are running on zsh, and set the options which allow our |
| 1813 | | # commands through without removal of \ escapes INIT. |
| 1814 | | if test -n "\${ZSH_VERSION+set}" ; then |
| 1815 | | setopt NO_GLOB_SUBST |
| 1816 | | fi |
| 1817 | | ]) |
| 1818 | | if test -n "${ZSH_VERSION+set}" ; then |
| 1819 | | setopt NO_GLOB_SUBST |
| 1820 | | fi |
| 1821 | | |
| 1822 | | _LT_CHECK_OBJDIR |
| 1823 | | |
| 1824 | | m4_require([_LT_TAG_COMPILER])dnl |
| 1825 | | _LT_PROG_ECHO_BACKSLASH |
| 1826 | | |
| 1827 | | case $host_os in |
| 1828 | | aix3*) |
| 1829 | | # AIX sometimes has problems with the GCC collect2 program. For some |
| 1830 | | # reason, if we set the COLLECT_NAMES environment variable, the problems |
| 1831 | | # vanish in a puff of smoke. |
| 1832 | | if test "X${COLLECT_NAMES+set}" != Xset; then |
| 1833 | | COLLECT_NAMES= |
| 1834 | | export COLLECT_NAMES |
| 1835 | | fi |
| 1836 | | ;; |
| 1837 | | esac |
| 1838 | | |
| 1839 | | # Sed substitution that helps us do robust quoting. It backslashifies |
| 1840 | | # metacharacters that are still active within double-quoted strings. |
| 1841 | | sed_quote_subst='s/\([["`$\\]]\)/\\\1/g' |
| 1842 | | |
| 1843 | | # Same as above, but do not quote variable references. |
| 1844 | | double_quote_subst='s/\([["`\\]]\)/\\\1/g' |
| 1845 | | |
| 1846 | | # Sed substitution to delay expansion of an escaped shell variable in a |
| 1847 | | # double_quote_subst'ed string. |
| 1848 | | delay_variable_subst='s/\\\\\\\\\\\$/\\\\\\$/g' |
| 1849 | | |
| 1850 | | # Sed substitution to delay expansion of an escaped single quote. |
| 1851 | | delay_single_quote_subst='s/'\''/'\'\\\\\\\'\''/g' |
| 1852 | | |
| 1853 | | # Sed substitution to avoid accidental globbing in evaled expressions |
| 1854 | | no_glob_subst='s/\*/\\\*/g' |
| 1855 | | |
| 1856 | | # Global variables: |
| 1857 | | ofile=libtool |
| 1858 | | can_build_shared=yes |
| 1859 | | |
| 1860 | | # All known linkers require a `.a' archive for static linking (except MSVC, |
| 1861 | | # which needs '.lib'). |
| 1862 | | libext=a |
| 1863 | | |
| 1864 | | with_gnu_ld="$lt_cv_prog_gnu_ld" |
| 1865 | | |
| 1866 | | old_CC="$CC" |
| 1867 | | old_CFLAGS="$CFLAGS" |
| 1868 | | |
| 1869 | | # Set sane defaults for various variables |
| 1870 | | test -z "$CC" && CC=cc |
| 1871 | | test -z "$LTCC" && LTCC=$CC |
| 1872 | | test -z "$LTCFLAGS" && LTCFLAGS=$CFLAGS |
| 1873 | | test -z "$LD" && LD=ld |
| 1874 | | test -z "$ac_objext" && ac_objext=o |
| 1875 | | |
| 1876 | | _LT_CC_BASENAME([$compiler]) |
| 1877 | | |
| 1878 | | # Only perform the check for file, if the check method requires it |
| 1879 | | test -z "$MAGIC_CMD" && MAGIC_CMD=file |
| 1880 | | case $deplibs_check_method in |
| 1881 | | file_magic*) |
| 1882 | | if test "$file_magic_cmd" = '$MAGIC_CMD'; then |
| 1883 | | _LT_PATH_MAGIC |
| 1884 | | fi |
| 1885 | | ;; |
| 1886 | | esac |
| 1887 | | |
| 1888 | | # Use C for the default configuration in the libtool script |
| 1889 | | LT_SUPPORTED_TAG([CC]) |
| 1890 | | _LT_LANG_C_CONFIG |
| 1891 | | _LT_LANG_DEFAULT_CONFIG |
| 1892 | | _LT_CONFIG_COMMANDS |
| 1893 | | ])# _LT_SETUP |
| 1894 | | |
| 1895 | | |
| 1896 | | # _LT_PROG_LTMAIN |
| 1897 | | # --------------- |
| 1898 | | # Note that this code is called both from `configure', and `config.status' |
| 1899 | | # now that we use AC_CONFIG_COMMANDS to generate libtool. Notably, |
| 1900 | | # `config.status' has no value for ac_aux_dir unless we are using Automake, |
| 1901 | | # so we pass a copy along to make sure it has a sensible value anyway. |
| 1902 | | m4_defun([_LT_PROG_LTMAIN], |
| 1903 | | [m4_ifdef([AC_REQUIRE_AUX_FILE], [AC_REQUIRE_AUX_FILE([ltmain.sh])])dnl |
| 1904 | | _LT_CONFIG_LIBTOOL_INIT([ac_aux_dir='$ac_aux_dir']) |
| 1905 | | ltmain="$ac_aux_dir/ltmain.sh" |
| 1906 | | ])# _LT_PROG_LTMAIN |
| 1907 | | |
| 1908 | | |
| 1909 | | |
| 1910 | | # So that we can recreate a full libtool script including additional |
| 1911 | | # tags, we accumulate the chunks of code to send to AC_CONFIG_COMMANDS |
| 1912 | | # in macros and then make a single call at the end using the `libtool' |
| 1913 | | # label. |
| 1914 | | |
| 1915 | | |
| 1916 | | # _LT_CONFIG_LIBTOOL_INIT([INIT-COMMANDS]) |
| 1917 | | # ---------------------------------------- |
| 1918 | | # Register INIT-COMMANDS to be passed to AC_CONFIG_COMMANDS later. |
| 1919 | | m4_define([_LT_CONFIG_LIBTOOL_INIT], |
| 1920 | | [m4_ifval([$1], |
| 1921 | | [m4_append([_LT_OUTPUT_LIBTOOL_INIT], |
| 1922 | | [$1 |
| 1923 | | ])])]) |
| 1924 | | |
| 1925 | | # Initialize. |
| 1926 | | m4_define([_LT_OUTPUT_LIBTOOL_INIT]) |
| 1927 | | |
| 1928 | | |
| 1929 | | # _LT_CONFIG_LIBTOOL([COMMANDS]) |
| 1930 | | # ------------------------------ |
| 1931 | | # Register COMMANDS to be passed to AC_CONFIG_COMMANDS later. |
| 1932 | | m4_define([_LT_CONFIG_LIBTOOL], |
| 1933 | | [m4_ifval([$1], |
| 1934 | | [m4_append([_LT_OUTPUT_LIBTOOL_COMMANDS], |
| 1935 | | [$1 |
| 1936 | | ])])]) |
| 1937 | | |
| 1938 | | # Initialize. |
| 1939 | | m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS]) |
| 1940 | | |
| 1941 | | |
| 1942 | | # _LT_CONFIG_SAVE_COMMANDS([COMMANDS], [INIT_COMMANDS]) |
| 1943 | | # ----------------------------------------------------- |
| 1944 | | m4_defun([_LT_CONFIG_SAVE_COMMANDS], |
| 1945 | | [_LT_CONFIG_LIBTOOL([$1]) |
| 1946 | | _LT_CONFIG_LIBTOOL_INIT([$2]) |
| 1947 | | ]) |
| 1948 | | |
| 1949 | | |
| 1950 | | # _LT_FORMAT_COMMENT([COMMENT]) |
| 1951 | | # ----------------------------- |
| 1952 | | # Add leading comment marks to the start of each line, and a trailing |
| 1953 | | # full-stop to the whole comment if one is not present already. |
| 1954 | | m4_define([_LT_FORMAT_COMMENT], |
| 1955 | | [m4_ifval([$1], [ |
| 1956 | | m4_bpatsubst([m4_bpatsubst([$1], [^ *], [# ])], |
| 1957 | | [['`$\]], [\\\&])]m4_bmatch([$1], [[!?.]$], [], [.]) |
| 1958 | | )]) |
| 1959 | | |
| 1960 | | |
| 1961 | | |
| 1962 | | |
| 1963 | | |
| 1964 | | # _LT_DECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION], [IS-TAGGED?]) |
| 1965 | | # ------------------------------------------------------------------- |
| 1966 | | # CONFIGNAME is the name given to the value in the libtool script. |
| 1967 | | # VARNAME is the (base) name used in the configure script. |
| 1968 | | # VALUE may be 0, 1 or 2 for a computed quote escaped value based on |
| 1969 | | # VARNAME. Any other value will be used directly. |
| 1970 | | m4_define([_LT_DECL], |
| 1971 | | [lt_if_append_uniq([lt_decl_varnames], [$2], [, ], |
| 1972 | | [lt_dict_add_subkey([lt_decl_dict], [$2], [libtool_name], |
| 1973 | | [m4_ifval([$1], [$1], [$2])]) |
| 1974 | | lt_dict_add_subkey([lt_decl_dict], [$2], [value], [$3]) |
| 1975 | | m4_ifval([$4], |
| 1976 | | [lt_dict_add_subkey([lt_decl_dict], [$2], [description], [$4])]) |
| 1977 | | lt_dict_add_subkey([lt_decl_dict], [$2], |
| 1978 | | [tagged?], [m4_ifval([$5], [yes], [no])])]) |
| 1979 | | ]) |
| 1980 | | |
| 1981 | | |
| 1982 | | # _LT_TAGDECL([CONFIGNAME], VARNAME, VALUE, [DESCRIPTION]) |
| 1983 | | # -------------------------------------------------------- |
| 1984 | | m4_define([_LT_TAGDECL], [_LT_DECL([$1], [$2], [$3], [$4], [yes])]) |
| 1985 | | |
| 1986 | | |
| 1987 | | # lt_decl_tag_varnames([SEPARATOR], [VARNAME1...]) |
| 1988 | | # ------------------------------------------------ |
| 1989 | | m4_define([lt_decl_tag_varnames], |
| 1990 | | [_lt_decl_filter([tagged?], [yes], $@)]) |
| 1991 | | |
| 1992 | | |
| 1993 | | # _lt_decl_filter(SUBKEY, VALUE, [SEPARATOR], [VARNAME1..]) |
| 1994 | | # --------------------------------------------------------- |
| 1995 | | m4_define([_lt_decl_filter], |
| 1996 | | [m4_case([$#], |
| 1997 | | [0], [m4_fatal([$0: too few arguments: $#])], |
| 1998 | | [1], [m4_fatal([$0: too few arguments: $#: $1])], |
| 1999 | | [2], [lt_dict_filter([lt_decl_dict], [$1], [$2], [], lt_decl_varnames)], |
| 2000 | | [3], [lt_dict_filter([lt_decl_dict], [$1], [$2], [$3], lt_decl_varnames)], |
| 2001 | | [lt_dict_filter([lt_decl_dict], $@)])[]dnl |
| 2002 | | ]) |
| 2003 | | |
| 2004 | | |
| 2005 | | # lt_decl_quote_varnames([SEPARATOR], [VARNAME1...]) |
| 2006 | | # -------------------------------------------------- |
| 2007 | | m4_define([lt_decl_quote_varnames], |
| 2008 | | [_lt_decl_filter([value], [1], $@)]) |
| 2009 | | |
| 2010 | | |
| 2011 | | # lt_decl_dquote_varnames([SEPARATOR], [VARNAME1...]) |
| 2012 | | # --------------------------------------------------- |
| 2013 | | m4_define([lt_decl_dquote_varnames], |
| 2014 | | [_lt_decl_filter([value], [2], $@)]) |
| 2015 | | |
| 2016 | | |
| 2017 | | # lt_decl_varnames_tagged([SEPARATOR], [VARNAME1...]) |
| 2018 | | # --------------------------------------------------- |
| 2019 | | m4_define([lt_decl_varnames_tagged], |
| 2020 | | [_$0(m4_quote(m4_default([$1], [[, ]])), |
| 2021 | | m4_quote(m4_if([$2], [], |
| 2022 | | m4_quote(lt_decl_tag_varnames), |
| 2023 | | m4_quote(m4_shift($@)))), |
| 2024 | | m4_split(m4_normalize(m4_quote(_LT_TAGS))))]) |
| 2025 | | m4_define([_lt_decl_varnames_tagged], [lt_combine([$1], [$2], [_], $3)]) |
| 2026 | | |
| 2027 | | |
| 2028 | | # lt_decl_all_varnames([SEPARATOR], [VARNAME1...]) |
| 2029 | | # ------------------------------------------------ |
| 2030 | | m4_define([lt_decl_all_varnames], |
| 2031 | | [_$0(m4_quote(m4_default([$1], [[, ]])), |
| 2032 | | m4_if([$2], [], |
| 2033 | | m4_quote(lt_decl_varnames), |
| 2034 | | m4_quote(m4_shift($@))))[]dnl |
| 2035 | | ]) |
| 2036 | | m4_define([_lt_decl_all_varnames], |
| 2037 | | [lt_join($@, lt_decl_varnames_tagged([$1], |
| 2038 | | lt_decl_tag_varnames([[, ]], m4_shift($@))))dnl |
| 2039 | | ]) |
| 2040 | | |
| 2041 | | |
| 2042 | | # _LT_CONFIG_STATUS_DECLARE([VARNAME]) |
| 2043 | | # ------------------------------------ |
| 2044 | | # Quote a variable value, and forward it to `config.status' so that its |
| 2045 | | # declaration there will have the same value as in `configure'. VARNAME |
| 2046 | | # must have a single quote delimited value for this to work. |
| 2047 | | m4_define([_LT_CONFIG_STATUS_DECLARE], |
| 2048 | | [$1='`$ECHO "X$][$1" | $Xsed -e "$delay_single_quote_subst"`']) |
| 2049 | | |
| 2050 | | |
| 2051 | | # _LT_CONFIG_STATUS_DECLARATIONS |
| 2052 | | # ------------------------------ |
| 2053 | | # We delimit libtool config variables with single quotes, so when |
| 2054 | | # we write them to config.status, we have to be sure to quote all |
| 2055 | | # embedded single quotes properly. In configure, this macro expands |
| 2056 | | # each variable declared with _LT_DECL (and _LT_TAGDECL) into: |
| 2057 | | # |
| 2058 | | # <var>='`$ECHO "X$<var>" | $Xsed -e "$delay_single_quote_subst"`' |
| 2059 | | m4_defun([_LT_CONFIG_STATUS_DECLARATIONS], |
| 2060 | | [m4_foreach([_lt_var], m4_quote(lt_decl_all_varnames), |
| 2061 | | [m4_n([_LT_CONFIG_STATUS_DECLARE(_lt_var)])])]) |
| 2062 | | |
| 2063 | | |
| 2064 | | # _LT_LIBTOOL_TAGS |
| 2065 | | # ---------------- |
| 2066 | | # Output comment and list of tags supported by the script |
| 2067 | | m4_defun([_LT_LIBTOOL_TAGS], |
| 2068 | | [_LT_FORMAT_COMMENT([The names of the tagged configurations supported by this script])dnl |
| 2069 | | available_tags="_LT_TAGS"dnl |
| 2070 | | ]) |
| 2071 | | |
| 2072 | | |
| 2073 | | # _LT_LIBTOOL_DECLARE(VARNAME, [TAG]) |
| 2074 | | # ----------------------------------- |
| 2075 | | # Extract the dictionary values for VARNAME (optionally with TAG) and |
| 2076 | | # expand to a commented shell variable setting: |
| 2077 | | # |
| 2078 | | # # Some comment about what VAR is for. |
| 2079 | | # visible_name=$lt_internal_name |
| 2080 | | m4_define([_LT_LIBTOOL_DECLARE], |
| 2081 | | [_LT_FORMAT_COMMENT(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], |
| 2082 | | [description])))[]dnl |
| 2083 | | m4_pushdef([_libtool_name], |
| 2084 | | m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [libtool_name])))[]dnl |
| 2085 | | m4_case(m4_quote(lt_dict_fetch([lt_decl_dict], [$1], [value])), |
| 2086 | | [0], [_libtool_name=[$]$1], |
| 2087 | | [1], [_libtool_name=$lt_[]$1], |
| 2088 | | [2], [_libtool_name=$lt_[]$1], |
| 2089 | | [_libtool_name=lt_dict_fetch([lt_decl_dict], [$1], [value])])[]dnl |
| 2090 | | m4_ifval([$2], [_$2])[]m4_popdef([_libtool_name])[]dnl |
| 2091 | | ]) |
| 2092 | | |
| 2093 | | |
| 2094 | | # _LT_LIBTOOL_CONFIG_VARS |
| 2095 | | # ----------------------- |
| 2096 | | # Produce commented declarations of non-tagged libtool config variables |
| 2097 | | # suitable for insertion in the LIBTOOL CONFIG section of the `libtool' |
| 2098 | | # script. Tagged libtool config variables (even for the LIBTOOL CONFIG |
| 2099 | | # section) are produced by _LT_LIBTOOL_TAG_VARS. |
| 2100 | | m4_defun([_LT_LIBTOOL_CONFIG_VARS], |
| 2101 | | [m4_foreach([_lt_var], |
| 2102 | | m4_quote(_lt_decl_filter([tagged?], [no], [], lt_decl_varnames)), |
| 2103 | | [m4_n([_LT_LIBTOOL_DECLARE(_lt_var)])])]) |
| 2104 | | |
| 2105 | | |
| 2106 | | # _LT_LIBTOOL_TAG_VARS(TAG) |
| 2107 | | # ------------------------- |
| 2108 | | m4_define([_LT_LIBTOOL_TAG_VARS], |
| 2109 | | [m4_foreach([_lt_var], m4_quote(lt_decl_tag_varnames), |
| 2110 | | [m4_n([_LT_LIBTOOL_DECLARE(_lt_var, [$1])])])]) |
| 2111 | | |
| 2112 | | |
| 2113 | | # _LT_TAGVAR(VARNAME, [TAGNAME]) |
| 2114 | | # ------------------------------ |
| 2115 | | m4_define([_LT_TAGVAR], [m4_ifval([$2], [$1_$2], [$1])]) |
| 2116 | | |
| 2117 | | |
| 2118 | | # _LT_CONFIG_COMMANDS |
| 2119 | | # ------------------- |
| 2120 | | # Send accumulated output to $CONFIG_STATUS. Thanks to the lists of |
| 2121 | | # variables for single and double quote escaping we saved from calls |
| 2122 | | # to _LT_DECL, we can put quote escaped variables declarations |
| 2123 | | # into `config.status', and then the shell code to quote escape them in |
| 2124 | | # for loops in `config.status'. Finally, any additional code accumulated |
| 2125 | | # from calls to _LT_CONFIG_LIBTOOL_INIT is expanded. |
| 2126 | | m4_defun([_LT_CONFIG_COMMANDS], |
| 2127 | | [AC_PROVIDE_IFELSE([LT_OUTPUT], |
| 2128 | | dnl If the libtool generation code has been placed in $CONFIG_LT, |
| 2129 | | dnl instead of duplicating it all over again into config.status, |
| 2130 | | dnl then we will have config.status run $CONFIG_LT later, so it |
| 2131 | | dnl needs to know what name is stored there: |
| 2132 | | [AC_CONFIG_COMMANDS([libtool], |
| 2133 | | [$SHELL $CONFIG_LT || AS_EXIT(1)], [CONFIG_LT='$CONFIG_LT'])], |
| 2134 | | dnl If the libtool generation code is destined for config.status, |
| 2135 | | dnl expand the accumulated commands and init code now: |
| 2136 | | [AC_CONFIG_COMMANDS([libtool], |
| 2137 | | [_LT_OUTPUT_LIBTOOL_COMMANDS], [_LT_OUTPUT_LIBTOOL_COMMANDS_INIT])]) |
| 2138 | | ])#_LT_CONFIG_COMMANDS |
| 2139 | | |
| 2140 | | |
| 2141 | | # Initialize. |
| 2142 | | m4_define([_LT_OUTPUT_LIBTOOL_COMMANDS_INIT], |
| 2143 | | [ |
| 2144 | | |
| 2145 | | # The HP-UX ksh and POSIX shell print the target directory to stdout |
| 2146 | | # if CDPATH is set. |
| 2147 | | (unset CDPATH) >/dev/null 2>&1 && unset CDPATH |
| 2148 | | |
| 2149 | | sed_quote_subst='$sed_quote_subst' |
| 2150 | | double_quote_subst='$double_quote_subst' |
| 2151 | | delay_variable_subst='$delay_variable_subst' |
| 2152 | | _LT_CONFIG_STATUS_DECLARATIONS |
| 2153 | | LTCC='$LTCC' |
| 2154 | | LTCFLAGS='$LTCFLAGS' |
| 2155 | | compiler='$compiler_DEFAULT' |
| 2156 | | |
| 2157 | | # Quote evaled strings. |
| 2158 | | for var in lt_decl_all_varnames([[ \ |
| 2159 | | ]], lt_decl_quote_varnames); do |
| 2160 | | case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in |
| 2161 | | *[[\\\\\\\`\\"\\\$]]*) |
| 2162 | | eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$sed_quote_subst\\"\\\`\\\\\\"" |
| 2163 | | ;; |
| 2164 | | *) |
| 2165 | | eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" |
| 2166 | | ;; |
| 2167 | | esac |
| 2168 | | done |
| 2169 | | |
| 2170 | | # Double-quote double-evaled strings. |
| 2171 | | for var in lt_decl_all_varnames([[ \ |
| 2172 | | ]], lt_decl_dquote_varnames); do |
| 2173 | | case \`eval \\\\\$ECHO "X\\\\\$\$var"\` in |
| 2174 | | *[[\\\\\\\`\\"\\\$]]*) |
| 2175 | | eval "lt_\$var=\\\\\\"\\\`\\\$ECHO \\"X\\\$\$var\\" | \\\$Xsed -e \\"\\\$double_quote_subst\\" -e \\"\\\$sed_quote_subst\\" -e \\"\\\$delay_variable_subst\\"\\\`\\\\\\"" |
| 2176 | | ;; |
| 2177 | | *) |
| 2178 | | eval "lt_\$var=\\\\\\"\\\$\$var\\\\\\"" |
| 2179 | | ;; |
| 2180 | | esac |
| 2181 | | done |
| 2182 | | |
| 2183 | | # Fix-up fallback echo if it was mangled by the above quoting rules. |
| 2184 | | case \$lt_ECHO in |
| 2185 | | *'\\\[$]0 --fallback-echo"')dnl " |
| 2186 | | lt_ECHO=\`\$ECHO "X\$lt_ECHO" | \$Xsed -e 's/\\\\\\\\\\\\\\\[$]0 --fallback-echo"\[$]/\[$]0 --fallback-echo"/'\` |
| 2187 | | ;; |
| 2188 | | esac |
| 2189 | | |
| 2190 | | _LT_OUTPUT_LIBTOOL_INIT |
| 2191 | | ]) |
| 2192 | | |
| 2193 | | |
| 2194 | | # LT_OUTPUT |
| 2195 | | # --------- |
| 2196 | | # This macro allows early generation of the libtool script (before |
| 2197 | | # AC_OUTPUT is called), incase it is used in configure for compilation |
| 2198 | | # tests. |
| 2199 | | AC_DEFUN([LT_OUTPUT], |
| 2200 | | [: ${CONFIG_LT=./config.lt} |
| 2201 | | AC_MSG_NOTICE([creating $CONFIG_LT]) |
| 2202 | | cat >"$CONFIG_LT" <<_LTEOF |
| 2203 | | #! $SHELL |
| 2204 | | # Generated by $as_me. |
| 2205 | | # Run this file to recreate a libtool stub with the current configuration. |
| 2206 | | |
| 2207 | | lt_cl_silent=false |
| 2208 | | SHELL=\${CONFIG_SHELL-$SHELL} |
| 2209 | | _LTEOF |
| 2210 | | |
| 2211 | | cat >>"$CONFIG_LT" <<\_LTEOF |
| 2212 | | AS_SHELL_SANITIZE |
| 2213 | | _AS_PREPARE |
| 2214 | | |
| 2215 | | exec AS_MESSAGE_FD>&1 |
| 2216 | | exec AS_MESSAGE_LOG_FD>>config.log |
| 2217 | | { |
| 2218 | | echo |
| 2219 | | AS_BOX([Running $as_me.]) |
| 2220 | | } >&AS_MESSAGE_LOG_FD |
| 2221 | | |
| 2222 | | lt_cl_help="\ |
| 2223 | | \`$as_me' creates a local libtool stub from the current configuration, |
| 2224 | | for use in further configure time tests before the real libtool is |
| 2225 | | generated. |
| 2226 | | |
| 2227 | | Usage: $[0] [[OPTIONS]] |
| 2228 | | |
| 2229 | | -h, --help print this help, then exit |
| 2230 | | -V, --version print version number, then exit |
| 2231 | | -q, --quiet do not print progress messages |
| 2232 | | -d, --debug don't remove temporary files |
| 2233 | | |
| 2234 | | Report bugs to <bug-libtool@gnu.org>." |
| 2235 | | |
| 2236 | | lt_cl_version="\ |
| 2237 | | m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl |
| 2238 | | m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION]) |
| 2239 | | configured by $[0], generated by m4_PACKAGE_STRING. |
| 2240 | | |
| 2241 | | Copyright (C) 2008 Free Software Foundation, Inc. |
| 2242 | | This config.lt script is free software; the Free Software Foundation |
| 2243 | | gives unlimited permision to copy, distribute and modify it." |
| 2244 | | |
| 2245 | | while test $[#] != 0 |
| 2246 | | do |
| 2247 | | case $[1] in |
| 2248 | | --version | --v* | -V ) |
| 2249 | | echo "$lt_cl_version"; exit 0 ;; |
| 2250 | | --help | --h* | -h ) |
| 2251 | | echo "$lt_cl_help"; exit 0 ;; |
| 2252 | | --debug | --d* | -d ) |
| 2253 | | debug=: ;; |
| 2254 | | --quiet | --q* | --silent | --s* | -q ) |
| 2255 | | lt_cl_silent=: ;; |
| 2256 | | |
| 2257 | | -*) AC_MSG_ERROR([unrecognized option: $[1] |
| 2258 | | Try \`$[0] --help' for more information.]) ;; |
| 2259 | | |
| 2260 | | *) AC_MSG_ERROR([unrecognized argument: $[1] |
| 2261 | | Try \`$[0] --help' for more information.]) ;; |
| 2262 | | esac |
| 2263 | | shift |
| 2264 | | done |
| 2265 | | |
| 2266 | | if $lt_cl_silent; then |
| 2267 | | exec AS_MESSAGE_FD>/dev/null |
| 2268 | | fi |
| 2269 | | _LTEOF |
| 2270 | | |
| 2271 | | cat >>"$CONFIG_LT" <<_LTEOF |
| 2272 | | _LT_OUTPUT_LIBTOOL_COMMANDS_INIT |
| 2273 | | _LTEOF |
| 2274 | | |
| 2275 | | cat >>"$CONFIG_LT" <<\_LTEOF |
| 2276 | | AC_MSG_NOTICE([creating $ofile]) |
| 2277 | | _LT_OUTPUT_LIBTOOL_COMMANDS |
| 2278 | | AS_EXIT(0) |
| 2279 | | _LTEOF |
| 2280 | | chmod +x "$CONFIG_LT" |
| 2281 | | |
| 2282 | | # configure is writing to config.log, but config.lt does its own redirection, |
| 2283 | | # appending to config.log, which fails on DOS, as config.log is still kept |
| 2284 | | # open by configure. Here we exec the FD to /dev/null, effectively closing |
| 2285 | | # config.log, so it can be properly (re)opened and appended to by config.lt. |
| 2286 | | if test "$no_create" != yes; then |
| 2287 | | lt_cl_success=: |
| 2288 | | test "$silent" = yes && |
| 2289 | | lt_config_lt_args="$lt_config_lt_args --quiet" |
| 2290 | | exec AS_MESSAGE_LOG_FD>/dev/null |
| 2291 | | $SHELL "$CONFIG_LT" $lt_config_lt_args || lt_cl_success=false |
| 2292 | | exec AS_MESSAGE_LOG_FD>>config.log |
| 2293 | | $lt_cl_success || AS_EXIT(1) |
| 2294 | | fi |
| 2295 | | ])# LT_OUTPUT |
| 2296 | | |
| 2297 | | |
| 2298 | | # _LT_CONFIG(TAG) |
| 2299 | | # --------------- |
| 2300 | | # If TAG is the built-in tag, create an initial libtool script with a |
| 2301 | | # default configuration from the untagged config vars. Otherwise add code |
| 2302 | | # to config.status for appending the configuration named by TAG from the |
| 2303 | | # matching tagged config vars. |
| 2304 | | m4_defun([_LT_CONFIG], |
| 2305 | | [m4_require([_LT_FILEUTILS_DEFAULTS])dnl |
| 2306 | | _LT_CONFIG_SAVE_COMMANDS([ |
| 2307 | | m4_define([_LT_TAG], m4_if([$1], [], [C], [$1]))dnl |
| 2308 | | m4_if(_LT_TAG, [C], [ |
| 2309 | | # See if we are running on zsh, and set the options which allow our |
| 2310 | | # commands through without removal of \ escapes. |
| 2311 | | if test -n "${ZSH_VERSION+set}" ; then |
| 2312 | | setopt NO_GLOB_SUBST |
| 2313 | | fi |
| 2314 | | |
| 2315 | | cfgfile="${ofile}T" |
| 2316 | | trap "$RM \"$cfgfile\"; exit 1" 1 2 15 |
| 2317 | | $RM "$cfgfile" |
| 2318 | | |
| 2319 | | cat <<_LT_EOF >> "$cfgfile" |
| 2320 | | #! $SHELL |
| 2321 | | |
| 2322 | | # `$ECHO "$ofile" | sed 's%^.*/%%'` - Provide generalized library-building support services. |
| 2323 | | # Generated automatically by $as_me ($PACKAGE$TIMESTAMP) $VERSION |
| 2324 | | # Libtool was configured on host `(hostname || uname -n) 2>/dev/null | sed 1q`: |
| 2325 | | # NOTE: Changes made to this file will be lost: look at ltmain.sh. |
| 2326 | | # |
| 2327 | | _LT_COPYING |
| 2328 | | _LT_LIBTOOL_TAGS |
| 2329 | | |
| 2330 | | # ### BEGIN LIBTOOL CONFIG |
| 2331 | | _LT_LIBTOOL_CONFIG_VARS |
| 2332 | | _LT_LIBTOOL_TAG_VARS |
| 2333 | | # ### END LIBTOOL CONFIG |
| 2334 | | |
| 2335 | | _LT_EOF |
| 2336 | | |
| 2337 | | case $host_os in |
| 2338 | | aix3*) |
| 2339 | | cat <<\_LT_EOF >> "$cfgfile" |
| 2340 | | # AIX sometimes has problems with the GCC collect2 program. For some |
| 2341 | | # reason, if we set the COLLECT_NAMES environment variable, the problems |
| 2342 | | # vanish in a puff of smoke. |
| 2343 | | if test "X${COLLECT_NAMES+set}" != Xset; then |
| 2344 | | COLLECT_NAMES= |
| 2345 | | export COLLECT_NAMES |
| 2346 | | fi |
| 2347 | | _LT_EOF |
| 2348 | | ;; |
| 2349 | | esac |
| 2350 | | |
| 2351 | | _LT_PROG_LTMAIN |
| 2352 | | |
| 2353 | | # We use sed instead of cat because bash on DJGPP gets confused if |
| 2354 | | # if finds mixed CR/LF and LF-only lines. Since sed operates in |
| 2355 | | # text mode, it properly converts lines to CR/LF. This bash problem |
| 2356 | | # is reportedly fixed, but why not run on old versions too? |
| 2357 | | sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \ |
| 2358 | | || (rm -f "$cfgfile"; exit 1) |
| 2359 | | |
| 2360 | | _LT_PROG_XSI_SHELLFNS |
| 2361 | | |
| 2362 | | sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \ |
| 2363 | | || (rm -f "$cfgfile"; exit 1) |
| 2364 | | |
| 2365 | | mv -f "$cfgfile" "$ofile" || |
| 2366 | | (rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile") |
| 2367 | | chmod +x "$ofile" |
| 2368 | | ], |
| 2369 | | [cat <<_LT_EOF >> "$ofile" |
| 2370 | | |
| 2371 | | dnl Unfortunately we have to use $1 here, since _LT_TAG is not expanded |
| 2372 | | dnl in a comment (ie after a #). |
| 2373 | | # ### BEGIN LIBTOOL TAG CONFIG: $1 |
| 2374 | | _LT_LIBTOOL_TAG_VARS(_LT_TAG) |
| 2375 | | # ### END LIBTOOL TAG CONFIG: $1 |
| 2376 | | _LT_EOF |
| 2377 | | ])dnl /m4_if |
| 2378 | | ], |
| 2379 | | [m4_if([$1], [], [ |
| 2380 | | PACKAGE='$PACKAGE' |
| 2381 | | VERSION='$VERSION' |
| 2382 | | TIMESTAMP='$TIMESTAMP' |
| 2383 | | RM='$RM' |
| 2384 | | ofile='$ofile'], []) |
| 2385 | | ])dnl /_LT_CONFIG_SAVE_COMMANDS |
| 2386 | | ])# _LT_CONFIG |
| 2387 | | |
| 2388 | | |
| 2389 | | # LT_SUPPORTED_TAG(TAG) |
| 2390 | | # --------------------- |
| 2391 | | # Trace this macro to discover what tags are supported by the libtool |
| 2392 | | # --tag option, using: |
| 2393 | | # autoconf --trace 'LT_SUPPORTED_TAG:$1' |
| 2394 | | AC_DEFUN([LT_SUPPORTED_TAG], []) |
| 2395 | | |
| 2396 | | |
| 2397 | | # C support is built-in for now |
| 2398 | | m4_define([_LT_LANG_C_enabled], []) |
| 2399 | | m4_define([_LT_TAGS], []) |
| 2400 | | |
| 2401 | | |
| 2402 | | # LT_LANG(LANG) |
| 2403 | | # ------------- |
| 2404 | | # Enable libtool support for the given language if not already enabled. |
| 2405 | | AC_DEFUN([LT_LANG], |
| 2406 | | [AC_BEFORE([$0], [LT_OUTPUT])dnl |
| 2407 | | m4_case([$1], |
| 2408 | | [C], [_LT_LANG(C)], |
| 2409 | | [C++], [_LT_LANG(CXX)], |
| 2410 | | [Java], [_LT_LANG(GCJ)], |
| 2411 | | [Fortran 77], [_LT_LANG(F77)], |
| 2412 | | [Fortran], [_LT_LANG(FC)], |
| 2413 | | [Windows Resource], [_LT_LANG(RC)], |
| 2414 | | [m4_ifdef([_LT_LANG_]$1[_CONFIG], |
| 2415 | | [_LT_LANG($1)], |
| 2416 | | [m4_fatal([$0: unsupported language: "$1"])])])dnl |
| 2417 | | ])# LT_LANG |
| 2418 | | |
| 2419 | | |
| 2420 | | # _LT_LANG(LANGNAME) |
| 2421 | | # ------------------ |
| 2422 | | m4_defun([_LT_LANG], |
| 2423 | | [m4_ifdef([_LT_LANG_]$1[_enabled], [], |
| 2424 | | [LT_SUPPORTED_TAG([$1])dnl |
| 2425 | | m4_append([_LT_TAGS], [$1 ])dnl |
| 2426 | | m4_define([_LT_LANG_]$1[_enabled], [])dnl |
| 2427 | | _LT_LANG_$1_CONFIG($1)])dnl |
| 2428 | | ])# _LT_LANG |
| 2429 | | |
| 2430 | | |
| 2431 | | # _LT_LANG_DEFAULT_CONFIG |
| 2432 | | # ----------------------- |
| 2433 | | m4_defun([_LT_LANG_DEFAULT_CONFIG], |
| 2434 | | [AC_PROVIDE_IFELSE([AC_PROG_CXX], |
| 2435 | | [LT_LANG(CXX)], |
| 2436 | | [m4_define([AC_PROG_CXX], defn([AC_PROG_CXX])[LT_LANG(CXX)])]) |
| 2437 | | |
| 2438 | | AC_PROVIDE_IFELSE([AC_PROG_F77], |
| 2439 | | [LT_LANG(F77)], |
| 2440 | | [m4_define([AC_PROG_F77], defn([AC_PROG_F77])[LT_LANG(F77)])]) |
| 2441 | | |
| 2442 | | AC_PROVIDE_IFELSE([AC_PROG_FC], |
| 2443 | | [LT_LANG(FC)], |
| 2444 | | [m4_define([AC_PROG_FC], defn([AC_PROG_FC])[LT_LANG(FC)])]) |
| 2445 | | |
| 2446 | | dnl The call to [A][M_PROG_GCJ] is quoted like that to stop aclocal |
| 2447 | | dnl pulling things in needlessly. |
| 2448 | | AC_PROVIDE_IFELSE([AC_PROG_GCJ], |
| 2449 | | [LT_LANG(GCJ)], |
| 2450 | | [AC_PROVIDE_IFELSE([A][M_PROG_GCJ], |
| 2451 | | [LT_LANG(GCJ)], |
| 2452 | | [AC_PROVIDE_IFELSE([LT_PROG_GCJ], |
| 2453 | | [LT_LANG(GCJ)], |
| 2454 | | [m4_ifdef([AC_PROG_GCJ], |
| 2455 | | [m4_define([AC_PROG_GCJ], defn([AC_PROG_GCJ])[LT_LANG(GCJ)])]) |
| 2456 | | m4_ifdef([A][M_PROG_GCJ], |
| 2457 | | [m4_define([A][M_PROG_GCJ], defn([A][M_PROG_GCJ])[LT_LANG(GCJ)])]) |
| 2458 | | m4_ifdef([LT_PROG_GCJ], |
| 2459 | | [m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])]) |
| 2460 | | |
| 2461 | | AC_PROVIDE_IFELSE([LT_PROG_RC], |
| 2462 | | [LT_LANG(RC)], |
| 2463 | | [m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])]) |
| 2464 | | ])# _LT_LANG_DEFAULT_CONFIG |
| 2465 | | |
| 2466 | | # Obsolete macros: |
| 2467 | | AU_DEFUN([AC_LIBTOOL_CXX], [LT_LANG(C++)]) |
| 2468 | | AU_DEFUN([AC_LIBTOOL_F77], [LT_LANG(Fortran 77)]) |
| 2469 | | AU_DEFUN([AC_LIBTOOL_FC], [LT_LANG(Fortran)]) |
| 2470 | | AU_DEFUN([AC_LIBTOOL_GCJ], [LT_LANG(Java)]) |
| 2471 | | dnl aclocal-1.4 backwards compatibility: |
| 2472 | | dnl AC_DEFUN([AC_LIBTOOL_CXX], []) |
| 2473 | | dnl AC_DEFUN([AC_LIBTOOL_F77], []) |
| 2474 | | dnl AC_DEFUN([AC_LIBTOOL_FC], []) |
| 2475 | | dnl AC_DEFUN([AC_LIBTOOL_GCJ], []) |
| 2476 | | |
| 2477 | | |
| 2478 | | # _LT_TAG_COMPILER |
| 2479 | | # ---------------- |
| 2480 | | m4_defun([_LT_TAG_COMPILER], |
| 2481 | | [AC_REQUIRE([AC_PROG_CC])dnl |
| 2482 | | |
| 2483 | | _LT_DECL([LTCC], [CC], [1], [A C compiler])dnl |
| 2484 | | _LT_DECL([LTCFLAGS], [CFLAGS], [1], [LTCC compiler flags])dnl |
| 2485 | | _LT_TAGDECL([CC], [compiler], [1], [A language specific compiler])dnl |
| 2486 | | _LT_TAGDECL([with_gcc], [GCC], [0], [Is the compiler the GNU compiler?])dnl |
| 2487 | | |
| 2488 | | # If no C compiler was specified, use CC. |
| 2489 | | LTCC=${LTCC-"$CC"} |
| 2490 | | |
| 2491 | | # If no C compiler flags were specified, use CFLAGS. |
| 2492 | | LTCFLAGS=${LTCFLAGS-"$CFLAGS"} |
| 2493 | | |
| 2494 | | # Allow CC to be a program name with arguments. |
| 2495 | | compiler=$CC |
| 2496 | | ])# _LT_TAG_COMPILER |
| 2497 | | |
| 2498 | | |
| 2499 | | # _LT_COMPILER_BOILERPLATE |
| 2500 | | # ------------------------ |
| 2501 | | # Check for compiler boilerplate output or warnings with |
| 2502 | | # the simple compiler test code. |
| 2503 | | m4_defun([_LT_COMPILER_BOILERPLATE], |
| 2504 | | [m4_require([_LT_DECL_SED])dnl |
| 2505 | | ac_outfile=conftest.$ac_objext |
| 2506 | | echo "$lt_simple_compile_test_code" >conftest.$ac_ext |
| 2507 | | eval "$ac_compile" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err |
| 2508 | | _lt_compiler_boilerplate=`cat conftest.err` |
| 2509 | | $RM conftest* |
| 2510 | | ])# _LT_COMPILER_BOILERPLATE |
| 2511 | | |
| 2512 | | |
| 2513 | | # _LT_LINKER_BOILERPLATE |
| 2514 | | # ---------------------- |
| 2515 | | # Check for linker boilerplate output or warnings with |
| 2516 | | # the simple link test code. |
| 2517 | | m4_defun([_LT_LINKER_BOILERPLATE], |
| 2518 | | [m4_require([_LT_DECL_SED])dnl |
| 2519 | | ac_outfile=conftest.$ac_objext |
| 2520 | | echo "$lt_simple_link_test_code" >conftest.$ac_ext |
| 2521 | | eval "$ac_link" 2>&1 >/dev/null | $SED '/^$/d; /^ *+/d' >conftest.err |
| 2522 | | _lt_linker_boilerplate=`cat conftest.err` |
| 2523 | | $RM -r conftest* |
| 2524 | | ])# _LT_LINKER_BOILERPLATE |
| 2525 | | |
| 2526 | | # _LT_REQUIRED_DARWIN_CHECKS |
| 2527 | | # ------------------------- |
| 2528 | | m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[ |
| 2529 | | case $host_os in |
| 2530 | | rhapsody* | darwin*) |
| 2531 | | AC_CHECK_TOOL([DSYMUTIL], [dsymutil], [:]) |
| 2532 | | AC_CHECK_TOOL([NMEDIT], [nmedit], [:]) |
| 2533 | | AC_CHECK_TOOL([LIPO], [lipo], [:]) |
| 2534 | | AC_CHECK_TOOL([OTOOL], [otool], [:]) |
| 2535 | | AC_CHECK_TOOL([OTOOL64], [otool64], [:]) |
| 2536 | | _LT_DECL([], [DSYMUTIL], [1], |
| 2537 | | [Tool to manipulate archived DWARF debug symbol files on Mac OS X]) |
| 2538 | | _LT_DECL([], [NMEDIT], [1], |
| 2539 | | [Tool to change global to local symbols on Mac OS X]) |
| 2540 | | _LT_DECL([], [LIPO], [1], |
| 2541 | | [Tool to manipulate fat objects and archives on Mac OS X]) |
| 2542 | | _LT_DECL([], [OTOOL], [1], |
| 2543 | | [ldd/readelf like tool for Mach-O binaries on Mac OS X]) |
| 2544 | | _LT_DECL([], [OTOOL64], [1], |
| 2545 | | [ldd/readelf like tool for 64 bit Mach-O binaries on Mac OS X 10.4]) |
| 2546 | | |
| 2547 | | AC_CACHE_CHECK([for -single_module linker flag],[lt_cv_apple_cc_single_mod], |
| 2548 | | [lt_cv_apple_cc_single_mod=no |
| 2549 | | if test -z "${LT_MULTI_MODULE}"; then |
| 2550 | | # By default we will add the -single_module flag. You can override |
| 2551 | | # by either setting the environment variable LT_MULTI_MODULE |
| 2552 | | # non-empty at configure time, or by adding -multi_module to the |
| 2553 | | # link flags. |
| 2554 | | rm -rf libconftest.dylib* |
| 2555 | | echo "int foo(void){return 1;}" > conftest.c |
| 2556 | | echo "$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ |
| 2557 | | -dynamiclib -Wl,-single_module conftest.c" >&AS_MESSAGE_LOG_FD |
| 2558 | | $LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \ |
| 2559 | | -dynamiclib -Wl,-single_module conftest.c 2>conftest.err |
| 2560 | | _lt_result=$? |
| 2561 | | if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then |
| 2562 | | lt_cv_apple_cc_single_mod=yes |
| 2563 | | else |
| 2564 | | cat conftest.err >&AS_MESSAGE_LOG_FD |
| 2565 | | fi |
| 2566 | | rm -rf libconftest.dylib* |
| 2567 | | rm -f conftest.* |
| 2568 | | fi]) |
| 2569 | | AC_CACHE_CHECK([for -exported_symbols_list linker flag], |
| 2570 | | [lt_cv_ld_exported_symbols_list], |
| 2571 | | [lt_cv_ld_exported_symbols_list=no |
| 2572 | | save_LDFLAGS=$LDFLAGS |
| 2573 | | echo "_main" > conftest.sym |
| 2574 | | LDFLAGS="$LDFLAGS -Wl,-exported_symbols_list,conftest.sym" |
| 2575 | | AC_LINK_IFELSE([AC_LANG_PROGRAM([],[])], |
| 2576 | | [lt_cv_ld_exported_symbols_list=yes], |
| 2577 | | [lt_cv_ld_exported_symbols_list=no]) |
| 2578 | | LDFLAGS="$save_LDFLAGS" |
| 2579 | | ]) |
| 2580 | | case $host_os in |
| 2581 | | rhapsody* | darwin1.[[012]]) |
| 2582 | | _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; |
| 2583 | | darwin1.*) |
| 2584 | | _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; |
| 2585 | | darwin*) # darwin 5.x on |
| 2586 | | # if running on 10.5 or later, the deployment target defaults |
| 2587 | | # to the OS version, if on x86, and 10.4, the deployment |
| 2588 | | # target defaults to 10.4. Don't you love it? |
| 2589 | | case ${MACOSX_DEPLOYMENT_TARGET-10.0},$host in |
| 2590 | | 10.0,*86*-darwin8*|10.0,*-darwin[[91]]*) |
| 2591 | | _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; |
| 2592 | | 10.[[012]]*) |
| 2593 | | _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; |
| 2594 | | 10.*) |
| 2595 | | _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; |
| 2596 | | esac |
| 2597 | | ;; |
| 2598 | | esac |
| 2599 | | if test "$lt_cv_apple_cc_single_mod" = "yes"; then |
| 2600 | | _lt_dar_single_mod='$single_module' |
| 2601 | | fi |
| 2602 | | if test "$lt_cv_ld_exported_symbols_list" = "yes"; then |
| 2603 | | _lt_dar_export_syms=' ${wl}-exported_symbols_list,$output_objdir/${libname}-symbols.expsym' |
| 2604 | | else |
| 2605 | | _lt_dar_export_syms='~$NMEDIT -s $output_objdir/${libname}-symbols.expsym ${lib}' |
| 2606 | | fi |
| 2607 | | if test "$DSYMUTIL" != ":"; then |
| 2608 | | _lt_dsymutil='~$DSYMUTIL $lib || :' |
| 2609 | | else |
| 2610 | | _lt_dsymutil= |
| 2611 | | fi |
| 2612 | | ;; |
| 2613 | | esac |
| 2614 | | ]) |
| 2615 | | |
| 2616 | | |
| 2617 | | # _LT_DARWIN_LINKER_FEATURES |
| 2618 | | # -------------------------- |
| 2619 | | # Checks for linker and compiler features on darwin |
| 2620 | | m4_defun([_LT_DARWIN_LINKER_FEATURES], |
| 2621 | | [ |
| 2622 | | m4_require([_LT_REQUIRED_DARWIN_CHECKS]) |
| 2623 | | _LT_TAGVAR(archive_cmds_need_lc, $1)=no |
| 2624 | | _LT_TAGVAR(hardcode_direct, $1)=no |
| 2625 | | _LT_TAGVAR(hardcode_automatic, $1)=yes |
| 2626 | | _LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported |
| 2627 | | _LT_TAGVAR(whole_archive_flag_spec, $1)='' |
| 2628 | | _LT_TAGVAR(link_all_deplibs, $1)=yes |
| 2629 | | _LT_TAGVAR(allow_undefined_flag, $1)="$_lt_dar_allow_undefined" |
| 2630 | | if test "$GCC" = "yes"; then |
| 2631 | | output_verbose_link_cmd=echo |
| 2632 | | _LT_TAGVAR(archive_cmds, $1)="\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring $_lt_dar_single_mod${_lt_dsymutil}" |
| 2633 | | _LT_TAGVAR(module_cmds, $1)="\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dsymutil}" |
| 2634 | | _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \$libobjs \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring ${_lt_dar_single_mod}${_lt_dar_export_syms}${_lt_dsymutil}" |
| 2635 | | _LT_TAGVAR(module_expsym_cmds, $1)="sed -e 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC \$allow_undefined_flag -o \$lib -bundle \$libobjs \$deplibs \$compiler_flags${_lt_dar_export_syms}${_lt_dsymutil}" |
| 2636 | | m4_if([$1], [CXX], |
| 2637 | | [ if test "$lt_cv_apple_cc_single_mod" != "yes"; then |
| 2638 | | _LT_TAGVAR(archive_cmds, $1)="\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dsymutil}" |
| 2639 | | _LT_TAGVAR(archive_expsym_cmds, $1)="sed 's,^,_,' < \$export_symbols > \$output_objdir/\${libname}-symbols.expsym~\$CC -r -keep_private_externs -nostdlib -o \${lib}-master.o \$libobjs~\$CC -dynamiclib \$allow_undefined_flag -o \$lib \${lib}-master.o \$deplibs \$compiler_flags -install_name \$rpath/\$soname \$verstring${_lt_dar_export_syms}${_lt_dsymutil}" |
| 2640 | | fi |
| 2641 | | ],[]) |
| 2642 | | else |
| 2643 | | _LT_TAGVAR(ld_shlibs, $1)=no |
| 2644 | | fi |
| 2645 | | ]) |
| 2646 | | |
| 2647 | | # _LT_SYS_MODULE_PATH_AIX |
| 2648 | | # ----------------------- |
| 2649 | | # Links a minimal program and checks the executable |
| 2650 | | # for the system default hardcoded library path. In most cases, |
| 2651 | | # this is /usr/lib:/lib, but when the MPI compilers are used |
| 2652 | | # the location of the communication and MPI libs are included too. |
| 2653 | | # If we don't find anything, use the default library path according |
| 2654 | | # to the aix ld manual. |
| 2655 | | m4_defun([_LT_SYS_MODULE_PATH_AIX], |
| 2656 | | [m4_require([_LT_DECL_SED])dnl |
| 2657 | | AC_LINK_IFELSE(AC_LANG_PROGRAM,[ |
| 2658 | | lt_aix_libpath_sed=' |
| 2659 | | /Import File Strings/,/^$/ { |
| 2660 | | /^0/ { |
| 2661 | | s/^0 *\(.*\)$/\1/ |
| 2662 | | p |
| 2663 | | } |
| 2664 | | }' |
| 2665 | | aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` |
| 2666 | | # Check for a 64-bit object if we didn't find anything. |
| 2667 | | if test -z "$aix_libpath"; then |
| 2668 | | aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"` |
| 2669 | | fi],[]) |
| 2670 | | if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi |
| 2671 | | ])# _LT_SYS_MODULE_PATH_AIX |
| 2672 | | |
| 2673 | | |
| 2674 | | # _LT_SHELL_INIT(ARG) |
| 2675 | | # ------------------- |
| 2676 | | m4_define([_LT_SHELL_INIT], |
| 2677 | | [ifdef([AC_DIVERSION_NOTICE], |
| 2678 | | [AC_DIVERT_PUSH(AC_DIVERSION_NOTICE)], |
| 2679 | | [AC_DIVERT_PUSH(NOTICE)]) |
| 2680 | | $1 |
| 2681 | | AC_DIVERT_POP |
| 2682 | | ])# _LT_SHELL_INIT |
| 2683 | | |
| 2684 | | |
| 2685 | | # _LT_PROG_ECHO_BACKSLASH |
| 2686 | | # ----------------------- |
| 2687 | | # Add some code to the start of the generated configure script which |