summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKonstantin Belousov <kostik@pooma.home>2010-03-06 00:41:37 +0200
committerKonstantin Belousov <kostik@pooma.home>2010-03-06 00:41:37 +0200
commit905034ce728e84b2a1652ac4b44a2d8a5147a0d1 (patch)
tree160158ac1a0d95c1c1d927ebda5751b484b42b4e
parent46ea10680d689fed15e2bbeed534c0c52059e0ec (diff)
downloadlibunwind-905034ce728e84b2a1652ac4b44a2d8a5147a0d1.tar.gz
Initial attempt at the build infrastructure for FreeBSD.
-rw-r--r--configure.in6
-rw-r--r--include/libunwind_i.h4
-rw-r--r--include/tdep/dwarf-config.h2
-rw-r--r--src/Makefile.am5
-rw-r--r--src/ptrace/_UPT_internal.h8
5 files changed, 21 insertions, 4 deletions
diff --git a/configure.in b/configure.in
index 6e55563c..72c6f88a 100644
--- a/configure.in
+++ b/configure.in
@@ -27,8 +27,8 @@ CHECK_ATOMIC_OPS
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h execinfo.h ia64intrin.h \
- sys/uc_access.h unistd.h signal.h)
+AC_CHECK_HEADERS(asm/ptrace_offsets.h endian.h sys/endian.h execinfo.h \
+ ia64intrin.h sys/uc_access.h unistd.h signal.h sys/types.h)
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
@@ -80,6 +80,7 @@ get_arch() {
hppa*) echo hppa;;
mips*) echo mips;;
powerpc*) is_gcc_m64;;
+ amd64) echo x86_64;;
*) echo $1;;
esac
}
@@ -99,6 +100,7 @@ AM_CONDITIONAL(ARCH_PPC32, test x$target_arch = xppc32)
AM_CONDITIONAL(ARCH_PPC64, test x$target_arch = xppc64)
AM_CONDITIONAL(OS_LINUX, expr x$target_os : xlinux >/dev/null)
AM_CONDITIONAL(OS_HPUX, expr x$target_os : xhpux >/dev/null)
+AM_CONDITIONAL(OS_FREEBSD, expr x$target_os : xfreebsd >/dev/null)
if test x$target_arch = xppc64; then
libdir='${exec_prefix}/lib64'
diff --git a/include/libunwind_i.h b/include/libunwind_i.h
index 27bfd8db..c7bd2231 100644
--- a/include/libunwind_i.h
+++ b/include/libunwind_i.h
@@ -54,8 +54,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#include <string.h>
#include <unistd.h>
-#ifdef HAVE_ENDIAN_H
+#if defined(HAVE_ENDIAN_H)
# include <endian.h>
+#elif defined(HAVE_SYS_ENDIAN_H)
+# include <sys/endian.h>
#else
# define __LITTLE_ENDIAN 1234
# define __BIG_ENDIAN 4321
diff --git a/include/tdep/dwarf-config.h b/include/tdep/dwarf-config.h
index ab36637b..ff5715f6 100644
--- a/include/tdep/dwarf-config.h
+++ b/include/tdep/dwarf-config.h
@@ -15,7 +15,7 @@
# include "tdep-ppc64/dwarf-config.h"
#elif defined __i386__
# include "tdep-x86/dwarf-config.h"
-#elif defined __x86_64__
+#elif defined __x86_64__ || defined __amd64__
# include "tdep-x86_64/dwarf-config.h"
#else
# error "Unsupported arch"
diff --git a/src/Makefile.am b/src/Makefile.am
index c110e768..4ba1b027 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -351,6 +351,11 @@ if OS_HPUX
libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_hpux_local)
endif
+if OS_FREEBSD
+ libunwind_la_SOURCES_os = $(libunwind_la_SOURCES_os_freebsd)
+ libunwind_la_SOURCES_os_local = $(libunwind_la_SOURCES_os_freebsd_local)
+endif
+
if ARCH_ARM
lib_LTLIBRARIES_arch = libunwind-arm.la
libunwind_la_SOURCES = $(libunwind_la_SOURCES_arm)
diff --git a/src/ptrace/_UPT_internal.h b/src/ptrace/_UPT_internal.h
index 0577097a..534a4ae4 100644
--- a/src/ptrace/_UPT_internal.h
+++ b/src/ptrace/_UPT_internal.h
@@ -26,6 +26,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */
#ifndef _UPT_internal_h
#define _UPT_internal_h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
#include <errno.h>
#include <libunwind-ptrace.h>
#include <limits.h>