Rebased from gcc
[libffi.git] / patches / win64-underscore
1 Index: libffi/ChangeLog
2 ===================================================================
3 --- libffi.orig/ChangeLog
4 +++ libffi/ChangeLog
5 @@ -176,6 +176,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 @@ -324,6 +324,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,817 @@ 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 18 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 +m4_pattern_allow([LT_LIBEXT])dnl
511 +AC_DEFINE_UNQUOTED([LT_LIBEXT],["$libext"],[The archive extension])
512 +
513 +name=
514 +eval "lt_libprefix=\"$libname_spec\""
515 +m4_pattern_allow([LT_LIBPREFIX])dnl
516 +AC_DEFINE_UNQUOTED([LT_LIBPREFIX],["$lt_libprefix"],[The archive prefix])
517 +
518 +name=ltdl
519 +eval "LTDLOPEN=\"$libname_spec\""
520 +AC_SUBST([LTDLOPEN])
521 +])# _LTDL_SETUP
522 +
523 +
524 +# _LT_ENABLE_INSTALL
525 +# ------------------
526 +m4_define([_LT_ENABLE_INSTALL],
527 +[AC_ARG_ENABLE([ltdl-install],
528 +    [AS_HELP_STRING([--enable-ltdl-install], [install libltdl])])
529 +
530 +case ,${enable_ltdl_install},${enable_ltdl_convenience} in
531 +  *yes*) ;;
532 +  *) enable_ltdl_convenience=yes ;;
533 +esac
534 +
535 +m4_ifdef([AM_CONDITIONAL],
536 +[AM_CONDITIONAL(INSTALL_LTDL, test x"${enable_ltdl_install-no}" != xno)
537 + AM_CONDITIONAL(CONVENIENCE_LTDL, test x"${enable_ltdl_convenience-no}" != xno)])
538 +])# _LT_ENABLE_INSTALL
539 +
540 +
541 +# LT_SYS_DLOPEN_DEPLIBS
542 +# ---------------------
543 +AC_DEFUN([LT_SYS_DLOPEN_DEPLIBS],
544 +[AC_REQUIRE([AC_CANONICAL_HOST])dnl
545 +AC_CACHE_CHECK([whether deplibs are loaded by dlopen],
546 +  [lt_cv_sys_dlopen_deplibs],
547 +  [# PORTME does your system automatically load deplibs for dlopen?
548 +  # or its logical equivalent (e.g. shl_load for HP-UX < 11)
549 +  # For now, we just catch OSes we know something about -- in the
550 +  # future, we'll try test this programmatically.
551 +  lt_cv_sys_dlopen_deplibs=unknown
552 +  case $host_os in
553 +  aix3*|aix4.1.*|aix4.2.*)
554 +    # Unknown whether this is true for these versions of AIX, but
555 +    # we want this `case' here to explicitly catch those versions.
556 +    lt_cv_sys_dlopen_deplibs=unknown
557 +    ;;
558 +  aix[[4-9]]*)
559 +    lt_cv_sys_dlopen_deplibs=yes
560 +    ;;
561 +  amigaos*)
562 +    case $host_cpu in
563 +    powerpc)
564 +      lt_cv_sys_dlopen_deplibs=no
565 +      ;;
566 +    esac
567 +    ;;
568 +  darwin*)
569 +    # Assuming the user has installed a libdl from somewhere, this is true
570 +    # If you are looking for one http://www.opendarwin.org/projects/dlcompat
571 +    lt_cv_sys_dlopen_deplibs=yes
572 +    ;;
573 +  freebsd* | dragonfly*)
574 +    lt_cv_sys_dlopen_deplibs=yes
575 +    ;;
576 +  gnu* | linux* | k*bsd*-gnu | kopensolaris*-gnu)
577 +    # GNU and its variants, using gnu ld.so (Glibc)
578 +    lt_cv_sys_dlopen_deplibs=yes
579 +    ;;
580 +  hpux10*|hpux11*)
581 +    lt_cv_sys_dlopen_deplibs=yes
582 +    ;;
583 +  interix*)
584 +    lt_cv_sys_dlopen_deplibs=yes
585 +    ;;
586 +  irix[[12345]]*|irix6.[[01]]*)
587 +    # Catch all versions of IRIX before 6.2, and indicate that we don't
588 +    # know how it worked for any of those versions.
589 +    lt_cv_sys_dlopen_deplibs=unknown
590 +    ;;
591 +  irix*)
592 +    # The case above catches anything before 6.2, and it's known that
593 +    # at 6.2 and later dlopen does load deplibs.
594 +    lt_cv_sys_dlopen_deplibs=yes
595 +    ;;
596 +  netbsd*)
597 +    lt_cv_sys_dlopen_deplibs=yes
598 +    ;;
599 +  openbsd*)
600 +    lt_cv_sys_dlopen_deplibs=yes
601 +    ;;
602 +  osf[[1234]]*)
603 +    # dlopen did load deplibs (at least at 4.x), but until the 5.x series,
604 +    # it did *not* use an RPATH in a shared library to find objects the
605 +    # library depends on, so we explicitly say `no'.
606 +    lt_cv_sys_dlopen_deplibs=no
607 +    ;;
608 +  osf5.0|osf5.0a|osf5.1)
609 +    # dlopen *does* load deplibs and with the right loader patch applied
610 +    # it even uses RPATH in a shared library to search for shared objects
611 +    # that the library depends on, but there's no easy way to know if that
612 +    # patch is installed.  Since this is the case, all we can really
613 +    # say is unknown -- it depends on the patch being installed.  If
614 +    # it is, this changes to `yes'.  Without it, it would be `no'.
615 +    lt_cv_sys_dlopen_deplibs=unknown
616 +    ;;
617 +  osf*)
618 +    # the two cases above should catch all versions of osf <= 5.1.  Read
619 +    # the comments above for what we know about them.
620 +    # At > 5.1, deplibs are loaded *and* any RPATH in a shared library
621 +    # is used to find them so we can finally say `yes'.
622 +    lt_cv_sys_dlopen_deplibs=yes
623 +    ;;
624 +  qnx*)
625 +    lt_cv_sys_dlopen_deplibs=yes
626 +    ;;
627 +  solaris*)
628 +    lt_cv_sys_dlopen_deplibs=yes
629 +    ;;
630 +  sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
631 +    libltdl_cv_sys_dlopen_deplibs=yes
632 +    ;;
633 +  esac
634 +  ])
635 +if test "$lt_cv_sys_dlopen_deplibs" != yes; then
636 + AC_DEFINE([LTDL_DLOPEN_DEPLIBS], [1],
637 +    [Define if the OS needs help to load dependent libraries for dlopen().])
638 +fi
639 +])# LT_SYS_DLOPEN_DEPLIBS
640 +
641 +# Old name:
642 +AU_ALIAS([AC_LTDL_SYS_DLOPEN_DEPLIBS], [LT_SYS_DLOPEN_DEPLIBS])
643 +dnl aclocal-1.4 backwards compatibility:
644 +dnl AC_DEFUN([AC_LTDL_SYS_DLOPEN_DEPLIBS], [])
645 +
646 +
647 +# LT_SYS_MODULE_EXT
648 +# -----------------
649 +AC_DEFUN([LT_SYS_MODULE_EXT],
650 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
651 +AC_CACHE_CHECK([which extension is used for runtime loadable modules],
652 +  [libltdl_cv_shlibext],
653 +[
654 +module=yes
655 +eval libltdl_cv_shlibext=$shrext_cmds
656 +  ])
657 +if test -n "$libltdl_cv_shlibext"; then
658 +  m4_pattern_allow([LT_MODULE_EXT])dnl
659 +  AC_DEFINE_UNQUOTED([LT_MODULE_EXT], ["$libltdl_cv_shlibext"],
660 +    [Define to the extension used for runtime loadable modules, say, ".so".])
661 +fi
662 +])# LT_SYS_MODULE_EXT
663 +
664 +# Old name:
665 +AU_ALIAS([AC_LTDL_SHLIBEXT], [LT_SYS_MODULE_EXT])
666 +dnl aclocal-1.4 backwards compatibility:
667 +dnl AC_DEFUN([AC_LTDL_SHLIBEXT], [])
668 +
669 +
670 +# LT_SYS_MODULE_PATH
671 +# ------------------
672 +AC_DEFUN([LT_SYS_MODULE_PATH],
673 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
674 +AC_CACHE_CHECK([which variable specifies run-time module search path],
675 +  [lt_cv_module_path_var], [lt_cv_module_path_var="$shlibpath_var"])
676 +if test -n "$lt_cv_module_path_var"; then
677 +  m4_pattern_allow([LT_MODULE_PATH_VAR])dnl
678 +  AC_DEFINE_UNQUOTED([LT_MODULE_PATH_VAR], ["$lt_cv_module_path_var"],
679 +    [Define to the name of the environment variable that determines the run-time module search path.])
680 +fi
681 +])# LT_SYS_MODULE_PATH
682 +
683 +# Old name:
684 +AU_ALIAS([AC_LTDL_SHLIBPATH], [LT_SYS_MODULE_PATH])
685 +dnl aclocal-1.4 backwards compatibility:
686 +dnl AC_DEFUN([AC_LTDL_SHLIBPATH], [])
687 +
688 +
689 +# LT_SYS_DLSEARCH_PATH
690 +# --------------------
691 +AC_DEFUN([LT_SYS_DLSEARCH_PATH],
692 +[m4_require([_LT_SYS_DYNAMIC_LINKER])dnl
693 +AC_CACHE_CHECK([for the default library search path],
694 +  [lt_cv_sys_dlsearch_path],
695 +  [lt_cv_sys_dlsearch_path="$sys_lib_dlsearch_path_spec"])
696 +if test -n "$lt_cv_sys_dlsearch_path"; then
697 +  sys_dlsearch_path=
698 +  for dir in $lt_cv_sys_dlsearch_path; do
699 +    if test -z "$sys_dlsearch_path"; then
700 +      sys_dlsearch_path="$dir"
701 +    else
702 +      sys_dlsearch_path="$sys_dlsearch_path$PATH_SEPARATOR$dir"
703 +    fi
704 +  done
705 +  m4_pattern_allow([LT_DLSEARCH_PATH])dnl
706 +  AC_DEFINE_UNQUOTED([LT_DLSEARCH_PATH], ["$sys_dlsearch_path"],
707 +    [Define to the system default library search path.])
708 +fi
709 +])# LT_SYS_DLSEARCH_PATH
710 +
711 +# Old name:
712 +AU_ALIAS([AC_LTDL_SYSSEARCHPATH], [LT_SYS_DLSEARCH_PATH])
713 +dnl aclocal-1.4 backwards compatibility:
714 +dnl AC_DEFUN([AC_LTDL_SYSSEARCHPATH], [])
715 +
716 +
717 +# _LT_CHECK_DLPREOPEN
718 +# -------------------
719 +m4_defun([_LT_CHECK_DLPREOPEN],
720 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
721 +AC_CACHE_CHECK([whether libtool supports -dlopen/-dlpreopen],
722 +  [libltdl_cv_preloaded_symbols],
723 +  [if test -n "$lt_cv_sys_global_symbol_pipe"; then
724 +    libltdl_cv_preloaded_symbols=yes
725 +  else
726 +    libltdl_cv_preloaded_symbols=no
727 +  fi
728 +  ])
729 +if test x"$libltdl_cv_preloaded_symbols" = xyes; then
730 +  AC_DEFINE([HAVE_PRELOADED_SYMBOLS], [1],
731 +    [Define if libtool can extract symbol lists from object files.])
732 +fi
733 +])# _LT_CHECK_DLPREOPEN
734 +
735 +
736 +# LT_LIB_DLLOAD
737 +# -------------
738 +AC_DEFUN([LT_LIB_DLLOAD],
739 +[m4_pattern_allow([^LT_DLLOADERS$])
740 +LT_DLLOADERS=
741 +AC_SUBST([LT_DLLOADERS])
742 +
743 +AC_LANG_PUSH([C])
744 +
745 +LIBADD_DLOPEN=
746 +AC_SEARCH_LIBS([dlopen], [dl],
747 +       [AC_DEFINE([HAVE_LIBDL], [1],
748 +                  [Define if you have the libdl library or equivalent.])
749 +       if test "$ac_cv_search_dlopen" != "none required" ; then
750 +         LIBADD_DLOPEN="-ldl"
751 +       fi
752 +       libltdl_cv_lib_dl_dlopen="yes"
753 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
754 +    [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#if HAVE_DLFCN_H
755 +#  include <dlfcn.h>
756 +#endif
757 +    ]], [[dlopen(0, 0);]])],
758 +           [AC_DEFINE([HAVE_LIBDL], [1],
759 +                      [Define if you have the libdl library or equivalent.])
760 +           libltdl_cv_func_dlopen="yes"
761 +           LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"],
762 +       [AC_CHECK_LIB([svld], [dlopen],
763 +               [AC_DEFINE([HAVE_LIBDL], [1],
764 +                        [Define if you have the libdl library or equivalent.])
765 +               LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
766 +               LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
767 +if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen" = xyes
768 +then
769 +  lt_save_LIBS="$LIBS"
770 +  LIBS="$LIBS $LIBADD_DLOPEN"
771 +  AC_CHECK_FUNCS([dlerror])
772 +  LIBS="$lt_save_LIBS"
773 +fi
774 +AC_SUBST([LIBADD_DLOPEN])
775 +
776 +LIBADD_SHL_LOAD=
777 +AC_CHECK_FUNC([shl_load],
778 +       [AC_DEFINE([HAVE_SHL_LOAD], [1],
779 +                  [Define if you have the shl_load function.])
780 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"],
781 +    [AC_CHECK_LIB([dld], [shl_load],
782 +           [AC_DEFINE([HAVE_SHL_LOAD], [1],
783 +                      [Define if you have the shl_load function.])
784 +           LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}shl_load.la"
785 +           LIBADD_SHL_LOAD="-ldld"])])
786 +AC_SUBST([LIBADD_SHL_LOAD])
787 +
788 +case $host_os in
789 +darwin[[1567]].*)
790 +# We only want this for pre-Mac OS X 10.4.
791 +  AC_CHECK_FUNC([_dyld_func_lookup],
792 +       [AC_DEFINE([HAVE_DYLD], [1],
793 +                  [Define if you have the _dyld_func_lookup function.])
794 +       LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dyld.la"])
795 +  ;;
796 +beos*)
797 +  LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}load_add_on.la"
798 +  ;;
799 +cygwin* | mingw* | os2* | pw32*)
800 +  AC_CHECK_DECLS([cygwin_conv_path], [], [], [[#include <sys/cygwin.h>]])
801 +  LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}loadlibrary.la"
802 +  ;;
803 +esac
804 +
805 +AC_CHECK_LIB([dld], [dld_link],
806 +       [AC_DEFINE([HAVE_DLD], [1],
807 +                  [Define if you have the GNU dld library.])
808 +               LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dld_link.la"])
809 +AC_SUBST([LIBADD_DLD_LINK])
810 +
811 +m4_pattern_allow([^LT_DLPREOPEN$])
812 +LT_DLPREOPEN=
813 +if test -n "$LT_DLLOADERS"
814 +then
815 +  for lt_loader in $LT_DLLOADERS; do
816 +    LT_DLPREOPEN="$LT_DLPREOPEN-dlpreopen $lt_loader "
817 +  done
818 +  AC_DEFINE([HAVE_LIBDLLOADER], [1],
819 +            [Define if libdlloader will be built on this platform])
820 +fi
821 +AC_SUBST([LT_DLPREOPEN])
822 +
823 +dnl This isn't used anymore, but set it for backwards compatibility
824 +LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD"
825 +AC_SUBST([LIBADD_DL])
826 +
827 +AC_LANG_POP
828 +])# LT_LIB_DLLOAD
829 +
830 +# Old name:
831 +AU_ALIAS([AC_LTDL_DLLIB], [LT_LIB_DLLOAD])
832 +dnl aclocal-1.4 backwards compatibility:
833 +dnl AC_DEFUN([AC_LTDL_DLLIB], [])
834 +
835 +
836 +# LT_SYS_SYMBOL_USCORE
837 +# --------------------
838 +# does the compiler prefix global symbols with an underscore?
839 +AC_DEFUN([LT_SYS_SYMBOL_USCORE],
840 +[m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
841 +AC_CACHE_CHECK([for _ prefix in compiled symbols],
842 +  [lt_cv_sys_symbol_underscore],
843 +  [lt_cv_sys_symbol_underscore=no
844 +  cat > conftest.$ac_ext <<_LT_EOF
845 +void nm_test_func(){}
846 +int main(){nm_test_func;return 0;}
847 +_LT_EOF
848 +  if AC_TRY_EVAL(ac_compile); then
849 +    # Now try to grab the symbols.
850 +    ac_nlist=conftest.nm
851 +    if AC_TRY_EVAL(NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) && test -s "$ac_nlist"; then
852 +      # See whether the symbols have a leading underscore.
853 +      if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
854 +        lt_cv_sys_symbol_underscore=yes
855 +      else
856 +        if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
857 +         :
858 +        else
859 +         echo "configure: cannot find nm_test_func in $ac_nlist" >&AS_MESSAGE_LOG_FD
860 +        fi
861 +      fi
862 +    else
863 +      echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&AS_MESSAGE_LOG_FD
864 +    fi
865 +  else
866 +    echo "configure: failed program was:" >&AS_MESSAGE_LOG_FD
867 +    cat conftest.c >&AS_MESSAGE_LOG_FD
868 +  fi
869 +  rm -rf conftest*
870 +  ])
871 +  sys_symbol_underscore=$lt_cv_sys_symbol_underscore
872 +  AC_SUBST([sys_symbol_underscore])
873 +])# LT_SYS_SYMBOL_USCORE
874 +
875 +# Old name:
876 +AU_ALIAS([AC_LTDL_SYMBOL_USCORE], [LT_SYS_SYMBOL_USCORE])
877 +dnl aclocal-1.4 backwards compatibility:
878 +dnl AC_DEFUN([AC_LTDL_SYMBOL_USCORE], [])
879 +
880 +
881 +# LT_FUNC_DLSYM_USCORE
882 +# --------------------
883 +AC_DEFUN([LT_FUNC_DLSYM_USCORE],
884 +[AC_REQUIRE([LT_SYS_SYMBOL_USCORE])dnl
885 +if test x"$lt_cv_sys_symbol_underscore" = xyes; then
886 +  if test x"$libltdl_cv_func_dlopen" = xyes ||
887 +     test x"$libltdl_cv_lib_dl_dlopen" = xyes ; then
888 +       AC_CACHE_CHECK([whether we have to add an underscore for dlsym],
889 +         [libltdl_cv_need_uscore],
890 +         [libltdl_cv_need_uscore=unknown
891 +          save_LIBS="$LIBS"
892 +          LIBS="$LIBS $LIBADD_DLOPEN"
893 +         _LT_TRY_DLOPEN_SELF(
894 +           [libltdl_cv_need_uscore=no], [libltdl_cv_need_uscore=yes],
895 +           [],                          [libltdl_cv_need_uscore=cross])
896 +         LIBS="$save_LIBS"
897 +       ])
898 +  fi
899 +fi
900 +
901 +if test x"$libltdl_cv_need_uscore" = xyes; then
902 +  AC_DEFINE([NEED_USCORE], [1],
903 +    [Define if dlsym() requires a leading underscore in symbol names.])
904 +fi
905 +])# LT_FUNC_DLSYM_USCORE
906 +
907 +# Old name:
908 +AU_ALIAS([AC_LTDL_DLSYM_USCORE], [LT_FUNC_DLSYM_USCORE])
909 +dnl aclocal-1.4 backwards compatibility:
910 +dnl AC_DEFUN([AC_LTDL_DLSYM_USCORE], [])
911 +
912  # Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008  Free Software Foundation, Inc.
913  #
914  # This file is free software; the Free Software Foundation
915 Index: libffi/configure
916 ===================================================================
917 --- libffi.orig/configure
918 +++ libffi/configure
919 @@ -621,6 +621,7 @@ FFI_DEBUG_FALSE
920  FFI_DEBUG_TRUE
921  TARGETDIR
922  TARGET
923 +sys_symbol_underscore
924  HAVE_LONG_DOUBLE
925  ALLOCA
926  PA64_HPUX_FALSE
927 @@ -13239,6 +13240,61 @@ $as_echo "#define HAVE_AS_STRING_PSEUDO_
928  
929      fi
930  fi
931 +
932 +if test x$TARGET = xX86_WIN64; then
933 +    { $as_echo "$as_me:${as_lineno-$LINENO}: checking for _ prefix in compiled symbols" >&5
934 +$as_echo_n "checking for _ prefix in compiled symbols... " >&6; }
935 +if ${lt_cv_sys_symbol_underscore+:} false; then :
936 +  $as_echo_n "(cached) " >&6
937 +else
938 +  lt_cv_sys_symbol_underscore=no
939 +  cat > conftest.$ac_ext <<_LT_EOF
940 +void nm_test_func(){}
941 +int main(){nm_test_func;return 0;}
942 +_LT_EOF
943 +  if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
944 +  (eval $ac_compile) 2>&5
945 +  ac_status=$?
946 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
947 +  test $ac_status = 0; }; then
948 +    # Now try to grab the symbols.
949 +    ac_nlist=conftest.nm
950 +    if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist\""; } >&5
951 +  (eval $NM conftest.$ac_objext \| $lt_cv_sys_global_symbol_pipe \> $ac_nlist) 2>&5
952 +  ac_status=$?
953 +  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
954 +  test $ac_status = 0; } && test -s "$ac_nlist"; then
955 +      # See whether the symbols have a leading underscore.
956 +      if grep '^. _nm_test_func' "$ac_nlist" >/dev/null; then
957 +        lt_cv_sys_symbol_underscore=yes
958 +      else
959 +        if grep '^. nm_test_func ' "$ac_nlist" >/dev/null; then
960 +         :
961 +        else
962 +         echo "configure: cannot find nm_test_func in $ac_nlist" >&5
963 +        fi
964 +      fi
965 +    else
966 +      echo "configure: cannot run $lt_cv_sys_global_symbol_pipe" >&5
967 +    fi
968 +  else
969 +    echo "configure: failed program was:" >&5
970 +    cat conftest.c >&5
971 +  fi
972 +  rm -rf conftest*
973 +
974 +fi
975 +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sys_symbol_underscore" >&5
976 +$as_echo "$lt_cv_sys_symbol_underscore" >&6; }
977 +  sys_symbol_underscore=$lt_cv_sys_symbol_underscore
978 +
979 +
980 +    if test "x$sys_symbol_underscore" = xyes; then
981 +
982 +$as_echo "#define SYMBOL_UNDERSCORE 1" >>confdefs.h
983 +
984 +    fi
985 +fi
986  
987  case "$target" in
988       *-apple-darwin10* | *-*-freebsd* | *-*-openbsd* | *-pc-solaris*)