Index: http/ChangeLog
===================================================================
--- http/ChangeLog	(revision f6559799c3dc0571509427ecd43c7c1dbc8dba27)
+++ http/ChangeLog	(revision d51420e73bb4a1998a0ebf130ecd4aae2f12c0ab)
@@ -1,2 +1,20 @@
+2007-07-12	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* ChangeLog, Makefile, init.c: No switchable from GoAhead to SHTTPD but
+	defaults to SHTTPD. The displayed index.html will indicate which
+	httpd implementation is enabled. The user should edit the Makefile to
+	switch settings.
+	* index.html.in: New file.
+	* rootfs/index.html: Removed.
+
+2007-07-12	Joel Sherrill <joel.sherrill@oarcorp.com>
+
+	* Makefile, init.c: No switchable from GoAhead to SHTTPD but defaults
+	to SHTTPD. The displayed index.html will indicate which httpd
+	implementation is enabled. The user should edit the Makefile to
+	switch settings.
+	* index.html.in: New file.
+	* rootfs/index.html: Removed.
+
 2007-07-11	Joel Sherrill <joel.sherrill@oarcorp.com>
 
Index: http/Makefile
===================================================================
--- http/Makefile	(revision f6559799c3dc0571509427ecd43c7c1dbc8dba27)
+++ http/Makefile	(revision d51420e73bb4a1998a0ebf130ecd4aae2f12c0ab)
@@ -19,5 +19,5 @@
 
 SRCS=$(DOCS) $(C_FILES) $(CC_FILES) $(H_FILES) $(S_FILES)
-OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES)
+OBJS=$(C_O_FILES) $(CC_O_FILES) $(S_O_FILES) $(ARCH)/tarfile.o
 
 PRINT_SRCS=$(DOCS)
@@ -35,5 +35,4 @@
 DEFINES  +=
 CPPFLAGS +=
-CFLAGS   += -DWEBS -DUEMF
 CFLAGS_LD += -Wl,--defsym -Wl,HeapSize=0xC0000 
 CFLAGS_OPTIMIZE_V   +=
@@ -41,8 +40,27 @@
 
 LD_PATHS  +=
-LD_LIBS   += -lhttpd
-LD_LIBS   += -lftpd
+
 #NATIVE_OBJ = $(shell $(OBJCOPY) 2>&1  | grep copy: | cut -d':' -f3 | cut -d' ' -f2)
 OBJDUMP=$(OBJCOPY:copy=dump)
+
+USE_GOHEAD=no
+USE_SIMPLE=yes
+USE_FTPD=yes
+ifeq ($(USE_GOHEAD),yes)
+  HTTPD     = GoAhead Web Server
+  CFLAGS   += -DWEBS -DUEMF -DUSE_GOAHEAD_HTTPD
+  LD_LIBS  += -lhttpd
+endif
+
+ifeq ($(USE_SIMPLE),yes)
+  HTTPD     = Simple HTTPD Web Server
+  CFLAGS   += -DUSE_SIMPLE_HTTPD
+  LD_LIBS  += -lshttpd
+endif
+
+ifeq ($(USE_FTPD),yes)
+  CFLAGS   += -DUSE_FTPD
+  LD_LIBS  += -lftpd
+endif
 
 #
@@ -53,5 +71,5 @@
 #
 
-CLEAN_ADDITIONS += tarfile obj_format
+CLEAN_ADDITIONS += tarfile obj_format stamp-index-html rootfs/index.html
 CLOBBER_ADDITIONS +=
 
@@ -65,13 +83,18 @@
 	    sed -e 's/^.*format //' >obj_format
 
-${PGM}: $(OBJS) obj_format $(LINK_FILES)
+${PGM}: $(OBJS) $(LINK_FILES)
+	$(make-exe)
+
+$(ARCH)/tarfile.o: $(ARCH) stamp-index-html obj_format
 	cd rootfs ; tar cf ../$(ARCH)/tarfile --exclude CVS .
 	cp $(ARCH)/tarfile .
 	$(OBJCOPY) -I binary -O `cat obj_format` tarfile $(ARCH)/tarfile.o
