Skip to content

Instantly share code, notes, and snippets.

@doubleotoo
Created November 14, 2012 23:54
Show Gist options
  • Save doubleotoo/4075700 to your computer and use it in GitHub Desktop.
Save doubleotoo/4075700 to your computer and use it in GitHub Desktop.
A basic script for project setup with the GNU autotools
#! /bin/bash
#
# Copied from http://code.google.com/p/autotools-bootstrap/source/browse/autotools-bootstrap-basic.sh
#
# This is the basic script for project setup with the GNU autotools.
# Visit:
# http://seth-g-kriticos.blogspot.com/2008/06/how-to-set-up-open-source-c-development.html
# to find out, what it does.
echo "Please enter the project name: "
read NAME
echo "Bootstrapping $NAME project.."
mkdir $NAME
cd $NAME
echo "Creating configure.in.."
echo "AC_INIT" > configure.in
echo "AM_INIT_AUTOMAKE($NAME,0.1.0)" >> configure.in
echo "AC_PROG_CC" >> configure.in
echo "AC_PROG_CXX" >> configure.in
echo "AC_OUTPUT(Makefile)" >> configure.in
echo "Creating mandatory files.."
touch AUTHORS NEWS README ChangeLog ${NAME}.c
echo "Creating Makefile.am.."
echo "bin_PROGRAMS = $NAME" > Makefile.am
echo "${NAME}_SOURCES = ${NAME}.c" >> Makefile.am
echo "Creating the build scripts.."
aclocal
autoconf
automake -a
./configure
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment