chiark / gitweb /
[PATCH] enable native tdb spinlocks on i386 platforms.
[elogind.git] / Makefile
index 24677d4194aa9364e86a4f3c746c1a0c538a99c7..1b7c71c57ca730d0f804ad668cfd1722b60b48df 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -25,6 +25,8 @@ USE_LOG = true
 # Leave this set to `false' for production use.
 DEBUG = false
 
+# Set this to compile with Security-Enhanced Linux support.
+USE_SELINUX = false
 
 ROOT =         udev
 DAEMON =       udevd
@@ -105,19 +107,11 @@ OPTIMIZATION := ${shell if $(CC) -Os -S -o /dev/null -xc /dev/null >/dev/null 2>
 # add -Wredundant-decls when libsysfs gets cleaned up
 WARNINGS := -Wall 
 
-# Some nice architecture specific optimizations
-ifeq ($(strip $(TARGET_ARCH)),arm)
-       OPTIMIZATION+=-fstrict-aliasing
-endif
-ifeq ($(strip $(TARGET_ARCH)),i386)
-       OPTIMIZATION+=-march=i386
-       OPTIMIZATION += ${shell if $(CC) -mpreferred-stack-boundary=2 -S -o /dev/null -xc \
-               /dev/null >/dev/null 2>&1; then echo "-mpreferred-stack-boundary=2"; fi}
-       OPTIMIZATION += ${shell if $(CC) -malign-functions=0 -malign-jumps=0 -S -o /dev/null -xc \
-               /dev/null >/dev/null 2>&1; then echo "-malign-functions=0 -malign-jumps=0"; fi}
-       CFLAGS+=-pipe -Dasmlinkage=__attribute__((regparm(0)))
-else
-       CFLAGS+=-pipe -Dasmlinkage=
+CFLAGS := -pipe -Dasmlinkage=
+
+# set up the proper tdb spinlock code if we can
+ifeq ($(strip $(ARCH)),i386)
+       CFLAGS += -DUSE_SPINLOCKS -DINTEL_SPINLOCKS
 endif
 
 ifeq ($(strip $(USE_LOG)),true)
@@ -170,6 +164,11 @@ else
        LDFLAGS =
 endif
 
+ifeq ($(strip $(USE_SELINUX)),true)
+       CFLAGS += -DUSE_SELINUX
+       LIB_OBJS += -lselinux
+endif
+
 CFLAGS += -I$(PWD)/libsysfs
 
 # config files automatically generated
@@ -222,6 +221,7 @@ HEADERS =   udev.h          \
                udevdb.h        \
                klibc_fixups.h  \
                logging.h       \
+               selinux.h       \
                list.h
 
 ifeq ($(strip $(USE_KLIBC)),true)