GAR
Advanced Topics
 OpenCSW Technical Summercamp
          Oslo 2009


      Dagobert Michelsen
       dam@opencsw.org
Topic:


Modulations
„A Modulation is the process of varying
  one waveform in relation to another
             waveform“
„A Modulation is the process of varying
      one waveform in relation to another
                 waveform“



            For soft ware builds that means:

„A Modulation is the process of varying a build in
       relation to certain parameters“
Phases
Phases
Prerequisites
Phases
Prerequisites
Fetch
Phases
Prerequisites
Fetch
Checksum
Phases
Prerequisites
Fetch
Checksum
Extract
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Build
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Build
Test
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Build
Test
Install
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Build
Test
Install
Merge
Phases
Prerequisites
Fetch
Checksum
Extract
Patch
Configure
Build
Test
Install
Merge
Package
Phases
Prerequisites               Executed
Fetch
                             globally
Checksum
Extract
Patch
Configure             Executed inside
Build
Test                    modulation
Install
Merge
Package             Executed globally
Phases
Prerequisites               Executed
Fetch
                             globally
Checksum
Extract
Patch
Configure             Executed inside
Build
Test                    modulation
Install
Merge
Package             Executed globally
Phases
Prerequisites                    Executed
                       One
Fetch               modulation
                                  globally
Checksum
Extract
Patch
Configure                Executed inside
Build
Test                       modulation
Install
Merge
Package              Executed globally
Modulations
  and pre-/post-phases
When is pre-build called?
  Technically ran before first build,
  but after every configure
Problem: each phase should be runnable
independently
Often sufficient: To be run per modulation
    pre-build-modulated
pre-/post-<phase> is likely to be replaced
with pre-/post-<phase>-modulated
Modulations
  and pre-/post-phases
When is pre-build called?
  Technically ran before first build,
  but after every configure
Problem: each phase should be runnable
independently
Often sufficient: To be run per modulation
    pre-build-modulated
pre-/post-<phase> is likely to be replaced
with pre-/post-<phase>-modulated
Modulations
  and pre-/post-phases
When is pre-build called?
  Technically ran before first build,
  but after every configure Synchronisation
                                  needed
Problem: each phase should be runnable
independently
Often sufficient: To be run per modulation
    pre-build-modulated
pre-/post-<phase> is likely to be replaced
with pre-/post-<phase>-modulated
Modulations
  and pre-/post-phases
When is pre-build called?
  Technically ran before first build,
  but after every configure
Problem: each phase should be runnable
independently
Often sufficient: To be run per modulation
    pre-build-modulated
pre-/post-<phase> is likely to be replaced
with pre-/post-<phase>-modulated
What can be used
     as modulator?
ISA for build architecture
For 32/64 bit versions and optimized binaries.
See lame

Package version
Useful when multiple versions of a library should be included
See automake

...anything that controls the build
   Static vs. dynamic linked versions
   See wget

   Parameter size
   See nrpe

   Wide vs. narrow characters
   See ncurses
Modulation
                over ISA
Allows easy building of multiple ISAs
Built-in special case of modulation
  No merge needed also


Simplest case
build64 = 1


Advanced
EXTRA_BUILD_ISAS = sparcv8plus+vis pentium_pro
Verify modulations
                 over ISA
build8s% gmake modenv
          Arch: sparc
        Kernel: sparcv9

Default ISA 32: sparcv8
Default ISA 64: sparcv9

Requested ISAs: sparcv8 sparcv9 i386 amd64 sparcv8plus+vis pentium_pro
   Needed ISAs: sparcv8 sparcv9 sparcv8plus+vis
    Build ISAs: sparcv8 sparcv9 sparcv8plus+vis

  ISAEXEC dirs: /opt/csw/bin /opt/csw/sbin /opt/csw/libexec
 ISAEXEC files: /opt/csw/bin/lame

 Merge include:
 Merge exclude:     /opt/csw/share/info/dir /opt/csw/lib/.*.la .*~ /opt/csw/lib/.*.a

    Modulators: ISA
   Modulations: isa-sparcv8 isa-sparcv9 isa-sparcv8plus+vis

Requested compiler flags:

* Modulation isa-sparcv8: ISA=sparcv8
           PATH = /home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/bin:/home/dam/mgar/pkg/lame/
trunk/work/install-isa-sparcv8/opt/csw/bin:/home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/sbin:/
home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/sbin:/opt/csw/bin:/opt/csw/bin:/opt/csw/sbin:/opt/
csw/sbin:/opt/studio/SOS11/SUNWspro/bin:/home/dam/mgar/pkg/lame/trunk/gar/bin:/usr/bin:/usr/sbin:/usr/java/bin:/
usr/ccs/bin:/usr/openwin/bin
PKG_CONFIG_PATH = /opt/csw/lib/pkgconfig
         CFLAGS = -xO3 -xarch=v8 -I/opt/csw/include
       CXXFLAGS = -xO3 -xarch=v8 -I/opt/csw/include
       CPPFLAGS = -I/opt/csw/include
        LDFLAGS = -xarch=v8 -L/opt/csw/lib
     LD_OPTIONS = -R/opt/csw/lib/$ISALIST -R/opt/csw/lib
        ASFLAGS =
Modulation
 over ISA requirements
Certain ISAs require specific platforms
x64 requires Solaris 10, but integrated package for Solaris 8-10


Parallelizing modulation builds
may require builds on multiple hosts (work-in-progress)


Build platform for each modulation
must be specified in the package
manifest (work-in-progress)
How does ISAEXEC relate to multi-ISA?
Modulation
                      over version
GARNAME = automake
GARVERSION = 1.11
...
EXTRA_MODULATORS = GARVERSION
MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11
...
SOURCEFILES =   $(foreach VERSION,$(MODULATIONS_GARVERSION),
                    $(GARNAME)-$(VERSION).tar.gz
                  )
DISTFILES = $(SOURCEFILES)
...
NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES))
...
$(foreach VERSION,$(MODULATIONS_GARVERSION),
  $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all)
)
Modulation
                      over version
GARNAME = automake                   Adds modulator with
GARVERSION = 1.11                         this name
...
EXTRA_MODULATORS = GARVERSION
MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11
...
SOURCEFILES =   $(foreach VERSION,$(MODULATIONS_GARVERSION),
                    $(GARNAME)-$(VERSION).tar.gz
                  )
DISTFILES = $(SOURCEFILES)
...
NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES))
...
$(foreach VERSION,$(MODULATIONS_GARVERSION),
  $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all)
)
Modulation
                       over version
GARNAME = automake                   Adds modulator with
GARVERSION = 1.11                         this name
...
EXTRA_MODULATORS = GARVERSION                                     One file per
MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11   modulated version
...
SOURCEFILES =   $(foreach VERSION,$(MODULATIONS_GARVERSION),
                    $(GARNAME)-$(VERSION).tar.gz
                  )
DISTFILES = $(SOURCEFILES)
...
NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES))
...
$(foreach VERSION,$(MODULATIONS_GARVERSION),
  $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all)
)
Modulation
                         over version
GARNAME = automake                   Adds modulator with
GARVERSION = 1.11                         this name
...
EXTRA_MODULATORS = GARVERSION                                     One file per
MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11   modulated version
...
SOURCEFILES =   $(foreach VERSION,$(MODULATIONS_GARVERSION),
                    $(GARNAME)-$(VERSION).tar.gz
                  )                                                              Make sure only the needed file is
DISTFILES = $(SOURCEFILES)                                                        extracted in each modulation
...
NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES))
...
$(foreach VERSION,$(MODULATIONS_GARVERSION),
  $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all)
)
Modulation
                         over version
GARNAME = automake                   Adds modulator with
GARVERSION = 1.11                         this name
...
EXTRA_MODULATORS = GARVERSION                                     One file per
MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11   modulated version
...
SOURCEFILES =   $(foreach VERSION,$(MODULATIONS_GARVERSION),
                    $(GARNAME)-$(VERSION).tar.gz
                  )                                                              Make sure only the needed file is
DISTFILES = $(SOURCEFILES)                                                        extracted in each modulation
...
NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES))
...
$(foreach VERSION,$(MODULATIONS_GARVERSION),
  $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all)
)


       Merge-rules needed!
      We‘ll see about this later
Modulation
over static/dynamic linking
 GARNAME = wget
 ...
 EXTRA_MODULATORS = STATIC
 MODULATIONS_STATIC = disable enable

 EXTRA_CONFIGURE_STATIC-disable = --with-ssl
 EXTRA_CONFIGURE_STATIC-enable = --disable-shared
 EXTRA_CONFIGURE_STATIC-enable += --enable-static
 EXTRA_CONFIGURE_STATIC-enable += --without-ssl
 ...
 CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))

 MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
  MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only
     MERGE_DIRS_isa-sparcv8-static-enable = $(bindir)

     MERGE_SCRIPTS_isa-i386-static-disable = copy-all
      MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only
         MERGE_DIRS_isa-i386-static-enable = $(bindir)

 merge-rename-wget:
         @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static
 ...
 include gar/category.mk
Modulation
over static/dynamic linking
                                 Adds modulator with
 GARNAME = wget                       this name
 ...
 EXTRA_MODULATORS = STATIC
 MODULATIONS_STATIC = disable enable

 EXTRA_CONFIGURE_STATIC-disable = --with-ssl
 EXTRA_CONFIGURE_STATIC-enable = --disable-shared
 EXTRA_CONFIGURE_STATIC-enable += --enable-static
 EXTRA_CONFIGURE_STATIC-enable += --without-ssl
 ...
 CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))

 MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
  MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only
     MERGE_DIRS_isa-sparcv8-static-enable = $(bindir)

     MERGE_SCRIPTS_isa-i386-static-disable = copy-all
      MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only
         MERGE_DIRS_isa-i386-static-enable = $(bindir)

 merge-rename-wget:
         @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static
 ...
 include gar/category.mk
Modulation
over static/dynamic linking
                                 Adds modulator with
 GARNAME = wget                       this name
 ...                                                                     Cool trick:
 EXTRA_MODULATORS = STATIC                                   Use dynamically expanded variables
                                                                   to set per-modulation
 MODULATIONS_STATIC = disable enable

 EXTRA_CONFIGURE_STATIC-disable = --with-ssl
 EXTRA_CONFIGURE_STATIC-enable = --disable-shared
 EXTRA_CONFIGURE_STATIC-enable += --enable-static
 EXTRA_CONFIGURE_STATIC-enable += --without-ssl
 ...
 CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))

 MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
  MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only
     MERGE_DIRS_isa-sparcv8-static-enable = $(bindir)

     MERGE_SCRIPTS_isa-i386-static-disable = copy-all
      MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only
         MERGE_DIRS_isa-i386-static-enable = $(bindir)

 merge-rename-wget:
         @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static
 ...
 include gar/category.mk
