Refresh from GCC
[libffi.git] / patches / win64-underscore
1 Index: libffi/ChangeLog
2 ===================================================================
3 --- libffi.orig/ChangeLog
4 +++ libffi/ChangeLog
5 @@ -42,6 +42,13 @@
6         (.eh_frame): Use FDE_ENCODING.
7         (.LASFDE1, .LASFDE2, LASFDE3): Simplify with FDE_ENCODE.
8  
9 +2010-11-22  Jacek Caban <jacek@codeweavers.com>
10 +
11 +       * configure.ac: Check for symbol underscores on mingw-w64.
12 +       * configure: Rebuilt.
13 +       * src/x86/win64.S: Correctly access extern symbols in respect to
14 +       underscores.
15 +
16  2010-11-15  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
17  
18         * testsuite/lib/libffi-dg.exp: Rename ...
19 Index: libffi/configure.ac
20 ===================================================================
21 --- libffi.orig/configure.ac
22 +++ libffi/configure.ac
23 @@ -321,6 +321,13 @@ if test x$TARGET = xX86 || test x$TARGET
24      fi
25  fi
26  
27 +if test x$TARGET = xX86_WIN64; then
28 +    LT_SYS_SYMBOL_USCORE
29 +    if test "x$sys_symbol_underscore" = xyes; then
30 +        AC_DEFINE(SYMBOL_UNDERSCORE, 1, [Define if symbols are underscored.])
31 +    fi
32 +fi
33 +
34  case "$target" in
35       *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
36         AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
37 Index: libffi/src/x86/win64.S
38 ===================================================================
39 --- libffi.orig/src/x86/win64.S
40 +++ libffi/src/x86/win64.S
41 @@ -232,10 +232,18 @@ ret_void$:
42  ffi_call_win64 ENDP
43  _TEXT  ENDS
44  END
45 -#else        
46 +
47 +#else
48 +
49 +#ifdef SYMBOL_UNDERSCORE
50 +#define SYMBOL_NAME(name) _##name
51 +#else
52 +#define SYMBOL_NAME(name) name
53 +#endif
54 +
55  .text
56  
57 -.extern _ffi_closure_win64_inner
58 +.extern SYMBOL_NAME(ffi_closure_win64_inner)
59  
60  # ffi_closure_win64 will be called with these registers set:
61  #    rax points to 'closure'
62 @@ -246,8 +254,8 @@ END
63  # call ffi_closure_win64_inner for the actual work, then return the result.
64  # 
65         .balign 16
66 -        .globl _ffi_closure_win64      
67 -_ffi_closure_win64:     
68 +        .globl SYMBOL_NAME(ffi_closure_win64)
69 +SYMBOL_NAME(ffi_closure_win64):
70         # copy register arguments onto stack
71         test    $1,%r11
72         jne     .Lfirst_is_float        
73 @@ -287,7 +295,7 @@ _ffi_closure_win64:     
74         mov     %rax, %rcx      # context is first parameter
75         mov     %rsp, %rdx      # stack is second parameter
76         add     $48, %rdx       # point to start of arguments
77 -       mov     $_ffi_closure_win64_inner, %rax
78 +       mov     $SYMBOL_NAME(ffi_closure_win64_inner), %rax
79         callq   *%rax           # call the real closure function
80         add     $40, %rsp
81         movq    %rax, %xmm0     # If the closure returned a float,
82 @@ -296,8 +304,8 @@ _ffi_closure_win64:     
83  .ffi_closure_win64_end:
84  
85         .balign 16
86 -        .globl _ffi_call_win64
87 -_ffi_call_win64:        
88 +        .globl SYMBOL_NAME(ffi_call_win64)
89 +SYMBOL_NAME(ffi_call_win64):
90          # copy registers onto stack
91         mov     %r9,32(%rsp)
92         mov     %r8,24(%rsp)
93 Index: libffi/aclocal.m4
94 ===================================================================
95 --- libffi.orig/aclocal.m4
96 +++ libffi/aclocal.m4
97 @@ -19,6 +19,811 @@ You have another version of autoconf.  I
98  If you have problems, you may need to regenerate the build system entirely.
99  To do so, use the procedure documented by the package, typically `autoreconf'.])])
100  
101 +# ltdl.m4 - Configure ltdl for the target system. -*-Autoconf-*-
102 +#
103 +#   Copyright (C) 1999-2006, 2007, 2008 Free Software Foundation, Inc.
104 +#   Written by Thomas Tanner, 1999
105 +#
106 +# This file is free software; the Free Software Foundation gives
107 +# unlimited permission to copy and/or distribute it, with or without
108 +# modifications, as long as this notice is preserved.
109 +
110 +# serial 17 LTDL_INIT
111 +
112 +# LT_CONFIG_LTDL_DIR(DIRECTORY, [LTDL-MODE])
113 +# ------------------------------------------
114 +# DIRECTORY contains the libltdl sources.  It is okay to call this
115 +# function multiple times, as long as the same DIRECTORY is always given.
116 +AC_DEFUN([LT_CONFIG_LTDL_DIR],
117 +[AC_BEFORE([$0], [LTDL_INIT])
118 +_$0($*)
119 +])# LT_CONFIG_LTDL_DIR
120 +
121 +# We break this out into a separate macro, so that we can call it safely
122 +# internally without being caught accidentally by the sed scan in libtoolize.
123 +m4_defun([_LT_CONFIG_LTDL_DIR],
124 +[dnl remove trailing slashes
125 +m4_pushdef([_ARG_DIR], m4_bpatsubst([$1], [/*$]))
126 +m4_case(_LTDL_DIR,
127 +       [], [dnl only set lt_ltdl_dir if _ARG_DIR is not simply `.'
128 +            m4_if(_ARG_DIR, [.],
129 +                    [],
130 +                [m4_define([_LTDL_DIR], _ARG_DIR)
131 +                 _LT_SHELL_INIT([lt_ltdl_dir=']_ARG_DIR['])])],
132 +    [m4_if(_ARG_DIR, _LTDL_DIR,
133 +           [],
134 +       [m4_fatal([multiple libltdl directories: `]_LTDL_DIR[', `]_ARG_DIR['])])])
135 +m4_popdef([_ARG_DIR])
136 +])# _LT_CONFIG_LTDL_DIR
137 +
138 +# Initialise:
139 +m4_define([_LTDL_DIR], [])
140 +
141 +
142 +# _LT_BUILD_PREFIX
143 +# ----------------
144 +# If Autoconf is new enough, expand to `${top_build_prefix}', otherwise
145 +# to `${top_builddir}/'.
146 +m4_define([_LT_BUILD_PREFIX],
147 +[m4_ifdef([AC_AUTOCONF_VERSION],
148 +   [m4_if(m4_version_compare(m4_defn([AC_AUTOCONF_VERSION]), [2.62]),
149 +         [-1], [m4_ifdef([_AC_HAVE_TOP_BUILD_PREFIX],
150 +                         [${top_build_prefix}],
151 +                         [${top_builddir}/])],
152 +         [${top_build_prefix}])],
153 +   [${top_builddir}/])[]dnl
154 +])
155 +
156 +
157 +# LTDL_CONVENIENCE
158 +# ----------------
159 +# sets LIBLTDL to the link flags for the libltdl convenience library and
160 +# LTDLINCL to the include flags for the libltdl header and adds
161 +# --enable-ltdl-convenience to the configure arguments.  Note that
162 +# AC_CONFIG_SUBDIRS is not called here.  LIBLTDL will be prefixed with
163 +# '${top_build_prefix}' if available, otherwise with '${top_builddir}/',
164 +# and LTDLINCL will be prefixed with '${top_srcdir}/' (note the single
165 +# quotes!).  If your package is not flat and you're not using automake,
166 +# define top_build_prefix, top_builddir, and top_srcdir appropriately
167 +# in your Makefiles.
168 +AC_DEFUN([LTDL_CONVENIENCE],
169 +[AC_BEFORE([$0], [LTDL_INIT])dnl
170 +dnl Although the argument is deprecated and no longer documented,
171 +dnl LTDL_CONVENIENCE used to take a DIRECTORY orgument, if we have one
172 +dnl here make sure it is the same as any other declaration of libltdl's
173 +dnl location!  This also ensures lt_ltdl_dir is set when configure.ac is
174 +dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
175 +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
176 +_$0()
177 +])# LTDL_CONVENIENCE
178 +
179 +# AC_LIBLTDL_CONVENIENCE accepted a directory argument in older libtools,
180 +# now we have LT_CONFIG_LTDL_DIR:
181 +AU_DEFUN([AC_LIBLTDL_CONVENIENCE],
182 +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
183 +_LTDL_CONVENIENCE])
184 +
185 +dnl aclocal-1.4 backwards compatibility:
186 +dnl AC_DEFUN([AC_LIBLTDL_CONVENIENCE], [])
187 +
188 +
189 +# _LTDL_CONVENIENCE
190 +# -----------------
191 +# Code shared by LTDL_CONVENIENCE and LTDL_INIT([convenience]).
192 +m4_defun([_LTDL_CONVENIENCE],
193 +[case $enable_ltdl_convenience in
194 +  no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
195 +  "") enable_ltdl_convenience=yes
196 +      ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
197 +esac
198 +LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdlc.la"
199 +LTDLDEPS=$LIBLTDL
200 +LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
201 +
202 +AC_SUBST([LIBLTDL])
203 +AC_SUBST([LTDLDEPS])
204 +AC_SUBST([LTDLINCL])
205 +
206 +# For backwards non-gettext consistent compatibility...
207 +INCLTDL="$LTDLINCL"
208 +AC_SUBST([INCLTDL])
209 +])# _LTDL_CONVENIENCE
210 +
211 +
212 +# LTDL_INSTALLABLE
213 +# ----------------
214 +# sets LIBLTDL to the link flags for the libltdl installable library
215 +# and LTDLINCL to the include flags for the libltdl header and adds
216 +# --enable-ltdl-install to the configure arguments.  Note that
217 +# AC_CONFIG_SUBDIRS is not called from here.  If an installed libltdl
218 +# is not found, LIBLTDL will be prefixed with '${top_build_prefix}' if
219 +# available, otherwise with '${top_builddir}/', and LTDLINCL will be
220 +# prefixed with '${top_srcdir}/' (note the single quotes!).  If your
221 +# package is not flat and you're not using automake, define top_build_prefix,
222 +# top_builddir, and top_srcdir appropriately in your Makefiles.
223 +# In the future, this macro may have to be called after LT_INIT.
224 +AC_DEFUN([LTDL_INSTALLABLE],
225 +[AC_BEFORE([$0], [LTDL_INIT])dnl
226 +dnl Although the argument is deprecated and no longer documented,
227 +dnl LTDL_INSTALLABLE used to take a DIRECTORY orgument, if we have one
228 +dnl here make sure it is the same as any other declaration of libltdl's
229 +dnl location!  This also ensures lt_ltdl_dir is set when configure.ac is
230 +dnl not yet using an explicit LT_CONFIG_LTDL_DIR.
231 +m4_ifval([$1], [_LT_CONFIG_LTDL_DIR([$1])])dnl
232 +_$0()
233 +])# LTDL_INSTALLABLE
234 +
235 +# AC_LIBLTDL_INSTALLABLE accepted a directory argument in older libtools,
236 +# now we have LT_CONFIG_LTDL_DIR:
237 +AU_DEFUN([AC_LIBLTDL_INSTALLABLE],
238 +[_LT_CONFIG_LTDL_DIR([m4_default([$1], [libltdl])])
239 +_LTDL_INSTALLABLE])
240 +
241 +dnl aclocal-1.4 backwards compatibility:
242 +dnl AC_DEFUN([AC_LIBLTDL_INSTALLABLE], [])
243 +
244 +
245 +# _LTDL_INSTALLABLE
246 +# -----------------
247 +# Code shared by LTDL_INSTALLABLE and LTDL_INIT([installable]).
248 +m4_defun([_LTDL_INSTALLABLE],
249 +[if test -f $prefix/lib/libltdl.la; then
250 +  lt_save_LDFLAGS="$LDFLAGS"
251 +  LDFLAGS="-L$prefix/lib $LDFLAGS"
252 +  AC_CHECK_LIB([ltdl], [lt_dlinit], [lt_lib_ltdl=yes])
253 +  LDFLAGS="$lt_save_LDFLAGS"
254 +  if test x"${lt_lib_ltdl-no}" = xyes; then
255 +    if test x"$enable_ltdl_install" != xyes; then
256 +      # Don't overwrite $prefix/lib/libltdl.la without --enable-ltdl-install
257 +      AC_MSG_WARN([not overwriting libltdl at $prefix, force with `--enable-ltdl-install'])
258 +      enable_ltdl_install=no
259 +    fi
260 +  elif test x"$enable_ltdl_install" = xno; then
261 +    AC_MSG_WARN([libltdl not installed, but installation disabled])
262 +  fi
263 +fi
264 +
265 +# If configure.ac declared an installable ltdl, and the user didn't override
266 +# with --disable-ltdl-install, we will install the shipped libltdl.
267 +case $enable_ltdl_install in
268 +  no) ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
269 +      LIBLTDL="-lltdl"
270 +      LTDLDEPS=
271 +      LTDLINCL=
272 +      ;;
273 +  *)  enable_ltdl_install=yes
274 +      ac_configure_args="$ac_configure_args --enable-ltdl-install"
275 +      LIBLTDL='_LT_BUILD_PREFIX'"${lt_ltdl_dir+$lt_ltdl_dir/}libltdl.la"
276 +      LTDLDEPS=$LIBLTDL
277 +      LTDLINCL='-I${top_srcdir}'"${lt_ltdl_dir+/$lt_ltdl_dir}"
278 +      ;;
279 +esac
280 +
281 +AC_SUBST([LIBLTDL])
282 +AC_SUBST([LTDLDEPS])
283 +AC_SUBST([LTDLINCL])
284 +
285 +# For backwards non-gettext consistent compatibility...
286 +INCLTDL="$LTDLINCL"
287 +AC_SUBST([INCLTDL])
288 +])# LTDL_INSTALLABLE
289 +
290 +
291 +# _LTDL_MODE_DISPATCH
292 +# -------------------
293 +m4_define([_LTDL_MODE_DISPATCH],
294 +[dnl If _LTDL_DIR is `.', then we are configuring libltdl itself:
295 +m4_if(_LTDL_DIR, [],
296 +       [],
297 +    dnl if _LTDL_MODE was not set already, the default value is `subproject':
298 +    [m4_case(m4_default(_LTDL_MODE, [subproject]),
299 +         [subproject], [AC_CONFIG_SUBDIRS(_LTDL_DIR)
300 +                         _LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"])],
301 +         [nonrecursive], [_LT_SHELL_INIT([lt_dlopen_dir="$lt_ltdl_dir"; lt_libobj_prefix="$lt_ltdl_dir/"])],
302 +         [recursive], [],
303 +       [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])dnl
304 +dnl Be careful not to expand twice:
305 +m4_define([$0], [])
306 +])# _LTDL_MODE_DISPATCH
307 +
308 +
309 +# _LT_LIBOBJ(MODULE_NAME)
310 +# -----------------------
311 +# Like AC_LIBOBJ, except that MODULE_NAME goes into _LT_LIBOBJS instead
312 +# of into LIBOBJS.
313 +AC_DEFUN([_LT_LIBOBJ], [
314 +  m4_pattern_allow([^_LT_LIBOBJS$])
315 +  _LT_LIBOBJS="$_LT_LIBOBJS $1.$ac_objext"
316 +])# _LT_LIBOBJS
317 +
318 +
319 +# LTDL_INIT([OPTIONS])
320 +# --------------------
321 +# Clients of libltdl can use this macro to allow the installer to
322 +# choose between a shipped copy of the ltdl sources or a preinstalled
323 +# version of the library.  If the shipped ltdl sources are not in a
324 +# subdirectory named libltdl, the directory name must be given by
325 +# LT_CONFIG_LTDL_DIR.
326 +AC_DEFUN([LTDL_INIT],
327 +[dnl Parse OPTIONS
328 +_LT_SET_OPTIONS([$0], [$1])
329 +
330 +dnl We need to keep our own list of libobjs separate from our parent project,
331 +dnl and the easiest way to do that is redefine the AC_LIBOBJs macro while
332 +dnl we look for our own LIBOBJs.
333 +m4_pushdef([AC_LIBOBJ], m4_defn([_LT_LIBOBJ]))
334 +m4_pushdef([AC_LIBSOURCES])
335 +
336 +dnl If not otherwise defined, default to the 1.5.x compatible subproject mode:
337 +m4_if(_LTDL_MODE, [],
338 +        [m4_define([_LTDL_MODE], m4_default([$2], [subproject]))
339 +        m4_if([-1], [m4_bregexp(_LTDL_MODE, [\(subproject\|\(non\)?recursive\)])],
340 +                [m4_fatal([unknown libltdl mode: ]_LTDL_MODE)])])
341 +
342 +AC_ARG_WITH([included_ltdl],
343 +    [AS_HELP_STRING([--with-included-ltdl],
344 +                    [use the GNU ltdl sources included here])])
345 +
346 +if test "x$with_included_ltdl" != xyes; then
347 +  # We are not being forced to use the included libltdl sources, so
348 +  # decide whether there is a useful installed version we can use.
349 +  AC_CHECK_HEADER([ltdl.h],
350 +      [AC_CHECK_DECL([lt_dlinterface_register],
351 +          [AC_CHECK_LIB([ltdl], [lt_dladvise_preload],
352 +              [with_included_ltdl=no],
353 +              [with_included_ltdl=yes])],
354 +          [with_included_ltdl=yes],
355 +          [AC_INCLUDES_DEFAULT
356 +           #include <ltdl.h>])],
357 +      [with_included_ltdl=yes],
358 +      [AC_INCLUDES_DEFAULT]
359 +  )
360 +fi
361 +
362 +dnl If neither LT_CONFIG_LTDL_DIR, LTDL_CONVENIENCE nor LTDL_INSTALLABLE
363 +dnl was called yet, then for old times' sake, we assume libltdl is in an
364 +dnl eponymous directory:
365 +AC_PROVIDE_IFELSE([LT_CONFIG_LTDL_DIR], [], [_LT_CONFIG_LTDL_DIR([libltdl])])
366 +
367 +AC_ARG_WITH([ltdl_include],
368 +    [AS_HELP_STRING([--with-ltdl-include=DIR],
369 +                    [use the ltdl headers installed in DIR])])
370 +
371 +if test -n "$with_ltdl_include"; then
372 +  if test -f "$with_ltdl_include/ltdl.h"; then :
373 +  else
374 +    AC_MSG_ERROR([invalid ltdl include directory: `$with_ltdl_include'])
375 +  fi
376 +else
377 +  with_ltdl_include=no
378 +fi
379 +
380 +AC_ARG_WITH([ltdl_lib],
381 +    [AS_HELP_STRING([--with-ltdl-lib=DIR],
382 +                    [use the libltdl.la installed in DIR])])
383 +
384 +if test -n "$with_ltdl_lib"; then
385 +  if test -f "$with_ltdl_lib/libltdl.la"; then :
386 +  else
387 +    AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
388 +  fi
389 +else
390 +  with_ltdl_lib=no
391 +fi
392 +
393 +case ,$with_included_ltdl,$with_ltdl_include,$with_ltdl_lib, in
394 +  ,yes,no,no,)
395 +       m4_case(m4_default(_LTDL_TYPE, [convenience]),
396 +           [convenience], [_LTDL_CONVENIENCE],
397 +           [installable], [_LTDL_INSTALLABLE],
398 +         [m4_fatal([unknown libltdl build type: ]_LTDL_TYPE)])
399 +       ;;
400 +  ,no,no,no,)
401 +       # If the included ltdl is not to be used, then use the
402 +       # preinstalled libltdl we found.
403 +       AC_DEFINE([HAVE_LTDL], [1],
404 +         [Define this if a modern libltdl is already installed])
405 +       LIBLTDL=-lltdl
406 +       LTDLDEPS=
407 +       LTDLINCL=
408 +       ;;
409 +  ,no*,no,*)
410 +       AC_MSG_ERROR([`--with-ltdl-include' and `--with-ltdl-lib' options must be used together])
411 +       ;;
412 +  *)   with_included_ltdl=no
413 +       LIBLTDL="-L$with_ltdl_lib -lltdl"
414 +       LTDLDEPS=
415 +       LTDLINCL="-I$with_ltdl_include"
416 +       ;;
417 +esac
418 +INCLTDL="$LTDLINCL"
419 +
420 +# Report our decision...
421 +AC_MSG_CHECKING([where to find libltdl headers])
422 +AC_MSG_RESULT([$LTDLINCL])
423 +AC_MSG_CHECKING([where to find libltdl library])
424 +AC_MSG_RESULT([$LIBLTDL])
425 +
426 +_LTDL_SETUP
427 +
428 +dnl restore autoconf definition.
429 +m4_popdef([AC_LIBOBJ])
430 +m4_popdef([AC_LIBSOURCES])
431 +
432 +AC_CONFIG_COMMANDS_PRE([
433 +    _ltdl_libobjs=
434 +    _ltdl_ltlibobjs=
435 +    if test -n "$_LT_LIBOBJS"; then
436 +      # Remove the extension.
437 +      _lt_sed_drop_objext='s/\.o$//;s/\.obj$//'
438 +      for i in `for i in $_LT_LIBOBJS; do echo "$i"; done | sed "$_lt_sed_drop_objext" | sort -u`; do
439 +        _ltdl_libobjs="$_ltdl_libobjs $lt_libobj_prefix$i.$ac_objext"
440 +        _ltdl_ltlibobjs="$_ltdl_ltlibobjs $lt_libobj_prefix$i.lo"
441 +      done
442 +    fi
443 +    AC_SUBST([ltdl_LIBOBJS], [$_ltdl_libobjs])
444 +    AC_SUBST([ltdl_LTLIBOBJS], [$_ltdl_ltlibobjs])
445 +])
446 +
447 +# Only expand once:
448 +m4_define([LTDL_INIT])
449 +])# LTDL_INIT
450 +
451 +# Old names:
452 +AU_DEFUN([AC_LIB_LTDL], [LTDL_INIT($@)])
453 +AU_DEFUN([AC_WITH_LTDL], [LTDL_INIT($@)])
454 +AU_DEFUN([LT_WITH_LTDL], [LTDL_INIT($@)])
455 +dnl aclocal-1.4 backwards compatibility:
456 +dnl AC_DEFUN([AC_LIB_LTDL], [])
457 +dnl AC_DEFUN([AC_WITH_LTDL], [])
458 +dnl AC_DEFUN([LT_WITH_LTDL], [])
459 +
460 +
461 +# _LTDL_SETUP
462 +# -----------
463 +# Perform all the checks necessary for compilation of the ltdl objects
464 +#  -- including compiler checks and header checks.  This is a public
465 +# interface  mainly for the benefit of libltdl's own configure.ac, most
466 +# other users should call LTDL_INIT instead.
467 +AC_DEFUN([_LTDL_SETUP],
468 +[AC_REQUIRE([AC_PROG_CC])dnl
469 +AC_REQUIRE([LT_SYS_MODULE_EXT])dnl
470 +AC_REQUIRE([LT_SYS_MODULE_PATH])dnl
471 +AC_REQUIRE([LT_SYS_DLSEARCH_PATH])dnl
472 +AC_REQUIRE([LT_LIB_DLLOAD])dnl
473 +AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
474 +AC_REQUIRE([LT_FUNC_DLSYM_USCORE])dnl
475 +AC_REQUIRE([LT_SYS_DLOPEN_DEPLIBS])dnl
476 +AC_REQUIRE([gl_FUNC_ARGZ])dnl
477 +
478 +m4_require([_LT_CHECK_OBJDIR])dnl
479 +m4_require([_LT_HEADER_DLFCN])dnl
480 +m4_require([_LT_CHECK_DLPREOPEN])dnl
481 +m4_require([_LT_DECL_SED])dnl
482 +
483 +dnl Don't require this, or it will be expanded earlier than the code
484 +dnl that sets the variables it relies on:
485 +_LT_ENABLE_INSTALL
486 +
487 +dnl _LTDL_MODE specific code must be called at least once:
488 +_LTDL_MODE_DISPATCH
489 +
490 +# In order that ltdl.c can compile, find out the first AC_CONFIG_HEADERS
491 +# the user used.  This is so that ltdl.h can pick up the parent projects
492 +# config.h file, The first file in AC_CONFIG_HEADERS must contain the
493 +# definitions required by ltdl.c.
494 +# FIXME: Remove use of undocumented AC_LIST_HEADERS (2.59 compatibility).
495 +AC_CONFIG_COMMANDS_PRE([dnl
496 +m4_pattern_allow([^LT_CONFIG_H$])dnl
497 +m4_ifset([AH_HEADER],
498 +    [LT_CONFIG_H=AH_HEADER],
499 +    [m4_ifset([AC_LIST_HEADERS],
500 +           [LT_CONFIG_H=`echo "AC_LIST_HEADERS" | $SED 's,^[[      ]]*,,;s,[[ :]].*$,,'`],
501 +       [])])])
502 +AC_SUBST([LT_CONFIG_H])
503 +
504 +AC_CHECK_HEADERS([unistd.h dl.h sys/dl.h dld.h mach-o/dyld.h dirent.h],
505 +       [], [], [AC_INCLUDES_DEFAULT])
506 +
507 +AC_CHECK_FUNCS([closedir opendir readdir], [], [AC_LIBOBJ([lt__dirent])])
508 +AC_CHECK_FUNCS([strlcat strlcpy], [], [AC_LIBOBJ([lt__strl])])
509 +
510 +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
511 +
512 +name=ltdl
513 +LTDLOPEN=`eval "\\$ECHO \"$libname_spec\""`
514 +AC_SUBST([LTDLOPEN])
515 +])# _LTDL_SETUP
516 +
517 +
518 +# _LT_ENABLE_INSTALL
519 +# ------------------
520 +m4_define([_LT_ENABLE_INSTALL],
521 +[AC_ARG_ENABLE([ltdl-install],
522 +    [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
523 +
524 +case ,${enable_ltdl_install},${enable_ltdl_convenience} in
525 +  *yes*) ;;
526 +  *) enable_ltdl_convenience=yes ;;
527 +esac
528 +
529 +m4_ifdef([AM_CONDITIONAL],
530 +[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
531 + AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
532 +])# _LT_ENABLE_INSTALL
533 +
534 +
535 +# LT_SYS_DLOPEN_DEPLIBS
536 +# ---------------------
537 +AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
538 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
539 +AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
540 +  [lt_cv_sys_dlopen_deplibs],
541 +  [# PORTME does your system automatically load deplibs for dlopen?
542 +  # or its logical equivalent (e.g. shl_load for HP-UX < 11)
543 +  # For now, we just catch OSes we know something about -- in the
544 +  # future, we'll try test this programmatically.
545 +  lt_cv_sys_dlopen_deplibs=unknown
546 +  case $host_os in
547 +  aix3*|aix4.1.*|aix4.2.*)
548 +    # Unknown whether this is true for these versions of AIX, but
549 +    # we want this `case' here to explicitly catch those versions.
550 +    lt_cv_sys_dlopen_deplibs=unknown
551 +    ;;
552 +  aix[[4-9]]*)
553 +    lt_cv_sys_dlopen_deplibs=yes
554 +    ;;
555 +  amigaos*)
556 +    case $host_cpu in
557 +    powerpc)
558 +      lt_cv_sys_dlopen_deplibs=no
559 +      ;;
560 +    esac
561 +    ;;
562 +  darwin*)
563 +    # Assuming the user has installed a libdl from somewhere, this is true
564 +    # If you are looking for one http://www.opendarwin.org/projects/dlcompat
565 +    lt_cv_sys_dlopen_deplibs=yes
566 +    ;;
567 +  freebsd* | dragonfly*)
568 +    lt_cv_sys_dlopen_deplibs=yes
569 +    ;;
570 +  gnu* | linux* | k*bsd*-gnu)
571 +    # GNU and its variants, using gnu ld.so (Glibc)
572 +    lt_cv_sys_dlopen_deplibs=yes
573 +    ;;
574 +  hpux10*|hpux11*)
575 +    lt_cv_sys_dlopen_deplibs=yes
576 +    ;;
577 +  interix*)
578 +    lt_cv_sys_dlopen_deplibs=yes
579 +    ;;
580 +  irix[[12345]]*|irix6.[[01]]*)
581 +    # Catch all versions of IRIX before 6.2, and indicate that we don't
582 +    # know how it worked for any of those versions.
583 +    lt_cv_sys_dlopen_deplibs=unknown
584 +    ;;
585 +  irix*)
586 +    # The case above catches anything before 6.2, and it's known that
587 +    # at 6.2 and later dlopen does load deplibs.
588 +    lt_cv_sys_dlopen_deplibs=yes
589 +    ;;
590 +  netbsd*)
591 +    lt_cv_sys_dlopen_deplibs=yes
592 +    ;;
593 +  openbsd*)
594 +    lt_cv_sys_dlopen_deplibs=yes
595 +    ;;
596 +  osf[[1234]]*)
597 +    # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
598 +    # it did *not* use an RPATH in a shared library to find objects the
599 +    # library depends on, so we explicitly say `no'.
600 +    lt_cv_sys_dlopen_deplibs=no
601 +    ;;
602 +  osf5.0|osf5.0a|osf5.1)
603 +    # dlopen *does* load deplibs and with the right loader patch applied
604 +    # it even uses RPATH in a shared library to search for shared objects
605 +    # that the library depends on, but there's no easy way to know if that
606 +    # patch is installed.  Since this is the case, all we can really
607 +    # say is unknown -- it depends on the patch being installed.  If
608 +    # it is, this changes to `yes'.  Without it, it would be `no'.
609 +    lt_cv_sys_dlopen_deplibs=unknown
610 +    ;;
611 +  osf*)
612 +    # the two cases above should catch all versions of osf <= 5.1.  Read
613 +    # the comments above for what we know about them.
614 +    # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
615 +    # is used to find them so we can finally say `yes'.
616 +    lt_cv_sys_dlopen_deplibs=yes
617 +    ;;
618 +  qnx*)
619 +    lt_cv_sys_dlopen_deplibs=yes
620 +    ;;
621 +  solaris*)
622 +    lt_cv_sys_dlopen_deplibs=yes
623 +    ;;
624 +  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
625 +    libltdl_cv_sys_dlopen_deplibs=yes
626 +    ;;
627 +  esac
628 +  ])
629 +if test "$lt_cv_sys_dlopen_deplibs" != yes; then
630 + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
631 +    [Define if the OS needs help to load dependent libraries for dlopen().])
632 +fi
633 +])# LT_SYS_DLOPEN_DEPLIBS
634 +
635 +# Old name:
636 +AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
637 +dnl aclocal-1.4 backwards compatibility:
638 +dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
639 +
640 +
641 +# LT_SYS_MODULE_EXT
642 +# -----------------
643 +AC_DEFUN([LT_SYS_MODULE_EXT],
644 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
645 +AC_CACHE_CHECK([which extension is used for runtime loadable modules],
646 +  [libltdl_cv_shlibext],
647 +[
648 +module=yes
649 +eval libltdl_cv_shlibext=$shrext_cmds
650 +  ])
651 +if test -n "$libltdl_cv_shlibext"; then
652 +  m4_pattern_allow([LT_MODULE_EXT])dnl
653 +  AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
654 +    [Define to the extension used for runtime loadable modules, say, ".so".])
655 +fi
656 +])# LT_SYS_MODULE_EXT
657 +
658 +# Old name:
659 +AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
660 +dnl aclocal-1.4 backwards compatibility:
661 +dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
662 +
663 +
664 +# LT_SYS_MODULE_PATH
665 +# ------------------
666 +AC_DEFUN([LT_SYS_MODULE_PATH],
667 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
668 +AC_CACHE_CHECK([which variable specifies run-time module search path],
669 +  [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
670 +if test -n "$lt_cv_module_path_var"; then
671 +  m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
672 +  AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
673 +    [Define to the name of the environment variable that determines the run-time module search path.])
674 +fi
675 +])# LT_SYS_MODULE_PATH
676 +
677 +# Old name:
678 +AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
679 +dnl aclocal-1.4 backwards compatibility:
680 +dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
681 +
682 +
683 +# LT_SYS_DLSEARCH_PATH
684 +# --------------------
685 +AC_DEFUN([LT_SYS_DLSEARCH_PATH],
686 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
687 +AC_CACHE_CHECK([for the default library search path],
688 +  [lt_cv_sys_dlsearch_path],
689 +  [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
690 +if test -n "$lt_cv_sys_dlsearch_path"; then
691 +  sys_dlsearch_path=
692 +  for dir in $lt_cv_sys_dlsearch_path; do
693 +    if test -z "$sys_dlsearch_path"; then
694 +      sys_dlsearch_path="$dir"
695 +    else
696 +      sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
697 +    fi
698 +  done
699 +  m4_pattern_allow([LT_DLSEARCH_PATH])dnl
700 +  AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
701 +    [Define to the system default library search path.])
702 +fi
703 +])# LT_SYS_DLSEARCH_PATH
704 +
705 +# Old name:
706 +AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
707 +dnl aclocal-1.4 backwards compatibility:
708 +dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
709 +
710 +
711 +# _LT_CHECK_DLPREOPEN
712 +# -------------------
713 +m4_defun([_LT_CHECK_DLPREOPEN],
714 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
715 +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
716 +  [libltdl_cv_preloaded_symbols],
717 +  [if test -n "$lt_cv_sys_global_symbol_pipe"; then
718 +    libltdl_cv_preloaded_symbols=yes
719 +  else
720 +    libltdl_cv_preloaded_symbols=no
721 +  fi
722 +  ])
723 +if test x"$libltdl_cv_preloaded_symbols" = xyes; then
724 +  AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
725 +    [Define if libtool can extract symbol lists from object files.])
726 +fi
727 +])# _LT_CHECK_DLPREOPEN
728 +
729 +
730 +# LT_LIB_DLLOAD
731 +# -------------
732 +AC_DEFUN([LT_LIB_DLLOAD],
733 +[m4_pattern_allow([^LT_DLLOADERS$])
734 +LT_DLLOADERS=
735 +AC_SUBST([LT_DLLOADERS])
736 +
737 +AC_LANG_PUSH([C])
738 +
739 +LIBADD_DLOPEN=
740 +AC_SEARCH_LIBS([dlopen], [dl],
741 +       [AC_DEFINE([HAVE_LIBDL], [1],
742 +                  [Define if you have the libdl library or equivalent.])
743 +       if test "$ac_cv_search_dlopen" != "none required" ; then
744 +         LIBADD_DLOPEN="-ldl"
745 +       fi
746 +       libltdl_cv_lib_dl_dlopen="yes"
747 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
748 +    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
749 +#  include <dlfcn.h>
750 +#endif
751 +    ]], [[dlopen(0, 0);]])],
752 +           [AC_DEFINE([HAVE_LIBDL], [1],
753 +                      [Define if you have the libdl library or equivalent.])
754 +           libltdl_cv_func_dlopen="yes"
755 +           LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
756 +       [AC_CHECK_LIB([svld], [dlopen],
757 +               [AC_DEFINE([HAVE_LIBDL], [1],
758 +                        [Define if you have the libdl library or equivalent.])
759 +               LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
760 +               LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
761 +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
762 +then
763 +  lt_save_LIBS="$LIBS"
764 +  LIBS="$LIBS $LIBADD_DLOPEN"
765 +  AC_CHECK_FUNCS([dlerror])
766 +  LIBS="$lt_save_LIBS"
767 +fi
768 +AC_SUBST([LIBADD_DLOPEN])
769 +
770 +LIBADD_SHL_LOAD=
771 +AC_CHECK_FUNC([shl_load],
772 +       [AC_DEFINE([HAVE_SHL_LOAD], [1],
773 +                  [Define if you have the shl_load function.])
774 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
775 +    [AC_CHECK_LIB([dld], [shl_load],
776 +           [AC_DEFINE([HAVE_SHL_LOAD], [1],
777 +                      [Define if you have the shl_load function.])
778 +           LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
779 +           LIBADD_SHL_LOAD="-ldld"])])
780 +AC_SUBST([LIBADD_SHL_LOAD])
781 +
782 +case $host_os in
783 +darwin[[1567]].*)
784 +# We only want this for pre-Mac OS X 10.4.
785 +  AC_CHECK_FUNC([_dyld_func_lookup],
786 +       [AC_DEFINE([HAVE_DYLD], [1],
787 +                  [Define if you have the _dyld_func_lookup function.])
788 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
789 +  ;;
790 +beos*)
791 +  LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
792 +  ;;
793 +cygwin* | mingw* | os2* | pw32*)
794 +  AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
795 +  LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
796 +  ;;
797 +esac
798 +
799 +AC_CHECK_LIB([dld], [dld_link],
800 +       [AC_DEFINE([HAVE_DLD], [1],
801 +                  [Define if you have the GNU dld library.])
802 +               LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
803 +AC_SUBST([LIBADD_DLD_LINK])
804 +
805 +m4_pattern_allow([^LT_DLPREOPEN$])
806 +LT_DLPREOPEN=
807 +if test -n "$LT_DLLOADERS"
808 +then
809 +  for lt_loader in $LT_DLLOADERS; do
810 +    LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
811 +  done
812 +  AC_DEFINE([HAVE_LIBDLLOADER], [1],
813 +            [Define if libdlloader will be built on this platform])
814 +fi
815 +AC_SUBST([LT_DLPREOPEN])
816 +
817 +dnl This isn't used anymore, but set it for backwards compatibility
818 +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
819 +AC_SUBST([LIBADD_DL])
820 +
821 +AC_LANG_POP
822 +])# LT_LIB_DLLOAD
823 +
824 +# Old name:
825 +AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
826 +dnl aclocal-1.4 backwards compatibility:
827 +dnl AC_DEFUN([AC_LTDL_DLLIB], [])
828 +
829 +
830 +# LT_SYS_SYMBOL_USCORE
831 +# --------------------
832 +# does the compiler prefix global symbols with an underscore?
833 +AC_DEFUN([LT_SYS_SYMBOL_USCORE],
834 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
835 +AC_CACHE_CHECK([for _ prefix in compiled symbols],
836 +  [lt_cv_sys_symbol_underscore],
837 +  [lt_cv_sys_symbol_underscore=no
838 +  cat > conftest.$ac_ext <<_LT_EOF
839 +void nm_test_func(){}
840 +int main(){nm_test_func;return 0;}
841 +_LT_EOF
842 +  if AC_TRY_EVAL(ac_compile); then
843 +    # Now try to grab the symbols.
844 +    ac_nlist=conftest.nm
845 +    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
846 +      # See whether the symbols have a leading underscore.
847 +      if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
848 +        lt_cv_sys_symbol_underscore=yes
849 +      else
850 +        if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
851 +         :
852 +        else
853 +         echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
854 +        fi
855 +      fi
856 +    else
857 +      echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
858 +    fi
859 +  else
860 +    echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
861 +    cat conftest.c >&AS_MESSAGE_LOG_FD
862 +  fi
863 +  rm -rf conftest*
864 +  ])
865 +  sys_symbol_underscore=$lt_cv_sys_symbol_underscore
866 +  AC_SUBST([sys_symbol_underscore])
867 +])# LT_SYS_SYMBOL_USCORE
868 +
869 +# Old name:
870 +AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
871 +dnl aclocal-1.4 backwards compatibility:
872 +dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
873 +
874 +
875 +# LT_FUNC_DLSYM_USCORE
876 +# --------------------
877 +AC_DEFUN([LT_FUNC_DLSYM_USCORE],
878 +[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
879 +if test x"$lt_cv_sys_symbol_underscore" = xyes; then
880 +  if test x"$libltdl_cv_func_dlopen" = xyes ||
881 +     test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
882 +       AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
883 +         [libltdl_cv_need_uscore],
884 +         [libltdl_cv_need_uscore=unknown
885 +          save_LIBS="$LIBS"
886 +          LIBS="$LIBS $LIBADD_DLOPEN"
887 +         _LT_TRY_DLOPEN_SELF(
888 +           [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
889 +           [],                          [libltdl_cv_need_uscore=cross])
890 +         LIBS="$save_LIBS"
891 +       ])
892 +  fi
893 +fi
894 +
895 +if test x"$libltdl_cv_need_uscore" = xyes; then
896 +  AC_DEFINE([NEED_USCORE], [1],
897 +    [Define if dlsym() requires a leading underscore in symbol names.])
898 +fi
899 +])# LT_FUNC_DLSYM_USCORE
900 +
901 +# Old name:
902 +AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
903 +dnl aclocal-1.4 backwards compatibility:
904 +dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
905 +
906  # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
907  #
908  # This file is free software; the Free Software Foundation
909 Index: libffi/configure
910 ===================================================================
911 --- libffi.orig/configure
912 +++ libffi/configure
913 @@ -795,6 +795,7 @@ FFI_DEBUG_FALSE
914  FFI_DEBUG_TRUE
915  TARGETDIR
916  TARGET
917 +sys_symbol_underscore
918  HAVE_LONG_DOUBLE
919  ALLOCA
920  PA64_HPUX_FALSE
921 @@ -4782,13 +4783,13 @@ if test "${lt_cv_nm_interface+set}" = se
922  else
923    lt_cv_nm_interface="BSD nm"
924    echo "int some_variable = 0;" > conftest.$ac_ext
925 -  (eval echo "\"\$as_me:4785: $ac_compile\"" >&5)
926 +  (eval echo "\"\$as_me:4786: $ac_compile\"" >&5)
927    (eval "$ac_compile" 2>conftest.err)
928    cat conftest.err >&5
929 -  (eval echo "\"\$as_me:4788: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
930 +  (eval echo "\"\$as_me:4789: $NM \\\"conftest.$ac_objext\\\"\"" >&5)
931    (eval "$NM \"conftest.$ac_objext\"" 2>conftest.err > conftest.out)
932    cat conftest.err >&5
933 -  (eval echo "\"\$as_me:4791: output\"" >&5)
934 +  (eval echo "\"\$as_me:4792: output\"" >&5)
935    cat conftest.out >&5
936    if $GREP 'External.*some_variable' conftest.out > /dev/null; then
937      lt_cv_nm_interface="MS dumpbin"
938 @@ -5994,7 +5995,7 @@ ia64-*-hpux*)
939    ;;
940  *-*-irix6*)
941    # Find out which ABI we are using.
942 -  echo '#line 5997 "configure"' > conftest.$ac_ext
943 +  echo '#line 5998 "configure"' > conftest.$ac_ext
944    if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
945    (eval $ac_compile) 2>&5
946    ac_status=$?
947 @@ -7851,11 +7852,11 @@ else
948     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
949     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
950     -e 's:$: $lt_compiler_flag:'`
951 -   (eval echo "\"\$as_me:7854: $lt_compile\"" >&5)
952 +   (eval echo "\"\$as_me:7855: $lt_compile\"" >&5)
953     (eval "$lt_compile" 2>conftest.err)
954     ac_status=$?
955     cat conftest.err >&5
956 -   echo "$as_me:7858: \$? = $ac_status" >&5
957 +   echo "$as_me:7859: \$? = $ac_status" >&5
958     if (exit $ac_status) && test -s "$ac_outfile"; then
959       # The compiler can only warn and ignore the option if not recognized
960       # So say no if there are warnings other than the usual output.
961 @@ -8190,11 +8191,11 @@ else
962     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
963     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
964     -e 's:$: $lt_compiler_flag:'`
965 -   (eval echo "\"\$as_me:8193: $lt_compile\"" >&5)
966 +   (eval echo "\"\$as_me:8194: $lt_compile\"" >&5)
967     (eval "$lt_compile" 2>conftest.err)
968     ac_status=$?
969     cat conftest.err >&5
970 -   echo "$as_me:8197: \$? = $ac_status" >&5
971 +   echo "$as_me:8198: \$? = $ac_status" >&5
972     if (exit $ac_status) && test -s "$ac_outfile"; then
973       # The compiler can only warn and ignore the option if not recognized
974       # So say no if there are warnings other than the usual output.
975 @@ -8295,11 +8296,11 @@ else
976     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
977     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
978     -e 's:$: $lt_compiler_flag:'`
979 -   (eval echo "\"\$as_me:8298: $lt_compile\"" >&5)
980 +   (eval echo "\"\$as_me:8299: $lt_compile\"" >&5)
981     (eval "$lt_compile" 2>out/conftest.err)
982     ac_status=$?
983     cat out/conftest.err >&5
984 -   echo "$as_me:8302: \$? = $ac_status" >&5
985 +   echo "$as_me:8303: \$? = $ac_status" >&5
986     if (exit $ac_status) && test -s out/conftest2.$ac_objext
987     then
988       # The compiler can only warn and ignore the option if not recognized
989 @@ -8350,11 +8351,11 @@ else
990     -e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
991     -e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
992     -e 's:$: $lt_compiler_flag:'`
993 -   (eval echo "\"\$as_me:8353: $lt_compile\"" >&5)
994 +   (eval echo "\"\$as_me:8354: $lt_compile\"" >&5)
995     (eval "$lt_compile" 2>out/conftest.err)
996     ac_status=$?
997     cat out/conftest.err >&5
998 -   echo "$as_me:8357: \$? = $ac_status" >&5
999 +   echo "$as_me:8358: \$? = $ac_status" >&5
1000     if (exit $ac_status) && test -s out/conftest2.$ac_objext
1001     then
1002       # The compiler can only warn and ignore the option if not recognized
1003 @@ -11153,7 +11154,7 @@ else
1004    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1005    lt_status=$lt_dlunknown
1006    cat > conftest.$ac_ext <<_LT_EOF
1007 -#line 11156 "configure"
1008 +#line 11157 "configure"
1009  #include "confdefs.h"
1010  
1011  #if HAVE_DLFCN_H
1012 @@ -11249,7 +11250,7 @@ else
1013    lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
1014    lt_status=$lt_dlunknown
1015    cat > conftest.$ac_ext <<_LT_EOF
1016 -#line 11252 "configure"
1017 +#line 11253 "configure"
1018  #include "confdefs.h"
1019  
1020  #if HAVE_DLFCN_H
1021 @@ -14658,6 +14659,63 @@ _ACEOF
1022      fi
1023  fi
1024  
1025 +if test x$TARGET = xX86_WIN64; then
1026 +    { $as_echo "$as_me:$LINENO: checking for _ prefix in compiled symbols" >&5
1027 +$as_echo_n "checking for _ prefix in compiled symbols... " >&6; }
1028 +if test "${lt_cv_sys_symbol_underscore+set}" = set; then
1029 +  $as_echo_n "(cached) " >&6
1030 +else
1031 +  lt_cv_sys_symbol_underscore=no
1032 +  cat > conftest.$ac_ext <<_LT_EOF
1033 +void nm_test_func(){}
1034 +int main(){nm_test_func;return 0;}
1035 +_LT_EOF
1036 +  if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
1037 +  (eval $ac_compile) 2>&5
1038 +  ac_status=$?
1039 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1040 +  (exit $ac_status); }; then
1041 +    # Now try to grab the symbols.
1042 +    ac_nlist=conftest.nm
1043 +    if { (eval echo "$as_me:$LINENO: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\"") >&5
1044 +  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
1045 +  ac_status=$?
1046 +  $as_echo "$as_me:$LINENO: \$? = $ac_status" >&5
1047 +  (exit $ac_status); } && test -s "$ac_nlist"; then
1048 +      # See whether the symbols have a leading underscore.
1049 +      if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
1050 +        lt_cv_sys_symbol_underscore=yes
1051 +      else
1052 +        if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
1053 +         :
1054 +        else
1055 +         echo "configure: cannot find nm_test_func in $ac_nlist" >&5
1056 +        fi
1057 +      fi
1058 +    else
1059 +      echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5
1060 +    fi
1061 +  else
1062 +    echo "configure: failed program was:" >&5
1063 +    cat conftest.c >&5
1064 +  fi
1065 +  rm -rf conftest*
1066 +
1067 +fi
1068 +{ $as_echo "$as_me:$LINENO: result: $lt_cv_sys_symbol_underscore" >&5
1069 +$as_echo "$lt_cv_sys_symbol_underscore" >&6; }
1070 +  sys_symbol_underscore=$lt_cv_sys_symbol_underscore
1071 +
1072 +
1073 +    if test "x$sys_symbol_underscore" = xyes; then
1074 +
1075 +cat >>confdefs.h <<\_ACEOF
1076 +#define SYMBOL_UNDERSCORE 1
1077 +_ACEOF
1078 +
1079 +    fi
1080 +fi
1081 +
1082  case "$target" in
1083       *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)
1084