summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorsuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2017-09-11 12:10:09 +0900
committersuzuki toshiya <mpsuzuki@hiroshima-u.ac.jp>2017-09-13 17:11:11 +0900
commit67219481a87f8618cd95673c16b2f42829129a9d (patch)
treee5033bc1e9ed45cedb1ac32bbb6cee027c3fb2d3
parent782336ab3121888f003f8569cf8deb3ed9009ceb (diff)
downloadfreetype2-67219481a87f8618cd95673c16b2f42829129a9d.tar.gz
watcom16.h, watcom16.mk: Watcom 16bit C compiler support files.
unix-watcom16.mk: cross build by Watcom C compiler on Linux.
-rw-r--r--builds/compiler/watcom16.h10
-rw-r--r--builds/compiler/watcom16.mk83
-rw-r--r--builds/freetype.mk24
-rw-r--r--builds/unix/detect.mk43
-rw-r--r--builds/unix/unix-watcom16.mk24
5 files changed, 160 insertions, 24 deletions
diff --git a/builds/compiler/watcom16.h b/builds/compiler/watcom16.h
new file mode 100644
index 000000000..de550bdcd
--- /dev/null
+++ b/builds/compiler/watcom16.h
@@ -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
diff --git a/builds/compiler/watcom16.mk b/builds/compiler/watcom16.mk
new file mode 100644
index 000000000..e49d53995
--- /dev/null
+++ b/builds/compiler/watcom16.mk
@@ -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
diff --git a/builds/freetype.mk b/builds/freetype.mk
index f8cfd411c..4bd4b4f83 100644
--- a/builds/freetype.mk
+++ b/builds/freetype.mk
@@ -126,12 +126,14 @@ INCLUDES := $(subst /,$(COMPILER_SEP),$(OBJ_DIR) \
INCLUDE_FLAGS := $(INCLUDES:%=$I%)
-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
- # information using `pkg-config'.
- INCLUDE_FLAGS += $(shell pkg-config --cflags libpng \
- harfbuzz )
+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
+ # information using `pkg-config'.
+ INCLUDE_FLAGS += $(shell pkg-config --cflags libpng \
+ harfbuzz )
+ endif
endif
@@ -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)
diff --git a/builds/unix/detect.mk b/builds/unix/detect.mk
index a2cf0a72b..c8bf093d2 100644
--- a/builds/unix/detect.mk
+++ b/builds/unix/detect.mk
@@ -54,23 +54,32 @@ ifeq ($(PLATFORM),unix)
.PHONY: lcc
else
- # If a Unix platform is detected, the configure script is called and
- # `unix-def.mk' together with `unix-cc.mk' is created.
- #
- # Arguments to `configure' should be in the CFG variable. Example:
- #
- # make CFG="--prefix=/usr --disable-static"
- #
- # If you need to set CFLAGS or LDFLAGS, do it here also.
- #
- # Feel free to add support for other platform specific compilers in
- # this directory (e.g. solaris.mk + changes here to detect the
- # platform).
- #
- CONFIG_FILE := unix.mk
- unix: setup
- must_configure := 1
- .PHONY: unix
+ 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
+ # `unix-def.mk' together with `unix-cc.mk' is created.
+ #
+ # Arguments to `configure' should be in the CFG variable. Example:
+ #
+ # make CFG="--prefix=/usr --disable-static"
+ #
+ # If you need to set CFLAGS or LDFLAGS, do it here also.
+ #
+ # Feel free to add support for other platform specific compilers in
+ # this directory (e.g. solaris.mk + changes here to detect the
+ # platform).
+ #
+ CONFIG_FILE := unix.mk
+ unix: setup
+ must_configure := 1
+ .PHONY: unix
+ endif
endif
endif
diff --git a/builds/unix/unix-watcom16.mk b/builds/unix/unix-watcom16.mk
new file mode 100644
index 000000000..bca4e0e8c
--- /dev/null
+++ b/builds/unix/unix-watcom16.mk
@@ -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