Modulation
over static/dynamic linking
                                 Adds modulator with
 GARNAME = wget                       this name
 ...                                                                           Cool trick:
 EXTRA_MODULATORS = STATIC                                         Use dynamically expanded variables
                                                                         to set per-modulation
 MODULATIONS_STATIC = disable enable

 EXTRA_CONFIGURE_STATIC-disable = --with-ssl
 EXTRA_CONFIGURE_STATIC-enable = --disable-shared
 EXTRA_CONFIGURE_STATIC-enable += --enable-static
 EXTRA_CONFIGURE_STATIC-enable += --without-ssl
 ...
 CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))

 MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
  MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only
     MERGE_DIRS_isa-sparcv8-static-enable = $(bindir)

     MERGE_SCRIPTS_isa-i386-static-disable = copy-all
                                                        Why is this a bad idea?
      MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only
         MERGE_DIRS_isa-i386-static-enable = $(bindir) Think gmake remerge
 merge-rename-wget:
         @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static
 ...
 include gar/category.mk
Modulation
over static/dynamic linking
Modulation
over static/dynamic linking
Modulation
over static/dynamic linking
 GARNAME = wget
 ...
 EXTRA_MODULATORS = STATIC
 MODULATIONS_STATIC = disable enable

 EXTRA_CONFIGURE_STATIC-disable = --with-ssl
 EXTRA_CONFIGURE_STATIC-enable = --disable-shared
 EXTRA_CONFIGURE_STATIC-enable += --enable-static
 EXTRA_CONFIGURE_STATIC-enable += --without-ssl
 ...
 CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC))
 ...
 MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all
  MERGE_SCRIPTS_isa-sparcv8-static-enable = copy-static-wget-only

    MERGE_SCRIPTS_isa-i386-static-disable = copy-all
     MERGE_SCRIPTS_isa-i386-static-enable = copy-static-wget-only from one phase
                                                          Always copy
                                                                  to another
 merge-copy-static-wget-only:
         ginstall $(INSTALLISADIR)$(bindir)/wget $(PKGROOT)$(bindir)/wget.static
            ...
 include gar/category.mk
Modulation
        over parameter size
GARNAME = nrpe
...
EXTRA_MODULATORS = SIZE
MODULATIONS_SIZE = 1k 8k
...
PATCHFILES_isa-sparcv8-size-8k = common.h.diff
PATCHFILES_isa-i386-size-8k = common.h.diff
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Modulation
         over parameter size
                            Ok, I guess you understood
GARNAME = nrpe                    how this works
...
EXTRA_MODULATORS = SIZE
MODULATIONS_SIZE = 1k 8k
...
PATCHFILES_isa-sparcv8-size-8k = common.h.diff
PATCHFILES_isa-i386-size-8k = common.h.diff
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Modulation
         over parameter size
                            Ok, I guess you understood
GARNAME = nrpe                    how this works
...
EXTRA_MODULATORS = SIZE                                   Use patchfiles on a
MODULATIONS_SIZE = 1k 8k                                 per-modulation basis
...
PATCHFILES_isa-sparcv8-size-8k = common.h.diff
PATCHFILES_isa-i386-size-8k = common.h.diff
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Modulations
      and their names
The name of a modulation is
    <modulator1>-<value1>-<modulator2>-<value2>-...

Call each phase from a modulation manually with
    <phase>-<modulation>

Example:
    gmake build-isa-sparcv8

This results in a sub-make-invocation
    <phase>-modulated   MODULATION=<MODULATION>
                        <MODULATOR1>=<value1> ...
Example:
    gmake build-modulated MODULATION=isa-sparcv8
                          ISA=sparcv8
Topic:


Merging
Merging
                    Why is this needed?
                Libraries may be located elsewhere in the package
                than they were configured
                32 and 64 bit need different install locations to
                have sane pkgconfig-files
build-isa-sparcv8/opt/csw/bin/myapp
build-isa-sparcv9/opt/csw/bin/64/myapp



                    pkgroot/opt/csw/bin/myapp
          Install
                    pkgroot/opt/csw/bin/sparcv9/myapp



                                     /opt/csw/bin/myapp -> isaexec
                         Package     /opt/csw/bin/sparcv8/myapp
                                     /opt/csw/bin/sparcv9/myapp
Merging
                default rules
copy-all
Copy all files and put them in standard locations (e. g. /csw/bin)

copy-only
Copy only the files to be relocated and also put them in standard locations

copy-relocate
Copy all files and relocate the locations to the ISA-subdirs
(e. g. /csw/bin/sparcv9/)

copy-relocated-only
Copy only the files to be relocated and also relocate the locations to the ISA-
subdirs
Merging
                          default rules
          copy-all
          Copy all files and put them in standard locations (e. g. /csw/bin)
                                    Copy all                 Copy only relocated
          copy-only
          Copy only the files to be relocated and also put them in standard locations

         copy-relocate
