egalite is an open source project powered by Assembla

Assembla offers free public and private SVN/Git repositories and project hosting with bug/issue tracking and collaboration tools.

Branchmaster
/
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
#!/bin/bash

# configure script for
#
#  dchat/egalite
#
# Copyright (C) 2011 Bernd Stramm
#

#/****************************************************************
# * This file is distributed under the following license:
# *
# * Copyright (C) 2011, Bernd Stramm
# *
# *  This program is free software; you can redistribute it and/or
# *  modify it under the terms of the GNU General Public License
# *  as published by the Free Software Foundation; either version 2
# *  of the License, or (at your option) any later version.
# *
# *  This program is distributed in the hope that it will be useful,
# *  but WITHOUT ANY WARRANTY; without even the implied warranty of
# *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# *  GNU General Public License for more details.
# *
# *  You should have received a copy of the GNU General Public License
# *  along with this program; if not, write to the Free Software
# *  Foundation, Inc., 51 Franklin Street, Fifth Floor,
# *  Boston, MA  02110-1301, USA.
# ****************************************************************/
#


#
# function to determine the name of qmake
#
findqmake () {

  QM=`which qmake`
  QM4=`which qmake-qt4`

  if [ -z $QM ]
  then
    RES3="0"
  else
    RES3=`$QM -query QT_VERSION`
  fi
  if [ -z $QM4 ]
  then
    RES4="0"
  else
    RES4=`$QM4 -query QT_VERSION`
  fi

  MATCH3=`expr match $RES3 '4.'`
  MATCH4=`expr match $RES4 '4.'`

  QMAKE="qmake"

  if [ $MATCH3 -eq 2 ]
  then
    QMAKE=$QM
  else
    if [ $MATCH4 -eq 2 ]
    then
      QMAKE=$QM4
    else
      echo "cannot find qmake for Qt4"
      exit 1
    fi
  fi
}


#
# function to find distro
#
find_distro () {
DISTRO=linux
if [ -e /etc/system-release ]
then
  DISTRO=`head -1 /etc/system-release \
         | awk '{print $1}' \
         | tr '[:upper:]' '[:lower:]'`
else
  if [ -e /etc/issue ]
  then
    DISTRO=`head -1 /etc/issue \
    | awk '{print $1}' \
    | tr '[:upper:]' '[:lower:]'`
  fi
fi
}

find_lrelease () {

  LREL=`which lrelease`
  LREL4=`which lrelease-qt4`

  if [ -z $LREL ]
  then
    RES3="0"
  else
    RES3=`$LREL -version`
  fi
  if [ -z $LREL4 ]
  then
    RES4="0"
  else
    RES4=`$LREL4 -version`
  fi

  LRMATCH3=`expr match "$RES3" 'lrelease version 4.'`
  LRMATCH4=`expr match "$RES4" 'lrelease version 4.'`

  LRELEASE="lrelease"

  if [ $LRMATCH3 -eq 19 ]
  then
    LRELEASE=$LREL
  else
    if [ $LRMATCH4 -eq 19 ]
    then
      LRELEASE=$LREL4
    else
      echo "cannot find LRELEASE for Qt4"
      exit 1
    fi
  fi
}

#
# function to tell the user about options
#
usage () {
   echo
   echo "$0 [OPTIONS]"
   echo
   echo "Options:"
   echo "--help             Show this help message and quit"
   echo "--prefix=PREFIX    Install into PREFIX [${PREFIX}]"
   echo "--qxmppbase=QXDIR  qxmpp base directory [${QXMPP_BASE}]"
   echo "--qxmppname=QXNAME qxmpp basic name [${QXMPP_NAME}]"
   echo "--audio=<0|1>      Build with audio input support [${DO_AUDIO}]"
   echo "--mobil-audio=<0|1>  Build with qtmobile audio [${DO_MOBI_AUDIO}]"
   echo
}


#
# main configure script
#

COPYRIGHT=" Copyright (C) 2011 Bernd Stramm"
PREFIX=/usr
QXMPP_BASE=/usr
QXMPP_NAME=qxmppclient
OPTIONS_FILE=options.pri
DO_AUDIO=0
DO_MOBI_AUDIO=1
COMMAND_LINE="$0 $*"
find_distro

#
# command line arguments:
# see if they said anything about prefix
#
while test $# != 0
do
  case $1 in
  --*=*)
  ac_option=`expr "X$1" : 'X\([^=]*\)='`
  ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
  ac_shift=:
  ;;
 *)
  ac_option=$1
  ac_optarg=$2
  ac_shift=shift
  ;;
  esac

case $ac_option in
  --help)
   usage
   exit 0
   ;;
  --prefix)
   PREFIX=$ac_optarg
   $ac_shift
   ;;
  --qxmppbase)
   QXMPP_BASE=$ac_optarg
   $ac_shift
   ;;
  --qxmppname)
   QXMPP_NAME=$ac_optarg
   $ac_shift
   ;;
  --audio)
   DO_AUDIO=$ac_optarg
   $ac_shift
   ;;
  --mobil-audio)
   DO_MOBI_AUDIO=$ac_optarg
   $ac_shift
   ;;
  --distro)
   DISTRO=$ac_optarg
   $ac_shift
   ;;
  *)
   echo "Bad option " $ac_option " " $ac_optarg
   usage
   shift
   ;;
  esac
shift

done

#
# see if we are on windows and need a special name for "make"
#

OSLEN=`expr match "Z$OS" "ZWindow"`
if [ $OSLEN -gt 5 ] ; then
  MAKE_PROGRAM="mingw32-make.exe"
  QMAKE="qmake.exe"
  LRELEASE="lrelease.exe"
else
  MAKE_PROGRAM="make"
  #
  # check what qmake is called on this system
  #
  findqmake
  find_lrelease
fi

#
#  see if we build for x86 or ARM
#
MACHINE=`uname -m`
IS_X86=`expr index 86 $MACHINE`
IS_ARM=`expr index arm $MACHINE`

#
# generate Makefile
#
# first shove in everything we found out
#
echo "#" > Makefile
echo "# Makefile generated by configure" >> Makefile
echo "# Faux automake" >> Makefile
echo "# ${COPYRIGHT}" >> Makefile
echo "#" >> Makefile
echo "PREFIX=${PREFIX}" >> Makefile
echo "DESTDIR=\${PREFIX}/bin" >> Makefile
echo "QMAKE = $QMAKE" >> Makefile
echo "MAKE = ${MAKE_PROGRAM}" >> Makefile
echo "LRELEASE = ${LRELEASE}" >> Makefile

#
# make options include file for qmake
#
echo "DISTRO = ${DISTRO}" > ${OPTIONS_FILE}
echo "CONFIG += ${DISTRO}" >> ${OPTIONS_FILE}
echo "DEFINES += DISTRO_${DISTRO}=1" >> ${OPTIONS_FILE}
echo "QXMPP_BASE = ${QXMPP_BASE}" >> ${OPTIONS_FILE}
echo "QXMPP_NAME = ${QXMPP_NAME}" >> ${OPTIONS_FILE}
echo "DO_AUDIO = ${DO_AUDIO}" >> ${OPTIONS_FILE}
echo "DO_MOBI_AUDIO = ${DO_MOBI_AUDIO}" >> ${OPTIONS_FILE}
if [ $DO_AUDIO -eq 1 ]
then
  echo "CONFIG += audio" >> ${OPTIONS_FILE}
else
  echo "CONFIG -= audio" >> ${OPTIONS_FILE}
fi
if [ $DO_MOBI_AUDIO -eq 1 ]
then
  echo "CONFIG += mobilaudio" >> ${OPTIONS_FILE}
else
  echo "CONFIG -= mobilaudio" >> ${OPTIONS_FILE}
fi
if [ $IS_ARM -eq 1 ]
then
  echo "CONFIG += build_arm" >> ${OPTIONS_FILE}
else
  echo "CONFIG -= build_arm" >> ${OPTIONS_FILE}
fi
if [ $IS_X86 -eq 1 ]
then
  echo "CONFIG += build_x86" >> ${OPTIONS_FILE}
else
  echo "CONFIG -= build_x86" >> ${OPTIONS_FILE}
fi
#
# next concatenate the Makefile.in content
#
cat Makefile.in >> Makefile

#
# tell the user what to do next
#
showmsg () {
  echo "     " $*
  echo $* >> config.last
}

echo "" > config.last
showmsg `date -R`
showmsg $COMMAND_LINE
showmsg ""
showmsg 'qmake is..................' $QMAKE
showmsg 'Installation prefix is....' $PREFIX
showmsg 'Distro setting is.........' $DISTRO
showmsg 'DO_AUDIO is...............' $DO_AUDIO
showmsg 'DO_MOBI_AUDIO is..........' $DO_MOBI_AUDIO
showmsg 'Qxmpp base dir is.........' $QXMPP_BASE
showmsg 'Qxmpp name is.............' $QXMPP_NAME
showmsg 'IS_ARM is.................' $IS_ARM
showmsg 'IS_X86 is.................' $IS_X86
showmsg 'Now you can build with....' $MAKE_PROGRAM
Ajax-loader Loading, please wait...