source: project/chicken/trunk/Makefile.macosx @ 13921

Last change on this file since 13921 was 13921, checked in by felix winkelmann, 12 years ago

chicken-bug attempts several tries to connect; reordered compiler switch settings in Makefile.macosx

File size: 4.4 KB
Line 
1# Makefile.macosx - configuration for Apple Macintosh OS X -*- Makefile -*-
2#
3# Copyright (c) 2007, Felix L. Winkelmann
4# Copyright (c) 2008-2009, The Chicken Team
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
27
28SRCDIR = ./
29
30# platform configuration
31
32ARCH = $(shell sh $(SRCDIR)/config-arch.sh)
33
34# commands
35
36POSTINSTALL_PROGRAM = install_name_tool
37
38# options
39
40C_COMPILER_OPTIONS = -no-cpp-precomp -fno-strict-aliasing -fno-common -DHAVE_CHICKEN_CONFIG_H
41ifdef DEBUGBUILD
42C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
43else
44C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer
45endif
46LINKER_LINK_SHARED_LIBRARY_OPTIONS = -dynamiclib -compatibility_version 1 -current_version 1.0 -install_name $@
47POSTINSTALL_PROGRAM_FLAGS = -change libchicken$(SO) $(LIBDIR)/libchicken$(SO)
48LIBRARIAN_OPTIONS = scru
49LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -bundle -L.
50
51# file extensions
52
53SO = .dylib
54
55# special files
56
57CHICKEN_CONFIG_H = chicken-config.h
58APPLY_HACK_OBJECT = apply-hack.$(ARCH)$(O)
59
60# architectures
61
62ifeq ($(ARCH),x86-64)
63C_COMPILER_OPTIONS += -m64
64LINKER_OPTIONS += -m64
65else
66
67ifeq ($(ARCH),universal)
68C_COMPILER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
69LINKER_OPTIONS += -arch ppc -arch i386 -isysroot /Developer/SDKs/MacOSX10.4u.sdk
70
71ifneq ($(HACKED_APPLY),)
72# We undefine HACKED_APPLY in order to override rules.make.
73HACKED_APPLY=
74apply-hack.ppc.darwin$(O): apply-hack.ppc.darwin.s
75        as -arch ppc -o $@ $<
76apply-hack.x86$(O): apply-hack.x86.s
77        as -arch i386 -o $@ $<
78$(APPLY_HACK_OBJECT): apply-hack.x86$(O) apply-hack.ppc.darwin$(O)
79        lipo -create -output $(APPLY_HACK_OBJECT) $^
80endif
81endif
82endif
83
84# select default and internal settings
85
86include $(SRCDIR)/defaults.make
87
88chicken-config.h: chicken-defaults.h
89        echo "#define HAVE_DIRENT_H 1" >$@
90        echo "#define HAVE_DLFCN_H 1" >>$@
91        echo "#define HAVE_INTTYPES_H 1" >>$@
92        echo "#define HAVE_LIMITS_H 1" >>$@
93        echo "#define HAVE_LONG_LONG 1" >>$@
94        echo "#define HAVE_MEMMOVE 1" >>$@
95        echo "#define HAVE_MEMORY_H 1" >>$@
96        echo "#define HAVE_STDINT_H 1" >>$@
97        echo "#define HAVE_STDLIB_H 1" >>$@
98        echo "#define HAVE_STRERROR 1" >>$@
99        echo "#define HAVE_STRINGS_H 1" >>$@
100        echo "#define HAVE_STRING_H 1" >>$@
101        echo "#define HAVE_STRTOLL 1" >>$@
102        echo "#define HAVE_STRTOQ 1" >>$@
103        echo "#define HAVE_SYS_STAT_H 1" >>$@
104        echo "#define HAVE_SYS_TYPES_H 1" >>$@
105        echo "#define HAVE_UNISTD_H 1" >>$@
106        echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@
107        echo "#define STDC_HEADERS 1" >>$@
108        echo "#define HAVE_ALLOCA 1" >>$@
109        echo "#define HAVE_ALLOCA_H 1" >>$@
110        echo "#define HAVE_GRP_H 1" >>$@
111        echo "#define HAVE_CRT_EXTERNS_H 1" >>$@
112        echo "#define HAVE_ERRNO_H 1" >>$@
113        echo "#define HAVE_SYSEXITS_H 1" >>$@
114        echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@
115ifdef GCHOOKS
116        echo "#define C_GC_HOOKS" >>$@
117endif
118ifdef SYMBOLGC
119        echo "#define C_COLLECT_ALL_SYMBOLS" >>$@
120endif
121ifdef NOAPPLYHOOK
122        echo "#define C_NO_APPLY_HOOK" >>$@
123endif
124ifneq ($(HACKED_APPLY),)
125        echo "#define C_HACKED_APPLY" >>$@
126endif
127        cat chicken-defaults.h >>$@
128
129include $(SRCDIR)/rules.make
Note: See TracBrowser for help on using the repository browser.