forked from AdaCore/PolyORB
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.ac
1017 lines (830 loc) · 24.9 KB
/
configure.ac
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
# $Id$
define(POLYORB_RELEASE, ifdef([OVERRIDE_RELEASE],OVERRIDE_RELEASE,[20.0w]))
AC_PREREQ(2.60)
AC_INIT(PolyORB, pkg_version(POLYORB_RELEASE), [email protected])
AC_CONFIG_SRCDIR(src/polyorb.ads)
AC_CONFIG_AUX_DIR(support)
AM_SCM
POLYORB_VERSION="$PACKAGE_VERSION (rev. $CMREVISION)"
AC_SUBST(POLYORB_VERSION)
AC_MSG_NOTICE([Configuring PolyORB $POLYORB_VERSION])
ifdef([LONGEST_FILE_NAME],[
if test ! -f ${srcdir}/LONGEST_FILE_NAME; then
AC_MSG_ERROR([Source directory sanity check failed, check your distribution!
Note that this package must be extracted with GNU tar.])
fi])
##########################################
# Initialization.
##########################################
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
# Disable Automake rules to rebuild Makefile.in and configure.
# We handle this manually using support/reconfig.
AM_MAINTAINER_MODE
LIBVERSIONINFO=1:4:0
AC_SUBST(LIBVERSIONINFO)
# Check for developer (debug) mode.
# This must come before AC_PROG_CC so we can set the default CFLAGS ourselves.
# Note that these default CFLAGS are used for both the native and the cross
# compilers.
define(DEBUG_OPTIONS, [dnl
if test "${CFLAGS-unset}" = "unset"; then CFLAGS="-g -O0"; fi
BASE_ADAFLAGS="-XBuild=DEBUG $VALIDITY_FLAG"
BARGS=-E
ASSERTION_POLICY_DEFAULT=Check
DEBUG_POLICY_DEFAULT=Check
DEBUG_ONLY=""
INSTALL_BIN='${INSTALL_PROGRAM}'
debug=true])
define(NODEBUG_OPTIONS, [dnl
if test "${CFLAGS-unset}" = "unset"; then CFLAGS="-g -O2"; fi
BASE_ADAFLAGS="-XBuild=PRODUCTION"
BARGS=
DEBUG_ONLY="-- "
INSTALL_BIN='${]ifdef([STRIP_PRODUCTION_BINARIES],
[INSTALL_STRIP_PROGRAM],
[INSTALL_PROGRAM])[}'
debug=false])
# By default use no-debug options
NODEBUG_OPTIONS
AC_MSG_CHECKING([debugging mode])
AC_ARG_ENABLE(debug,
AS_HELP_STRING([--enable-debug], [Turn on debugging options (yes/all/no)]),
[
AC_MSG_RESULT($enableval)
if test "$enableval" = "all"; then
VALIDITY_FLAG="-gnatVa"
enableval=yes
fi
if test "$enableval" = "yes"; then
DEBUG_OPTIONS
fi
],
[AC_MSG_RESULT(no)])
# LIBRARY_TYPE set to use static or shared libraries consistently.
# By default build static libs
LIBRARY_TYPE=static
AC_ARG_ENABLE(shared,
AS_HELP_STRING([--enable-shared], [Enable build of shared libraries]),
[
if test "$enableval" = "yes"; then
LIBRARY_TYPE="relocatable"
fi
],
[])
AC_SUBST(LIBRARY_TYPE)
# WARNINGS_MODE can be set to:
# e (treat warnings as errors)
# n (normal processing)
# s (suppress all warnings)
# Here we set WARNINGS_MODE to "e", unless another default has been set
# in aclocal.m4 (see prepare_distrib).
WARNINGS_MODE=ifdef([DEFAULT_WARNINGS_MODE],DEFAULT_WARNINGS_MODE,e)
AC_ARG_ENABLE(warnings,
AS_HELP_STRING([--enable-warnings=X], [Set warnings processing to X (e/n/s)]),
[case "$enableval" in
yes) WARNINGS_MODE=e ;;
no) WARNINGS_MODE=s ;;
[[ens]]) WARNINGS_MODE="$enableval" ;;
*) AC_ERROR([invalid argument to --enable-warnings: $enableval]) ;;
esac])
AC_SUBST(WARNINGS_MODE)
AM_ARG_ENABLE_POLICY(assertion, Ignore)
AM_ARG_ENABLE_POLICY(debug, Check)
AC_SUBST(INSTALL_BIN)
#######################################
# Additional configuration pragmas file
#######################################
AC_ARG_ENABLE(conf-pragmas,
AS_HELP_STRING([--enable-conf-pragmas=F],
[Additional Ada configuration pragmas file for target]),
[
if test -f "${enableval}"; then
# Compute absolute path, as configure tests are run from a temporary
# directory. This variable is used only for configure tests (which are
# executed from a temporary directory).
ADDITIONAL_CONF_PRAGMAS_SWITCH="-gnatec=$(cd "$(dirname "${enableval}")"; pwd)/$(basename "${enableval}")"
# Set substitution for config.adc.in
ADDITIONAL_CONF_PRAGMAS="${enableval}"
else
AC_ERROR([valid file name required for --enable-conf-pragmas])
fi
],
[ADDITIONAL_CONF_PRAGMAS="/dev/null"])
AC_SUBST_FILE(ADDITIONAL_CONF_PRAGMAS)
##########################################
# Set platform-specific supplementary CFLAGS and options
##########################################
# Host
case "$host_os" in
cygwin* | mingw*)
HOST_EXE_SUFFIX=.exe
WINDOWS_ON_HOST=True
# Make sure every call to ln(1) fails, and falls back to cp(1), because
# the compiler does not know how to handle Cygwin symbolic links.
SYMLINK_ALIAS="alias ln=/bin/false"
;;
*)
HOST_EXE_SUFFIX=
WINDOWS_ON_HOST=False
;;
esac
AC_SUBST(WINDOWS_ON_HOST)
AM_CONDITIONAL(WINDOWS, test x$WINDOWS_ON_HOST = xTrue)
# Target
WINDOWS_ON_TARGET=False
TARGET_EXE_SUFFIX=
case $target_os in
aix*)
CFLAGS_FOR_TARGET="-mminimal-toc"
;;
vxworks*)
CFLAGS_FOR_TARGET="-mlongcall"
TARGET_EXE_SUFFIX=.out
PLATFORM_BASE_LIST="PolyORB.Parameters.Static"
;;
cygwin* | mingw* )
WINDOWS_ON_TARGET=True
TARGET_EXE_SUFFIX=.exe
;;
esac
ADAFLAGS_FOR_TARGET="${CFLAGS_FOR_TARGET}"
AC_SUBST(CFLAGS_FOR_TARGET)
AC_SUBST(ADAFLAGS_FOR_TARGET)
AC_SUBST(WINDOWS_ON_TARGET)
# Implementation note: the *vxworks* rule above is for VxWorks 5, it can
# present some problems for VxWorks 6.
AC_SUBST(HOST_EXE_SUFFIX)
AC_SUBST(TARGET_EXE_SUFFIX)
# By default treat all warnings as errors when building directly from the
# source repository. The packaging procedure changes the default to "n".
# so that builds from packaged sources do not stop on warnings.
BASE_ADAFLAGS="${BASE_ADAFLAGS} -XWarnings_Mode=${WARNINGS_MODE}"
# ADAFLAGS will be set later, once AC_PROG_CC has set the definitive CFLAGS
AC_SUBST(CFLAGS)
AC_SUBST(ADAFLAGS)
AC_SUBST(BARGS)
AC_SUBST(DEBUG_ONLY)
AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
##########################################
# Check for various programs
##########################################
AC_PROG_CC
if test "${ADAFLAGS-unset}" = unset; then
ADAFLAGS="-cargs ${CFLAGS} -margs ${BASE_ADAFLAGS}"
else
ADAFLAGS="-cargs ${ADAFLAGS} -margs ${BASE_ADAFLAGS}"
fi
AC_PROG_AWK
AC_CHECK_PROG(RM, rm, rm)
AC_CHECK_PROG(SED, sed, sed)
AC_CHECK_PROG(FIND, find, find)
AC_CHECK_PROG(PYTHON, python, python)
AC_CHECK_PROG(GREP, grep, grep)
AM_PROG_GNATCHOP
AM_PROG_ADA
AM_CROSS_PROG_ADA
AM_PROG_WORKING_ADA
AM_CROSS_PROG_WORKING_ADA
AM_PROG_GNATMAKE
AM_CROSS_PROG_GNATMAKE
AM_CROSS_PROG_CC
AM_PROG_IDLCPP
AM_WITH_GPRBUILD
##########################################
# Check Ada environment features
##########################################
AM_HAS_GNAT_PERFECT_HASH_GENERATORS
AM_HAS_PRAGMA_PROFILE_RAVENSCAR
AM_HAS_PRAGMA_PROFILE_WARNINGS
AM_HAS_PRAGMA_SUPPRESS_VALIDITY_CHECK
AM_HAS_STYLESW_YG
AM_HAS_STYLESW_YO
AM_SUBST_GPR([STYLE_SWITCHES])
AM_HAS_INTRINSIC_SYNC_COUNTERS
AM_HAS_ADA_DYNAMIC_PRIORITIES
AM_HAS_FREE_ON_TERMINATION
##########################################
# Check C environment features (for target)
##########################################
save_CC="$CC"
CC="$CC_FOR_TARGET"
# Need to provide a non-empty 4th argument to AC_CHECK_HEADERS
# so that a real compilation test is performed using CC, not a
# junk preprocessor test that will use the host preprocessor
# instead of the target compiler.
# Mandatory features
AC_CHECK_HEADERS([fcntl.h],
[],
[AC_ERROR([One or more required header file could not be found.])],
[/*relax*/])
# Optional features
AC_CHECK_FUNCS([setsid strftime])
CC="$save_CC"
##########################################
# Check platform properties
##########################################
AC_EXEEXT
##########################################
# Tools list: contains libraries that are
# needed by some personnalities.
##########################################
LIBS_LIST=""
##########################################
# Protocol personalities list.
##########################################
AC_MSG_CHECKING([default protocol personalities])
AC_ARG_WITH(proto-perso,
AS_HELP_STRING([--with-proto-perso=X], [Enumerate protocol personalities]),
[
PROTO_LIST=""
newwithval=`echo ${withval} | tr "[A-Z]" "[a-z]"`
for P in ${newwithval}
do
if ${FIND} ${srcdir}/src/${P} -name 'polyorb-binding_data-*.ads' > /dev/null;
then
PROTO_LIST="${PROTO_LIST}${P} "
else
AC_MSG_ERROR([unknown protocol personality ${P}])
fi
done
PROTO_LIST=`echo "$PROTO_LIST" | sed 's/ $//'`
],
[
PROTO_LIST="giop"
])
AC_MSG_RESULT(${PROTO_LIST})
AC_SUBST(PROTO_LIST)
##########################################
# Application personalities list
##########################################
AC_MSG_CHECKING([default application personalities])
AC_ARG_WITH(appli-perso,
AS_HELP_STRING([--with-appli-perso=X], [Enumerate application personalities]),
[
APPLI_LIST=""
newwithval=`echo ${withval} | tr "[A-Z]" "[a-z]"`
for P in ${newwithval}
do
if test -d "${srcdir}/src/${P}"
then
APPLI_LIST="${APPLI_LIST}${P} "
else
AC_MSG_ERROR([unknown application personality ${P}])
fi
done
APPLI_LIST=`echo "$APPLI_LIST" | sed 's/ $//'`
],
[
APPLI_LIST="corba"
])
AC_MSG_RESULT(${APPLI_LIST})
AC_SUBST(APPLI_LIST)
############################################
# Internal configuration of the IDL compiler
############################################
AC_ARG_WITH(idl-compiler,
AS_HELP_STRING([--with-idl-compiler=X], [Select IDL compiler]),
[
IDLAC=${withval}
],
[
IDLAC=iac
])
AC_SUBST(IDLAC)
AC_ARG_ENABLE(idlac-wrapper,
AS_HELP_STRING([--disable-idlac-wrapper], [Do not use idlac_wrapper for build]),
[case "$enableval" in
yes|no) USE_IDLAC_WRAPPER=$enableval ;;
*) AC_ERROR([invalid argument to --enable-idlac-wrapper: $enableval]) ;;
esac],
[USE_IDLAC_WRAPPER=yes])
AC_SUBST(USE_IDLAC_WRAPPER)
AC_ARG_ENABLE(use-installed,
AS_HELP_STRING([--enable-use-installed], [Use installed PolyORB to build testsuite and examples]),
[case "$enableval" in
yes|no) USE_INSTALLED=$enableval ;;
*) AC_ERROR([invalid argument to --enable-use-installed: $enableval]) ;;
esac],
[USE_INSTALLED=no])
AC_SUBST(USE_INSTALLED)
AM_IDLCPP_NEEDS_DOT
##########################################
# Services list.
##########################################
AC_MSG_CHECKING([default services])
AC_ARG_WITH(corba-services,
AS_HELP_STRING([--with-corba-services=X], [Enumerate services]),
[
SERVICE_LIST=""
newwithval=`echo ${withval} | tr "[A-Z]" "[a-z]"`
for S in ${newwithval}
do
if test -d "${srcdir}/cos/${S}"
then
SERVICE_LIST="${SERVICE_LIST}${S} "
else
AC_MSG_ERROR([unknown service ${S}])
fi
done
SERVICE_LIST=`echo "$SERVICE_LIST" | sed 's/ $//'`
],
[
SERVICE_LIST=" "
])
AC_MSG_RESULT(${SERVICE_LIST})
AC_SUBST(SERVICE_LIST)
##########################################
# If the SOAP or the AWS personnality is
# selected, then we have to add the
# WEB_COMMON library
##########################################
soap_enabled=`echo ${PROTO_LIST} | ${AWK} '/soap/ {print "yes"}'`
aws_enabled=`echo ${APPLI_LIST} | ${AWK} '/aws/ {print "yes"}'`
if test x"$soap_enabled" = xyes -o x"$aws_enabled" = xyes
then
AC_MSG_CHECKING([tools libraries])
LIBS_LIST="${LIBS_LIST} web_common"
fi
AC_MSG_RESULT(${LIBS_LIST})
AC_SUBST(LIBS_LIST)
##########################################
# gnatdist flags
##########################################
PCSNAME="polyorb"
AC_SUBST(PCSNAME)
#
# Remote shell command
#
AC_CHECK_PROGS(DEFAULT_RSH_CMD, [remsh rsh ssh], rsh)
AC_MSG_CHECKING(for remote shell command to use)
AC_ARG_WITH(rshcmd,
AS_HELP_STRING([--with-rshcmd=command], [Set alternate remote shell command]),
[RSH_CMD="${withval}"],
[RSH_CMD="${DEFAULT_RSH_CMD}"])
AC_SUBST(RSH_CMD)
AC_MSG_RESULT([${RSH_CMD}])
#
# Remote shell flags
#
AC_MSG_CHECKING(for remote shell options to use)
AC_ARG_WITH(rshopt,
AS_HELP_STRING([--with-rshopt=command], [Set remote shell options]),
[RSH_OPT="${withval}"],
[RSH_OPT=""])
AC_SUBST(RSH_OPT)
AC_MSG_RESULT([${RSH_OPT}])
#
# Default storage location.
#
DEFSTORAGENAME="dsm"
DEFSTORAGEDATA=""
AC_SUBST(DEFSTORAGENAME)
AC_SUBST(DEFSTORAGEDATA)
DEFPROTOCOLNAME="tcp"
DEFPROTOCOLDATA=""
AC_SUBST(DEFPROTOCOLDATA)
AC_SUBST(DEFPROTOCOLNAME)
#
# Check whether we remove support for RPC abortion
#
AC_ARG_ENABLE(rpc-abortion,
AS_HELP_STRING([--enable-rpc-abortion], [Enable RPC abortion even when not supported]),
[SUPPORT_RPC_ABORTION="True"],
[SUPPORT_RPC_ABORTION="Default"])
AM_SUPPORT_RPC_ABORTION
AC_MSG_CHECKING(whether we support RPC abortion)
if test "$SUPPORT_RPC_ABORTION" = "True"; then
AC_MSG_RESULT([yes])
else
AC_MSG_RESULT([no])
fi
AC_SUBST(SUPPORT_RPC_ABORTION)
##########################################
# Check for exception model
##########################################
AC_MSG_CHECKING(for exception model to use)
AC_MSG_RESULT($EXCEPTION_MODEL)
AC_SUBST(GNAT_RTS_FLAG)
#
# If ATC or dynamic priorities are not supported, remove corresponding units.
# Note: can't use a multi-line value for an AC_SUBST variable, this works only
# with recent versions of autoconf (which use awk(1) for all substitutions).
# Older versions that rely on sed(1) don't handle multi-line substitutions
# correctly.
#
EXCLUDED_SOURCE_FILES=config.excluded_source_files
rm -f $EXCLUDED_SOURCE_FILES
if $HAVE_ADA_ATC; then
: No excluded files
else
cat <<__EOF__
polyorb-tasking-profiles-full_tasking_atc.ads
polyorb-tasking-profiles-full_tasking_atc-abortables.ads
polyorb-tasking-profiles-full_tasking_atc-abortables.adb
__EOF__
fi >> ${EXCLUDED_SOURCE_FILES}
if $HAVE_ADA_DYNAMIC_PRIORITIES; then
: No excluded files
else
cat <<__EOF__
polyorb-tasking-profiles-full_tasking-threads-dynamic_priorities.ads
polyorb-tasking-profiles-full_tasking-threads-dynamic_priorities.adb
__EOF__
fi >> ${EXCLUDED_SOURCE_FILES}
##########################################
# XML/Ada
##########################################
dnl Projects-based build infrastructure: find XML/Ada project in project path
soap_enabled=`echo ${PROTO_LIST} | ${AWK} '/soap/ {print "yes"}'`
if test x"$soap_enabled" = xyes; then
AM_HAS_GNAT_PROJECT([xmlada])
if test x"$HAVE_GNAT_PROJECT_xmlada" != xyes; then
AC_MSG_ERROR(["SOAP protocol personality requires XML/Ada"])
fi
fi
##########################################
# GNATColl
##########################################
AM_WITH_GNATCOLL
if test "x$HAVE_GNAT_PROJECT_gnatcoll" = xyes; then
PLATFORM_BASE_LIST="$PLATFORM_BASE_LIST PolyORB.Parameters.Macros"
EXTRA_PRJS="$EXTRA_PRJS gnatcoll"
else
cat <<__EOF__
polyorb-parameters-macros.ads
polyorb-parameters-macros.adb
__EOF__
fi >> ${EXCLUDED_SOURCE_FILES}
##########################################
# SSL/TLS Support with OpenSSL
##########################################
AM_WITH_OPENSSL
AM_CONDITIONAL(HAVE_SSL, [test "x$HAVE_SSL" = "xyes"])
##########################################
# Identify projects to be built
##########################################
get_perso_prjs() {
(
cd ${srcdir}/projects
# Look for projects with given personality prefix (or "setup"). Note that
# these projects may be generated by configure, so consider .gpr.in as well.
for p in polyorb_src_$1*.gpr*; do
case "$p" in
*.gpr)
# If configure has been run for building in the source tree, then a
# stale .gpr file might exist for a generated project: ignore it, we'll
# process the .gpr.in file instead.
if test -f $p.in; then continue; fi ;;
*.gpr.in)
# Process normally
;;
*)
# Neither .gpr nor .gpr.in: ignore
continue
esac
output=true
for var in `sed -n '/^--# *require */s///p' < $p`; do
eval "val=\${$var}"
if test "x${val}" != "xyes"; then
output=false
fi
done
if $output; then
echo -n " ${p%.in}"
fi
done
)
}
with_projects() {
WITH_PRJS=
case "$1" in
--prefix=*) prj_prefix=${1#--prefix=}; shift ;;
esac
if test x"$1" != x; then
for gpr in $*; do
prj="\"${prj_prefix}`basename $gpr .gpr`\""
if test "x$WITH_PRJS" = x; then
WITH_PRJS="with $prj"
else
WITH_PRJS="$WITH_PRJS, $prj"
fi
done
WITH_PRJS="$WITH_PRJS;"
fi
echo "$WITH_PRJS"
}
APPLI_DIRS=""
APPLI_INCS=""
APPLI_LIBS=""
APPLI_EXES="\$(poly_exe) "
APPLI_PRJS=""
for P in ${APPLI_LIST}
do
APPLI_DIRS="${APPLI_DIRS} "'$'"(${P}_dir)"
APPLI_INCS="${APPLI_INCS} "'$'"(${P}_inc)"
APPLI_LIBS="${APPLI_LIBS} "'$'"(${P}_lib)"
APPLI_EXES="${APPLI_EXES} "'$'"(${P}_exe)"
APPLI_PRJS="${APPLI_PRJS} `get_perso_prjs ${P}`"
done
WITH_APPLI_PRJS=`with_projects $APPLI_PRJS`
AC_SUBST(APPLI_DIRS)
AC_SUBST(APPLI_INCS)
AC_SUBST(APPLI_LIBS)
AC_SUBST(APPLI_EXES)
AC_SUBST(APPLI_PRJS)
AC_SUBST(WITH_APPLI_PRJS)
PROTO_DIRS=""
PROTO_INCS=""
PROTO_LIBS=""
PROTO_PRJS=""
for P in ${PROTO_LIST}
do
PROTO_DIRS="${PROTO_DIRS} "'$'"(${P}_dir)"
PROTO_INCS="${PROTO_INCS} "'$'"(${P}_inc)"
PROTO_LIBS="${PROTO_LIBS} "'$'"(${P}_lib)"
PROTO_PRJS="${PROTO_PRJS} `get_perso_prjs ${P}`"
done
WITH_PROTO_PRJS=`with_projects $PROTO_PRJS`
AC_SUBST(PROTO_DIRS)
AC_SUBST(PROTO_INCS)
AC_SUBST(PROTO_LIBS)
AC_SUBST(PROTO_PRJS)
AC_SUBST(WITH_PROTO_PRJS)
SERVICE_DIRS=""
SERVICE_INCS=""
SERVICE_LIBS=""
SERVICE_EXES=""
SERVICE_PRJS=""
for P in ${SERVICE_LIST}
do
SERVICE_DIRS="${SERVICE_DIRS} "'$'"(${P}_dir)"
SERVICE_INCS="${SERVICE_INCS} "'$'"(${P}_inc)"
SERVICE_LIBS="${SERVICE_LIBS} "'$'"(${P}_lib)"
SERVICE_EXES="${SERVICE_EXES} "'$'"(${P}_exe)"
if test "$P" != ir
then
SERVICE_PRJS="${SERVICE_PRJS} polyorb_idls_cos_${P}.gpr"
SERVICE_PRJS="${SERVICE_PRJS} polyorb_cos_${P}.gpr"
fi
done
WITH_SERVICE_PRJS=`with_projects $SERVICE_PRJS`
AC_SUBST(SERVICE_DIRS)
AC_SUBST(SERVICE_INCS)
AC_SUBST(SERVICE_LIBS)
AC_SUBST(SERVICE_EXES)
AC_SUBST(SERVICE_PRJS)
AC_SUBST(WITH_SERVICE_PRJS)
SETUP_PRJS=`get_perso_prjs setup`
WITH_SETUP_PRJS=`with_projects $SETUP_PRJS`
WITH_DISTRIB_SETUP_PRJS=`with_projects --prefix=polyorb/ $SETUP_PRJS`
AC_SUBST(SETUP_PRJS)
AC_SUBST(WITH_SETUP_PRJS)
AC_SUBST(WITH_DISTRIB_SETUP_PRJS)
LIBS_DIRS=""
LIBS_INCS=""
LIBS_LIBS=""
LIBS_EXES=""
for P in ${LIBS_LIST}
do
LIBS_DIRS="${LIBS_DIRS} "'$'"(${P}_dir)"
LIBS_INCS="${LIBS_INCS} "'$'"(${P}_inc)"
LIBS_LIBS="${LIBS_LIBS} "'$'"(${P}_lib)"
LIBS_EXES="${LIBS_EXES} "'$'"(${P}_exe)"
done
AC_SUBST(LIBS_DIRS)
AC_SUBST(LIBS_INCS)
AC_SUBST(LIBS_LIBS)
AC_SUBST(LIBS_EXES)
##########################################
# Extra gnatmake parameters provided by the user
##########################################
AC_SUBST(EXTRA_GNATMAKE_FLAGS)
#################################################
# Build code fragments to be substituted in
# src/setup/polyorb-setup-client_base.adb
# src/setup/polyorb-setup-server.adb
# tools/po_catref/po_catref_setup.adb
# tools/po_createref/po_createref_setup.adb
#################################################
PLATFORM_BASE_WITHS=config.platform_base_withs.adb
PROTO_CLIENT_WITHS=config.proto_client_withs.adb
PROTO_SERVER_WITHS=config.proto_server_withs.adb
PO_CATREF_WITHS=config.po_catref_withs.adb
PO_CREATEREF_WITHS=config.po_createref_withs.adb
# Dependency files related to protocol personalities
ALL_PROTO_WITHS="
${PROTO_CLIENT_WITHS}
${PROTO_SERVER_WITHS}
${PO_CATREF_WITHS}
${PO_CREATEREF_WITHS}"
# All generated dependency files
ALL_WITHS="
${PLATFORM_BASE_WITHS}
${ALL_PROTO_WITHS}"
rm -f ${ALL_WITHS}
if test -z "${PLATFORM_BASE_LIST}"
then
# Generate a comment line to avoid consecutive white lines
# in the resulting file.
cat >>${PLATFORM_BASE_WITHS} <<EOF
-- No additional platform-specific dependencies on $target
EOF
else
for U in ${PLATFORM_BASE_LIST}
do
cat >>${PLATFORM_BASE_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
fi
for P in ${PROTO_LIST}
do
c1=`echo "-- ${P} --" | tr a-z A-Z`
c2=`echo "$c1" | sed s/./-/g`
for f in ${ALL_PROTO_WITHS}; do
cat >>${f} <<EOF
$c2
$c1
$c2
EOF
done
for F in `${FIND} ${srcdir}/src/${P} -type f \
| ${GREP} 'polyorb-setup-[[a-z]]*\.ads$' \
| ${GREP} -v polyorb-setup-tlsiop.ads`
do
U=`${AWK} '/^package/{print $2}' ${F}`
cat >>${PROTO_SERVER_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
cat >>${PROTO_CLIENT_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
for F in `${FIND} ${srcdir}/src/${P} -name 'polyorb-binding_data-*.ads'`
do
U=`${AWK} '/^package/{print $2}' ${F}`
cat >>${PROTO_CLIENT_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
for F in `${FIND} ${srcdir}/src/${P} -name 'polyorb-setup-access_points-*.ads' \
| ${GREP} -v polyorb-setup-access_points-tlsiop.ads`
do
U=`${AWK} '/^package/{print $2}' ${F}`
cat >>${PROTO_SERVER_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
for F in `${FIND} ${srcdir}/tools/po_catref -name "polyorb-binding_data-${P}-*.ads"`
do
U=`${AWK} '/^package/{print $2}' ${F}`
cat >>${PO_CATREF_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
for F in `${FIND} ${srcdir}/tools/po_createref -name "polyorb-binding_data-${P}-*.ads"`
do
U=`${AWK} '/^package/{print $2}' ${F}`
cat >>${PO_CREATEREF_WITHS} <<EOF
with ${U};
pragma Elaborate_All (${U});
pragma Warnings (Off, ${U});
EOF
done
done
##########################################
# Clean up files
##########################################
for F in ${ALL_WITHS}
do
# Remove initial blank line
SEDCMD="${SED} -e 1d"
# If we do not have SSL enabled, comment out any mention of SSLIOP
# in the setup files.
if test "x$HAVE_SSL" != xyes; then
SEDCMD=["${SEDCMD} -e 's/[^ ].*SSLIOP/-- &/'"]
fi
if test -e ${F}; then
eval "${SEDCMD}" < ${F} > ${F}.new
mv ${F}.new ${F}
fi
done
AC_SUBST_FILE(PLATFORM_BASE_WITHS)
AC_SUBST_FILE(PROTO_CLIENT_WITHS)
AC_SUBST_FILE(PROTO_SERVER_WITHS)
AC_SUBST_FILE(PO_CATREF_WITHS)
AC_SUBST_FILE(PO_CREATEREF_WITHS)
#################################################
# Consistency checks
#################################################
# Shared libs build requires gprbuild
AS_IF(test "$HAVE_GPRBUILD:${enable_shared:-no}" = "no:yes",
[AC_MSG_FAILURE("--enable-shared requires gprbuild")])
# COS require CORBA
corba_enabled=`echo ${APPLI_LIST} | ${AWK} '/corba/{print "yes"}'`
AS_IF(test x"$SERVICE_LIST" != x" " -a x$corba_enabled != xyes,
[AC_MSG_FAILURE("CORBA COS require CORBA application personality")])
#################################################
# Build code fragments to be substituted in
# Makefile
#################################################
LOCAL_MAKEFILES=config.local.makefiles
(
echo "test_targets :="
(cd ${srcdir} && find . -name Makefile.local) | sed "s,^\./,," | \
while read mklocal; do
testdir="`dirname ${mklocal}`/"
echo "current_dir := ${testdir}"
echo "test_target := ${testdir}build-test"
echo "include \$(top_srcdir)/${mklocal}"
echo "test_targets += \${test_target}"
done) > ${LOCAL_MAKEFILES}
AC_SUBST_FILE(LOCAL_MAKEFILES)
# GNATDIST version
# This is set differently for the GLADE and PolyORB distributions, which
# share the same source tree.
GNATDIST_VERSION="$POLYORB_VERSION"
AC_SUBST(GNATDIST_VERSION)
##########################################
# Last orders
##########################################
AC_SUBST_FILE(EXCLUDED_SOURCE_FILES)
WITH_EXTRA_PRJS=`with_projects $EXTRA_PRJS`
AC_SUBST(WITH_EXTRA_PRJS)
##########################################
# Output generated files
##########################################
AC_CONFIG_HEADERS([src/config.h])
AC_CONFIG_LINKS([src/polyorb-smart_pointers-sync_counters.adb:src/polyorb-smart_pointers-sync_counters__$SYNC_COUNTERS_IMPL.adb
testsuite/projects/polyorb_config.gpr:projects/polyorb_config.gpr
testsuite/projects/polyorb_common.gpr:projects/polyorb_common.gpr])
AC_OUTPUT(FILTER_OUTPUT_FILES(OUTPUT_FILTER,[
Makefile
Makefile.common
Makefile.common.project
compilers/common_files/platform.ads
compilers/config.adc
compilers/gnatdist/xe_defs-defaults.ads
compilers/gnatprfh/gnatprfh.adb
doc/Makefile
doc/polyorb_version.py
projects/polyorb.gpr
projects/polyorb_config.gpr
projects/polyorb_src_setup.gpr
projects-distrib/polyorb.gpr
projects-distrib/polyorb/polyorb_install_common.gpr
projects-distrib/polyorb/polyorb_src_setup.gpr
src/config.adc
src/src.exclude
src/setup/polyorb-setup-base.adb
src/setup/polyorb-setup-client_base.adb
src/setup/polyorb-setup-server.adb
src/setup/polyorb-setup-tasking-full_tasking.adb
src/polyorb-platform.ads
src/polyorb-platform-ssl_linker_options.ads
src/ravenscar.adc
src/ravenscar_compatible.adc
contrib/idlac_wrapper/idlac_wrapper
examples/corba/secure_echo/gssup.conf
examples/corba/secure_echo/tls.conf
examples/corba/secure_echo/tls_gssup.conf
testsuite/tests/config.py
tools/po_catref/po_catref_setup.adb
tools/po_createref/po_createref_setup.adb
polyorb-config
]),
[
##########################################
# Copy files
##########################################
mkdir support 2> /dev/null
for a in support/gentexifile \