Home | History | Annotate | Download | only in bash
      1 #
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the "License").
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets "[]" replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 # Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
     23 # Use is subject to license terms.
     24 #
     25 # ident	"@(#)Makefile.sfw	1.18	09/10/05 SMI"
     26 #
     27 
     28 VER =		$(COMPONENT_NAME:sh)-$(COMPONENT_VERSION:sh)
     29 TARBALL =	$(VER).tar.gz
     30 PWD:sh=pwd
     31 
     32 include ../Makefile.cmd
     33 
     34 # We must use the c99 driver because some c99 math functions are
     35 # only available with this driver, and not with cc -xc99=%all
     36 CC = $(SPRO_VROOT)/bin/c99
     37 
     38 CFLAGS_GENERIC = -Xc -features=extinl,extensions -xprefetch=auto 
     39 CFLAGS_GENERIC += -xbuiltin=%none -xnorunpath -xcsi -xinline=%auto 
     40 CFLAGS_GENERIC += -xustr=ascii_utf16_ushort -xF=%none -xthreadvar=%all 
     41 CFLAGS_GENERIC += -xspace -xldscope=symbolic -KPIC -mt -D_REENTRANT 
     42 CFLAGS_GENERIC += -D__EXTENSIONS__=1 -D_LARGEFILE_SOURCE 
     43 CFLAGS_GENERIC += -D_FILE_OFFSET_BITS=64 -D_XOPEN_SOURCE=600 -D_XPG6 
     44 CFLAGS_GENERIC += -D_POSIX_PTHREAD_SEMANTICS -D_POSIX_C_SOURCE=200112L 
     45 CFLAGS_GENERIC += -D__XOPEN_OR_POSIX -D_STRICT_STDC -D_STRICT_STDC__ 
     46 CFLAGS_GENERIC += -D_STDC_C99 -D_ISOC99_SOURCE -D__C99FEATURES__ -DSOLARIS
     47 
     48 CFLAGS_i386 = -m32 -xregs=no%frameptr -xarch=generic -xO3 -s
     49 CFLAGS_sparc = -m32 -xvis=yes -xmemalign=8i -xregs=appl 
     50 CFLAGS_sparc += -xtarget=ultra2 -xarch=sparcvis -xchip=ultra2 -xO4 -s
     51 CFLAGS = $(CFLAGS_GENERIC) $(CFLAGS_$(MACH))
     52 
     53 LDFLAGS = -lc -lm -lsocket -lresolv -lnsl -lgen 
     54 LDFLAGS += -z combreloc -z redlocsym -z ignore -z rescan -z absexec
     55 LDFLAGS += -KPIC
     56 
     57 LD_OPTIONS = -M $(SRC)/cmd/mapfile_noexstk
     58 LD_OPTIONS += -lsocket -lresolv -lnsl -lgen -z ignore
     59 
     60 # The bash test harness needs the GNU userland utilities
     61 GNU_PATH = /usr/gnu/bin
     62 
     63 # We need a temporary install directory to get all the *.mo
     64 # localization files.
     65 DESTDIR=$(SRC)/cmd/bash/proto-$(MACH)
     66 
     67 # We need to tell the install-sfw script where the bash system
     68 # scripts are.
     69 SCRIPTDIR=$(SRC)/cmd/bash/Solaris
     70 
     71 TARGET_ENV = CC=$(CC) CXX=$(CCC)
     72 TARGET_ENV += "CPPFLAGS=$(CPPFLAGS)"
     73 TARGET_ENV += "CFLAGS=$(CFLAGS)"
     74 TARGET_ENV += "LDFLAGS=$(LDFLAGS)"
     75 TARGET_ENV += "LD=$(CC) $(CFLAGS) $(LDFLAGS)"
     76 TARGET_ENV += "PATH=$(GNU_PATH):$(SFW_PATH)"
     77 TARGET_ENV += "MAKE=$(GMAKE)"
     78 TARGET_ENV += "INSTALL=$(GINSTALL)"
     79 
     80 TEST_OUTPUT = bash_test_results_$(MACH).out
     81 
     82 # For running the test harness we need to pick up some executables
     83 # which are built in $(top_srcdir).
     84 TEST_PATH = "PATH=$(SRC)/cmd/bash/$(VER):$(GNU_PATH):$(SFW_PATH)"
     85 
     86 all: $(VER)/config.status
     87 	( cd $(VER); env - \
     88 	    LD_OPTIONS="$(LD_OPTIONS)" $(GMAKE) )
     89 
     90 test: all
     91 	( cd $(VER) ; \
     92 	    env - $(TARGET_ENV) $(TEST_PATH) $(GMAKE) check > \
     93 	    $(TEST_OUTPUT) 2>&1 )
     94 
     95 install: all
     96 	mkdir -p $(DESTDIR)
     97 	( cd $(VER) ; env "DESTDIR=$(DESTDIR)" \
     98 	    $(GMAKE) DESTDIR=$(DESTDIR) \
     99 	    INSTALL=$(GINSTALL) install )
    100 	INSTDIR=$(DESTDIR) SCRIPTDIR=$(SCRIPTDIR) $(SH) ./install-sfw
    101 
    102 $(VER)/configure: $(VER)/$(SFW_STAMP_UNPACKED)
    103 
    104 $(VER)/apply_patches.sh: $(PWD)/Solaris/apply_patches.sh $(VER)/configure
    105 	( cd $(VER) ; \
    106 	    cp -fp ../Solaris/apply_patches.sh . ; \
    107 	    chmod 0755 ./apply_patches.sh ; \
    108 	    $(SH) ./apply_patches.sh )
    109 
    110 $(VER)/config.status: $(VER)/apply_patches.sh
    111 	(cd $(VER); env - $(TARGET_ENV) \
    112 	    ./configure --prefix=$(CFGPREFIX) \
    113 	    --localstatedir=/var \
    114 	    --enable-alias \
    115 	    --enable-arith-for-command \
    116 	    --enable-array-variables \
    117 	    --enable-bang-history \
    118 	    --enable-brace-expansion \
    119 	    --enable-casemod-attributes \
    120 	    --enable-casemod-expansions \
    121 	    --enable-command-timing \
    122 	    --enable-cond-command \
    123 	    --enable-cond-regexp \
    124 	    --enable-coprocesses \
    125 	    --enable-debugger \
    126 	    --enable-directory-stack \
    127 	    --enable-disabled-builtins \
    128 	    --enable-dparen-arithmetic \
    129 	    --enable-extended-glob \
    130 	    --enable-help-builtin \
    131 	    --enable-history \
    132 	    --enable-job-control \
    133 	    --enable-multibyte \
    134 	    --enable-net-redirections \
    135 	    --enable-process-substitution \
    136 	    --enable-progcomp \
    137 	    --enable-prompt-string-decoding \
    138 	    --enable-readline \
    139 	    --enable-restricted \
    140 	    --enable-select \
    141 	    --enable-separate-helpfiles \
    142 	    --enable-single-help-strings \
    143 	    --disable-strict-posix-default \
    144 	    --enable-usg-echo-default \
    145 	    --enable-xpg-echo-default \
    146 	    --enable-mem-scramble \
    147 	    --disable-profiling \
    148 	    --enable-static-link \
    149 	    --enable-largefile \
    150 	    --enable-nls \
    151 	    --with-bash-malloc \
    152 	    --with-curses \
    153 	    --with-installed-readline=no )
    154 
    155 clean:
    156 	-rm -rf $(VER) $(DESTDIR)
    157 
    158 include ../Makefile.targ
    159 
    160