Gisle Vanem's djgpp fixes

This commit is contained in:
Daniel Stenberg 2003-12-19 08:03:48 +00:00
parent 4223f602ed
commit 4ea14b25df
2 changed files with 133 additions and 104 deletions

View File

@ -1,56 +1,74 @@
# #
# Common defines for curl (djgpp/Watt-32) # Common defines for curl (djgpp/Watt-32)
# #
# Assumes you've unpacked cURL with short-file names # Assumes you've unpacked cURL with short-file names
# I.e use "set LFN=n" before untaring on Win9x/XP. # I.e use "set LFN=n" before untaring on Win9x/XP.
# Requires sed, yacc, rm and the usual stuff. # Requires sed, yacc, rm and the usual stuff.
# #
.SUFFIXES: .exe .y .SUFFIXES: .exe .y
MAKEFILE = Makefile.dj MAKEFILE = Makefile.dj
# #
# OpenSSL is available from www.openssl.org and builds okay # OpenSSL is available from www.openssl.org and builds okay
# with djgpp/Watt-32. Set to 0 if you don't need https URLs # with djgpp/Watt-32. Set to 0 if you don't need https URLs
# (reduces curl.exe with approx 700 kB) # (reduces curl.exe with approx 700 kB)
# #
USE_SSL = 1 USE_SSL = 0
default: all #
# Use zlib for contents encoding
# #
# Root directory for Waterloo tcp/ip. WATT_ROOT should be set USE_ZLIB = 0
# during Watt-32 install.
# #
WATT32_ROOT = $(subst \,/,$(WATT_ROOT)) # Use Watt-32 IPv6 stack (only IPv6 name resolution working at the moment)
OPENSSL_ROOT = /net/openssl.098 #
ZLIB_ROOT = $(DJDIR)/contrib/zlib USE_IPV6 = 1
CC = gcc default: all
YACC = bison -y
#
CFLAGS = -g -O2 -I. -I../include -Wall -DHAVE_CONFIG_H # Root directory for Waterloo tcp/ip etc. Change to suite.
# WATT_ROOT should be set during Watt-32 install.
ifeq ($(USE_SSL),1) #
CFLAGS += -DUSE_SSLEAY -DHAVE_OPENSSL_ENGINE_H WATT32_ROOT = $(subst \,/,$(WATT_ROOT))
endif OPENSSL_ROOT = /net/openssl.098
ZLIB_ROOT = /djgpp/contrib/zlib.121
#
# Generated dependencies; Due to some hacks in gcc 2.95+ and djgpp 2.03 CC = gcc
# we must prevent "$(DJDIR)/bin/../include/sys/version.h" from beeing YACC = bison -y
# included in dependency output (or else this makefile cannot be used on
# another machine). We therefore use a special 'specs' file during CFLAGS = -g -O2 -I. -I../include -Wall -DHAVE_CONFIG_H -DHAVE_SPNEGO
# pre-processing.
# ifeq ($(USE_SSL),1)
MM_SPECS = $(TMPDIR)/specs CFLAGS += -DUSE_SSLEAY
endif
depend: $(DEPEND_PREREQ)
@echo Generating dependencies.. ifeq ($(USE_ZLIB),1)
@copy $(MAKEFILE) Makefile.bak CFLAGS += -DUSE_ZLIB -I$(ZLIB_ROOT)
@echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $(MM_SPECS) endif
sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > $(MAKEFILE)
echo "# DO NOT DELETE THIS LINE" >> $(MAKEFILE) ifeq ($(USE_IPV6),1)
$(CC) -MM -specs=$(MM_SPECS) $(CFLAGS) $(SOURCES) >> $(MAKEFILE) CFLAGS += -DENABLE_IPV6
rm -f $(MM_SPECS) endif
#
# Generated dependencies; Due to some hacks in gcc 2.95+ and djgpp 2.03
# we must prevent "$(DJDIR)/bin/../include/sys/version.h" from beeing
# included in dependency output (or else this makefile cannot be used on
# another machine). We therefore use a special 'specs' file during
# pre-processing.
#
MM_SPECS = ./specs.dj
depend: $(DEPEND_PREREQ)
@echo Generating dependencies..
@copy $(MAKEFILE) Makefile.bak
@echo "*cpp: %(cpp_cpu) %{posix:-D_POSIX_SOURCE} -remap" > $(MM_SPECS)
sed -e "/^# DO NOT DELETE THIS LINE/,$$d" < Makefile.bak > $(MAKEFILE)
echo "# DO NOT DELETE THIS LINE" >> $(MAKEFILE)
$(CC) -MM -specs=$(MM_SPECS) $(CFLAGS) $(SOURCES) >> $(MAKEFILE)
rm -f $(MM_SPECS)

