-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.in
2415 lines (2090 loc) · 59.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
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
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#
# MICO --- an Open Source CORBA implementation
# Copyright (c) 1997-2019 by The Mico Team
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library 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
# Library General Public License for more details.
#
# You should have received a copy of the GNU Library General Public
# License along with this library; if not, write to the Free
# Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# For more information, visit the MICO Home Page at
# http://www.mico.org/
#
# Process this file with autoconf to produce a configure script.
AC_INIT(idl/scanner.ll)
#
# arguments
#
AC_ARG_ENABLE(ccm,
[ --enable-ccm build CCM-specific parts],
use_ccm=$enableval, use_ccm=no)
AC_ARG_ENABLE(messaging,
[ --disable-messaging disable CORBA messaging specific parts],
use_messaging=$enableval, use_messaging=yes)
AC_ARG_ENABLE(coss,
[ --disable-coss, do not use MICO COSS],
use_coss=$enableval, use_coss=yes)
AC_ARG_ENABLE(csl2,
[ --enable-csl2 enable CORBASec Level 2],
use_csl2=$enableval, use_csl2=no)
AC_ARG_ENABLE(csiv2,
[ --disable-csiv2 disable CSIv2],
use_csiv2=$enableval, use_csiv2=yes)
AC_ARG_ENABLE(sl3,
[ --disable-sl3 disable SL3],
use_sl3=$enableval, use_sl3=yes)
AC_ARG_ENABLE(naming,
[ --disable-naming, do not use MICO Naming Service],
use_naming=$enableval, use_naming=$use_coss)
AC_ARG_ENABLE(relship,
[ --enable-relship, enable MICO Relationship Service],
use_relship=$enableval, use_relship=no)
AC_ARG_ENABLE(events,
[ --disable-events, do not use MICO Event Service],
use_events=$enableval, use_events=$use_coss)
AC_ARG_ENABLE(streams,
[ --enable-streams, use MICO Stream Service],
use_streams=$enableval, use_streams=no)
AC_ARG_ENABLE(property,
[ --disable-property, do not use MICO Property Service],
use_property=$enableval, use_property=$use_coss)
AC_ARG_ENABLE(trader,
[ --enable-trader, use MICO Trading Service],
use_trader=$enableval, use_trader=no)
AC_ARG_ENABLE(time,
[ --disable-time, do not use MICO Time Service],
use_time=$enableval, use_time=$use_coss)
AC_ARG_ENABLE(life,
[ --enable-life, use MICO Life Cycle Service],
use_life=$enableval, use_life=no)
AC_ARG_ENABLE(externalize,
[ --enable-externalize, use MICO Externalization Service],
use_extern=$enableval, use_extern=no)
AC_ARG_ENABLE(wireless,
[ --enable-wireless include full Wireless CORBA support],
use_wireless=$enableval, use_wireless=no)
AC_ARG_ENABLE(wireless-home,
[ --enable-wireless-home compile Home Location Agent for wCORBA],
use_wireless_home=$enableval, use_wireless_home=$use_wireless)
AC_ARG_ENABLE(wireless-terminal,
[ --enable-wireless-terminal Wireless CORBA for terminals],
use_wireless_terminal=$enableval, use_wireless_terminal=$use_wireless)
AC_ARG_ENABLE(wireless-access,
[ --enable-wireless-access Wireless CORBA Access Bridge],
use_wireless_access=$enableval, use_wireless_access=$use_wireless)
AC_ARG_ENABLE(mini-stl,
[ --enable-mini-stl use MICO-supplied STL],
use_mini_stl=$enableval, use_mini_stl=no)
AC_ARG_ENABLE(repo,
[ --enable-repo use gcc's template repository],
use_repo=$enableval, use_repo=no)
AC_ARG_ENABLE(optimize,
[ --disable-optimize do not use -O2 to compile],
use_opt=$enableval, use_opt=yes)
AC_ARG_ENABLE(debug,
[ --enable-debug use -g to compile],
use_debug=$enableval, use_debug=no)
AC_ARG_ENABLE(shared,
[ --disable-shared don't build shared libs],
use_shared=$enableval, use_shared=yes)
AC_ARG_ENABLE(static,
[ --disable-static don't build static libs],
use_static=$enableval, use_static=yes)
AC_ARG_ENABLE(dynamic,
[ --disable-dynamic disable dynamic loading],
use_dynamic=$enableval, use_dynamic=yes)
AC_ARG_ENABLE(final,
[ --enable-final build size optimized lib (needs lots of memory)],
use_final=$enableval, use_final=no)
AC_ARG_ENABLE(except,
[ --disable-except disable exception handling],
use_except=$enableval, use_except=yes)
AC_ARG_ENABLE(std-eh,
[ --disable-std-eh disable CORBA compliant exception handling],
use_std_eh=$enableval, use_std_eh=yes)
AC_ARG_ENABLE(cd,
[ --enable-cd disable use of fancy libs etc],
use_cd=$enableval, use_cd=no)
AC_ARG_WITH(qt,
[ --with-qt=qtdir use QT installed in qtdir],
QTDIR=$withval, QTDIR="")
AC_ARG_WITH(gtk,
[ --with-gtk=gtkdir use GTK installed in gtkdir],
GTKDIR=$withval, GTKDIR="")
AC_ARG_WITH(tcl,
[ --with-tcl=tcldir use TCL installed in tcldir],
TCLDIR=$withval, TCLDIR="")
AC_ARG_WITH(ssl,
[ --with-ssl=ssldir use SSL/TLS installed in ssldir],
SSLDIR=$withval, SSLDIR="")
AC_ARG_WITH(bluetooth,
[ --with-bluetooth=btdir use Bluetooth installed in btdir],
BTDIR=$withval, BTDIR="")
AC_ARG_WITH(extra-dir,
[ --with-extra-dir=dir add dir(s) into extra dirs],
EXTRADIR="$withval", EXTRADIR="")
AC_ARG_WITH(pgsql,
[ --with-pgsql=pgsqldir use PostgreSQL installed in pgsqldir],
PGSQLDIR=$withval, PGSQLDIR="")
AC_ARG_WITH(mico,
[ --with-mico=micodir use MICO installed in micodir (suitable for cross-compiling)],
MICODIR=$withval, MICODIR="")
AC_ARG_WITH(snacc,
[ --with-snacc=snaccdir use SNACC installed in snaccdir (needed for SL3 AC support)],
SNACCDIR=$withval, SNACCDIR="")
AC_ARG_WITH(smp,
[ --with-smp=smpdir use SMP library installed in smpdir (needed for SL3 AC support)],
SMPDIR=$withval, SMPDIR="")
AC_ARG_ENABLE(split,
[ --disable-split dont split large source files],
use_split=$enableval, use_split=yes)
AC_ARG_ENABLE(orb-excepts,
[ --disable-orb-excepts build libmico without exception support],
use_orb_excepts=$enableval, use_orb_excepts=yes)
AC_ARG_ENABLE(memcheck,
[ --enable-memcheck for debugging MICO memory management],
use_memcheck=$enableval, use_memcheck=no)
AC_ARG_ENABLE(compiled-headers,
[ --enable-compiled-headers use precompiled headers if supported],
use_compiled_headers=$enableval, use_compiled_headers=no)
AC_ARG_ENABLE(speed-tune,
[ --enable-speed-tune compile MICO for maximum peformance],
use_speed_tune=$enableval, use_speed_tune=no)
AC_ARG_ENABLE(threads,
[ --disable-threads compile single-threaded MICO],
use_threads=$enableval, use_threads=yes)
AC_ARG_ENABLE(minimum-corba,
[ --enable-minimum-corba build minimum ORB only],
minimum_corba=$enableval, minimum_corba=no)
AC_ARG_ENABLE(orb-core-only,
[ --enable-orb-core-only build only ORB core w/o IDL/IR and other libraries],
orb_core_only=$enableval, orb_core_only=no)
AC_ARG_ENABLE(threading-policies,
[ --disable-threading-policies do not build Threading Policies],
threading_policies=$enableval, threading_policies=yes)
AC_ARG_ENABLE(umem,
[ --disable-umem do not build against libumem if it is available],
umem=$enableval, umem=yes)
AC_ARG_ENABLE(tcmalloc,
[ --disable-tcmalloc do not build against libtcmalloc_minimal if it is available],
tcmalloc=$enableval, tcmalloc=yes)
AC_SUBST(HAVE_MINGW)
AC_SUBST(HAVE_CYGWIN)
AC_SUBST(HAVE_MEMCHECK)
HAVE_MEMCHECK=$use_memcheck
AC_SUBST(USE_MEMTRACE)
USE_MEMTRACE=no
AC_SUBST(HAVE_FINAL)
HAVE_FINAL=$use_final
AC_SUBST(HAVE_MINIMUM_CORBA)
HAVE_MINIMUM_CORBA=$minimum_corba
AC_SUBST(ORB_CORE_ONLY)
ORB_CORE_ONLY=$orb_core_only
if test X"$use_speed_tune" = Xyes; then
use_orb_excepts=no
fi
if test X"$use_wireless_access" = Xyes -o X"$use_wireless_terminal" = Xyes -o X"$use_wireless_home" = Xyes; then
use_wireless=yes
fi
# Bomb out as soon as possible
if test X"$use_wireless" = Xyes -a X"$use_threads" = Xyes; then
echo ""
AC_MSG_ERROR([The current Wireless CORBA implementation is incompatible with multi-threading, do not use --enable-threads if Wireless CORBA is needed])
fi
# doesnt work at the moment
#if test X"$use_split" = Xyes; then
# AC_DEFINE(HAVE_SIZE_LIMIT)
#fi
#
# extra dirs
#
wi_EXTRA_DIRS(no, $EXTRADIR $QTDIR $GTKDIR $TCLDIR $SSLDIR $PGSQLDIR $SNACCDIR $SMPDIR)
#
# misc
#
AC_CONFIG_AUX_DIR($srcdir/admin)
AC_CANONICAL_SYSTEM
AC_SUBST(ABSSRCDIR)
case $srcdir in
/*)
ABSSRCDIR=$srcdir
;;
*)
ABSSRCDIR=`pwd`/$srcdir
;;
esac
myprefix=$prefix
myexec=$exec_prefix
test "x$myprefix" = xNONE && myprefix=$ac_default_prefix
test "x$myexec" = xNONE && myexec=${myprefix}
ABSEXECDIR=$myexec
ABSSHRDDIR=$myprefix
AC_DEFINE_UNQUOTED(ABSEXECDIR, "$myexec")
AC_DEFINE_UNQUOTED(ABSSHRDDIR, "$myprefix")
AC_SUBST(ABSEXECDIR)
AC_SUBST(ABSSHRDDIR)
if test X"$use_csl2" != Xno; then
AC_DEFINE(USE_CSL2)
fi
#if test X"$use_csiv2" != Xno; then
# AC_DEFINE(USE_CSIV2)
#fi
if test X"$use_wireless" != Xno; then
AC_DEFINE(USE_WIRELESS)
fi
AC_SUBST(STLINC)
if test X"$use_mini_stl" != Xno; then
AC_DEFINE(HAVE_MINI_STL)
#
# hack for Cygnus CDK: replace //E/... by E:/...
# since CDK's gcc does not understand -I//E/...
#
changequote(<<, >>)
CDK_ABSSRCDIR=`echo $ABSSRCDIR | sed -e 's,^//\([a-zA-Z]\),\1:,g'`
changequote([, ])
STLINC=-I$CDK_ABSSRCDIR/include/ministl
fi
AC_SUBST(REPOFLAG)
AC_SUBST(HAVE_REPO)
HAVE_REPO=no
if test X"$use_repo" != Xno; then
HAVE_REPO=yes
REPOFLAG=-frepo
fi
AC_SUBST(PRELINK_FLAG)
AC_SUBST(HAVE_PRELINK)
HAVE_PRELINK=no
AC_SUBST(PCHFLAGS)
AC_SUBST(USE_PCH_DIR)
USE_PCH_DIR=no
#
# Checks for compiler.
#
AC_PROG_CC
AC_PROG_CPP
AC_PROG_CXX
AC_PROG_CXXCPP
if test X"$cross_compiling" != X"no"; then
# cross compiling we have to test target and host
if test X"$host" != X"$target"; then
# this is ok we have specified different target system
echo
echo "MICO will be cross-compiled for the $target target platform."
echo
else
# we are cross-compiling to the target == host =>
# the user probably forget to supply --target=xxx option
echo "ERROR:"
echo "ERROR:"
echo "ERROR: Specified C++ compiler is probably cross-compiler. If so and if you"
echo "ERROR: really try to cross-compile MICO to some other target,"
echo "ERROR: then please use --target=<target platform name> option to specify"
echo "ERROR: required target exactly. It is needed for correct MICO configuration."
echo "ERROR:"
echo "ERROR:"
exit 1
fi
fi
AC_ISC_POSIX
AC_LANG_CPLUSPLUS
AC_MSG_CHECKING(OS Type)
gxxversion=`$CXX -v 2>&1`
case $gxxversion in
*mingw*special*)
#
# This is the MinGW compiler in a Cygwin environment
#
OSTYPE=windows
RMPROG="rm -f"
LNPROG="cp"
;;
*)
OSTYPE=unix
RMPROG="rm -f"
LNPROG="ln -f -s"
;;
esac
AC_MSG_RESULT($OSTYPE)
AC_SUBST(OSTYPE)
AC_SUBST(RMPROG)
AC_SUBST(LNPROG)
#
# extra libraries ...
#
AC_SUBST(EXTRA_LIBS)
ac_link="$ac_link "'$EXTRA_LIBS'
AC_SUBST(EXTRA_CXXFLAGS)
ac_compile="$ac_compile "'$EXTRA_CXXFLAGS'
#
# thread support
#
# some platforms needs -D_REENTRANT to correctly find
# thread related header files (example: Tru64)
CPPFLAGS_BACKUP=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -D_REENTRANT"
platform_supports_threads=no
if test X"$use_pthreads" = Xyes; then
use_solaris_threads=no
use_dce_threads=no
use_pth_threads=no
AC_CHECK_LIB(pthread, open, use_pthreads=yes, use_pthreads=no)
if test X"$use_pthreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h sched.h,,
AC_MSG_ERROR(pthread header files incomplete)
)
AC_CHECK_HEADERS(semaphore.h)
AC_DEFINE(HAVE_PTHREADS)
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
SHLIBS="-lpthread"
platform_supports_threads=yes
use_threads=yes
else
AC_CHECK_LIB(c_r, pthread_create, use_pthreads=yes, use_pthreads=no)
if test X"$use_pthreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h sched.h,,
AC_MSG_ERROR(pthread header files incomplete)
)
AC_CHECK_HEADERS(semaphore.h)
AC_DEFINE(HAVE_PTHREADS)
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
#SHLIBS="-lpthread"
LDFLAGS="-pthread $LDFLAGS"
platform_supports_threads=yes
use_threads=yes
else
echo ""
AC_MSG_ERROR("Your platform does not support POSIX-threads !")
fi
fi
fi
if test X"$use_solaris_threads" = Xyes; then
use_pthreads=no
use_dce_threads=no
use_pth_threads=no
AC_CHECK_LIB(thread, open, use_solaris_threads=yes, use_solaris_threads=no)
if test X"$use_solaris_threads" = Xyes; then
AC_CHECK_HEADERS(thread.h semaphore.h synch.h,,
AC_MSG_ERROR(solaris thread header files incomplete)
)
AC_DEFINE(HAVE_SOLARIS_THREADS)
SHLIBS="-lthread"
platform_supports_threads=yes
use_threads=yes
else
echo ""
AC_MSG_ERROR("Your platform does not support Solaris threads !")
fi
fi
if test X"$use_dce_threads" = Xyes; then
use_pthreads=no
use_solaris_threads=no
use_pth_threads=no
AC_CHECK_LIB(cma, open, use_dcethreads=yes, use_dcethreads=no)
if test X"$use_dcethreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h semaphore.h sched.h,,
AC_MSG_ERROR(DCE pthread header files incomplete)
)
AC_DEFINE(HAVE_DCE_THREADS)
SHLIBS="-lcma"
platform_supports_threads=yes
use_threads=yes
else
echo ""
AC_MSG_ERROR("Your platform does not support DCE threads !")
fi
fi
if test X"$use_pth_threads" = Xyes; then
use_pthreads=no
use_dce_threads=no
use_solaris_threads=no
unset pth_config_prog
AC_CHECK_PROG(pth_config_prog, pth-config, yes, no)
if test X"$pth_config_prog" = Xyes; then
PTH_HEADERS=`pth-config --cflags`
PTH_LDFLAGS=`pth-config --ldflags`
PTH_LIBS=`pth-config --libs`
CFLAGS="$PTH_HEADERS $CFLAGS"
CXXFLAGS="$PTH_HEADERS $CXXFLAGS"
LDFLAGS="$PTH_LDFLAGS $LDFLAGS"
PTH_INCLUDE_DIR=`pth-config --includedir`
PTH_LIB_DIR=`pth-config --libdir`
AC_CHECK_HEADER($PTH_INCLUDE_DIR/pth.h)
AC_CHECK_LIB(pth, pth_init, pth_lib=yes, pth_lib=no, "-L$PTH_LIB_DIR")
AC_DEFINE(HAVE_PTH_THREADS)
AC_DEFINE(HAVE_PTH_H)
SHLIBS=$PTH_LIBS
use_pth_threads=yes
platform_supports_threads=yes
use_threads=yes
else
echo ""
AC_MSG_ERROR("Your platform does not support GNU Pth threads !")
fi
fi
if test X"$platform_supports_threads" = Xno; then
if test X"$use_threads" = Xyes; then
AC_CHECK_LIB(pthread, open, use_pthreads=yes, use_pthreads=no)
if test X"$use_pthreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h sched.h,,
AC_MSG_ERROR(pthread header files incomplete)
)
AC_CHECK_HEADERS(semaphore.h)
AC_DEFINE(HAVE_PTHREADS)
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
case "${GXX}:${target}" in
yes:*solaris*|yes:*sunos*)
CXXFLAGS="-pthreads ${CXXFLAGS}"
LDFLAGS="-pthreads ${LDFLAGS}"
;;
yes:*)
CXXFLAGS="-pthread ${CXXFLAGS}"
LDFLAGS="-pthread ${LDFLAGS}"
;;
*)
SHLIBS="-lpthread"
;;
esac
else
AC_CHECK_LIB(c_r, pthread_create, use_pthreads=yes, use_pthreads=no)
if test X"$use_pthreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h sched.h,,
AC_MSG_ERROR(pthread header files incomplete)
)
AC_CHECK_HEADERS(semaphore.h)
AC_DEFINE(HAVE_PTHREADS)
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
LDFLAGS="-pthread $LDFLAGS"
else
AC_CHECK_LIB(thread, open, use_solaris_threads=yes, use_solaris_threads=no)
if test X"$use_solaris_threads" = Xyes; then
AC_CHECK_HEADERS(thread.h semaphore.h synch.h,,
AC_MSG_ERROR(solaris thread header files incomplete)
)
AC_DEFINE(HAVE_SOLARIS_THREADS)
SHLIBS="-lthread"
else
AC_CHECK_LIB(cma, open, use_dcethreads=yes, use_dcethreads=no)
if test X"$use_dcethreads" = Xyes; then
AC_CHECK_HEADERS(pthread.h semaphore.h sched.h,,
AC_MSG_ERROR(DCE pthread header files incomplete)
)
AC_DEFINE(HAVE_DCE_THREADS)
SHLIBS="-lcma"
else
AC_CHECK_PROG(pth_config_prog, pth-config, yes, no)
if test X"$pth_config_prog" = Xyes; then
PTH_HEADERS=`pth-config --cflags`
PTH_LDFLAGS=`pth-config --ldflags`
PTH_LIBS=`pth-config --libs`
CFLAGS="$PTH_HEADERS $CFLAGS"
CXXFLAGS="$PTH_HEADERS $CXXFLAGS"
LDFLAGS="$PTH_LDFLAGS $LDFLAGS"
PTH_INCLUDE_DIR=`pth-config --includedir`
PTH_LIB_DIR=`pth-config --libdir`
AC_CHECK_HEADER($PTH_INCLUDE_DIR/pth.h)
AC_CHECK_LIB(pth, pth_init, pth_lib=yes, pth_lib=no, "-L$PTH_LIB_DIR")
AC_DEFINE(HAVE_PTH_THREADS)
AC_DEFINE(HAVE_PTH_H)
SHLIBS=$PTH_LIBS
else
use_pthreads=no
use_dcethreads=no
use_solaris_threads=no
use_pth_threads=no
fi
fi
fi
fi
fi
fi
fi
CPPFLAGS="$CPPFLAGS_BACKUP"
service_disabled=no
if test X"$use_threads" = Xyes; then
if test X"$use_pthreads" = Xno -a X"$use_dcethreads" = Xno -a X"$use_solaris_threads" = Xno -a X"$use_pth_threads" = Xno; then
echo ""
AC_MSG_ERROR([MICO does not support the thread package for your platform, please remove --enable-threads from your configure command-line and run configure again])
fi
if test X"$use_mini_stl" = Xyes; then
# don't use mini-stl with treads
AC_MSG_WARN(disabling mini-stl for multi-thread support.)
use_mini_stl=no
STLINC=""
fi
if test X"$use_ccm" = Xyes; then
# AC_MSG_WARN(disabling CCM support for MT build.)
# use_ccm=no
service_disabled=yes
fi
if test X"$use_coss" = Xyes; then
if test X"$use_streams" = Xyes; then
# AC_MSG_WARN(disabling mico streams for MT build.)
# use_streams=no
service_disabled=yes
fi
if test X"$use_relship" = Xyes; then
# AC_MSG_WARN(disabling cos relship for MT build.)
# use_relship=no
service_disabled=yes
fi
if test X"$use_trader" = Xyes; then
# AC_MSG_WARN(disabling cos trader for MT build.)
# use_trader=no
service_disabled=yes
fi
fi
AC_DEFINE(HAVE_THREADS)
HAVE_THREADS=yes
AC_SUBST(HAVE_THREADS)
else
HAVE_THREADS=no
AC_SUBST(HAVE_THREADS)
fi
AC_SUBST(LDCONFIG)
LDCONFIG=ldconfig
AC_SUBST(SHLIBS)
#
# System dependencies.
#
CONF_OPT_FLAGS=-O2
CONF_DEBUG_FLAGS=-g
CONF_LIBNSL=yes
CONF_EXCEPT_FLAGS=
CONF_NO_EXCEPT_FLAGS=
CONF_AR=ar
CONF_ARFLAGS=rc
CONF_SHARED_CC="$CC -shared"
CONF_LDSOFLAGS=
CONF_PICFLAGS=
CONF_OBJ_SIZE_LIMIT=no
CONF_SOEXT=so
CONF_LDSO_IN=admin/mico-shld.def.in
CONF_DLFLAGS=
CONF_LDFLAGS=
if test X"$GXX" = Xyes; then
#
# GCC
#
# add -Wall
CXXFLAGS="-Wall -Wwrite-strings $CXXFLAGS"
CFLAGS="-Wall $CFLAGS"
if test X"$use_speed_tune" = Xyes; then
CONF_OPT_FLAGS=-O2
fi
CONF_SHARED_CC="$CXX -shared"
CONF_PICFLAGS=-fPIC
CONF_LDSOFLAGS=-fPIC
CONF_NO_EXCEPT_FLAGS="-fno-exceptions"
CONF_EXCEPT_FLAGS=""
# workaround for compiling X11 headers with gcc 2.95
# kcg: I've commented it out, since it seems to be useless
# for a long time now
#SAVE_CXXFLAGS=$CXXFLAGS
#CXXFLAGS="$SAVE_CXXFLAGS -fpermissive"
#AC_TRY_COMPILE([],[],, CXXFLAGS=$SAVE_CXXFLAGS)
GCCMT="safe"
gccversion=`$CXX --version 2>&1`
case $gccversion in
*2.95*)
GCCMT="unsafe"
;;
*)
;;
esac
# kcg: GCC 4.1.x and higher requires -fno-strict-aliasing
GCC_STRICT_ALIASING="no"
GXX_IS_REAL_GCC=no
gccver=`$CXX -v 2>&1|grep "gcc version"`
if test -n "$gccver"; then
GXX_IS_REAL_GCC=yes
fi
if test X"$GXX_IS_REAL_GCC" = Xyes; then
gccver=`$CXX -v 2>&1|grep "gcc version"|cut -d ' ' -f 3-3`
case $gccver in
# we need to avoid 4.0.x but still support 4.4.0
*4.0.0*|*4.0.1*|*4.0.2*|*4.0.3*|*4.0.4*)
;;
*4.*.*|*5.*.*|*6.*.*|*7.*.*|*8.*.*)
GCC_STRICT_ALIASING="yes"
;;
*)
echo "WARNING: Your GNU C++ compiler is unknown so we do not know"
echo "WARNING: if to switch on or off strict aliasing rules!"
echo "WARNING: Your resulting MICO build may not function correctly!"
;;
esac
fi
gccver=`$CXX -v 2>&1|grep "clang"`
if test -n "$gccver"; then
# switch off strict aliasing on all clang.
GCC_STRICT_ALIASING="yes"
# clang hates our C11 un-compatible narrowing in uni_fromuni.cc and others
# hence enforce good old C++ 98 mode
CXXFLAGS="$CXXFLAGS -std=c++98"
fi
if test X"$GCC_STRICT_ALIASING" = Xyes; then
CXXFLAGS="$CXXFLAGS -fno-strict-aliasing"
fi
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_REENTRANT"
fi
case $target in
*aix*)
CONF_LDSO_IN=admin/mico-shld.aix.in
CONF_LDFLAGS=-Wl,-brtl,-bbigtoc
# all code is PIC on AIX
CONF_PICFLAGS=
CONF_LDSOFLAGS=
;;
*linux*)
CONF_DLFLAGS=-rdynamic
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_GNU_SOURCE"
fi
;;
*solaris*|*sunos*)
if test X"$use_threads" = Xyes; then
SHLIBS="$SHLIBS -lposix4"
fi
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
;;
*osf*)
CONF_LDSOFLAGS="-Wl,-expect_unresolved,'*' $CONF_LDSOFLAGS"
;;
*hpux*)
# -mmillicode-long-calls
CONF_LDFLAGS=-Wl,+s
CONF_DLFLAGS=-Wl,-E
case $target in
hppa*) CONF_SOEXT=sl ;;
esac
CONF_OBJ_SIZE_LIMIT=yes
;;
*freebsd2*|*freebsd3*)
# does anybody still use this?
CONF_SOEXT=so.1.0
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
fi
;;
*freebsd*)
# FreeBSD 4.x and later
# must not use .so.1.0 here
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
fi
;;
*netbsd*)
# must not use .so.1.0 here
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
fi
;;
*bsd*)
CONF_SOEXT=so.1.0
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_THREAD_SAFE"
fi
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
;;
*mingw*|*cygwin*)
# check if the compiler is cygwin or mingw
gxxversion=`$CXX -v 2>&1`
case $gxxversion in
*mingw*)
CONF_SOEXT=dll
CONF_PICFLAGS=
CONF_LDSOFLAGS=
HAVE_MINGW=yes
HAVE_CYGWIN=no
if test "x$use_shared" = "xyes" ; then
CXX="$CXX -mthreads"
CONF_SHARED_CC="$CXX -shared"
else
CXXFLAGS="-DBUILD_MICO_DLL $CXXFLAGS"
fi
;;
*cygwin*)
# cygwin doesn't support (or Windows doesn't support)
# symlinks to shared libraries => we just copy them
# to the libs directory
LNPROG="cp"
CONF_SOEXT=dll
CONF_PICFLAGS=
CONF_LDSOFLAGS=
HAVE_CYGWIN=yes
HAVE_MINGW=no
if test "x$use_shared" = "xyes" ; then
CXX="$CXX -mthreads"
CONF_SHARED_CC="$CXX -shared"
else
CXXFLAGS="-DBUILD_MICO_DLL $CXXFLAGS"
fi
;;
esac
;;
*lynxos*)
CXXFLAGS="$CXXFLAGS -mminimal-toc"
;;
*dgux*)
CONF_SHARED_CC="$CXX -shared"
;;
*apple-darwin*)
# generated code is PIC by default
CONF_SHARED_CC="$CXX -dynamiclib -dylib -Wl,-flat_namespace -Wl,-undefined -Wl,suppress"
CONF_SOEXT="dylib"
CONF_PICFLAGS=
CONF_LDSOFLAGS=
CXXFLAGS="$CXXFLAGS -Wno-long-double"
LDCONFIG="echo ldconfig not run on darwin"
;;
esac
else
#
# native C/C++ compiler
#
case $target in
*irix*)
# -KPIC is on by default
AC_SUBST(SGI_ABI)
if test -z "$SGI_ABI"; then
$SGI_ABI="n32"
fi
case $SGI_ABI in
"n32")
LDFLAGS="$LDFLAGS -L/usr/lib32"
;;
"o32")
LDFLAGS="$LDFLAGS -L/usr/lib"
;;
"64")
LDFLAGS="$LDFLAGS -L/usr/lib64"
;;
esac
CONF_SHARED_CC="$CXX -shared"
CONF_LIBNSL=no
CONF_OPT_FLAGS=-O1
CONF_AR="$CXX -ar -$SGI_ABI"
CONF_ARFLAGS="-o"
CPPFLAGS="$CPPFLAGS -$SGI_ABI -LANG:std"
CXXFLAGS="$CXXFLAGS -$SGI_ABI -OPT:Olimit_opt=on -G 4 -LANG:std -woff 1682,1110,1116,1014,1681,1047,1460"
LIBS=-lCio $LIBS
if test X"$use_compiled_headers" = Xyes; then
PCHFLAGS="$PCHFLAGS -LANG:pch_dir=$ABSSRCDIR/pch -LANG:pch -DFAST_PCH"
USE_PCH_DIR=yes
fi
;;
*powermax*)
CONF_NO_EXCEPT_FLAGS=--no_exceptions
CONF_EXCEPT_FLAGS=--exceptions
CXXFLAGS="$CXXFLAGS -DPMaxOS --auto_instantiation --display_error_number --diag_suppress=382,610,611"
# dont know what this is for, ask <[email protected]>
HAVE_REPO=yes
;;
*solaris*)
cxxversion=`$CXX -V 2>&1`
CONF_OPT_FLAGS=-O
CONF_SHARED_CC="$CXX -G"
# kcg: following option is probably for very old SunPRO compiler
# even Forte Developer C++ 6 update 2 should be ok with
# -pto instead of with full template repository (-ptr switch)
# CXXFLAGS="$CXXFLAGS -ptr$ABSSRCDIR"
# kcg: -pto is not needed anymore since Sun Studio 8
# where `-instances=global' was switched on by default
# so here we test for Forte Developer 6 and Sun Studio 7
if test ! -z "`echo $cxxversion|grep 'C++ 5.3'`" || test ! -z "`echo $cxxversion|grep 'C++ 5.4'`"; then
CXXFLAGS="$CXXFLAGS -pto"
HAVE_REPO=yes
fi
# disable anachronism warnings
CXXFLAGS="$CXXFLAGS -erroff=badargtype2w"
CONF_PICFLAGS=-KPIC
CONF_LDSOFLAGS=-KPIC
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -mt"
LDFLAGS="$LDFLAGS -mt"
SHLIBS="$SHLIBS -lrt"
fi
CONF_AR="CC"
CONF_ARFLAGS="-xar -o"
AC_DEFINE(USE_SHARED_MUTEX_ATTRIBUTE)
;;
*aix*)
AC_PATH_PROG(AIXLINKER, makeC++SharedLib, makeC++SharedLib, $PATH:/usr/lpp/xlC/bin)
CONF_LDSO_IN=admin/mico-shld.aix-xlc.in
CONF_SHARED_CC="$AIXLINKER -p 0 -G"
CONF_LDFLAGS=-brtl
CXXFLAGS="$CXXFLAGS -+ -qrtti=all -qnotempinc -qlongdouble -qlonglong -w"
CFLAGS="$CFLAGS -qlongdouble -qlonglong"
;;
*hpux*)
if test X"$use_pthreads" = Xyes; then
CXXFLAGS="$CXXFLAGS -mt"
SHLIBS="$SHLIBS -lrt"
fi
if test X"$use_dcethreads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_RW_MULTI_THREAD -D_RWSTD_MULTI_THREAD -D_HPUX_SOURCE -D_THREAD_SAFE -D_REENTRANT"
fi
if test X"$use_mini_stl" = Xyes; then
# mini-stl doesn't compile under HP aCC according to
# <[email protected]> because it clashes with the system
# supplied Rogue-Wave STL (RWSTL does not appear to be disable-able).
AC_MSG_WARN("HP aCC found - disabling mini-stl.")
use_mini_stl=no
STLINC=""
fi
CXXCPP="$CXXCPP -AA" # this is needed for correct detection of sstream header file below
CONF_OPT_FLAGS=+O2
CONF_SHARED_CC="$CXX -b"
CONF_LDFLAGS=-Wl,+s
CONF_DLFLAGS=-Wl,-E
CONF_SOEXT=sl
CONF_PICFLAGS=+Z
CONF_LDSOFLAGS=+Z
CXXFLAGS="$CXXFLAGS -AA -ext"
CFLAGS="$CFLAGS -Ae"
HAVE_REPO=yes
;;
*osf*)
# generated code is PIC by default
CONF_SHARED_CC="ld -shared"
CONF_LDSOFLAGS="-expect_unresolved '*'"
CPPFLAGS="$CPPFLAGS -D__USE_STD_IOSTREAM"
CXXFLAGS="$CXXFLAGS -ptr $ABSSRCDIR/rep -ieee"
if test X"$use_threads" = Xyes; then
CXXFLAGS="-pthread $CXXFLAGS"
SHLIBS="$SHLIBS -lrt"
fi
;;
*linux*)
cxxversion=`$CXX -V 2>&1`
if test ! -z "`echo $cxxversion|grep como:`"; then
# Comeau C/C++ 4.3.x.x
HAVE_PRELINK=yes
PRELINK_FLAG=--prelink_objects
CONF_OPT_FLAGS="-O2"
CONF_PICFLAGS="-copt=-fPIC"
CONF_DLFLAGS=--lopt=-rdynamic
# old params for relaxed mode
#CXXFLAGS="$CXXFLAGS --const_string_literal --diag_suppress=997"
# new params for strict ansi warning mode
# (for strict ansi error mode please change '-a' to '-A')
CXXFLAGS="$CXXFLAGS -a --long_long --implicit_extern_c_type_conversion --diag_suppress=997"
if test X"$use_compiled_headers" = Xyes; then
PCHFLAGS="$PCHFLAGS --pch --pch_dir $ABSSRCDIR/pch -DFAST_PCH"
USE_PCH_DIR=yes
fi
if test X"$use_threads" = Xyes; then
CXXFLAGS="$CXXFLAGS -D_REENTRANT -D_GNU_SOURCE"
fi