I strictly followed the instructions on this page to build my own host tools for mtd-utils. http://processors.wiki.ti.com/index.php/MTD_Utilities#MTD-Utils_Compilation
But I am getting error when I try to do make on mtd-utils build.
---------------------------------------------------------------------------------------------------------------------
root@NX-W-3:~/mtd/mtd-utils-d37fcc0# WITHOUT_XATTR=1 make
CHK include/version.h
LD mkfs.jffs2
/usr/bin/ld: cannot find -llzo2
collect2: ld returned 1 exit status
---------------------------------------------------------------------------------------------------------------------
I think linker was failing to find libs for lzo but apparently I already add
LZOLDFLAGS = -I$(PREFIX)/lib
in the Makefile. Could someone give some help with this?
Makefile changes:
---------------------------------------------------------------------------------------------------------------
# -*- sh -*-
VERSION = 1.4.8
PREFIX = /root/mtd/install
ZLIBCPPFLAGS = -I$(PREFIX)/include
LZOCPPFLAGS = -I$(PREFIX)/include
ZLIBLDFLAGS = -I$(PREFIX)/lib
LZOLDFLAGS = -I$(PREFIX)/lib
LDFLAGS += $(ZLIBLDFLAGS) $(LZOLDFLAGS)
CFLAGS ?= -O2 -g $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
CPPFLAGS += -I./include -I$(BUILDDIR)/include -I./ubi-utils/include $(ZLIBCPPFLAGS) $(LZOCPPFLAGS)
-----------------------------------------------------------------------------------------------------------
common.mk changes:
-----------------------------------------------------------------------------------------------------------
CC := $(CROSS)gcc
AR := $(CROSS)ar
RANLIB := $(CROSS)ranlib
# Stolen from Linux build system
comma = ,
try-run = $(shell set -e; ($(1)) >/dev/null 2>&1 && echo "$(2)" || echo "$(3)")
cc-option = $(call try-run, $(CC) $(1) -c -xc /dev/null -o /dev/null,$(1),$(2))
CFLAGS ?= -O2 -g
WFLAGS := -Wall \
$(call cc-option,-Wextra) \
$(call cc-option,-Wwrite-strings) \
$(call cc-option,-Wno-sign-compare)
CFLAGS += $(WFLAGS)
SECTION_CFLAGS := $(call cc-option,-ffunction-sections -fdata-sections -Wl$(comma)--gc-sections)
CFLAGS += $(SECTION_CFLAGS)
ifneq ($(WITHOUT_LARGEFILE), 1)
CPPFLAGS += -D_FILE_OFFSET_BITS=64
endif
DESTDIR?=
#PREFIX=/usr
EXEC_PREFIX=$(PREFIX)
SBINDIR=$(EXEC_PREFIX)/sbin
MANDIR=$(PREFIX)/share/man
INCLUDEDIR=$(PREFIX)/include
--------------------------------------------------------------------------------------------------------------------