Print this page
    
NEX-5200 native tools must reliably use a native adjunct
Reviewed by: Hans Rosenfeld <hans.rosenfeld@nexenta.com>
Reviewed by: Josef 'Jeff' Sipek <josef.sipek@nexenta.com>
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/cmd/svc/svccfg/Makefile
          +++ new/usr/src/cmd/svc/svccfg/Makefile
   1    1  #
   2    2  # CDDL HEADER START
   3    3  #
   4    4  # The contents of this file are subject to the terms of the
   5    5  # Common Development and Distribution License (the "License").
   6    6  # You may not use this file except in compliance with the License.
   7    7  #
   8    8  # You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9  # or http://www.opensolaris.org/os/licensing.
  10   10  # See the License for the specific language governing permissions
  11   11  # and limitations under the License.
  12   12  #
  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  #
  23   23  # Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
  24   24  # Copyright 2017 Joyent, Inc.
  25   25  #
  26   26  
  27   27  MYPROG =        svccfg
  28   28  PROG =          $(MYPROG)
  29   29  
  30   30  SRCS  =         svccfg_main.c \
  31   31                  svccfg_engine.c \
  32   32                  svccfg_internal.c \
  33   33                  svccfg_libscf.c \
  34   34                  svccfg_tmpl.c \
  35   35                  svccfg_xml.c \
  36   36                  svccfg_help.c
  37   37  
  38   38  LNTS =          $(SRCS:%.c=%.ln) \
  39   39                  manifest_find.ln \
  40   40                  manifest_hash.ln
  41   41  
  42   42  MYOBJS =        $(SRCS:%.c=%.o) \
  43   43                  svccfg_grammar.o \
  44   44                  svccfg_lex.o \
  45   45                  manifest_find.o \
  46   46                  manifest_hash.o \
  47   47                  notify_params.o
  48   48  OBJS =          $(MYOBJS)
  49   49  
  50   50  POFILES =       $(SRCS:%.c=%.po) \
  51   51                  svccfg_grammar.po \
  52   52                  svccfg_lex.po \
  53   53                  ../common/manifest_find.po \
  54   54                  ../common/manifest_hash.po
  55   55  
  56   56  include ../../Makefile.cmd
  57   57  include ../../Makefile.ctf
  58   58  
  59   59  POFILE =        $(PROG)_all.po
  60   60  
  61   61  NATIVE_BUILD=$(POUND_SIGN)
  62   62  $(NATIVE_BUILD)NOT_NATIVE=$(POUND_SIGN)
  63   63  
  
    | 
      ↓ open down ↓ | 
    63 lines elided | 
    
      ↑ open up ↑ | 
  
  64   64  $(NATIVE_BUILD)PROG = $(MYPROG:%=%-native)
  65   65  $(NATIVE_BUILD)OBJS = $(MYOBJS:%.o=%-native.o)
  66   66  
  67   67  # svccfg has a name clash with main() and libl.so.1.  However, svccfg must
  68   68  # still export a number of "yy*" (libl) interfaces.  Reduce all other symbols
  69   69  # to local scope.
  70   70  MAPFILES +=     $(MAPFILE.LEX) $(MAPFILE.NGB)
  71   71  MAPOPTS =       $(MAPFILES:%=-M%)
  72   72  
  73   73  MYCPPFLAGS =    -I ../common -I$(ADJUNCT_PROTO)/usr/include/libxml2
       74 +$(NATIVE_BUILD)MYCPPFLAGS =     -I ../common \
       75 +                -I$(NATIVE_ADJUNCT)/usr/include/libxml2
  74   76  CPPFLAGS +=     $(MYCPPFLAGS)
  75   77  LDFLAGS +=      $(MAPOPTS)
  76   78  
  77   79  CERRWARN +=     -_gcc=-Wno-unused-label
  78   80  CERRWARN +=     -_gcc=-Wno-implicit-function-declaration
  79   81  CERRWARN +=     -_gcc=-Wno-switch
  80   82  CERRWARN +=     -_gcc=-Wno-uninitialized
  81   83  CERRWARN +=     -_gcc=-Wno-unused-variable
  82   84  CERRWARN +=     -_gcc=-Wno-parentheses
  83   85  
  84   86  LFLAGS = -t
  85   87  YFLAGS = -d
  86   88  
  87   89  CLOBBERFILES += svccfg_lex.c svccfg_grammar.c svccfg_grammar.h \
  88   90      $(MYPROG:%=%-native)
  89   91  
  90   92  SVCCFG_EXTRA_LIBS = -lxml2 -lscf -ll -luutil -lumem -lmd5 -lnvpair
  91   93  $(NOT_NATIVE)SVCCFG_EXTRA_LIBS += -ltecla
  92   94  
  93   95  LIBSCF          = $(SRC)/lib/libscf
  94   96  LIBTECLA        = $(SRC)/lib/libtecla           # just for the header
  95   97  LIBUUTIL        = $(SRC)/lib/libuutil
  96   98  
  97   99  debug := COPTFLAG = -g
  98  100  
  99  101  lint := LINTFLAGS = -mux
 100  102  lint := SVCCFG_EXTRA_LIBS = -lscf -ll -luutil -lumem -lmd5 -lnvpair
 101  103  
 102  104  LDLIBS += $(SVCCFG_EXTRA_LIBS)
 103  105  
 104  106  $(NATIVE_BUILD)CC =     $(NATIVECC)
 105  107  $(NATIVE_BUILD)LD =     $(NATIVELD)
 106  108  $(NATIVE_BUILD)CFLAGS = $(NATIVE_CFLAGS)
  
    | 
      ↓ open down ↓ | 
    23 lines elided | 
    
      ↑ open up ↑ | 
  
 107  109  $(NATIVE_BUILD)CPPFLAGS = \
 108  110          -DNATIVE_BUILD \
 109  111          $(MYCPPFLAGS) \
 110  112          -I$(LIBSCF)/inc \
 111  113          -I$(LIBTECLA) \
 112  114          -I$(LIBUUTIL)/common
 113  115  $(NATIVE_BUILD)LDFLAGS =
 114  116  $(NATIVE_BUILD)LDLIBS = \
 115  117          -L$(LIBUUTIL)/native -R $(LIBUUTIL)/native \
 116  118          -L$(LIBSCF)/native -R $(LIBSCF)/native \
 117      -        -L$(ADJUNCT_PROTO)/usr/lib -R$(ADJUNCT_PROTO)/usr/lib \
      119 +        -L$(NATIVE_ADJUNCT)/usr/lib -R$(NATIVE_ADJUNCT)/usr/lib \
 118  120          $(SVCCFG_EXTRA_LIBS)
 119  121  
 120  122  svccfg_lex.o svccfg_grammar.o := CCVERBOSE =
 121  123  
 122  124  svccfg_help.po := XGETFLAGS =   -a
 123  125  
 124  126  .KEEP_STATE:
 125  127  .PARALLEL: $(OBJS) $(LNTS)
 126  128  
 127  129  all debug: $(PROG)
 128  130  
 129  131  native: FRC
 130  132          @cd $(LIBUUTIL)/native; pwd; $(MAKE) $(MFLAGS) install
 131  133          @cd $(LIBSCF)/native; pwd; $(MAKE) $(MFLAGS) install
 132  134          @NATIVE_BUILD= $(MAKE) $(MFLAGS) all
 133  135  
 134  136  $(PROG): $(OBJS) $(MAPFILES)
 135  137          $(LINK.c) -o $@ $(OBJS) $(LDLIBS)
 136  138          $(POST_PROCESS)
 137  139  
 138  140  $(POFILES): svccfg_grammar.h
 139  141  
 140  142  $(POFILE): $(POFILES)
 141  143          cat $(POFILES) > $(POFILE)
 142  144  
 143  145  install: all $(ROOTUSRSBINPROG)
 144  146  
 145  147  svccfg_lex.c: svccfg.l svccfg_grammar.h
 146  148          $(LEX) $(LFLAGS) svccfg.l > $@
 147  149  
 148  150  svccfg_help.o: svccfg_grammar.h
 149  151  svccfg_help-native.o: svccfg_grammar.h
 150  152  
 151  153  svccfg_grammar.h svccfg_grammar.c: svccfg.y
 152  154          $(YACC) $(YFLAGS) svccfg.y
 153  155          @$(MV) y.tab.h svccfg_grammar.h
 154  156          @$(MV) y.tab.c svccfg_grammar.c
 155  157  
 156  158  clean: FRC
 157  159          $(RM) $(MYOBJS) $(MYOBJS:%.o=%-native.o) $(LNTS)
 158  160  
 159  161  lint: $(LNTS)
 160  162          $(LINT.c) $(LINTFLAGS) $(LNTS) $(LDLIBS)
 161  163  
 162  164  %-native.o: %.c
 163  165          $(COMPILE.c) -o $@ $<
 164  166          $(POST_PROCESS_O)
 165  167  
 166  168  %-native.o: ../common/%.c
 167  169          $(COMPILE.c) -o $@ $<
 168  170          $(POST_PROCESS_O)
 169  171  
 170  172  %.o: ../common/%.c
 171  173          $(COMPILE.c) $(OUTPUT_OPTION) $<
 172  174          $(POST_PROCESS_O)
 173  175  
 174  176  %.ln: ../common/%.c
 175  177          $(LINT.c) $(OUTPUT_OPTION) -c $<
 176  178  
 177  179  include ../../Makefile.targ
 178  180  
 179  181  FRC:
  
    | 
      ↓ open down ↓ | 
    52 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX