forked from Uninett/fwbuilder
-
Notifications
You must be signed in to change notification settings - Fork 1
/
configure.in
689 lines (565 loc) · 17.7 KB
/
configure.in
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
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
dnl $Id: configure.in,v 1.70 2007/06/07 02:33:53 vkurland Exp $
AC_INIT
AC_CONFIG_SRCDIR([src/gui/main.cpp])
AC_CANONICAL_TARGET
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(src/libfwbuilder/src/fwbuilder/libfwbuilder-config.h)
PACKAGE=fwbuilder
AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [package])
AC_SUBST(PACKAGE)
LT_INIT
AC_CONFIG_MACRO_DIR([m4])
dnl
dnl all version numbers are defined in the file VERSION
dnl
. ./VERSION
RELEASE_NUM=$BUILD_NUM
GENERATION_SHORT=$(echo $GENERATION | sed 's/\.//')
AC_DEFINE_UNQUOTED(BUILD_NUM, "$BUILD_NUM")
AC_SUBST(BUILD_NUM)
AC_SUBST(RELEASE_NUM)
AC_SUBST(FWB_MAJOR_VERSION)
AC_SUBST(FWB_MINOR_VERSION)
AC_SUBST(FWB_MICRO_VERSION)
AC_SUBST(FWB_VERSION)
AC_SUBST(GENERATION)
AC_SUBST(GENERATION_SHORT)
# libfwbuilder versions
dnl AC_SUBST(LIBFWBUILDER_VERSION)
AC_SUBST(FWBUILDER_XML_VERSION)
AC_DEFINE_UNQUOTED(FWBUILDER_XML_VERSION, "$FWBUILDER_XML_VERSION")
echo "Creating VERSION.h file..."
cat <<EOF > VERSION.h
#define VERSION "$VERSION"
#define GENERATION "$GENERATION"
EOF
dnl try to find QT
dnl
AC_ARG_WITH(qtdir,[ --with-qtdir=DIR Specify directory path for QT ])
if test -n "$with_qtdir"; then
AC_MSG_CHECKING(Using QT in )
QTDIR="$with_qtdir";
export QTDIR
AC_MSG_RESULT($QTDIR)
fi
# TODO: do we need to add $QTDIR/bin to PATH to find qmake?
EXTENDED_PATH="/usr/local/bin:$PATH"
AC_ARG_WITH(qmake, [ --with-qmake=qmake Specify the qmake to be used (debian qmake-qt4) ])
if test -n "$with_qmake"; then
AC_PATH_PROG(QMAKE, $with_qmake, ,[$EXTENDED_PATH])
if test -z "$QMAKE"; then
AC_MSG_ERROR("Could not find qmake")
fi
else
AC_PATH_PROG(QMAKE, qmake, ,[$EXTENDED_PATH])
if test -z "$QMAKE"; then
AC_PATH_PROG(QMAKE, qmake-qt4, ,[$EXTENDED_PATH])
if test -z "$QMAKE"; then
AC_MSG_ERROR("Could not find qmake")
fi
fi
fi
AC_MSG_CHECKING(checking version of QT this qmake is part of)
qmake_version=`$QMAKE -v 2>&1 | awk '/Using Qt version/ { print $4;}'`
case $qmake_version in
4.*) AC_MSG_RESULT( $qmake_version ) ;;
5.*) AC_MSG_RESULT( $qmake_version ) ;;
*) AC_MSG_ERROR( "$qmake_version -- v4.x or v5.x is required") ;;
esac
AC_ARG_WITH(templatedir, [ --with-templatedir=DIR Specify directory path for fwbuilder template files ])
AC_ARG_WITH(docdir, [ --with-docdir=DIR Specify directory path for fwbuilder
documentation files ])
AC_ARG_WITH(datadir, [ --with-datadir=DIR Specify directory path for fwbuilder
data files ])
AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),
AC_DEFINE(WORDS_LITTLEENDIAN),
AC_MSG_ERROR(Failed to determine endianness!!))
LIBFWBUILDER_LIBDIR='-L${libdir}'
dnl
dnl Determine init dir and add definition to config.h. Program
dnl determines prefix name of the directory it was started from
dnl and prepends it to the RES_DIR
dnl
PREFIX=$ac_default_prefix
if test "x$prefix" != "xNONE"; then
PREFIX=$prefix
fi
AC_DEFINE_UNQUOTED(PREFIX, "${PREFIX}", [prefix])
AC_SUBST(PREFIX)
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [version])
AC_SUBST(VERSION)
AC_PROG_INSTALL
AC_ISC_POSIX
AC_PROG_CC
dnl AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
dnl need this for intl to compile on FreeBSD and may be other platforms
AC_CHECK_FUNCS(strchr memcpy)
dnl AM_INIT_AUTOMAKE($PACKAGE, $VERSION)
dnl AC_CANONICAL_HOST
AC_PROG_MAKE_SET
dnl Check for GNU make
dnl
AC_MSG_CHECKING(whether make is GNU Make)
if ${MAKE-make} -q --version 2>/dev/null | grep '^GNU Make ' >/dev/null ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
if test "$host_vendor" = "sun" ; then
AC_MSG_ERROR("SUN make does not work for building Firewall Builder. Please install GNU make")
fi
fi
dnl some platform-dependent flags
dnl
dnl e.g. we need to set -I/sw/include before check for GETTEXT
dnl
GUILINKFLAGS=
case "$build_os" in
*solaris*)
GUILINKFLAGS="-export-dynamic"
;;
esac
AC_SUBST(GUILINKFLAGS)
dnl
dnl forkpty is in libutil on Linux and BSD, while on Mac it is in libc
dnl
AC_CHECK_HEADERS( [pty.h libutil.h util.h],[],[],[#include <sys/types.h>])
AC_CHECK_LIB(c,forkpty,[
AC_DEFINE_UNQUOTED(HAVE_FORKPTY, 1, [forkpty])
],[
AC_CHECK_LIB(util,forkpty,[
AC_DEFINE_UNQUOTED(HAVE_FORKPTY, 1, [forkpty])
LIBS="-lutil $LIBS"
],[
AC_MSG_RESULT(["forkpty not found, will use emulation"])
],[])
],[])
AC_CHECK_LIB(c,cfmakeraw,[
AC_DEFINE_UNQUOTED(HAVE_CFMAKERAW, 1, [cfmakeraw])
])
dnl standard LIBTOOL fragment
dnl
dnl commented out 12/20 - we now use qmake and do not need libtool
dnl
dnl AC_LIBTOOL_DLOPEN
dnl AC_PROG_LIBTOOL
dnl AC_SUBST(LIBTOOL_DEPS)
dnl AM_PROG_LIBTOOL
dnl AC_PROG_RANLIB
AC_CHECK_HEADERS([getopt.h])
AC_CHECK_HEADERS([signal.h])
AC_CHECK_HEADERS([endian.h])
AC_CHECK_FUNCS(strtok_r)
AC_CHECK_FUNCS(stat _stat signal)
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_SUBST(LIBS)
AC_LANG([C++])
AM_PATH_CPPUNIT(1.12.0, [HAVE_CPPUNIT="1"])
AC_DEFINE_UNQUOTED(HAVE_CPPUNIT, $HAVE_CPPUNIT)
AC_SUBST(HAVE_CPPUNIT)
AC_SUBST(CPPUNIT_CFLAGS)
AC_SUBST(CPPUNIT_LIBS)
dnl A check for antlr-runtime library used to be here but has been
dnl removed. We should always use antlr runtime code incuded with
dnl fwbuilder code tree because of the fixes I've done in
dnl CurcularQueue.hpp module for 64 bit systems. This problem seems to
dnl have been fixed in antlr v3 but until we convert all grammars to
dnl the new antlr, we have to use provided antlr 2.7.7 with these
dnl fixes. This means we can't use antlr runtime that comes with the
dnl OS even if it is installed.
ANTLR_INCLUDEPATH="`pwd`/src/"
ANTLR_LIBS="`pwd`/src/antlr/libantlr.a"
AC_SUBST(ANTLR_LIBS)
AC_SUBST(ANTLR_INCLUDEPATH)
dnl check for pthreads
dnl
dnl Somehow, standard macro tries -lpthreads, while pthread library really
dnl is "libpthread" on Linux. Thus only test using -pthread suceeds, but
dnl PTHREAD_LIBS macro ends up empty.
ACX_PTHREAD([
test -z "$PTHREAD_LIBS" && test "$PTHREAD_CFLAGS" = "-pthread" && PTHREAD_LIBS="-pthread"
echo "Found pthread library:"
echo "PTHREAD_CFLAGS="$PTHREAD_CFLAGS
echo "PTHREAD_LIBS="$PTHREAD_LIBS
] , [
AC_MSG_ERROR([POSIX threads library not present or not configured])
])
dnl check for XML library
AC_PATH_PROG(XML2_CONFIG, xml2-config, ,[$EXTENDED_PATH])
if test x$XML2_CONFIG = x ; then
AC_MSG_ERROR([libxml2 not present or not configured])
else
XML_CFLAGS="`$XML2_CONFIG --cflags`"
XML_LIBS="`$XML2_CONFIG --libs`"
fi
XML_CFLAGS=`echo $XML_CFLAGS | sed 's/-I\/usr\/include //'`
AC_SUBST(XML_CFLAGS)
AC_SUBST(XML_LIBS)
SAVE_LIBS=${LIBS}
LIBS="$XML_LIBS $LIBS"
AC_CHECK_FUNCS(xmlSaveFormatFileEnc)
LIBS=${SAVE_LIBS}
dnl check for XSLT library
AC_PATH_PROG(XSLT_CONFIG, xslt-config, ,[$EXTENDED_PATH])
if test x$XSLT_CONFIG = x ; then
AC_MSG_ERROR([libxslt not present or not configured])
else
XSLT_CFLAGS="`$XSLT_CONFIG --cflags`"
XSLT_LIBS="`$XSLT_CONFIG --libs`"
fi
XSLT_CFLAGS=`echo $XSLT_CFLAGS | sed 's/-I\/usr\/include //'`
dnl
dnl purely aestetical: xslt-config often reports the same flags as
dnl xml2-config
dnl
ac_xslt_var=""
for w in ${XSLT_CFLAGS}; do
case " ${XML_CFLAGS} " in
*\ $w\ *) ;;
*) ac_xslt_var="$ac_xslt_var $w" ;;
esac
done
XSLT_CFLAGS=$ac_xslt_var
ac_xslt_var=""
for w in ${XSLT_LIBS}; do
case " ${XML_LIBS} " in
*\ $w\ *) ;;
*) ac_xslt_var="$ac_xslt_var $w" ;;
esac
done
XSLT_LIBS=$ac_xslt_var
AC_SUBST(XSLT_CFLAGS)
AC_SUBST(XSLT_LIBS)
dnl libXslt header libxslt/xsltconfig.h only present in newew version of libxslt
dnl for instance it is not part of 1.0.1 but present in 1.0.7.
AC_CHECK_HEADERS(libxslt/xsltconfig.h)
dnl Check for bind specific headers and libraries
dnl if they are present, use them, rather than ones
dnl coming with libc.
AC_CHECK_HEADER(bind/resolv.h, [
CPPFLAGS="$CPPFLAGS -I/usr/include/bind"
HAVE_RESOLV_H=yes
] , [ AC_CHECK_HEADER(/usr/local/bind/include/resolv.h, [
CPPFLAGS="$CPPFLAGS -I/usr/local/bind/include/"
HAVE_RESOLV_H=yes
], [
AC_CHECK_HEADERS([resolv.h], [ HAVE_RESOLV_H=yes ], [], [
#include <sys/types.h>
#include <netinet/in.h>
] )
] )
], [
#include <netinet/in.h>
] )
LIB_RESOLV=""
HAVE_RES_NQUERY=""
AC_SUBST(LIB_RESOLV)
dnl
dnl prepare equivalents of *_CFLAGS variables for qmake
dnl qmake requires these to be without "-I"
dnl
XML_CFLAGS_Q=`echo ${XML_CFLAGS} | sed 's/-I//g'`
XSLT_CFLAGS_Q=`echo ${XSLT_CFLAGS} | sed 's/-I//g'`
PTHREAD_CFLAGS_Q=`echo ${PTHREAD_CFLAGS} | sed 's/-I//g'`
LIBS_Q=`echo ${LIBS} | sed 's/-I//g'`
AC_SUBST(XML_CFLAGS_Q)
AC_SUBST(XSLT_CFLAGS_Q)
AC_SUBST(PTHREAD_CFLAGS_Q)
AC_SUBST(LIBS_Q)
dnl
dnl We also support "--with-ucdsnmp=no" and "--without-ucdsnmp"
dnl By default we assume user wants snmp support, provided script
dnl can find the library
dnl
dnl Just in case we support both --with-ucdsnmp and --with-ucd-snmp
dnl --vk
dnl
check_for_ucdsnmp=yes
if test x$with_ucdsnmp = xno ; then
check_for_ucdsnmp=no
fi
if test x$with_ucd_snmp = xno ; then
check_for_ucdsnmp=no
fi
if test $check_for_ucdsnmp = yes ; then
dnl
dnl net-snmp library includes script net-snmp-config which I use to determine cflags
dnl and libs. Unfortunately even if this script is there and is used flags,
dnl the program may still not link with the library. Currently having this problem on
dnl FreeBSD 4.7 - after upgrade of openssl, code using net-snmp stopped linking. That
dnl is why I still try to do linking test even if script is present.
dnl
dnl Testing for presence of includes and doing linking test assures that -devel
dnl package is indeed installed (primitive test program could link with libsnmp.so
dnl even if -devel package is not installed and headers are not there).
dnl
AC_PATH_PROG(NET_SNMP_CONFIG, net-snmp-config, ,[$EXTENDED_PATH])
if test x$NET_SNMP_CONFIG != x ; then
ac_LIBSNMP_LIBS="`$NET_SNMP_CONFIG --libs`"
ac_LIBSNMP_CFLAGS="`$NET_SNMP_CONFIG --cflags`"
AC_CHECK_LIB(netsnmp, init_snmp,
[
HAVE_LIBSNMP="1"
AC_DEFINE(HAVE_LIBSNMP)
NET_SNMP="1"
AC_DEFINE(NET_SNMP)
LIBSNMP_LIBS=$ac_LIBSNMP_LIBS
LIBSNMP_CFLAGS=$ac_LIBSNMP_CFLAGS
AC_CHECK_LIB(netsnmp, snprint_objid, [
AC_DEFINE(HAVE_SNPRINT_OBJID)
], ,$ac_LIBSNMP_LIBS)
], ,$ac_LIBSNMP_LIBS)
else
AC_CHECK_HEADERS([ucd-snmp/asn1.h], [
AC_CHECK_HEADER(ucd-snmp/snmp.h, [
AC_CHECK_LIBSNMP( snmp )
if test "Z$HAVE_LIBSNMP" != "Z"; then
UCD_SNMP="1"
AC_DEFINE(UCD_SNMP)
save_LIBS=$LIBS
LIBS="$LIBSNMP_LIBS $LIBS"
AC_CHECK_LIB(snmp, snprint_objid, [
AC_DEFINE(HAVE_SNPRINT_OBJID)
])
LIBS=$save_LIBS
fi
], ,[
#include <sys/types.h>
#include <ucd-snmp/asn1.h>
])
])
fi
LIBS="${LIBSNMP_LIBS} ${LIBS}"
fi
AC_SUBST(LIBSNMP_LIBS)
AC_CHECK_LIB(c, inet_net_ntop, [
AC_DEFINE_UNQUOTED(HAVE_INET_NET_NTOP, 1, [inet_net_ntop])
],[
AC_CHECK_LIB(bind, inet_net_ntop, [
AC_DEFINE_UNQUOTED(HAVE_INET_NET_NTOP, 1, [inet_net_ntop])
LIBS="-lbind $LIBS"
])
],[])
AC_CHECK_LIB(z, gzopen, [ LIBS="-lz ${LIBS}"], [
AC_MSG_ERROR([libz library not found])
])
dnl
dnl Determine init dir and add definition to config.h
dnl
PREFIX=$ac_default_prefix
if test "x$prefix" != "xNONE"; then
PREFIX=$prefix
fi
dnl ********************************************************************
if test "x$with_docdir" != "x"; then
DOCDIR="${with_docdir}"
else
DOCDIR="${PREFIX}/share/doc/fwbuilder-${VERSION}"
fi
DOCDIRPATH=`dirname ${DOCDIR}`
if test "x$with_datadir" != "x"; then
DATADIR="${with_datadir}"
else
DATADIR="${PREFIX}/share/"
fi
ICONSDIR=""
dnl do not insert spaces in these macros, even outside of []
AC_PATH_PROG(RCS_FILE_NAME,[rcs],[rcs],[$EXTENDED_PATH])
AC_PATH_PROG(RCSDIFF_FILE_NAME,[rcsdiff],[rcsdiff],[$EXTENDED_PATH])
AC_PATH_PROG(RLOG_FILE_NAME,[rlog],[rlog],[$EXTENDED_PATH])
AC_PATH_PROG(CI_FILE_NAME,[ci],[ci],[$EXTENDED_PATH])
AC_PATH_PROG(CO_FILE_NAME,[co],[co],[$EXTENDED_PATH])
AC_MSG_CHECKING(what OS this is)
case ${host} in
*-*-cygwin*)
OS=cygwin
OS_CYGWIN=1
AC_MSG_RESULT(Win32 cygwin)
DEFAULT_RES_DIR="resources"
;;
*-*-mingw32*)
OS=mingw32
OS_MINGW=1
AC_MSG_RESULT(Win32 mingw)
DEFAULT_RES_DIR="resources"
RCS_FILE_NAME="rcs.exe"
RCSDIFF_FILE_NAME="rcsdiff.exe"
RLOG_FILE_NAME="rlog.exe"
CI_FILE_NAME="ci.exe"
CO_FILE_NAME="co.exe"
;;
*-*-darwin*)
OS=MacOSX
OS_MACOSX=1
MANDIR="${PREFIX}/share/man/"
AC_MSG_RESULT(MacOSX)
DEFAULT_RES_DIR="../Resources"
;;
*-*-solaris*)
OS=Solaris
OS_SOLARIS=1
MANDIR="${PREFIX}/share/man/"
AC_MSG_RESULT(Solaris)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
;;
*-*-freebsd*)
OS=FreeBSD
OS_FREEBSD=1
MANDIR="${PREFIX}/man/"
AC_MSG_RESULT(FreeBSD)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
;;
*-*-openbsd*)
OS=OpenBSD
OS_OPENBSD=1
MANDIR="${PREFIX}/man/"
AC_MSG_RESULT(OpenBSD)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
;;
*-*-kfreebsd*)
OS=FreeBSD
OS_FREEBSD=1
if test -f /etc/debian_version ; then
DISTRO=Debian
else
DISTRO="Unknown"
fi
MANDIR="${PREFIX}/share/man/"
AC_MSG_RESULT($DISTRO GNU/kFreeBSD)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
;;
*-*-linux*)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
OS=Linux
OS_LINUX=1
if test -f /etc/debian_version ; then
DISTRO=Debian
elif test -f /etc/mandrake-release ; then
DISTRO=Mandrake
elif test -f /etc/slackware-version ; then
DISTRO=Slackware
elif test -f /etc/SuSE-release ; then
DISTRO=SuSE
elif test -f /etc/redhat-release ; then
#
# Mandrake has symlink /etc/redhat-release -> /etc/manrake-release ,
# so this check must be the last
#
DISTRO=RedHat
else
DISTRO="Unknown"
fi
MANDIR="${PREFIX}/share/man/"
ICONSDIR="${DATADIR}/icons/hicolor/"
AC_MSG_RESULT($DISTRO Linux)
;;
*)
OS=Unknown
OS_UNKNOWN=1
DISTRO=Unknown
MANDIR="${PREFIX}/share/man/"
AC_MSG_RESULT(Unknown)
DEFAULT_RES_DIR="${PREFIX}/share/fwbuilder-${VERSION}"
;;
esac
if test "x$with_templatedir" != "x"; then
RES_DIR="${with_templatedir}"
else
RES_DIR="$DEFAULT_RES_DIR"
fi
AC_DEFINE_UNQUOTED(RES_DIR, "$RES_DIR", [res_dir])
AC_SUBST(RES_DIR)
AC_DEFINE_UNQUOTED(RCS_FILE_NAME, ["$RCS_FILE_NAME"], [rcs_file_name])
AC_DEFINE_UNQUOTED(RCSDIFF_FILE_NAME, ["$RCSDIFF_FILE_NAME"], [rcsdiff_file_name])
AC_DEFINE_UNQUOTED(RLOG_FILE_NAME, ["$RLOG_FILE_NAME"], [rlog_file_name])
AC_DEFINE_UNQUOTED(CI_FILE_NAME, ["$CI_FILE_NAME"], [ci_file_name])
AC_DEFINE_UNQUOTED(CO_FILE_NAME, ["$CO_FILE_NAME"], [co_file_name])
dnl prefix has bogus value while building RPM. Since program
dnl should incrorporate full path to the templates directory into
dnl the code via config.h file, we need to keep track of
dnl this directory twice: TEMPLATE_DIR is what goes to config.h, while
dnl "install" Makefile targets will use $(prefix) to build install
dnl path
TEMPLATE_DIR=$RES_DIR
AC_DEFINE_UNQUOTED(LIBFWBUILDER_TEMPLATE_DIR, "${TEMPLATE_DIR}")
AC_SUBST(TEMPLATE_DIR)
AC_SUBST(OS)
AC_DEFINE_UNQUOTED(OS, "${OS}", [os])
test -n "$OS_CYGWIN" && AC_DEFINE_UNQUOTED(OS_CYGWIN, "${OS_CYGWIN}", [cygwin])
test -n "$OS_MINGW" && AC_DEFINE_UNQUOTED(OS_MINGW, "${OS_MINGW}", [mingw])
test -n "$OS_MACOSX" && AC_DEFINE_UNQUOTED(OS_MACOSX, "${OS_MACOSX}", [macosx])
test -n "$OS_SOLARIS" && AC_DEFINE_UNQUOTED(OS_SOLARIS,"${OS_SOLARIS}",[solaris])
test -n "$OS_FREEBSD" && AC_DEFINE_UNQUOTED(OS_FREEBSD,"${OS_FREEBSD}",[freebsd])
test -n "$OS_OPENBSD" && AC_DEFINE_UNQUOTED(OS_OPENBSD,"${OS_OPENBSD}",[openbsd])
test -n "$OS_LINUX" && AC_DEFINE_UNQUOTED(OS_LINUX, "${OS_LINUX}", [linux])
test -n "$OS_SECUWALL" && AC_DEFINE_UNQUOTED(OS_SECUWALL, "${OS_SECUWALL}", [secuwall])
test -n "$OS_UNKNOWN" && AC_DEFINE_UNQUOTED(OS_UNKNOWN,"${OS_UNKNOWN}",[unknown])
AC_SUBST(DISTRO)
AC_DEFINE_UNQUOTED(DISTRO, "${DISTRO}", [distro])
AC_SUBST(DOCDIRPATH)
AC_DEFINE_UNQUOTED(DOCDIRPATH, "${DOCDIRPATH}", [docdirpath])
AC_SUBST(DOCDIR)
AC_DEFINE_UNQUOTED(DOCDIR, "${DOCDIR}", [docdir])
AC_SUBST(DATADIR)
AC_SUBST(MANDIR)
AC_SUBST(ICONSDIR)
AC_ARG_WITH(ccache,[ --with-ccache=yes Use ccache to speed up repeated compilation])
if test -n "$with_ccache"; then
if test "x$with_ccache" != "xno"; then
AC_PATH_PROG(CCACHE, ccache, , )
AC_SUBST(CCACHE)
if test -n "$CCACHE"
then
ccache -s
fi
else
CCACHE=""
AC_SUBST(CCACHE)
fi
else
AC_PATH_PROG(CCACHE, ccache, , )
AC_SUBST(CCACHE)
if test -n "$CCACHE"
then
ccache -s
fi
fi
AC_ARG_WITH(distcc,[ --with-distcc=N Use distcc with N parallel make count])
if test -n "$with_distcc"; then
if test "x$with_distcc" != "xno"; then
AC_PATH_PROG(HAVE_DISTCC, distcc, , )
if test -n "$HAVE_DISTCC"; then
DISTCC=$HAVE_DISTCC
AC_SUBST(DISTCC)
PARALLEL_MAKE_COUNT=$with_distcc
AC_SUBST(PARALLEL_MAKE_COUNT)
fi
fi
else
AC_PATH_PROG(HAVE_DISTCC, distcc, , )
if test -n "$HAVE_DISTCC"; then
M_J=$(distcc -j 2>/dev/null)
if test -n "$M_J"; then
DISTCC=$HAVE_DISTCC
AC_SUBST(DISTCC)
PARALLEL_MAKE_COUNT=$M_J
AC_SUBST(PARALLEL_MAKE_COUNT)
fi
fi
fi
AC_CONFIG_FILES([ qmake.inc
src/res/objects_init.xml
src/res/templates.xml
src/libfwbuilder/qmake.inc
src/libfwbuilder/etc/fwbuilder.dtd
packaging/fwbuilder.control
packaging/fwbuilder.spec
packaging/fwbuilder-static-qt.spec
packaging/fwbuilder.nsi])
AC_OUTPUT
# QMAKE=$QMAKE CCACHE=$CCACHE QTDIR=$QTDIR ./runqmake.sh
QMAKE=$QMAKE QTDIR=$QTDIR ./runqmake.sh