$ sudo emerge \ app-arch/bzip2 \ app-arch/unzip \ app-arch/xz-utils \ app-shells/bash \ dev-lang/ruby \ dev-libs/libffi \ dev-libs/openssl \ dev-perl/XML-Parser \ dev-util/cmake \ dev-util/intltool \ dev-util/pkgconfig \ dev-util/scons \ dev-vcs/git \ sys-devel/autoconf \ sys-devel/automake \ sys-devel/bison \ sys-devel/flex \ sys-devel/gettext \ sys-devel/libtool \ sys-devel/patch \ net-misc/ntp \ www-client/lynx
$ mkdir -p $HOME/setup $ cd $HOME/setup $ wget http://majestio.tk/stuff/setup-scripts.tar.xz $ tar -xf setup-scripts.tar.xz $ rm -f setup-scripts.tar.xz
#!/bin/sh ########################################################################### ## ## ## 1. ## ## - MXE (http://mxe.cc), ## ## ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME , $HOME/Setup # 2. # 3. # # $HOME/dev # MXE $HOME/dev/cross/mxe # # ......................................................................... if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi RETDIR=`pwd` MXEHOME=$HOME/dev/cross/mxe # MXE git- ----------- mkdir -p $HOME/dev/{cross,projests,src,stuff,tools} cd $HOME/dev/cross # : # git clone https://github.com/mxe/mxe.git # : # wget http://majestio.tk/stuff/mxe-empty-26.05.2015.tar.xz # tar -xf mxe-empty-26.05.2015.tar.xz # rm -f mxe-empty-26.05.2015.tar.xz wget http://majestio.tk/stuff/mxe-empty-26.05.2015.tar.xz tar -xf mxe-empty-26.05.2015.tar.xz rm -f mxe-empty-26.05.2015.tar.xz # ABI MXE ------------------------------- echo "#!/bin/sh" > $HOME/dev/cross/mxe/ext/config.guess echo "echo \"x86_64-pc-linux-gnu\"" >> $HOME/dev/cross/mxe/ext/config.guess # MXE win32 -------------------- cd $MXEHOME make MXE_TARGETS='x86_64-w64-mingw32.shared '` `'x86_64-w64-mingw32.static '` `'i686-w64-mingw32.shared '` `'i686-w64-mingw32.static ' gcc gmp winpthreads -j4 JOBS=4 # mxe/src/gcc.mk posix-threads --------------- GCCMK=$MXEHOME/src/gcc.mk PLTMP=$$-$RANDOM.pl echo "open(F,\"$GCCMK\") || die \"Holy shit!\\n\";" > $PLTMP echo "@In = <F>;" >> $PLTMP echo "close(F);" >> $PLTMP echo "open(F,\">$GCCMK\") || die \"Holy shit!\\n\";" >> $PLTMP echo "foreach \$I(@In) {" >> $PLTMP echo " \$I =~ s/^(\\\$\(PKG\)_DEPS.+)\$/\$1 winpthreads/;" >> $PLTMP echo " \$I =~ s/^(.+?--libdir='\\\$\(PREFIX\).+)\$/\$1\n --enable-shared=libstdc\+\+ \\\/;" >> $PLTMP echo " \$I =~ s/^(.+?--enable-threads=)win32(.*)\$/\$1posix\$2/;" >> $PLTMP echo " print F \$I;" >> $PLTMP echo "}" >> $PLTMP echo "close(F);" >> $PLTMP perl $PLTMP && rm -f $PLTMP # GCC posix-threads ----------------------------- cd $MXEHOME make MXE_TARGETS='x86_64-w64-mingw32.shared '` `'x86_64-w64-mingw32.static '` `'i686-w64-mingw32.shared '` `'i686-w64-mingw32.static ' gcc -j4 JOBS=4 # "" - ------------ echo " ..." cd .. tar -cJf mxe-winpthreads-empty.tar.xz ./mxe # -------------------------------------------- cd $MXEHOME make MXE_TARGETS='x86_64-w64-mingw32.shared '` `'x86_64-w64-mingw32.static '` `'i686-w64-mingw32.shared '` `'i686-w64-mingw32.static ' zlib xz sqlite dbus \ libiconv libodbc++ -j4 JOBS=4 # PostgreSQL -------------------------------------------- cd $MXEHOME/src wget http://majestio.tk/stuff/postgresql-3-socket.patch PQSQL=$MXEHOME/src/postgresql.mk PLTMP=$$-$RANDOM.pl echo "open(F,\"$PQSQL\") || die \"Holy shit!\\n\";" > $PLTMP echo "@In = <F>;" >> $PLTMP echo "close(F);" >> $PLTMP echo "open(F,\">$PQSQL\") || die \"Holy shit!\\n\";" >> $PLTMP echo "foreach \$I(@In) {" >> $PLTMP echo " \$I =~ s/^(.+?--disable-rpath.+)\$/\$1\n --disable-thread-safety \\\/;" >> $PLTMP echo " print F \$I;" >> $PLTMP echo "}" >> $PLTMP echo "close(F);" >> $PLTMP perl $PLTMP && rm -f $PLTMP cd $MXEHOME make MXE_TARGETS='x86_64-w64-mingw32.shared '` `'x86_64-w64-mingw32.static '` `'i686-w64-mingw32.shared '` `'i686-w64-mingw32.static ' postgresql -j4 JOBS=4 for PREFIX in "x86_64-w64-mingw32.shared" "x86_64-w64-mingw32.static" \ "i686-w64-mingw32.shared" "i686-w64-mingw32.static" ; do echo "Description: PostgreSQL libpq library" > $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Url: http://www.postgresql.org/" >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Version: 9.2.4" >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Requires: " >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Requires.private: " >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Cflags: -I$MXEHOME/usr/$PREFIX/include" >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Libs: -L$MXEHOME/usr/$PREFIX/lib -lpq" >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc echo "Libs.private: -lssl -lcrypto -lshell32 -lwsock32 -lws2_32 -lsecur32" >> $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc chmod 0644 $MXEHOME/usr/$PREFIX/lib/pkgconfig/libpq.pc done cd $RETDIR
#!/bin/sh ########################################################################### ## ## ## 2. Qt 5.4.1 + ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME/Setup # 2. # 3. # # qt5 # # ------------------------------------------------------------------------- if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi wget http://download.qt.io/official_releases/qt/5.4/5.4.1/single/qt-everywhere-opensource-src-5.4.1.tar.gz tar -xf qt-everywhere-opensource-src-5.4.1.tar.gz mv qt-everywhere-opensource-src-5.4.1 qt5 cd qt5/qtbase/mkspecs wget http://majestio.tk/stuff/win32-g++.static.tar.xz tar -xf win32-g++.static.tar.xz rm -f win32-g++.static.tar.xz cd ../.. wget http://majestio.tk/stuff/qt-5.4.1.patch patch -p1 -u < qt-5.4.1.patch rm -f qt-5.4.1.patch cd ..
#!/bin/sh ########################################################################### ## ## ## 3.1 Qt 5.4.1 Win x32 (shared) ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME/Setup # 2. # 3. # # , %HOME/dev/stuff # # ------------------------------------------------------------------------- if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi TARGET="i686-w64-mingw32.shared" MXE="$HOME/dev/cross/mxe/usr" PREFIX="$HOME/dev/stuff/qt5-$TARGET" export PATH=$MXE/bin:$PATH PWD="`pwd`" LOG="$PWD/$TARGET-qt5.log___________" mkdir "$TARGET-qt5.build" cd "$TARGET-qt5.build" clear OPENSSL_LIBS="`''"$TARGET"'-pkg-config' --libs-only-l openssl`" \ PSQL_LIBS="-lpq -lsecur32 `''"$TARGET"'-pkg-config' --libs-only-l openssl` -lws2_32" \ ../qt5/configure -prefix $PREFIX \ -opensource \ -confirm-license \ -release \ -shared \ -opengl desktop \ -force-pkg-config \ -no-use-gold-linker \ -no-glib \ -openssl \ -dbus \ -plugin-sql-psql \ -plugin-sql-sqlite \ -plugin-sql-odbc \ -qt-libpng -qt-libjpeg -qt-pcre -zlib -qt-freetype -no-kms -no-pch \ -nomake examples -nomake tests -silent -skip webkit \ -xplatform win32-g++ \ -device-option CROSS_COMPILE=$TARGET- \ -device-option PKG_CONFIG="$TARGET-pkg-config" 2>&1 | tee $LOG make -j4 2>&1 | tee -a $LOG make install 2>&1 | tee -a $LOG
#!/bin/sh ########################################################################### ## ## ## 3.2 Qt 5.4.1 Win x32 (static) ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME/Setup # 2. # 3. # # , %HOME/dev/stuff # # ------------------------------------------------------------------------- if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi TARGET="i686-w64-mingw32.static" MXE="$HOME/dev/cross/mxe/usr" PREFIX="$HOME/dev/stuff/qt5-$TARGET" PWD="`pwd`" LOG="$PWD/$TARGET-qt5.log___________" mkdir "$TARGET-qt5.build" cd "$TARGET-qt5.build" clear export PATH=$MXE/bin:$PATH #../qt5/configure --help|less #exit OPENSSL_LIBS="`''"$TARGET"'-pkg-config' --libs-only-l openssl`" \ PSQL_LIBS="-lpq -lsecur32 `''"$TARGET"'-pkg-config' --libs-only-l openssl` -lws2_32" \ ../qt5/configure -prefix $PREFIX \ -opensource \ -confirm-license \ -release \ -static \ -opengl desktop \ -force-pkg-config \ -no-use-gold-linker \ -no-glib \ -openssl-linked \ -dbus-linked \ -qt-sql-psql \ -qt-sql-sqlite \ -qt-sql-odbc \ -qt-libpng -qt-libjpeg -qt-pcre -zlib -qt-freetype -no-kms -no-pch \ -nomake examples -nomake tests -silent -skip webkit \ -xplatform win32-g++ \ -device-option CROSS_COMPILE=$TARGET- \ -device-option PKG_CONFIG="$TARGET-pkg-config" 2>&1 | tee $LOG make -j4 2>&1 | tee -a $LOG make install 2>&1 | tee -a $LOG
#!/bin/sh ########################################################################### ## ## ## 3.3 Qt 5.4.1 Win x64 (shared) ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME/Setup # 2. # 3. # # , %HOME/dev/stuff # # ------------------------------------------------------------------------- if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi TARGET="x86_64-w64-mingw32.shared" MXE="$HOME/dev/cross/mxe/usr" PREFIX="$HOME/dev/stuff/qt5-$TARGET" export PATH=$MXE/bin:$PATH PWD="`pwd`" LOG="$PWD/$TARGET-qt5.log___________" mkdir "$TARGET-qt5.build" cd "$TARGET-qt5.build" clear OPENSSL_LIBS="`''"$TARGET"'-pkg-config' --libs-only-l openssl`" \ PSQL_LIBS="-lpq -lsecur32 `''"$TARGET"'-pkg-config' --libs-only-l openssl` -lws2_32" \ ../qt5/configure -prefix $PREFIX \ -opensource \ -confirm-license \ -release \ -shared \ -opengl desktop \ -force-pkg-config \ -no-use-gold-linker \ -no-glib \ -openssl \ -dbus \ -plugin-sql-psql \ -plugin-sql-sqlite \ -plugin-sql-odbc \ -qt-libpng -qt-libjpeg -qt-pcre -zlib -qt-freetype -no-kms -no-pch \ -nomake examples -nomake tests -silent -skip webkit \ -xplatform win32-g++ \ -device-option CROSS_COMPILE=$TARGET- \ -device-option PKG_CONFIG="$TARGET-pkg-config" 2>&1 | tee $LOG make -j4 2>&1 | tee -a $LOG make install 2>&1 | tee -a $LOG
#!/bin/sh ########################################################################### ## ## ## 3.4 Qt 5.4.1 Win x64 (static) ## ## ## ## Majestio (C) http://majestio.tk ## ########################################################################### # # : # # 1. $HOME/Setup # 2. # 3. # # , %HOME/dev/stuff # # ------------------------------------------------------------------------- if [ "$(whoami)" == 'root' ]; then echo ": !" exit 1 fi TARGET="x86_64-w64-mingw32.static" MXE="$HOME/dev/cross/mxe/usr" PREFIX="$HOME/dev/stuff/qt5-$TARGET" PWD="`pwd`" LOG="$PWD/$TARGET-qt5.log___________" mkdir "$TARGET-qt5.build" cd "$TARGET-qt5.build" clear export PATH=$MXE/bin:$PATH #../qt5/configure --help|less #exit OPENSSL_LIBS="`''"$TARGET"'-pkg-config' --libs-only-l openssl`" \ PSQL_LIBS="-lpq -lsecur32 `''"$TARGET"'-pkg-config' --libs-only-l openssl` -lws2_32" \ ../qt5/configure -prefix $PREFIX \ -opensource \ -confirm-license \ -release \ -static \ -opengl desktop \ -force-pkg-config \ -no-use-gold-linker \ -no-glib \ -openssl-linked \ -dbus-linked \ -qt-sql-psql \ -qt-sql-sqlite \ -qt-sql-odbc \ -qt-libpng -qt-libjpeg -qt-pcre -zlib -qt-freetype -no-kms -no-pch \ -nomake examples -nomake tests -silent -skip webkit \ -xplatform win32-g++ \ -device-option CROSS_COMPILE=$TARGET- \ -device-option PKG_CONFIG="$TARGET-pkg-config" 2>&1 | tee $LOG make -j4 2>&1 | tee -a $LOG make install 2>&1 | tee -a $LOG
$ sh 1.setup-first.sh
$ sh 2.setup-qt5.sh
$ sh
$ mkdir -p $HOME/dev/{cross,src,stuff,projects} $ cd $HOME/dev/cross $ git clone https://github.com/mxe/mxe.git $ make MXE_TARGETS='x86_64-w64-mingw32.shared' gcc -j4 JOBS=4 $ make MXE_TARGETS='x86_64-w64-mingw32.static' gcc -j4 JOBS=4 $ make MXE_TARGETS='i686-w64-mingw32.shared' gcc -j4 JOBS=4 $ make MXE_TARGETS='i686-w64-mingw32.static' gcc -j4 JOBS=4 # # PostgreSQL- - $HOME/dev/cross/mxe/src # , http://majestio.tk/stuff/postgresql-3-socket.patch # $ make MXE_TARGETS='x86_64-w64-mingw32.shared' qt5 -j4 JOBS=4 $ make MXE_TARGETS='x86_64-w64-mingw32.static' qt5 -j4 JOBS=4 $ make MXE_TARGETS='i686-w64-mingw32.shared' qt5 -j4 JOBS=4 $ make MXE_TARGETS='i686-w64-mingw32.static' qt5 -j4 JOBS=4
Source: https://habr.com/ru/post/258951/
All Articles