The same way as libpng, libjpeg, etc from installing sfillib
Seems libarchive's source is located here
https://github.com/libarchive/libarchive
It has a configure.ac file so just run build/autogen.sh to generate the configure script. After that its just a matter of running configure, make, and make install
export PATH=$DEVKITARM/bin:$PATH
export CFLAGS=-march=armv6k -mtune=mpcore -mfloat-abi=hard -O3 -mword-relocations -fomit-frame-pointer -ffast-math
./configure --disable-shared --enable-static --host=arm-none-eabi --prefix=$DEVKITPRO/portlibs/armv6k --without-xml2
make
make install
If you have the source code and it uses configure then the above set of commands may work to compile it.
As for how to use the library there's always the documentation.
Heh this is proving tough to compile...
Anyway this is as far as I got after disabling pthreads in config.h (somehow it was still enabled) and removed <memory.h> include from archive_ppmd7.c
libarchive/archive_read_disk_posix.c:103:2: error: #error fchdir function required.
#error fchdir function required.