Configure command for building various software

#See https://adrhc.go.ro/wordpress/common-commands-when-building/ for building environment, x.sh script and other things not defined here.
#Before compiling do declare the environment variables specified to the link above and prepare sources with ~/x.sh ffpg (or ~/x.sh ffpg-all if compilation fails).

#urbackup-server-1.4.9
NEW_BUILD_NAME=urbackup-server
NEW_BUILD_VER=1.4.9
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
In Makefile comment:
#	adduser urbackup --system --quiet --group --home "$(DESTDIR)$(localstatedir)/urbackup" || true
#	chown urbackup:urbackup "$(DESTDIR)$(localstatedir)/urbackup"
In urbackupserver/Makefile replace:
INSTALL_OPTS = -o urbackup -g urbackup
with:
INSTALL_OPTS = -o root -g root
In dllmain.cpp comment:
//#define _exit exit
and 
replace _exit(0) with exit(0)

#gptfdisk-1.0.0
#http://sourceforge.net/projects/gptfdisk/
NEW_BUILD_NAME=gptfdisk
NEW_BUILD_VER=1.0.0
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=1
#Append -lintl in Makefile as below:
gdisk:	$(LIB_OBJS) gdisk.o gpttext.o
	$(CXX) $(LIB_OBJS) gdisk.o gpttext.o $(LDFLAGS) -luuid -lintl -o gdisk
cgdisk: $(LIB_OBJS) cgdisk.o gptcurses.o
	$(CXX) $(LIB_OBJS) cgdisk.o gptcurses.o $(LDFLAGS) -luuid -lncursesw -lintl -o cgdisk
make -f Makefile
mkdir -p ~/temp/gptfdisk-1.0.0/ffp/bin
cd ~/temp/gptfdisk-1.0.0/ffp/bin
cp -v ~/compile/gptfdisk-1.0.0/cgdisk .
cp -v ~/compile/gptfdisk-1.0.0/fixparts .
cp -v ~/compile/gptfdisk-1.0.0/gdisk .
cp -v ~/compile/gptfdisk-1.0.0/sgdisk .
chmod -v +x ~/temp/gptfdisk-1.0.0/ffp/bin/*
cd ~/temp/gptfdisk-1.0.0
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME_AND_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/

#CouchPotatoServer
git clone https://github.com/RuudBurger/CouchPotatoServer.git --branch build/2.6.3 --single-branch CouchPotatoServer-build-2.6.3
ffpg

#unrar-5.3.2
http://www.rarlab.com/rar_add.htm
ffpg
#comment in makefile as below (do not comment CXX or DEFINES!):
# Linux using GCC
CXX=g++
#CXXFLAGS=-O2
#DESTDIR=/usr
make -f makefile
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER/ffp
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR
cp -v /tmp/$NEW_BUILD_NAME-$NEW_BUILD_VER-arm-$NEW_BUILD_NR.txz ~/ffp_0.7_armv5/packages/
funpkg -q $NEW_BUILD_NAME

#par2cmdline-0.4
ffpg-no-m4
sed -i s/"bool\s*ReedSolomon"/"template <> bool ReedSolomon"/g reedsolomon.cpp
./configure --prefix=/ffp --enable-dependency-tracking

#libsigc-2.2.10
#http://ftp.gnome.org/pub/gnome/sources/libsigc++/
ffpg
./configure --prefix=/ffp --enable-dependency-tracking

#msgpack-0.5.6
#when gallery3 fails with core dump on php-fpm than recompile msgpack
#see https://adrhc.go.ro/wordpress/core-dump/
git clone -b msgpack-0.5.6 https://github.com/msgpack/msgpack-php.git msgpack-0.5.6
ffpg
phpize
./configure --with-php-config=/ffp/bin/php-config --with-msgpack
make
make test
make install

#net_snmp-5.7.2
NEW_BUILD_NAME=net_snmp
NEW_BUILD_VER=5.7.2
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
#./net-snmp-config --configure-options -> learn about installed mz:net_snmp-5.7.2-arm-1.txz configure options
#the output:
#'--prefix=/ffp' '--enable-ucd-snmp-compatibility' '--enable-ipv6' '--disable-deprecated' '--with-logfile=/ffp/var/log/snmpd.log' '--with-persistent-directory=/ffp/var/lib/snmpd' 'CC=gcc' 'CFLAGS=-march=armv5te -O3 -I/ffp/include'
./configure --prefix=/ffp --enable-ucd-snmp-compatibility --enable-ipv6 --disable-deprecated --with-logfile=/ffp/var/log/snmpd.log --with-persistent-directory=/ffp/var/lib/snmpd CC=gcc
#now accept every configure default
#difference against mz:net_snmp-5.7.2-arm-1.txz:
diff -y --suppress-common-lines /ffp/include/net-snmp/net-snmp-config.h compile/net_snmp-5.7.2/include/net-snmp/net-snmp-config.h
nohup make -C . &

#gdb-7.9.1
NEW_BUILD_NAME=gdb
NEW_BUILD_VER=7.9.1
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
ERROR (make)
	../../libiberty/libiberty.a(floatformat.o): In function `floatformat_to_double':
	floatformat.c:(.text+0x4cc): undefined reference to `ldexp'
SOLUTION
	sed -i s/"CONFIG_LIBS = -ldl -lz"/"CONFIG_LIBS = -ldl -lm -lz"/ sim/arm/Makefile
./configure --prefix=/ffp
sed -i s/"CONFIG_LIBS = -ldl -lz"/"CONFIG_LIBS = -ldl -lm -lz"/ sim/arm/Makefile
make

#zenphoto-1.4.8
grep -nr "\sMutex" compile/zenphoto-1.4.8+ffpg/
find apache-htdocs/albums -name "*.php" -type f -exec sed -i s/"\ Mutex"/"\ ZenphotoMutex"/g {} \;
grep -nr "ZenphotoMutex" apache-htdocs/albums
#images won't show well because of php's scientific notation used for width and height
#modify precision in php.ini: precision = 7

#grep-2.21
~/x.sh ffpg-make-conf
./configure --prefix=/ffp
make

#util-linux-2.26
NEW_BUILD_NAME=util-linux
NEW_BUILD_VER=2.26
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
./configure --prefix=/ffp --enable-dependency-tracking --enable-write --enable-tunelp --disable-kill --disable-nologin --with-libintl-prefix=/ffp --disable-use-tty-group
nohup make -C . &
#make check
#ERROR (make check)
	undefined reference to `libintl_gettext'
#SOLUTION (make check)
	#use "-L/ffp/lib -lintl" for failed commands like below:
	/ffp/bin/sh ./libtool ... -L/ffp/lib -lintl ...
#do NOT run the tests; see http://www.linuxfromscratch.org/lfs/view/development/chapter06/util-linux.html warning
#bash tests/run.sh --srcdir=$PWD --builddir=$PWD -> do NOT run!!!
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install DESTDIR=$HOME/temp/$NEW_BUILD_NAME_AND_VER

#parted-3.2
#requires LVM2-2.02.120 in order to use --enable-device-mapper
NEW_BUILD_NAME=parted
NEW_BUILD_VER=3.2
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
#./configure --prefix=/ffp --enable-dependency-tracking --disable-device-mapper
#./configure --prefix=/ffp --enable-dependency-tracking --enable-device-mapper=no
./configure --prefix=/ffp --enable-dependency-tracking

#LVM2-2.02.120
#requires thin-provisioning-tools-0.4.1
NEW_BUILD_NAME=LVM2
NEW_BUILD_VER=2.02.120
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
./configure --prefix=/ffp

#thin-provisioning-tools-0.4.1
#requires https://git.fedorahosted.org/cgit/libaio.git/snapshot/libaio-0.3.110-1.zip
NEW_BUILD_NAME=thin-provisioning-tools
NEW_BUILD_VER=0.4.1
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
#replace any "truncl" with "trunc" in thin-provisioning/thin_metadata_size.cc
sed -i s/"truncl"/"trunc"/g thin-provisioning/thin_metadata_size.cc
#modify in get-gmock.sh:
./configure --prefix=/ffp --enable-dependency-tracking
#start building
autoreconf
./configure --prefix=/ffp --enable-testing
./get-gmock.sh
make unit-test

#drizzle7-2011.07.21 (requires protobuf, boost)
#see also http://wiki.nginx.org/HttpDrizzleModule#Installation
cd ~/compile
wget http://agentzh.org/misc/nginx/drizzle7-2011.07.21.tar.gz
tar xvzf drizzle7-2011.07.21.tar.gz
cd drizzle7-2011.07.21
~/x.sh ffpg
./configure --prefix=/ffp --enable-dependency-tracking --without-server
nohup make V=1 -C . libdrizzle-1.0 &
make install-libdrizzle-1.0 DESTDIR=$HOME/temp/drizzle7-2011.07.21
cd $HOME/temp/drizzle7-2011.07.21

#mpich-3.1.4
cd ~/compile
wget http://www.mpich.org/static/downloads/3.1.4/mpich-3.1.4.tar.gz
tar xvzf mpich-3.1.4.tar.gz
cd mpich-3.1.4
#don't use ffpg here because it's not necessaire; if you do then you'll be asked for aclocal 1.15
./configure --prefix=/ffp --enable-dependency-tracking --disable-fortran
make

#hydra-3.1.4
cd ~/compile
wget http://www.mpich.org/static/downloads/3.1.4/hydra-3.1.4.tar.gz
tar xvzf hydra-3.1.4.tar.gz
cd hydra-3.1.4
#don't use ffpg here because it's not necessaire; if you do then you'll be asked for aclocal 1.15
./configure --prefix=/ffp --enable-dependency-tracking
make

#protobuf-2.6.1
#other version: https://protobuf.googlecode.com/files/protobuf-2.5.0.tar.gz
git clone https://github.com/google/protobuf.git protobuf-2.6.1
~/x.sh ffpg
./autogen.sh
~/x.sh ffpg
./configure --prefix=/ffp --enable-dependency-tracking
make

#hdparm-9.45
cd ~/compile && wget http://downloads.sourceforge.net/project/hdparm/hdparm/hdparm-9.45.tar.gz?r=http%3A%2F%2Fsourceforge.net%2Fprojects%2Fhdparm%2F&ts=1430572151&use_mirror=heanet
tar xvzf hdparm-9.45.tar.gz
cd hdparm-9.45
~/x.sh ffpg
NEW_BUILD_NAME=hdparm
NEW_BUILD_VER=9.45
NEW_BUILD_NAME_AND_VER=$NEW_BUILD_NAME-$NEW_BUILD_VER
ls -l /tmp/$NEW_BUILD_NAME-*
ls -l ~/ffp_0.7_armv5/packages/$NEW_BUILD_NAME-*
NEW_BUILD_NR=0
sed -i s/"#include <scsi\/scsi.h"/"\/\/#include <scsi\/scsi.h"/ sgio.c
sed -i s/"binprefix = "/"binprefix = \/ffp"/ Makefile
sed -i s/"manprefix = \/usr"/"manprefix = \/ffp"/ Makefile
sed -i s/"DESTDIR ="/"DESTDIR = \/ffp\/home\/root\/temp\/$NEW_BUILD_NAME-$NEW_BUILD_VER"/ Makefile
ERROR
	In file included from sgio.c:12:0:
	/ffp/include/scsi/scsi.h:145:2: error: unknown type name 'u8'
	  u8 opcode;        /* opcode always == VARIABLE_LENGTH_CMD */
