--- libffi/configure.orig 2015-06-23 07:55:27 UTC +++ libffi/configure @@ -642,6 +642,8 @@ ARM_FALSE ARM_TRUE AARCH64_FALSE AARCH64_TRUE +POWERPC_BSDSUNIX_FALSE +POWERPC_BSDSUNIX_TRUE POWERPC_FREEBSD_FALSE POWERPC_FREEBSD_TRUE POWERPC_DARWIN_FALSE @@ -664,6 +666,8 @@ X86_WIN64_FALSE X86_WIN64_TRUE X86_WIN32_FALSE X86_WIN32_TRUE +X86_BSDSUNIX_FALSE +X86_BSDSUNIX_TRUE X86_FREEBSD_FALSE X86_FREEBSD_TRUE X86_FALSE @@ -5198,7 +5202,7 @@ else lt_cv_sys_max_cmd_len=8192; ;; - netbsd* | freebsd* | openbsd* | darwin* | dragonfly*) + netbsd* | bsdsunix* | freebsd* | openbsd* | darwin* | dragonfly*) # This has been around since 386BSD, at least. Likely further. if test -x /sbin/sysctl; then lt_cv_sys_max_cmd_len=`/sbin/sysctl -n kern.argmax` @@ -5548,13 +5552,13 @@ darwin* | rhapsody*) lt_cv_deplibs_check_method=pass_all ;; -freebsd* | dragonfly*) +bsdsunix* | freebsd* | dragonfly*) if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then case $host_cpu in i*86 ) # Not sure whether the presence of OpenBSD here was a mistake. # Let's accept both of them until this is cleared up. - lt_cv_deplibs_check_method='file_magic (FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' + lt_cv_deplibs_check_method='file_magic (BSDSUniX|FreeBSD|OpenBSD|DragonFly)/i[3-9]86 (compact )?demand paged shared library' lt_cv_file_magic_cmd=/usr/bin/file lt_cv_file_magic_test_file=`echo /usr/lib/libc.so.*` ;; @@ -6393,7 +6397,7 @@ ia64-*-hpux*) rm -rf conftest* ;; -x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ +x86_64-*kbsdsunix*-gnu|x86_64-*kfreebsd*-gnu|x86_64-*linux*|powerpc*-*linux*| \ s390*-*linux*|s390*-*tpf*|sparc*-*linux*) # Find out which ABI we are using. echo 'int i;' > conftest.$ac_ext @@ -6405,6 +6409,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* case `/usr/bin/file conftest.o` in *32-bit*) case $host in + x86_64-*kbsdsunix*-gnu) + LD="${LD-ld} -m elf_i386_bsdsux" + ;; x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_i386_fbsd" ;; @@ -6434,6 +6441,9 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux* ;; *64-bit*) case $host in + x86_64-*kbsdsunix*-gnu) + LD="${LD-ld} -m elf_x86_64_bsdsux" + ;; x86_64-*kfreebsd*-gnu) LD="${LD-ld} -m elf_x86_64_fbsd" ;; @@ -8502,7 +8512,7 @@ $as_echo_n "checking whether the $compil hardcode_minus_L=no hardcode_shlibpath_var=unsupported inherit_rpath=no - link_all_deplibs=unknown + link_all_deplibs=no module_cmds= module_expsym_cmds= old_archive_from_new_cmds= @@ -8768,7 +8778,7 @@ _LT_EOF wlarc= else archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib' fi ;; @@ -8787,7 +8797,7 @@ _LT_EOF _LT_EOF elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib' else ld_shlibs=no fi @@ -8816,7 +8826,7 @@ _LT_EOF if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir' archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib' else ld_shlibs=no fi @@ -8834,7 +8844,7 @@ _LT_EOF *) if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib' - archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib' + archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-version-script $wl$lib-ver -o $lib' else ld_shlibs=no fi @@ -9157,6 +9167,13 @@ if test -z "$aix_libpath"; then aix_libp hardcode_shlibpath_var=no ;; + bsdsunix*) + archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags' + hardcode_libdir_flag_spec='-R$libdir' + hardcode_direct=yes + hardcode_shlibpath_var=no + ;; + hpux9*) if test "$GCC" = yes; then archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib' @@ -9338,7 +9355,7 @@ rm -f core conftest.err conftest.$ac_obj hardcode_direct_absolute=yes if test -z "`echo __ELF__ | $CC -E - | $GREP __ELF__`" || test "$host_os-$host_cpu" = "openbsd2.8-powerpc"; then archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags' - archive_expsym_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-retain-symbols-file,$export_symbols' + archive_expsym_cmds='echo "{ global:" > $lib-ver~ sed -e "s|$|;|" < $export_symbols >> $lib-ver~ echo "local: *; };" >> $lib-ver~$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags ${wl}-version-script,$lib-ver' hardcode_libdir_flag_spec='${wl}-rpath,$libdir' export_dynamic_flag_spec='${wl}-E' else @@ -10048,6 +10065,25 @@ dgux*) shlibpath_var=LD_LIBRARY_PATH ;; +bsdsunix*) + objformat=elf + version_type=bsdsunix-$objformat + case $version_type in + bsdsunix-elf*) + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' + need_version=no + need_lib_prefix=no + ;; + bsdsunix-*) + library_names_spec='${libname}${release}${shared_ext}$versuffix $libname${shared_ext}$versuffix' + need_version=yes + ;; + esac + shlibpath_var=LD_LIBRARY_PATH + shlibpath_overrides_runpath=yes + hardcode_into_libs=yes + ;; + freebsd* | dragonfly*) # DragonFly does not have aout. When/if they implement a new # versioning mechanism, adjust this. @@ -10062,7 +10098,7 @@ freebsd* | dragonfly*) version_type=freebsd-$objformat case $version_type in freebsd-elf*) - library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext} $libname${shared_ext}' + library_names_spec='$libname$release$shared_ext$versuffix $libname$release$shared_ext$major $libname$shared_ext' soname_spec='$libname$release$shared_ext$major' need_version=no need_lib_prefix=no ;; @@ -11144,7 +11180,7 @@ striplib= old_striplib= { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether stripping libraries is possible" >&5 $as_echo_n "checking whether stripping libraries is possible... " >&6; } -if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "GNU strip" >/dev/null; then +if test -n "$STRIP" && $STRIP -V 2>&1 | $GREP "strip" >/dev/null; then test -z "$old_striplib" && old_striplib="$STRIP --strip-debug" test -z "$striplib" && striplib="$STRIP --strip-unneeded" { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 @@ -11466,6 +11502,10 @@ case "$host" in TARGET=ARM; TARGETDIR=arm ;; + amd64-*-bsdsunix*) + TARGET=X86_64; TARGETDIR=x86 + ;; + amd64-*-freebsd* | amd64-*-openbsd*) TARGET=X86_64; TARGETDIR=x86 ;; @@ -11500,6 +11540,10 @@ case "$host" in TARGET=PA_HPUX; TARGETDIR=pa ;; + i?86-*-bsdsunix*) + TARGET=X86_BSDSUNIX; TARGETDIR=x86 + ;; + i?86-*-freebsd* | i?86-*-openbsd*) TARGET=X86_FREEBSD; TARGETDIR=x86 ;; @@ -11562,6 +11606,13 @@ case "$host" in powerpc-*-aix* | rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc ;; + powerpc-*-bsdsunix*) + TARGET=POWERPC_BSDSUNIX; TARGETDIR=powerpc + HAVE_LONG_DOUBLE_VARIANT=1 + ;; + powerpc64-*-bsdsunix*) + TARGET=POWERPC; TARGETDIR=powerpc + ;; powerpc-*-freebsd* | powerpc-*-openbsd*) TARGET=POWERPC_FREEBSD; TARGETDIR=powerpc HAVE_LONG_DOUBLE_VARIANT=1 @@ -11653,6 +11704,14 @@ else X86_FALSE= fi + if test x$TARGET = xX86_BSDSUNIX; then + X86_BSDSUNIX_TRUE= + X86_BSDSUNIX_FALSE='#' +else + X86_BSDSUNIX_TRUE='#' + X86_BSDSUNIX_FALSE= +fi + if test x$TARGET = xX86_FREEBSD; then X86_FREEBSD_TRUE= X86_FREEBSD_FALSE='#' @@ -11741,6 +11800,14 @@ else POWERPC_DARWIN_FALSE= fi + if test x$TARGET = xPOWERPC_BSDSUNIX; then + POWERPC_BSDSUNIX_TRUE= + POWERPC_BSDSUNIX_FALSE='#' +else + POWERPC_BSDSUNIX_TRUE='#' + POWERPC_BSDSUNIX_FALSE= +fi + if test x$TARGET = xPOWERPC_FREEBSD; then POWERPC_FREEBSD_TRUE= POWERPC_FREEBSD_FALSE='#' @@ -12707,7 +12774,7 @@ case "$target" in $as_echo "#define FFI_EXEC_TRAMPOLINE_TABLE 1" >>confdefs.h ;; - *-apple-darwin1* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) + *-apple-darwin1* | *-*-bsdsunix* | *-*-kbsdsunix* | *-*-freebsd* | *-*-kfreebsd* | *-*-openbsd* | *-pc-solaris*) $as_echo "#define FFI_MMAP_EXEC_WRIT 1" >>confdefs.h @@ -13048,6 +13115,10 @@ if test -z "${X86_TRUE}" && test -z "${X as_fn_error "conditional \"X86\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${X86_BSDSUNIX_TRUE}" && test -z "${X86_BSDSUNIX_FALSE}"; then + as_fn_error "conditional \"X86_BSDSUNIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${X86_FREEBSD_TRUE}" && test -z "${X86_FREEBSD_FALSE}"; then as_fn_error "conditional \"X86_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 @@ -13092,6 +13163,10 @@ if test -z "${POWERPC_DARWIN_TRUE}" && t as_fn_error "conditional \"POWERPC_DARWIN\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5 fi +if test -z "${POWERPC_BSDSUNIX_TRUE}" && test -z "${POWERPC_BSDSUNIX_FALSE}"; then + as_fn_error "conditional \"POWERPC_BSDSUNIX\" was never defined. +Usually this means the macro was only invoked conditionally." "$LINENO" 5 +fi if test -z "${POWERPC_FREEBSD_TRUE}" && test -z "${POWERPC_FREEBSD_FALSE}"; then as_fn_error "conditional \"POWERPC_FREEBSD\" was never defined. Usually this means the macro was only invoked conditionally." "$LINENO" 5