View File

@ -1,48 +1,59 @@
# #
# Adapted for djgpp2 / Watt-32 / DOS by # Adapted for djgpp2 / Watt-32 / DOS by
# Gisle Vanem <giva@bgnett.no> # Gisle Vanem <giva@bgnett.no>
# #
DEPEND_PREREQ = config.h DEPEND_PREREQ = config.h hugehelp.c
include ../packages/DOS/common.dj include ../packages/DOS/common.dj
ifeq ($(USE_SSL),1) ifeq ($(USE_SSL),1)
EX_LIBS = $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a EX_LIBS += $(OPENSSL_ROOT)/lib/libssl.a $(OPENSSL_ROOT)/lib/libcrypt.a
endif endif
EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a $(ZLIB_ROOT)/libz.a ifeq ($(USE_ZLIB),1)
EX_LIBS += $(ZLIB_ROOT)/libz.a
BIN = ../curl.exe endif
SOURCES = hugehelp.c main.c urlglob.c writeenv.c writeout.c
OBJECTS = $(SOURCES:.c=.o) EX_LIBS += $(WATT32_ROOT)/lib/libwatt.a
all: config.h $(BIN) PROGRAM = ../curl.exe
SOURCES = getpass.c homedir.c hugehelp.c main.c urlglob.c writeenv.c writeout.c
$(BIN): $(OBJECTS) ../lib/libcurl.a OBJECTS = $(SOURCES:.c=.o)
$(CC) -o $@ $^ $(EX_LIBS)
all: config.h $(PROGRAM)
config.h:
@echo '#include "../lib/config.dj"' > $@ $(PROGRAM): $(OBJECTS) ../lib/libcurl.a
$(CC) -o $@ $^ $(EX_LIBS)
hugehelp.c: ../docs/curl.1
groff -man $^ | perl mkhelp.pl ../readme > $@ config.h:
@echo '#include "../lib/config.dj"' > $@
clean:
- rm -f $(OBJECTS) Makefile.bak config.h #
# groff 1.18+ requires "-P -c"
vclean: clean #
- rm -f $(BIN) hugehelp.c hugehelp.c: ../docs/MANUAL ../docs/curl.1 mkhelp.pl
groff -Tascii -man ../docs/curl.1 | \
# DO NOT DELETE THIS LINE perl -w mkhelp.pl ../docs/MANUAL ../readme > $@
hugehelp.o: hugehelp.c
main.o: main.c setup.h config.h ../lib/config.dj ../include/curl/curl.h \ clean:
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \ - rm -f $(OBJECTS) Makefile.bak config.h
../include/curl/mprintf.h urlglob.h writeout.h version.h
urlglob.o: urlglob.c setup.h config.h ../lib/config.dj \ realclean vclean: clean
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \ - rm -f $(PROGRAM) hugehelp.c
../include/curl/multi.h urlglob.h
writeenv.o: writeenv.c setup.h config.h ../lib/config.dj # DO NOT DELETE THIS LINE
writeout.o: writeout.c setup.h config.h ../lib/config.dj \ getpass.o: getpass.c setup.h config.h ../lib/config.dj
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \ homedir.o: homedir.c setup.h config.h ../lib/config.dj
../include/curl/multi.h ../include/curl/mprintf.h writeout.h hugehelp.o: hugehelp.c
main.o: main.c setup.h config.h ../lib/config.dj ../include/curl/curl.h \
../include/curl/types.h ../include/curl/easy.h ../include/curl/multi.h \
../include/curl/mprintf.h urlglob.h writeout.h getpass.h homedir.h \
version.h
urlglob.o: urlglob.c setup.h config.h ../lib/config.dj \
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
../include/curl/multi.h ../include/curl/mprintf.h urlglob.h
writeenv.o: writeenv.c setup.h config.h ../lib/config.dj
writeout.o: writeout.c setup.h config.h ../lib/config.dj \
../include/curl/curl.h ../include/curl/types.h ../include/curl/easy.h \
../include/curl/multi.h ../include/curl/mprintf.h writeout.h