Do   not Copy all files and relocate the locations to the ISA-subdirs
          relocate              copy-all                       copy-only
         (e. g. /csw/bin/sparcv9/)

         copy-relocated-only
         Copy only the files to be relocated and also relocate the locations to the ISA-
 Do    relocate
         subdirs
                               copy-relocate                   copy-relocated-only
Merging
            and renaming
Rename files on-the-fly during merge
See curl

EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-32.h,p"
EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-64.h,p"
EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64)
EXTRA_PAX_ARGS_isa-i386    = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-amd64   = $(EXTRA_PAX_ARGS_64)
Merging
            and renaming
Rename files on-the-fly during merge
See curl                                                    From here


EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-32.h,p"
EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-64.h,p"
EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64)
EXTRA_PAX_ARGS_isa-i386    = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-amd64   = $(EXTRA_PAX_ARGS_64)
Merging
            and renaming
Rename files on-the-fly during merge
See curl                                                    From here

                                                                    To here
EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-32.h,p"
EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-64.h,p"
EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64)
EXTRA_PAX_ARGS_isa-i386    = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-amd64   = $(EXTRA_PAX_ARGS_64)
Merging
            and renaming
Rename files on-the-fly during merge
See curl

EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                           .$(includedir)/curl/curlbuild-32.h,p"
                             This is the modulation where the
EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$,
                               PAX args should be applied
                           .$(includedir)/curl/curlbuild-64.h,p"
EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64)
EXTRA_PAX_ARGS_isa-i386    = $(EXTRA_PAX_ARGS_32)
EXTRA_PAX_ARGS_isa-amd64   = $(EXTRA_PAX_ARGS_64)
Merging
      with custom rules
  Only merge specific files
  See nrpe
GARNAME = nrpe
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Merging
      with custom rules
  Only merge specific files
  See nrpe
                                                       This is the default build
GARNAME = nrpe                                       Just copy everything over
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Merging
      with custom rules
  Only merge specific files
  See nrpe
                                                       This is the default build
GARNAME = nrpe                                       Just copy everything over
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only   We want to control exactly what is used
                                                        from the additional modulation
MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only

include gar/category.mk
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Merging
      with custom rules
  Only merge specific files
  See nrpe
GARNAME = nrpe
...
MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all
MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only

MERGE_SCRIPTS_isa-i386-size-1k = copy-all
MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only
                                              Merging copies from the install
include gar/category.mk                          location to PKGROOT
...
merge-copy-nrpe-only:
        cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k
        cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k
        @$(MAKECOOKIE)
Questions?
Bueller? Anybody?

More Related Content

PDF
Play ja kansai
PDF
Security on JIT
PDF
Xen server 6.0 xe command reference (1.1)
PDF
23769377 lab-bgp-juniper
KEY
JavaOne 2012 Groovy update
PDF
Groovy update at SpringOne2GX 2012
KEY
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
PDF
Groovy 1.8 et 2.0 au BreizhC@mp 2012
Play ja kansai
Security on JIT
Xen server 6.0 xe command reference (1.1)
23769377 lab-bgp-juniper
JavaOne 2012 Groovy update
Groovy update at SpringOne2GX 2012
Groovy Update, new in 1.8 and beyond - Guillaume Laforge - Devoxx 2011
Groovy 1.8 et 2.0 au BreizhC@mp 2012

What's hot (14)

PDF
Groovy 2.0 update at Devoxx 2012
PPT
Lecture 20 presentation
PDF
Groovy 1.8 and 2.0 at GR8Conf Europe 2012
PDF
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
PDF
Ten common mistakes made in Function Java
PDF
Ten common mistakes made in Function Java - iSense Java Summit
PDF
PDF
Vmware management-with-vcli-5.0
PDF
Oracle11g On Fedora14
TXT
Centos config
PDF
ARM Trusted FirmwareのBL31を単体で使う!
PPTX
Ansible - simple it automation
PDF
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
PDF
Riak Operations
Groovy 2.0 update at Devoxx 2012
Lecture 20 presentation
Groovy 1.8 and 2.0 at GR8Conf Europe 2012
Groovy 2.0 update - Cloud Foundry Open Tour Moscow - Guillaume Laforge
Ten common mistakes made in Function Java
Ten common mistakes made in Function Java - iSense Java Summit
Vmware management-with-vcli-5.0
Oracle11g On Fedora14
Centos config
ARM Trusted FirmwareのBL31を単体で使う!
Ansible - simple it automation
Diving into SWUpdate: adding new platform support in 30minutes with Yocto/OE !
Riak Operations
Ad

Viewers also liked (19)

