The generate-kernel-patch option -u does now enable #undef CONFIG_SCST_PROC.
authorbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sat, 24 Oct 2009 07:48:44 +0000 (07:48 +0000)
committerbvassche <bvassche@d57e44dd-8a1f-0410-8b47-8ef2f437770f>
Sat, 24 Oct 2009 07:48:44 +0000 (07:48 +0000)
git-svn-id: https://scst.svn.sourceforge.net/svnroot/scst/trunk@1265 d57e44dd-8a1f-0410-8b47-8ef2f437770f

scripts/generate-kernel-patch
scripts/specialize-patch

index e6c777d..c1b7609 100755 (executable)
@@ -175,7 +175,7 @@ do
 done
 
 if [ "${generating_upstream_patch}" = "true" ]; then
-  specialize_patch_options="${specialize_patch_options} -v generating_upstream_patch_defined=1 -v config_tcp_zero_copy_transfer_completion_notification_undefined=1"
+  specialize_patch_options="${specialize_patch_options} -v generating_upstream_patch_defined=1 -v config_tcp_zero_copy_transfer_completion_notification_undefined=1 -v config_scst_proc_undefined=1"
 fi
 
 if [ $# != 1 ]; then
index f2eb4e2..d2fbb26 100755 (executable)
@@ -117,6 +117,12 @@ function evaluate(stmnt) {
     gsub("defined *\\( *CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION *\\)", 0, stmnt)
   }
 
+  if (config_scst_proc_undefined)
+  {
+    gsub("defined  *CONFIG_SCST_PROC", 0, stmnt)
+    gsub("defined *\\( *CONFIG_SCST_PROC *\\)", 0, stmnt)
+  }
+
   do
   {
     last_stmnt = stmnt
@@ -206,8 +212,9 @@ function handle_if()
       || $0 ~ "RHEL_RELEASE_CODE"  \
       || $0 ~ "GENERATING_UPSTREAM_PATCH" \
       || $0 ~ "CONFIG_TCP_ZERO_COPY_TRANSFER_COMPLETION_NOTIFICATION" \
-      || $0 ~ "SCSI_EXEC_REQ_FIFO_DEFINED" \
-      || $0 ~ "SCST_IO_CONTEXT")
+      || ($0 ~ "CONFIG_SCST_PROC" && config_scst_proc_undefined) \
+      || ($0 ~ "SCSI_EXEC_REQ_FIFO_DEFINED" && SCSI_EXEC_REQ_FIFO_DEFINED!="") \
+      || ($0 ~ "SCST_IO_CONTEXT" && SCST_IO_CONTEXT != ""))
   {
     #print $0 " -> " evaluated
     $0 = evaluated
@@ -278,7 +285,11 @@ function process_preprocessor_statement() {
   }
   if (delete_disabled_code                                      \
       && (evaluated ~ "^+#define SCSI_EXEC_REQ_FIFO_DEFINED$"   \
-          || evaluated ~ "^+#define SCST_IO_CONTEXT$"))
+             && SCSI_EXEC_REQ_FIFO_DEFINED != ""                \
+          || evaluated ~ "^+#define SCST_IO_CONTEXT$"           \
+            && SCST_IO_CONTEXT != ""                           \
+          || (evaluated ~ "^+#define CONFIG_SCST_PROC$"         \
+              && config_scst_proc_undefined)))
   {
     lines_deleted += input_line_count
     delete_next_blank_line = 1
@@ -344,6 +355,8 @@ BEGIN {
     generating_upstream_patch_defined = 0
   if (config_tcp_zero_copy_transfer_completion_notification_undefined != 0 && config_tcp_zero_copy_transfer_completion_notification_undefined != 1)
     config_tcp_zero_copy_transfer_completion_notification_undefined = 0
+  if (config_scst_proc_undefined != 0 && config_scst_proc_undefined != 1)
+    config_scst_proc_undefined = 0
 
   # Variable initialization.
   reset_hunk_state_variables()