Commit c33f915e authored by Brian Ermold's avatar Brian Ermold
Browse files

Add build system files.

parent bdf6d4aa
SUBDIRS = src conf
MAINTAINERCLEANFILES = \
aclocal.m4 \
build-aux/ar-lib \
build-aux/config.guess \
build-aux/config.sub \
build-aux/depcomp \
build-aux/install-sh \
build-aux/ltmain.sh \
build-aux/missing \
config.h.in \
config.h.in~ \
configure \
m4/libtool.m4 \
m4/lt~obsolete.m4 \
m4/ltoptions.m4 \
m4/ltsugar.m4 \
m4/ltversion.m4 \
Makefile.in
#!/bin/sh
set -e
autoreconf --install --force --verbose
rm -rf autom4te.cache
#!/bin/sh
# Check for BUILD_PACKAGE_NAME environment variable
name=$BUILD_PACKAGE_NAME
if [ -z "$name" ]; then
# Get 'group-project' from git repo URL
name=`git config --get remote.origin.url | \
sed 's/.*://;s/.git$//;s/\//-/'`
if [ -z "$name" ]; then
# Get group name from path to project
path=`pwd`
path=${path%/*}
group=$(basename $path)
# Use directory name for project name
project=$(basename `pwd`)
name="$group-$project"
fi
fi
printf $name
exit 0
#!/bin/sh
# Check for BUILD_PACKAGE_VERSION environment variable
version=$BUILD_PACKAGE_VERSION
if [ -z "$version" ]; then
# Check for most recent package specific tag
package=$BUILD_PACKAGE_NAME
if [ -z "$package" ]; then
# Use git project name for package name
package=`git config --get remote.origin.url | \
sed 's/.*://;s/.git$//;s/^.*\///'`
fi
tag=`git describe --tags --long --dirty --match="${package}-v[0-9]*" 2>/dev/null`
if [ -z "$tag" ]; then
# Check for most recent tag
tag=`git describe --tags --long --dirty 2>/dev/null`
fi
if [ -z "$tag" ]; then
version="0.0-0-0-g0000000-dirty"
else
version=`echo $tag | \
sed -E "s/.*v([0-9]+)\.([0-9]+)\.([0-9]+.*)$/\1.\2-\3/"`
fi
parts=(${version//-/ })
# ${parts[0]} = major.minor
# ${parts[1]} = build number
# ${parts[2]} = number of commits since last tag
# ${parts[3]} = git hash of last commit
# ${parts[4]} = 'dirty' if local changes since last commit
# major.minor-build
version="${parts[0]}-${parts[1]}"
# development version
if [ ${parts[2]} != 0 ] || [ ${parts[4]} ]; then
# add .dev<commit number>
version+=".dev${parts[2]}"
fi
# uncommitted changes in code
if [ ${parts[4]} ]; then
# add .dirty
version+=".${parts[4]}"
fi
# platform
system=`uname`
if [ $system == "Linux" ]; then
# use 'el#'
platform=`uname -r | sed 's/.*\(el[0-9]\).*/\1/'`
else
# use system name
platform=$system
fi
version="$version.$platform"
fi
printf $version
exit 0
#!/bin/sh
# Print usage
script_name=$0
usage()
{
cat <<EOM
DESCRIPTION
Build script to configure, make, and install this package.
SYNOPSIS
$script_name [--prefix=path [--destdir=path]] [--clean] [--conf]
OPTIONS
--prefix=path absolute path to installation directory
default: \$VAP_HOME
--destdir=path absolute path prepended to prefix
used to perform a staged installation
--clean cleanup build directory and regenerate
build system files
--conf only install conf files
--strip strip debugging symbols
--purify build with purify
-h, --help display this help message
EOM
}
# Parse command line
install="install"
for i in "$@"
do
case $i in
--clean) clean=1
;;
--conf) install="install-data"
;;
--destdir=*) destdir="${i#*=}"
;;
--prefix=*) prefix="${i#*=}"
;;
--purify) purify="true"
;;
--strip) install="install-strip"
;;
-h | --help) usage
exit
;;
*) usage
exit 1
;;
esac
done
if [ $destdir ] && [ ! $prefix ]; then
usage
exit 1
fi
# Get prefix from environemnt variables if necessary
if [ ! $prefix ]; then
if [ $VAP_HOME ]; then
prefix=$VAP_HOME
else
usage
exit 1
fi
fi
# Function to echo and run commands
run() {
echo "> $1"
$1 || exit 1
}
# autogen.sh
if [ $clean ] || [ ! -f ./configure ]; then
echo "------------------------------------------------------------------"
echo "prefix: $prefix"
if [ $destdir ]; then
echo "destdir: $destdir"
fi
echo "------------------------------------------------------------------"
run "./autogen.sh"
fi
# mkdir build; cd build
echo "------------------------------------------------------------------"
if [ $clean ] || [ ! -d ./build ]; then
if [ -d build ]; then
run "rm -rf build"
fi
run "mkdir -p build"
fi
run "cd build"
# configure
if [ $clean ] || [ ! -f ./Makefile ]; then
echo "------------------------------------------------------------------"
run "../configure --prefix=$prefix"
fi
# make install
if [ $purify ]; then
export CC="purify -cache-dir=$HOME/.purecache -windows=no gcc"
install="-e $install"
echo "------------------------------------------------------------------"
run "make clean"
fi
echo "------------------------------------------------------------------"
if [ $destdir ]; then
run "make DESTDIR=$destdir $install"
else
run "make $install"
fi
exit
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.63])
AC_INIT(
m4_esyscmd([./build-aux/get_package_name.sh]),
m4_esyscmd([./build-aux/get_package_version.sh]),
[])
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign -Wall -Werror])
#AM_MAINTAINER_MODE
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
LT_INIT(disable-static)
AC_CONFIG_HEADERS([config.h])
AC_SUBST(PACKAGE_VERSION)
# Checks for programs.
AM_PROG_CC_C_O
# Checks for libraries.
PKG_CHECK_MODULES([BWADI], [bwadi], [],
[AC_MSG_ERROR([bwadi not found in PKG_CONFIG_PATH])])
# Checks for header files.
# Checks for typedefs, structures, and compiler characteristics.
# Checks for library functions.
AC_CONFIG_FILES([Makefile
conf/Makefile
src/Makefile])
AC_OUTPUT
bin_PROGRAMS = langley
langley_SOURCES = \
barnard_langley.c \
jim-plot.c \
jim-plot.h \
la.c \
la.h \
langley.c \
langley.h \
langley_retriever.h \
lfit.c \
michalsky_analysis.c \
michalsky_langley.c \
michalsky_langley.h \
solarpos.c \
sunae.c \
sunae.h \
time_of.c \
util.c \
util.h
langley_CFLAGS = -Wall -Wextra $(BWADI_CFLAGS)
langley_LDFLAGS = $(BWADI_LIBS)
MAINTAINERCLEANFILES = \
Makefile.in
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment