diff --git a/auto.def b/auto.def index dd18dc7517..5281ba6898 100644 --- a/auto.def +++ b/auto.def @@ -101,6 +101,7 @@ cc-with { -libs { -llzma }} { } } if {[string match *-freebsd* [get-define host]]} { + define pkg_freebsd cc-with { -libs { -lmd }} { if {![cc-check-functions SHA256_Data]} { user-error "Unable to find libmd" diff --git a/libpkg/Makefile.autosetup b/libpkg/Makefile.autosetup index accd64c497..ef3eee4977 100644 --- a/libpkg/Makefile.autosetup +++ b/libpkg/Makefile.autosetup @@ -129,9 +129,12 @@ LOCAL_LDFLAGS+= -L$(top_builddir)/external/libmachista -lmachista_pic \ SRCS+= pkg_macho.c @else SRCS+= pkg_elf.c +@if pkg_freebsd +LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version +@else # --undefined-version is a FreeBSD ld option LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver -#LOCAL_LDFLAGS+= -Wl,--version-script=$(top_srcdir)/libpkg/libpkg.ver,--undefined-version +@endif @endif @if libelf-internal diff --git a/libpkg/pkg_macho.c b/libpkg/pkg_macho.c index 0e4ec14f19..6b345b7d40 100644 --- a/libpkg/pkg_macho.c +++ b/libpkg/pkg_macho.c @@ -332,7 +332,7 @@ pkg_arch_to_legacy(const char *arch, char *dest, size_t sz) /* Map the architecture name to its CPU type */ ai = NXGetArchInfoFromName(arch + i); if (ai == NULL) { - // pkg_emit_error("could not find architecture info for %s", arch + i); + pkg_emit_error("could not find architecture info for %s", arch + i); return EPKG_FATAL; }