xfail the unwindtest for osx as per issue #279
[libffi.git] / Makefile.am
index 3d1ecae..4ddd12d 100644 (file)
@@ -5,55 +5,24 @@ AUTOMAKE_OPTIONS = foreign subdir-objects
 ACLOCAL_AMFLAGS = -I m4
 
 SUBDIRS = include testsuite man
+if BUILD_DOCS
+## This hack is needed because it doesn't seem possible to make a
+## conditional info_TEXINFOS in Automake.  At least Automake 1.14
+## either gives errors -- if this attempted in the most
+## straightforward way -- or simply unconditionally tries to build the
+## info file.
+SUBDIRS += doc
+endif
 
 EXTRA_DIST = LICENSE ChangeLog.v1 ChangeLog.libgcj                     \
-        src/aarch64/ffi.c src/aarch64/ffitarget.h src/aarch64/sysv.S   \
-        src/alpha/ffi.c src/alpha/osf.S                        \
-        src/alpha/ffitarget.h src/arc/ffi.c src/arc/arcompact.S        \
-        src/arc/ffitarget.h src/arm/ffi.c src/arm/sysv.S               \
-        src/arm/ffitarget.h src/avr32/ffi.c src/avr32/sysv.S           \
-        src/avr32/ffitarget.h src/cris/ffi.c src/cris/sysv.S           \
-        src/cris/ffitarget.h src/ia64/ffi.c src/ia64/ffitarget.h       \
-        src/ia64/ia64_flags.h src/ia64/unix.S src/mips/ffi.c           \
-        src/mips/n32.S src/mips/o32.S src/metag/ffi.c                  \
-        src/metag/ffitarget.h src/metag/sysv.S src/moxie/ffi.c         \
-        src/moxie/ffitarget.h src/moxie/eabi.S src/mips/ffitarget.h    \
-        src/m32r/ffi.c src/m32r/sysv.S src/m32r/ffitarget.h            \
-        src/m68k/ffi.c src/m68k/sysv.S src/m68k/ffitarget.h            \
-        src/m88k/ffi.c src/m88k/obsd.S src/m88k/ffitarget.h            \
-        src/microblaze/ffi.c src/microblaze/sysv.S                     \
-        src/microblaze/ffitarget.h                                     \
-        src/nios2/ffi.c src/nios2/ffitarget.h src/nios2/sysv.S         \
-        src/or1k/ffi.c src/or1k/ffitarget.h src/or1k/sysv.S            \
-        src/powerpc/ffi.c src/powerpc/ffi_powerpc.h                    \
-        src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c               \
-        src/powerpc/sysv.S src/powerpc/linux64.S                       \
-        src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S        \
-        src/powerpc/asm.h src/powerpc/aix.S src/powerpc/darwin.S       \
-        src/powerpc/aix_closure.S src/powerpc/darwin_closure.S         \
-        src/powerpc/ffi_darwin.c src/powerpc/ffitarget.h               \
-        src/s390/ffi.c src/s390/sysv.S src/s390/ffitarget.h            \
-        src/sh/ffi.c src/sh/sysv.S src/sh/ffitarget.h src/sh64/ffi.c   \
-        src/sh64/sysv.S src/sh64/ffitarget.h src/sparc/v8.S            \
-        src/sparc/v9.S src/sparc/ffitarget.h src/sparc/ffi.c           \
-        src/x86/darwin64.S src/x86/ffi.c src/x86/sysv.S                \
-        src/x86/win32.S src/x86/darwin.S src/x86/ffiw64.c src/x86/win64.S \
-        src/x86/freebsd.S src/x86/ffi64.c src/x86/unix64.S             \
-        src/x86/ffitarget.h src/pa/ffitarget.h src/pa/ffi.c            \
-        src/pa/linux.S src/pa/hpux32.S src/frv/ffi.c src/bfin/ffi.c    \
-        src/bfin/ffitarget.h src/bfin/sysv.S src/frv/eabi.S            \
-        src/frv/ffitarget.h src/dlmalloc.c src/tile/ffi.c              \
-        src/tile/ffitarget.h src/tile/tile.S libtool-version           \
-        src/vax/ffi.c src/vax/ffitarget.h src/vax/elfbsd.S             \
-        src/xtensa/ffitarget.h src/xtensa/ffi.c src/xtensa/sysv.S      \
-        ChangeLog.libffi m4/libtool.m4 m4/lt~obsolete.m4               \
+       ChangeLog.libffi ChangeLog.libffi-3.1                           \
+       m4/libtool.m4 m4/lt~obsolete.m4                                 \
         m4/ltoptions.m4 m4/ltsugar.m4 m4/ltversion.m4                  \
-        m4/ltversion.m4 src/arm/gentramp.sh src/debug.c msvcc.sh       \
-        generate-darwin-source-and-headers.py                          \
-        libffi.xcodeproj/project.pbxproj src/arm/trampoline.S          \
-        libtool-ldflags ChangeLog.libffi-3.1
+        m4/ltversion.m4 src/debug.c msvcc.sh                           \
+       generate-darwin-source-and-headers.py                           \
+       libffi.xcodeproj/project.pbxproj                                \
+       libtool-ldflags
 
-info_TEXINFOS = doc/libffi.texi
 
 ## ################################################################
 
@@ -104,140 +73,93 @@ FLAGS_TO_PASS = $(AM_MAKEFLAGS)
 
 MAKEOVERRIDES=
 
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = libffi.pc
+
 toolexeclib_LTLIBRARIES = libffi.la
 noinst_LTLIBRARIES = libffi_convenience.la
 
 libffi_la_SOURCES = src/prep_cif.c src/types.c \
                src/raw_api.c src/java_raw_api.c src/closures.c
 
-pkgconfigdir = $(libdir)/pkgconfig
-pkgconfig_DATA = libffi.pc
-
-nodist_libffi_la_SOURCES =
-
 if FFI_DEBUG
-nodist_libffi_la_SOURCES += src/debug.c
-endif
-
-if MIPS
-nodist_libffi_la_SOURCES += src/mips/ffi.c src/mips/o32.S src/mips/n32.S
-endif
-if BFIN
-nodist_libffi_la_SOURCES += src/bfin/ffi.c src/bfin/sysv.S
-endif
-if X86
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/sysv.S src/x86/win32.S
-endif
-if X86_FREEBSD
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/freebsd.S src/x86/win32.S
-endif
-if X86_WIN32
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/win32.S
-endif
-if X86_WIN64
-nodist_libffi_la_SOURCES += src/x86/ffiw64.c src/x86/win64.S
-endif
-if X86_DARWIN
-nodist_libffi_la_SOURCES += src/x86/ffi.c src/x86/darwin.S src/x86/ffi64.c src/x86/darwin64.S
-if X86_DARWIN32
-nodist_libffi_la_SOURCES += src/x86/win32.S
-endif
-endif
-if SPARC
-nodist_libffi_la_SOURCES += src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S
-endif
-if ALPHA
-nodist_libffi_la_SOURCES += src/alpha/ffi.c src/alpha/osf.S
-endif
-if IA64
-nodist_libffi_la_SOURCES += src/ia64/ffi.c src/ia64/unix.S
-endif
-if M32R
-nodist_libffi_la_SOURCES += src/m32r/sysv.S src/m32r/ffi.c
-endif
-if M68K
-nodist_libffi_la_SOURCES += src/m68k/ffi.c src/m68k/sysv.S
-endif
-if M88K
-nodist_libffi_la_SOURCES += src/m88k/ffi.c src/m88k/obsd.S
-endif
-if MOXIE
-nodist_libffi_la_SOURCES += src/moxie/ffi.c src/moxie/eabi.S
-endif
-if MICROBLAZE
-nodist_libffi_la_SOURCES += src/microblaze/ffi.c src/microblaze/sysv.S
-endif
-if NIOS2
-nodist_libffi_la_SOURCES += src/nios2/sysv.S src/nios2/ffi.c
-endif
-if OR1K
-nodist_libffi_la_SOURCES += src/or1k/sysv.S src/or1k/ffi.c
-endif
-if POWERPC
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c src/powerpc/sysv.S src/powerpc/ppc_closure.S src/powerpc/linux64.S src/powerpc/linux64_closure.S
-endif
-if POWERPC_AIX
-nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S
-endif
-if POWERPC_DARWIN
-nodist_libffi_la_SOURCES += src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S
-endif
-if POWERPC_FREEBSD
-nodist_libffi_la_SOURCES += src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/sysv.S src/powerpc/ppc_closure.S
-endif
-if AARCH64
-nodist_libffi_la_SOURCES += src/aarch64/sysv.S src/aarch64/ffi.c
-endif
-if ARC
-nodist_libffi_la_SOURCES += src/arc/arcompact.S src/arc/ffi.c
-endif
-if ARM
-nodist_libffi_la_SOURCES += src/arm/sysv.S src/arm/ffi.c
-if FFI_EXEC_TRAMPOLINE_TABLE
-nodist_libffi_la_SOURCES += src/arm/trampoline.S
-endif
-endif
-if AVR32
-nodist_libffi_la_SOURCES += src/avr32/sysv.S src/avr32/ffi.c
-endif
-if LIBFFI_CRIS
-nodist_libffi_la_SOURCES += src/cris/sysv.S src/cris/ffi.c
-endif
-if FRV
-nodist_libffi_la_SOURCES += src/frv/eabi.S src/frv/ffi.c
-endif
-if S390
-nodist_libffi_la_SOURCES += src/s390/sysv.S src/s390/ffi.c
-endif
-if X86_64
-nodist_libffi_la_SOURCES += src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S
-endif
-if SH
-nodist_libffi_la_SOURCES += src/sh/sysv.S src/sh/ffi.c
-endif
-if SH64
-nodist_libffi_la_SOURCES += src/sh64/sysv.S src/sh64/ffi.c
-endif
-if PA_LINUX
-nodist_libffi_la_SOURCES += src/pa/linux.S src/pa/ffi.c
-endif
-if PA_HPUX
-nodist_libffi_la_SOURCES += src/pa/hpux32.S src/pa/ffi.c
-endif
-if TILE
-nodist_libffi_la_SOURCES += src/tile/tile.S src/tile/ffi.c
-endif
-if XTENSA
-nodist_libffi_la_SOURCES += src/xtensa/sysv.S src/xtensa/ffi.c
-endif
-if METAG
-nodist_libffi_la_SOURCES += src/metag/sysv.S src/metag/ffi.c
-endif
-if VAX
-nodist_libffi_la_SOURCES += src/vax/elfbsd.S src/vax/ffi.c
-endif
+libffi_la_SOURCES += src/debug.c
+endif
+
+noinst_HEADERS = \
+       src/aarch64/ffitarget.h src/aarch64/internal.h                  \
+       src/alpha/ffitarget.h src/alpha/internal.h                      \
+       src/arc/ffitarget.h                                             \
+       src/arm/ffitarget.h src/arm/internal.h                          \
+       src/avr32/ffitarget.h                                           \
+       src/bfin/ffitarget.h                                            \
+       src/cris/ffitarget.h                                            \
+       src/frv/ffitarget.h                                             \
+       src/ia64/ffitarget.h src/ia64/ia64_flags.h                      \
+       src/m32r/ffitarget.h                                            \
+       src/m68k/ffitarget.h                                            \
+       src/m88k/ffitarget.h                                            \
+       src/metag/ffitarget.h                                           \
+       src/microblaze/ffitarget.h                                      \
+       src/mips/ffitarget.h                                            \
+       src/moxie/ffitarget.h                                           \
+       src/nios2/ffitarget.h                                           \
+       src/or1k/ffitarget.h                                            \
+       src/pa/ffitarget.h                                              \
+       src/powerpc/ffitarget.h src/powerpc/asm.h src/powerpc/ffi_powerpc.h \
+       src/s390/ffitarget.h                                            \
+       src/sh/ffitarget.h                                              \
+       src/sh64/ffitarget.h                                            \
+       src/sparc/ffitarget.h src/sparc/internal.h                      \
+       src/tile/ffitarget.h                                            \
+       src/vax/ffitarget.h                                             \
+       src/x86/ffitarget.h src/x86/internal.h src/x86/internal64.h     \
+       src/xtensa/ffitarget.h                                          \
+       src/dlmalloc.c
+
+EXTRA_libffi_la_SOURCES = \
+       src/aarch64/ffi.c src/aarch64/sysv.S                            \
+       src/alpha/ffi.c src/alpha/osf.S                                 \
+       src/arc/ffi.c src/arc/arcompact.S                               \
+       src/arm/ffi.c src/arm/sysv.S                                    \
+       src/avr32/ffi.c src/avr32/sysv.S                                \
+       src/bfin/ffi.c src/bfin/sysv.S                                  \
+       src/cris/ffi.c src/cris/sysv.S                                  \
+       src/frv/ffi.c src/frv/eabi.S                                    \
+       src/ia64/ffi.c src/ia64/unix.S                                  \
+       src/m32r/ffi.c src/m32r/sysv.S                                  \
+       src/m68k/ffi.c src/m68k/sysv.S                                  \
+       src/m88k/ffi.c src/m88k/obsd.S                                  \
+       src/metag/ffi.c src/metag/sysv.S                                \
+       src/microblaze/ffi.c src/microblaze/sysv.S                      \
+       src/mips/ffi.c src/mips/o32.S src/mips/n32.S                    \
+       src/moxie/ffi.c src/moxie/eabi.S                                \
+       src/nios2/ffi.c src/nios2/sysv.S                                \
+       src/or1k/ffi.c src/or1k/sysv.S                                  \
+       src/pa/ffi.c src/pa/linux.S src/pa/hpux32.S                     \
+       src/powerpc/ffi.c src/powerpc/ffi_sysv.c src/powerpc/ffi_linux64.c \
+        src/powerpc/sysv.S src/powerpc/linux64.S                       \
+        src/powerpc/linux64_closure.S src/powerpc/ppc_closure.S        \
+        src/powerpc/aix.S src/powerpc/darwin.S src/powerpc/aix_closure.S \
+        src/powerpc/darwin_closure.S src/powerpc/ffi_darwin.c          \
+       src/s390/ffi.c src/s390/sysv.S                                  \
+       src/sh/ffi.c src/sh/sysv.S                                      \
+       src/sh64/ffi.c src/sh64/sysv.S                                  \
+       src/sparc/ffi.c src/sparc/ffi64.c src/sparc/v8.S src/sparc/v9.S \
+       src/tile/ffi.c src/tile/tile.S                                  \
+       src/vax/ffi.c src/vax/elfbsd.S                                  \
+       src/x86/ffi.c src/x86/sysv.S                                    \
+        src/x86/ffiw64.c src/x86/win64.S                               \
+        src/x86/ffi64.c src/x86/unix64.S                               \
+       src/xtensa/ffi.c src/xtensa/sysv.S
+
+TARGET_OBJ = @TARGET_OBJ@
+libffi_la_LIBADD = $(TARGET_OBJ)
 
 libffi_convenience_la_SOURCES = $(libffi_la_SOURCES)