SOLUTION
	#/ffp/include/scsi/scsi.h -> linux/types.h -> asm/types.h -> asm-generic/int-ll64.h -> typedef unsigned char __u8;
	append "typedef unsigned char u8;" after "typedef unsigned char __u8;" in /ffp/include/asm-generic/int-ll64.h
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
make install
cd $HOME/temp/$NEW_BUILD_NAME_AND_VER
makepkg $NEW_BUILD_NAME $NEW_BUILD_VER $NEW_BUILD_NR

#nginx-1.7.11
#+nginx-dav-ext-module-20150330
#+ngx_devel_kit-0.2.19
#+lua-nginx-module-0.9.16rc1
mkdir -p /ffp/tmp/nginx/client-body 
mkdir -p /ffp/tmp/nginx/proxy 
mkdir -p /ffp/tmp/nginx/fastcgi 
mkdir -p /ffp/tmp/nginx/uwsgi 
mkdir -p /ffp/tmp/nginx/scgi
sed -i s/"\/usr\/local\/"/"\/ffp\/"/ auto/lib/pcre/conf
sed -i s/"\/usr\/local\/"/"\/ffp\/"/ auto/lib/geoip/conf
sed -i s/"\/usr\/local\/"/"\/ffp\/"/ auto/lib/libgd/conf
sed -i s/"\/usr\/local\/"/"\/ffp\/"/ auto/lib/google-perftools/conf
sed -i s/"\/usr\/local\/"/"\/ffp\/"/g auto/lib/libxslt/conf
./configure --prefix=/ffp --conf-path=/ffp/etc/nginx/nginx.conf --error-log-path=/ffp/log/nginx-error.log --pid-path=/ffp/var/run/nginx.pid --user=nobody --group=nobody --with-file-aio --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-perl=/ffp/bin/perl --http-log-path=/ffp/log/nginx-access.log --http-client-body-temp-path=/ffp/tmp/nginx/client-body --http-proxy-temp-path=/ffp/tmp/nginx/proxy --http-fastcgi-temp-path=/ffp/tmp/nginx/fastcgi --http-uwsgi-temp-path=/ffp/tmp/nginx/uwsgi --http-scgi-temp-path=/ffp/tmp/nginx/scgi --with-cc=/ffp/bin/cc --with-cpp=/ffp/bin/cpp --with-cpu-opt=armv5te --with-debug --add-module=$HOME/compile/nginx-modules/nginx-dav-ext-module --add-module=$HOME/compile/nginx-modules/ngx_devel_kit-0.2.19 --add-module=$HOME/compile/nginx-modules/lua-nginx-module-0.9.16rc1 --with-pcre-jit

#nginx-1.6.2
mkdir -p /ffp/tmp/nginx/client-body 
mkdir -p /ffp/tmp/nginx/proxy 
mkdir -p /ffp/tmp/nginx/fastcgi 
mkdir -p /ffp/tmp/nginx/uwsgi 
mkdir -p /ffp/tmp/nginx/scgi
./configure --prefix=/ffp --conf-path=/ffp/etc/nginx/nginx.conf --error-log-path=/ffp/log/nginx-error.log --pid-path=/ffp/var/run/nginx.pid --user=nobody --group=nobody --with-file-aio --with-http_ssl_module --with-http_spdy_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_auth_request_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --with-perl=/ffp/bin/perl --http-log-path=/ffp/log/nginx-access.log --http-client-body-temp-path=/ffp/tmp/nginx/client-body --http-proxy-temp-path=/ffp/tmp/nginx/proxy --http-fastcgi-temp-path=/ffp/tmp/nginx/fastcgi --http-uwsgi-temp-path=/ffp/tmp/nginx/uwsgi --http-scgi-temp-path=/ffp/tmp/nginx/scgi --with-cc=/ffp/bin/cc --with-cpp=/ffp/bin/cpp --with-cpu-opt=armv5te --with-debug

