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


  1# Makefile.solaris - configuration for Solaris -*- 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
 31ARCH ?= $(shell sh $(SRCDIR)/config-arch.sh)
 32# default to gcc - use "make ... C_COMPILER=cc ..." to use SunPro CC
 33export C_COMPILER ?= gcc
 34export INSTALL_PROGRAM ?= ginstall
 35
 36# options
 37
 38ifeq ($(C_COMPILER),cc)
 39ifneq (,$(filter-out x86 x86-64,$(ARCH))) # -xannotate=no is not supported on x86/x86-64
 40DISABLE_ANNOTATIONS=-xannotate=no
 41else
 42DISABLE_ANNOTATIONS=
 43endif
 44C_COMPILER_OPTIONS ?= -errtags -xdebugformat=stabs $(DISABLE_ANNOTATIONS) -DHAVE_CHICKEN_CONFIG_H
 45else
 46C_COMPILER_OPTIONS ?= -fno-strict-aliasing -fwrapv -DHAVE_CHICKEN_CONFIG_H
 47endif
 48
 49ifdef DEBUGBUILD
 50ifeq ($(C_COMPILER),cc)
 51C_COMPILER_OPTIMIZATION_OPTIONS ?= -g +w
 52else
 53C_COMPILER_OPTIMIZATION_OPTIONS ?= -g -Wall -Wno-unused
 54endif
 55else
 56ifdef OPTIMIZE_FOR_SPEED
 57ifeq ($(C_COMPILER),cc)
 58C_COMPILER_OPTIMIZATION_OPTIONS += -g -xO4
 59else
 60C_COMPILER_OPTIMIZATION_OPTIONS ?= -O3 -fomit-frame-pointer
 61endif
 62else
 63ifeq ($(C_COMPILER),cc)
 64C_COMPILER_OPTIMIZATION_OPTIONS += -g -xO3
 65else
 66C_COMPILER_OPTIMIZATION_OPTIONS ?= -Os -fomit-frame-pointer
 67endif
 68endif
 69endif
 70
 71ifeq ($(C_COMPILER),cc) # Assuming 'cc' means SunW/SunStudio compiler
 72LINKER_LINK_SHARED_LIBRARY_OPTIONS = -G $(DISABLE_ANNOTATIONS)
 73LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -G $(DISABLE_ANNOTATIONS) -R"$(RUNTIME_LINKER_PATH)" -L.
 74LINKER_LINK_SHARED_PROGRAM_OPTIONS = -R"$(RUNTIME_LINKER_PATH)"
 75else
 76LINKER_LINK_SHARED_LIBRARY_OPTIONS = -shared
 77LINKER_LINK_SHARED_DLOADABLE_OPTIONS = -shared -Wl,-R"$(RUNTIME_LINKER_PATH)" -Wl,-L.
 78LINKER_LINK_SHARED_PROGRAM_OPTIONS = -Wl,-R"$(RUNTIME_LINKER_PATH)"
 79endif
 80LIBRARIES = -lsocket -lnsl -lm -ldl -lrt
 81NEEDS_RELINKING = yes
 82USES_SONAME = yes
 83
 84# special files
 85
 86CHICKEN_CONFIG_H = chicken-config.h
 87
 88# select default and internal settings
 89
 90include $(SRCDIR)/defaults.make
 91
 92chicken-config.h: chicken-defaults.h
 93	echo "/* END OF FILE */" >$@.tmp
 94	echo "#define HAVE_DIRENT_H 1" >>$@.tmp
 95	echo "#define HAVE_DLFCN_H 1" >>$@.tmp
 96	echo "#define HAVE_INTTYPES_H 1" >>$@.tmp
 97	echo "#define HAVE_LIMITS_H 1" >>$@.tmp
 98	echo "#define HAVE_LONG_LONG 1" >>$@.tmp
 99	echo "#define HAVE_MEMMOVE 1" >>$@.tmp
100	echo "#define HAVE_MEMORY_H 1" >>$@.tmp
101	echo "#define HAVE_SIGACTION 1" >>$@.tmp
102	echo "#define HAVE_STDINT_H 1" >>$@.tmp
103	echo "#define HAVE_STDLIB_H 1" >>$@.tmp
104	echo "#define HAVE_STRERROR 1" >>$@.tmp
105	echo "#define HAVE_STRINGS_H 1" >>$@.tmp
106	echo "#define HAVE_STRING_H 1" >>$@.tmp
107	echo "#define HAVE_STRLCAT 1" >>$@.tmp
108	echo "#define HAVE_STRLCPY 1" >>$@.tmp
109	echo "#define HAVE_STRTOLL 1" >>$@.tmp
110	echo "#define HAVE_SYS_STAT_H 1" >>$@.tmp
111	echo "#define HAVE_SYS_TYPES_H 1" >>$@.tmp
112	echo "#define HAVE_SETENV 1" >>$@.tmp
113	echo "#define HAVE_UNISTD_H 1" >>$@.tmp
114	echo "#define HAVE_UNSIGNED_LONG_LONG 1" >>$@.tmp
115	echo "#define STDC_HEADERS 1" >>$@.tmp
116	echo "#define HAVE_ALLOCA_H 1" >>$@.tmp
117	echo "#define HAVE_ALLOCA 1" >>$@.tmp
118	echo "#define HAVE_ERRNO_H 1" >>$@.tmp
119	echo "#define HAVE_SYSEXITS_H 1" >>$@.tmp
120	echo "#define C_STACK_GROWS_DOWNWARD 1" >>$@.tmp
121ifdef GCHOOKS
122	echo "#define C_GC_HOOKS" >>$@.tmp
123endif
124	cat $@.tmp chicken-defaults.h >$@.tmp2
125	rm $@.tmp
126	mv $@.tmp2 $@
127
128include $(SRCDIR)/rules.make
Trap