Makefile: on x64, prefer /usr/lib64, if it is existent, over /usr/lib. bug reported & fix suggested by @chaostheory88

This commit is contained in:
Nguyen Anh Quynh 2014-04-08 23:34:44 +08:00
parent b6961b6ceb
commit ad6cc985d7

View File

@ -30,14 +30,16 @@ PREFIX ?= /usr
DESTDIR ?=
INCDIR = $(DESTDIR)$(PREFIX)/include
LIBDIR = $(DESTDIR)$(PREFIX)/lib
# on x86_64, we might have /usr/lib64 directory instead of /usr/lib
UNAME_M := $(shell uname -m)
UNAME_S := $(shell uname -s)
LIBDIR = $(DESTDIR)$(PREFIX)/lib
# on x86_64, we might have /usr/lib64 directory instead of /usr/lib
ifeq ($(UNAME_M), x86_64)
ifeq (,$(wildcard $(LIBDIR)))
# ignore Mac OSX
ifneq ($(UNAME_S), Darwin)
LIBDIR = $(DESTDIR)$(PREFIX)/lib64
ifeq (,$(wildcard $(LIBDIR)64))
LIBDIR = $(LIBDIR)64
endif
endif
endif