PDF
OpenCSW - What is the project about?
PPT
Dare Ireland presentation
PPT
Gruppo 8 tirapelle_sean
PDF
ใบงานที่ 2 เรื่อง ความหมายและความสำคัญของโครงงาน
PPT
Administaff Overview
PPT
supernatural
PPTX
PPTX
4.drama & horror
PDF
Hong kong and Macaywww.Tripmart.com
PPTX
Vehicle
PPS
Baile milespowerpoints.com
PPTX
dont download it!!
PPTX
Computer components =d
PPTX
5S Alicia civilization
PPT
7 simplesteps
PPTX
Who would be the audience for your media honica
PPT
собрание ОГЭ 2015
PDF
Collateral: Cast Iron for BigMachines
PPTX
Stacey savrasova
OpenCSW - What is the project about?
Dare Ireland presentation
Gruppo 8 tirapelle_sean
ใบงานที่ 2 เรื่อง ความหมายและความสำคัญของโครงงาน
Administaff Overview
supernatural
4.drama & horror
Hong kong and Macaywww.Tripmart.com
Vehicle
Baile milespowerpoints.com
dont download it!!
Computer components =d
5S Alicia civilization
7 simplesteps
Who would be the audience for your media honica
собрание ОГЭ 2015
Collateral: Cast Iron for BigMachines
Stacey savrasova
Ad

Similar to Advanced GAR (20)

PDF
An introductionto mGAR (Dublin 2011)
PDF
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
PDF
Package management and creation in Gentoo Linux
PDF
Cvpr2010 open source vision software, intro and training part ii - using git ...
PDF
Autotools
PDF
$ make install
PDF
Whats_new_Conan 2_0_MeetingC++7557.pdf
ODP
Software Build processes and Git
PDF
Configure, Pack and Distribute: An RPM Creation Workshop
PDF
Lean Software Production and Qualification Infrastructures
PDF
Parsing and Type checking all 2^10000 configurations of the Linux kernel
PDF
Dependencies Managers in C/C++. Using stdcpp 2014
PPTX
Autotools pratical training
PPTX
Gnu linux for safety related systems
PDF
Effective CMake
ODP
Develop and Maintain a Distro with Open Build Service
PDF
Php on Windows
PDF
Iz Pack
PDF
Gnubs pres-foss-cdac-sem
An introductionto mGAR (Dublin 2011)
Tracing Software Build Processes to Uncover License Compliance Inconsistencies
Package management and creation in Gentoo Linux
Cvpr2010 open source vision software, intro and training part ii - using git ...
Autotools
$ make install
Whats_new_Conan 2_0_MeetingC++7557.pdf
Software Build processes and Git
Configure, Pack and Distribute: An RPM Creation Workshop
Lean Software Production and Qualification Infrastructures
Parsing and Type checking all 2^10000 configurations of the Linux kernel
Dependencies Managers in C/C++. Using stdcpp 2014
Autotools pratical training
Gnu linux for safety related systems
Effective CMake
Develop and Maintain a Distro with Open Build Service
Php on Windows
Iz Pack
Gnubs pres-foss-cdac-sem

Recently uploaded (20)

PDF
Getting Started with Data Integration: FME Form 101
PDF
Enhancing emotion recognition model for a student engagement use case through...
PDF
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
PDF
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
PDF
A review of recent deep learning applications in wood surface defect identifi...
PPTX
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
PDF
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
PDF
A novel scalable deep ensemble learning framework for big data classification...
PDF
Zenith AI: Advanced Artificial Intelligence
PPTX
Group 1 Presentation -Planning and Decision Making .pptx
PPTX
Final SEM Unit 1 for mit wpu at pune .pptx
PDF
CloudStack 4.21: First Look Webinar slides
PPTX
Benefits of Physical activity for teenagers.pptx
PDF
Hybrid model detection and classification of lung cancer
PDF
WOOl fibre morphology and structure.pdf for textiles
PDF
August Patch Tuesday
PPTX
observCloud-Native Containerability and monitoring.pptx
PDF
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
PDF
STKI Israel Market Study 2025 version august
PDF
Five Habits of High-Impact Board Members
Getting Started with Data Integration: FME Form 101
Enhancing emotion recognition model for a student engagement use case through...
Microsoft Solutions Partner Drive Digital Transformation with D365.pdf
How ambidextrous entrepreneurial leaders react to the artificial intelligence...
A review of recent deep learning applications in wood surface defect identifi...
MicrosoftCybserSecurityReferenceArchitecture-April-2025.pptx
Video forgery: An extensive analysis of inter-and intra-frame manipulation al...
A novel scalable deep ensemble learning framework for big data classification...
Zenith AI: Advanced Artificial Intelligence
Group 1 Presentation -Planning and Decision Making .pptx
Final SEM Unit 1 for mit wpu at pune .pptx
CloudStack 4.21: First Look Webinar slides
Benefits of Physical activity for teenagers.pptx
Hybrid model detection and classification of lung cancer
WOOl fibre morphology and structure.pdf for textiles
August Patch Tuesday
observCloud-Native Containerability and monitoring.pptx
ENT215_Completing-a-large-scale-migration-and-modernization-with-AWS.pdf
STKI Israel Market Study 2025 version august
Five Habits of High-Impact Board Members

