4 LCRSODIR=$(PREFIX)/libexec/lcrso
6 # Do not modify below this line
13 ifeq "$(UNAME)" "Linux"
16 ifeq "$(UNAME)" "Darwin"
20 ifneq "" "$(findstring BSD,$(UNAME))"
23 ifeq "$(UNAME)" "SunOS"
24 OPENAIS_COMPAT=SOLARIS
25 # Note that CC must be set to gcc compiled to link with gnu-ld
28 $(error "OPENAIS_COMPAT cannot be detected, it must be manually defined")
31 # BUILD_DYNAMIC can be defined to 1 to build for dynamic loading of service
32 # handler modules. If the developer intends to debug, building without
33 # dynamic modules should provide an easier route.
38 # OPENAIS_BUILD can be defined as RELEASE or DEBUG
46 # default CFLAGS, LDFLAGS
52 # Adding the TS_CLASS flag enables not being scheduled RR
55 # build CFLAGS, LDFLAGS
57 ifeq (${OPENAIS_BUILD}, RELEASE)
59 # -Wstrict-aliasing=2 TODO sameday fix all of these
60 ifndef OPENAIS_PROFILE
61 CFLAGS += -fomit-frame-pointer
65 ifeq (${OPENAIS_BUILD}, DEBUG)
66 CFLAGS += -O0 -g -Wall -DDEBUG
68 ifeq (${OPENAIS_COMPAT}, SOLARIS)
69 CFLAGS += -Werror -DTS_CLASS
72 ifeq (${OPENAIS_BUILD}, COVERAGE)
73 CFLAGS += -O0 -g -ftest-coverage -fprofile-arcs
74 LDFLAGS += -g -ftest-coverage -fprofile-arcs
83 # platform specific CFLAGS, LDFLAGS
85 ifeq (${OPENAIS_COMPAT}, LINUX)
86 override CFLAGS += -DOPENAIS_LINUX
87 override LDFLAGS += -ldl -lpthread
88 override DYFLAGS += -rdynamic
90 ifeq (${OPENAIS_COMPAT}, BSD)
91 override CFLAGS += -DOPENAIS_BSD
92 override LDFLAGS += -pthread
93 override DYFLAGS += -export-dynamic
95 ifeq (${OPENAIS_COMPAT}, DARWIN)
96 override CFLAGS += -DOPENAIS_DARWIN
97 override LDFLAGS += -lpthread
99 ifeq (${OPENAIS_COMPAT}, SOLARIS)
100 override CFLAGS += -DOPENAIS_SOLARIS -D_REENTRANT
101 override LDFLAGS += -lpthread
102 # See http://sources.redhat.com/ml/bug-gnu-utils/2000-07/msg00168.html
103 override LDFLAGS += -Wl,--export-dynamic -Wl,-rpath-link=/usr/lib
104 ifeq ($(shell uname -r), 5.10)
105 override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT
107 ifeq ($(shell uname -r), 5.11)
108 override CFLAGS += -DHAVE_GETPEERUCRED -DHAVE_SCANDIR -DHAVE_ALPHASORT
112 VPATH:=. $(srcdir) $(srcdir)$(subdir)