~ chicken-core (chicken-5) /Makefile.macosx


  1# Makefile.macosx - configuration for Apple Macintosh OS X -*- Makefile -*-
  2#
  3# Copyright (c) 2008-2022, The CHICKEN Team
  4# Copyright (c) 2007, Felix L. Winkelmann
  5# All rights reserved.
  6#
  7# Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
  8# conditions are met:
  9#
 10#   Redistributions of source code must retain the above copyright notice, this list of conditions and the following
 11#     disclaimer.
 12#   Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following
 13#     disclaimer in the documentation and/or other materials provided with the distribution.
 14#   Neither the name of the author nor the names of its contributors may be used to endorse or promote
 15#     products derived from this software without specific prior written permission.
 16#
 17# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS
 18# OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
 19# AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR
 20# CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
 21# CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
 22# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
 23# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
 24# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
 25# POSSIBILITY OF SUCH DAMAGE.
 26
 27SRCDIR ?= ./
 28
 29# platform configuration
 30
 31C_COMPILER ?= gcc
 32ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh)
 33
 34# commands
 35
 36POSTINSTALL_PROGRAM = install_name_tool
 37
 38# options
 39
 40C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -fno-common -DHAVE_CHICKEN_CONFIG_H
 41ifdef DEBUGBUILD
 42C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
 43else
 44ifdef OPTIMIZE_FOR_SPEED
 45C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3 -fomit-frame-pointer
 46else
 47C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer
 48endif
 49endif
 50LIBRARIAN ?= ar
 51LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dynamiclib -compatibility_version 1 -current_version 1.0 -install_name $@
 52HERE = $(shell pwd)
 53PREINSTALL_PROGRAM_FIXUP = $(POSTINSTALL_PROGRAM) -change lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) $(HERE)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)
 54POSTINSTALL_PROGRAM_FLAGS = -change lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) $(LIBDIR)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) -change $(HERE)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO) $(LIBDIR)/lib$(PROGRAM_PREFIX)chicken$(PROGRAM_SUFFIX)$(SO)
 55LIBRARIAN_OPTIONS = scru
 56LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -bundle -L.
 57ASSEMBLER_OPTIONS =
 58
 59# file extensions
 60
 61SO = .dylib
 62
 63# special files
 64
 65CHICKEN_CONFIG_H = chicken-config.h
 66
 67# architectures
 68
 69ifeq ($(ARCH),x86-64)
 70C_COMPILER_OPTIONS += -m64
 71LINKER_OPTIONS += -m64
 72# Avoid bus error in install_name_tool
 73LINKER_LINK_SHARED_DLOADABLE_OPTIONS += -Wl,-headerpad -Wl,128
 74else
 75
 76ifeq ($(ARCH),universal)
 77C_COMPILER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
 78LINKER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
 79endif
 80
 81endif
 82
 83# select default and internal settings
 84
 85include $(SRCDIR)/defaults.make
 86
 87chicken-config.h: chicken-defaults.h
 88	echo "/* GENERATED */" >$@.tmp
 89	echo "#define HAVE_DIRENT_H 1" >>$@.tmp
 90	echo "#define HAVE_DLFCN_H 1" >>$@.tmp
 91	echo "#define HAVE_INTTYPES_H 1" >>$@.tmp
 92	echo "#define HAVE_LIMITS_H 1" >>$@.tmp
 93	echo "#define HAVE_LONG_LONG 1" >>$@.tmp
 94	echo "#define HAVE_MEMMOVE 1" >>$@.tmp
 95	echo "#define HAVE_MEMORY_H 1" >>$@.tmp
 96	echo "#define HAVE_SIGACTION 1" >>$@.tmp
 97	echo "#define HAVE_SIGSETJMP 1" >>$@.tmp
 98	echo "#define HAVE_SIGPROCMASK 1" >>$@.tmp
 99	echo "#define HAVE_STDINT_H 1" >>$@.tmp
100	echo "#define HAVE_STDLIB_H 1" >>$@.tmp
101	echo "#define HAVE_STRERROR 1" >>$@.tmp
102	echo "#define HAVE_STRINGS_H 1" >>$@.tmp
103	echo "#define HAVE_STRING_H 1" >>$@.tmp
104	echo "#define HAVE_STRLCAT 1" >>$@.tmp
105	echo "#define HAVE_STRLCPY 1" >>$@.tmp
106	echo "#define HAVE_STRTOLL 1" >>$@.tmp
107	echo "#define HAVE_STRTOQ 1" >>$@.tmp
108	echo "#define HAVE_SYS_STAT_H 1" >>$@.tmp
109	echo "#define HAVE_SYS_TYPES_H 1" >>$@.tmp
110	echo "#define HAVE_SETENV 1" >>$@.tmp
111	echo "#define HAVE_UNISTD_H 1" >>$@.tmp
112	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@.tmp
113	echo "#define STDC_HEADERS 1" >>$@.tmp
114	echo "#define HAVE_ALLOCA 1" >>$@.tmp
115	echo "#define HAVE_ALLOCA_H 1" >>$@.tmp
116	echo "#define HAVE_CRT_EXTERNS_H 1" >>$@.tmp
117	echo "#define HAVE_ERRNO_H 1" >>$@.tmp
118	echo "#define HAVE_SYSEXITS_H 1" >>$@.tmp
119	echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@.tmp
120ifdef GCHOOKS
121	echo "#define C_GC_HOOKS" >>$@.tmp
122endif
123	cat $@.tmp chicken-defaults.h >$@.tmp2
124	rm $@.tmp
125	mv $@.tmp2 $@
126
127include $(SRCDIR)/rules.make
Trap