-
Notifications
You must be signed in to change notification settings - Fork 2
/
configure.in
859 lines (731 loc) · 26 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
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
#
# Copyright (C) 2001-2006 Intel Corporation
#
# 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.
#
#
# Process this file with autoconf to produce a configure script.
# This is the configure.in file for asim.
AC_INIT([AWB], [3.0a], [joel.emer@intel.com], [awb])
AC_PREREQ(2.59) dnl required autoconf version
AC_CONFIG_SRCDIR([admin/packages/awb])
# Installation defaults
# AC_PREFIX_DEFAULT(/usr/local)
AC_PREFIX_PROGRAM(asimstarter)
AC_CONFIG_AUX_DIR(aux-scripts)
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([1.8.3 foreign subdir-objects]) dnl automake version + options
AM_CONFIG_HEADER(include/config.h)
# prevent casual installer from having to deal with Makefile.in etc.
# getting regenerated; this could happen due to timestamp issues of
# the files coming out of the repository;
AM_MAINTAINER_MODE
#
# Some defines from the ASIM core to be able to include syntax.h
# (This is code is borrowed and Bourne-shellified from Makefile.config)
# (... and its quite ugly ...)
#
HOSTOS=`uname -s`
HOSTMACHINE=`uname -m`
HOSTOSRELEASE=`uname -r`
HOSTOSRELEASE_SUBST=`echo $HOSTOSRELEASE | tr ".)(-" "____"`
#
# get the perl version.
# Needed in FIND_PERLGUI.
# Export it so asimstarter knows which is the good version of perl.
#
PERLVERSION=`perl --version | perl -e 'while (<>) {if (m/This is perl.*v(\d+\.\d+\.\d+)/) {print $1}}'`
config_perl_version=$PERLVERSION
AC_SUBST(config_perl_version)
#
# For ancient versions of Ubuntu default to qt3, otherwise assume qt4
#
if -x /usr/bin/lsb_release -a $(lsb_release -s -i) = "Ubuntu" -a $(lsb_release -s -r | sed 's/\.//') -lt 1110
then
asim_cv_enable_qt4_default="no"
else
asim_cv_enable_qt4_default="yes"
fi
#
# --enable-qt4
#
AC_ARG_ENABLE([qt4],
AC_HELP_STRING([--enable-qt4=ARG],
[use qt4 [[ARG=no|yes]] (default=yes)]),
asim_cv_enable_qt4=$enableval,
asim_cv_enable_qt4=$asim_cv_enable_qt4_default)
if test "$asim_cv_enable_qt4" = "yes"
then
awb_tools_dir_suffix=""
else
awb_tools_dir_suffix="_qt3"
fi
AC_SUBST(awb_tools_dir_suffix)
#
# FIND_QT(<dirs>)
#
AC_DEFUN([FIND_MOC],[
AC_MSG_CHECKING("for Qt moc")
for dir in $1
do
for try in $dir/bin $dir/qt/bin $dir/qt $dir $dir/qt3/bin $dir/qt3
do
if test -f $try/moc
then
QTMOCDIR=$try
QTMOCBIN=moc
AC_MSG_RESULT("found in $QTMOCDIR")
break 2
elif test "$asim_cv_enable_qt4" = "yes"
then
if test -f $try/moc-qt4
then
QTMOCDIR=$try
QTMOCBIN=moc-qt4
AC_MSG_RESULT("found in $QTMOCDIR")
break 2
fi
fi
done
done
])
AC_DEFUN([FIND_UIC],[
AC_MSG_CHECKING("for Qt uic")
for dir in $1
do
for try in $dir/qt/bin $dir/bin $dir/qt $dir $dir/qt3/bin $dir/qt3
do
if test -f $try/uic
then
QTUICDIR=$try
QTUICBIN=uic
AC_MSG_RESULT("found in $QTUICDIR")
break 2
elif test "$asim_cv_enable_qt4" = "yes"
then
if test -f $try/uic-qt4
then
QTUICDIR=$try
QTUICBIN=uic-qt4
AC_MSG_RESULT("found in $QTUICDIR")
break 2
fi
fi
done
done
])
AC_DEFUN([FIND_QT_LIBS],[
if test "$asim_cv_enable_qt4" = "yes"
then
AC_MSG_CHECKING("for Qt 4.x.x libraries")
QTLIBS="QtCore QtGui"
else
AC_MSG_CHECKING("for Qt 3.x.x libraries")
QTLIBS="qt-mt qt"
fi
for dir in $1
do
for try in $dir/qt/lib $dir/lib/qt $dir/lib $dir/qt $dir/qt4/lib $dir/lib/qt4 $dir/qt4 $dir/lib64/qt $dir/lib64 $dir/lib64/qt4 $dir/lib64 $dir/qt4 $dir $dir/qt3/lib $dir/lib/qt3 $dir/qt3
do
for i in $QTLIBS
do
if test -f $try/lib$i.a -o -f $try/lib$i.so -o -f $try/lib$i.so.3
then
QTLIBDIR=$try
QT=$i
AC_MSG_RESULT("found lib$i in $QTLIBDIR")
break 3
fi
done
done
done
])
AC_DEFUN([FIND_QT_INCLUDES],[
if test "$asim_cv_enable_qt4" = "yes"
then
AC_MSG_CHECKING("for Qt 4.x.x include files")
else
AC_MSG_CHECKING("for Qt 3.x.x include files")
fi
for dir in $1
do
for try in $dir/qt/include $dir/include/qt $dir/include $dir/qt $dir $dir/qt3/include $dir/include/qt3 $dir/qt3 $dir/Qt
do
if test -f $try/qwidget.h
then
QTINCDIR=$try
AC_MSG_RESULT("found in $QTINCDIR")
break 2
fi
done
done
])
AC_DEFUN([FIND_QT], [
qt_available=1;
AC_SUBST(QT)
if test "$asim_cv_enable_qt4" = "yes"
then
FIND_MOC($with_qt_moc $with_qt_dir $QTDIR ${prefix}/lib /usr/local/lib /usr/local /usr/lib /usr / /usr/X11R6)
else
FIND_MOC($with_qt_moc $with_qt_dir $QTDIR ${prefix}/lib/qt3 /usr/local/lib /usr/local /usr/lib /usr / /usr/X11R6)
fi
if test "X$QTMOCDIR" = "X"; then
echo ""
echo "Qt's moc not found! If you have installed Qt in an"
echo "unusual place, please use the \"--with-qt-moc=\"" option
echo ""
echo "****************************************************************"
echo "****************************************************************"
echo "You don't have QT Library available in this system. Remember"
echo "you cannot compile libagt, StripChartViewer and 2Dreams"
echo "****************************************************************"
echo "****************************************************************"
echo ""
qt_available=0;
fi
dnl
dnl find uic
dnl
if test "$asim_cv_enable_qt4" = "yes"
then
FIND_UIC($with_qt_uic $with_qt_dir $QTDIR ${prefix}/lib /usr/local/lib /usr/local /usr/lib /usr / /usr/X11R6)
else
FIND_UIC($with_qt_uic $with_qt_dir $QTDIR ${prefix}/lib/qt3 /usr/local/lib /usr/local /usr/lib /usr / /usr/X11R6)
fi
if test "X$QTUICDIR" = "X"; then
echo ""
echo "Qt's uic not found! If you have installed Qt in an"
echo "unusual place, please use the \"--with-qt-uic=\"" option
echo ""
echo "****************************************************************"
echo "****************************************************************"
echo "You don't have QT Library available in this system. Remember"
echo "you cannot compile libagt, StripChartViewer and 2Dreams"
echo "****************************************************************"
echo "****************************************************************"
echo ""
qt_available=0;
fi
dnl
dnl find qt libraries
dnl
if test "$asim_cv_enable_qt4" = "yes"
then
FIND_QT_LIBS($with_qt_libs $with_qt_dir $QTDIR ${prefix} /usr/local /usr /usr/X11R6 /usr/lib/x86_64-linux-gnu/ /usr/lib/i386-linux-gnu/)
else
FIND_QT_LIBS($with_qt_libs $with_qt_dir $QTDIR ${prefix} /usr/local /usr /usr/X11R6 /usr/lib/qt3/lib64 /usr/lib/x86_64-linux-gnu/ /usr/lib/i386-linux-gnu/)
fi
if test "X$QTLIBDIR" = "X"
then
echo ""
echo "Qt libs not found! If you have installed Qt in an"
echo "unusual place, please use the \"--with-qt-libs=\"" option
echo ""
echo "****************************************************************"
echo "****************************************************************"
echo "You don't have QT Library available in this system. Remember"
echo "you cannot compile libagt, StripChartViewer and 2Dreams"
echo "****************************************************************"
echo "****************************************************************"
echo ""
qt_available=0;
else
QTLIBOBJ="-l$QT"
QTLIBDIR="-L$QTLIBDIR"
fi
dnl
dnl find qt headers
dnl
if test "$asim_cv_enable_qt4" = "yes"
then
FIND_QT_INCLUDES($with_qt_includes $with_qt_dir $QTDIR ${prefix}/lib/qt /usr/lib/qt4 /usr/local/qt /usr/lib/qt /usr/include /usr/include/qt /usr/include/qt4 /usr/local/include /usr/X11R6/include/qt4)
else
FIND_QT_INCLUDES($with_qt_includes $with_qt_dir $QTDIR ${prefix}/lib/qt /usr/lib/qt3 /usr/local/qt /usr/lib/qt /usr/include /usr/include/qt /usr/include/qt3 /usr/local/include /usr/X11R6/include/qt3)
fi
if test "X$QTINCDIR" = "X"
then
echo ""
echo "Qt headers not found! If you have installed Qt in an"
echo "unusual place, please use the \"--with-qt-includes=\"" option
echo ""
echo "****************************************************************"
echo "****************************************************************"
echo "You don't have QT Library available in this system. Remember"
echo "you cannot compile libagt, StripChartViewer and 2Dreams"
echo "****************************************************************"
echo "****************************************************************"
echo ""
qt_available=0;
else
QTINCDIR="-I$QTINCDIR"
fi
])
AC_DEFUN([FIND_GUI], [
AC_PATH_XTRA
FIND_QT
if test $qt_available = 1
then
AC_SUBST(QTINCDIR)
AC_SUBST(QTLIBDIR)
AC_SUBST(QTLIBOBJ)
AC_SUBST(QTUICDIR)
AC_SUBST(QTUICBIN)
AC_SUBST(QTMOCDIR)
AC_SUBST(QTMOCBIN)
dnl Configuring AGT defines
case $HOSTMACHINE in
alpha*)
X_EXTRA_LIBS="-lXext -lX11" ;;
i?86*)
X_EXTRA_LIBS="-ldl -lGL -lXext -lX11 -lXinerama -lXrender" ;;
ia64*)
X_EXTRA_LIBS="-ldl -lGL -lXext -lX11 -lXinerama -lXrender" ;;
x86_64*)
X_EXTRA_LIBS="-ldl -lGL -lXext -lX11 -lXinerama -lXrender" ;;
*)
echo "This architecture is not supported" ;
exit ;;
esac
AC_SUBST(X_EXTRA_LIBS)
fi
])
#
# FIND_PERLGUI(<dirs>)
#
# Get the perl system library location, where Qt.so is to be found.
# We should really try to extract this from INSTALLSITELIB in libperl/Asim/Makefile,
# but for now it's hardwired here, as a function of the Linux and Perl versions.
#
AC_DEFUN([FIND_PERLGUI], [
AC_PATH_XTRA
AC_MSG_CHECKING(for PerlQt)
perlprefixes="$prefix /usr"
perllibs="lib/perl5 lib/perl5/site_perl/$PERLVERSION lib/site_perl lib64/perl5 lib64/perl5/site_perl/$PERLVERSION lib64/site_perl lib32/site_perl/$PERLVERSION lib32/site_perl"
perlarch="/ i386-linux-thread-multi i686-linux"
if test "$asim_cv_enable_qt4" = "yes"
then
PERLQTMODULES="QtCore4 QtGui4"
else
PERLQTMODULES="Qt"
fi
for p in $perlprefixes
do
for d in $perllibs
do
for a in $perlarch
do
for i in $PERLQTMODULES
do
if test -f $p/$d/$a/$i.pm
then
AC_MSG_RESULT(found in $p/$d)
perlqt_search_path=$p/$d
break 2
fi
done
done
done
done
if test "X$perlqt_search_path" = "X"
then
echo ""
echo "****************************************************************"
echo "PerlQt not found!"
echo "****************************************************************"
echo ""
fi
AC_SUBST(perlqt_search_path)
])
##
## with arguments
##
AC_ARG_WITH(qt-dir, [ --with-qt-dir=DIR qt-dir in DIR])
AC_ARG_WITH(qt-moc, [ --with-qt-moc=DIR qt-moc in DIR])
AC_ARG_WITH(qt-uic, [ --with-qt-uic=DIR qt-uic in DIR])
AC_ARG_WITH(qt-includes, [ --with-qt-includes=DIR qt-includes in DIR])
AC_ARG_WITH(qt-libs, [ --with-qt-libs=DIR qt-libs in DIR])
AC_ARG_WITH(stlport-dir, [ --with-stlport-dir=DIR stlport-dir in DIR])
#
# Control perl install
#
AC_ARG_ENABLE([perl-vendor-install],
AC_HELP_STRING([--enable-perl-vendor-install],
[Do a perl vendor install]),
perlinstalldirs=vendor,
perlinstalldirs=site)
##
## compile switches
##
#
# --enable-warning
#
AC_ARG_ENABLE([warning],
AC_HELP_STRING([--enable-warning=ARG],
[warning level [[ARG=no|warn|error]] (default=error)]),
asim_cv_enable_warning=$enableval,
asim_cv_enable_warning=warn)
AC_CACHE_CHECK([which warning level to use],
asim_cv_enable_warning,
asim_cv_enable_warning=warn)
if test $asim_cv_enable_warning = yes; then
asim_cv_enable_warning=warn
fi
if test $asim_cv_enable_warning = no; then
WARNFLAGS="-Wformat"
fi
if test $asim_cv_enable_warning = warn -o $asim_cv_enable_warning = error; then
WARNFLAGS="-Wall -W -Wshadow -Wcast-align -Wcast-qual -Wold-style-cast -Wredundant-decls -Wnon-virtual-dtor -ansi"
fi
if test $asim_cv_enable_warning = error; then
WARNFLAGS="${WARNFLAGS} -Werror"
fi
AC_SUBST(WARNFLAGS)
#
# --enable-optimize
#
AC_ARG_ENABLE([optimize],
AC_HELP_STRING([--enable-optimize=ARG],
[optimizations [[ARG=no|yes|high]] (default=yes)]),
asim_cv_enable_optimize=$enableval,
asim_cv_enable_optimize=yes)
AC_CACHE_CHECK([if optimizations should be used] ,
asim_cv_enable_optimize,
asim_cv_enable_optimize=yes)
if test $asim_cv_enable_optimize = no; then
OPTFLAGS="-g -O0 -fno-inline -DQT_DEBUG -DQT_FATAL_ASSERT"
fi
if test $asim_cv_enable_optimize = yes; then
OPTFLAGS="-g -O2 -DQT_DEBUG -DQT_FATAL_ASSERT"
fi
if test $asim_cv_enable_optimize = high; then
OPTFLAGS="-g -O3 -finline-limit=1200 -funroll-loops -fexpensive-optimizations -frerun-loop-opt -DQT_NO_DEBUG -DQT_NO_CHECK"
fi
AC_SUBST(OPTFLAGS)
#
# --enable-distcc
#
AC_ARG_ENABLE([distcc],
AC_HELP_STRING([--enable-distcc=ARG],
[use distcc compiler [[ARG=no|yes]] (default=no)]),
asim_cv_enable_distcc=$enableval,
asim_cv_enable_distcc=no)
AC_CACHE_CHECK([if distcc compiler should be used] ,
asim_cv_enable_distcc,
asim_cv_enable_distcc=no)
#
# --enable-64bit
#
# on x86_64, enable or disable compiling for the 64-bit architecture.
# The default is to enable 64-bit binary builds.
#
ARCHFLAGS=
case $HOSTMACHINE in
x86_64*)
AC_MSG_CHECKING(whether to build 64-bit binaries)
AC_ARG_ENABLE( 64bit, [Enable compiling for 64-bit x86 architecture], [
# if user explicitly used this switch:
case $enableval in
no | 0 | off | false | FALSE)
AC_MSG_RESULT(Disabled: building 32-bit binaries)
ARCHFLAGS=-m32 ;;
yes | 1 | on | true | TRUE)
AC_MSG_RESULT(yes) ;;
*)
AC_MSG_ERROR(Unknown argument to --enable-64bit option: $enableval)
exit ;;
esac
],[
# switch not used, default to "enabled"
AC_MSG_RESULT(yes)
])
;;
esac
AC_SUBST(ARCHFLAGS)
#
# Check if they have defined the STLPort directory
#
if test -z $with_stlport_dir; then
STLPORTINC=""
else
AC_MSG_CHECKING("for STLPort")
if test ! -d $with_stlport_dir; then
AC_MSG_ERROR(STLPort not found at $with_stlport_dir)
fi
STLPORTINC="-I$with_stlport_dir/stlport"
AC_MSG_RESULT(Using STLPort at $with_stlport_dir)
fi
AC_SUBST(STLPORTINC)
# pull all flags together
AM_CXXFLAGS='$(WARNFLAGS) $(PTVFLAGS) $(OPTFLAGS) $(ARCHFLAGS) $(ASIMCOREFLAGS) $(ASIMCOREINCS)'
AM_LDFLAGS='$(ARCHFLAGS) $(ASIMCORELIBS)'
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_LDFLAGS)
# This is the asim package name
AC_SUBST(package)
package=awb
# This is the release tag out of the package file.
# The tag is assumed to be in a line that looks like: Tag=<tagname>
AC_SUBST(release)
release=`grep '^Tag=' ./admin/packages/$package | sed 's/Tag=//'`
# This is the directory for default workspace
# Note: name is a misnomer that needs to be changed everywhere
configdir='${datadir}/asim/ws/${release}'
AC_SUBST(configdir)
# This is where architecture independent info is placed
packagedir='${datadir}/asim/packages'
AC_SUBST(packagedir)
# This is where a copy of the package is placed
codedir='${packagedir}/${package}/${release}'
AC_SUBST(codedir)
# This is where architecture dependent info is placed
#tooldir='${libexecdir}/asim/${release}'
# For now we always treat the release for tools as HEAD
tooldir='${libexecdir}/asim/HEAD'
AC_SUBST(tooldir)
# directory to install html doxygen documentation
htmldir='${docdir}/html'
AC_SUBST(htmldir)
# Checks for programs.
if test x${CXXFLAGS+set} = x; then
dnl prevent AC_PROG_CXX from setting CXXFLAGS to -O -g flags
CXXFLAGS=""
fi
# check if we should use distcc or not
if test $asim_cv_enable_distcc = "yes"; then
distcc="distcc gcc"
distcxx="distcc g++"
else
distcc=""
fi
AC_PROG_CC("$distcc" gcc cc)
AC_PROG_CXX("$distcxx" g++ cxx)
AC_PROG_LN_S
AC_PROG_INSTALL
AC_PROG_MAKE_SET
# tools for building libraries
LT_INIT
AC_DISABLE_SHARED
AC_PROG_LIBTOOL
# Check for perl version
AC_MSG_CHECKING(for a perl version >= 5.6)
perlok=`perl -e 'if ("$]" >= 5.006) { print "yes\n";} else {print "no\n"}'`
if test "$perlok" = "yes" ; then
AC_MSG_RESULT(yes)
else
AC_MSG_ERROR(Wrong perl version - need at least version 5.6)
fi
# Check for perl packages
# TBD
# Check for tcl version
# TBD
# Handle gui-based stuff
AC_ARG_ENABLE([gui],
AC_HELP_STRING([--enable-gui=ARG],
[build qt gui-based programs [[ARG=no|yes]] (default=yes)]),
asim_cv_enable_gui=$enableval,
asim_cv_enable_gui=yes)
if test "$asim_cv_enable_gui" = "yes"
then
NO_GUI=''
FIND_GUI()
else
NO_GUI='#'
qt_available=0
fi
AC_SUBST(NO_GUI)
# Handle perlgui-based stuff
AC_ARG_ENABLE([perlgui],
AC_HELP_STRING([--enable-perlgui=ARG],
[build perlgui-based programs [[ARG=no|yes]] (default=same as --enable-gui)]),
asim_cv_enable_perlgui=$enableval,
asim_cv_enable_perlgui=$asim_cv_enable_gui)
case $HOSTMACHINE in
i?64*)
asim_cv_enable_perlgui="no"
esac
if test "$asim_cv_enable_perlgui" = "yes"
then
NO_PERLGUI=''
FIND_PERLGUI()
else
NO_PERLGUI='#'
fi
AC_SUBST(NO_PERLGUI)
# Define LINK...
LINK="ar -r"
AC_SUBST(LINK)
#
# some glob libraries do not support tilde and brace expansion
#
AC_MSG_CHECKING(for define of GLOB_TILDE)
AC_TRY_COMPILE(
[#include <glob.h>],
[int foo = GLOB_TILDE;],
have_glob_brace=1,
have_glob_brace=0
)
if test $have_glob_brace = 1 ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN(No ~ substitution available for filename paths)
AC_DEFINE(GLOB_TILDE, 0,
[stub out GLOB_TILDE if not defined by system headers])
fi
AC_MSG_CHECKING(for define of GLOB_BRACE)
AC_TRY_COMPILE(
[#include <glob.h>],
[int foo = GLOB_BRACE;],
have_glob_brace=1,
have_glob_brace=0
)
if test $have_glob_brace = 1 ; then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
AC_MSG_WARN(No {} substitution available for filename paths)
AC_DEFINE(GLOB_BRACE, 0,
[stub out GLOB_BRACE if not defined by system headers])
fi
# set various other OS- and machine-dependent compiler args for Asim
if test $HOSTOS = "OSF1" ; then
AC_DEFINE(HOST_DUNIX, 1,
[system is DigitalUnix Alpha])
if test $GNU != 1 ; then
ASIMCORELIBS="-L/proj/vssad/local/alpha/lib -ltcl -lX11 -lrt -lm -lmld -lbfd -liberty_gcoff -lst -lmld -lexc -lintl"
# cxx on Tru64 needs this to compile standard iostream right
ASIMCOREFLAGS="-DHOST_DUNIX -D__USE_STD_IOSTREAM -DHASH_NAMESPACE=std -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES"
ASIMCOREINCS="-I/usr/local/include"
AC_DEFINE(__USE_STD_IOSTREAM, 1,
[convince DigitalUnix CXX to follow C++ IOstream standard])
AC_DEFINE(HASH_NAMESPACE, std,
[Hash namespace in DigitalUnix CXX is std])
else
AC_DEFINE(HASH_NAMESPACE, __gnu_cxx, [Hash namespace in GNU CXX is __gnu_cxx])
ASIMCORELIBS="-L/proj/vssad/local/alpha/lib -ltcl -lX11 -lrt -lm -lmld -lbfd -liberty -lst -lmld -lexc -lintl"
ASIMCOREINCS="-idirafter /usr/local/include"
ASIMCOREFLAGS="-DHOST_DUNIX -DHASH_NAMESPACE=__gnu_cxx -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES"
fi
AC_SUBST(ASIMCOREFLAGS)
AC_SUBST(ASIMCORELIBS)
AC_SUBST(ASIMCOREINCS)
else
if test $HOSTOS = "FreeBSD" ; then
case $HOSTMACHINE in
i?86)
ASIMCOREFLAGS="-DHOST_FREEBSD_X86 -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES" ;
AC_DEFINE(HOST_FREEBSD_X86, 1, [system is FreeBSD x86]) ;;
*)
ASIMCOREFLAGS="-DHOST_FREEBSD -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES" ;
AC_DEFINE(HOST_FREEBSD, 1, [system is FreeBSD (other)]) ;;
esac
ASIMCORELIBS="-L/usr/local/lib -L/usr/X11R6/lib -ltcl -lX11 -lm" ;
ASIMCOREINCS="-L/usr/local/lib -L/usr/X11R6/lib -ltcl -lX11 -lm" ;
else
AC_DEFINE(HOST_LINUX, 1, [system is Linux])
AC_DEFINE(HASH_NAMESPACE, __gnu_cxx, [Hash namespace in GNU CXX is __gnu_cxx])
case $HOSTMACHINE in
i?86*)
ASIMCOREFLAGS="-DHOST_LINUX_X86 -DLINUX_$HOSTOSRELEASE_SUBST -D__STDC_LIMIT_MACROS -DHASH_NAMESPACE=__gnu_cxx -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES" ;
ASIMCORELIBS="-L/usr/X11R6/lib -lX11 -ldl -lm"
ASIMCOREINCS="-idirafter /usr/local/include" ;
AC_DEFINE(HOST_LINUX_X86, 1, [system is Linux x86]) ;;
x86_64*)
ASIMCOREFLAGS="-DHOST_LINUX_X86 -DLINUX_$HOSTOSRELEASE_SUBST -D__STDC_LIMIT_MACROS -DHASH_NAMESPACE=__gnu_cxx -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES" ;
ASIMCORELIBS="-L/usr/X11R6/lib64 -lX11 -ldl -lm"
ASIMCOREINCS="-idirafter /usr/local/include" ;
AC_DEFINE(HOST_LINUX_X86, 1, [system is Linux x86-64]) ;;
ia64*)
ASIMCOREFLAGS="-DHOST_LINUX_IA64 -DLINUX_$HOSTOSRELEASE_SUBST -DHASH_NAMESPACE=__gnu_cxx -DQT_CLEAN_NAMESPACE -DQT_NO_STL -DQ_STRICT_INLINING_RULES" ;
ASIMCORELIBS="-L/usr/X11R6/lib -lX11 -ldl -lm" ;
ASIMCOREINCS="-idirafter /usr/local/include" ;
AC_DEFINE(HOST_LINUX_IA64, 1, [system is Linux IA64]) ;;
esac
fi
AC_SUBST(ASIMCOREFLAGS)
AC_SUBST(ASIMCORELIBS)
AC_SUBST(ASIMCOREINCS)
fi
#
# libtool on SUSE x86_64 installations does not look for -lpopt in the right place,
# so we define this conditional, used in the makefiles for awb-resolver, amc, and dbtest,
# which forces an explicit link command not using libtool
#
AM_CONDITIONAL(X86_64_LIBTOOL_HACK, test x$SYSTOKEN = xx86_64_linux26)
# Checks for libraries.
AC_CHECK_LIB(popt, poptGetContext)
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_MODE_T
AC_TYPE_SIZE_T
AC_TYPE_SIGNAL
AC_STRUCT_TM
# Checks for library functions.
AC_CHECK_FUNCS(getcwd mkdir regcomp rmdir strdup strerror strtol strtoul)
# setup all files that need to be generated
# top level
AC_CONFIG_FILES(Makefile)
# etc
AC_CONFIG_FILES(share/awb.config.template)
# lib top level
AC_CONFIG_FILES(lib/Makefile)
# lib/libawb
AC_CONFIG_FILES(lib/libawb/Makefile)
# libperl
AC_CONFIG_FILES(libperl/Makefile)
AC_CONFIG_FILES(libperl/Asim/lib/Asim.pm)
# run perl MakeMaker at configure time, not make time,
# to create the makefiles in the libperl tree:
AC_CONFIG_COMMANDS( libperl/Asim/Makefile ,
[cd libperl/Asim; perl Makefile.PL INSTALL_BASE=$prefix INSTALLDIRS=$perlinstalldirs; cd ../..],
[prefix=$prefix; perlinstalldirs=$perlinstalldirs ])
AC_CONFIG_COMMANDS( libperl/AsimShell/Makefile ,
[cd libperl/AsimShell; perl Makefile.PL INSTALL_BASE=$prefix INSTALLDIRS=$perlinstalldirs; cd ../..],
[prefix=$prefix; perlinstalldirs=$perlinstalldirs ])
AC_CONFIG_COMMANDS( libperl/Benchmarks/Makefile ,
[cd libperl/Benchmarks; perl Makefile.PL INSTALL_BASE=$prefix INSTALLDIRS=$perlinstalldirs; cd ../..],
[prefix=$prefix; perlinstalldirs=$perlinstalldirs ])
AC_CONFIG_COMMANDS( libperl/PinPoints/Makefile ,
[cd libperl/PinPoints; perl Makefile.PL INSTALL_BASE=$prefix INSTALLDIRS=$perlinstalldirs; cd ../..],
[prefix=$prefix; perlinstalldirs=$perlinstalldirs ])
AC_CONFIG_COMMANDS( libperl/PlotShell/Makefile ,
[cd libperl/PlotShell; perl Makefile.PL INSTALL_BASE=$prefix INSTALLDIRS=$perlinstalldirs; cd ../..],
[prefix=$prefix; perlinstalldirs=$perlinstalldirs ])
# tools top level
AC_CONFIG_FILES(tools/Makefile)
# tools/scripts
AC_CONFIG_FILES(tools/scripts/Makefile)
AC_CONFIG_FILES(tools/scripts/asimstarter, [chmod +x tools/scripts/asimstarter])
AC_CONFIG_FILES(tools/scripts/awb-pkg-config, [chmod +x tools/scripts/awb-pkg-config])
AM_CONDITIONAL([QT4_BUILD], [test "$asim_cv_enable_qt4" = yes])
# tools/awb
AC_CONFIG_FILES(tools/awb/Makefile)
AC_CONFIG_FILES(tools/awb/awb/Makefile)
AC_CONFIG_FILES(tools/awb/awb-resolver/Makefile)
AC_CONFIG_FILES(tools/awb/amc/Makefile)
AC_CONFIG_FILES(tools/awb/apm-edit/Makefile)
AC_CONFIG_FILES(tools/awb/apm-find-replace/Makefile)
AC_CONFIG_FILES(tools/awb/awb-wizard/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/amc/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/awb-resolver/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/awb2/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/apm-edit/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/apm-find-replace/Makefile)
AC_CONFIG_FILES(tools/awb_qt3/awb-wizard/Makefile)
# now generate all files
AC_OUTPUT