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 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242
|
# -*- Makefile -*-
#
# Make rule template for autoconf builds, sourced before dir.mk
#
# Based upon beforedir.mk and platform makefiles
platform = autoconf
MAKEFILE_INC_DIR = $(BASE_OMNI_TREE)/$(CURRENT)/
IMPORT_TREES = $(TOP) $(BASE_OMNI_TREE)
THIS_IMPORT_TREE = $(TOP)
EXPORT_TREE = $(TOP)
PYTHON = @PYTHON@
# If the build tree is the same as the source tree, autoconf helpfully
# clears any makefile lines that set VPATH. We put it back here.
ifndef VPATH
VPATH=.
endif
#############################################################################
#
# Standard directories in import/export trees
#
INCDIR = include
IDLDIR = idl
MAKEDIR = mk
LIBDIR = lib
BINDIR = bin
#############################################################################
#
# Directories for installation
#
prefix := @prefix@
exec_prefix := @exec_prefix@
PYTHON_PREFIX := @prefix@
PYTHON_EXEC_PREFIX := @exec_prefix@
INSTALLTARGET := 1
INSTALLINCDIR := $(DESTDIR)@includedir@
INSTALLBINDIR := $(DESTDIR)@bindir@
INSTALLLIBDIR := $(DESTDIR)@libdir@
INSTALLPYTHONDIR := $(DESTDIR)/usr/lib/omniidl
INSTALLPYEXECDIR := $(DESTDIR)/usr/lib/omniidl
INSTALLIDLDIR := $(DESTDIR)@datadir@/idl
#############################################################################
#
# Cross compilation
#
ifeq (@CROSS_COMPILING@,yes)
CrossCompiling = 1
endif
#############################################################################
#
# Tool bindir to use depends on make target
#
ifndef CrossCompiling
ifeq ($(MAKECMDGOALS),install)
TOOLBINDIR = $(INSTALLBINDIR)
else
TOOLBINDIR = $(TOP)/$(BINDIR)
endif
OMNIORB_IDL_ONLY = $(TOOLBINDIR)/omniidl -bcxx
else
OMKDEPEND = @OMKDEPEND@
OMNIORB_IDL_ONLY = @OMNIIDL@ -bcxx
endif
#############################################################################
#
# These definitions are useful for referring to spaces and commas inside
# GNU make functions
#
empty :=
space := $(empty) $(empty)
comma := ,
#############################################################################
#
# DIR_CPPFLAGS can be defined in dir.mk.
# IMPORT_CPPFLAGS can have platform-independent -D and -I flags added by each
# import tree using +=. Note that here we already put a -I flag for each
# directory in VPATH and each import tree's include directory.
#
# CXXDEBUGFLAGS and CDEBUGFLAGS are for setting debug/optimisation options to
# the C++ and C compilers respectively. CXXOPTIONS and COPTIONS are for
# setting any other options to the compilers.
#
# There is nothing magic about these variables, but hopefully this covers
# most of the things people will want to set in other import trees and dir.mk.
#
IMPORT_CPPFLAGS += -I. $(patsubst %,-I%,$(VPATH)) \
-I$(TOP)/include -I$(BASE_OMNI_TREE)/include \
-D__OSVERSION__=@OSVERSION@
CPPFLAGS = @CPPFLAGS@ $(DIR_CPPFLAGS) $(IMPORT_CPPFLAGS)
CFLAGS = $(CDEBUGFLAGS) $(COPTIONS) $(CPPFLAGS)
CXXFLAGS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) $(CPPFLAGS)
#############################################################################
#
# GENERATE_LIB_DEPEND is a variable which behaves more like a "function",
# taking a single argument, the current value of $(lib_depend). What it does
# is search through the IMPORT_LIBRARY_DIRS for the library specified in
# lib_depend. It is used with ":=" (simply-expanded variables) like this:
#
# lib_depend := libwobble.a
# WOBBLE_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
#
# $(WOBBLE_LIB_DEPEND) can now be specified as one of the dependencies of an
# executable which uses "libwobble.a", so that the executable will be rebuilt
# whenever libwobble.a changes.
#
IMPORT_LIBRARY_DIRS = $(patsubst %,%/$(LIBDIR),$(IMPORT_TREES))
GENERATE_LIB_DEPEND = $(firstword \
$(foreach dir,$(IMPORT_LIBRARY_DIRS),$(wildcard $(dir)/$(lib_depend))))
#############################################################################
#
# Phony targets
#
.PHONY: all export install clean veryclean redepend lastveryclean
#############################################################################
#
# MakeSubdirs is a general rule which runs make in each of SUBDIRS.
# Unfortunately we have to unset MAKEFLAGS otherwise the -I flags which
# make passed to this make will be incorrectly passed down to the sub-make.
#
OMNI_MAKEFLAGS = $(filter -j% --j%, $(MAKEFLAGS))
define MakeSubdirs
(MAKEFLAGS='$(OMNI_MAKEFLAGS)'; \
set -e; \
if [ "$$subdir_makeflags" = "" ]; then \
subdir_makeflags='$(SUBDIR_MAKEFLAGS)'; \
fi; \
if [ "$$subdirs" = "" ]; then \
subdirs='$(SUBDIRS)'; \
fi; \
if [ "$$target" = "" ]; then \
target='$@'; \
fi; \
for dir in $$subdirs ; do \
$(CreateDir); \
(cd $$dir ; echo "making $$target in $(CURRENT)/$$dir..." ; \
eval $(MAKE) $$subdir_makeflags $$target ) ; \
if [ $$? != 0 ]; then \
exit 1; \
fi; \
done; \
)
endef
# Stop SUBDIRS specified on the command line being passed down.
unexport SUBDIRS
#############################################################################
#
# Useful bits of shell script. Most take arguments as shell variables which
# can be set before putting them in your make rule.
#
#
# Create directory $$dir if it doesn't already exist.
#
define CreateDir
if [ ! -d $$dir ]; then \
(umask 022; set -x; $(MKDIRHIER) $$dir); \
fi
endef
#
# Find $$file in $$dirs. Returns full file name in $$fullfile.
#
define FindFileInDirs
case "$$file" in \
/*) fullfile="$$file";; \
*) \
fullfile=""; \
for _dir in $$dirs; do \
if [ -f $$_dir/$$file ]; then \
if [ "$$_dir" = "." ]; then \
fullfile="$$file"; \
else \
fullfile="$$_dir/$$file"; \
fi; \
break; \
fi; \
done; \
if [ ! "$$fullfile" ]; then \
echo "ERROR: Cannot find $$file in $$dirs"; \
exit 1; \
fi;; \
esac
endef
#
# Find $$file in current directory or $(VPATH) - returns $$fullfile.
#
define FindFileInVpath
dirs='. $(VPATH)'; \
$(FindFileInDirs)
endef
#
# "Export" $$file to $$dir, creating $$dir if necessary. Searches for
# $$file in $(VPATH) if not found in current directory.
#
define ExportFileToDir
$(CreateDir); \
$(FindFileInVpath); \
base=`basename $$file`; \
if [ -f $$dir/$$base ] && cmp $$fullfile $$dir/$$base >/dev/null; then \
echo "File $$base hasn't changed."; \
else \
(set -x; \
$(INSTALL) $(INSTLIBFLAGS) $$fullfile $$dir); \
fi
endef
#
# "Export" an executable file. Same as previous one but adds execute
# permission.
#
define ExportExecutableFileToDir
$(CreateDir); \
$(FindFileInVpath); \
base=`basename $$file`; \
if [ -f $$dir/$$base ] && cmp $$fullfile $$dir/$$base >/dev/null; then \
echo "File $$base hasn't changed."; \
else \
(set -x; \
$(INSTALL) $(INSTEXEFLAGS) $$fullfile $$dir); \
fi
endef
#############################################################################
#
# CORBA stuff
#
include $(BASE_OMNI_TREE)/mk/version.mk
# It is now possible to compile interfaces and stubs that depend on
# idl from import trees without generating headers and stubs for those
# imported idls locally. This is useful when the import tree supplies
# the headers and stubs itself, usually as part of some library.
#
# To arrange this, set DIR_IDLFLAGS and DIR_STUBS_CPPFLAGS in your
# dir.mk to the appropriate include flags. Usually, these will just
# be the ones in IMPORT_IDLFLAGS and IMPORT_CPPFLAGS defined here, so
#
# DIR_IDLFLAGS = $(IMPORT_IDLFLAGS)
# DIR_STUBS_CPPFLAGS = $(IMPORT_CPPFLAGS)
#
# is all you need. This would be the default if it weren't for the
# need to preserve the old (idl-copying) behaviour for existing dir.mk
# files.
vpath %.idl $(IMPORT_TREES:%=%/idl)
IMPORT_IDLFLAGS += -I. $(patsubst %,-I%,$(VPATH)) \
$(patsubst %,-I%/idl,$(IMPORT_TREES))
CORBA_IDL_FILES = $(CORBA_INTERFACES:%=%.idl)
CORBA_STUB_DIR = $(TOP)/stub
CorbaImplementation = OMNIORB
CORBA_IDL = $($(CorbaImplementation)_IDL)
CORBA_CPPFLAGS = $($(CorbaImplementation)_CPPFLAGS)
CORBA_LIB = $($(CorbaImplementation)_LIB)
CORBA_LIB_DEPEND = $($(CorbaImplementation)_LIB_DEPEND)
CORBA_LIB_NODYN = $($(CorbaImplementation)_LIB_NODYN)
CORBA_LIB_NODYN_DEPEND = $($(CorbaImplementation)_LIB_NODYN_DEPEND)
CORBA_IDL_OUTPUTDIR_PATTERN = $($(CorbaImplementation)_IDL_OUTPUTDIR_PATTERN)
CORBA_STUB_HDR_PATTERN = $($(CorbaImplementation)_STUB_HDR_PATTERN)
CORBA_STUB_SRC_PATTERN = $($(CorbaImplementation)_STUB_SRC_PATTERN)
CORBA_STUB_OBJ_PATTERN = $($(CorbaImplementation)_STUB_OBJ_PATTERN)
CORBA_DYN_STUB_SRC_PATTERN = $($(CorbaImplementation)_DYN_STUB_SRC_PATTERN)
CORBA_DYN_STUB_OBJ_PATTERN = $($(CorbaImplementation)_DYN_STUB_OBJ_PATTERN)
CORBA_STUB_HDRS = \
$(CORBA_INTERFACES:%=$(CORBA_STUB_HDR_PATTERN))
CORBA_STUB_SRCS = $($(CorbaImplementation)_STUB_SRCS)
CORBA_STUB_OBJS = $($(CorbaImplementation)_STUB_OBJS)
CORBA_STATIC_STUB_SRCS = $($(CorbaImplementation)_STATIC_STUB_SRCS)
CORBA_STATIC_STUB_OBJS = $($(CorbaImplementation)_STATIC_STUB_OBJS)
CORBA_DYN_STUB_SRCS = $($(CorbaImplementation)_DYN_STUB_SRCS)
CORBA_DYN_STUB_OBJS = $($(CorbaImplementation)_DYN_STUB_OBJS)
CORBA_STUB_FILES = $(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%.idl) \
$(CORBA_STUB_HDRS) $(CORBA_STUB_SRCS) $(CORBA_STUB_OBJS) \
$(CORBA_STUB_OBJS:.o=.d) $(CORBA_STUB_DIR)/dir.mk \
$($(CorbaImplementation)_EXTRA_STUB_FILES)
GENERATED_CXX_HDRS += $(CORBA_STUB_HDRS)
#
# Standard make variables and rules for all UNIX platforms. Override
# later if necessary.
#
UnixPlatform = 1
ThreadSystem = Posix
#
# General rules for cleaning.
#
define CleanRule
$(RM) *.o *.a
endef
define VeryCleanRule
$(RM) *.d
$(RM) *.pyc
$(RM) $(CORBA_STUB_FILES)
endef
#
# Patterns for various file types
#
LibPathPattern = -L%
LibNoDebugPattern = lib%.a
LibDebugPattern = lib%.a
LibPattern = lib%.a
LibSuffixPattern = %.a
LibSearchPattern = -l%
BinPattern = %
TclScriptPattern = %
#
# Stuff to generate statically-linked libraries.
#
define StaticLinkLibrary
(set -x; \
$(RM) $@; \
$(AR) $@ $^; \
$(RANLIB) $@; \
)
endef
define ExportLibraryToDir
(files="$^"; \
for file in $$files; do \
$(ExportFileToDir); \
done; \
)
endef
ifdef EXPORT_TREE
define ExportLibrary
(dir="$(EXPORT_TREE)/$(LIBDIR)"; \
$(ExportLibraryToDir) \
)
endef
endif
define InstallLibrary
(dir="$(INSTALLLIBDIR)"; \
$(ExportLibraryToDir) \
)
endef
#
# Stuff to generate executable binaries.
#
# These rules are used like this
#
# target: objs lib_depends
# @(libs="libs"; $(...Executable))
#
# The command we want to generate is like this
#
# linker -o target ... objs libs
# i.e. we need to filter out the lib_depends from the command
#
IMPORT_LIBRARY_FLAGS = $(patsubst %,$(LibPathPattern),$(IMPORT_LIBRARY_DIRS))
define CXXExecutable
(set -x; \
$(RM) $@; \
$(CXXLINK) -o $@ $(CXXLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
$(filter-out $(LibSuffixPattern),$^) $$libs; \
)
endef
define CExecutable
(set -x; \
$(RM) $@; \
$(CLINK) -o $@ $(CLINKOPTIONS) $(IMPORT_LIBRARY_FLAGS) \
$(filter-out $(LibSuffixPattern),$^) $$libs; \
)
endef
ifdef EXPORT_TREE
define ExportExecutable
(dir="$(EXPORT_TREE)/$(BINDIR)"; \
files="$^"; \
for file in $$files; do \
$(ExportExecutableFileToDir); \
done; \
)
endef
endif
define InstallExecutable
(dir="$(INSTALLBINDIR)"; \
files="$^"; \
for file in $$files; do \
$(ExportExecutableFileToDir); \
done; \
)
endef
# omnithread - platform libraries required by omnithread.
# Use when building omnithread.
OMNITHREAD_PLATFORM_LIB = $(filter-out $(patsubst %,$(LibSearchPattern),\
omnithread), $(OMNITHREAD_LIB))
#
# omniORB stuff
#
CorbaImplementation = OMNIORB
lib_depend := $(patsubst %,$(LibPattern),omniORB$(OMNIORB_MAJOR_VERSION))
omniORB_lib_depend := $(GENERATE_LIB_DEPEND)
lib_depend := $(patsubst %,$(LibPattern),omniDynamic$(OMNIORB_MAJOR_VERSION))
omniDynamic_lib_depend := $(GENERATE_LIB_DEPEND)
OMNIORB_DLL_NAME = $(patsubst %,$(LibSearchPattern),\
omniORB$(OMNIORB_MAJOR_VERSION))
OMNIORB_DYNAMIC_DLL_NAME = $(patsubst %,$(LibSearchPattern),\
omniDynamic$(OMNIORB_MAJOR_VERSION))
OMNIORB_IDL_ANY_FLAGS = -Wba
OMNIORB_IDL = $(OMNIORB_IDL_ONLY) $(OMNIORB_IDL_ANY_FLAGS)
OMNIORB_CPPFLAGS = -D__OMNIORB$(OMNIORB_MAJOR_VERSION)__ \
-I$(CORBA_STUB_DIR) $(OMNITHREAD_CPPFLAGS)
OMNIORB_IDL_OUTPUTDIR_PATTERN = -C%
OMNIORB_LIB = $(OMNIORB_DLL_NAME) $(OMNIORB_DYNAMIC_DLL_NAME)
OMNIORB_LIB_NODYN = $(OMNIORB_DLL_NAME)
OMNIORB_LIB_NODYN_DEPEND = $(omniORB_lib_depend)
OMNIORB_LIB_DEPEND = $(omniORB_lib_depend) $(omniDynamic_lib_depend)
OMNIORB_STATIC_STUB_OBJS = \
$(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.o)
OMNIORB_STATIC_STUB_SRCS = \
$(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%SK.cc)
OMNIORB_DYN_STUB_OBJS = \
$(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.o)
OMNIORB_DYN_STUB_SRCS = \
$(CORBA_INTERFACES:%=$(CORBA_STUB_DIR)/%DynSK.cc)
OMNIORB_STUB_SRCS = $(OMNIORB_STATIC_STUB_SRCS) $(OMNIORB_DYN_STUB_SRCS)
OMNIORB_STUB_OBJS = $(OMNIORB_STATIC_STUB_OBJS) $(OMNIORB_DYN_STUB_OBJS)
OMNIORB_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%SK.cc
OMNIORB_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%SK.o
OMNIORB_DYN_STUB_SRC_PATTERN = $(CORBA_STUB_DIR)/%DynSK.cc
OMNIORB_DYN_STUB_OBJ_PATTERN = $(CORBA_STUB_DIR)/%DynSK.o
OMNIORB_STUB_HDR_PATTERN = $(CORBA_STUB_DIR)/%.hh
# thread libraries required by omniORB. Make sure this is the last in
# the list of omniORB related libraries
OMNIORB_LIB += $(OMNITHREAD_LIB) $(SOCKET_LIB)
OMNIORB_LIB_NODYN += $(OMNITHREAD_LIB) $(SOCKET_LIB)
OMNIORB_LIB_DEPEND += $(OMNITHREAD_LIB_DEPEND)
OMNIORB_LIB_NODYN_DEPEND += $(OMNITHREAD_LIB_DEPEND)
OMNITHREAD_LIB = $(patsubst %,$(LibSearchPattern),omnithread)
# CodeSets library
OMNIORB_CODESETS_LIB = $(patsubst %,$(LibSearchPattern),omniCodeSets$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omniCodeSets$(OMNIORB_MAJOR_VERSION))
OMNIORB_CODESETS_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
# Connections library
OMNIORB_CONNECTIONS_LIB = $(patsubst %,$(LibSearchPattern),omniConnectionMgmt$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omniConnectionMgmt$(OMNIORB_MAJOR_VERSION))
OMNIORB_CONNECTIONS_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
# omniORB SSL transport
OMNIORB_SSL_VERSION = $(OMNIORB_VERSION)
OMNIORB_SSL_MAJOR_VERSION = $(word 1,$(subst ., ,$(OMNIORB_SSL_VERSION)))
OMNIORB_SSL_MINOR_VERSION = $(word 2,$(subst ., ,$(OMNIORB_SSL_VERSION)))
OMNIORB_SSL_LIB = $(patsubst %,$(LibSearchPattern),\
omnisslTP$(OMNIORB_SSL_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omnisslTP$(OMNIORB_SSL_MAJOR_VERSION))
OMNIORB_SSL_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB_SSL_LIB += $(OPEN_SSL_LIB)
OMNIORB_SSL_CPPFLAGS += $(OPEN_SSL_CPPFLAGS)
# omniORB HTTP transport
OMNIORB_HTTP_LIB = $(patsubst %,$(LibSearchPattern),\
omnihttpTP$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omnihttpTP$(OMNIORB_MAJOR_VERSION))
OMNIORB_HTTP_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB_HTTP_LIB += $(OMNIORB_SSL_LIB)
OMNIORB_HTTP_CPPFLAGS += $(OPEN_SSL_CPPFLAGS)
# omniORB HTTP Crypto library
OMNIORB_HTTP_CRYPTO_LIB = $(patsubst %,$(LibSearchPattern),\
omnihttpCrypto$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omnihttpCrypto$(OMNIORB_MAJOR_VERSION))
OMNIORB_HTTP_CRYPTO_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB_HTTP_CRYPTO_LIB += $(OMNIORB_HTTP_LIB)
# ZIOP
OMNIORB_ZIOP_LIB = $(patsubst %,$(LibSearchPattern),omniZIOP$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omniZIOP$(OMNIORB_MAJOR_VERSION))
OMNIORB_ZIOP_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB_ZIOP_DYNAMIC_LIB = $(patsubst %,$(LibSearchPattern),omniZIOPDynamic$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),omniZIOPDynamic$(OMNIORB_MAJOR_VERSION))
OMNIORB_ZIOP_DYNAMIC_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
# COS
OMNIORB_COS_LIB = $(patsubst %,$(LibSearchPattern),COS$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),COS$(OMNIORB_MAJOR_VERSION))
OMNIORB_COS_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
OMNIORB_COS_DYNAMIC_LIB = $(patsubst %,$(LibSearchPattern),COSDynamic$(OMNIORB_MAJOR_VERSION))
lib_depend := $(patsubst %,$(LibPattern),COSDynamic$(OMNIORB_MAJOR_VERSION))
OMNIORB_COS_DYNAMIC_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
##########################################################################
#
# Shared library support stuff
#
# Default setup. Work for most platforms. For those exceptions, override
# the rules in their platform files.
#
BuildSharedLibrary = 1 # Enable by default
SHAREDLIB_SUFFIX = so
SharedLibraryFullNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
SharedLibrarySoNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3
SharedLibraryLibNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX)
SharedLibraryImplibNameTemplate = lib$$1$$2.a
SharedLibraryPlatformLinkFlagsTemplate = -shared -Wl,-soname,$$soname
define SharedLibraryFullName
fn() { \
if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \
echo $(SharedLibraryFullNameTemplate); \
}; fn
endef
define SharedLibraryImplibName
fn() { \
if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi ; \
echo $(SharedLibraryImplibNameTemplate); \
}; fn
endef
define ParseNameSpec
set $$namespec ; \
if [ $$2 = "_" ] ; then set $$1 "" $$3 $$4 ; fi
endef
# MakeCXXSharedLibrary- Build shared library
# Expect shell variable:
# namespec = <library name> <major ver. no.> <minor ver. no.> <micro ver. no>
# extralibs = <libraries to add to the link line>
#
# e.g. namespec="COS 3 0 0" --> shared library libCOS3.so.0.0
# extralibs="$(OMNIORB_LIB)"
#
define MakeCXXSharedLibrary
$(ParseNameSpec); \
soname=$(SharedLibrarySoNameTemplate); \
set -x; \
$(RM) $@; \
$(CXX) @LDFLAGS@ $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \
$(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs;
endef
# ExportSharedLibrary- export sharedlibrary
# Expect shell variable:
# namespec = <library name> <major ver. no.> <minor ver. no.> <micro ver. no>
# e.g. namespec = "COS 3 0 0" --> shared library libCOS3.so.0.0
#
define ExportSharedLibraryToDir
$(ExportLibraryToDir); \
$(ParseNameSpec); \
soname=$(SharedLibrarySoNameTemplate); \
libname=$(SharedLibraryLibNameTemplate); \
set -x; \
cd $$dir; \
$(RM) $$soname; \
ln -s $(<F) $$soname; \
$(RM) $$libname; \
ln -s $$soname $$libname;
endef
define ExportSharedLibrary
dir="$(EXPORT_TREE)/$(LIBDIR)"; \
$(ExportSharedLibraryToDir)
endef
define ExportImplibLibrary
dir="$(EXPORT_TREE)/$(LIBDIR)"; \
$(ExportLibraryToDir)
endef
define InstallSharedLibrary
dir="$(INSTALLLIBDIR)"; \
$(ExportSharedLibraryToDir)
endef
define InstallImplibLibrary
dir="$(INSTALLLIBDIR)"; \
$(ExportLibraryToDir)
endef
define CleanSharedLibrary
( set -x; \
$(RM) $${dir:-.}/*.$(SHAREDLIB_SUFFIX).* )
endef
define CleanImplibLibrary
( set -x; \
$(RM) $${dir:-.}/*.a )
endef
# Pattern rules to build objects files for static and shared library.
# The convention is to build the static library in the subdirectoy "static" and
# the shared library in the subdirectory "shared".
# The pattern rules below ensure that the right compiler flags are used
# to compile the source for the library.
static/%.o: %.cc
$(CXX) -c $(CXXFLAGS) -o $@ $<
shared/%.o: %.cc
$(CXX) -c $(SHAREDLIB_CPPFLAGS) $(CXXFLAGS) -o $@ $<
static/%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
SHAREDLIB_CFLAGS = $(SHAREDLIB_CPPFLAGS)
shared/%.o: %.c
$(CC) -c $(SHAREDLIB_CFLAGS) $(CFLAGS) -o $@ $<
#
# Replacements for implicit rules
#
%.o: %.c
$(CC) -c $(CFLAGS) -o $@ $<
%.o: %.cc
$(CXX) -c $(CXXFLAGS) -o $@ $<
###########################################################################
#
# Things figured out by autoconf
#
#
# Standard unix programs - note that GNU make already defines some of
# these such as AR, RM, etc (see section 10.3 of the GNU make manual).
#
AR = ar cq
CC = @CC@
CXX = @CXX@
RANLIB = @RANLIB@
MKDIRHIER = mkdir -p
INSTLIBFLAGS = -m 0644
INSTEXEFLAGS = -m 0755
CP = cp
MV = mv -f
CPP = @CPP@
RMDIRHIER = $(RM) -rf
CXXMAKEDEPEND = @CXX@ -M -MD -MG
CMAKEDEPEND = @CC@ -M -MD -MG
#
# Platform, processor and compiler
#
@PLATFORM_NAME@ = 1
@PROCESSOR_NAME@ = 1
@COMPILER_NAME@ = 1
#
# File locations
#
OMNIORB_CONFIG_DEFAULT_LOCATION = @OMNIORB_CONFIG@
OMNINAMES_LOG_DEFAULT_LOCATION = @OMNINAMES_LOGDIR@
#
# OpenSSL
#
OPEN_SSL_ROOT = @OPEN_SSL_ROOT@
OPEN_SSL_LIB = @OPEN_SSL_LIB@
OPEN_SSL_CPPFLAGS = @OPEN_SSL_CPPFLAGS@
#
# Static libraries?
#
ifeq (@ENABLE_STATIC@,no)
NoStaticLibrary = 1
endif
#
# Disable long double?
#
ifeq (@ENABLE_LONGDOUBLE@,no)
DisableLongDouble = 1
endif
#
# Enable ZIOP?
#
ifeq (@ENABLE_ZIOP@,yes)
EnableZIOP = 1
endif
ifeq (@ENABLE_ZIOP_ZLIB@,yes)
EnableZIOPZLib = 1
endif
ifeq (@ENABLE_ZIOP_ZSTD@,yes)
EnableZIOPZStd = 1
endif
#
# Enable HTTP Crypto?
#
ifeq (@ENABLE_HTTP_CRYPTO@,yes)
EnableHTTPCrypto = 1
endif
###########################################################################
#
# Default compiler rules
#
CDEBUGFLAGS = @CFLAGS@
CLINK = $(CC)
CLINKOPTIONS = @LDFLAGS@ $(CDEBUGFLAGS) $(COPTIONS)
CXXDEBUGFLAGS = @CXXFLAGS@
CXXLINK = $(CXX)
CXXLINKOPTIONS = @LDFLAGS@ $(CXXDEBUGFLAGS) $(CXXOPTIONS)
###########################################################################
#
# OS independent compiler dependencies
#
ifdef Compiler_GCC
CXXOPTIONS = -Wall -Wno-unused -fexceptions @EXTRA_GCC_CXXFLAGS@
EgcsMajorVersion = 1
EgcsMinorVersion = 1
SHAREDLIB_CPPFLAGS = -fPIC
endif
###########################################################################
#
# OS dependencies
#
# So much for autoconfiguration... ;-)
###################
ifdef Linux
OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT
OMNITHREAD_LIB += -lpthread
endif
###################
ifdef kFreeBSD
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT -pthread
OMNITHREAD_LIB += -lpthread
endif
###################
ifdef GNU
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT -pthread
OMNITHREAD_LIB += -lpthread
endif
###################
ifdef SunOS
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -DUsePthread -D_REENTRANT $(CXXMTFLAG)
SOCKET_LIB = -lsocket -lnsl
THREAD_LIB = -lthread $(CXXMTFLAG)
OMNITHREAD_LIB += -lpthread -lposix4 $(CXXMTFLAG)
ifdef Compiler_GCC
SharedLibraryPlatformLinkFlagsTemplate = -shared -Wl,-h,$$soname
endif
ifdef Compiler_Sun5
SharedLibraryPlatformLinkFlagsTemplate = -G -h $$soname
PythonLibraryPlatformLinkFlagsTemplate = -G -h $$soname -lCrun
CXXMAKEDEPEND += -D__SUNPRO_CC
CXXDEBUGFLAGS = -O2 -g # Remove -g may cause problem with exception handling
# This is a problem with Sun C++ 5.0, see README.SunC++5
CXXMTFLAG = -mt
SHAREDLIB_CPPFLAGS = -KPIC
endif
ifdef Compiler_Sun4
CXXMTFLAG = -mt
CXXDEBUGFLAGS = -O2 -g
SHAREDLIB_CPPFLAGS = -KPIC
SharedLibraryPlatformLinkFlagsTemplate = -G -h $$soname
PythonLibraryPlatformLinkFlagsTemplate = -G -h $$soname -lC
endif
endif
###################
ifdef OSF1
ifeq (@OSVERSION@,3)
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=4 -DNoNanoSleep
else
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 -DNoNanoSleep
endif
OMNITHREAD_CPPFLAGS = -pthread
CXXOPTIONS += -pthread
AR = ar clq
OMNITHREAD_LIB += -lmach -lc_r
define MakeCXXSharedLibrary
$(ParseNameSpec); \
soname=$(SharedLibrarySoNameTemplate); \
set -x; \
$(RM) $@; \
ld -shared -soname $$soname -set_version $$soname -o $@ \
$(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs \
-lpthread -lcxxstd -lcxx -lexc -lots -lc;
endef
ifdef Compiler_DEC61
DecCxxMajorVersion = 6
DecCxxMinorVersion = 1
CXXOPTIONS += -ptr $(TOP)/cxx_respository
CXXDEBUGFLAGS = -O
CXXLINKOPTIONS += -call_shared
CMAKEDEPEND += -D__DECC
CXXMAKEDEPEND += -D__DECCXX
endif
ifdef Compiler_DEC62
DecCxxMajorVersion = 6
DecCxxMinorVersion = 2
CXXOPTIONS += -ptr $(TOP)/cxx_respository
CXXDEBUGFLAGS = -O
CXXLINKOPTIONS += -call_shared
CMAKEDEPEND += -D__DECC
CXXMAKEDEPEND += -D__DECCXX -D__DECCXX_VER=60290024
endif
endif
###################
ifdef HPUX
INSTLIBFLAGS = -m 0755
ifeq (@OSVERSION@,10)
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=4
OMNITHREAD_CPPFLAGS += -D_REENTRANT
OMNITHREAD_LIB += -ldce -lcma
else
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10
endif
define StaticLinkLibrary
(set -x; \
$(RM) $@; \
$(CXX) -c +inst_close $^; \
$(AR) $@ $^; \
$(RANLIB) $@; \
)
endef
ifdef ia64Processor
SHAREDLIB_SUFFIX = so
endif
ifndef ia64Processor
SHAREDLIB_SUFFIX = sl
endif
ifdef Compiler_KCC
AR = KCC --thread_safe -o
CXXDEBUGFLAGS = +K0 --one_per --thread_safe --exceptions +Z
CXXLINKOPTIONS = $(CXXDEBUGFLAGS) $(CXXOPTIONS) -Bdynamic --thread_safe \
--exceptions
SHAREDLIB_CPPFLAGS = +Z
SharedLibraryPlatformLinkFlagsTemplate = --thread_safe --soname $$soname
endif
ifdef Compiler_GCC
# -D_CMA_NOWRAPPERS_ is needed otherwise linking omniNames results in
# /opt/aCC/lbin/ld: Unsatisfied symbols:
# fstreambase::cma_close(void)(code)
CXXOPTIONS = -Wall -Wno-unused \
-D_CMA_NOWRAPPERS_ @EXTRA_GCC_CXXFLAGS@
SharedLibraryPlatformLinkFlagsTemplate = -Wl,-b -Wl,+h$$soname -lCsup
endif
ifdef Compiler_aCC
CXXDEBUGFLAGS = -O
CXXOPTIONS += -AA -w -mt
CDEBUGFLAGS = -O
COPTIONS = -w -mt
SharedLibraryPlatformLinkFlagsTemplate = -b -Wl,+h$$soname -lCsup
endif
endif
###################
ifdef NextStep
ThreadSystem = Mach
OMNITHREAD_CPPFLAGS = -D_REENTRANT
ifdef Compiler_GCC
CXXOPTIONS += -fhandle-exceptions -Wall -Wno-unused
endif
endif
###################
ifdef IRIX
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \
-DPthreadSupportThreadPriority
OMNITHREAD_LIB += -lpthread
# *** FIXME. How do we know what ABI to use? Perhaps it has to be a
# configure option?
ABIFLAG = -n32
ifdef Compiler_SGI
CXXMAKEDEPEND += -D__SGI_CC
CXXDEBUGFLAGS = -O2 -OPT:Olimit=0
CXXWOFFOPTIONS = -woff 3303,1110,1182
CXXOPTIONS = $(ABIFLAG) -float -ansi -LANG:exceptions=ON $(CXXWOFFOPTIONS)
COPTIONS = $(ABIFLAG)
endif
endif
###################
ifdef AIX
ifndef Compiler_GCC # Assuming XlC compiler
CMAKEDEPEND += -D_AIX
CXXMAKEDEPEND += -D_AIX
CDEBUGFLAGS =
CXXDEBUGFLAGS =
CXXLINKOPTIONS += -brtl -bnoipath -blibpath:/usr/lib:$(prefix)/lib
CXXOPTIONS = -qstaticinline -qmaxmem=8192 -qlonglong -qlongdouble
COPTIONS = -qmaxmem=8192 -qlonglong -qlongdouble
OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT
OMNITHREAD_LIB += -lpthread
#SHAREDLIB_SUFFIX = so
PythonSHAREDLIB_SUFFIX = so
# this works only for xlc version >= 5
SharedLibraryPlatformLinkFlagsTemplate = -G -qmkshrobj \
-bnoipath -blibpath:/usr/lib:$(prefix)/lib
endif
ifdef Compiler_GCC
CMAKEDEPEND += -D_AIX
CXXMAKEDEPEND += -D_AIX
CXXLINKOPTIONS += -Wl,-brtl -Wl,-blibpath:/lib:/usr/lib:$(prefix)/lib
CLINKOPTIONS += -Wl,-brtl -Wl,-blibpath:/lib:/usr/lib:$(prefix)/lib
# Name all static libraries with -ar.a suffix.
LibPattern = lib%-ar.a
LibDebugPattern = lib%-ar.a
LibNoDebugPattern = lib%-ar.a
LibSuffixPattern = %-ar.a
# Name all shared libraries with .a suffix
LibSharedPattern = lib%.a
LibSharedSuffixPattern = %.a
LibSharedSearchPattern = -l%
# Link with shared libraries
LibSearchPattern = -l%$(OMNIORB_MINOR_VERSION)
# OMNI thread stuff
ThreadSystem = Posix
OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
OMNITHREAD_PLATFORM_LIB = -lpthreads
OMNITHREAD_LIB = -lomnithread$(OMNITHREAD_MAJOR_VERSION) $(OMNITHREAD_PLATFORM_LIB)
# Shared library support stuff
SHAREDLIB_SUFFIX = a
PythonSHAREDLIB_SUFFIX = so
SharedLibraryFullNameTemplate = lib$$1$$2$$3$$4.$(SHAREDLIB_SUFFIX)
SharedLibrarySoNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX).$$3
SharedLibraryLibNameTemplate = lib$$1$$2$$3.$(SHAREDLIB_SUFFIX)
SharedLibraryPlatformLinkFlagsTemplate = -shared -fPIC -Wl,-brtl -Wl,-blibpath:/lib:/usr/lib:$(prefix)/lib
endif # Compiler_GCC
endif # AIX
###################
ifdef Darwin
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=10 \
-DPthreadSupportThreadPriority -DNoNanoSleep
CXXOPTIONS = -fno-common @EXTRA_GCC_CXXFLAGS@
SHAREDLIB_SUFFIX = dylib
ifeq (@OMNI_USE_CFNETWORK_CONNECT@,yes)
CXXLINKOPTIONS += -framework CoreFoundation
endif
SharedLibraryFullNameTemplate = lib$$1$$2.$$3.$$4.$(SHAREDLIB_SUFFIX)
SharedLibrarySoNameTemplate = lib$$1$$2.$$3.$(SHAREDLIB_SUFFIX)
SharedLibraryLibNameTemplate = lib$$1$$2.$(SHAREDLIB_SUFFIX)
SharedLibraryPlatformLinkFlagsTemplate = -dynamiclib $(CXXLINKOPTIONS) \
-install_name $(INSTALLLIBDIR)/$(SharedLibraryFullNameTemplate) \
-compatibility_version $$2.$$3 \
-current_version $$2.$$3.$$4
PythonLibraryPlatformLinkFlagsTemplate = -bundle -undefined dynamic_lookup
PythonSHAREDLIB_SUFFIX = so
# Re-define 'ExportLibrary' to run 'ranlib' after the file is copied,
# for static libraries as otherwise the linker complains: "table of
# contents for archive: ???? is out of date; rerun ranlib(1) (can't
# load from it)"
#
define ExportLibraryToDir
(files="$^"; \
for file in $$files; do \
$(ExportFileToDir); \
base=`basename $$file`; \
if [ $${base%.a} != $$base ]; then (set -x; $(RANLIB) $$dir/$$base); fi; \
done; \
)
endef
endif
###################
ifdef FreeBSD
OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10
OMNITHREAD_LIB += -pthread
endif
###################
ifdef NetBSD
OMNITHREAD_CPPFLAGS = -D_REENTRANT
OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10
OMNITHREAD_LIB += -pthread
endif
###################
ifdef OpenBSD
OMNITHREAD_CPPFLAGS = -D_REENTRANT -D_THREAD_SAFE
OMNITHREAD_POSIX_CPPFLAGS = -DUsePthread -DPthreadDraftVersion=10
OMNITHREAD_LIB += -pthread
endif
###################
ifdef OSR5
COPTIONS = -fpcc-struct-return
OMNITHREAD_POSIX_CPPFLAGS = -DPthreadDraftVersion=6 \
-DPthreadSupportThreadPriority -DNoNanoSleep
endif
###################
ifdef Cygwin
MKDIRHIER = mkdir -p
CXXLINKOPTIONS += -Wl,--enable-auto-import
SHAREDLIB_CPPFLAGS =
OMNITHREAD_POSIX_CPPFLAGS = -DNoNanoSleep -DPthreadDraftVersion=10
OMNITHREAD_CPPFLAGS = -D_REENTRANT
OMNITHREAD_LIB += -lpthread
BinPattern = %.exe
SharedLibraryPlatformLinkFlagsTemplate = -shared -Wl,-soname=$$soname,--out-implib=$$implib,--export-dynamic,--enable-auto-import
define ExportLibraryToDir
(files="$^"; \
for file in $$files; do \
$(ExportExecutableFileToDir); \
done; \
)
endef
define MakeCXXSharedLibrary
$(ParseNameSpec); \
soname=$(SharedLibrarySoNameTemplate); \
implib=$(SharedLibraryImplibNameTemplate); \
set -x; \
$(RM) $@; \
$(CXX) $(SharedLibraryPlatformLinkFlagsTemplate) -o $@ \
$(IMPORT_LIBRARY_FLAGS) $(filter-out $(LibSuffixPattern),$^) $$extralibs;
endef
define ExportSharedLibrary
dir="$(EXPORT_TREE)/$(BINDIR)"; \
$(ExportSharedLibraryToDir)
endef
define ExportImplibLibrary
dir="$(EXPORT_TREE)/$(LIBDIR)"; \
$(ExportLibraryToDir)
endef
define InstallSharedLibrary
dir="$(INSTALLBINDIR)"; \
$(ExportSharedLibraryToDir)
endef
define InstallImplibLibrary
dir="$(INSTALLBINDIR)"; \
$(ExportLibraryToDir)
endef
SHAREDLIB_SUFFIX = dll
SharedLibraryFullNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX).$$3.$$4
SharedLibrarySoNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX).$$3
SharedLibraryLibNameTemplate = cyg$$1$$2.$(SHAREDLIB_SUFFIX)
SharedLibraryImplibNameTemplate = lib$$1$$2.dll.a
endif
###########################################################################
#
# Final things
#
lib_depend := $(patsubst %,$(LibPattern),omnithread)
OMNITHREAD_LIB_DEPEND := $(GENERATE_LIB_DEPEND)
|