2 automake.inc provides a simple mechanism for downloading/patching/building
3 and installing packages within the uClinux-dist framework.
5 How to use it is documented below by example.
7 Using this build system requires a working net connection (at least for the
8 first time you turn on a package in the build). All downloaded files will
9 be stored in ~/.downloads. If you want to share downloads to save bandwidth
10 or time you can copy this directory or mount it as a shared filesystem. It
11 is just a directory of files.
13 For this example we will work through the steps needed to add a package
18 2) Add user/mypkg/Makefile
20 URL = http://mypkg.net/downloads/mypkg-1.2.tar.gz
21 include $(ROOTDIR)/tools/automake.inc
23 or if you want to build more than one package:
25 mkpkg-1.2_URL = http://mypkg.net/downloads/mypkg-1.2.tar.gz
26 yourpkg-2.3_URL = http://yourpkg.net/downloads/yourpkg-2.3.tar.gz
28 AUTOMAKE_y = mypkg-1.2 yourpkg-2.3
30 include $(ROOTDIR)/tools/automake.inc
32 3) Put your patches in user/mypkg/patches/.
34 Patches can be of the form:
36 mypkg-1.2-fix-strcpy.patch
37 mypkg-1.2-more-fixes.patch
39 or in quilt format with a "series" files listing the patches in the order
40 the need to be applied.
42 Patches should apply with -p1 from the top directory in the extracted
45 4) Run "make oldconfig" which will let you enable your new application in
48 5) try building ;-), if you have already built a full tree you can just
53 or run "make" from the top level.
55 6) Customising your new package.
57 Extra variables you can add to your makefile to customise how the package
58 is built, followed by an example.
60 PKG = name - override PKG name, normally drived from URL
64 <pkg>_CONFOPTS - configure options needed to build package
66 mypkg-1.2_CONFOPTS = --with-installed-zlib
68 <pkg>_CONFVARS - env vars passed to configure to override settings
70 mypkg-1.2_CONFVARS = ac_cv_func_posix_getpwuid_r=yes
72 <pkg>_CFLAGS - CFLAGS needed to build package
74 mypkg-1.2_CFLAGS = -DPTYS_ARE_GETPT=1
76 <pkg>_BUILDDIR - if the subdir to build in isn't <pkg> after extraction,
77 patches apply -p1 within this directory.
79 mypkg-1.2_BUILDDIR = mypkg/src
81 <pkg>_MAKEVARS - variables to force when making
83 mypkg-1.2_MAKEVARS = LIBS=-lintl
85 <pkg>_ROMFS - package specific romfs make target to be run after default
88 <pkg>_METHOD - The default method is to treat URL as a tarball/zip
89 download. You may set method to "git" or "gitarchive".
90 "git" will clone the remote repo and build with that.
91 "gitarchive" will run the git archive command to obtain
92 a tarball of just a given "SUBDIR". URL is used to
93 specify the remote repository. VERSION may be used to
94 specifiy a version or branch.
96 <pkg>_VERSION - for revision controlled packages, you can set the
99 <pkg>_SUBDIR - when using the gitarchive method to obtain
100 subdirectories of larger projects, this is the
101 subdirectory under the projects git root.
104 - Sometimes the URL does not provide a nicely named file,
105 this option allows the locally used archive name to be
108 <pkg>_MAKEVARS - vars to add to all make commands, ie., make CC=gcc.
112 - environment or vars that are set before building(make)
115 In many cases the individual <pkg> options can be set globally to apply
116 to one or more packages. For example the follow sets CONFOPTS for all
117 packages built by this automake file:
119 CONFOPTS = my-conf-options
121 Other such shortcust are:
123 URL, METHOD, BUILDDIR, SRCDIR, DOWNLOADNAME, CONFIGURE, SUBDIR,
124 VERSION, AUTOCONF, NODEFCONF, INSTALL, METHOD
126 Some othe global only overrides are:
128 AUTOMAKE_ROMFS - override the main romfs target, you have complete
130 BUILDTARGET - (defaults to built)
131 INSTALLTARGET - defaults to installed
132 FINALTARGET - defaults to lndir
133 COMPLETETARGET - default to complete_target
135 The above overrides can be used to gain control over the build at various
138 You can also add your own Kconfig file if you want fine grained config
139 control. If you do not provide a Kconfig a simple version will be
140 created for you automatically at config time. If you do add your own
141 Kconfig file then you must include a top level config option to build
142 your new directory, for example, a Kconfig for a packge with one extra
150 config USER_MYPKG_OPTION
151 bool "mypkg: simple option"
152 depends on USER_MYPKG
155 Change the mypkg build in some useful way.
157 If you add your library/application to the "lib" directory, then change
158 all occurances of of the text USER in the above example to LIB.
160 Copyright (C) 2009 David McCullough <davidm@uclinux.org>