I'm running an embedded system and do not compile ltp on it instead I
compile it on a host system and then copy it to a SD card (ext3). There
were a handful of hard coded links in the Makefiles that made this hard.
Below is a patch to address these issues, please review it closely as I'm
not sure if it is the best approach, however it does work. I also had to
patch the tools/netpipe-2.4/chmod.sh because it was forcing you to be root
but you do not need to be root if your installing into a staging area. The
modification ignores if your not root if you have CROSS_COMPILE set up.
Regards,
Shane
Patch:
--- ltp-full-20080831/doc/man1/Makefile~org 2008-10-09 10:31:22.000000000
-0400
+++ ltp-full-20080831/doc/man1/Makefile 2008-10-09 10:31:49.000000000
-0400
@@ -1,6 +1,6 @@
-DESTDIR=/usr
+DESTDIR?=/usr
MANPAGES=bump.1 doio.1 iogen.1 pan.1
all:
--- ltp-full-20080831/doc/man3/Makefile~org 2008-10-09 10:31:27.000000000
-0400
+++ ltp-full-20080831/doc/man3/Makefile 2008-10-09 10:31:40.000000000
-0400
@@ -1,6 +1,6 @@
-DESTDIR=/usr
+DESTDIR?=/usr
MANPAGES=forker.3 get_attrib.3 parse_open_flags.3 parse_opts.3 \
parse_ranges.3 pattern.3 random_range.3 random_range_seed.3 \
rmobj.3 string_to_tokens.3 str_to_bytes.3 tst_res.3 \
--- ltp-full-20080831/tools/netpipe-2.4/chmod.sh~org 2008-10-09
10:40:27.000000000 -0400
+++ ltp-full-20080831/tools/netpipe-2.4/chmod.sh 2008-10-09
10:50:03.000000000 -0400
@@ -1,6 +1,6 @@
#!/bin/sh
whoami | grep root > /dev/null
-if [ $? -eq 0 ];then
+if [[ $? -eq 0 || -n "${CROSS_COMPILE:+x}" ]]; then
chmod 755 $1
else
echo ""
--- ltp-full-20080831/include/Makefile~org 2008-10-09 12:20:37.000000000
-0400
+++ ltp-full-20080831/include/Makefile 2008-10-09 12:20:43.000000000
-0400
@@ -1,6 +1,6 @@
-DESTDIR=/opt/ltp
+DESTDIR?=/opt/ltp
HEADERS=compiler.h dataascii.h databin.h file_lock.h forker.h open_flags.h
\
pattern.h random_range.h rmobj.h search_path.h string_to_tokens.h \
str_to_bytes.h test.h tlibio.h usctest.h write_log.h \
--- ltp-full-20080831/pan/Makefile~org 2008-10-09 12:23:14.000000000
-0400
+++ ltp-full-20080831/pan/Makefile 2008-10-09 12:23:19.000000000 -0400
@@ -2,7 +2,7 @@
LOADLIBES += -lm
LFLAGS += -l
CFLAGS += -w
-DESTDIR = /opt/ltp
+DESTDIR ?= /opt/ltp
all: pan bump scanner
--- ltp-full-20080831/lib/Makefile~org 2008-10-09 14:02:24.000000000
-0400
+++ ltp-full-20080831/lib/Makefile 2008-10-09 14:03:06.000000000 -0400
@@ -1,5 +1,5 @@
-DESTDIR=/opt/ltp
+DESTDIR?=/opt/ltp
CFLAGS+= -Wall
CFLAGS+= -D_USC_LIB_
@@ -21,5 +21,5 @@
install: $(TARGET)
install -D $(TARGET) $(DESTDIR)/lib/$(TARGET)
- install -D ltp.pc /usr/share/pkgconfig/ltp.pc
+ install -D ltp.pc $(DESTDIR)/usr/share/pkgconfig/ltp.pc
-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list