From a8392436effcd7f3e64855594144ab9ab90fcdf7 Mon Sep 17 00:00:00 2001
From: Mike Hibler <mike@flux.utah.edu>
Date: Tue, 3 Sep 2002 23:30:06 +0000
Subject: [PATCH] Add --enable-windows option as a general purpose hook for
 Windows support. Right now (or as soon as the changes are checked in) this
 enables NTFS support in imagezip.

Also get rid of rc.d/cvsupd.sh setup since this file appears to have
gone away
---
 configure    | 47 +++++++++++++++++++++++++++++++++++++----------
 configure.in | 22 +++++++++++++++++++++-
 2 files changed, 58 insertions(+), 11 deletions(-)

diff --git a/configure b/configure
index cd18a47330..e226e78d23 100755
--- a/configure
+++ b/configure
@@ -29,6 +29,8 @@ ac_help="$ac_help
   --disable-debug       Build with optimization flags (-O2 -DNDEBUG -UDEBUG)"
 ac_help="$ac_help
   --disable-events       Disable events (requires Elvin libraries)"
+ac_help="$ac_help
+  --enable-windows       Enable Windows XP support (requires third-party software)"
 ac_help="$ac_help
   --enable-testmode     Enable test mode
   --disable-testmode    Disable test mode"
@@ -571,7 +573,7 @@ else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; }
 fi
 
 echo $ac_n "checking host system type""... $ac_c" 1>&6
-echo "configure:575: checking host system type" >&5
+echo "configure:577: checking host system type" >&5
 
 host_alias=$host
 case "$host_alias" in
@@ -592,7 +594,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'`
 echo "$ac_t""$host" 1>&6
 
 echo $ac_n "checking build system type""... $ac_c" 1>&6
-echo "configure:596: checking build system type" >&5
+echo "configure:598: checking build system type" >&5
 
 build_alias=$build
 case "$build_alias" in
@@ -618,7 +620,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args.
 set dummy ${ac_tool_prefix}gcc; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:622: checking for $ac_word" >&5
+echo "configure:624: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -650,7 +652,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}g++", so it can be a program name with args.
 set dummy ${ac_tool_prefix}g++; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:654: checking for $ac_word" >&5
+echo "configure:656: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -682,7 +684,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ar; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:686: checking for $ac_word" >&5
+echo "configure:688: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -714,7 +716,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ranlib; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:718: checking for $ac_word" >&5
+echo "configure:720: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -746,7 +748,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
 set dummy ${ac_tool_prefix}strip; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:750: checking for $ac_word" >&5
+echo "configure:752: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -778,7 +780,7 @@ fi
 # Extract the first word of "${ac_tool_prefix}ssh", so it can be a program name with args.
 set dummy ${ac_tool_prefix}ssh; ac_word=$2
 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:782: checking for $ac_word" >&5
+echo "configure:784: checking for $ac_word" >&5
 if eval "test \"`echo '$''{'ac_cv_prog_SSH'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
@@ -1091,6 +1093,29 @@ else
 fi
 
 
+#
+# Enable Windows support.
+# Right now this means NTFS support in imagezip, maybe more things later.
+# Relies on Linux NTFS library.
+# Off by default.
+# 
+# Check whether --enable-windows or --disable-windows was given.
+if test "${enable_windows+set}" = set; then
+  enableval="$enable_windows"
+  :
+fi
+
+
+if test "$enable_windows" = "yes"; then
+	winfiles="os/imagezip/ntfs/GNUmakefile";
+	optional_subdirs="$optional_subdirs";
+        WINSUPPORT=1;
+else
+	winfiles="";
+        WINSUPPORT=0;
+fi
+
+
 #
 # Testing mode.  In testing mode scripts should not effect hardware state.
 # This is designed to be used with the testsuite software which operates
@@ -1125,7 +1150,7 @@ fi
 # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
 # ./install, which can be erroneously created by make from ./install.sh.
 echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6
-echo "configure:1129: checking for a BSD compatible install" >&5
+echo "configure:1154: checking for a BSD compatible install" >&5
 if test -z "$INSTALL"; then
 if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -1245,10 +1270,11 @@ outfiles="$outfiles Makeconf GNUmakefile \
 	vis/dbvistopology vis/dbtopper \
 	vis/top2png vis/render \
 	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
-	rc.d/cvsupd.sh rc.d/2.elvind.sh \
+	rc.d/2.elvind.sh \
 	tools/GNUmakefile \
 	tools/pcapper/GNUmakefile \
 	$eventfiles \
+	$winfiles \
 	apache/GNUmakefile apache/apache.conf "
 
 #
@@ -1435,6 +1461,7 @@ s%@INSTALL_RCDIR@%$INSTALL_RCDIR%g
 s%@INSTALL_APACHE_CONFIG@%$INSTALL_APACHE_CONFIG%g
 s%@OPT_CFLAGS@%$OPT_CFLAGS%g
 s%@EVENTSYS@%$EVENTSYS%g
+s%@WINSUPPORT@%$WINSUPPORT%g
 s%@TESTMODE@%$TESTMODE%g
 s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
 s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g
diff --git a/configure.in b/configure.in
index 0567059d97..db8c4bb1f7 100755
--- a/configure.in
+++ b/configure.in
@@ -229,6 +229,25 @@ else
 fi
 AC_SUBST(EVENTSYS)
 
+#
+# Enable Windows support.
+# Right now this means NTFS support in imagezip, maybe more things later.
+# Relies on Linux NTFS library.
+# Off by default.
+# 
+AC_ARG_ENABLE(windows,
+[  --enable-windows       Enable Windows XP support (requires third-party software)])
+
+if test "$enable_windows" = "yes"; then
+	winfiles="os/imagezip/ntfs/GNUmakefile";
+	optional_subdirs="$optional_subdirs";
+        WINSUPPORT=1;
+else
+	winfiles="";
+        WINSUPPORT=0;
+fi
+AC_SUBST(WINSUPPORT)
+
 #
 # Testing mode.  In testing mode scripts should not effect hardware state.
 # This is designed to be used with the testsuite software which operates
@@ -317,10 +336,11 @@ outfiles="$outfiles Makeconf GNUmakefile \
 	vis/dbvistopology vis/dbtopper \
 	vis/top2png vis/render \
 	rc.d/GNUmakefile rc.d/2.mysql-server.sh rc.d/3.testbed.sh \
-	rc.d/cvsupd.sh rc.d/2.elvind.sh \
+	rc.d/2.elvind.sh \
 	tools/GNUmakefile \
 	tools/pcapper/GNUmakefile \
 	$eventfiles \
+	$winfiles \
 	apache/GNUmakefile apache/apache.conf "
 
 #
-- 
GitLab