Advanced GAR

  • 1. GAR Advanced Topics OpenCSW Technical Summercamp Oslo 2009 Dagobert Michelsen dam@opencsw.org
  • 3. „A Modulation is the process of varying one waveform in relation to another waveform“
  • 4. „A Modulation is the process of varying one waveform in relation to another waveform“ For soft ware builds that means: „A Modulation is the process of varying a build in relation to certain parameters“
  • 17. Phases Prerequisites Executed Fetch globally Checksum Extract Patch Configure Executed inside Build Test modulation Install Merge Package Executed globally
  • 18. Phases Prerequisites Executed Fetch globally Checksum Extract Patch Configure Executed inside Build Test modulation Install Merge Package Executed globally
  • 19. Phases Prerequisites Executed One Fetch modulation globally Checksum Extract Patch Configure Executed inside Build Test modulation Install Merge Package Executed globally
  • 20. Modulations and pre-/post-phases When is pre-build called? Technically ran before first build, but after every configure Problem: each phase should be runnable independently Often sufficient: To be run per modulation pre-build-modulated pre-/post-<phase> is likely to be replaced with pre-/post-<phase>-modulated
  • 21. Modulations and pre-/post-phases When is pre-build called? Technically ran before first build, but after every configure Problem: each phase should be runnable independently Often sufficient: To be run per modulation pre-build-modulated pre-/post-<phase> is likely to be replaced with pre-/post-<phase>-modulated
  • 22. Modulations and pre-/post-phases When is pre-build called? Technically ran before first build, but after every configure Synchronisation needed Problem: each phase should be runnable independently Often sufficient: To be run per modulation pre-build-modulated pre-/post-<phase> is likely to be replaced with pre-/post-<phase>-modulated
  • 23. Modulations and pre-/post-phases When is pre-build called? Technically ran before first build, but after every configure Problem: each phase should be runnable independently Often sufficient: To be run per modulation pre-build-modulated pre-/post-<phase> is likely to be replaced with pre-/post-<phase>-modulated
  • 24. What can be used as modulator? ISA for build architecture For 32/64 bit versions and optimized binaries. See lame Package version Useful when multiple versions of a library should be included See automake ...anything that controls the build Static vs. dynamic linked versions See wget Parameter size See nrpe Wide vs. narrow characters See ncurses
  • 25. Modulation over ISA Allows easy building of multiple ISAs Built-in special case of modulation No merge needed also Simplest case build64 = 1 Advanced EXTRA_BUILD_ISAS = sparcv8plus+vis pentium_pro
  • 26. Verify modulations over ISA build8s% gmake modenv Arch: sparc Kernel: sparcv9 Default ISA 32: sparcv8 Default ISA 64: sparcv9 Requested ISAs: sparcv8 sparcv9 i386 amd64 sparcv8plus+vis pentium_pro Needed ISAs: sparcv8 sparcv9 sparcv8plus+vis Build ISAs: sparcv8 sparcv9 sparcv8plus+vis ISAEXEC dirs: /opt/csw/bin /opt/csw/sbin /opt/csw/libexec ISAEXEC files: /opt/csw/bin/lame Merge include: Merge exclude: /opt/csw/share/info/dir /opt/csw/lib/.*.la .*~ /opt/csw/lib/.*.a Modulators: ISA Modulations: isa-sparcv8 isa-sparcv9 isa-sparcv8plus+vis Requested compiler flags: * Modulation isa-sparcv8: ISA=sparcv8 PATH = /home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/bin:/home/dam/mgar/pkg/lame/ trunk/work/install-isa-sparcv8/opt/csw/bin:/home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/sbin:/ home/dam/mgar/pkg/lame/trunk/work/install-isa-sparcv8/opt/csw/sbin:/opt/csw/bin:/opt/csw/bin:/opt/csw/sbin:/opt/ csw/sbin:/opt/studio/SOS11/SUNWspro/bin:/home/dam/mgar/pkg/lame/trunk/gar/bin:/usr/bin:/usr/sbin:/usr/java/bin:/ usr/ccs/bin:/usr/openwin/bin PKG_CONFIG_PATH = /opt/csw/lib/pkgconfig CFLAGS = -xO3 -xarch=v8 -I/opt/csw/include CXXFLAGS = -xO3 -xarch=v8 -I/opt/csw/include CPPFLAGS = -I/opt/csw/include LDFLAGS = -xarch=v8 -L/opt/csw/lib LD_OPTIONS = -R/opt/csw/lib/$ISALIST -R/opt/csw/lib ASFLAGS =
  • 27. Modulation over ISA requirements Certain ISAs require specific platforms x64 requires Solaris 10, but integrated package for Solaris 8-10 Parallelizing modulation builds may require builds on multiple hosts (work-in-progress) Build platform for each modulation must be specified in the package manifest (work-in-progress) How does ISAEXEC relate to multi-ISA?
  • 28. Modulation over version GARNAME = automake GARVERSION = 1.11 ... EXTRA_MODULATORS = GARVERSION MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11 ... SOURCEFILES = $(foreach VERSION,$(MODULATIONS_GARVERSION), $(GARNAME)-$(VERSION).tar.gz ) DISTFILES = $(SOURCEFILES) ... NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES)) ... $(foreach VERSION,$(MODULATIONS_GARVERSION), $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all) )
  • 29. Modulation over version GARNAME = automake Adds modulator with GARVERSION = 1.11 this name ... EXTRA_MODULATORS = GARVERSION MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11 ... SOURCEFILES = $(foreach VERSION,$(MODULATIONS_GARVERSION), $(GARNAME)-$(VERSION).tar.gz ) DISTFILES = $(SOURCEFILES) ... NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES)) ... $(foreach VERSION,$(MODULATIONS_GARVERSION), $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all) )
  • 30. Modulation over version GARNAME = automake Adds modulator with GARVERSION = 1.11 this name ... EXTRA_MODULATORS = GARVERSION One file per MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11 modulated version ... SOURCEFILES = $(foreach VERSION,$(MODULATIONS_GARVERSION), $(GARNAME)-$(VERSION).tar.gz ) DISTFILES = $(SOURCEFILES) ... NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES)) ... $(foreach VERSION,$(MODULATIONS_GARVERSION), $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all) )
  • 31. Modulation over version GARNAME = automake Adds modulator with GARVERSION = 1.11 this name ... EXTRA_MODULATORS = GARVERSION One file per MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11 modulated version ... SOURCEFILES = $(foreach VERSION,$(MODULATIONS_GARVERSION), $(GARNAME)-$(VERSION).tar.gz ) Make sure only the needed file is DISTFILES = $(SOURCEFILES) extracted in each modulation ... NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES)) ... $(foreach VERSION,$(MODULATIONS_GARVERSION), $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all) )
  • 32. Modulation over version GARNAME = automake Adds modulator with GARVERSION = 1.11 this name ... EXTRA_MODULATORS = GARVERSION One file per MODULATIONS_GARVERSION = 1.6.3 1.7.9 1.8.5 1.9.6 1.10.2 1.11 modulated version ... SOURCEFILES = $(foreach VERSION,$(MODULATIONS_GARVERSION), $(GARNAME)-$(VERSION).tar.gz ) Make sure only the needed file is DISTFILES = $(SOURCEFILES) extracted in each modulation ... NOEXTRACT = $(filter-out $(GARNAME)-$(GARVERSION).tar.gz, $(SOURCEFILES)) ... $(foreach VERSION,$(MODULATIONS_GARVERSION), $(eval MERGE_SCRIPTS_isa-$(ISA)-garversion-$(VERSION) = copy-all) ) Merge-rules needed! We‘ll see about this later
  • 33. Modulation over static/dynamic linking GARNAME = wget ... EXTRA_MODULATORS = STATIC MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only MERGE_DIRS_isa-sparcv8-static-enable = $(bindir) MERGE_SCRIPTS_isa-i386-static-disable = copy-all MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only MERGE_DIRS_isa-i386-static-enable = $(bindir) merge-rename-wget: @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static ... include gar/category.mk
  • 34. Modulation over static/dynamic linking Adds modulator with GARNAME = wget this name ... EXTRA_MODULATORS = STATIC MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only MERGE_DIRS_isa-sparcv8-static-enable = $(bindir) MERGE_SCRIPTS_isa-i386-static-disable = copy-all MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only MERGE_DIRS_isa-i386-static-enable = $(bindir) merge-rename-wget: @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static ... include gar/category.mk
  • 35. Modulation over static/dynamic linking Adds modulator with GARNAME = wget this name ... Cool trick: EXTRA_MODULATORS = STATIC Use dynamically expanded variables to set per-modulation MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only MERGE_DIRS_isa-sparcv8-static-enable = $(bindir) MERGE_SCRIPTS_isa-i386-static-disable = copy-all MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only MERGE_DIRS_isa-i386-static-enable = $(bindir) merge-rename-wget: @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static ... include gar/category.mk
  • 36. Modulation over static/dynamic linking Adds modulator with GARNAME = wget this name ... Cool trick: EXTRA_MODULATORS = STATIC Use dynamically expanded variables to set per-modulation MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = rename-wget copy-only MERGE_DIRS_isa-sparcv8-static-enable = $(bindir) MERGE_SCRIPTS_isa-i386-static-disable = copy-all Why is this a bad idea? MERGE_SCRIPTS_isa-i386-static-enable = rename-wget copy-only MERGE_DIRS_isa-i386-static-enable = $(bindir) Think gmake remerge merge-rename-wget: @mv $(DESTDIR)$(bindir)/wget $(DESTDIR)$(bindir)/wget.static ... include gar/category.mk
  • 39. Modulation over static/dynamic linking GARNAME = wget ... EXTRA_MODULATORS = STATIC MODULATIONS_STATIC = disable enable EXTRA_CONFIGURE_STATIC-disable = --with-ssl EXTRA_CONFIGURE_STATIC-enable = --disable-shared EXTRA_CONFIGURE_STATIC-enable += --enable-static EXTRA_CONFIGURE_STATIC-enable += --without-ssl ... CONFIGURE_ARGS += $(EXTRA_CONFIGURE_STATIC-$(STATIC)) ... MERGE_SCRIPTS_isa-sparcv8-static-disable = copy-all MERGE_SCRIPTS_isa-sparcv8-static-enable = copy-static-wget-only MERGE_SCRIPTS_isa-i386-static-disable = copy-all MERGE_SCRIPTS_isa-i386-static-enable = copy-static-wget-only from one phase Always copy to another merge-copy-static-wget-only: ginstall $(INSTALLISADIR)$(bindir)/wget $(PKGROOT)$(bindir)/wget.static ... include gar/category.mk
  • 40. Modulation over parameter size GARNAME = nrpe ... EXTRA_MODULATORS = SIZE MODULATIONS_SIZE = 1k 8k ... PATCHFILES_isa-sparcv8-size-8k = common.h.diff PATCHFILES_isa-i386-size-8k = common.h.diff ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 41. Modulation over parameter size Ok, I guess you understood GARNAME = nrpe how this works ... EXTRA_MODULATORS = SIZE MODULATIONS_SIZE = 1k 8k ... PATCHFILES_isa-sparcv8-size-8k = common.h.diff PATCHFILES_isa-i386-size-8k = common.h.diff ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 42. Modulation over parameter size Ok, I guess you understood GARNAME = nrpe how this works ... EXTRA_MODULATORS = SIZE Use patchfiles on a MODULATIONS_SIZE = 1k 8k per-modulation basis ... PATCHFILES_isa-sparcv8-size-8k = common.h.diff PATCHFILES_isa-i386-size-8k = common.h.diff ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 43. Modulations and their names The name of a modulation is <modulator1>-<value1>-<modulator2>-<value2>-... Call each phase from a modulation manually with <phase>-<modulation> Example: gmake build-isa-sparcv8 This results in a sub-make-invocation <phase>-modulated MODULATION=<MODULATION> <MODULATOR1>=<value1> ... Example: gmake build-modulated MODULATION=isa-sparcv8 ISA=sparcv8
  • 45. Merging Why is this needed? Libraries may be located elsewhere in the package than they were configured 32 and 64 bit need different install locations to have sane pkgconfig-files build-isa-sparcv8/opt/csw/bin/myapp build-isa-sparcv9/opt/csw/bin/64/myapp pkgroot/opt/csw/bin/myapp Install pkgroot/opt/csw/bin/sparcv9/myapp /opt/csw/bin/myapp -> isaexec Package /opt/csw/bin/sparcv8/myapp /opt/csw/bin/sparcv9/myapp
  • 46. Merging default rules copy-all Copy all files and put them in standard locations (e. g. /csw/bin) copy-only Copy only the files to be relocated and also put them in standard locations copy-relocate Copy all files and relocate the locations to the ISA-subdirs (e. g. /csw/bin/sparcv9/) copy-relocated-only Copy only the files to be relocated and also relocate the locations to the ISA- subdirs
  • 47. Merging default rules copy-all Copy all files and put them in standard locations (e. g. /csw/bin) Copy all Copy only relocated copy-only Copy only the files to be relocated and also put them in standard locations copy-relocate Do not Copy all files and relocate the locations to the ISA-subdirs relocate copy-all copy-only (e. g. /csw/bin/sparcv9/) copy-relocated-only Copy only the files to be relocated and also relocate the locations to the ISA- Do relocate subdirs copy-relocate copy-relocated-only
  • 48. Merging and renaming Rename files on-the-fly during merge See curl EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-32.h,p" EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-64.h,p" EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64) EXTRA_PAX_ARGS_isa-i386 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-amd64 = $(EXTRA_PAX_ARGS_64)
  • 49. Merging and renaming Rename files on-the-fly during merge See curl From here EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-32.h,p" EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-64.h,p" EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64) EXTRA_PAX_ARGS_isa-i386 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-amd64 = $(EXTRA_PAX_ARGS_64)
  • 50. Merging and renaming Rename files on-the-fly during merge See curl From here To here EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-32.h,p" EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-64.h,p" EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64) EXTRA_PAX_ARGS_isa-i386 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-amd64 = $(EXTRA_PAX_ARGS_64)
  • 51. Merging and renaming Rename files on-the-fly during merge See curl EXTRA_PAX_ARGS_32 = -s ",^.$(includedir)/curl/curlbuild.h$$, .$(includedir)/curl/curlbuild-32.h,p" This is the modulation where the EXTRA_PAX_ARGS_64 = -s ",^.$(includedir)/curl/curlbuild.h$$, PAX args should be applied .$(includedir)/curl/curlbuild-64.h,p" EXTRA_PAX_ARGS_isa-sparcv8 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-sparcv9 = $(EXTRA_PAX_ARGS_64) EXTRA_PAX_ARGS_isa-i386 = $(EXTRA_PAX_ARGS_32) EXTRA_PAX_ARGS_isa-amd64 = $(EXTRA_PAX_ARGS_64)
  • 52. Merging with custom rules Only merge specific files See nrpe GARNAME = nrpe ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 53. Merging with custom rules Only merge specific files See nrpe This is the default build GARNAME = nrpe Just copy everything over ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 54. Merging with custom rules Only merge specific files See nrpe This is the default build GARNAME = nrpe Just copy everything over ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only We want to control exactly what is used from the additional modulation MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only include gar/category.mk ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)
  • 55. Merging with custom rules Only merge specific files See nrpe GARNAME = nrpe ... MERGE_SCRIPTS_isa-sparcv8-size-1k = copy-all MERGE_SCRIPTS_isa-sparcv8-size-8k = copy-nrpe-only MERGE_SCRIPTS_isa-i386-size-1k = copy-all MERGE_SCRIPTS_isa-i386-size-8k = copy-nrpe-only Merging copies from the install include gar/category.mk location to PKGROOT ... merge-copy-nrpe-only: cp $(INSTALLISADIR)$(bindir)/nrpe_1k $(PKGROOT)$(bindir)/nrpe_8k cp $(INSTALLISADIR)$(LIBEXECDIR)/check_nrpe $(PKGROOT)$(LIBEXECDIR)/check_nrpe_8k @$(MAKECOOKIE)