Print this page
3900 illumos will not build against gcc compiled perl

Split Close
Expand all
Collapse all
          --- old/usr/src/cmd/perl/skel/Makefile
          +++ new/usr/src/cmd/perl/skel/Makefile
↓ open down ↓ 12 lines elided ↑ open up ↑
  13   13  # When distributing Covered Code, include this CDDL HEADER in each
  14   14  # file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15  # If applicable, add the following below this CDDL HEADER, with the
  16   16  # fields enclosed by brackets "[]" replaced with your own identifying
  17   17  # information: Portions Copyright [yyyy] [name of copyright owner]
  18   18  #
  19   19  # CDDL HEADER END
  20   20  #
  21   21  #
  22   22  # Copyright (c) 2010, Oracle and/or its affiliates. All rights reserved.
       23 +# Copyright (c) 2013 Racktop Systems.
  23   24  #
  24   25  
  25   26  include ../../Makefile.cmd
  26   27  
  27   28  # To turn KEEP_STATE off the following two environment variables must be unset.
  28   29  KEEP_STATE_OFF = unset KEEP_STATE SUNPRO_DEPENDENCIES
  29   30  
  30   31  # Perl installs files we don't want to ship, so we install to a
  31   32  # staging area to postprocess and install the result to $(ROOT)
  32   33  STAGE = $(SRC)/cmd/perl/$(PERL_VERSION)/staging
  33   34  
  34   35  PERL=/usr/perl5/$(PERL_VERSION)/bin/perl
  35   36  
  36      -PERL_MM_ARGS = INSTALLDIRS=perl CC='$(CC)' LD='$(CC)'
       37 +PERL_MM_ARGS = CC='$(CC)' LD='$(CC)'
  37   38  
  38   39  # Prefix for Solaris-specific extensions that are maintained by
  39   40  # Sun/Oracle.
  40   41  SUN_SOLARIS = Sun/Solaris
  41   42  
       43 +# When building with gcc we don't bother with cw.  Intead we use PerlGcc to
       44 +# make sure the Makefile contains options that the compiler will understand.
       45 +# The version on the host could be incomplete so use the one we're building.
       46 +PERL5LIB =
       47 +$(__GNUC)PERL5LIB= \
       48 +    $(SRC)/cmd/perl/$(PERL_VERSION)/$(SUN_SOLARIS)/PerlGcc
       49 +
       50 +$(__GNUC)PERL_MM_ARGS = \
       51 +    CC='$(GCC_ROOT)/bin/gcc' \
       52 +    LD='$(GCC_ROOT)/bin/gcc'
       53 +
       54 +PERL_MM_ARGS += INSTALLDIRS=perl
       55 +
  42   56  # Add any XS extensions here.
  43   57  PERL_DYNAMIC_EXT = \
  44   58      $(SUN_SOLARIS)/Utils \
  45   59      $(SUN_SOLARIS)/Kstat \
  46   60      $(SUN_SOLARIS)/Intrs \
  47   61      $(SUN_SOLARIS)/Project \
  48   62      $(SUN_SOLARIS)/Task \
  49   63      $(SUN_SOLARIS)/Exacct \
  50   64      $(SUN_SOLARIS)/Privilege \
  51   65      $(SUN_SOLARIS)/Lgrp \
↓ open down ↓ 1 lines elided ↑ open up ↑
  53   67  
  54   68  # Add any pure-perl extensions here.
  55   69  PERL_NONXS_EXT = \
  56   70      $(SUN_SOLARIS)/BSM \
  57   71      $(SUN_SOLARIS)/PerlGcc \
  58   72      $(SUN_SOLARIS)/Pg
  59   73  
  60   74  PERL_EXT = $(PERL_DYNAMIC_EXT) $(PERL_NONXS_EXT)
  61   75  PERL_EXT_MAKEFILES = $(PERL_EXT:%=%/Makefile)
  62   76  
       77 +# When doing a gcc build we need to build PerGcc before the dynamic extenions.
       78 +$(__GNUC)$(PERL_DYNAMIC_EXT:%=%/Makefile): $(SUN_SOLARIS)/PerlGcc/Makefile
       79 +
  63   80  all: copy_contrib $(PERL_EXT_MAKEFILES) $(PERL_EXT)
  64   81  
  65   82  .PARALLEL: $(PERL_EXT_MAKEFILES) $(PERL_EXT)
  66   83  
  67   84  install: all
  68   85          for ext in $(PERL_EXT); do \
  69   86                  if [ -d $$ext ]; then \
  70   87                          ( \
  71   88                          cd $$ext; pwd; \
  72   89                          $(KEEP_STATE_OFF); $(MAKE) $(PERL_MM_ARGS) \
↓ open down ↓ 34 lines elided ↑ open up ↑
 107  124                  cd $$ext; pwd; \
 108  125                  $(KEEP_STATE_OFF); $(MAKE) test; \
 109  126                  ) \
 110  127          done
 111  128  
 112  129  #
 113  130  # Ensure that the extension's makefile is built before
 114  131  # trying to build the extension
 115  132  #
 116  133  %/Makefile: %/Makefile.PL $(PERL_CONFIGDEP)
 117      -        @ cd $(@D); pwd; $(PERL) $(<F) $(PERL_MM_ARGS) 2>&1 /dev/null
      134 +        @ cd $(@D); pwd; PERL5LIB=$(PERL5LIB) \
      135 +                $(PERL) $(<F) $(PERL_MM_ARGS) 2>&1 /dev/null
 118  136  
 119  137  # Pattern-matching rule for extensions.
 120  138  $(SUN_SOLARIS)/%: $(SUN_SOLARIS)/%/Makefile FRC
 121  139          @ cd $@; pwd; $(KEEP_STATE_OFF) ; \
 122  140                  $(PERL_MM_ARGS) $(MAKE) DESTDIR=$(STAGE) all
 123  141  
 124  142  FRC:
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX