From b4be1607bc11ae377736191fd90a0704738bc6fd Mon Sep 17 00:00:00 2001 From: Nishi Date: Wed, 2 Oct 2024 19:24:43 +0000 Subject: [PATCH] can be compiled using bcc32 now git-svn-id: file:///raid/svn-personal/tewi/trunk@215 8739d7e6-ffea-ec47-b151-bdff447c6205 --- Common/Makefile | 5 ++-- Common/dir.c | 2 +- Module/Makefile | 4 ++-- Module/mod_cgi.c | 2 +- Module/mod_example.c | 2 +- Module/mod_proxy.c | 2 +- Platform/bcc.mk | 16 +++++++++++++ Platform/vc6.mk | 1 + Server/Makefile | 8 ++++++- Server/config.c | 8 +++---- Server/http.c | 2 +- Server/main.c | 14 +++++++---- Server/module.c | 8 +++---- Server/server.c | 57 +++++++++++++++++++++++++++++--------------- Server/strptime.c | 33 ++++++++++++++++++++----- Server/tw_config.h | 6 ++--- Server/version.c | 2 ++ bcc.sh | 55 ++++++++++++++++++++++++++++++++++++++++++ config.h.tmpl | 6 ++--- 19 files changed, 180 insertions(+), 53 deletions(-) create mode 100644 Platform/bcc.mk create mode 100644 bcc.sh diff --git a/Common/Makefile b/Common/Makefile index 520e1fe..f328220 100644 --- a/Common/Makefile +++ b/Common/Makefile @@ -3,6 +3,7 @@ OBJ=o STATIC=a AR_FLAGS=rcs +AR_PROC=cat include $(PWD)/Platform/$(PLATFORM).mk .PHONY: all clean @@ -13,10 +14,10 @@ OBJS = string.$(OBJ) log.$(OBJ) dir.$(OBJ) all: common.$(STATIC) common.$(STATIC): $(OBJS) - $(AR) $(AR_FLAGS)$@ $(OBJS) + $(AR) $(AR_FLAGS)$@ `echo $(OBJS) | $(AR_PROC)` .c.$(OBJ): $(CC) $(CFLAGS) -c -o $@ $< clean: - rm -f *.o *.a *.lib + rm -f *.o *.a *.lib *.obj diff --git a/Common/dir.c b/Common/dir.c index 7b37f17..eae03e4 100644 --- a/Common/dir.c +++ b/Common/dir.c @@ -18,7 +18,7 @@ int cm_sort(const void* _a, const void* _b) { } char** cm_scandir(const char* path) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) return NULL; #else DIR* dir = opendir(path); diff --git a/Module/Makefile b/Module/Makefile index 6848729..00cea8c 100644 --- a/Module/Makefile +++ b/Module/Makefile @@ -13,7 +13,7 @@ all: mod_cgi$(LIBSUF) mod_proxy$(LIBSUF) $(CC) $(LDFLAGS) -shared -o $@ $< ../Common/common.$(STATIC) $(LIBS) .c.$(OBJ): - $(CC) $(CFLAGS) -c -o $@ $< + $(CC) $(CFLAGS) -I ../Server -c -o $@ $< clean: - rm -f *.o *.so *.a *.dll *.dll + rm -f *.o *.so *.a *.dll diff --git a/Module/mod_cgi.c b/Module/mod_cgi.c index 718b8ab..6659043 100644 --- a/Module/mod_cgi.c +++ b/Module/mod_cgi.c @@ -1,6 +1,6 @@ /* $Id$ */ -#include "../Server/tw_module.h" +#include #include diff --git a/Module/mod_example.c b/Module/mod_example.c index 6e8d9e2..a554de5 100644 --- a/Module/mod_example.c +++ b/Module/mod_example.c @@ -1,7 +1,7 @@ /* $Id$ */ /* This module will accept all directives, and always return 403 on the access. */ -#include "../Server/tw_module.h" +#include int mod_init(struct tw_config* config, struct tw_tool* tools) { tools->log("Example", "This is an example module"); diff --git a/Module/mod_proxy.c b/Module/mod_proxy.c index 932db7a..4c09144 100644 --- a/Module/mod_proxy.c +++ b/Module/mod_proxy.c @@ -1,6 +1,6 @@ /* $Id$ */ -#include "../Server/tw_module.h" +#include #include diff --git a/Platform/bcc.mk b/Platform/bcc.mk new file mode 100644 index 0000000..7fc5c67 --- /dev/null +++ b/Platform/bcc.mk @@ -0,0 +1,16 @@ +# $Id$ + +PREFIX = C:/Tewi + +CC = ../bcc.sh +AR = tlib +AR_FLAGS = +AR_PROC = grep -Eo "[^ ]+" | xargs -I {} echo + {} +CFLAGS = -g -std=c99 -DPREFIX=\"$(PREFIX)\" -I ../Common -fPIC +LDFLAGS = +LIBS = -lws2_32 +EXEC = +STATIC = lib +LIBSUF = .dll +OBJ = obj +REQOBJS = tewi_bcc.res diff --git a/Platform/vc6.mk b/Platform/vc6.mk index 8e06552..f0105be 100644 --- a/Platform/vc6.mk +++ b/Platform/vc6.mk @@ -12,3 +12,4 @@ EXEC = STATIC = lib LIBSUF = .dll OBJ = obj +PREOBJS = tewi_vc6.res diff --git a/Server/Makefile b/Server/Makefile index e62626e..18aa72e 100644 --- a/Server/Makefile +++ b/Server/Makefile @@ -13,7 +13,7 @@ all: tewi$(EXEC) $(TARGET) tewi_strip$(EXEC): tewi$(EXEC) -tewi$(EXEC): $(OBJS) ../Common/common.$(STATIC) +tewi$(EXEC): $(OBJS) ../Common/common.$(STATIC) $(REQOBJS) $(CC) $(LDFLAGS) $(EXTLDFLAGS) -o $@ $(OBJS) $(EXTLIBS) ../Common/common.$(STATIC) $(LIBS) $(SERVADD) @@ -48,5 +48,11 @@ tewi.pkg: tewi.self tewi.res: tewi.rc ../Binary/tewi.ico $(WINDRES) tewi.rc -O coff -o $@ +tewi_vc6.res: tewi.rc ../Binary/tewi.ico + rc /fo$@ tewi.rc + +tewi_bcc.res: tewi.rc ../Binary/tewi.ico + brc32 -r -fo$@ tewi.rc + clean: rm -f *.o tewi *.exe *.res *.elf *.sfo *.pbp *.self *.pkg *.obj diff --git a/Server/config.c b/Server/config.c index c48daf1..3a320af 100644 --- a/Server/config.c +++ b/Server/config.c @@ -10,11 +10,11 @@ #include #include -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__BORLANDC__) #include #endif -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #endif @@ -266,14 +266,14 @@ int tw_config_read(const char* path) { #endif ) { for(i = 1; r[i] != NULL; i++) { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) uint32_t port = atoi(r[i]); #else uint64_t port = atoi(r[i]); #endif int j; cm_log("Config", "Going to listen at port %d%s", (int)port, cm_strcaseequ(r[0], "ListenSSL") ? " with SSL" : ""); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1UL << 31); #else if(cm_strcaseequ(r[0], "ListenSSL")) port |= (1ULL << 31); diff --git a/Server/http.c b/Server/http.c index 549d842..e5fab0e 100644 --- a/Server/http.c +++ b/Server/http.c @@ -15,7 +15,7 @@ #include #include -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #else #ifdef USE_POLL diff --git a/Server/main.c b/Server/main.c index 52e5617..a418157 100644 --- a/Server/main.c +++ b/Server/main.c @@ -4,7 +4,13 @@ #include "../config.h" -#ifndef _MSC_VER +#ifdef __BORLANDC__ + +#pragma resource "tewi_bcc.res" + +#endif + +#if !defined(_MSC_VER) && !defined(__BORLANDC__) #include #endif #include @@ -24,7 +30,7 @@ #include "tw_server.h" #include "tw_version.h" -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #endif @@ -61,7 +67,7 @@ PSP_MAIN_THREAD_ATTR(PSP_THREAD_ATTR_USER); #define printf(...) tt_printf(__VA_ARGS__) #define STDERR_LOG(...) tt_printf(__VA_ARGS__) -#elif defined(_MSC_VER) +#elif defined(_MSC_VER) || defined(__BORLANDC__) void STDERR_LOG(const char* format, ...) { va_list args; va_start(args, format); @@ -783,7 +789,7 @@ int startup(int argc, char** argv) { r = cm_strcat(tw_server, " running..."); cm_force_log(r); free(r); -#if !defined(__MINGW32__) && !defined(_MSC_VER) +#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) signal(SIGCHLD, SIG_IGN); signal(SIGPIPE, SIG_IGN); #else diff --git a/Server/module.c b/Server/module.c index 9b7bed6..b11dd3a 100644 --- a/Server/module.c +++ b/Server/module.c @@ -11,7 +11,7 @@ #include #include -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__BORLANDC__) #include #endif @@ -26,7 +26,7 @@ int tw_module_init(void* mod) { return 1; } #else -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #else #include @@ -36,7 +36,7 @@ void* tw_module_load(const char* path) { char* p = getcwd(NULL, 0); void* lib; chdir(config.server_root); -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) lib = LoadLibraryA(path); #else lib = dlopen(path, RTLD_LAZY); @@ -50,7 +50,7 @@ void* tw_module_load(const char* path) { } void* tw_module_symbol(void* mod, const char* sym) { -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) return GetProcAddress(mod, sym); #else return dlsym(mod, sym); diff --git a/Server/server.c b/Server/server.c index c8a2634..bc23a02 100644 --- a/Server/server.c +++ b/Server/server.c @@ -15,7 +15,7 @@ #include "tw_module.h" #include "tw_version.h" -#ifndef _MSC_VER +#if !defined(_MSC_VER) && !defined(__BORLANDC__) #include #endif #include @@ -32,7 +32,7 @@ #include #include -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #ifndef NO_GETADDRINFO #include #include @@ -83,7 +83,7 @@ int sockcount = 0; SOCKADDR addresses[MAX_PORTS]; int sockets[MAX_PORTS]; -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) const char* reserved_names[] = {"CON", "PRN", "AUX", "NUL", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}; #endif @@ -110,7 +110,7 @@ int tw_wildcard_match(const char* wildcard, const char* target) { } void close_socket(int sock) { -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) closesocket(sock); #else close(sock); @@ -119,7 +119,7 @@ void close_socket(int sock) { int tw_server_init(void) { int i; -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) WSADATA wsa; WSAStartup(MAKEWORD(2, 0), &wsa); #endif @@ -134,7 +134,7 @@ int tw_server_init(void) { #else int sock = socket(AF_INET6, SOCK_STREAM, IPPROTO_TCP); #endif -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) if(sock == INVALID_SOCKET) #else if(sock < 0) @@ -237,7 +237,7 @@ void _tw_process_page(SSL* ssl, int sock, const char* status, const char* type, f = NULL; doc = NULL; } -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) sprintf(construct, "%lu", (unsigned long)size); #else sprintf(construct, "%llu", (unsigned long long)size); @@ -450,12 +450,14 @@ struct pass_entry { #if defined(__MINGW32__) || defined(_MSC_VER) unsigned int WINAPI tw_server_pass(void* ptr) { +#elif defined(__BORLANDC__) +void tw_server_pass(void* ptr) { #elif defined(__HAIKU__) int32_t tw_server_pass(void* ptr) { #elif defined(_PSP) || defined(__PPU__) int tw_server_pass(void* ptr) { #endif -#if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) +#if defined(__HAIKU__) || defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) #define FREE_PTR int sock = ((struct pass_entry*)ptr)->sock; bool ssl = ((struct pass_entry*)ptr)->ssl; @@ -548,7 +550,7 @@ int tw_server_pass(void* ptr) { time_t t; struct tm* btm; strptime(req.headers[i + 1], "%a, %d %b %Y %H:%M:%S GMT", &tm); -#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_PSP) || defined(__PPU__) || defined(__ps2sdk__) || defined(_MSC_VER) || defined(__BORLANDC__) t = 0; btm = localtime(&t); cmtime = mktime(&tm); @@ -611,10 +613,20 @@ int tw_server_pass(void* ptr) { char* path; char* rpath; struct stat st; + char* slash; cm_log("Server", "Document root is %s", vhost_entry->root == NULL ? "not set" : vhost_entry->root); path = cm_strcat(vhost_entry->root == NULL ? "" : vhost_entry->root, req.path); cm_log("Server", "Filesystem path is %s", path); -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(_MSC_VER) || defined(__BORLANDC__) + for(i = strlen(path) - 1; i >= 0; i--){ + if(path[i] == '/'){ + path[i] = 0; + }else{ + break; + } + } +#endif +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) rpath = cm_strdup(path); for(i = strlen(rpath) - 1; i >= 0; i--) { if(rpath[i] == '/') { @@ -646,7 +658,8 @@ int tw_server_pass(void* ptr) { tw_http_error(s, sock, 403, name, port, vhost_entry); } else if(S_ISDIR(st.st_mode)) { if(req.path[strlen(req.path) - 1] != '/') { - char* headers[3] = {"Location", cm_strcat(req.path, "/"), NULL}; + char* headers[3] = {"Location", NULL, NULL}; + headers[1] = cm_strcat(req.path, "/"); cm_log("Server", "Accessing directory without the slash at the end"); _tw_process_page(s, sock, tw_http_status(301), NULL, NULL, NULL, 0, headers, 0, 0); free(headers[1]); @@ -884,12 +897,18 @@ cleanup: SSL_free(s); #endif close_socket(sock); -#if defined(__MINGW32__) || defined(_MSC_VER) - _endthread(0); +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) + _endthread( +#ifndef __BORLANDC__ + 0 +#endif + ); #elif defined(__HAIKU__) exit_thread(0); #endif +#ifndef __BORLANDC__ return 0; +#endif } #ifdef SERVICE @@ -897,7 +916,7 @@ extern SERVICE_STATUS status; extern SERVICE_STATUS_HANDLE status_handle; #endif -#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) struct thread_entry { #ifdef __HAIKU__ thread_id thread; @@ -916,7 +935,7 @@ void tw_server_loop(void) { fd_set fdset; struct timeval tv; #endif -#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_MSC_VER) || defined(__BORLANDC__) struct thread_entry threads[2048]; for(i = 0; i < sizeof(threads) / sizeof(threads[0]); i++) { threads[i].used = false; @@ -947,7 +966,7 @@ void tw_server_loop(void) { #endif #endif if(ret == -1) { -#if !defined(__MINGW32__) && !defined(_MSC_VER) +#if !defined(__MINGW32__) && !defined(_MSC_VER) && !defined(__BORLANDC__) cm_log("Server", "Select failure: %s", strerror(errno)); #endif break; @@ -971,12 +990,12 @@ void tw_server_loop(void) { SOCKADDR claddr; socklen_t clen = sizeof(claddr); int sock = accept(sockets[i], (struct sockaddr*)&claddr, &clen); -#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(__HAIKU__) || defined(_PSP) || defined(__PPU__) || defined(_MSC_VER) || defined(__BORLANDC__) int j; struct pass_entry* e = malloc(sizeof(*e)); cm_log("Server", "New connection accepted"); e->sock = sock; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) e->ssl = config.ports[i] & (1UL << 31); #else e->ssl = config.ports[i] & (1ULL << 31); @@ -984,7 +1003,7 @@ void tw_server_loop(void) { e->port = config.ports[i]; e->addr = claddr; #endif -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) _beginthread(tw_server_pass, 0, e); #elif defined(_PSP) || defined(__PPU__) tw_server_pass(e); diff --git a/Server/strptime.c b/Server/strptime.c index 1165cff..1000af6 100644 --- a/Server/strptime.c +++ b/Server/strptime.c @@ -35,7 +35,7 @@ //#include //__RCSID("$NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $"); -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #include @@ -103,11 +103,32 @@ static const unsigned char *find_string(const unsigned char *, int *, const char #define isleap_sum(a, b) isleap((a) % 400 + (b) % 400) -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) #define tzname _tzname #define strncasecmp _strnicmp #endif +#ifdef __BORLANDC__ +char* cm_strdup(const char* str); + +int _strnicmp(const char* _a, const char* _b, int len){ + char* a = cm_strdup(_a); + char* b = cm_strdup(_b); + int i; + char* r; + for(i = 0; a[i] != 0; i++){ + a[i] = tolower(a[i]); + } + for(i = 0; b[i] != 0; i++){ + b[i] = tolower(b[i]); + } + r = strncmp(a, b, len); + free(a); + free(b); + return r; +} +#endif + #ifdef TM_ZONE static char* utc = "UTC"; #endif @@ -399,7 +420,7 @@ recurse: continue; #ifndef TIME_MAX -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) #define TIME_MAX INT32_MAX #else #define TIME_MAX INT64_MAX @@ -408,7 +429,7 @@ recurse: case 's': /* seconds since the epoch */ { time_t sse = 0; -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) uint32_t rulim = TIME_MAX; #else uint64_t rulim = TIME_MAX; @@ -425,7 +446,7 @@ recurse: rulim /= 10; } while ((sse * 10 <= TIME_MAX) && rulim && *bp >= '0' && *bp <= '9'); -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) if (sse < 0 || (uint32_t)sse > TIME_MAX) { #else if (sse < 0 || (uint64_t)sse > TIME_MAX) { @@ -434,7 +455,7 @@ recurse: continue; } #ifdef _WIN32 -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) if (1) #else if (localtime_s(tm, &sse) == 0) diff --git a/Server/tw_config.h b/Server/tw_config.h index 823f2f3..d640ae1 100644 --- a/Server/tw_config.h +++ b/Server/tw_config.h @@ -14,7 +14,7 @@ extern "C" { #include #include -#if defined(__MINGW32__) || defined(_MSC_VER) +#if defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__) #include #define NO_IPV6 #else @@ -42,7 +42,7 @@ extern "C" { #define MAX_INDEX 1024 #define MAX_README 8 -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) #define NUM1024 1024UL #else #define NUM1024 1024ULL @@ -94,7 +94,7 @@ struct tw_config_entry { }; struct tw_config { -#ifdef _MSC_VER +#if defined(_MSC_VER) || defined(__BORLANDC__) uint32_t ports[MAX_PORTS + 1]; #else uint64_t ports[MAX_PORTS + 1]; /* If port & (1 << 32) is non-zero, it is SSL */ diff --git a/Server/version.c b/Server/version.c index 4aa7c1e..a0c4cfc 100644 --- a/Server/version.c +++ b/Server/version.c @@ -17,6 +17,8 @@ const char* tw_platform = "Windows-MinGW32" #elif defined(_MSC_VER) "Windows-MSVC" +#elif defined(__BORLANDC__) + "Windows-BCC" #elif defined(__HAIKU__) "Haiku" #elif defined(__CYGWIN__) diff --git a/bcc.sh b/bcc.sh new file mode 100644 index 0000000..fd42452 --- /dev/null +++ b/bcc.sh @@ -0,0 +1,55 @@ +#!/bin/sh +# $Id$ +# Wrapper for CL. VC6 sucks. + +outfile="a.out" +dowhat="" +options="-I../VC6Compat -tWM" +obj=0 +source="" +libraries="" +link="" +shared=0 + +for i in "$@"; do + if [ "$i" = "-o" ]; then + dowhat="output" + elif [ "$i" = "-I" ]; then + dowhat="include" + elif [ "$i" = "-c" ]; then + options="$options -c" + obj=1 + elif [ "$i" = "-fPIC" ]; then + : + elif [ "$i" = "-g" ]; then + : + elif [ "$i" = "-std=c99" ]; then + : + elif [ "$i" = "-shared" ]; then + options="$options -tWD" + shared=1 + elif [ "`echo "$i" | grep -Eo "^-D"`" = "-D" ]; then + options="$options -`echo "$i" | sed "s/^-//g"`" + elif [ "`echo "$i" | grep -Eo "^-l"`" = "-l" ]; then + libraries="$libraries `echo "$i" | sed "s/^-l//g"`.lib" + elif [ "$dowhat" = "output" ]; then + dowhat="" + outfile="$i" + elif [ "$dowhat" = "include" ]; then + dowhat="" + options="$options -I$i" + elif [ ! "`echo "$i" | grep -Eo "^."`" = "-" ]; then + source="$source $i" + fi +done +if [ "$obj" = "1" ]; then + options="$options -o$outfile" +else + options="$options -e$outfile" +fi +if [ ! "$libraries" = "" ]; then + link="$libraries" +fi +construct="bcc32 $options $source $link" +echo "Run: $construct" +$construct diff --git a/config.h.tmpl b/config.h.tmpl index dda9796..956ab1c 100644 --- a/config.h.tmpl +++ b/config.h.tmpl @@ -17,17 +17,17 @@ #define SSL void #endif -#if (defined(__MINGW32__) || defined(_MSC_VER)) && defined(USE_POLL) +#if (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)) && defined(USE_POLL) #undef USE_POLL /* Force select(2) for Windows */ #endif -#if (defined(__MINGW32__) || defined(_MSC_VER)) && defined(HAS_CHROOT) +#if (defined(__MINGW32__) || defined(_MSC_VER) || defined(__BORLANDC__)) && defined(HAS_CHROOT) #undef HAS_CHROOT /* Windows should not have chroot */ #endif -#if defined(_MSC_VER) && !defined(NO_GETADDRINFO) +#if (defined(_MSC_VER) || defined(__BORLANDC__)) && !defined(NO_GETADDRINFO) #define NO_GETADDRINFO /* Do not use getaddrinfo */ #endif -- 2.45.2