source: scripts/untested/blfs-scripts/blfs-qt.sh@ 7ed0e05

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since 7ed0e05 was fcf217f, checked in by Jim Gifford <clfs@…>, 19 years ago

r602@server (orig r600): ryan | 2005-08-05 23:24:20 -0700
Script now uses defaults defined in qt-setup.sh
Has options to build against mysql,pgsql and unixodbc
Fixed some indentation...


  • Property mode set to 100755
File size: 4.6 KB
Line 
1#!/bin/sh
2
3### qt ###
4cd ${SRC}
5LOG=qt-blfs.log
6
7SELF=`basename ${0}`
8set_buildenv
9set_libdirname
10setup_multiarch
11
12# qt-setup.sh should have been sourced
13#QT_INSTALL_SELF_CONTAINED=Y
14#USE_MYSQL=Y
15#USE_PGSQL=Y
16#USE_UNIXODBC=Y
17
18if [ "Y" = "${QT_INSTALL_SELF_CONTAINED}" ]; then
19 # for now, install to /opt
20 qtprefix="/opt/qt-${QT_VER}"
21 qtheaderdir="${qtprefix}/include"
22 extra_conf="${extra_conf} -libdir ${qtprefix}/${libdirname}"
23 # TODO: probably only want to do this if BIARCH, but hey
24 # plugins should probably go under libdir
25 # This stops the plugins from each arch getting clobbering
26 extra_conf="${extra_conf} -plugindir ${qtprefix}/${libdirname}/plugins"
27 headerdir=
28else
29 qtprefix="/usr"
30 qtheaderdir="${qtprefix}/include/qt"
31 extra_conf="${extra_conf} -docdir ${qtprefix}/share/doc/qt"
32 extra_conf="${extra_conf} -headerdir ${qtprefix}/include/qt"
33 extra_conf="${extra_conf} -libdir ${qtprefix}/${libdirname}"
34 extra_conf="${extra_conf} -plugindir ${qtprefix}/${libdirname}/qt/plugins"
35 extra_conf="${extra_conf} -datadir ${qtprefix}/share/qt"
36 extra_conf="${extra_conf} -translationdir ${qtprefix}/share/qt/translations"
37 extra_conf="${extra_conf} -sysconfdir /etc/qt"
38fi
39
40if [ "${USE_MYSQL}" = "Y" ]; then
41 extra_conf="${extra_conf} -plugin-sql-mysql $( mysql_config --include )"
42 echo extra_conf
43fi
44
45
46if [ "${USE_POSTGRES}" = "Y" ]; then
47 extra_conf="${extra_conf} -plugin-sql-psql -I$( pg_config --includedir )"
48fi
49
50if [ "${USE_ODBC}" = "Y" ]; then
51 extra_conf="${extra_conf} -plugin-sql-odbc -I/usr/include"
52fi
53
54unpack_tarball qt-x11-free-${QT_VER}
55cd ${PKGDIR}
56
57# Here we have to handle lib / lib64 , and also handle multilib compilers
58if [ "Y" = "${MULTIARCH}" ]; then
59 platform="linux-g++"
60 if [ "${libdirname}" = "lib64" ]; then platform="linux-g++-64" ; fi
61fi
62
63sed -i "s@\(gcc\|g++\)@& ${ARCH_CFLAGS} ${TGT_CFLAGS}@g" \
64 mkspecs/${platform}/qmake.conf
65
66# Force removal of existing file when installing
67echo "QMAKE_INSTALL_FILE = cp --remove-destination" \
68 >> mkspecs/${platform}/qmake.conf
69sed -i -e 's@cp -f@cp --remove-destination@g' \
70 qmake/Makefile.unix
71
72extra_conf="${extra_conf} -platform ${platform}"
73
74export QTDIR="${SRC}/${PKGDIR}"
75export LD_LIBRARY_PATH="${QTDIR}/lib:${LD_LIBRARY_PATH}"
76export PATH=${QTDIR}/bin:${PATH}
77
78max_log_init qt ${QT_VER} "blfs (shared)" ${CONFLOGS} ${LOG}
79echo "yes" | ./configure \
80 -prefix ${qtprefix} ${extra_conf} \
81 -no-exceptions -thread -plugin-imgfmt-png \
82 -system-libpng -system-libmng -system-zlib -system-libjpeg \
83 -system-nas-sound -qt-gif -tablet \
84 >> ${LOGFILE} 2>&1 &&
85echo " o Configure OK" || barf
86
87min_log_init ${BUILDLOGS} &&
88make \
89 >> ${LOGFILE} 2>&1 &&
90echo " o Build OK" || barf
91
92if [ "Y" = "${MULTIARCH}" ]; then
93 # Preserve any existing configurations for the other
94 # qt platform during install
95 case ${platform} in
96 linux-g++ )
97 if [ -d ${qtprefix}/mkspecs/linux-g++-64 ];then
98 mv ${qtprefix}/mkspecs/linux-g++-64 \
99 ${qtprefix}/mkspecs/linux-g++-64-ORIG
100 fi
101 ;;
102 linux-g++-64 )
103 if [ -d ${qtprefix}/mkspecs/linux-g++ ];then
104 mv ${qtprefix}/mkspecs/linux-g++ \
105 ${qtprefix}/mkspecs/linux-g++-ORIG
106 fi
107 ;;
108 esac
109fi
110
111min_log_init ${INSTLOGS} &&
112make install \
113 >> ${LOGFILE} 2>&1 &&
114echo " o ALL OK" || barf
115
116if [ "Y" = "${MULTIARCH}" ]; then
117 case ${platform} in
118 linux-g++ )
119 if [ -d ${qtprefix}/mkspecs/linux-g++-64-ORIG ];then
120 rm -rf ${qtprefix}/mkspecs/linux-g++-64
121 mv ${qtprefix}/mkspecs/linux-g++-64-ORIG \
122 ${qtprefix}/mkspecs/linux-g++-64
123 fi
124 ;;
125 linux-g++-64 )
126 if [ -d ${qtprefix}/mkspecs/linux-g++-ORIG ];then
127 rm -rf ${qtprefix}/mkspecs/linux-g++
128 mv ${qtprefix}/mkspecs/linux-g++-ORIG \
129 ${qtprefix}/mkspecs/linux-g++
130 fi
131 ;;
132 esac
133fi
134
135if [ "Y" = "${QT_INSTALL_SELF_CONTAINED}" ]; then
136 ln -sfn qt-${QT_VER} /opt/qt
137 cp -r doc/man ${qtprefix}/doc
138 cp -r examples ${qtprefix}/doc
139else
140 cp -r doc/man ${qtprefix}/share
141 cp -r examples ${qtprefix}/share/doc/qt
142fi
143
144ln -s libqt-mt.so ${qtprefix}/${libdirname}/libqt.so &&
145rm ${qtprefix}/bin/qmake &&
146install -m755 -oroot -groot qmake/qmake ${qtprefix}/bin
147
148if [ "Y" = "${MULTIARCH}" ]; then
149 use_wrapper ${qtprefix}/bin/{qmake,uic,moc,qtconfig}
150
151 # There is one header file (qconfig.h) which will be different
152 # between 32 and 64 bit ( stores things such as size of long long
153 # for the given architecture ). Here we move it to a subdir and
154 # create a stub header
155 create_stub_hdrs ${qtheaderdir}/qconfig.h
156fi
Note: See TracBrowser for help on using the repository browser.