[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] Problem building some softwares included in Petalinux dist.



Well, just to make this example working I had to modified the makefile.
I am using GNU Make 3.81on Opensuse 10.3.

The parentheses in the build/build target does not seem necessary.
But the lines :

>    cd build; \
>
>    sh ../configure $(CONFIGURE_OPTS) $(CONFOPTS)

Should not be separated with a blank line.
Maybe it is what the parentheses are supposed to do, but they don't in my case.

As I understand the "; \" at end of lines is just to make the successive command run in a same sub-shell.
This is required only for the two cited lines. Without, each of the two command lines, will execute in a separate subshell so "cd build" with change to build (and return), but the "sh ..." will be run from the same directory as the makefile.

I also add to change the CONFOPTS options in the "modifiable enable" section to match my system.
Here is my modified makefile (I keep the comments, so that it can just be cut and paste).

In case of a version control fetch (SVN, git, etc.), it should be safer to hard code the version that have been tested, letting the user to inactivate it if he wants to test with the latest development /trunk or /branch version.

Please not that the email formatting should remove the tab character that is required before each command line for a target.

Nicolas



# Version modified by Nicolas Herve
# Original script from Chris Robson can be found here
# http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/archive/current/msg00158.html

#-----------------------------------------------------------------
# The comments within this file are for those who, like myself (Chris Robson)
# who 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.
#
#-----------------------------------------------------------------
# Define ./configure options. Pay attention to ":=" and " \" as
# these are required.
CONFOPTS :=    --with-ssl-lib=/usr/lib64/ \
        --with-ssl-headers=/usr/include/openssl/ \
        --disable-lzo
#-----------------------------------------------------------------
# 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 is redefined without it.
CONFIGURE_OPTS :=    --host=microblaze-linux \
            --build=i686-pc-linux-gnu \
            --target=microblaze-linux
#------------------------------------------------------------------
# Define DOWNLOADAPP to retrieve the latest 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 linux kernel release.
# unset the REVISION_FLAG to get the latest developpment release.
#
REVISION_FLAG:= -r 4400
DOWNLOADAPP :=    svn co $(REVISION_FLAG)\
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) build/openvpn /bin/openvpn

#------------------------------------------------------------------
# DO NOT EDITING ANYTHING BEYOND THIS POINT
# This should be common to every script and included by the port.

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)