I've a TL-WR841NV14(US) router.So, I've downloaded the GPL code from there official website. And then I've tried to compile the the firmware as they told in the README file.But it didn't worked at all.
The README file
README:
1. To Build both Toolchain and Firmware image:
1.1 Host Ubuntu 12.04 or higher (Linux kernel 3.2.0) on x86 machine
1.2 Compiling tool version: gcc 4.6.3 or higher, GNU Make version 3.81
2. Put the package TL-WR841NV14.tar.gz to a directory such as /home/TP-LINK, then extract the compressed files.
$ cd /home/TP-LINK
$ tar xzvf TL-WR841NV14.tar.gz
To Build Firmware image:
1.1 Go to TL-WR841NV14 build folder and execute make.
$ cd /home/TP-LINK/TL-WR841NV14/build
Do as:
Take WR841NV14 for example
1. sudo make MODEL=WR841NV14 env_build
2. make MODEL=WR841NV14 boot_build
3. make MODEL=WR841NV14 kernel_build(kernel_menuconfig)
4. make MODEL=WR841NV14 modules_build
4.1 "modules_build" include some sub target,like kernel_modules,misc_modules,wlan_modules...
4.2 For most people only need to make kernel_modules
5. make MODEL=WR841NV14 apps_build
6. make MODEL=WR841NV14 fs_build
7. make MODEL=WR841NV14 image_build
will generate the DEV_NAME_(xxx).bin, under TL-WR841NV14/targets/image_MODEL folder.
xxx refers to flash or up_boot, with specific time-stamp and version info.
So when I ran the 1st command :
root@XXX:/home/TP-LINK/TL-WR841NV14/build# make
toolchain buildroot-gcc463 exists.
env_build done!
And then when I ran the 2nd command the error shows up :
..
....
make[2]: Entering directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot/tools'
gcc -I./ -DUSE_HOSTCC -c mkimage.c
In file included from mkimage.c:61:0:
./image.h:210:1: warning: ‘packed’ attribute ignored [-Wattributes]
} dram_header_t __attribute__ ((packed));
^
./image.h:218:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_badblock_info1_t __attribute__ ((packed));
^
./image.h:232:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_info_1_t __attribute__ ((packed));
^
./image.h:246:1: warning: ‘packed’ attribute ignored [-Wattributes]
} nand_header_t __attribute__ ((packed));
^
./image.h:266:1: warning: ‘packed’ attribute ignored [-Wattributes]
} image_header_t __attribute__((packed));
^
gcc -I./ -DUSE_HOSTCC -c crc32.c
crc32.c:15:18: fatal error: zlib.h: No such file or directory
compilation terminated.
make[2]: *** [crc32.o] Error 1
make[2]: Leaving directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot/tools'
make[1]: *** [tools] Error 2
make[1]: Leaving directory `/home/TP-LINK/TL-WR841NV14/mtk_ApSoC_4320/Uboot'
make: *** [boot_build] Error 2
root@XXX:/home/TP-LINK/TL-WR841NV14/build#
PS: I've installed ubuntu 16 x84 and my gcc compiler's version is gcc version 5.4.0 20160609 and the GNU make version is 3.81