1 (edited by kukodajanos 2011-03-28 16:36:17)

Topic: compile a single package for backfire


I want to compile only an simple package for backfire without compile everything from scratch. I downloaded backfire source. First I tried this SDK compiling tutorial. But I get the error below. I thought, that the include directory is missing, because I dont installed SDK yet. So I went to make menuconfig, check "build SDK" but now it started to build the whole system. How can I compile an lonely nano for backfire, not wasting my time to compile everything?

$make package/ncurses/compile V=99
and the error: checking for C compiler default output... configure: error: C compiler cannot create executables

Re: compile a single package for backfire

I was meaning to do the same, but as you found out already there's no SDK for backfire. Still to build even just one package, you need the toolchain and I don't know whether you can actually build that alone... I tried a few times then gave up cos it would take far less time to build everything and call it a day.

If by any chance you happen to have a WR1043ND and 64-bit Linux, I have the SDK and can upload it somewhere for you to try.

TP-Link WR1043N v1.8 (Backfire 10.03.1-RC6) - Seagate Dockstar revC (ArchLinux|ARM) - Netgear DG834v2 (DGTeam v849) - Netgear DG834Gv3 (bricked, still)

Re: compile a single package for backfire

Did you select your target and build the cross-compiler first?  You don't need to build the SDK.  Try:

make menuconfig
make toolchain/install V=99
make package/ncurses/compile V=99

Re: compile a single package for backfire


Thank you your advise, I tried the "make toolchain/install V=99", but I get an error. What do you think, what is the problem? I set up in menuconfig the system target and profile.

cp -fpR /home/kukodajanos/backfire/staging_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc- /home/kukodajanos/backfire/staging_dir/host/bin/readelf
cp: cannot create regular file `/home/kukodajanos/backfire/staging_dir/host/bin/readelf': No such file or directory
make[2]: *** [/home/kukodajanos/backfire/staging_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc-] Error 1

Re: compile a single package for backfire

Sorry, I'm not in front of my Linux box right now... so I was just suggesting something to try w/o testing it myself.  I usually build everything first (i.e. make V=99), then recompile individual packages as needed.  What does "make prereq" tell you?  Just checking if you have all the required tools installed.  You may also try "make toolchain/compile" instead of "make toolchain/install".

Re: compile a single package for backfire

For "make toolchain/compile" I get an other error, see below. "make prereq" give nothing back.

/home/kukodajanos/backfire/staging_dir/host/bin/sed -i -e 's/@expr length/@-expr length/' /home/kukodajanos/backfire/build_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc-
--: /home/kukodajanos/backfire/staging_dir/host/bin/sed: No such file or directory
make[2]: *** [/home/kukodajanos/backfire/build_dir/toolchain-mipsel_gcc-4.3.3+cs_uClibc-] Error 127

7 (edited by kukodajanos 2011-03-28 21:26:00)

Re: compile a single package for backfire

OK, I think I have the solution, first: make tools/install, then make toolchain/install.

Re: compile a single package for backfire

I would surely like to see you achieve and document a "simple" package compilation/build, but if all you want is nano, have you tried "opkg install nano"?

If you're trying to learn how to build a package, ignore this, and good luck.

Re: compile a single package for backfire

Actually it is not about nano, I have it, use it every day, but the tutorial what I mentioned above was about nano. My problem was till today, when I had figured out I need an new package, I had to compile the whole toolchain process from scratch, and I was fed up with this.

10 (edited by kukodajanos 2011-04-10 09:39:08)

Re: compile a single package for backfire

OK, these are the commands. Now there is no error, and packages are in bin/ .

svn checkout svn://svn.openwrt.org/openwrt/trunk backfire
./scripts/feeds update
make defconfig
make package/symlinks
make menuconfig

make menuconfig -> check nano and libncurses
make tools/install
make toolchain/install
make target/compile
make package/ncurses/compile
make package/ncurses/install
make package/feeds/packages/nano/compile
make package/feeds/packages/nano/install
make package/index

Re: compile a single package for backfire

Dear fellows,

I need to compile this file for controlling usbrelay2
          https://forum.openwrt.org/viewtopic.php … 64#p315564
It works in Ubuntu.
Anyway just to start somehow, I want to crosscompile an introductory Hello World. I have the program and Makefile, but it does not works.
I have this wifi router with openWrt Chaos Calmer:
I downloaded 15.05 branch (Chaos Calmer) into my Lubuntu:
          git clone git://git.openwrt.org/15.05/openwrt.git
etc. up to:
make menuconfig
make defconfig
make prereq

This is the program:
in Ubuntu works this:
gcc -Wall hellowworld.c -o hellowworld
int main(void)
    printf("\n Hello World \n\n");
    return 0;
My non functional Makefile:
include $(TOPDIR)/rules.mk



include $(INCLUDE_DIR)/package.mk

define Package/helloworld
  TITLE:=Typical starting program "Hello World" written in C
  #DESCRIPTION:=This variable is obsolete. use the Package/name/description define instead!

define Package/helloworld/description
This is a tutorial, how to cross compile this simple program in C for OpenWrt distribution

define Build/Configure
  $(call Build/Configure/Default,--with-linux-headers=$(LINUX_DIR))

define Package/helloworld/install
        $(INSTALL_DIR) $(1)/usr/sbin
        $(INSTALL_BIN) $(PKG_BUILD_DIR)/brctl/brctl $(1)/usr/sbin/

$(eval $(call BuildPackage,helloworld))

That is all I have. Can you help me a bit. All I need is program usbrelay on command line in ssh switching on off relays over HID USB. First I want to start with simple crosscompiling C programm of Hello world then I will fight with HID USB... :-)
I will provide you any additional information needed, and of course thank you a lot your patience in replying to this obviously trivial question. :-)