#GeoIP-1.6.5 (https://github.com/maxmind/geoip-api-c/releases)
./configure --prefix=/ffp --enable-dependency-tracking

#libatomic_ops (https://github.com/ivmai/libatomic_ops/)
./configure --prefix=/ffp --enable-dependency-tracking
make
make check

#mod_python-3.5.0
./configure --prefix=/ffp --with-apxs=/ffp/opt/apache-2.2.29-worker/bin/apxs
sed -i s/"GIT="/"#GIT="/ dist/version.sh
make install

#mod_perl-2.0.8
perl Makefile.PL MP_APXS=/ffp/opt/apache-2.2.29-worker/bin/apxs MP_APR_CONFIG=/ffp/bin/apr-1-config MP_CCOPTS="$BUILD_FLAGS"
make install

#p7zip_9.38_src_all
wget http://sourceforge.net/projects/p7zip/files/p7zip/9.38/p7zip_9.38_src_all.tar.bz2/download
tar jvxf p7zip_9.38_src_all.tar.bz2
#cp -v makefile.linux_x32 makefile.machine -> won't recognize the -m32 compiler option
cp -v makefile.linux_any_cpu makefile.machine
#in the file named makefile:
	DEST_HOME=/ffp/home/root/temp/p7zip_9.38/ffp
#in the file named makefile.machine:
	OPTFLAGS="${BUILD_FLAGS}"
nohup make all3 -C /ffp/home/root/compile/p7zip_9.38 &
nohup make all_test -C /ffp/home/root/compile/p7zip_9.38 &
#Edit install.sh in order to change DEST_HOME:
#DEST_HOME=/ffp/home/root/temp/p7zip-9.38/ffp
./install.sh

#tar-1.28
export FORCE_UNSAFE_CONFIGURE=1
./configure --prefix=/ffp --without-included-regex --with-compress=/ffp/bin/7z --with-gzip=/ffp/bin/gzip --with-bzip2=/ffp/bin/bzip2 --with-lzip=/ffp/bin/lzip --with-lzma=/ffp/bin/lzma --with-lzop=/ffp/bin/lzop --with-xz=/ffp/bin/xz --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp

#xz-5.2.0
./configure --prefix=/ffp --enable-threads=posix --enable-assume-ram=64 --enable-dependency-tracking --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp

#openssl-1.0.1l
#remove -I/ffp/include from BUILD_FLAGS, CPPFLAGS, CXXFLAGS
./config --prefix=/ffp --openssldir=/ffp/etc/ssl threads -D_REENTRANT zlib-dynamic shared
rm -r $HOME/temp/$NEW_BUILD_NAME_AND_VER
#install without docs if pod2html fails:
#make INSTALL_PREFIX=$HOME/temp/$NEW_BUILD_NAME_AND_VER install_sw
#or install only with html docs:
#sed -i s/"install:\sall\sinstall_docs"/"install: all install_html_docs"/ Makefile
make INSTALL_PREFIX=$HOME/temp/$NEW_BUILD_NAME_AND_VER install

#curl-7.31.0
./configure --prefix=/ffp --enable-dependency-tracking --enable-http --enable-ftp --enable-file --enable-ldap --enable-ldaps --enable-rtsp --enable-proxy --enable-dict --enable-telnet --enable-tftp --enable-pop3 --enable-imap --enable-smtp --enable-gopher --enable-manual --enable-libcurl-option --enable-ipv6 --enable-versioned-symbols --enable-threaded-resolver --enable-verbose --enable-sspi --enable-crypto-auth --enable-tls-srp --enable-cookies --with-zlib=/ffp --with-ssl=/ffp

#recode-20150131 (won't build but I tried anyway)
find . -name configure.ac -exec sed -i s/"AM_INIT_AUTOMAKE(\[1\.13\.3"/"AM_INIT_AUTOMAKE([1.14.1"/ {} \;
find . -name *.m4 -exec sed -i s/"AM_AUTOMAKE_VERSION(\[1\.13\.3"/"AM_AUTOMAKE_VERSION([1.14.1"/ {} \;
find . -name *.m4 -exec sed -i s/"\[1\.13\.3"/"[1.14.1"/ {} \;
find . -type f -name Makefile -exec sed -i s/"automake-1\.13"/"automake"/ {} \;
grep -r automake-1.13 .
./configure --prefix=/ffp --enable-dependency-tracking --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp
make

#recode-3.6 (won't build but I tried anyway)
#./aclocal.sh: 
#replace 'mkdir aclocal.tmp' with 'mkdir -p aclocal.tmp'
#replace aclocal option '--acdir=' with '-I'
wget http://www.linuxfromscratch.org/patches/blfs/6.3/recode-3.6-fixes-1.patch
patch -p1 -i recode-3.6-fixes-1.patch
./configure --prefix=/ffp --without-included-gettext
make

