OpenWrt Forum Archive

Topic: Help writing a simple Makefile compile section

The content of this topic has been archived on 29 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hi.
I have a piece of software I want to run on OpenWrt, and it is not present on the repos. It is "servald", the Serval Project daemon.
I already have most of the makefile, but the application won't compile. Usually to compile this application one has to run

autoconf
./configure
make

What is the equivalent of these commands in the makefile? Simply running them would use the toolchain of the operating system and the resulting binary won't run on OpenWrt.

Thanks!

Why not post your complete Makefile?

Also add PKG_FIXUP:=autoreconf to your OpenWrt Makefile

I added PKG_FIXUP:=autoreconf to the top of the Makefile.

Below is the current Makefile. I took it from someone who used it a long time ago. It was using deprecated syntax so I fixed only that. I don't completely understand the compilt section.

Thank you!

include $(TOPDIR)/rules.mk

PKG_NAME:=servald
PKG_RELEASE:=1
PKG_VERSION:=1
PKG_FIXUP:=autoreconf

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)

include $(INCLUDE_DIR)/package.mk

define Package/servald
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=servald
endef

define Package/servald/description
    Serval Distributed Numbering Architecture Reference Implementation
endef

define Build/Compile
    mkdir -p $(PKG_BUILD_DIR)
    $(CP) ./src/* $(PKG_BUILD_DIR)/
    $(TARGET_CC) $(PKG_BUILD_DIR)/*.c -o $(PKG_BUILD_DIR)/servald
#    $(MAKE) CC=$(TARGET_CC) -C $(PKG_BUILD_DIR)
endef

define Package/servald/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/servald $(1)/usr/bin
endef

$(eval $(call BuildPackage,servald))

The output of the compilation is very long so I'll post only the beginnin and end of it:

make[1]: Entering directory `/home/jonathan/OpenWrt-SDK'
make[2]: Entering directory `/home/jonathan/OpenWrt-SDK/package/dna'
mkdir -p /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1
cp -fpR ./src/* /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/
mips-openwrt-linux-uclibc-gcc /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/*.c -o /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/dna
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:1: note: someone does not honour COPTS correctly, passed 0 times
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:16:22: error: asterisk.h: No such file or directory
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:18: error: expected declaration specifiers or '...' before string constant
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:18: error: expected declaration specifiers or '...' before string constant
In file included from /home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/bits/types.h:31,
                 from /home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:31,
                 from /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:20:
/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/include/stddef.h: In function 'ASTERISK_FILE_VERSION':
/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/include/stddef.h:214: error: storage class specified for parameter 'size_t'
In file included from /home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/bits/types.h:32,
                 from /home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/sys/types.h:31,
                 from /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/asterisk_app.c:20:
/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/bits/kernel_types.h:37: error: storage class specified for parameter '__kernel_dev_t'
/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/bin/../lib/gcc/mips-openwrt-linux-uclibc/4.3.3/../../../../mips-openwrt-linux-uclibc/sys-include/bits/kernel_types.h:38: error: storage class specified for parameter '__kernel_ino_t'
...
...
...
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/vomp.c:778: error: 'overlay_mdp_frame' has no member named 'in'
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/vomp.c:948: error: 'overlay_mdp_frame' has no member named 'in'
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/vomp_console.c:1: note: someone does not honour COPTS correctly, passed 0 times
In file included from /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/vomp_console.c:27:
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/serval.h:373: error: field 'address' has incomplete type
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/serval.h:374: error: field 'broadcast_address' has incomplete type
In file included from /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/vomp_console.c:27:
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/serval.h:651:18: error: nacl.h: No such file or directory
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/serval.h:716: error: expected specifier-qualifier-list before 'uint16_t'
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/serval.h:751: error: expected specifier-qualifier-list before 'uint16_t'
/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/xprintf.c:1: note: someone does not honour COPTS correctly, passed 0 times
make[2]: *** [/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/dna-1/.built] Error 1
make[2]: Leaving directory `/home/jonathan/OpenWrt-SDK/package/dna'
make[1]: *** [package/dna/compile] Error 2
make[1]: Leaving directory `/home/jonathan/OpenWrt-SDK'
make: *** [package/dna/compile] Error 2

(in this try the package was called "dna" instead of "servald", you can ignore that change)

This software is a bit tricky to port, especially since it insists on building its own version of NaCL which fails horribly for cross compiling.
Anyway, I was bored and made it working using the Makefile and patch below.

package/serval-dna/Makefile

include $(TOPDIR)/rules.mk

PKG_NAME:=serval-dna
PKG_VERSION:=2012-10-10
PKG_RELEASE=$(PKG_SOURCE_VERSION)

PKG_SOURCE_PROTO:=git
PKG_SOURCE_URL:=https://github.com/servalproject/serval-dna.git
PKG_SOURCE_SUBDIR:=$(PKG_NAME)-$(PKG_VERSION)
PKG_SOURCE_VERSION:=b7201a75b2c581bf3e73106fc2a54b52dd372b1c
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION)-$(PKG_SOURCE_VERSION).tar.gz

PKG_FIXUP:=autoreconf

PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_NAME)-$(PKG_VERSION)
PKG_BUILD_DEPENDS:=nacl

include $(INCLUDE_DIR)/package.mk

define Package/serval-dna
    SECTION:=utils
    CATEGORY:=Utilities
    TITLE:=serval-dna
    DEPENDS:=+libpthread +librt
endef

define Package/serval-dna/description
  Serval Distributed Numbering Architecture Reference Implementation
endef

define Build/Prepare
    $(call Build/Prepare/Default)
    echo $(STAGING_DIR)/usr/include/nacl > $(PKG_BUILD_DIR)/nacl/naclinc.txt
    echo $(STAGING_DIR)/usr/lib/libnacl.a > $(PKG_BUILD_DIR)/nacl/nacllib.txt
    (cd $(STAGING_DIR)/usr/include/nacl; \
        find . -name \*.h -a \! -name mphlr.h -a \! -name nacl.h | \
        sed -e 's,\./\(.*\),#include <\1>,') > $(PKG_BUILD_DIR)/nacl.h
endef

define Package/serval-dna/install
    $(INSTALL_DIR) $(1)/usr/bin
    $(INSTALL_BIN) $(PKG_BUILD_DIR)/servald $(1)/usr/bin
endef

$(eval $(call BuildPackage,serval-dna))

package/serval-dna/patches/100-no-shipped-nacl.patch

--- a/configure.in
+++ b/configure.in
@@ -104,16 +104,10 @@ AC_CHECK_HEADER([alsa/asoundlib.h], [hav
 AS_IF([test x"$have_alsa" = "x1"], [AC_DEFINE([HAVE_ALSA_ASOUNDLIB_H])])
 AS_IF([test x"$have_alsa" = "x1"], [AC_SUBST(HAVE_ALSA,1)], [AC_SUBST(HAVE_ALSA,0)])
 
-echo "Fetching and building NaCl if required."
-echo "(this can take HOURS to build depending on your architecture,"
-echo " but fortunately it only needs to happen once.)"
-cd nacl
-./nacl-gcc-prep
-cd ..
 NACL_INC=`cat nacl/naclinc.txt`
 NACL_LIB=`cat nacl/nacllib.txt`
-CPPFLAGS="$CPPFLAGS -Inacl/$NACL_INC"
-LDFLAGS="$LDFLAGS nacl/$NACL_LIB"
+CPPFLAGS="$CPPFLAGS -I$NACL_INC"
+LDFLAGS="$LDFLAGS $NACL_LIB"
 AC_CHECK_HEADER(crypto_sign_edwards25519sha512batch_ref/ge25519.h,
         AC_DEFINE([HAVE_CRYPTO_SIGN_NACL_GE25519_H]),
         [

You also need to install the "nacl" package from feeds to make it work.

Thank you so much! I couldn't pull that stunt alone smile I really appreciate your help.
The developers of Serval are also interested in this port and I'm going to pass this to them when it all works.

I changed all of the indentations in the makefile from spaces to tabs because it said "missing separator". Hope it's ok. (probably a copy-paste problem)

Unfortunately I would need a little bit more help building it. When I do

make package/serval-dna/compile

it tries to download the sources from two OpenWrt mirrors and it can't find the sources there. Here is the output: (I changed the links to hxxp because the forum does not allow more than one link to be posted)

make[1]: Entering directory `/home/jonathan/OpenWrt-SDK'
make[2]: Entering directory `/home/jonathan/OpenWrt-SDK/package/serval-dna'
mkdir -p /home/jonathan/OpenWrt-SDK/dl
--2012-10-15 13:18:39--  hxxp://mirror2.openwrt.org/sources/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz
Resolving mirror2.openwrt.org... 46.4.11.11
Connecting to mirror2.openwrt.org|46.4.11.11|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-10-15 13:18:44 ERROR 404: Not Found.

Download failed.
--2012-10-15 13:18:44--  hxxp://downloads.openwrt.org/sources/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz
Resolving downloads.openwrt.org... 78.24.191.177
Connecting to downloads.openwrt.org|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-10-15 13:18:50 ERROR 404: Not Found.

Download failed.
No more mirrors to try - giving up.
Checking out files from the git repository...
--: git: command not found
make[2]: *** [/home/jonathan/OpenWrt-SDK/dl/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz] Error 127
make[2]: Leaving directory `/home/jonathan/OpenWrt-SDK/package/serval-dna'
make[1]: *** [package/serval-dna/compile] Error 2
make[1]: Leaving directory `/home/jonathan/OpenWrt-SDK'
make: *** [package/serval-dna/compile] Error 2

Do I have to do anything before trying to compile it or should I run another command?

(Last edited by SoleSoul on 15 Oct 2012, 12:23)

Install git.

oh, I missed that line "--: git: command not found"

It downloaded the sources to build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10, now when trying to run

make package/serval-dna/compile

I get

make[1]: Entering directory `/home/jonathan/OpenWrt-SDK'
make[2]: Entering directory `/home/jonathan/OpenWrt-SDK/package/serval-dna'
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib " make -C /home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[3]: Entering directory `/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10'
make[2]: *** [/home/jonathan/OpenWrt-SDK/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/.built] Error 2
make[2]: Leaving directory `/home/jonathan/OpenWrt-SDK/package/serval-dna'
make[1]: *** [package/serval-dna/compile] Error 2
make[1]: Leaving directory `/home/jonathan/OpenWrt-SDK'
make: *** [package/serval-dna/compile] Error 2

It's my first time, please forgive my ignorance smile

You're not supposed to download any sources, and you apparently did it wrong too.
Just install git on your build machine, the makefile will fetch the required sources automatically.

mm... I didn't write "I downloaded", I wrote "It downloaded" smile
I installed git, and the sources were indeed fetched automatically.
What I did is put the Makefile and patch file in place and run "make package/serval-dna/compile" in the root folder of the sdk as described in the wiki.

After the sources were fetched automatically and put in place, it tried to "make" the application, and failed with the output I copied in the previous reply. I tried several times, and that's why the output does not contain the download output, because the sources were  already in place from the previous try to build.

What I have in the build folder looks like the content of the git repo. This folder however does not contain a makefile yet.

Your SDK might be too old for that, I tried with current trunk. Your version needs to support the PKG_FIXUP:=autoreconf feature. Judging from the output above it doesn't.

Ok, I tried again fresh from start. This is the whole output of the try with backfire's SDK:

 % make package/serval-dna/compile V=99
Collecting package info: done
Collecting target info: done
Checking 'non-root'... ok.
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'getopt'... ok.
Checking 'fileutils'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... ok.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'flex'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
make[4]: Entering directory `/home/jonathan/OpenWrt-SDK-older/package/serval-dna'
make[4]: Leaving directory `/home/jonathan/OpenWrt-SDK-older/package/serval-dna'
make[1]: Entering directory `/home/jonathan/OpenWrt-SDK-older'
make[2]: Entering directory `/home/jonathan/OpenWrt-SDK-older/package/serval-dna'
mkdir -p /home/jonathan/OpenWrt-SDK-older/dl
--2012-10-16 17:51:51--  http://mirror2.openwrt.org/sources/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz
Resolving mirror2.openwrt.org... 46.4.11.11
Connecting to mirror2.openwrt.org|46.4.11.11|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-10-16 17:51:52 ERROR 404: Not Found.

Download failed.
--2012-10-16 17:51:52--  http://downloads.openwrt.org/sources/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz
Resolving downloads.openwrt.org... 78.24.191.177
Connecting to downloads.openwrt.org|78.24.191.177|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2012-10-16 17:51:52 ERROR 404: Not Found.

Download failed.
No more mirrors to try - giving up.
Checking out files from the git repository...
Cloning into 'serval-dna-2012-10-10'...
remote: Counting objects: 8177, done.
remote: Compressing objects: 100% (2355/2355), done.
remote: Total 8177 (delta 5781), reused 8175 (delta 5780)
Receiving objects: 100% (8177/8177), 4.05 MiB | 859 KiB/s, done.
Resolving deltas: 100% (5781/5781), done.
Note: checking out 'b7201a75b2c581bf3e73106fc2a54b52dd372b1c'.

You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.

If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:

  git checkout -b new_branch_name

HEAD is now at b7201a7... Ensure paths decay and eventually expire
Packing checkout...
gzip -dc /home/jonathan/OpenWrt-SDK-older/dl/serval-dna-2012-10-10-b7201a75b2c581bf3e73106fc2a54b52dd372b1c.tar.gz | /bin/tar -C /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/.. -xf - 

Applying ./patches/100-no-shipped-nacl.patch using plaintext: 
patching file configure.in
patch unexpectedly ends in middle of line
Hunk #1 succeeded at 104 with fuzz 1.
echo /home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include/nacl > /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/nacl/naclinc.txt
echo /home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib/libnacl.a > /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/nacl/nacllib.txt
(cd /home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include/nacl; find . -name \*.h -a \! -name mphlr.h -a \! -name nacl.h | sed -e 's,\./\(.*\),#include <\1>,') > /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/nacl.h
touch /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/.prepared_0ba6d65d4eedcd56b9a42455e5b51574
(cd /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10; rm -f aclocal.m4; if [ -f ./configure.ac ] || [ -f ./configure.in ]; then [ -d ./autom4te.cache ] && rm -rf autom4te.cache; touch NEWS AUTHORS COPYING ChangeLog; AUTOM4TE=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autom4te AUTOCONF=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autoconf AUTOMAKE=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/automake ACLOCAL=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/aclocal AUTOHEADER=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autoheader LIBTOOLIZE=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/libtoolize LIBTOOL=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/libtool M4=/home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/m4 AUTOPOINT=true /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autoreconf -v -f -i -s -B /home/jonathan/OpenWrt-SDK-older/staging_dir/host/share/aclocal -I /home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/host/share/aclocal -I /home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/share/aclocal -I m4 -I . . || true; [ -e ./config.rpath ] || ln -s /home/jonathan/OpenWrt-SDK-older/scripts/config.rpath ./config.rpath; fi; );
Can't locate Autom4te/ChannelDefs.pm in @INC (@INC contains: /home/jow/devel/openwrt/10.03.1/ar71xx/staging_dir/host/share/autoconf /usr/lib/perl5/site_perl /usr/share/perl5/site_perl /usr/lib/perl5/vendor_perl /usr/share/perl5/vendor_perl /usr/lib/perl5/core_perl /usr/share/perl5/core_perl .) at /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autoreconf line 40.
BEGIN failed--compilation aborted at /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/autoreconf line 40.
(cd /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/./; if [ -x ./configure ]; then /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/find /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/ -name config.guess | xargs -r chmod u+w; /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/find /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/ -name config.guess | xargs -r -n1 cp /home/jonathan/OpenWrt-SDK-older/scripts/config.guess; /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/find /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/ -name config.sub | xargs -r chmod u+w; /home/jonathan/OpenWrt-SDK-older/staging_dir/host/bin/find /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/ -name config.sub | xargs -r -n1 cp /home/jonathan/OpenWrt-SDK-older/scripts/config.sub; AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float " CPPFLAGS="-I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib "   ./configure --target=mips-openwrt-linux --host=mips-openwrt-linux --build=x86_64-unknown-linux-gnu --program-prefix="" --program-suffix="" --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/lib --sysconfdir=/etc --datadir=/usr/share --localstatedir=/var --mandir=/usr/man --infodir=/usr/info --disable-nls   ; fi; )
touch /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/.configured_
CFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " CXXFLAGS="-Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float  -I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/include -I/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/include " LDFLAGS="-L/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/target-mips_r2_uClibc-0.9.30.1/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/usr/lib -L/home/jonathan/OpenWrt-SDK-older/staging_dir/toolchain-mips_r2_gcc-4.3.3+cs_uClibc-0.9.30.1/lib " make -C /home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/. AR=mips-openwrt-linux-uclibc-ar AS="mips-openwrt-linux-uclibc-gcc -c -Os -pipe -mips32r2 -mtune=mips32r2 -funit-at-a-time -fhonour-copts -msoft-float" LD=mips-openwrt-linux-uclibc-ld NM=mips-openwrt-linux-uclibc-nm CC="mips-openwrt-linux-uclibc-gcc" GCC="mips-openwrt-linux-uclibc-gcc" CXX="mips-openwrt-linux-uclibc-g++" RANLIB=mips-openwrt-linux-uclibc-ranlib STRIP=mips-openwrt-linux-uclibc-strip OBJCOPY=mips-openwrt-linux-uclibc-objcopy OBJDUMP=mips-openwrt-linux-uclibc-objdump SIZE=mips-openwrt-linux-uclibc-size CROSS="mips-openwrt-linux-uclibc-" ARCH="mips" ;
make[3]: Entering directory `/home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10'
make[3]: *** No targets specified and no makefile found.  Stop.
make[3]: Leaving directory `/home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10'
make[2]: *** [/home/jonathan/OpenWrt-SDK-older/build_dir/target-mips_r2_uClibc-0.9.30.1/serval-dna-2012-10-10/.built] Error 2
make[2]: Leaving directory `/home/jonathan/OpenWrt-SDK-older/package/serval-dna'
make[1]: *** [package/serval-dna/compile] Error 2
make[1]: Leaving directory `/home/jonathan/OpenWrt-SDK-older'
make: *** [package/serval-dna/compile] Error 2

As you can see, it seems like the is no makefile. Is there another way to do "autoconf;./configure" beside what we tried?

I'll separate the compilation on the newer SDK to another post.

As you said on IRC, this seems to be too much for someone who doesn't know the system. I would then ask two more questions if that's all right, so I could continue my work.

The first is, the patch file is ending with an opening bracket. it looked weird to me before but now I saw that in the build output there is a line "patch unexpectedly ends in middle of line". Is that ok?

Second thing is, if I can't build it, can I use the package you built? Would it work on Backfire, or would I have to reflash the routers and put the beta on them?

Thank you again.

Where does it expect the GNU Makefile to be in this case?

The discussion might have continued from here.