Skip to content

Commit

Permalink
Disable building of elf-specific code on Mach-O systems.
Browse files Browse the repository at this point in the history
The only Mach-O system supported is Darwin.
  • Loading branch information
landonf committed Dec 22, 2014
1 parent b236be0 commit 9b9cb27
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 3 deletions.
12 changes: 11 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,17 @@ else
fi

AM_CONDITIONAL(DYNAMIC, test "$with_staticonly" != "no")
AM_CONDITIONAL(LIBELF_BUNDLED, test "$libelf_bundled" != "no")

dnl Select appropriate ABI
AS_CASE(
[$host_os],
[darwin*],
[ac_cv_binary_abi=macho],
[ac_cv_binary_abi=elf]
)
AM_CONDITIONAL(HAVE_MACHO_ABI, test "$ac_cv_binary_abi" = "macho")
AM_CONDITIONAL(HAVE_ELF_ABI, test "$ac_cv_binary_abi" = "elf")
AM_CONDITIONAL(LIBELF_BUNDLED, test "$ac_cv_binary_abi" = "elf" -a "$libelf_bundled" != "no")

AC_SUBST([LIBJAIL_LIB])
AC_SUBST([LIBEXECINFO_LIB])
Expand Down
2 changes: 2 additions & 0 deletions external/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ libsqlite_static_la_SOURCES= $(libsqlite_la_SOURCES)
libsqlite_static_la_CFLAGS= $(sqlite_common_cflags) -static
libsqlite_static_la_LDFLAGS= -all-static

if HAVE_ELF_ABI
CLEANFILES= libelf/libelf_fsize.c \
libelf/libelf_msize.c \
libelf/libelf_convert.c \
Expand All @@ -248,3 +249,4 @@ libelf/libelf_msize.c:
@m4 -D SRCDIR=$(srcdir)/libelf $(srcdir)/libelf/elf_types.m4 $(srcdir)/libelf/libelf_msize.m4 > $@
libelf/native-elf-format.h:
$(srcdir)/libelf/native-elf-format > libelf/native-elf-format.h
endif
15 changes: 13 additions & 2 deletions libpkg/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ endif
libpkg_la_SOURCES= pkg.c \
backup.c \
dns_utils.c \
elfhints.c \
fetch.c \
packing.c \
pkg_add.c \
Expand All @@ -31,7 +30,6 @@ libpkg_la_SOURCES= pkg.c \
pkg_cudf.c \
pkg_create.c \
pkg_delete.c \
pkg_elf.c \
pkg_event.c \
pkg_jobs.c \
pkg_jobs_conflicts.c \
Expand Down Expand Up @@ -59,6 +57,16 @@ libpkg_la_SOURCES= pkg.c \
pkg_old.c \
merge3.c \
diff.c

if HAVE_ELF_ABI
libpkg_la_SOURCES+= elfhints.c \
pkg_elf.c
endif

if HAVE_MACHO_ABI
# TODO
endif

libpkg_la_CFLAGS= $(pkg_common_cflags) -shared
libpkg_la_LIBADD= $(top_builddir)/compat/libbsd_compat.la \
$(top_builddir)/external/libucl.la \
Expand All @@ -75,11 +83,14 @@ libpkg_la_LIBADD= $(top_builddir)/compat/libbsd_compat.la \
-lssl \
-lcrypto \
-lm

if HAVE_ELF_ABI
if LIBELF_BUNDLED
libpkg_la_LIBADD+= $(top_builddir)/external/libelf.la
else
libpkg_la_LIBADD+= -lelf
endif
endif

libpkg_la_LDFLAGS= -version-info @LIBPKG_SO_VERSION@
EXTRA_libpkg_la_DEPENDENCIES= @REPOS_LDADD@
Expand Down

0 comments on commit 9b9cb27

Please sign in to comment.