3 # We always include config-linux.h on Linux platforms.
4 ACE_PLATFORM_CONFIG ?= config-linux.h
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)
19 PLATFORM_FL_LIBS=-lfltk -lfltk_forms -lfltk_gl
22 PLATFORM_X11_CPPFLAGS=-I/usr/X11R6/include
23 PLATFORM_X11_LIBS=-lX11
24 PLATFORM_X11_LDFLAGS=-L/usr/X11R6/lib
26 PLATFORM_GL_CPPFLAGS=-I/usr/X11R6/include
27 PLATFORM_GL_LIBS =-lGL
28 PLATFORM_GL_LDFLAGS =-L/usr/X11R6/lib
30 PLATFORM_GTK_CPPFLAGS=$(shell gtk-config --cflags)
31 PLATFORM_GTK_LIBS =$(shell gtk-config --libs)
32 PLATFORM_GTK_LDFLAGS =
34 PLATFORM_FOX_CPPFLAGS ?= -I/usr/include/fox
35 PLATFORM_FOX_LIBS ?= -lFOX
36 PLATFORM_FOX_LDFLAGS ?=
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)
43 PLATFORM_BOOST_CPPFLAGS ?=
44 PLATFORM_BOOST_LDLAGS ?=
45 PLATFORM_BOOST_UTF_LIBS ?= -lboost_unit_test_framework
47 ace_source_if_exists=$(if $(wildcard $(1)), $(shell . $(1) $(2)))
48 ace_buildbits_64=$(findstring 64,$(buildbits))
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)
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))
58 PLATFORM_QT_CPPFLAGS ?= -I$(QTDIR)/include
59 PLATFORM_QT_LIBS ?= -lqt-mt
60 PLATFORM_QT_LDFLAGS ?= -L$(QTDIR)/lib
63 # support for OpenSS7 SCTP
64 ifeq ($(sctp),openss7)
65 PLATFORM_SCTP_CPPFLAGS+= -DACE_HAS_OPENSS7_SCTP
66 PLATFORM_SCTP_LDFLAGS?=
70 # support for LKSCTP (Linux Kernel 2.5)
72 PLATFORM_SCTP_CPPFLAGS+= -DACE_HAS_LKSCTP
73 PLATFORM_SCTP_LDFLAGS?= -L/usr/local/lib
74 PLATFORM_SCTP_LIBS?= -lsctp
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)))
86 CPPFLAGS += -DACE_LACKS_LINUX_NPTL
91 # Some Linux OpenSSL installations compile in Kerberos support. Add
92 # the Kerberos include path to preprocessor include path.
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
103 PLATFORM_LARGEFILE_CFLAGS := $(shell getconf LFS_CFLAGS 2> /dev/null)
104 ifdef PLATFORM_LARGEFILE_CFLAGS
106 CPPFLAGS += $(PLATFORM_LARGEFILE_CFLAGS)
109 SYSARCH := $(shell uname -m)
116 # Added line below to support "Executable Shared Object" files (as
117 # needed by the service configurator).
118 # Marius Kjeldahl <mariusk@sn.no, marius@funcom.com>
120 ESOBUILD = $(COMPILEESO.cc) $(PIC) -shared -o $(VSHDIR)$*.so $<
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
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
145 SOBUILD = $(COMPILE.cc) $(PIC) -o $(VSHDIR)$*.so $<; \
146 $(SOLINK.cc) -o $@ $(LDFLAGS) $(VSHDIR)$*.o