keep APK_DEFAULT_ARCH as the define used in source code
parent
917698ec1d
commit
feec480b34
|
@ -48,7 +48,7 @@ time_t time(time_t *tloc)
|
||||||
|
|
||||||
static void version(struct apk_out *out, const char *prefix)
|
static void version(struct apk_out *out, const char *prefix)
|
||||||
{
|
{
|
||||||
apk_out_fmt(out, prefix, "apk-tools " APK_VERSION ", compiled for " APK_DEFAULT_FULL_ARCH ".");
|
apk_out_fmt(out, prefix, "apk-tools " APK_VERSION ", compiled for " APK_DEFAULT_ARCH ".");
|
||||||
#ifdef TEST_MODE
|
#ifdef TEST_MODE
|
||||||
apk_out_fmt(out, prefix, "TEST MODE BUILD. NOT FOR PRODUCTION USE.");
|
apk_out_fmt(out, prefix, "TEST MODE BUILD. NOT FOR PRODUCTION USE.");
|
||||||
#endif
|
#endif
|
||||||
|
@ -201,7 +201,7 @@ static int option_parse_global(void *ctx, struct apk_ctx *ac, int opt, const cha
|
||||||
ac->arch = optarg;
|
ac->arch = optarg;
|
||||||
break;
|
break;
|
||||||
case OPT_GLOBAL_print_arch:
|
case OPT_GLOBAL_print_arch:
|
||||||
puts(APK_DEFAULT_FULL_ARCH);
|
puts(APK_DEFAULT_ARCH);
|
||||||
return -ESHUTDOWN;
|
return -ESHUTDOWN;
|
||||||
#ifdef TEST_MODE
|
#ifdef TEST_MODE
|
||||||
case OPT_GLOBAL_test_repo:
|
case OPT_GLOBAL_test_repo:
|
||||||
|
|
|
@ -101,51 +101,51 @@ static inline int IS_ERR(const void *ptr) { return (unsigned long)ptr >= (unsign
|
||||||
|
|
||||||
/* default architecture for APK packages. */
|
/* default architecture for APK packages. */
|
||||||
#if defined(__x86_64__)
|
#if defined(__x86_64__)
|
||||||
#define APK_DEFAULT_ARCH "x86_64"
|
#define APK_DEFAULT_BASE_ARCH "x86_64"
|
||||||
#elif defined(__i386__)
|
#elif defined(__i386__)
|
||||||
#define APK_DEFAULT_ARCH "x86"
|
#define APK_DEFAULT_BASE_ARCH "x86"
|
||||||
#elif defined(__powerpc__) && !defined(__powerpc64__)
|
#elif defined(__powerpc__) && !defined(__powerpc64__)
|
||||||
#define APK_DEFAULT_ARCH "ppc"
|
#define APK_DEFAULT_BASE_ARCH "ppc"
|
||||||
#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "ppc64"
|
#define APK_DEFAULT_BASE_ARCH "ppc64"
|
||||||
#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__powerpc64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "ppc64le"
|
#define APK_DEFAULT_BASE_ARCH "ppc64le"
|
||||||
#elif defined(__arm__) && defined(__ARM_PCS_VFP) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __ARM_ARCH>=7
|
#elif defined(__arm__) && defined(__ARM_PCS_VFP) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ && __ARM_ARCH>=7
|
||||||
#define APK_DEFAULT_ARCH "armv7"
|
#define APK_DEFAULT_BASE_ARCH "armv7"
|
||||||
#elif defined(__arm__) && defined(__ARM_PCS_VFP) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__arm__) && defined(__ARM_PCS_VFP) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "armhf"
|
#define APK_DEFAULT_BASE_ARCH "armhf"
|
||||||
#elif defined(__arm__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__arm__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "armel"
|
#define APK_DEFAULT_BASE_ARCH "armel"
|
||||||
#elif defined(__aarch64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__aarch64__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "aarch64"
|
#define APK_DEFAULT_BASE_ARCH "aarch64"
|
||||||
#elif defined(__s390x__)
|
#elif defined(__s390x__)
|
||||||
#define APK_DEFAULT_ARCH "s390x"
|
#define APK_DEFAULT_BASE_ARCH "s390x"
|
||||||
#elif defined(__mips64) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
#elif defined(__mips64) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "mips64"
|
#define APK_DEFAULT_BASE_ARCH "mips64"
|
||||||
#elif defined(__mips64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__mips64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "mips64el"
|
#define APK_DEFAULT_BASE_ARCH "mips64el"
|
||||||
#elif defined(__mips__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
#elif defined(__mips__) && __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "mips"
|
#define APK_DEFAULT_BASE_ARCH "mips"
|
||||||
#elif defined(__mips__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__mips__) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "mipsel"
|
#define APK_DEFAULT_BASE_ARCH "mipsel"
|
||||||
#elif defined(__riscv) && __riscv_xlen == 32
|
#elif defined(__riscv) && __riscv_xlen == 32
|
||||||
#define APK_DEFAULT_ARCH "riscv32"
|
#define APK_DEFAULT_BASE_ARCH "riscv32"
|
||||||
#elif defined(__riscv) && __riscv_xlen == 64
|
#elif defined(__riscv) && __riscv_xlen == 64
|
||||||
#define APK_DEFAULT_ARCH "riscv64"
|
#define APK_DEFAULT_BASE_ARCH "riscv64"
|
||||||
#elif defined(__loongarch__) && defined(__loongarch32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__loongarch__) && defined(__loongarch32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "loongarch32"
|
#define APK_DEFAULT_BASE_ARCH "loongarch32"
|
||||||
#elif defined(__loongarch__) && defined(__loongarchx32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__loongarch__) && defined(__loongarchx32) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "loongarchx32"
|
#define APK_DEFAULT_BASE_ARCH "loongarchx32"
|
||||||
#elif defined(__loongarch__) && defined(__loongarch64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
#elif defined(__loongarch__) && defined(__loongarch64) && __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
|
||||||
#define APK_DEFAULT_ARCH "loongarch64"
|
#define APK_DEFAULT_BASE_ARCH "loongarch64"
|
||||||
#else
|
#else
|
||||||
#error APK_DEFAULT_ARCH not detected for this architecture
|
#error APK_DEFAULT_BASE_ARCH not detected for this architecture
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef APK_ARCH_PREFIX
|
#ifndef APK_ARCH_PREFIX
|
||||||
#define APK_DEFAULT_FULL_ARCH APK_DEFAULT_ARCH
|
#define APK_DEFAULT_ARCH APK_DEFAULT_BASE_ARCH
|
||||||
#else
|
#else
|
||||||
#define APK_DEFAULT_FULL_ARCH APK_ARCH_PREFIX "-" APK_DEFAULT_ARCH
|
#define APK_DEFAULT_ARCH APK_ARCH_PREFIX "-" APK_DEFAULT_BASE_ARCH
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define APK_MAX_REPOS 32 /* see struct apk_package */
|
#define APK_MAX_REPOS 32 /* see struct apk_package */
|
||||||
|
|
|
@ -263,7 +263,7 @@ static int mkpkg_main(void *pctx, struct apk_ctx *ac, struct apk_string_array *a
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (adb_ro_val(&pkgi, ADBI_PI_ARCH) == ADB_VAL_NULL)
|
if (adb_ro_val(&pkgi, ADBI_PI_ARCH) == ADB_VAL_NULL)
|
||||||
adb_wo_blob(&pkgi, ADBI_PI_ARCH, APK_BLOB_STRLIT(APK_DEFAULT_FULL_ARCH));
|
adb_wo_blob(&pkgi, ADBI_PI_ARCH, APK_BLOB_STRLIT(APK_DEFAULT_ARCH));
|
||||||
|
|
||||||
// scan and add all files
|
// scan and add all files
|
||||||
if (ctx->files_dir) {
|
if (ctx->files_dir) {
|
||||||
|
|
|
@ -1680,7 +1680,7 @@ int apk_db_open(struct apk_database *db, struct apk_ctx *ac)
|
||||||
db->arch = apk_atomize_dup(&db->atoms, apk_blob_trim(arch));
|
db->arch = apk_atomize_dup(&db->atoms, apk_blob_trim(arch));
|
||||||
free(arch.ptr);
|
free(arch.ptr);
|
||||||
} else {
|
} else {
|
||||||
db->arch = apk_atomize(&db->atoms, APK_BLOB_STR(APK_DEFAULT_FULL_ARCH));
|
db->arch = apk_atomize(&db->atoms, APK_BLOB_STR(APK_DEFAULT_ARCH));
|
||||||
db->write_arch = 1;
|
db->write_arch = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue