1#
2# FreeType 2 configuration file to detect a UNIX host platform.
3#
4
5
6# Copyright (C) 1996-2020 by
7# David Turner, Robert Wilhelm, and Werner Lemberg.
8#
9# This file is part of the FreeType project, and may only be used, modified,
10# and distributed under the terms of the FreeType project license,
11# LICENSE.TXT.  By continuing to use, modify, or distribute this file you
12# indicate that you have read the license and understand and accept it
13# fully.
14
15.PHONY: setup
16
17ifeq ($(PLATFORM),ansi)
18
19  # Note: this test is duplicated in "builds/toplevel.mk".
20  #
21  is_unix := $(strip $(wildcard /sbin/init) \
22                     $(wildcard /usr/sbin/init) \
23                     $(wildcard /dev/null) \
24                     $(wildcard /hurd/auth))
25  ifneq ($(is_unix),)
26
27    PLATFORM := unix
28
29  endif # test is_unix
30endif # test PLATFORM ansi
31
32ifeq ($(PLATFORM),unix)
33  COPY   := cp
34  DELETE := rm -f
35  CAT    := cat
36
37  # If `devel' is the requested target, we use a special configuration
38  # file named `unix-dev.mk'.  It disables optimization and libtool.
39  #
40  ifneq ($(findstring devel,$(MAKECMDGOALS)),)
41    CONFIG_FILE := unix-dev.mk
42    CC          := gcc
43
44    .PHONY: devel
45    devel: setup
46	    @:
47  else
48
49    # If `lcc' is the requested target, we use a special configuration
50    # file named `unix-lcc.mk'.  It disables libtool for LCC.
51    #
52    ifneq ($(findstring lcc,$(MAKECMDGOALS)),)
53      CONFIG_FILE := unix-lcc.mk
54      CC          := lcc
55
56      .PHONY: lcc
57      lcc: setup
58	      @:
59    else
60
61      # If a Unix platform is detected, the configure script is called and
62      # `unix-def.mk' together with `unix-cc.mk' is created.
63      #
64      # Arguments to `configure' should be in the CFG variable.  Example:
65      #
66      #   make CFG="--prefix=/usr --disable-static"
67      #
68      # If you need to set CFLAGS or LDFLAGS, do it here also.
69      #
70      # Feel free to add support for other platform specific compilers in
71      # this directory (e.g. solaris.mk + changes here to detect the
72      # platform).
73      #
74      CONFIG_FILE := unix.mk
75      must_configure := 1
76
77      .PHONY: unix
78      unix: setup
79	      @:
80    endif
81  endif
82
83  have_Makefile := $(wildcard $(OBJ_DIR)/Makefile)
84
85      setup: std_setup
86  ifdef must_configure
87    ifneq ($(have_Makefile),)
88      # we are building FT2 not in the src tree
89	        $(TOP_DIR)/builds/unix/configure $(value CFG)
90    else
91	      cd builds/unix; \
92	        ./configure $(value CFG)
93    endif
94  endif
95
96endif   # test PLATFORM unix
97
98
99# EOF
100