+EXTRA_libffi_convenience_la_SOURCES = $(EXTRA_libffi_la_SOURCES)
+libffi_convenience_la_LIBADD = $(libffi_la_LIBADD)
+libffi_convenience_la_DEPENDENCIES = $(libffi_la_DEPENDENCIES)
 nodist_libffi_convenience_la_SOURCES = $(nodist_libffi_la_SOURCES)
 
 LTLDFLAGS = $(shell $(SHELL) $(top_srcdir)/libtool-ldflags $(LDFLAGS))
@@ -249,7 +171,32 @@ if FFI_DEBUG
 AM_CFLAGS += -DFFI_DEBUG
 endif
 
-libffi_la_LDFLAGS = -no-undefined -version-info `grep -v '^\#' $(srcdir)/libtool-version` $(LTLDFLAGS) $(AM_LTLDFLAGS)
+if LIBFFI_BUILD_VERSIONED_SHLIB
+if LIBFFI_BUILD_VERSIONED_SHLIB_GNU
+libffi_version_script = -Wl,--version-script,libffi.map
+libffi_version_dep = libffi.map
+endif
+if LIBFFI_BUILD_VERSIONED_SHLIB_SUN
+libffi_version_script = -Wl,-M,libffi.map-sun
+libffi_version_dep = libffi.map-sun
+libffi.map-sun : libffi.map $(top_srcdir)/../contrib/make_sunver.pl \
+                $(libffi_la_OBJECTS) $(libffi_la_LIBADD)
+       perl $(top_srcdir)/../contrib/make_sunver.pl libffi.map \
+        `echo $(libffi_la_OBJECTS) $(libffi_la_LIBADD) | \
+           sed 's,\([^/        ]*\)\.l\([ao]\),.libs/\1.\2,g'` \
+        > $@ || (rm -f $@ ; exit 1)
+endif
+else
+libffi_version_script =
+libffi_version_dep =
+endif
+libffi_version_info = -version-info `grep -v '^\#' $(srcdir)/libtool-version`
+
+libffi.map: $(top_srcdir)/libffi.map.in
+       $(COMPILE) -D$(TARGET) -E -x assembler-with-cpp -o $@ $<
+
+libffi_la_LDFLAGS = -no-undefined $(libffi_version_info) $(libffi_version_script) $(LTLDFLAGS) $(AM_LTLDFLAGS)
+libffi_la_DEPENDENCIES = $(libffi_la_LIBADD) $(libffi_version_dep)
 
 AM_CPPFLAGS = -I. -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src
 AM_CCASFLAGS = $(AM_CPPFLAGS)