-	$(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o \
-	    $(ARCH)/init.o $(ARCH)/tarfile.o
-	$(MV) $(ARCH)/temp.o  $(ARCH)/init.o
-	$(RM) $(ARCH)/temp.o
-	$(make-exe)
+	$(LD) $(LD_CPU_CFLAGS) -r -o $(ARCH)/temp.o $(ARCH)/tarfile.o
+
+stamp-index-html: index.html.in
+ifneq ($(HTTPD),)
+	sed -e 's/@SERVER@/$(HTTPD)/' <index.html.in >rootfs/index.html
+endif
+	touch stamp-index-html
 
 # Install the program(s), appending _g or _p as appropriate.
Index: http/index.html.in
===================================================================
--- http/index.html.in	(revision d51420e73bb4a1998a0ebf130ecd4aae2f12c0ab)
+++ http/index.html.in	(revision d51420e73bb4a1998a0ebf130ecd4aae2f12c0ab)
@@ -0,0 +1,12 @@
+<HTML>
+<HEAD><TITLE>RTEMS @SERVER@ Test Page</TITLE></HEAD>
+<BODY BGCOLOR="FFFFFF">
+<center>
+<H1>RTEMS @SERVER@ Test Page</H1>
+<A HREF="http://www.rtems.org">
+  <IMG align=center BORDER=0 SRC="rtems_logo.jpg" ALT="RTEMS"> </A>
+
+<P><big>Congratulations, you have successfully loaded your first page
+from the @SERVER@ running on RTEMS.</big></P>
+</center>
+</BODY></HTML>
Index: http/init.c
===================================================================
--- http/init.c	(revision f6559799c3dc0571509427ecd43c7c1dbc8dba27)
+++ http/init.c	(revision d51420e73bb4a1998a0ebf130ecd4aae2f12c0ab)
@@ -5,8 +5,4 @@
  *  Don't forget to change the IP addresses
  */
-
-#define USE_HTTPD
-#define USE_FTPD
-#define TEST_INIT
 
 #define CONFIGURE_APPLICATION_NEEDS_CONSOLE_DRIVER
@@ -73,18 +69,37 @@
 
 #if defined(USE_FTPD)
-struct rtems_ftpd_configuration rtems_ftpd_configuration = {
-   10,                     /* FTPD task priority            */
-   1024,                   /* Maximum buffersize for hooks  */
-   21,                     /* Well-known port     */
-   NULL                    /* List of hooks       */
-};
+  boolean FTPD_enabled = TRUE;
+  struct rtems_ftpd_configuration rtems_ftpd_configuration = {
+    10,                     /* FTPD task priority            */
+    1024,                   /* Maximum buffersize for hooks  */
+    21,                     /* Well-known port     */
+    NULL                    /* List of hooks       */
+ };
+#else
+ boolean FTPD_enabled = FALSE;
 #endif
 
-/* GoAhead Trace Handler */
-#include <goahead/uemf.h>
-void quietTraceHandler(int level, char *buf)
-{
-  /* do nothing */
-}
+#if defined(USE_GOAHEAD_HTTPD)
+  boolean GoAhead_HTTPD_enabled = TRUE;
+
+  /* GoAhead Trace Handler */
+  #include <goahead/uemf.h>
+  void quietTraceHandler(int level, char *buf)
+  {
+    /* do nothing */
+  }
+#else
+  boolean GoAhead_HTTPD_enabled = FALSE;
+#endif
+
+#if defined(USE_SIMPLE_HTTPD)
+  boolean Simple_HTTPD_enabled = TRUE;
+
+  #include <shttpd/shttpd.h>
+#else
+  boolean Simple_HTTPD_enabled = FALSE;
+#endif
+
+#define bool2string(_b) ((_b) ? "true" : "false")
 
 rtems_task Init(
@@ -95,18 +110,47 @@
 
   printf("\n\n*** HTTP TEST ***\n\r" );
+  printf("GoAhead HTTPD Enabled: %s\n", bool2string(GoAhead_HTTPD_enabled) );
+  printf("Simple HTTPD Enabled: %s\n", bool2string(Simple_HTTPD_enabled) );
+  printf("FTPD Enabled: %s\n", bool2string(FTPD_enabled) );
+  printf("\n");
 
+  /*
+   * Load filesystem image
+   */
+  printf("Loading filesystem image");
   status = Untar_FromMemory((void *)(&TARFILE_START), (size_t)&TARFILE_SIZE);
    
+  printf("Initializing Network");
   rtems_bsdnet_initialize_network ();
-#if defined(USE_FTPD)
-  rtems_initialize_ftpd();
-#endif
 
-#if defined(USE_HTTPD)
-  if ( rtems_initialize_webserver() )
-    printf( "ERROR -- failed to initialize webserver\n" );
+  #if defined(USE_FTPD)
+    printf( "Initializing FTPD\n" );
+    rtems_initialize_ftpd();
+  #endif
 
-  traceSetHandler( quietTraceHandler );
-#endif
+  #if defined(USE_GOAHEAD_HTTPD)
+    printf( "Initializing GoAhead HTTPD\n" );
+    status = rtems_initialize_webserver();
+    if ( status )
+      printf( "ERROR -- failed to initialize webserver\n" );
+
+    traceSetHandler( quietTraceHandler );
+  #endif
+
+  #if defined(USE_SIMPLE_HTTPD)
+    printf( "Initializing Simple HTTPD\n" );
+    status = rtems_initialize_webserver(
+      100,                             /* initial priority */
+      RTEMS_MINIMUM_STACK_SIZE * 2,    /* stack size */
+      RTEMS_DEFAULT_MODES,             /* initial modes */
+      RTEMS_DEFAULT_ATTRIBUTES,        /* attributes */
+      NULL,                            /* init_callback */
+      NULL,                            /* addpages_callback */
+      "/"                              /* initial priority */
+    );
+    if ( status )
+      printf( "ERROR -- failed to initialize webserver\n" );
+
+  #endif
 
   status = rtems_task_delete( RTEMS_SELF );
Index: tp/rootfs/index.html
===================================================================
--- http/rootfs/index.html	(revision f6559799c3dc0571509427ecd43c7c1dbc8dba27)
+++ 	(revision )
@@ -1,12 +1,0 @@
-<HTML>
-<HEAD><TITLE>RTEMS GoAhead Test Page</TITLE></HEAD>
-<BODY BGCOLOR="FFFFFF">
-<center>
-<H1>RTEMS GoAhead Web Server Test Page</H1>
-<A HREF="http://www.rtems.org">
-  <IMG align=center BORDER=0 SRC="rtems_logo.jpg" ALT="RTEMS"> </A>
-
-<P><big>Congratulations, you have successfully loaded your first page
-from the GoAhead Web Server running on RTEMS.</big></P>
-</center>
-</BODY></HTML>
