• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/docs/manual/adding-packages-autotools.txt
Maxime HadjinlianMaxime Hadjinlian committed 7ffa8e4c60b15 Nov 2014
Raw file
Source viewDiff to previous
 
1
// -*- mode:doc; -*-
2
// vim: set syntax=asciidoc:
3
​
4
=== Infrastructure for autotools-based packages
5
​
6
[[autotools-package-tutorial]]
7
​
8
==== +autotools-package+ tutorial
9
​
10
First, let's see how to write a +.mk+ file for an autotools-based
11
package, with an example :
12
​
13
------------------------
14
01: ################################################################################
15
02: #
16
03: # libfoo
17
04: #
18
05: ################################################################################
19
06:
20
07: LIBFOO_VERSION = 1.0
21
08: LIBFOO_SOURCE = libfoo-$(LIBFOO_VERSION).tar.gz
22
09: LIBFOO_SITE = http://www.foosoftware.org/download
23
10: LIBFOO_INSTALL_STAGING = YES
24
11: LIBFOO_INSTALL_TARGET = NO
25
12: LIBFOO_CONF_OPTS = --disable-shared
26
13: LIBFOO_DEPENDENCIES = libglib2 host-pkgconf
27
14:
28
15: $(eval $(autotools-package))
29
------------------------
30
​
31
On line 7, we declare the version of the package.
32
​
33
On line 8 and 9, we declare the name of the tarball (xz-ed tarball recommended)
34
and the location of the tarball on the Web. Buildroot will automatically
35
download the tarball from this location.
36
​
37
On line 10, we tell Buildroot to install the package to the staging
38
directory. The staging directory, located in +output/staging/+
39
is the directory where all the packages are installed, including their
40
development files, etc. By default, packages are not installed to the
41
staging directory, since usually, only libraries need to be installed in
42
the staging directory: their development files are needed to compile
43
other libraries or applications depending on them. Also by default, when
44
staging installation is enabled, packages are installed in this location
45
using the +make install+ command.
46
​
47
On line 11, we tell Buildroot to not install the package to the
48
target directory. This directory contains what will become the root
49
filesystem running on the target. For purely static libraries, it is
50
not necessary to install them in the target directory because they will
51
not be used at runtime. By default, target installation is enabled; setting
52
this variable to NO is almost never needed. Also by default, packages are
53
installed in this location using the +make install+ command.
54
​
55
On line 12, we tell Buildroot to pass a custom configure option, that
56
will be passed to the +./configure+ script before configuring
57
and building the package.
58
​
59
On line 13, we declare our dependencies, so that they are built
60
before the build process of our package starts.
61
​
62
Finally, on line line 15, we invoke the +autotools-package+
63
macro that generates all the Makefile rules that actually allows the
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.