CC=$(CROSS)gcc AR=$(CROSS)ar LD=$(CROSS)ld CXX=$(CROSS)g++ HOST=arm-linux TARGET=arm-linux CWD=$(shell pwd) LIBPCAP_DIR=libpcap-1.7.3 TCPDUMP_DIR=tcpdump-4.7.4 IPERF_DIR=iperf-2.0.5 SYSSTAT_DIR=sysstat-master IPROUTE2_DIR=iproute2-3.1.0 LRZSZ_DIR=lrzsz-0.12.20 STRACE_DIR=strace-4.9 GDB_DIR=gdb-7.8 PROCSTAT_DIR=procstat-src TAR_DIR=tar-1.28/ SAMBA_DIR=samba-3.6.23 ETHTOOL_DIR=ethtool-3.18 ATFTP_DIR=atftp-0.7.1 INETUTILS=inetutils-1.9 COREUTILS=coreutils-8.23 NCURSES=ncurses-5.9 VIM=vim74 E2FSPROGS=e2fsprogs-1.42.13 MPG123=mpg123-0.60 PHP=php-5.6.19 FIM=fim-0.5-rc1 FBV=fbv-master LIBLZF=liblzf-3.6 PYTHON=python-2.7.14 ZLIB=zlib-1.2.11 OPENSSL=openssl-1.0.2n DIALOG=dialog-1.3-20171209 CURL=curl-7.61.0 #apps=curl dialog openssl openssl python liblzf fbv fim php mpg123 e2fsprogs vim ncurses coreutils inetutils atftp ethtool samba tar gdb libpcap tcpdump iperf sysstat iproute2 lrzsz strace procstat apps=curl all: $(apps) curl: if [ ! -f $(CURL)/curl ]; then \ cd $(CURL); \ ./configure --host=arm-linux --disable-shared --enable-static LDFLAGS="-static" CC=$(CC); \ make; \ fi dialog: if [ ! -f $(DIALOG)/dialog ]; then \ cd $(DIALOG); \ ./configure --host=arm-linux CC=$(CC) --with-ncurses CFLAGS="-I../$(NCURSES)/include -L../$(NCURSES)/lib -static"; \ make; \ fi openssl: if [ ! -f $(OPENSSL)/libssl.so.1.0.0 ]; then \ cd $(OPENSSL); \ export CC=$(CC);\ export LD=$(LD);\ ./Configure shared linux-armv4;\ make; \ fi zlib: if [ ! -f $(ZLIB)/lzf ]; then \ cd $(ZLIB); \ export CC=$(CC);\ ./configure; \ make; \ fi python: if [ ! -f $(PYTHON)/python ]; then \ cd $(PYTHON); \ -rm -rf python-2.7.14/Lib/test/; \ ./configure;\ make python Parser/pgen;\ mv python python_for_build;\ mv Parser/pgen Parser/pgen_for_build;\ make distclean;\ CONFIG_SITE=config.site ./configure --host=arm-linux --build=i586-linux-gnu --prefix=/ --disable-ipv6 --enable-optimizations\ CC=$(CC);\ make -j 4 CFLAGS="-g0 -O2";\ mkdir build_install;\ make install DESTDIR=`pwd`/build_install;\ fi liblzf: if [ ! -f $(LIBLZF)/lzf ]; then \ cd $(LIBLZF); \ ./configure --host=arm-linux CC=$(CC); \ make; \ fi fbv: cd $(FBV); \ ./configure --without-libjpeg --without-libpng; \ make CC=$(CC) CXX=$(CXX) ; fim: if [ ! -f $(FIM)/src/fim ]; then \ echo Need to manually compile b2ba as x86 and remove all regex.* in Makefile; \ sleep 3;\ cd $(FIM); \ ./configure --enable-static --disable-exif --disable-smartautocompletion --host=arm-linux CC=$(CC) CXX=$(CXX) --disable-readline; \ make; \ fi php: if [ ! -f $(PHP)/sapi/cli/php ]; then \ cd $(PHP); \ ./configure --enable-static --without-mysql --disable-all --host=arm-linux CC=$(CC); \ make; \ fi mpg123: if [ ! -f $(MPG123)/src/mpg123 ]; then \ cd $(MPG123); \ ./configure CC=$(CC) --host=arm-linux --with-audio=alsa --with-default-audio=alsa --with-optimization=3 CFLAGS="-I/home/ubuntu/alsa-build/include"; \ make; \ fi e2fsprogs: if [ ! -f $(E2FSPROGS)/misc/mke2fs ]; then \ cd $(E2FSPROGS); \ ./configure --host=arm-linux CC=$(CC) CXX=$(CXX) ; \ make; \ fi vim: # for some system. ./configure --host=arm-linux --build=arm-linux --with-tlib=ncurses CFLAGS="-static" if [ ! -f $(VIM)/src/vim ]; then \ cd $(VIM); \ ./configure --host=arm-linux --with-tlib=ncurses CFLAGS="-static" \ LDFLAGS="-L$(CWD)/$(NCURSES)/lib -static" \ CC=$(CC) CXX=$(CXX) \ ac_cv_sizeof_int=4 \ vim_cv_getcwd_broken=no \ vim_cv_memmove_handles_overlap=yes \ vim_cv_stat_ignores_slash=yes \ vim_cv_tgetent=zero \ vim_cv_terminfo=yes \ vim_cv_toupper_broken=no \ vim_cv_tty_group=world --enable-multibyte && make; \ fi ncurses: if [ ! -f $(NCURSES)/lib/libncurses.a ]; then \ cd $(NCURSES); \ ./configure --host=arm-linux CC=$(CC) CXX=$(CXX) CPPFLAGS="-P" --with-shared --with-termlib; \ make; \ fi coreutils: if [ ! -f $(COREUTILS)/src/chroot ]; then \ cd $(COREUTILS); \ ./configure --host=arm-linux CC=$(CC); \ make; \ fi inetutils: if [ ! -f $(INETUTILS)/ifconfig/ifconfig ]; then \ cd $(INETUTILS); \ ./configure --host=arm-linux CC=$(CC) CFLAGS=-I`pwd`/termcap-1.3.1; \ make; \ fi atftp: if [ ! -f $(ATFTP_DIR)/atftp ]; then \ cd $(ATFTP_DIR); \ ./configure --host=arm-linux CC=$(CC); \ make; \ fi ethtool: if [ ! -f $(ETHTOOL_DIR)/ethtool ]; then \ cd $(ETHTOOL_DIR); \ ./configure --host=arm-linux CC=$(CC); \ make; \ fi samba: if [ ! -f $(SAMBA_DIR)/source3/bin/smbd ]; then \ cd $(SAMBA_DIR)/source3; \ ./autogen.sh; \ ./configure --without-quotas --without-sys-quotas --without-krb5 --without-ldap --without-ads --disable-cups --enable-swat=no --with-winbind=no --target=arm-linux-gnueabi --host=arm-linux-gnueabi --prefix= --with-configdir=/etc samba_cv_CC_NEGATIVE_ENUM_VALUES=yes libreplace_cv_HAVE_GETADDRINFO=no ac_cv_file__proc_sys_kernel_core_pattern=yes CFLAGS=-Os CC=$(CC);\ make; \ fi; tar: if [ ! -f $(TAR_DIR)/src/tar ]; then \ cd $(TAR_DIR); \ ./configure --host=$(HOST) TARGET=$(TARGET) CC=$(CC) AR=$(AR) LD=$(LD); \ make; \ fi; gdb: if [ ! -f $(GDB_DIR)/gdb/gdb ]; then \ cd $(GDB_DIR); \ ./configure --host=$(HOST) TARGET=$(TARGET) CC=$(CC) AR=$(AR) LD=$(LD); \ make; \ fi; libpcap: if [ ! -f $(LIBPCAP_DIR)/libpcap.a ]; then \ cd $(LIBPCAP_DIR); \ ./configure --host=$(HOST) CC=$(CC) --with-pcap=linux; \ make; \ fi; tcpdump: if [ ! -f $(TCPDUMP_DIR)/tcpdump ]; then \ cd $(TCPDUMP_DIR); \ ./configure --host=$(HOST) CC=$(CC) -without-crypto --disable-smb CFLAGS=../$(LIBPCAP_DIR)/libpcap.a -static ; \ make;\ fi; iperf: if [ ! -f $(IPERF_DIR)/src/iperf ]; then \ cd $(IPERF_DIR) ;\ ./configure --host=$(HOST) CC=$(CC) CXX=$(CXX) ac_cv_func_malloc_0_nonnull=yes ;\ make; \ fi; sysstat: if [ ! -f $(SYSSTAT_DIR)/mpstat ]; then \ cd $(SYSSTAT_DIR) ;\ ./configure --host=$(HOST) CC=$(CC) CXX=$(CXX);\ make; \ fi; iproute2: if [ ! -f $(IPROUTE2_DIR)/ip/ip ]; then \ cd $(IPROUTE2_DIR) ;\ make GCC=$(CC) ;\ make; \ fi; lrzsz: if [ ! -f $(LRZSZ_DIR)/src/lrz ]; then \ cd $(LRZSZ_DIR) ;\ rm -f config.cache ;\ export CC=$(CC) && ./configure ;\ make; \ fi strace: if [ ! -f $(STRACE_DIR)/strace ]; then \ cd $(STRACE_DIR) ;\ ./configure --host=$(HOST) CC=$(CC) CXX=$(CXX);\ make; \ fi procstat: cd $(PROCSTAT_DIR) ;\ make CC=$(CC) clean: make -C $(LIBPCAP_DIR) clean make -C $(TCPDUMP_DIR) clean make -C $(IPERF_DIR) clean make -C $(SYSSTAT_DIR) clean make -C $(IPROUTE2_DIR) clean make -C $(LRZSZ_DIR) clean make -C $(STRACE_DIR) clean make -C $(GDB_DIR) clean make -C $(PROCSTAT_DIR) clean make -C $(NCURSE) distclean make -C $(VIM) distclean make -C $(LIBLZF) distclean