watcom16.h, watcom16.mk: Watcom 16bit C compiler support files.

unix-watcom16.mk: cross build by Watcom C compiler on Linux.
This commit is contained in:
suzuki toshiya 2017-09-11 12:10:09 +09:00
parent 782336ab31
commit 67219481a8
5 changed files with 160 additions and 24 deletions

View File

@ -0,0 +1,10 @@
#include "16bit.h"
/*
* Watcom C compiler for 16bit cannot parse a command line option
* to set preprocessor macro with a value including a dot.
* it is misunderstood as a filename.
*/
#define FT_CONFIG_MODULES_H "ftmodule.h"
#undef TT_CONFIG_OPTION_GX_VAR_SUPPORT

View File

@ -0,0 +1,83 @@
#
# FreeType 2 Watcom-specific definitions
#
# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
# Compiler command line name
#
CC := wcc
COMPILER_SEP := $(SEP)
_cc_opt_gcc_incompat := yes
_no_cpp_opt_ftmodule_h := yes
# The object file extension (for standard and static libraries). This can be
# .o, .tco, .obj, etc., depending on the platform.
#
O := obj
SO := obj
# The library file extension (for standard and static libraries). This can
# be .a, .lib, etc., depending on the platform.
#
A := lib
SA := lib
# Path inclusion flag. Some compilers use a different flag than `-I' to
# specify an additional include path. Examples are `/i=' or `-J'.
#
I := -i=
# C flag used to define a macro before the compilation of a given source
# object. Usually it is `-D' like in `-DDEBUG'.
#
D := -d
# The link flag used to specify a given library file on link. Note that
# this is only used to compile the demo programs, not the library itself.
#
L := -l
# Target flag.
#
T := -fo=
# C flags
#
# These should concern: debug output, optimization & warnings.
#
# Use the ANSIFLAGS variable to define the compiler flags used to enfore
# ANSI compliance.
#
CFLAGS ?= -zq -i=$(TOP_DIR)/builds/compiler -fi=$(TOP_DIR)/builds/compiler/watcom16.h
# ANSIFLAGS: Put there the flags used to make your compiler ANSI-compliant.
#
ANSIFLAGS := -za
# Library linking
#
CLEAN_LIBRARY ?= $(DELETE) $(subst /,$(SEP),$(PROJECT_LIBRARY))
LINK_LIBRARY = $(subst /,$(COMPILER_SEP), \
wlib -q -n $@; \
$(foreach m, $(OBJECTS_LIST), wlib -q $@ +$(m);) \
echo > nul)
# EOF

View File

@ -126,6 +126,7 @@ INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
ifndef _cc_opt_gcc_incompat
ifdef DEVEL_DIR
# We assume that all library dependencies for FreeType are fulfilled for a
# development build, so we directly access the necessary include directory
@ -133,6 +134,7 @@ ifdef DEVEL_DIR
INCLUDE_FLAGS += $(shell pkg-config --cflags libpng \
harfbuzz )
endif
endif
# C flags used for the compilation of an object file. This must include at
@ -157,10 +159,18 @@ endif
# `CPPFLAGS' might be specified by the user in the environment.
#
# some broken C compiler cannot parse "<ftmodule.h>" correctly.
# they should declare _no_cpp_opt_ftmodule_h
ifdef _no_cpp_opt_ftmodule_h
CPPFLAGS += $(I)$(TOP_DIR)/include/freetype/config
else
FTOPTION_FTMODULE_H := $(D)FT_CONFIG_MODULE_H="<ftmodule.h>"
endif
FT_CFLAGS = $(CPPFLAGS) \
$(CFLAGS) \
$DFT2_BUILD_LIBRARY \
$DFT_CONFIG_MODULES_H="<ftmodule.h>" \
$(FTOPTION_FTMODULE_H) \
$(FTOPTION_FLAG)

View File

@ -52,6 +52,14 @@ ifeq ($(PLATFORM),unix)
CC := lcc
lcc: setup
.PHONY: lcc
else
ifneq ($(findstring unix-watcom16,$(MAKECMDGOALS)),)
CONFIG_FILE := unix-watcom16.mk
CC := wcc
unix-watcom16: setup
.PHONY: unix-watcom16
else
# If a Unix platform is detected, the configure script is called and
@ -73,6 +81,7 @@ ifeq ($(PLATFORM),unix)
.PHONY: unix
endif
endif
endif
have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)

View File

@ -0,0 +1,24 @@
#
# FreeType 2 Configuration rules for Unix + Bruce CC for ELKS
#
# Development version without optimizations & libtool
# and no installation.
#
# Copyright 1996-2017 by
# David Turner, Robert Wilhelm, and Werner Lemberg.
#
# This file is part of the FreeType project, and may only be used, modified,
# and distributed under the terms of the FreeType project license,
# LICENSE.TXT. By continuing to use, modify, or distribute this file you
# indicate that you have read the license and understand and accept it
# fully.
include $(TOP_DIR)/builds/unix/unixddef.mk
include $(TOP_DIR)/builds/compiler/watcom16.mk
include $(TOP_DIR)/builds/link_std.mk
# EOF