#php-5.6.5
#--with-recode -> couldn't build it for the moment
#--with-tidy -> too old, makes no sense to use it
#--enable-mysqlnd -> I don't use it
./configure --prefix=/ffp --enable-re2c-cgoto=shared,/ffp --enable-mod-charset --with-apxs2=/ffp/opt/apache-2.2.29-worker/bin/apxs --with-config-file-path=/ffp/etc/php.ini --with-config-file-scan-dir=/ffp/etc --with-libxml-dir=/ffp --with-openssl=shared,/ffp --with-pcre-regex=/ffp --with-zlib=shared,/ffp --with-zlib-dir=/ffp --enable-bcmath --with-bz2=shared,/ffp --enable-calendar --with-curl=shared,/ffp --with-enchant=shared,/ffp --enable-exif --with-pcre-dir=/ffp --enable-ftp --with-openssl-dir=/ffp --with-gd=shared,/ffp --with-jpeg-dir=/ffp --with-png-dir=/ffp --with-freetype-dir=/ffp --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext=shared,/ffp --with-gmp=shared,/ffp --with-mhash=shared,/ffp --enable-intl --with-icu-dir=/ffp --enable-mbstring --with-mcrypt=shared,/ffp --with-mysql=/ffp --with-mysql-sock=/ffp/var/run/mysql/mysql.sock --with-mysqli=/ffp/bin/mysql_config --enable-embedded-mysqli --enable-opcache --enable-pcntl --with-pdo-mysql=/ffp --with-readline=shared,/ffp --enable-shmop --enable-soap --enable-sockets --enable-wddx --with-xmlrpc=shared,/ffp --with-libexpat-dir=/ffp --with-iconv-dir=/ffp --with-xsl=/ffp --enable-zip --without-pear

#xmlrpc-epi-0.54.2
./configure --prefix=/ffp --enable-dependency-tracking
~/x.sh ffpg1
make

#antiword-0.37
#http://www.winfield.demon.nl/linux/antiword-0.37.tar.gz
~/x.sh ffpg
#modify in Makefile.Linux to this:
GLOBAL_INSTALL_DIR = $(HOME)/temp/antiword-0.37/ffp/bin
GLOBAL_RESOURCES_DIR = $(HOME)/temp/antiword-0.37/ffp/share/antiword
make
make global_install

#libmbfl-1.3.2
./buildconf --prefix=/ffp
~/x.sh ffpg1
./configure --prefix=/ffp --enable-dependency-tracking
~/x.sh ffpg1
make

#enchant-1.6.0
./configure --prefix=/ffp --enable-dependency-tracking --with-aspell-prefix=/ffp

#pcre-8.21
./configure --prefix=/ffp --enable-dependency-tracking --enable-jit --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-pcretest-libreadline --with-pcregrep-bufsize=8192

#pcre-8.30
#fails when using --enable-pcretest-libreadline
./configure --prefix=/ffp --enable-dependency-tracking --enable-pcre16 --enable-jit --enable-utf8 --enable-unicode-properties --enable-pcregrep-libz --enable-pcregrep-libbz2 --with-pcregrep-bufsize=8192

#pcre-8.36
./configure --prefix=/ffp --enable-dependency-tracking --enable-pcre16 --enable-pcre32 --enable-jit --enable-utf8 --enable-unicorties --enable-pcregrep-libz --enable-pcregrep-libbz2 --enable-pcretest-libreadline --with-pcregrep-bufsize=8192

#aspell-0.60.6.1
./configure --prefix=/ffp --enable-dependency-tracking --enable-static=yes --enable-shared=yes --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp

#libvpx-1.3.0 (won't build because it requires armv5te-linux-gcc or generic-gnu instead of armv5tel-unknown-linux-uclibceabi)
git clone -b "v1.3.0" https://chromium.googlesource.com/webm/libvpx libvpx-1.3.0
./configure --prefix=/ffp --enable-install-srcs
nohup /ffp/bin/make -C /ffp/home/root/compile/libvpx-1.3.0 &

#libXpm-3.5.11 (won't build because it requires X11)
git clone -b "libXpm-3.5.11" http://cgit.freedesktop.org/xorg/lib/libXpm/ libXpm-3.5.11
./autogen.sh --prefix=/ffp

#libgd-2.1.1
./bootstrap.sh --prefix=/ffp
./configure --prefix=/ffp --enable-dependency-tracking --with-libiconv-prefix=/ffp --with-zlib=/ffp --with-png=/ffp --with-freetype=/ffp --with-fontconfig=/ffp --with-jpeg=/ffp --with-tiff=/ffp
~/x.sh ffpg
find . -name gd_bmp.c -exec sed -i s/"ceill"/"ceil"/ {} \;
make

