SELinux can be assumed for Android 4.4+

Change-Id: I7410a0c8e439eec90a955ee9201efd9a92bb9635
diff --git a/libtar/Android.mk b/libtar/Android.mk
index ddf8e05..c8905d9 100644
--- a/libtar/Android.mk
+++ b/libtar/Android.mk
@@ -10,11 +10,8 @@
                     external/zlib
 LOCAL_SHARED_LIBRARIES += libz libc
 
-ifeq ($(TWHAVE_SELINUX), true)
-    LOCAL_C_INCLUDES += external/libselinux/include
-    LOCAL_SHARED_LIBRARIES += libselinux
-    LOCAL_CFLAGS += -DHAVE_SELINUX
-endif
+LOCAL_C_INCLUDES += external/libselinux/include
+LOCAL_SHARED_LIBRARIES += libselinux
 
 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
     LOCAL_SHARED_LIBRARIES += libe4crypt
@@ -34,11 +31,8 @@
                     external/zlib
 LOCAL_STATIC_LIBRARIES += libz libc
 
-ifeq ($(TWHAVE_SELINUX), true)
-    LOCAL_C_INCLUDES += external/libselinux/include
-    LOCAL_STATIC_LIBRARIES += libselinux
-    LOCAL_CFLAGS += -DHAVE_SELINUX
-endif
+LOCAL_C_INCLUDES += external/libselinux/include
+LOCAL_STATIC_LIBRARIES += libselinux
 
 ifeq ($(TW_INCLUDE_CRYPTO_FBE), true)
     LOCAL_SHARED_LIBRARIES += libe4crypt
diff --git a/libtar/append.c b/libtar/append.c
index 7c679f6..d8ba3ca 100644
--- a/libtar/append.c
+++ b/libtar/append.c
@@ -35,9 +35,7 @@
 # include <unistd.h>
 #endif
 
-#ifdef HAVE_SELINUX
-# include "selinux/selinux.h"
-#endif
+#include <selinux/selinux.h>
 
 #ifdef HAVE_EXT4_CRYPT
 # include "ext4crypt_tar.h"
@@ -105,7 +103,6 @@
 #endif
 	th_set_path(t, (savename ? savename : realname));
 
-#ifdef HAVE_SELINUX
 	/* get selinux context */
 	if (t->options & TAR_STORE_SELINUX)
 	{
@@ -129,7 +126,6 @@
 #endif
 		}
 	}
-#endif
 
 #ifdef HAVE_EXT4_CRYPT
 	if (TH_ISDIR(t) && t->options & TAR_STORE_EXT4_POL)
diff --git a/libtar/block.c b/libtar/block.c
index a117857..1b3ba82 100644
--- a/libtar/block.c
+++ b/libtar/block.c
@@ -123,10 +123,8 @@
 		free(t->th_buf.gnu_longname);
 	if (t->th_buf.gnu_longlink != NULL)
 		free(t->th_buf.gnu_longlink);
-#ifdef HAVE_SELINUX
 	if (t->th_buf.selinux_context != NULL)
 		free(t->th_buf.selinux_context);
-#endif
 #ifdef HAVE_EXT4_CRYPT
 	if (t->th_buf.e4crypt_policy != NULL) {
 		free(t->th_buf.e4crypt_policy);
@@ -287,7 +285,7 @@
 				printf("    th_read(): Posix capabilities detected\n");
 #endif
 			} // end posix capabilities
-#ifdef HAVE_SELINUX // selinux contexts
+			// selinux contexts
 			start = strstr(buf, SELINUX_TAG);
 			if(start && start+SELINUX_TAG_LEN < buf+len)
 			{
@@ -300,8 +298,7 @@
 					printf("    th_read(): SELinux context xattr detected: %s\n", t->th_buf.selinux_context);
 #endif
 				}
-			}
-#endif // HAVE_SELINUX
+			} // end selinux contexts
 #ifdef HAVE_EXT4_CRYPT
 			start = strstr(buf, E4CRYPT_TAG);
 			if(start && start+E4CRYPT_TAG_LEN < buf+len)
@@ -496,7 +493,7 @@
 
 	memset(buf, 0, T_BLOCKSIZE);
 	ptr = buf;
-#ifdef HAVE_SELINUX
+
 	if((t->options & TAR_STORE_SELINUX) && t->th_buf.selinux_context != NULL)
 	{
 #ifdef DEBUG
@@ -514,7 +511,6 @@
 		snprintf(ptr, T_BLOCKSIZE, "%d "SELINUX_TAG"%s\n", (int)sz, t->th_buf.selinux_context);
 		ptr += sz;
 	}
-#endif
 
 #ifdef HAVE_EXT4_CRYPT
 	if((t->options & TAR_STORE_EXT4_POL) && t->th_buf.e4crypt_policy != NULL)
diff --git a/libtar/extract.c b/libtar/extract.c
index 9e24e8e..87ccf24 100644
--- a/libtar/extract.c
+++ b/libtar/extract.c
@@ -32,9 +32,7 @@
 # include <unistd.h>
 #endif
 
-#ifdef HAVE_SELINUX
-# include "selinux/selinux.h"
-#endif
+#include <selinux/selinux.h>
 
 #ifdef HAVE_EXT4_CRYPT
 # include "ext4crypt_tar.h"
@@ -159,7 +157,6 @@
 		return i;
 	}
 
-#ifdef HAVE_SELINUX
 	if((t->options & TAR_STORE_SELINUX) && t->th_buf.selinux_context != NULL)
 	{
 #ifdef DEBUG
@@ -168,7 +165,6 @@
 		if (lsetfilecon(realname, t->th_buf.selinux_context) < 0)
 			fprintf(stderr, "tar_extract_file(): failed to restore SELinux context %s to file %s !!!\n", t->th_buf.selinux_context, realname);
 	}
-#endif
 
 	if((t->options & TAR_STORE_POSIX_CAP) && t->th_buf.has_cap_data)
 	{
diff --git a/libtar/libtar.h b/libtar/libtar.h
index 8c42028..4d92124 100644
--- a/libtar/libtar.h
+++ b/libtar/libtar.h
@@ -68,9 +68,7 @@
 	char padding[12];
 	char *gnu_longname;
 	char *gnu_longlink;
-#ifdef HAVE_SELINUX
 	char *selinux_context;
-#endif
 #ifdef HAVE_EXT4_CRYPT
 	char *e4crypt_policy;
 #endif