hal: compilation fix for extended feature flags

- Fix compilation error for offload, Dolby,
  HDMI pass through, FLAC decoder, and hardware
  accelerated effects when extended feature
  flags are disabled.

Change-Id: If64d5fa5d124b42d40d7e123b887db8e0a5d7426
diff --git a/post_proc/Android.mk b/post_proc/Android.mk
index be70166..ed46f17 100644
--- a/post_proc/Android.mk
+++ b/post_proc/Android.mk
@@ -14,8 +14,12 @@
 	virtualizer.c \
 	reverb.c \
 	effect_api.c \
-	effect_util.c \
-        hw_accelerator.c
+	effect_util.c
+
+ifeq ($(strip $(AUDIO_FEATURE_ENABLED_HW_ACCELERATED_EFFECTS)),true)
+    LOCAL_CFLAGS += -DHW_ACCELERATED_EFFECTS
+    LOCAL_SRC_FILES += hw_accelerator.c
+endif
 
 LOCAL_CFLAGS+= -O2 -fvisibility=hidden
 
diff --git a/post_proc/bundle.c b/post_proc/bundle.c
index e38a41c..c09d2ad 100644
--- a/post_proc/bundle.c
+++ b/post_proc/bundle.c
@@ -43,7 +43,7 @@
 #include <system/thread_defs.h>
 #include <tinyalsa/asoundlib.h>
 #include <hardware/audio_effect.h>
-
+#include <stdlib.h>
 #include "bundle.h"
 #include "hw_accelerator.h"
 #include "equalizer.h"
@@ -69,7 +69,9 @@
         &ins_env_reverb_descriptor,
         &aux_preset_reverb_descriptor,
         &ins_preset_reverb_descriptor,
+#ifdef HW_ACCELERATED_EFFECTS
         &hw_accelerator_descriptor,
+#endif
         NULL,
 };
 
@@ -604,6 +606,7 @@
             reverb_preset_init(reverb_ctxt);
         }
         reverb_ctxt->ctl = NULL;
+#ifdef HW_ACCELERATED_EFFECTS
     } else if (memcmp(uuid, &hw_accelerator_descriptor.uuid,
                sizeof(effect_uuid_t)) == 0) {
         hw_accelerator_context_t *hw_acc_ctxt = (hw_accelerator_context_t *)
@@ -625,6 +628,7 @@
         context->ops.process = hw_accelerator_process;
 
         context->desc = &hw_accelerator_descriptor;
+#endif
     } else {
         return -EINVAL;
     }
@@ -910,7 +914,7 @@
             add_effect_to_output(out_ctxt, context);
 
         } break;
-
+#ifdef HW_ACCELERATED_EFFECTS
     case EFFECT_CMD_HW_ACC: {
         ALOGV("EFFECT_CMD_HW_ACC cmdSize %d pCmdData %p, *replySize %d, pReplyData %p",
               cmdSize, pCmdData, *replySize, pReplyData);
@@ -925,6 +929,7 @@
         context->hw_acc_enabled = (value > 0) ? true : false;
         break;
     }
+#endif
     default:
         if (cmdCode >= EFFECT_CMD_FIRST_PROPRIETARY && context->ops.command)
             status = context->ops.command(context, cmdCode, cmdSize,
diff --git a/post_proc/bundle.h b/post_proc/bundle.h
index 06da991..efe69ee 100644
--- a/post_proc/bundle.h
+++ b/post_proc/bundle.h
@@ -27,7 +27,9 @@
 /* Retry for delay for mixer open */
 #define RETRY_NUMBER 10
 #define RETRY_US 500000
-
+#ifdef HW_ACCELERATED_EFFECTS
+#define EFFECT_CMD_HW_ACC 20
+#endif
 #define MIXER_CARD 0
 #define SOUND_CARD 0
 
diff --git a/post_proc/effect_api.c b/post_proc/effect_api.c
index 2fb79ed..7aef997 100644
--- a/post_proc/effect_api.c
+++ b/post_proc/effect_api.c
@@ -60,7 +60,7 @@
 #include <sound/audio_effects.h>
 #include <sound/devdep_params.h>
 #include <linux/msm_audio.h>
-
+#include <errno.h>
 #include "effect_api.h"
 
 #ifdef DTS_EAGLE
diff --git a/post_proc/effect_util.c b/post_proc/effect_util.c
index 8f7a604..b401f6a 100644
--- a/post_proc/effect_util.c
+++ b/post_proc/effect_util.c
@@ -17,6 +17,7 @@
 #include <utils/Log.h>
 #include <stdlib.h>
 #include "effect_util.h"
+#include <string.h>
 
 #ifdef LOG_TAG
 #undef LOG_TAG