diff options
Diffstat (limited to 'src/driver/pe_amain.c')
-rw-r--r-- | src/driver/pe_amain.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/driver/pe_amain.c b/src/driver/pe_amain.c index 606184d..a766dba 100644 --- a/src/driver/pe_amain.c +++ b/src/driver/pe_amain.c @@ -10,16 +10,15 @@ #include <perk/perk_output.h> #include "perk_driver_impl.h" #include "perk_dprintf_impl.h" +#include "perk_ar_impl.h" #ifndef PERK_DRIVER_FLAGS #define PERK_DRIVER_FLAGS PERK_DRIVER_VERBOSITY_ERRORS \ | PERK_DRIVER_VERBOSITY_UTILITY \ - | PERK_DRIVER_AR_STRICT_PE \ - | PERK_DRIVER_AR_STRICT_PE_ARCH \ | PERK_DRIVER_AR_OBJECT_VECTOR #endif -static const char vermsg[] = "%s%s%s (git://midipix.org/perk): " +static const char vermsg[] = "%s%s%s (https://git.foss21.org/perk): " "version %s%d.%d.%d%s.\n" "[commit reference: %s%s%s]\n"; @@ -65,6 +64,10 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) uint64_t flags; struct pe_driver_ctx * dctx; const char ** unit; + const char * posname; + const char * arname; + const char ** arfiles; + uint64_t arflags; flags = PERK_DRIVER_FLAGS; fdout = fdctx ? fdctx->fdout : STDOUT_FILENO; @@ -84,6 +87,23 @@ int pe_main(char ** argv, char ** envp, const struct pe_fd_ctx * fdctx) pe_cmd_perk(dctx,*unit); break; + case PERK_CMD_AR: + arflags = dctx->cctx->drvflags; + + if (arflags & AR_POSNAME_MASK) { + posname = dctx->units[0]; + arname = posname ? dctx->units[1] : 0; + arfiles = arname ? &dctx->units[2] : 0; + } else { + posname = 0; + arname = dctx->units[0]; + arfiles = arname ? &dctx->units[1] : 0; + } + + pe_cmd_ar(dctx,arflags,posname,arname,arfiles); + + break; + default: break; } |