capstone-engine / capstone

Capstone disassembly/disassembler framework for ARM, ARM64 (ARMv8), Alpha, BPF, Ethereum VM, HPPA, LoongArch, M68K, M680X, Mips, MOS65XX, PPC, RISC-V(rv32G/rv64G), SH, Sparc, SystemZ, TMS320C64X, TriCore, Webassembly, XCore and X86.
http://www.capstone-engine.org
7.61k stars 1.56k forks source link

LIBDIRARCH does not propagate to Makefile #2214

Closed YaSuenag closed 10 months ago

YaSuenag commented 11 months ago

I did not see lib64 under capstone directory when I installed it via make.sh as following:

$ PREFIX=/tmp/capstone ./make.sh install
  :
<snip>
  :
$ ls /tmp/capstone
bin  include  lib

We could not use pkg-config to detect capstone directories because libdir in capstone.pc points to lib64:

$ cat /tmp/capstone/lib/pkgconfig/capstone.pc
Name: capstone
Description: Capstone disassembly engine
Version: 5.0.0
libdir=/tmp/capstone/lib64
includedir=/tmp/capstone/include/capstone
archive=${libdir}/libcapstone.a
Libs: -L${libdir} -lcapstone
Libs.private: -L${libdir} -l:libcapstone.a
Cflags: -I${includedir}
archs=arm aarch64 m68k mips powerpc sparc systemz x86 xcore tms320c64x m680x evm riscv mos65xx wasm bpf sh tricore

make.sh would kick make with LIBDIRARCH=lib64 if /usr/lib64 exists, but it does not propagate to make install. We can see same problem in uninstall(). We need to export or set it to each commands.

kabeor commented 10 months ago

LGTM, thank you for your contribution!