forked from hime-ime/hime
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure
executable file
·616 lines (562 loc) · 17.7 KB
/
configure
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
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
#!/bin/sh
if [ "$1" = "-h" -o "$1" = "--help" -o "$1" = "-help" ]; then
echo "Usage: $0 [OPTION]... [VAR=VALUE]..."
echo ""
echo "Installation directories:"
echo " --prefix=PREFIX : install in PREFIX (e.g. /usr) [default: /usr/local]"
echo ""
echo "Optional Packages:"
echo " --with-gtk=2.0|3.0 : which gtk+ version to compile against [default: 2.0]"
echo ""
echo "Optional Features:"
echo " --disable-nls : disable Native Language Support [default: enable]"
echo " --disable-xim : disable the support of XIM [default: enable]"
echo " --disable-system-tray : disable system tray support [default: enable]"
echo " --disable-tsin : disable Tsin input method [default: enable]"
echo " --disable-gtk2-im-module : disable GTK+ 2.x im-module [default: auto-detect]"
echo " --disable-gtk3-im-module : disable GTK+ 3.x im-module [default: auto-detect]"
echo " --enable-qt3-immodule : enable QT3 im-module [default: disable]"
echo " --disable-qt4-immodule : disable QT4 im-module [default: auto-detect]"
echo " --disable-qt5-immodule : disable QT5 im-module [default: auto-detect]"
echo " --disable-anthy : disable Anthy input method [default: auto-detect]"
echo " --disable-chewing : disable Chewing input method [default: auto-detect]"
echo " --disable-appindicator : disable Ubuntu unity tray [default: auto-detect]"
echo " --disable-lib64 : disable the use of lib64 dir [default: auto-detect]"
echo ""
echo "System Specific Pathes:"
echo " --qt3-moc-path=PATH : specify the path of \"moc\" command for Qt 3.x"
echo " --qt4-moc-path=PATH : specify the path of \"moc\" command for Qt 4.x"
echo " --qt4-im-module-path=PATH : specify the install path for Qt 4.x im-module."
echo " --qt5-moc-path=PATH : specify the path of \"moc\" command for Qt 5.x"
echo " --qt5-im-module-path=PATH : specify the install path for Qt 5.x im-module."
echo ""
exit
fi
MAKE=make
which gmake > /dev/null 2> /dev/null
if [ $? = 0 ]; then
MAKE=gmake
fi
FREEBSD=0
uname | grep FreeBSD | grep -v GNU/kFreeBSD > /dev/null 2> /dev/null
if [ $? = 0 ]; then
FREEBSD=1
fi
uname | grep OpenBSD > /dev/null 2> /dev/null
if [ $? = 0 ]; then
FREEBSD=1
fi
SO_FLAGS="$LDFLAGS -shared -Wl,--as-needed"
MAC_OS=0
uname | grep Darwin > /dev/null 2> /dev/null
if [ $? = 0 ]; then
FREEBSD=1
MAC_OS=1
SO_FLAGS="-dynamic -bundle -undefined suppress -flat_namespace"
fi
prefix="/usr/local"
LIB=
use_xim='Y'
use_tray='Y'
use_unity='Y'
use_i18n='Y'
use_tsin='Y'
use_anthy='Y'
use_chewing='Y'
# Qt3 immodule patch is not included in official Qt3 release.
# Some distros do not apply that patch and will always build failure.
# We should turn off Qt3 immodule by default.
use_qt3='N'
use_qt4='Y'
use_qt5='Y'
use_gtk='Y'
use_gtk3='Y'
find_in_path_list_to_variable() {
# find_in_path_list_to_variable() will find all elements in the array name stored in $1
# if found, set the found path to variable name in $2 and return 0
# otherwise return 1.
for path in $1; do
if [ -x "$path" ]; then
eval $2=\"$path\"
return 0
fi
done
return 1
}
# debian fedora fedora freebsd slackware arch
qt5_moc_path_list="/usr/share/qt5/bin/moc /usr/lib/qt5/bin/moc /usr/bin/moc-qt5 /usr/local/bin/moc-qt5 /usr/local/bin/moc /usr/bin/moc"
# debian fedora fedora freebsd slackware arch
qt4_moc_path_list="/usr/share/qt4/bin/moc /usr/lib/qt4/bin/moc /usr/bin/moc-qt4 /usr/local/bin/moc-qt4 /usr/local/bin/moc /usr/bin/moc"
# debian others
qt3_moc_path_list="/usr/share/qt3/bin/moc /opt/qt/bin/moc"
if [ "$HIME_USE_XIM" ]; then
use_xim=$HIME_USE_XIM
fi
QT5_IM_DIR_CUSTOM=
QT4_IM_DIR_CUSTOM=
for opt do
case "$opt" in
--with_gtk3|--with-gtk=3.0) GTK=gtk+-3.0
;;
--prefix=*) prefix=`echo $opt | cut -d '=' -f 2`
;;
--use_xim=*) use_xim=`echo $opt | cut -d '=' -f 2`
;;
--enable-xim) use_xim=Y
;;
--disable-xim) use_xim=N
;;
--use_tray=*) use_tray=`echo $opt | cut -d '=' -f 2`
;;
--enable-system-tray) use_tray=Y
;;
--disable-system-tray) use_tray=N
;;
--use_unity=*) use_unity=`echo $opt | cut -d '=' -f 2`
;;
--enable-appindicator) use_unity=Y
;;
--disable-appindicator) use_unity=N
;;
--use_i18n=*) use_i18n=`echo $opt | cut -d '=' -f 2`
;;
--enable-nls) use_i18n=Y
;;
--disable-nls) use_i18n=N
;;
--use_tsin=*) use_tsin=`echo $opt | cut -d '=' -f 2`
;;
--enable-tsin) use_tsin=Y
;;
--disable-tsin) use_tsin=N
;;
--use_anthy=*) use_anthy=`echo $opt | cut -d '=' -f 2`
;;
--enable-anthy) use_anthy=Y
;;
--disable-anthy) use_anthy=N
;;
--use_chewing=*) use_chewing=`echo $opt | cut -d '=' -f 2`
;;
--enable-chewing) use_chewing=Y
;;
--disable-chewing) use_chewing=N
;;
--use_qt3=*) use_qt3=`echo $opt | cut -d '=' -f 2`
;;
--enable-qt3-immodule) use_qt3=Y
;;
--disable-qt3-immodule) use_qt3=N
;;
--use_qt4=*) use_qt4=`echo $opt | cut -d '=' -f 2`
;;
--enable-qt4-immodule) use_qt4=Y
;;
--disable-qt4-immodule) use_qt4=N
;;
--use_qt5=*) use_qt5=`echo $opt | cut -d '=' -f 2`
;;
--enable-qt5-immodule) use_qt5=Y
;;
--disable-qt5-immodule) use_qt5=N
;;
--use_gtk=*) use_gtk=`echo $opt | cut -d '=' -f 2`
;;
--enable-gtk2-im-module) use_gtk=Y
;;
--disable-gtk2-im-module) use_gtk=N
;;
--use_gtk3=*) use_gtk3=`echo $opt | cut -d '=' -f 2`
;;
--enable-gtk3-im-module) use_gtk3=Y
;;
--disable-gtk3-im-module) use_gtk3=N
;;
--qt3-moc-path=*) QT3_MOC_PATH=`echo $opt | cut -d '=' -f 2`
;;
--qt4-moc-path=*) QT4_MOC_PATH=`echo $opt | cut -d '=' -f 2`
;;
--qt4-install-to=*|--qt4-im-module-path=*) QT4_IM_DIR_CUSTOM=`echo $opt | cut -d '=' -f 2`
;;
--qt5-moc-path=*) QT5_MOC_PATH=`echo $opt | cut -d '=' -f 2`
;;
--qt5-install-to=*|--qt5-im-module-path=*) QT5_IM_DIR_CUSTOM=`echo $opt | cut -d '=' -f 2`
;;
--disable-lib64) LIB='lib'
;;
esac
done
echo "prefix: $prefix"
echo -n ".... Testing Xtst : "
XTST=`pkg-config --exists xtst 2> /dev/null`
if [ $? != 0 ]; then
echo "please install rpm/package xtest-devel. abort!"
exit 1
else
echo "Found."
fi
if [ -z "$GTK" ]; then
GTK=gtk+-2.0
fi
echo -n ".... Testing $GTK : "
GTKINC=`pkg-config --cflags $GTK 2> /dev/null`
if [ $? != 0 ]; then
if [ "$GTK" = gtk+-2.0 ]; then
echo "Not found, trying gtk+-3.0..."
GTK=gtk+-3.0
echo -n ".... Testing $GTK : "
GTKINC=`pkg-config --cflags $GTK 2> /dev/null`
if [ $? != 0 ]; then
echo "$GTK or above required --cflags. abort!"
rm -f config.mak
exit 1
fi
else
echo "$GTK or above required --cflags. abort!"
rm -f config.mak
exit 1
fi
fi
## problem in MacOS, by candyz
if [ $MAC_OS = 1 ]; then
GTKINC="-I/sw/include `pkg-config --cflags $GTK` 2> /dev/null"
fi
GTKLDFLAGS=`pkg-config --libs $GTK 2> /dev/null`
if [ $? != 0 ]; then
echo "$GTK or above required --libs"
echo "please install rpm/package libgtk+2.0_0-devel/libgtk+3.0_0-devel. abort!"
rm -f config.mak
exit 1
else
echo "Found."
fi
if [ "$GTK" = gtk+-2.0 ]; then
pkg-config --exists 'gtk+-2.0 >= 2.10' 2> /dev/null
if [ $? != 0 ]; then
echo ".... Testing system-tray : Disabled. gtk > 2.10 is needed to enable system-tray."
use_tray=N
fi
fi
echo -n ".... Testing anthy : "
USE_ANTHY=`pkg-config --libs anthy 2> /dev/null`
if [ $? != 0 ]; then
echo "Not found, anthy module is turned off."
USE_ANTHY=N
else
if [ "$use_anthy" = "N" ]; then
USE_ANTHY='N'
echo "Found, but disabled."
else
USE_ANTHY='Y'
ANTHY_INC="-I`pkg-config --variable=includedir anthy` `pkg-config --libs anthy`"
echo "Found."
fi
fi
echo -n ".... Testing chewing : "
USE_CHEWING=`pkg-config --libs chewing 2> /dev/null`
if [ $? != 0 ]; then
echo Not found, chewing module is turned off.
USE_CHEWING=N
else
if [ $use_chewing = "N" ]; then
USE_CHEWING='N'
echo "Found, but disabled."
else
pkg-config --exists 'chewing >= 0.3.2' 2> /dev/null
if [ $? != 0 ]; then
USE_CHEWING='N'
echo "Disabled. chewing > 0.3.2 is needed to enable chewing."
else
USE_CHEWING='Y'
echo "Found."
fi
fi
fi
if [ "$GTK" = "gtk+-3.0" ]; then
APPINDICATOR=appindicator3-0.1
SUPPORT_SYSTEM_TRAY=`pkg-config --exists 'gtk+-3.0 > 3.9.8' && echo 'N' || echo 'Y'`
if [ "$SUPPORT_SYSTEM_TRAY" = "N" ]; then
use_tray='N'
fi
else
APPINDICATOR=appindicator-0.1
fi
if [ "$use_unity" = "Y" ]; then
echo -n ".... Testing appindicator : "
USE_UNITY=`pkg-config --libs $APPINDICATOR 2> /dev/null`
if [ $? != 0 ]; then
USE_UNITY=`pkg-config --libs appindicator3-0.1 2> /dev/null`
if [ $? = 0 ] && [ "$GTK" = "gtk+-2.0" ]; then
echo "Disabled. appindicator3-0.1 is found, but is using gtk+2.0. Add option \"--with-gtk=3.0\" to enable it."
else
echo "Not found, unity tray is turned off."
fi
USE_UNITY=N
else
if [ "$use_unity" = "N" ]; then
USE_UNITY='N'
echo "Found, but disabled."
else
pkg-config --exists "$APPINDICATOR >= 0.4.0" 2> /dev/null
if [ $? != 0 ]; then
echo "Disabled. appindicator > 0.4.0 is needed to enable appindicator."
USE_UNITY='N'
else
USE_UNITY='Y'
echo "Found."
UNITY_INC="-I/usr/include/libappindicator-0.1"
GTKINC=`pkg-config --cflags $GTK $APPINDICATOR 2> /dev/null`
GTKLDFLAGS=`pkg-config --libs $GTK $APPINDICATOR 2> /dev/null`
fi
fi
fi
fi
if [ -z "$LIB" ];then
LIB='lib'
if [ -d /usr/lib64 -a -d /lib64 ]; then
LIB='lib64'
fi
if [ `uname -s` = Linux ]; then
distid=`lsb_release -is 2> /dev/null`
if [ $? = 0 ]; then
case $distid in
Ubuntu | Debian | Arch | archlinux)
LIB='lib'
;;
esac
else
DEBIAN_LD=`ld -v 2>&1 | grep -i debian`
UBUNTU_LD=`ld -v 2>&1 | grep -i ubuntu`
if [ "$DEBIAN_LD" != "" -o "$UBUNTU_LD" != "" ]; then
LIB='lib'
elif [ -e /etc/arch-release ]; then
LIB='lib'
fi
fi
fi
fi
# --- QT3 START ---
QT_IM='N'
QT_IM_DIR=/qt3/plugins/inputmethods
echo -n ".... Testing Qt 3.x : "
pkg-config --libs qt-mt > /dev/null 2> /dev/null
if [ $? = 0 ]; then
QT_IM='Y'
fi
if [ ! -x "$QT3_MOC_PATH" ]; then
find_in_path_list_to_variable "$qt3_moc_path_list" "QT3_MOC_PATH"
fi
if [ "$QT_IM" = "Y" ]; then
if [ "$use_qt3" = "N" ]; then
QT_IM='N'
echo "Found, but disabled."
else
if [ ! -x "$QT3_MOC_PATH" ]; then
echo "Not found, cannot find \"moc\" tool for Qt 3.x."
echo "Hint: use the --qt3-moc-path option. abort!"
exit 1
fi
echo "Found."
fi
else
echo "Not found, Qt 3.x immodule is turned off."
fi
# --- QT3 END ---
# --- QT4 START ---
QT4_IM='N'
if [ -z "$QT4_IM_DIR" ]; then QT4_IM_DIR=/qt4/plugins/inputmethods; fi
echo -n ".... Testing Qt 4.x : "
pkg-config --libs QtCore QtGui > /dev/null 2> /dev/null
if [ $? = 0 ]; then
QT4_IM='Y'
fi
if [ ! -x "${QT4_MOC_PATH}" ]; then
find_in_path_list_to_variable "`pkg-config --variable=moc_location QtCore` $qt4_moc_path_list" "QT4_MOC_PATH"
fi
if [ "$QT4_IM" = "Y" ]; then
if [ "$use_qt4" = "N" ]; then
QT4_IM='N'
echo "Found, but disabled."
else
if [ ! -x "$QT4_MOC_PATH" ]; then
echo "Not found, cannot find \"moc\" tool for Qt 4.x."
echo "Hint: use the --qt4-moc-path option. abort!"
exit 1
fi
echo "Found."
fi
else
echo "Not found, Qt 4.x immodule is turned off."
fi
# --- QT4 END ---
# --- QT5 START ---
QT5_IM='N'
if [ -z "$QT5_IM_DIR" ]; then QT5_IM_DIR=/qt5/plugins/platforminputcontexts; fi
echo -n ".... Testing Qt 5.x : "
pkg-config --libs Qt5Core Qt5Gui > /dev/null 2> /dev/null
if [ $? = 0 ]; then
QT5_IM='Y'
fi
if [ ! -x "${QT5_MOC_PATH}" ]; then
find_in_path_list_to_variable "`pkg-config --variable=host_bins Qt5Core`/moc $qt5_moc_path_list" "QT5_MOC_PATH"
fi
if [ "$QT5_IM" = "Y" ]; then
if [ "$use_qt5" = "N" ]; then
QT5_IM='N'
echo "Found, but disabled."
else
if [ ! -x "$QT5_MOC_PATH" ]; then
echo "Not found, cannot find \"moc\" tool for Qt 5.x."
echo "Hint: use the --qt5-moc-path option. abort!"
exit 1
fi
echo "Found."
fi
else
echo "Not found, Qt 5.x immodule is turned off."
fi
# --- QT5 END ---
# --- MOC INFO START ---
if [ "$QT_IM" = "Y" ]; then echo ".... Path of Qt3 moc : ${QT3_MOC_PATH}"; fi
if [ "$QT4_IM" = "Y" ]; then echo ".... Path of Qt4 moc : ${QT4_MOC_PATH}"; fi
if [ "$QT5_IM" = "Y" ]; then echo ".... Path of Qt5 moc : ${QT5_MOC_PATH}"; fi
# --- MOC INFO END ---
if [ "$GTK"=gtk+-3.0 ]; then
GTK_IM='N'
echo -n ".... Testing GTK+ 2.x immodule : "
pkg-config --libs gtk+-2.0 > /dev/null 2> /dev/null
if [ $? = 0 ]; then
GTK_IM='Y'
fi
if [ "$GTK_IM" = "Y" ]; then
if [ "$use_gtk" = "N" ]; then
GTK_IM='N'
echo "Found, but disabled."
else
echo "Found."
fi
else
echo "Not found. It's ok if you don't want GTK+ 2.x immodule."
fi
fi
GTK3_IM='N'
echo -n ".... Testing GTK+ 3.x immodule : "
pkg-config --libs gtk+-3.0 > /dev/null 2> /dev/null
if [ $? = 0 ]; then
GTK3_IM='Y'
fi
if [ "$GTK3_IM" = "Y" ]; then
if [ "$use_gtk3" = "N" ]; then
GTK3_IM='N'
echo "Found, but disabled."
else
echo "Found."
fi
else
echo "Not found. It's ok if you don't want GTK+ 3.x immodule."
fi
[ -f "data/dayi3.cin" ] && INSTALL_DFSG_INCOMPATIBLE=Y
if [ -d .git ]; then
GIT_HAVE='Y'
GIT_HASH=`git log 2> /dev/null | head -n 1 | cut -d ' ' -f 2 | head -c 7`
fi
bindir=$prefix/bin
datadir=$prefix/share
if [ $FREEBSD -eq 0 ]; then
mandir=$datadir/man
else
mandir=$prefix/man
fi
libdir=$prefix/$LIB
includedir=$prefix/include
optdir=/opt
if [ -z "$CFLAGS" ]; then
OPTFLAGS="-Wall"
else
OPTFLAGS="$CFLAGS"
fi
echo "-> CFLAGS = $CFLAGS."
if [ -z "$CC" ]; then
CC=gcc
fi
if [ -z "$CXX" ]; then
CXX=g++
fi
echo "CC=$CC" > config.mak
echo "CCX=$CC" >> config.mak
echo "CXX=$CXX" >> config.mak
echo "CCLD=$CC" >> config.mak
echo "MAKE=$MAKE" >> config.mak
echo "GTK=$GTK" >> config.mak
echo "GTKINC=$GTKINC" >> config.mak
echo "prefix=$prefix" >> config.mak
echo "bindir=\$(DESTDIR)$bindir" >> config.mak
echo "mandir=\$(DESTDIR)$mandir" >> config.mak
echo "man1dir=\$(mandir)/man1" >> config.mak
echo "bindir_r=\$(DESTDIR)$bindir" >> config.mak
echo "datadir=\$(DESTDIR)$datadir" >> config.mak
echo "datadir_r=\$(DESTDIR)$datadir" >> config.mak
echo "filterdir=\$(datadir_r)/hime/filter" >> config.mak
echo "libdir=\$(DESTDIR)$libdir" >> config.mak
echo "himelibdir=\$(libdir)/hime" >> config.mak
echo "includedir=\$(DESTDIR)$includedir" >> config.mak
echo "LDFLAGS_ENV=$LDFLAGS" >> config.mak
echo "LDFLAGS=$LDFLAGS -Wl,--as-needed -lX11 -lm" >> config.mak
echo "CFLAGS=$CFLAGS $CPPFLAGS" >> config.mak
echo "CXXFLAGS=$CXXFLAGS $CPPFLAGS" >> config.mak
if [ $FREEBSD -eq 0 ]; then
echo "LDFLAGS+=$GTKLDFLAGS -lX11 -ldl" >> config.mak
else
echo "LDFLAGS+=$GTKLDFLAGS -lX11" >> config.mak
fi
echo "HIME_TABLE_DIR=\$(datadir_r)/hime/table" >> config.mak
echo "HIME_OGG_DIR=\$(datadir_r)/hime/ogg" >> config.mak
echo "HIME_TABLE_DIR_i=\$(datadir)/hime/table" >> config.mak
echo "HIME_SCRIPT_DIR=\$(datadir_r)/hime/script" >> config.mak
echo "HIME_SCRIPT_DIR_i=\$(datadir)/hime/script" >> config.mak
echo "OPTFLAGS=$OPTFLAGS" >> config.mak
echo "DOC_DIR=\$(datadir_r)/doc/hime" >> config.mak
echo "DOC_DIR_i=\$(datadir)/doc/hime" >> config.mak
echo "HIME_DEFAULT_ICON_DIR=\$(datadir_r)/pixmaps/hime" >> config.mak
echo "SYS_ICON_DIR=\$(datadir_r)/pixmaps" >> config.mak
echo "HIME_DEFAULT_ICON_DIR_i=\$(datadir)/pixmaps/hime" >> config.mak
echo "HIME_BIN_DIR=\$(bindir_r)" >> config.mak
echo "FREEBSD=$FREEBSD" >> config.mak
echo "QT_IM=$QT_IM" >> config.mak
echo "QT_IM_DIR=\$(libdir)$QT_IM_DIR" >> config.mak
echo "QT4_IM=$QT4_IM" >> config.mak
if [ -z "$QT4_IM_DIR_CUSTOM" ]; then
echo "QT4_IM_DIR=`pkg-config --define-variable=prefix=$\(DESTDIR\)/\$\(prefix\) --variable=libdir QtCore`$QT4_IM_DIR" >> config.mak
else
echo "QT4_IM_DIR=\$(DESTDIR)$QT4_IM_DIR_CUSTOM" >> config.mak
fi
echo "QT5_IM=$QT5_IM" >> config.mak
if [ -z "$QT5_IM_DIR_CUSTOM" ]; then
echo "QT5_IM_DIR=`pkg-config --define-variable=prefix=$\(DESTDIR\)/\$\(prefix\) --variable=libdir Qt5Core`$QT5_IM_DIR" >> config.mak
else
echo "QT5_IM_DIR=\$(DESTDIR)$QT5_IM_DIR_CUSTOM" >> config.mak
fi
echo "QT3_MOC_PATH=$QT3_MOC_PATH" >> config.mak
echo "QT4_MOC_PATH=$QT4_MOC_PATH" >> config.mak
echo "QT5_MOC_PATH=$QT5_MOC_PATH" >> config.mak
echo "QT3_QMAKE_PATH=$QT3_MOC_PATH" | sed 's/moc/qmake/' >> config.mak
echo "QT4_QMAKE_PATH=$QT4_MOC_PATH" | sed 's/moc/qmake/' >> config.mak
echo "QT5_QMAKE_PATH=$QT5_MOC_PATH" | sed 's/moc/qmake/' >> config.mak
echo "GTK_IM=$GTK_IM" >> config.mak
echo "GTK3_IM=$GTK3_IM" >> config.mak
echo "USE_XIM=$use_xim" >> config.mak
echo "LIB=$LIB" >> config.mak
echo "MAC_OS=$MAC_OS" >> config.mak
echo "SO_FLAGS=$SO_FLAGS" >> config.mak
echo "USE_TRAY=$use_tray" >> config.mak
echo "USE_I18N=$use_i18n" >> config.mak
echo "USE_TSIN=$use_tsin" >> config.mak
echo "USE_ANTHY=$USE_ANTHY" >> config.mak
echo "ANTHY_INC=$ANTHY_INC" >> config.mak
echo "USE_CHEWING=$USE_CHEWING" >> config.mak
echo "USE_UNITY=$USE_UNITY" >> config.mak
echo "INSTALL_DFSG_INCOMPATIBLE=$INSTALL_DFSG_INCOMPATIBLE" >> config.mak
echo "GIT_HAVE=$GIT_HAVE" >> config.mak
echo "GIT_HASH=$GIT_HASH" >> config.mak
echo "hime_ld_run_path=\$(himelibdir)" >> config.mak
echo "gcc_ld_run_path=-Wl,-rpath,\$(hime_ld_run_path)" >> config.mak