#mkvtoolnix-7.5.0
./autogen.sh --prefix=/ffp
./configure --prefix=/ffp --with-words=little --enable-optimization=no --enable-gui=no --enable-wxwidgets=no --with-extra-libs=/ffp/lib --with-boost=/ffp
#it's indeed rake instead of make
rake
rake install DESTDIR=/ffp/home/root/temp/mkvtoolnix-7.5.0
cd /ffp/home/root/temp/mkvtoolnix-7.5.0
makepkg mkvtoolnix 7.5.0 0

#libvorbis-1.3.4
./configure --prefix=/ffp --enable-dependency-tracking --enable-docs --enable-examples --with-ogg=/ffp

#libogg-1.3.2
aclocal
autoconf
autoheader
automake --add-missing
~/x.sh ffpg
./configure --prefix=/ffp --enable-dependency-tracking

#flac-1.3.1
./configure --prefix=/ffp --enable-dependency-tracking --with-ogg=/ffp --with-libiconv-prefix=/ffp

#lzo-2.08
./configure --prefix=/ffp --enable-dependency-tracking

#cmake-3.1.1
./bootstrap --prefix=/ffp
make
make install DESTDIR=$HOME/temp/cmake-3.1.1

#libmatroska-release-1.4.1
cd make/linux
make staticlib
make DESTDIR=$HOME/temp/libmatroska-1.4.1 install_staticlib install_headers
cd $HOME/temp/libmatroska-1.4.1
makepkg libmatroska 1.4.1 0

#libebml-1.3.1
./configure --prefix=/ffp --enable-dependency-tracking

#expect5.45
./configure --prefix=/ffp --enable-threads

#dejagnu-1.5.1
./configure --prefix=/ffp --enable-dependency-tracking

#rote-0.2.8
./configure --prefix=/ffp

#libsigsegv-2.10
./configure --prefix=/ffp --enable-dependency-tracking

#libxslt-1.1.28
wget http://xmlsoft.org/sources/libxslt-1.1.28.tar.gz
./configure --prefix=/ffp --enable-dependency-tracking --with-python=/ffp --with-libxml-prefix=/ffp

#tomcat-native-1.1.32
wget http://mirrors.hostingromania.ro/apache.org/tomcat/tomcat-connectors/native/1.1.32/source/tomcat-native-1.1.32-src.tar.gz
export LD_LIBRARY_PATH=/usr/local/zy-pkgs/lib:/ffp/lib
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -O2 -Wall"
export LDFLAGS="-L/ffp/lib"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export CFLAGS="$BUILD_FLAGS"
#locate libjvm -> indicates the path for --with-os-type
./configure --prefix=/ffp --with-apr=/ffp --with-java-home=/ffp/opt/ejre1.7.0_60 --with-ssl=/ffp --with-os-type=lib/arm/client
#fails with:
#... tcn_api.h:36:17: fatal error: jni.h: No such file or directory

#ossp js
wget ftp://ftp.ossp.org/pkg/lib/js/js-1.6.20070208.tar.gz
tar xvzf js-1.6.20070208.tar.gz
mv js-1.6.20070208/ ossp-js-1.6.20070208
cd ossp-js-1.6.20070208
#when compiling with perl use -I/ffp/lib/perl5/5.20.1/armv5tel-linux-thread-multi/CORE:
#export BUILD_FLAGS="$BUILD_FLAGS -I/ffp/lib/perl5/5.20.1/armv5tel-linux-thread-multi/CORE"
./configure --help > configure.help.txt
#for compiling with perl use:
#./configure --prefix=/ffp --with-editline=/ffp --with-perl=/ffp
./configure --prefix=/ffp --with-editline=/ffp

#libunistring-0.9.3
./configure --prefix=/ffp --enable-dependency-tracking --enable-threads=posix --with-libiconv-prefix=/ffp --with-libpth-prefix=/ffp

#gettext-0.18.3
#./autogen.sh
~/x.sh ffpg
find . -name configure.ac -exec sed -i s/"AM_INIT_AUTOMAKE(\[1\.11\.1"/"AM_INIT_AUTOMAKE([1.14.1"/ {} \;
./configure --prefix=/ffp --enable-dependency-tracking --enable-threads=posix --with-libpth-prefix=/ffp --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp --with-libglib-2.0-prefix=/ffp --with-libcroco-0.6-prefix=/ffp --with-libunistring-prefix=/ffp --with-libxml2-prefix=/ffp --with-libncurses-prefix=/ffp --without-libtermcap-prefix --without-libxcurses-prefix --without-libcurses-prefix --with-libexpat-prefix=/ffp

#ncurses-5.9
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -pthread -O2 -Wall"
./configure --prefix=/ffp --with-pkg-config=/ffp/bin/pkg-config --enable-pc-files --with-build-cflags="$BUILD_FLAGS" --with-build-cppflags="$BUILD_FLAGS" --with-build-ldflags="$LDFLAGS" --with-libtool --with-shared --with-termlib --with-gpm --enable-termcap --enable-widec --with-pthread --enable-weak-symbols

#readline-6.2
./configure --prefix=/ffp --enable-multibyte --with-curses

