History: Setting Up An Application - Autotools - Linux
Preview of version: 6
|
|
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.
Table of contents
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. 😊