| 1 |
# -*- Makefile -*- |
| 2 |
|
| 3 |
# We always include config-linux.h on Linux platforms. |
| 4 |
ACE_PLATFORM_CONFIG ?= config-linux.h |
| 5 |
|
| 6 |
debug ?= 1 |
| 7 |
optimize ?= 1 |
| 8 |
threads ?= 1 |
| 9 |
insure ?= 0 |
| 10 |
|
| 11 |
LSB_RELEASE_ID := $(shell lsb_release -i 2> /dev/null || echo Distributor ID: Unknown) |
| 12 |
LSB_RELEASE_RELEASE := $(shell lsb_release -r 2> /dev/null || echo Release: Unknown) |
| 13 |
|
| 14 |
PLATFORM_XT_CPPFLAGS= |
| 15 |
PLATFORM_XT_LIBS=-lXt |
| 16 |
PLATFORM_XT_LDFLAGS= |
| 17 |
|
| 18 |
PLATFORM_FL_CPPFLAGS= |
| 19 |
PLATFORM_FL_LIBS=-lfltk -lfltk_forms -lfltk_gl |
| 20 |
PLATFORM_FL_LDFLAGS= |
| 21 |
|
| 22 |
PLATFORM_X11_CPPFLAGS=-I/usr/X11R6/include |
| 23 |
PLATFORM_X11_LIBS=-lX11 |
| 24 |
PLATFORM_X11_LDFLAGS=-L/usr/X11R6/lib |
| 25 |
|
| 26 |
PLATFORM_GL_CPPFLAGS=-I/usr/X11R6/include |
| 27 |
PLATFORM_GL_LIBS =-lGL |
| 28 |
PLATFORM_GL_LDFLAGS =-L/usr/X11R6/lib |
| 29 |
|
| 30 |
PLATFORM_GTK_CPPFLAGS=$(shell gtk-config --cflags) |
| 31 |
PLATFORM_GTK_LIBS =$(shell gtk-config --libs) |
| 32 |
PLATFORM_GTK_LDFLAGS = |
| 33 |
|
| 34 |
PLATFORM_FOX_CPPFLAGS ?= -I/usr/include/fox |
| 35 |
PLATFORM_FOX_LIBS ?= -lFOX |
| 36 |
PLATFORM_FOX_LDFLAGS ?= |
| 37 |
|
| 38 |
# NOTE: we only support wxWindows over GTK |
| 39 |
PLATFORM_WX_CPPFLAGS= $(shell wx-config --cxxflags) $(PLATFORM_GTK_CPPFLAGS) |
| 40 |
PLATFORM_WX_LIBS = $(shell wx-config --libs) $(PLATFORM_GTK_LIBS) |
| 41 |
PLATFORM_WX_LDFLAGS = $(shell wx-config --ldflags) $(PLATFORM_GTK_LDFLAGS) |
| 42 |
|
| 43 |
PLATFORM_BOOST_CPPFLAGS ?= |
| 44 |
PLATFORM_BOOST_LDLAGS ?= |
| 45 |
PLATFORM_BOOST_UTF_LIBS ?= -lboost_unit_test_framework |
| 46 |
|
| 47 |
ace_source_if_exists=$(if $(wildcard $(1)), $(shell . $(1) $(2))) |
| 48 |
ace_buildbits_64=$(findstring 64,$(buildbits)) |
| 49 |
|
| 50 |
PLATFORM_TK_CPPFLAGS=$(call ace_source_if_exists,/usr/lib$(ace_buildbits_64)/tkConfig.sh,&& echo -n $$TK_INCLUDE_SPEC $$TK_DEFS) |
| 51 |
PLATFORM_TK_LIBS=$(call ace_source_if_exists,/usr/lib$(ace_buildbits_64)/tkConfig.sh,&& echo -n $$TK_LIB_FLAG) |
| 52 |
PLATFORM_TK_LDFLAGS= |
| 53 |
|
| 54 |
PLATFORM_TCL_CPPFLAGS=$(call ace_source_if_exists,/usr/lib$(ace_buildbits_64)/tclConfig.sh,&& echo -n $$TCL_INCLUDE_SPEC $$TCL_DEFS) |
| 55 |
PLATFORM_TCL_LIBS=$(call ace_source_if_exists,/usr/lib$(ace_buildbits_64)/tclConfig.sh,&& echo -n $$(eval echo $$TCL_LIB_FLAG)) |
| 56 |
PLATFORM_TCL_LDFLAGS= |
| 57 |
|
| 58 |
PLATFORM_QT_CPPFLAGS ?= -I$(QTDIR)/include |
| 59 |
PLATFORM_QT_LIBS ?= -lqt-mt |
| 60 |
PLATFORM_QT_LDFLAGS ?= -L$(QTDIR)/lib |
| 61 |
|
| 62 |
sctp ?= |
| 63 |
# support for OpenSS7 SCTP |
| 64 |
ifeq ($(sctp),openss7) |
| 65 |
PLATFORM_SCTP_CPPFLAGS+= -DACE_HAS_OPENSS7_SCTP |
| 66 |
PLATFORM_SCTP_LDFLAGS?= |
| 67 |
PLATFORM_SCTP_LIBS?= |
| 68 |
endif |
| 69 |
|
| 70 |
# support for LKSCTP (Linux Kernel 2.5) |
| 71 |
ifeq ($(sctp),lksctp) |
| 72 |
PLATFORM_SCTP_CPPFLAGS+= -DACE_HAS_LKSCTP |
| 73 |
PLATFORM_SCTP_LDFLAGS?= -L/usr/local/lib |
| 74 |
PLATFORM_SCTP_LIBS?= -lsctp |
| 75 |
endif |
| 76 |
|
| 77 |
GNU_LIBPTHREAD_VERSION := $(shell getconf GNU_LIBPTHREAD_VERSION 2> /dev/null || echo Unknown) |
| 78 |
ifeq (NPTL, $(word 1,$(GNU_LIBPTHREAD_VERSION))) |
| 79 |
NPTL_VERS := $(subst ., ,$(word 2,$(GNU_LIBPTHREAD_VERSION))) |
| 80 |
ifneq (0, $(word 1,$(NPTL_VERS))) |
| 81 |
nptl ?= 1 |
| 82 |
endif |
| 83 |
endif |
| 84 |
nptl ?= 0 |
| 85 |
ifeq ($(nptl),0) |
| 86 |
CPPFLAGS += -DACE_LACKS_LINUX_NPTL |
| 87 |
endif |
| 88 |
|
| 89 |
ssl ?= 0 |
| 90 |
ifeq ($(ssl),1) |
| 91 |
# Some Linux OpenSSL installations compile in Kerberos support. Add |
| 92 |
# the Kerberos include path to preprocessor include path. |
| 93 |
# |
| 94 |
# We should probably also add the Kerberos libraries to |
| 95 |
# PLATFORM_SSL_LIBS but we can't be sure if they are needed without |
| 96 |
# a more sophisticated check. This will only be a problem when |
| 97 |
# statically linking the OpenSSL library. The majority of |
| 98 |
# installations use shared OpenSSL libraries so we should be okay, |
| 99 |
# at least until we migrate to Autoconf. |
| 100 |
PLATFORM_SSL_CPPFLAGS += -I/usr/kerberos/include |
| 101 |
endif # ssl |
| 102 |
|
| 103 |
PLATFORM_LARGEFILE_CFLAGS := $(shell getconf LFS_CFLAGS 2> /dev/null) |
| 104 |
ifdef PLATFORM_LARGEFILE_CFLAGS |
| 105 |
# Large file support |
| 106 |
CPPFLAGS += $(PLATFORM_LARGEFILE_CFLAGS) |
| 107 |
endif |
| 108 |
|
| 109 |
SYSARCH := $(shell uname -m) |
| 110 |
|
| 111 |
PIC = -fPIC |
| 112 |
AR ?= ar |
| 113 |
ARFLAGS ?= rsuv |
| 114 |
RANLIB = @true |
| 115 |
|
| 116 |
# Added line below to support "Executable Shared Object" files (as |
| 117 |
# needed by the service configurator). |
| 118 |
# Marius Kjeldahl <[email protected], [email protected]> |
| 119 |
ifeq ($(threads),1) |
| 120 |
ESOBUILD = $(COMPILEESO.cc) $(PIC) -shared -o $(VSHDIR)$*.so $< |
| 121 |
ifndef PRELIB |
| 122 |
PRELIB = @true |
| 123 |
endif # ! PRELIB |
| 124 |
endif |
| 125 |
|
| 126 |
# DT_RUNPATH is preferred over DT_RPATH, but the linker will only use it when |
| 127 |
# this extra flag option (enable-new-dtags) is present |
| 128 |
LD_RPATH_FLAGS += -Wl,--enable-new-dtags |
| 129 |
|
| 130 |
# Rely on _GNU_SOURCE to set these defaults defined in /usr/include/features.h |
| 131 |
# instead of setting them directly here (older versions of gcc don't set it |
| 132 |
# for you): _SVID_SOURCE _BSD_SOURCE _POSIX_SOURCE _POSIX_C_SOURCE=199506L, ... |
| 133 |
CPPFLAGS += -D_GNU_SOURCE |
| 134 |
|
| 135 |
DCFLAGS += -ggdb |
| 136 |
DCCFLAGS += -ggdb |
| 137 |
DLD = $(CXX) |
| 138 |
LD = $(CXX) |
| 139 |
|
| 140 |
ifeq ($(optimize),1) |
| 141 |
SOFLAGS += -Wl,-O3 |
| 142 |
endif |
| 143 |
|
| 144 |
SOFLAGS += -shared |
| 145 |
SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $<; \ |
| 146 |
$(SOLINK.cc) -o $@ $(LDFLAGS) $(VSHDIR)$*.o |
| 147 |
PRELIB = @true |