#libffi-3.2.1
wget ftp://sourceware.org/pub/libffi/libffi-3.2.1.tar.gz
aclocal -I m4
autoconf
autoheader
automake --add-missing
./configure --prefix=/ffp --enable-dependency-tracking

#binutils-2.25
export BUILD_FLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -pthread -O2 -Wall"
#./configure --prefix=/ffp --enable-gold=yes --enable-ld=yes --enable-libada --enable-libssp --enable-lto --enable-objc-gc --enable-vtable-verify --with-mpc=/ffp --with-mpfr=/ffp --with-gmp=/ffp --with-isl=/ffp --with-cloog=/ffp
./configure --prefix=/ffp --enable-ld=yes --enable-libada --enable-libssp --enable-lto --enable-objc-gc --enable-vtable-verify --with-mpc=/ffp --with-mpfr=/ffp --with-gmp=/ffp --with-isl=/ffp --with-cloog=/ffp

#sqlite-3.7.17 (http://www.sqlite.org/cgi/src/timeline?t=version-3.7.17&n=200)
wget http://www.sqlite.org/cgi/src/zip/SQLite-118a3b3569.zip?uuid=118a3b35693b134d56ebd780123b7fd6f1497668
unzip sqlite-3.7.17.zip
mv SQLite-118a3b3569 sqlite-3.7.17
cd ~/compile/sqlite-3.7.17
~/x.sh ffpg
#at some moment I had a problem requiring: sed -i s/"HAVE_POSIX_FALLOCATE 1"/"HAVE_POSIX_FALLOCATE 0"/ ~/compile/sqlite-3.7.17/src/os_unix.c
mkdir ~/compile/sqlite-3.7.17-build
cd ~/compile/sqlite-3.7.17-build
#don't use --enable-gcov (needed for profiling)
../sqlite-3.7.17/configure --prefix=/ffp --enable-threadsafe --enable-releasemode --disable-tcl
~/x.sh ffpg1
make

#serf-1.2.1 required by subversion-1.8.5
#--with-serf uses it
wget https://serf.googlecode.com/files/serf-1.2.1.tar.bz2
./configure --prefix=/ffp --with-apr=/ffp --with-apr-util=/ffp --with-openssl=/ffp

#subversion-1.8.5
#svn: E170000: Unrecognized URL scheme for 'https://...' -> use --with-serf option
wget http://archive.apache.org/dist/subversion/subversion-1.8.5.tar.gz
tar xvzf subversion-1.8.5.tar.gz
./configure --prefix=/ffp --with-apr=/ffp --with-apr-util=/ffp --with-serf=/ffp --with-apxs=/ffp/opt/apache-2.2.29-worker/bin/apxs --with-sqlite=/ffp --with-zlib=/ffp
make

#mpfr-3.1.2 -> depends on perl
./configure --prefix=/ffp --enable-thread-safe --enable-dependency-tracking --with-gmp=/ffp

#mpc-1.0.2
./configure --prefix=/ffp --with-mpfr=/ffp --with-gmp=/ffp

#lzip
make CPPFLAGS="$BUILD_FLAGS" CPPFLAGS="$BUILD_FLAGS" LDFLAGS="$LDFLAGS"

#The LLVM Core libraries provide a modern source- and target-independent optimizer, along with code generation support for many popular CPUs (as well as some less common ones!)
llvm-3.5.0
#./configure --prefix=/ffp --enable-libcpp=yes --enable-cxx1y=yes --enable-split-dwarf=yes --enable-libffi=yes --with-python=/ffp/bin/python --enable-targets=arm
./configure --prefix=/ffp --enable-cxx1y=yes --enable-split-dwarf=yes --enable-libffi=yes --with-python=/ffp/bin/python

#isl-0.14 (Integer set library) -> depends on perl
#./configure --prefix=/ffp --enable-dependency-tracking --with-gmp=/ffp --with-clang-prefix=/ffp
./configure --prefix=/ffp --enable-dependency-tracking --with-gmp=/ffp

#OpenScop Library 0.9.0
#http://icps.u-strasbg.fr/~bastoul/development/openscop/#DL
wget http://icps.u-strasbg.fr/~bastoul/development/openscop/docs/osl-0.9.0.tar.gz -o openscop-0.9.0.tar.gz
./configure --prefix=/ffp --enable-dependency-tracking --with-gcc-arch=armv5te --with-gmp-prefix=/ffp

#OpenScop Library 0.5.0
git clone https://github.com/cesarsabater/openscop.git
./autogen.sh
./configure --prefix=/ffp --enable-dependency-tracking --with-gcc-arch=armv5te --with-gmp-prefix=/ffp
~/x.sh ffpg
make

#cloog-0.18.1 (Chunky LOOp Generator) depends on Integer set library 0.12.1 and OpenScop Library 0.5.0
#isl/configure (Integer set library): VERSION='0.12.1'
aclocal -I m4
autoconf
autoheader
automake --add-missing
./configure --prefix=/ffp --enable-dependency-tracking --with-isl-prefix=/ffp --with-gmp-prefix=/ffp --with-osl-prefix=/ffp
~/x.sh ffpg

