| OLD | NEW |
| 1 diff --git a/compat/Makefile.am b/compat/Makefile.am | 1 diff --git a/compat/Makefile.am b/compat/Makefile.am |
| 2 --- a/compat/Makefile.am | 2 --- a/compat/Makefile.am |
| 3 +++ b/compat/Makefile.am | 3 +++ b/compat/Makefile.am |
| 4 @@ -1,8 +1,7 @@ | 4 @@ -1,8 +1,7 @@ |
| 5 -noinst_LTLIBRARIES= libbsd_compat.la | 5 -noinst_LTLIBRARIES= libbsd_compat.la |
| 6 noinst_HEADERS= bsd_compat.h endian_util.h \ | 6 noinst_HEADERS= bsd_compat.h endian_util.h \ |
| 7 humanize_number.h | 7 humanize_number.h |
| 8 | 8 |
| 9 -libbsd_compat_la_SOURCES= basename.c \ | 9 -libbsd_compat_la_SOURCES= basename.c \ |
| 10 +sources= basename.c \ | 10 +sources= basename.c \ |
| (...skipping 733 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 | 744 |
| 745 return (0); | 745 return (0); |
| 746 } | 746 } |
| 747 +#endif | 747 +#endif |
| 748 | 748 |
| 749 -#ifndef __DragonFly__ | 749 -#ifndef __DragonFly__ |
| 750 +#if !defined(__DragonFly__) && !defined(__native_client__) | 750 +#if !defined(__DragonFly__) && !defined(__native_client__) |
| 751 int | 751 int |
| 752 pkg_get_myarch(char *dest, size_t sz) | 752 pkg_get_myarch(char *dest, size_t sz) |
| 753 { | 753 { |
| 754 @@ -987,3 +993,49 @@ pkg_get_myarch(char *dest, size_t sz) | 754 @@ -987,3 +993,51 @@ pkg_get_myarch(char *dest, size_t sz) |
| 755 } | 755 } |
| 756 #endif | 756 #endif |
| 757 | 757 |
| 758 +#ifdef __native_client__ | 758 +#ifdef __native_client__ |
| 759 +int | 759 +int |
| 760 +pkg_get_myarch_legacy(char *dest, size_t sz) | 760 +pkg_get_myarch_legacy(char *dest, size_t sz) |
| 761 +{ | 761 +{ |
| 762 + char current[sz]; | 762 + char current[sz]; |
| 763 + int ret; | 763 + int ret; |
| 764 + | 764 + |
| 765 + if ((ret = pkg_get_myarch(current, sizeof(current))) != EPKG_OK) | 765 + if ((ret = pkg_get_myarch(current, sizeof(current))) != EPKG_OK) |
| 766 + return ret; | 766 + return ret; |
| 767 + | 767 + |
| 768 + return pkg_arch_to_legacy(current, dest, sz); | 768 + return pkg_arch_to_legacy(current, dest, sz); |
| 769 +} | 769 +} |
| 770 + | 770 + |
| 771 +int | 771 +int |
| 772 +pkg_get_myarch(char *dest, size_t sz) | 772 +pkg_get_myarch(char *dest, size_t sz) |
| 773 +{ | 773 +{ |
| 774 + char * os_name = "nacl"; | 774 + char * os_name = "nacl"; |
| 775 +#ifdef __arm__ | 775 +#ifdef __arm__ |
| 776 + const char* cpu_name = "arm"; | 776 + const char* cpu_name = "arm"; |
| 777 +#elif defined __i386__ | 777 +#elif defined __i386__ |
| 778 + const char* cpu_name = "i686"; | 778 + const char* cpu_name = "i686"; |
| 779 +#elif defined __x86_64__ | 779 +#elif defined __x86_64__ |
| 780 + const char* cpu_name = "x86_64"; | 780 + const char* cpu_name = "x86_64"; |
| 781 +#elif defined __le32__ |
| 782 + const char* cpu_name = "le32"; |
| 781 +#elif defined __pnacl__ | 783 +#elif defined __pnacl__ |
| 782 + const char* cpu_name = "pnacl"; | 784 + const char* cpu_name = "pnacl"; |
| 783 +#else | 785 +#else |
| 784 +#error "Unknown architecture" | 786 +#error "Unknown architecture" |
| 785 +#endif | 787 +#endif |
| 786 + long long major_version = 0; | 788 + long long major_version = 0; |
| 787 + char *spec = NULL; | 789 + char *spec = NULL; |
| 788 + int ret = EPKG_OK; | 790 + int ret = EPKG_OK; |
| 789 + | 791 + |
| 790 + asprintf(&spec, "%s:%lld:%s", os_name, major_version, cpu_name); | 792 + asprintf(&spec, "%s:%lld:%s", os_name, major_version, cpu_name); |
| (...skipping 1391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2182 | 2184 |
| 2183 +if DYNAMIC | 2185 +if DYNAMIC |
| 2184 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil | 2186 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat.la -lutil |
| 2185 +else | 2187 +else |
| 2186 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la | 2188 + GENERIC_LDADD+= $(top_builddir)/compat/libbsd_compat_static.la |
| 2187 +endif | 2189 +endif |
| 2188 + | 2190 + |
| 2189 if HAVE_ELF_ABI | 2191 if HAVE_ELF_ABI |
| 2190 if LIBELF_BUNDLED | 2192 if LIBELF_BUNDLED |
| 2191 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la | 2193 GENERIC_LDADD+= $(top_builddir)/external/libelf_static.la |
| OLD | NEW |