Merge "Remove HAVE_SELINUX guards"
diff --git a/Android.mk b/Android.mk
index e899a77..68e46d0 100644
--- a/Android.mk
+++ b/Android.mk
@@ -17,11 +17,7 @@
 
 LOCAL_MODULE := mkyaffs2image
 
-ifeq ($(HAVE_SELINUX), true)
-LOCAL_C_INCLUDES += external/libselinux/include
-LOCAL_STATIC_LIBRARIES += libselinux
-LOCAL_CFLAGS += -DHAVE_SELINUX
-endif # HAVE_SELINUX
+LOCAL_STATIC_LIBRARIES := libselinux
 
 include $(BUILD_HOST_EXECUTABLE)
 
diff --git a/yaffs2/utils/mkyaffs2image.c b/yaffs2/utils/mkyaffs2image.c
index f4e5745..8ab0e23 100644
--- a/yaffs2/utils/mkyaffs2image.c
+++ b/yaffs2/utils/mkyaffs2image.c
@@ -32,7 +32,6 @@
 #include <string.h>
 #include <unistd.h>
 
-#ifdef HAVE_SELINUX
 #define XATTR_NAME_SELINUX "security.selinux"
 #include <selinux/selinux.h>
 #include <selinux/label.h>
@@ -40,7 +39,6 @@
 static struct selabel_handle *sehnd;
 static unsigned int seprefixlen;
 static char *mntpoint;
-#endif
 
 #include <private/android_filesystem_config.h>
 
@@ -263,7 +261,6 @@
 	
 	
 	yaffs_ObjectHeader *oh = (yaffs_ObjectHeader *)bytes;
-#ifdef HAVE_SELINUX
 	char *xb = (char *)bytes + sizeof(*oh);
 	int xnamelen = strlen(XATTR_NAME_SELINUX) + 1;
 	int xvalsize = 0;
@@ -273,7 +270,6 @@
 		xvalsize = strlen(secontext) + 1;
 		xreclen = sizeof(int) + xnamelen + xvalsize;
 	}
-#endif
 	
 	memset(bytes,0xff,sizeof(bytes));
 	
@@ -283,7 +279,6 @@
 	
 	strncpy(oh->name,name,YAFFS_MAX_NAME_LENGTH);
 
-#ifdef HAVE_SELINUX
 	if (xreclen) {
 		memcpy(xb, &xreclen, sizeof(int));
 		xb += sizeof(int);
@@ -291,7 +286,6 @@
 		xb += xnamelen;
 		memcpy(xb, secontext, xvalsize);
 	}
-#endif
 	
 	if(t != YAFFS_OBJECT_TYPE_HARDLINK)
 	{
@@ -356,10 +350,8 @@
 			   strcmp(entry->d_name,".."))
  			{
  				char full_name[500];
-#ifdef HAVE_SELINUX
 				char *suffix, dest_name[500];
 				int ret;
-#endif
 				struct stat stats;
 				int equivalentObj;
 				int newObj;
@@ -368,7 +360,6 @@
 				
 				lstat(full_name,&stats);
 
-#ifdef HAVE_SELINUX
 				if (sehnd) {
 					suffix = full_name + seprefixlen;
 					ret = snprintf(dest_name,
@@ -403,7 +394,6 @@
 					}
 					free(sepath);
 				}
-#endif
 
 				if(S_ISLNK(stats.st_mode) ||
 				    S_ISREG(stats.st_mode) ||
@@ -577,16 +567,13 @@
 	}
 
 	dir = argv[optind];
-#ifdef HAVE_SELINUX
 	seprefixlen = strlen(dir);
-#endif
 	image = argv[optind + 1];
 
 	if (optind + 2 < argc) {
 		if (!strncmp(argv[optind + 2], "convert", strlen("convert")))
 			convert_endian = 1;
 		else {
-#ifdef HAVE_SELINUX
 			struct selinux_opt seopts[] = {
 				{ SELABEL_OPT_PATH, argv[optind + 2] }
 			};
@@ -605,10 +592,6 @@
 				if (!strncmp(argv[optind + 4], "convert", strlen("convert")))
 					convert_endian = 1;
 			}
-#else
-			usage();
-			exit(1);
-#endif
 		}
 	}
 
@@ -648,7 +631,6 @@
     }
     
 	//printf("Processing directory %s into image file %s\n",dir,image);
-#ifdef HAVE_SELINUX
     if (sehnd) {
 
         char *sepath = NULL;
@@ -670,7 +652,6 @@
 
 	free(sepath);
     }
-#endif
 
     error =  write_object_header(1, YAFFS_OBJECT_TYPE_DIRECTORY, &stats, 1,"", -1, NULL, secontext);
 	if(error)