Skip to content

Commit

Permalink
build: automake and libtool support
Browse files Browse the repository at this point in the history
Use autotools (automake, autoconf, libtool) to build numactl, libnuma
and the additional distribution binaries.

Set up the build with:
  $ autoreconf --install --symlink

Build with:
  $ ./configure --prefix=/usr
  $ make

Install with:
  root# make install

Or install to a staging directory with:
  $ make install DESTDIR=/path/to/staging/numactl

Create a distribution archive with:
  $ make dist

Test the distribution archive with:
  $ make distcheck

Tested:
- Ran all make commands above and made sure they worked.
- Confirmed that the binaries built with automake work as expected.
- Compared the now libtool-based libnuma.so.1 with the one built
  directly and confirmed they are identical and interoperable.

Signed-off-by: Filipe Brandenburger <[email protected]>
  • Loading branch information
filbranden committed Aug 5, 2014
1 parent 965cddd commit 46122d1
Show file tree
Hide file tree
Showing 4 changed files with 80 additions and 4 deletions.
23 changes: 19 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# Object files:
*.o
*.lo

# Auxiliary build files:
.depend
/.deps
/.libs

# libnuma libraries:
/libnuma.la
/libnuma.a
/libnuma.so
/libnuma.so.*
Expand Down Expand Up @@ -35,6 +38,18 @@
/test/tbitmap
/test/tshared

# Temporary files used by the build:
/empty.c
/threadtest
# Files generated by autoreconf:
/Makefile.in
/aclocal.m4
/autom4te.cache
/build-aux
/config.h.in
/configure

# Files generated by configure:
/Makefile
/config.h
/config.log
/config.status
/libtool
/stamp-*
37 changes: 37 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@

ACLOCAL_AMFLAGS = -I m4

bin_PROGRAMS = numactl numastat numademo migratepages migspeed memhog

lib_LTLIBRARIES = libnuma.la

include_HEADERS = numa.h numacompat1.h numaif.h

noinst_HEADERS = numaint.h util.h

dist_man_MANS = move_pages.2 numa.3 numactl.8 numastat.8 migratepages.8 migspeed.8

EXTRA_DIST = README CHANGES TODO DESIGN

numactl_SOURCES = numactl.c util.c shm.c shm.h
numactl_LDADD = libnuma.la

numastat_SOURCES = numastat.c
numastat_CFLAGS = -std=gnu99

numademo_SOURCES = numademo.c stream_lib.c stream_lib.h mt.c mt.h clearcache.c clearcache.h
numademo_CPPFLAGS = -DHAVE_STREAM_LIB -DHAVE_MT -DHAVE_CLEAR_CACHE
numademo_LDADD = libnuma.la -lm

migratepages_SOURCES = migratepages.c util.c
migratepages_LDADD = libnuma.la

migspeed_SOURCES = migspeed.c util.c
migspeed_LDADD = libnuma.la -lrt

memhog_SOURCES = memhog.c util.c
memhog_LDADD = libnuma.la

libnuma_la_SOURCES = libnuma.c syscall.c distance.c affinity.c affinity.h sysfs.c sysfs.h rtnetlink.c rtnetlink.h versions.ldscript
libnuma_la_LDFLAGS = -version-info 1:0:0 -Wl,--version-script,$(srcdir)/versions.ldscript -Wl,-init,numa_init -Wl,-fini,numa_fini

18 changes: 18 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
AC_PREREQ([2.64])
AC_INIT([numactl], [2.0.10])

AC_CONFIG_SRCDIR([numactl.c])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE([foreign])

LT_PREREQ([2.2])
LT_INIT

AC_PROG_CC

AC_CONFIG_FILES([Makefile])

AC_OUTPUT
6 changes: 6 additions & 0 deletions m4/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# m4 files generated by libtoolize:
libtool.m4
ltoptions.m4
ltsugar.m4
ltversion.m4
lt~obsolete.m4

0 comments on commit 46122d1

Please sign in to comment.