LINUX.ORG.RU

Компиляция приложения для Synology DS210j


0

0

Господа, помогите, плз, разобраться - нужно на компьютере с Ubuntu 9 скомпилировать приложение для NASa Synology DS210j. В комплекте с исходными файлами нет файла configure.

Вот исходники приложения - harimini. Toolchain для NASa я скачал и распаковал в /usr/local/arm-none-linux/gnueabi. Исходники в - /tmp/harimini. С исходниками есть 2 файла - Makefile и build-arm.sh. Первый со следующим текстом:

# export CROSS=/stuff/tmp/work/armv4t-angstrom-linux-gnueabi/gcc-cross-4.2.4-r5/staging-pkg/cross/bin/arm-angstrom-linux-gnueabi-
# export CPPFLAGS=-I/stuff/tmp/staging/armv4t-angstrom-linux-gnueabi/usr/include/mysql/
# export CPPFLAGS=-I/usr/include/libxml2/
export CPPFLAGS=-DUSE_MYSQL_WRAPPER -I/usr/include/libxml2/ -I/usr/include/mysql
# export CPPFLAGS=-DUSE_MYSQL_WRAPPER -I/stuff/tmp/work/armv4t-angstrom-linux-gnueabi/libxml2-2.7.2-r0/staging-pkg/staging/armv4t-angstrom-linux-gnueabi/usr/include/libxml2
# export CXXFLAGS=-msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4 -mtune=arm920t -Wcast-align
# export CFLAGS=-msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4 -mtune=arm920t -Wcast-align 
# export LDFLAGS=-L/stuff/tmp/staging/armv4t-angstrom-linux-gnueabi/usr/lib/mysql/
# export CC=${CROSS}gcc ${CFLAGS}
#export LD=${CROSS}ld
# export CXX=${CROSS}g++ ${CXXFLAGS}

LIBRARIES=RA SerializeClass PlutoUtils DCE pluto_main lmce_datalog
APPS=DCERouter MessageSend sqlCVS mysql_wrapper CreateDevice
DCEDEVS=ZWave AEt_EMC2000 Tongdy_RS485 # EnOcean_TCM120 
PLUGINS=RPC_Plugin Lighting_Plugin DataLogger_Plugin
CONFLICTING=

all: libs nolibs

nolibs: plugins apps

apps: required_dirs dcedevs intersecting
	for i in $(APPS); do $(MAKE) -C $$i || exit $$?; done

dcedevs: required_dirs
	for i in $(DCEDEVS); do $(MAKE) -C $$i bin || exit $$?; done

libs: required_dirs
	for i in $(LIBRARIES); do $(MAKE) -C $$i || exit $$?; done

plugins: required_dirs
	for i in $(PLUGINS); do $(MAKE) -C $$i so || exit $$?; done

intersecting: required_dirs
	for i in $(CONFLICTING); do $(MAKE) -C $$i clean all || exit $$?; done

required_dirs:
	mkdir -p bin lib 2>/dev/null

# you have to request yourself; there's no target depending on it
packages: all
	@echo "** Expect lots of editing to do :) Press enter to start"
	read
	for i in $(APPS) $(DCEDEVS) $(PLUGINS) $(CONFLICTING); do $(MAKE) -C $$i package; done

clean:
	@#for i in $(STANDALONE) $(PLUGINS) $(CONFLICTING); do $(MAKE) -C $$i clean || exit $$?; done
	for i in '*.d' '*.d.*' '*.o'; do find -type f -name "$$i" -exec rm '{}' ';' ; done

.PHONY: clean all
и второй:
#!/bin/bash
# make clean
CROSS=/stuff/tmp/work/armv4t-angstrom-linux-gnueabi/gcc-cross-4.2.4-r5/staging-pkg/cross/bin/arm-angstrom-linux-gnueabi- CPPFLAGS=-I/stuff/tmp/staging/armv4t-angstrom-linux-gnueabi/usr/include/mysql/ CXXFLAGS="-msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4 -mtune=arm920t" make 

В соответствии с Apps Development Guide, мне нужно сделать следующее:

# env CC=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-gcc \
LD=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ld \
RANLIB=/usr/local/arm-none-linux-gnueabi/bin/arm-none-linux-gnueabi-ranlib \
CFLAGS="-I/usr/local/arm-none-linux-gnueabi/include" \
LDFLAGS="-L/usr/local/arm-none-linux-gnueabi/lib" \
./configure \
--host=armle-unknown-linux \
--target=armle-unknown-linux \
--build=i686-pc-linux \
--prefix=/usr/local
но т.к. файла configure у меня нет, то я получаю ошибку:

env: ./configure: No such file or directory

.

Как все-таки скомпилировать это приложение?

Еще, разработчик приложения говорит, что для компиляции нужны headers/libs - mysql, libattr и libxml2. Где их взять для моего NASa?


попробуй для начала
bash build-arm.sh

dimon555 ★★★★★ ()
Ответ на: комментарий от dimon555

(исходники переложил в /usr/local/arm-none-linux-gnueabi/bin/harimini/)

Попробовал. Получаю ошибку:

root@ubuntu910desktop:/usr/local/arm-none-linux-gnueabi/bin/harimini# bash build-arm.sh
mkdir -p bin lib 2>/dev/null
for i in RA SerializeClass PlutoUtils DCE pluto_main lmce_datalog; do make -C $i || exit $?; done
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/RA'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/RA'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/SerializeClass'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/SerializeClass'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/PlutoUtils'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/PlutoUtils'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/DCE'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/DCE'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/pluto_main'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/pluto_main'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/lmce_datalog'
for dir in ; do cd $dir; make all; cd ..; done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/lmce_datalog'
for i in RPC_Plugin Lighting_Plugin DataLogger_Plugin; do make -C $i so || exit $?; done
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/RPC_Plugin'
cc -Wall -fPIC -ggdb3 -c mongoose.c
g++ -shared -o RPC_Plugin.so Main.o RPC_Plugin.o ../Gen_Devices/RPC_PluginBase.o mongoose.o  -L../lib   -lSerializeClass -lDCECommon -lPlutoUtils -lpthread -ldl -lpluto_main
cp RPC_Plugin.so ../bin
chmod +x post_make.sh
./post_make.sh RPC_Plugin.so
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/RPC_Plugin'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
Computing dependencies for ../Gen_Devices/Lighting_PluginBase.cpp done
Computing dependencies for Lighting_Plugin.cpp done
Computing dependencies for Main.cpp done
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
make[1]: Entering directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
g++ -c -DUSE_MYSQL_WRAPPER -I/usr/include/libxml2/ -I/usr/include/mysql -I.. -I../DCE   -msoft-float -D__GCC_FLOAT_NOT_NEEDED -march=armv4 -mtune=arm920t -Wall -fPIC -ggdb3  Main.cpp -o Main.o
Main.cpp:1: error: bad value (armv4) for -march= switch
Main.cpp:1: error: bad value (arm920t) for -mtune= switch
make[1]: *** [Main.o] Error 1
make[1]: Leaving directory `/usr/local/arm-none-linux-gnueabi/bin/harimini/Lighting_Plugin'
make: *** [plugins] Error 2

(Компилирую на компе с VMWare Player, Ubuntu 9.10 Desktop, не на NASe)

LA_ ()
Ответ на: комментарий от LA_

>Main.cpp:1: error: bad value (armv4) for -march= switch

Main.cpp:1: error: bad value (arm920t) for -mtune= switch


arm-gcc какой-нить поставить надо

dimon555 ★★★★★ ()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.