Skip to main content

History: Setting Up An Application - Autotools - Linux

Preview of version: 6

gnu_make-icon.png
Setting Up An Application using GNU Autotools - Linux


Introduction

This set of instructions will walk you through setting up a C++ project from scratch using GNU Autotools.

When you have finished this tutorial you will be able to compile a working Ogre Application and you will be ready to start the Basic Tutorials.

Prerequisites

You should have a working build environment set up (apt-get install build-essentials on Ubuntu)
Make sure that autoconf + automake + libtool are installed.

Ogre Wiki Tutorial Framework

Download the Ogre Wiki Tutorial Framework here:
No such attachment on this page

bootstrap

Copy to clipboard
#!/bin/sh rm -rf autom4te.cache libtoolize --force --copy && aclocal && autoheader && automake --add-missing --force-missing --copy --foreign && autoconf

Make this file (bootstrap) executable.

configure.ac

Copy to clipboard
AC_INIT(configure.ac) AM_INIT_AUTOMAKE(SampleApp, 0.1) AM_CONFIG_HEADER(config.h) AC_LANG_CPLUSPLUS AC_PROG_CXX AM_PROG_LIBTOOL PKG_CHECK_MODULES(OGRE, [OGRE >= 1.2]) AC_SUBST(OGRE_CFLAGS) AC_SUBST(OGRE_LIBS) PKG_CHECK_MODULES(OIS, [OIS >= 1.0]) AC_SUBST(OIS_CFLAGS) AC_SUBST(OIS_LIBS) AC_CONFIG_FILES(Makefile) AC_OUTPUT

Makefile.am

Copy to clipboard
noinst_HEADERS= BaseApplication.h TutorialApplication.h bin_PROGRAMS= OgreApp OgreApp_CPPFLAGS= -I$(top_srcdir) OgreApp_SOURCES= BaseApplication.cpp TutorialApplication.cpp OgreApp_CXXFLAGS= $(OGRE_CFLAGS) $(OIS_CFLAGS) OgreApp_LDADD= $(OGRE_LIBS) $(OIS_LIBS) EXTRA_DIST = bootstrap AUTOMAKE_OPTIONS = foreign

The Autotools Dance

Run this in a console:

Copy to clipboard
./bootstrap && ./configure && make


You should have successfully built your Ogre application. 😊

History

Information Version
Mon 20 of Mar, 2017 22:06 GMT-0000 clemix 12
Mon 14 of Nov, 2016 14:04 GMT-0000 dark_sylinc 11
Mon 14 of Nov, 2016 14:03 GMT-0000 dark_sylinc 10
Mon 05 of May, 2014 08:30 GMT-0000 c6burns removed file link so it doesnt have to be maintained manually 9
Sat 30 of Apr, 2011 12:36 GMT-0000 montaropdf Adding an explanation on how to add optional OGRE libraries in the building process, add a comment in the 'Possible Improvements' section and add details in section 'Ogre Wiki Tutorial Framework' 8
Sun 02 of Jan, 2011 01:12 GMT-0000 jacmoe 7
Sat 01 of Jan, 2011 21:37 GMT-0000 jacmoe 6
Sat 01 of Jan, 2011 21:36 GMT-0000 jacmoe 5
Sat 01 of Jan, 2011 21:31 GMT-0000 jacmoe 4
Sat 01 of Jan, 2011 21:25 GMT-0000 jacmoe 3
Sat 01 of Jan, 2011 21:14 GMT-0000 jacmoe 2
Sat 01 of Jan, 2011 16:26 GMT-0000 jacmoe 1