[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [microblaze-uclinux] adding applications to Petalinux platform: what do I need to know?
Dan
You will have to cross compile things. Generally application trees are
placed in the ./petalinux/user directory tree and user libraries are
placed in ./petalinux-dist/lib tree. I've enclosed a "makefile" (note
the small "m") make file which is a poor attempt at a make file tutorial
I'm still trying to work that may help you. If you can not do this
method I use a REALLY UGLY procedure which is really bad and should only
be used if the attached makefile wont work at all.
Steps:
1. copy your app tree to ./petalinux/user/[your app tree]
2. create the makefile as show below with your specific changes (note,
you may only need to run ./configure, my example pulls a fresh release
of the app from the net)
3. Edit the Makefile in ./petalinux-dist/user/Makefile (or
lib/Makefile) to include your app. You'll see how about midway down the
file dup a line like: "dir_$(CONFIG_USER_HTTPD_HTTPD) += httpd"
4. Edit ./petalinux-dist/config/config.in and add your app or lib to it.
5. Run make menuconfig, selecting your app
6. Check ./petalinux-dist/romfs/bin to see if your app is there and try
running it. It should fail because its the wrong type of binary, thus
it cross-compiled OK.
Hope this helps.............. makefile below
#-----------------------------------------------------------------
# The comments within this file are for those who, like myself
# are new at cross-compiling "and" creating a "makefile" for
# for environments like Petalinux's userland and libland.
# Thanks to the makefile experts out there from which most
# of the information here was exploited.
#
# Currently this file is placed within the application directory
# tree ./petalinux-dist/user/[application name]. (Possibly a
# cleaner approach is to have the ./user/makefile create the
# specific application directory??) This example is for building
# the application "openvpn". First a clean
# ./petalinux-dist/user/openvpn is created and this
# "makefile" placed into it. Because DOWNLOADAPP is defined, a
# new svn release of openvpn is pull into the directory.
#
#-----------------------------------------------------------------
# Define ./configure options. Pay attendtion to ":=" and " \" as
# these are required.
CONFOPTS := --with-ssl-lib=$(ROOTDIR)/user/openssl \
--with-ssl-headers=$(ROOTDIR)/user/openssl/include
#-----------------------------------------------------------------
# Define CONFIGURE_OPTS here if the defaults need to be overridden.
# For example, the defaults include the configure option
# "--disable-shared" but this build of openvpn required the shared
# library so CONFIGURE_OPTS redfined without it.
CONFIGURE_OPTS := --host=microblaze-linux \
--build=i686-pc-linux-gnu \
--target=microblaze-linux
#------------------------------------------------------------------
# Define DOWNLOADAPP to retrieve the lastest version of openvpn.
# Since openvpn is well behaved an svn release pull can be
# used. This is not always the case and may require manual
# downloading of the application into the user/appl directory
# directly. For example, applications which are closely integrated
# with a particular linus kernel release.
DOWNLOADAPP :=svn co \
http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn ./
#------------------------------------------------------------------
# Defines the distribution cleanup method. For example openvpn
# uses a supplied script "doclean". Other applications might
# use "make distclean".
CLEANDIST := doclean
#------------------------------------------------------------------
# Define the automake method. This could be autoconf, autoreconf
# (as in the openvpn case) or automake.
AUTOBUILD := autoreconf
#------------------------------------------------------------------
# Define any automake options.
AUTOBUILDOPTIONS := -i -v
#------------------------------------------------------------------
# Define compiler options. This maybe required because the
# application is not well behaved.
# Openvpn does not require these definitions.
#CC := mb-linux-gcc
#CXX := mb-linux-g++
#RANLIB := mb-linux-ranlib
#------------------------------------------------------------------
# Defines the application executable to be built into the romfs
# APPNAME is used here so if more than one executable is used
# they are listed here not within the non-editing portion of
# this makefile.
#APPNAME := $(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN ./build/openvpn
/bin/openvpn
APPNAME := $(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN ./etc/S99openvpn
/etc/rc.d/S99openvpn; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN ./build/openvpn
/bin/openvpn; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN
./etc/TopSY1000DS-static.conf /etc/TopSY1000DS-static.conf; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN
./etc/TopSY1000DS-CMF-static.conf /etc/TopSY1000DS-CMF-static.conf; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN
./etc/BottomSY1000DS-CMF-static.conf /etc/BottomSY1000DS-CMF-static.conf; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN
./etc/TopSY1000DS-static.key /etc/TopSY1000DS-static.key; \
$(ROMFSINST) -e CONFIG_USER_OPENVPN_OPENVPN
./etc/BottomSY1000DS-static.key /etc/BottomSY1000DS-static.key
#------------------------------------------------------------------
# DO NOT EDITING ANYTHING BEYOND THIS POINT
all: build/build
$(MAKE) -C build
build/build: makefile
@rm -rf build
@mkdir build
($(DOWNLOADAPP); \
./$(CLEANDIST); \
$(AUTOBUILD) $(AUTOBUILDOPTIONS); \
cd build; \
sh ../configure $(CONFIGURE_OPTS) $(CONFOPTS))
@touch build/build
clean:
rm -rf build
romfs:
$(APPNAME)
___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/