#osl (object storage layer) -> depends on perl
git clone git://git.tuebingen.mpg.de/osl
#modify Makefile to set PREFIX=/ffp
make
make install PREFIX=/ffp

wget http://ftp.gnome.org/pub/gnome/sources/glib/2.30/glib-2.30.3.tar.xz
aclocal -I m4macros
autoconf
autoheader
automake --add-missing
#./configure --prefix=/ffp --enable-dependency-tracking --enable-gcov --with-libiconv=gnu --with-threads=posix --with-pcre=/ffp
./configure --prefix=/ffp --enable-dependency-tracking --with-threads=posix --with-pcre=/ffp

#libgpg-error-1.12
curl -L -k ftp://ftp.gnupg.org/gcrypt/libgpg-error/libgpg-error-1.12.tar.gz -o libgpg-error-1.12.tar.gz
./configure --prefix=/ffp --enable-dependency-tracking --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp

#libassuan depends on libgpg-error
curl -L -k ftp://ftp.gnupg.org/gcrypt/libassuan/libassuan-2.2.0.tar.bz2 -o libassuan-2.2.0.tar.bz2
./autogen.sh --add-missing
automake --add-missing
./configure --prefix=/ffp --enable-dependency-tracking --with-libgpg-error-prefix=/ffp
#ERROR for doc directory
#Comment (using #) the below lines in files doc/Makefile and doc/Makefile.am:
#assuan_TEXINFOS = lgpl.texi gpl.texi
#Comment (using "@c " prefix) the below lines in doc/assuan.texi:
#* Library Copying::     GNU Lesser General Public License says
#* Copying::             How you can copy and share this manual.
#@include lgpl.texi
#@include gpl.texi

#libksba depends on libgpg-error
curl -L -k ftp://ftp.gnupg.org/gcrypt/libksba/libksba-1.3.2.tar.bz2 -o libksba-1.3.2.tar.bz2
aclocal -I m4
autoconf
autoheader
automake --add-missing
./autogen.sh --add-missing
./configure --prefix=/ffp --enable-dependency-tracking --with-libgpg-error-prefix=/ffp

wget ftp://ftp.gnupg.org/gcrypt/gnupg/gnupg-2.0.26.tar.bz2
#Comment the lines below in doc/Makefile.in and doc/Makefile.am:
#.fig.pdf:
#	fig2dev -L pdf `test -f '$<' || echo '$(srcdir)/'`$< $@
./autogen.sh --add-missing
./configure --prefix=/ffp --enable-dependency-tracking --enable-symcryptrun --enable-gpgtar --enable-selinux-support --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp --with-zlib=/ffp --with-bzip2=/ffp --with-readline=/ffp --with-libgpg-error-prefix=/ffp --with-libassuan-prefix=/ffp --with-libgcrypt-prefix=/ffp --with-pth-prefix=/ffp --with-libcurl=/ffp --with-ksba-prefix=/ffp --enable-scdaemon=no

#wget http://ftp.gnu.org/gnu/gdbm/gdbm-1.10.tar.gz
aclocal -I m4
autoconf
autoheader
automake --add-missing
./configure --prefix=/ffp --enable-libgdbm-compat --enable-dependency-tracking --with-libiconv-prefix=/ffp --with-libintl-prefix=/ffp

#-mtune=xscale ?
export CFLAGS="-march=armv5te -mfloat-abi=soft -mabi=aapcs-linux -fno-stack-protector -pthread -O2 -Wall"
export BUILD_FLAGS="$CFLAGS -I/ffp/include -I/ffp/opt/apache-2.2.29-worker/include"
#export LDFLAGS="-L/ffp/lib -lintl -lpthread -lncurses"
export LIBS="-lintl -lpthread -lncurses"
export CPPFLAGS="$BUILD_FLAGS"
export CXXFLAGS="$BUILD_FLAGS"
export LC_ALL=POSIX

#posix_madvise requires -lc in LDFLAGS
#when using readline the building process might require -lncurses

One thought on “Configure command for building various software”

  1. Hello there,

    So, hopping you can help me out… I’ve came across this post while searching for howto compile GDB on my NAS (DNS325), running :
    FFP_VERSION=0.7.0
    FFP_ARCH=arm

    Your snipped code for #gdb-7.9.1 is exactly the same error I’m getting ! However, if I try to:

    sed -i s/”CONFIG_LIBS = -ldl -lz”/”CONFIG_LIBS = -ldl -lm -lz”/ sim/arm/Makefile
    ./configure –prefix=/ffp
    sed -i s/”CONFIG_LIBS = -ldl -lz”/”CONFIG_LIBS = -ldl -lm -lz”/ sim/arm/Makefile
    make

    I get the same error … and looking at ‘sim/arm/Makefile’, it seems to have reverted back to
    ‘CONFIG_LIBS = -ldl -lz’

    So, I’m stuck here, not knowing how to do this…
    Any help with this would be awesome!!

    Thanks a million!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.