>Number: 2936
>Category: general
>Synopsis: Adding new cygwin32 platform support to core Apache
>distribution
>Confidential: no
>Severity: non-critical
>Priority: medium
>Responsible: apache
>State: open
>Class: change-request
>Submitter-Id: apache
>Arrival-Date: Tue Sep 1 06:10:00 PDT 1998
>Last-Modified:
>Originator: [EMAIL PROTECTED]
>Organization:
apache
>Release: 1.3.1
>Environment:
Cygnus' cygwin32 b19 on top of Win32
>Description:
The patch file:
diff -C3 -r apache_1.3.1/src/Configure apache_1.3.1-cygwin32/src/Configure
*** apache_1.3.1/src/Configure Sat Jul 18 12:51:51 1998
--- apache_1.3.1-cygwin32/src/Configure Tue Sep 01 14:35:37 1998
***************
*** 476,481 ****
--- 476,485 ----
DBM_LIB=""
DB_LIB=""
;;
+ *-cygwin32*)
+ OS='cygwin32'
+ OSDIR="os/cygwin32"
+ ;;
*-openbsd*)
OS='OpenBSD'
DBM_LIB=""
***************
*** 741,746 ****
--- 745,751 ----
fi
fi
+
####################################################################
## Now we determine the C-compiler and optimization level
## to use. Settings of CC and OPTIM in Configuration have
***************
*** 832,837 ****
--- 837,848 ----
LDFLAGS_SHLIB_EXPORT=""
SHLIB_SUFFIX_DEPTH=2
;;
+ *-cygwin32*)
+ CFLAGS_SHLIB=""
+ LDFLAGS_SHLIB=""
+ LDFLAGS_SHLIB_EXPORT=""
+ SHLIB_SUFFIX_DEPTH=2
+ ;;
*-openbsd*)
CFLAGS_SHLIB="-fPIC"
LDFLAGS_SHLIB="-Bforcearchive -Bshareable"
***************
*** 1180,1185 ****
--- 1191,1208 ----
LIBS="$LIBS -lnsl"
fi
;;
+
+ *cygwin32*)
+ # cygwin32 requires -lcrypt, but has not one in the distribution
+ if ./helpers/TestCompile lib crypt; then
+ LIBS="$LIBS -lcrypt"
+ else
+ echo "** Your cygwin32 installation is missing the libcrypt.a
library."
+ echo "** Please read the file README.cygwin32 within the Apache
root directory."
+ exitcode=1
+ exit 1
+ fi
+ ;;
esac
# SOCKS4 support:
diff -C3 -r apache_1.3.1/src/helpers/GuessOS
apache_1.3.1-cygwin32/src/helpers/GuessOS
*** apache_1.3.1/src/helpers/GuessOS Mon Jun 29 14:21:03 1998
--- apache_1.3.1-cygwin32/src/helpers/GuessOS Mon Aug 31 11:52:07 1998
***************
*** 127,132 ****
--- 127,137 ----
echo "${MACHINE}-whatever-freebsd${FREEBSDVERS}"; exit 0
;;
+ CYGWIN32*:*:*:*)
+ CYGWIN32VERS=`echo ${VERSION}|sed -e 's/[-(].*//'`
+ echo "${MACHINE}-whatever-cygwin32/${CYGWIN32VERS}"; exit 0
+ ;;
+
NetBSD:*:*:*486*)
echo "i486-whatever-netbsd"; exit 0
;;
diff -C3 -r apache_1.3.1/src/include/ap_config.h
apache_1.3.1-cygwin32/src/include/ap_config.h
*** apache_1.3.1/src/include/ap_config.h Sat Jul 18 17:30:43 1998
--- apache_1.3.1-cygwin32/src/include/ap_config.h Mon Aug 31 22:05:53 1998
***************
*** 90,96 ****
#include "os.h"
#endif
! #if !defined(QNX) && !defined(MPE) && !defined(WIN32)
#include <sys/param.h>
#endif
--- 90,96 ----
#include "os.h"
#endif
! #if !defined(QNX) && !defined(MPE) && !defined(WIN32) &&
!defined(__CYGWIN32__)
#include <sys/param.h>
#endif
***************
*** 604,609 ****
--- 604,616 ----
#define HAVE_SYSLOG 1
#define SYS_SIGLIST sys_siglist
+ #elif defined(__CYGWIN32__)
+ #define JMP_BUF jmp_buf
+ #define NO_KILLPG
+ #define USE_LONGJMP
+ /* taken from /gnuwin32/b19/H-i386-cygwin32/i386-cygwin32/include/mywinsock.h
*/
+ #define SO_SNDBUF 0x1001 /* send buffer size */
+
#elif defined(QNX)
#ifndef crypt
char *crypt(const char *pw, const char *salt);
***************
*** 858,864 ****
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>
! #if !defined(MPE) && !defined(BEOS)
#include <arpa/inet.h> /* for inet_ntoa */
#endif
#include <sys/wait.h>
--- 865,871 ----
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>
! #if !defined(MPE) && !defined(BEOS) && !defined(__CYGWIN32__)
#include <arpa/inet.h> /* for inet_ntoa */
#endif
#include <sys/wait.h>
***************
*** 871,877 ****
#define O_BINARY (0)
#endif
! #else /* WIN32 */
#include <winsock.h>
#include <malloc.h>
#include <io.h>
--- 878,884 ----
#define O_BINARY (0)
#endif
! #elif !defined(__CYGWIN32__) /* WIN32 */
#include <winsock.h>
#include <malloc.h>
#include <io.h>
diff -C3 -r apache_1.3.1/src/main/http_core.c
apache_1.3.1-cygwin32/src/main/http_core.c
*** apache_1.3.1/src/main/http_core.c Mon Jul 13 13:32:39 1998
--- apache_1.3.1-cygwin32/src/main/http_core.c Mon Aug 31 12:01:25 1998
***************
*** 2588,2594 ****
return METHOD_NOT_ALLOWED;
}
! #if defined(__EMX__) || defined(WIN32)
/* Need binary mode for OS/2 */
f = ap_pfopen(r->pool, r->filename, "rb");
#else
--- 2588,2594 ----
return METHOD_NOT_ALLOWED;
}
! #if defined(__EMX__) || defined(WIN32) || defined(__CYGWIN32__)
/* Need binary mode for OS/2 */
f = ap_pfopen(r->pool, r->filename, "rb");
#else
***************
*** 2605,2614 ****
--- 2605,2621 ----
ap_set_last_modified(r);
ap_set_etag(r);
ap_table_setn(r->headers_out, "Accept-Ranges", "bytes");
+
+ /*
+ * FIXME: The next if statement breaks binary transmissions
+ * on the cygwin32 platform - Stipe Tolj ([EMAIL PROTECTED]).
+ */
+ #if !defined(__CYGWIN32__)
if (((errstatus = ap_meets_conditions(r)) != OK)
|| (errstatus = ap_set_content_length(r, r->finfo.st_size))) {
return errstatus;
}
+ #endif
#ifdef USE_MMAP_FILES
ap_block_alarms();
diff -C3 -r apache_1.3.1/src/main/http_main.c
apache_1.3.1-cygwin32/src/main/http_main.c
*** apache_1.3.1/src/main/http_main.c Tue Jul 14 11:57:55 1998
--- apache_1.3.1-cygwin32/src/main/http_main.c Mon Aug 31 12:04:57 1998
***************
*** 115,121 ****
#endif
#ifdef WIN32
#include "../os/win32/getopt.h"
! #elif !defined(BEOS)
#include <netinet/tcp.h>
#endif
--- 115,121 ----
#endif
#ifdef WIN32
#include "../os/win32/getopt.h"
! #elif !defined(BEOS) && !defined(__CYGWIN32__)
#include <netinet/tcp.h>
#endif
***************
*** 2632,2638 ****
int x;
chdir("/");
! #if !defined(MPE) && !defined(__EMX__)
/* Don't detach for MPE because child processes can't survive the death of
the parent. */
if ((x = fork()) > 0)
--- 2632,2638 ----
int x;
chdir("/");
! #if !defined(MPE) && !defined(__EMX__) && !defined(__CYGWIN32__)
/* Don't detach for MPE because child processes can't survive the death of
the parent. */
if ((x = fork()) > 0)
***************
*** 2656,2662 ****
fprintf(stderr, "httpd: setpgrp or getpgrp failed\n");
exit(1);
}
! #elif defined(__EMX__)
/* OS/2 don't support process group IDs */
pgrp = getpid();
#elif defined(MPE)
--- 2656,2662 ----
fprintf(stderr, "httpd: setpgrp or getpgrp failed\n");
exit(1);
}
! #elif defined(__EMX__) || defined(__CYGWIN32__)
/* OS/2 don't support process group IDs */
pgrp = getpid();
#elif defined(MPE)
***************
*** 2723,2729 ****
else
name = ap_user_name;
! #ifndef __EMX__
/* OS/2 dosen't support groups. */
/* Reset `groups' attributes. */
--- 2723,2729 ----
else
name = ap_user_name;
! #if !defined(__EMX__) && !defined(__CYGWIN32__)
/* OS/2 dosen't support groups. */
/* Reset `groups' attributes. */
***************
*** 3992,3998 ****
{
int remaining_children_to_start;
! #ifdef __EMX__
printf("%s \n", ap_get_server_version());
#endif
--- 3992,3998 ----
{
int remaining_children_to_start;
! #if defined(__EMX__) || defined(__CYGWIN32__)
printf("%s \n", ap_get_server_version());
#endif
***************
*** 5509,5516 ****
#ifdef __EMX__
printf("%s \n", ap_get_server_version());
! #endif
! #ifdef WIN32
if (!child) {
printf("%s \n", ap_get_server_version());
}
--- 5509,5515 ----
#ifdef __EMX__
printf("%s \n", ap_get_server_version());
! #elif defined(WIN32) || defined(__CYGWIN32__)
if (!child) {
printf("%s \n", ap_get_server_version());
}
>How-To-Repeat:
A mail to [EMAIL PROTECTED] has been send with the additional files for the
src/os/cygwin32 files and the README.cygwin32 file.
>Fix:
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, ]
[you need to include <[EMAIL PROTECTED]> in the Cc line ]
[and leave the subject line UNCHANGED. This is not done]
[automatically because of the potential for mail loops. ]
[If you do not include this Cc, your reply may be ig- ]
[nored unless you are responding to an explicit request ]
[from a developer. ]
[Reply only with text; DO NOT SEND ATTACHMENTS! ]