Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suport to autotools and fix minor compile erros and warn. #15

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
First attempt to use autotools...
psychomantys committed Aug 24, 2013
commit 3e5611051bcbe259199895766c231259e0621dc4
68 changes: 68 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
SUBDIRS=src/ test

## Place generated object files (.o) into the same directory as their source
## files, in order to avoid collisions when non-recursive make is used.
AUTOMAKE_OPTIONS = subdir-objects

## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}

## Install the generated pkg-config file (.pc) into the expected location for
## architecture-dependent package configuration information. Occasionally,
## pkg-config files are also used for architecture-independent data packages,
## in which case the correct install location would be $(datadir)/pkgconfig.
##pkgconfigdir = $(libdir)/pkgconfig
##pkgconfig_DATA = cabrio-$(PACKAGE_VERSION_MAJOR).pc

## Define an independent executable script for inclusion in the distribution
## archive. However, it will not be installed on an end user's system due to
## the noinst_ prefix.
dist_noinst_SCRIPTS = bootstrap.sh


TEMP_PKG_RPM_DIR=$(abs_top_builddir)/packages/rpm
TEMP_PKG_DEB_DIR=$(abs_top_builddir)/packages/debian/root

# Create a deb package
pkg-deb:
mkdir -p $(TEMP_PKG_DEB_DIR)/DEBIAN

make DESTDIR=$(TEMP_PKG_DEB_DIR) install
cp packages/debian/control $(TEMP_PKG_DEB_DIR)/DEBIAN/control
echo -n 'Depends: ' >> $(TEMP_PKG_DEB_DIR)/DEBIAN/control
find $(TEMP_PKG_DEB_DIR) -not -type d | xargs -n1 objdump -p 2>/dev/null \
| grep 'NEEDED ' |tr -s ' ' |cut -f 3 -d ' ' | \
xargs -n1 dpkg -S |cut -f1 -d: |sort -u | xargs echo | tr ' ' ',' >> $(TEMP_PKG_DEB_DIR)/DEBIAN/control
dpkg --build $(TEMP_PKG_DEB_DIR) $(TEMP_PKG_DEB_DIR)/../$(PACKAGE_NAME)-$(PACKAGE_VERSION_API).deb
- rm -r $(TEMP_PKG_DEB_DIR)

# Create an RPM package
# Depend of all rule
pkg-rpm: all
mkdir -p $(TEMP_PKG_RPM_DIR)/RPMS/i386
mkdir -p $(TEMP_PKG_RPM_DIR)/SRPMS
mkdir -p $(TEMP_PKG_RPM_DIR)/BUILD
mkdir -p $(TEMP_PKG_RPM_DIR)/SOURCES
mkdir -p $(TEMP_PKG_RPM_DIR)/tmp
@- rm -r $(TEMP_PKG_RPM_DIR)/BUILD/$(PACKAGE_NAME)-root
@- ln -s $(abs_top_builddir) $(TEMP_PKG_RPM_DIR)/BUILD/$(PACKAGE_NAME)-root
@- rm -r $(TEMP_PKG_RPM_DIR)/RPMS/$(PACKAGE_NAME)-*
@- rm -r $(TEMP_PKG_RPM_DIR)/SRPMS/$(PACKAGE_NAME)-*
@- rm -r $(TEMP_PKG_RPM_DIR)/SOURCES/$(PACKAGE_NAME)-*

# Find binary deps for binary in $(abs_top_builddir) to write in rpm
# deps in cabrio.spec
sed -i s/"^Requires: .*/Requires: ` ( find $(abs_top_builddir) -not -type d \
| xargs -n1 objdump -p | grep 'NEEDED ' \
| tr -s ' ' |cut -f 3 -d ' ' | sort -u \
| xargs -n 1 printf -- " -e %s" \
| xargs -I'{}' bash -c 'rpm -q -a --filesbypkg | grep {}' \
| tr -s ' ' | cut -f1 -d ' ' | sort -u \
| xargs echo | tr ' ' ',' ) 2> /dev/null `/"g $(abs_top_builddir)/$(PACKAGE_NAME).spec

- rpmbuild --with noconfigure --quiet --nodeps --define="_topdir $(TEMP_PKG_RPM_DIR)" \
-bb $(abs_top_builddir)/$(PACKAGE_NAME).spec
mv $(TEMP_PKG_RPM_DIR)/RPMS/i386/$(PACKAGE_NAME)-$(PACKAGE_VERSION_API)-*.i386.rpm $(TEMP_PKG_RPM_DIR)/../

17 changes: 17 additions & 0 deletions bootstrap.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh -e

test -n "${srcdir}" || srcdir=`dirname "$0"`
test -n "${srcdir}" || srcdir=.

if [ ! "${NO_CHANGELOG}" ] ; then
(
cd "${srcdir}"
svn log > ChangeLog
)
fi

libtoolize --ltdl
autoreconf --force --install --verbose "$srcdir"
test -n "${NOCONFIGURE}" || "${srcdir}/configure" "$@"
#test -n "${NOCONFIGURE}" || "${srcdir}/configure" --enable-silent-rules --disable-dependency-tracking "$@"

177 changes: 177 additions & 0 deletions build-aux/m4/dolt.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,177 @@
dnl dolt, a replacement for libtool
dnl Copyright © 2007-2010 Josh Triplett <[email protected]>
dnl Copying and distribution of this file, with or without modification,
dnl are permitted in any medium without royalty provided the copyright
dnl notice and this notice are preserved.
dnl
dnl To use dolt, invoke the DOLT macro immediately after the libtool macros.
dnl Optionally, copy this file into acinclude.m4, to avoid the need to have it
dnl installed when running autoconf on your project.

AC_DEFUN([DOLT], [
AC_REQUIRE([AC_CANONICAL_HOST])
# dolt, a replacement for libtool
# Josh Triplett <[email protected]>
AC_PATH_PROG(DOLT_BASH, bash)
AC_MSG_CHECKING([if dolt supports this host])
dolt_supported=yes
if test x$DOLT_BASH = x; then
dolt_supported=no
fi
if test x$GCC != xyes; then
dolt_supported=no
fi
case $host in
i?86-*-linux*|x86_64-*-linux*|powerpc-*-linux*|sparc*-*-linux* \
|amd64-*-freebsd*|i?86-*-freebsd*|ia64-*-freebsd*)
pic_options='-fPIC'
;;
i?86-apple-darwin*)
pic_options='-fno-common'
;;
*)
dolt_supported=no
;;
esac
if test x$dolt_supported = xno ; then
AC_MSG_RESULT([no, falling back to libtool])
LTCOMPILE='$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(COMPILE)'
LTCXXCOMPILE='$(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXXCOMPILE)'
else
AC_MSG_RESULT([yes, replacing libtool])

dnl Start writing out doltcompile.
cat <<__DOLTCOMPILE__EOF__ >doltcompile
#!$DOLT_BASH
__DOLTCOMPILE__EOF__
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
args=("$[]@")
for ((arg=0; arg<${#args@<:@@@:>@}; arg++)) ; do
if test x"${args@<:@$arg@:>@}" = x-o ; then
objarg=$((arg+1))
break
fi
done
if test x$objarg = x ; then
echo 'Error: no -o on compiler command line' 1>&2
exit 1
fi
lo="${args@<:@$objarg@:>@}"
obj="${lo%.lo}"
if test x"$lo" = x"$obj" ; then
echo "Error: libtool object file name \"$lo\" does not end in .lo" 1>&2
exit 1
fi
objbase="${obj##*/}"
__DOLTCOMPILE__EOF__

dnl Write out shared compilation code.
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
libobjdir="${obj%$objbase}.libs"
if test ! -d "$libobjdir" ; then
mkdir_out="$(mkdir "$libobjdir" 2>&1)"
mkdir_ret=$?
if test "$mkdir_ret" -ne 0 && test ! -d "$libobjdir" ; then
echo "$mkdir_out" 1>&2
exit $mkdir_ret
fi
fi
pic_object="$libobjdir/$objbase.o"
args@<:@$objarg@:>@="$pic_object"
__DOLTCOMPILE__EOF__
cat <<__DOLTCOMPILE__EOF__ >>doltcompile
"\${args@<:@@@:>@}" $pic_options -DPIC || exit \$?
__DOLTCOMPILE__EOF__
fi

dnl Write out static compilation code.
dnl Avoid duplicate compiler output if also building shared objects.
if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
non_pic_object="$obj.o"
args@<:@$objarg@:>@="$non_pic_object"
__DOLTCOMPILE__EOF__
if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" >/dev/null 2>&1 || exit $?
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
"${args@<:@@@:>@}" || exit $?
__DOLTCOMPILE__EOF__
fi
fi

dnl Write out the code to write the .lo file.
dnl The second line of the .lo file must match "^# Generated by .*libtool"
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
{
echo "# $lo - a libtool object file"
echo "# Generated by doltcompile, not libtool"
__DOLTCOMPILE__EOF__

if test x$enable_shared = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "pic_object='.libs/${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo pic_object=none
__DOLTCOMPILE__EOF__
fi

if test x$enable_static = xyes; then
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo "non_pic_object='${objbase}.o'"
__DOLTCOMPILE__EOF__
else
cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
echo non_pic_object=none
__DOLTCOMPILE__EOF__
fi

cat <<'__DOLTCOMPILE__EOF__' >>doltcompile
} > "$lo"
__DOLTCOMPILE__EOF__

dnl Done writing out doltcompile; substitute it for libtool compilation.
chmod +x doltcompile
LTCOMPILE='$(top_builddir)/doltcompile $(COMPILE)'
LTCXXCOMPILE='$(top_builddir)/doltcompile $(CXXCOMPILE)'

dnl automake ignores LTCOMPILE and LTCXXCOMPILE when it has separate CFLAGS for
dnl a target, so write out a libtool wrapper to handle that case.
dnl Note that doltlibtool does not handle inferred tags or option arguments
dnl without '=', because automake does not use them.
cat <<__DOLTLIBTOOL__EOF__ > doltlibtool
#!$DOLT_BASH
__DOLTLIBTOOL__EOF__
cat <<'__DOLTLIBTOOL__EOF__' >>doltlibtool
top_builddir_slash="${0%%doltlibtool}"
: ${top_builddir_slash:=./}
args=()
modeok=false
tagok=false
for arg in "$[]@"; do
case "$arg" in
--mode=compile) modeok=true ;;
--tag=CC|--tag=CXX) tagok=true ;;
*) args@<:@${#args[@]}@:>@="$arg" ;;
esac
done
if $modeok && $tagok ; then
. ${top_builddir_slash}doltcompile "${args@<:@@@:>@}"
else
exec ${top_builddir_slash}libtool "$[]@"
fi
__DOLTLIBTOOL__EOF__

dnl Done writing out doltlibtool; substitute it for libtool.
chmod +x doltlibtool
LIBTOOL='$(top_builddir)/doltlibtool'
fi
AC_SUBST(LTCOMPILE)
AC_SUBST(LTCXXCOMPILE)
# end dolt
])
10 changes: 10 additions & 0 deletions build-aux/packages/debian/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source: @PACKAGE_NAME@
Section: Server
Priority: optional
Maintainer: @PACKAGE_AUTHOR@ <@PACKAGE_AUTHOR_EMAIL@>
Version: @PACKAGE_VERSION_API@
Package: @PACKAGE_NAME@
Architecture: any
Depends: @PACKAGE_REQUIRED_RUNTIME@
Description: @PACKAGE_DESCRIPTION_SHORT@
@PACKAGE_DESCRIPTION_LONG@
43 changes: 43 additions & 0 deletions cabrio.spec.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
%{?_with_noconfigure:%define exec_configure 0}
%{!?_with_noconfigure:%define exec_configure 1}

Summary: @PACKAGE_DESCRIPTION_SHORT@
Name: @PACKAGE_NAME@
Provides: @PACKAGE_NAME@
Version: @PACKAGE_VERSION_API@
Release: @PACKAGE_VERSION_MINOR_FIX@
License: GPL
Group: Server
Source0: %{name}-%{version}.tar.bz2
URL: @PACKAGE_URL@
Vendor: @PACKAGE_AUTHOR@ <@PACKAGE_AUTHOR_EMAIL@>
Packager: @PACKAGE_AUTHOR@ <@PACKAGE_AUTHOR_EMAIL@>
#BuildArch: i386
BuildRoot: %{_builddir}/%{name}-root
Requires: @PACKAGE_REQUIRED_RUNTIME@
BuildRequires: @PACKAGE_REQUIRED_BUILD@

%description
@PACKAGE_DESCRIPTION_LONG@

%prep
%setup -D -T -n %{name}-root

%build
%if %{exec_configure}
./configure --prefix=/usr
%endif
make

%install
make DESTDIR=%{buildroot} install

#%clean
#rm -rf %{buildroot}

%files
/
%defattr(-,root,root,-)
%doc
%changelog

182 changes: 182 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@

# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.80])
AC_INIT(cabrio, 01.00, https://groups.google.com/group/cabrio-fe-dev/)

AC_CONFIG_MACRO_DIR([build-aux/m4])
AC_CONFIG_AUX_DIR([build-aux])

LT_INIT([dlopen])

# find the libltdl sources in the libltdl sub-directory
LT_CONFIG_LTDL_DIR([build-aux/libltdl])

LTDL_INIT([recursive])

# Include DOLT, libtool faster compiler for something plataforms.
m4_include([build-aux/m4/dolt.m4])

# Inicialize DOLT
DOLT

AM_INIT_AUTOMAKE([1.11 subdir-objects parallel-tests color-tests silent-rules -Wall -Werror])

# Silent Build, sample:
# CXX ../cabrio/main.o
AM_SILENT_RULES([yes])


# Information about projet to build packages and the programs.
AC_SUBST([PACKAGE_NAME], ["cabrio"] )
AC_SUBST([PACKAGE_DESCRIPTION_SHORT], ["A graphical front end for emulators, specifically designed for use in arcade cabinets."] )
AC_SUBST([PACKAGE_DESCRIPTION_LONG], ["Cabrio is a graphical front end for emulators, specifically designed for use in arcade cabinets. It allows you to select games via an intuitive, attractive interface which is easy to use with limited controls, such as a joystick. Cabrio is made available under the GNU General Public License, meaning anyone can freely download the source code and even contribute to development."] )
AC_SUBST([PACKAGE_URL], ["http://www.cabrio-fe.org/"] )

AC_SUBST([PACKAGE_AUTHOR], ["Steve Maddison"] )
AC_SUBST([PACKAGE_AUTHOR_EMAIL], ["..."] )

AC_SUBST([PACKAGE_REQUIRED_BUILD], ["libavcodec-dev libavutil-dev libavformat-dev libglut3-dev libsdl1.2-dev libsdl-image1.2-dev libsdl-gfx1.2-dev libsdl-mixer1.2-dev libsdl-ttf2.0-dev libswscale-dev libxml2-dev zlib1g-dev"] )
AC_SUBST([PACKAGE_REQUIRED_RUNTIME], ["libavcodec libavutil libavformat libglut3 libsdl1.2 libsdl-image1.2 libsdl-gfx1.2 libsdl-mixer1.2 libsdl-ttf2.0 libswscale libxml2 zlib1g"] )

AC_SUBST([PACKAGE_VERSION_MAJOR], [0])
AC_SUBST([PACKAGE_VERSION_MINOR], [1])
AC_SUBST([PACKAGE_VERSION_MINOR_FIX], [0])

AC_SUBST([PACKAGE_VERSION_SO], [${PACKAGE_VERSION_MAJOR}:${PACKAGE_VERSION_MINOR}:${PACKAGE_VERSION_MINOR_FIX}])
AC_SUBST([PACKAGE_VERSION_API], [${PACKAGE_VERSION_MAJOR}.${PACKAGE_VERSION_MINOR}])


# Checks for programs.
AC_PROG_CXX
AC_PROG_CPP
AC_PROG_CC

# Checks for libraries.

# Checks for header files.
AC_CHECK_HEADERS([unistd.h])

AC_CHECK_HEADER([ltdl.h],
[AC_CHECK_LIB([ltdl],[lt_dladvise_init],
[LIBLTDL=-lltdl],
[LIBLTDL=])
],[
LIBLTDL=
])


# Checks for typedefs, structures, and compiler characteristics.
AC_HEADER_STDBOOL
AC_TYPE_SIZE_T

# Checks for library functions.
AC_CHECK_FUNCS([getcwd mkdir socket])


# Set --enable-debug flag.
# If not debug, silent make will be unset.
AC_MSG_CHECKING([Enable debug])
AC_ARG_ENABLE(
[debug],
AS_HELP_STRING([--enable-debug],[Turn on debugging]),
[
case "${enableval}" in
yes) debug=true;;
no) debug=false ;;
*)
AC_MSG_RESULT([${enableval}])
AC_MSG_ERROR([Bad value ${enableval} for --enable-debug])
;;
esac
],
[debug=false]
)
AM_CONDITIONAL([DEBUG], [test x$debug = xtrue])
AM_COND_IF([DEBUG],
[
CPPFLAGS="$CPPFLAGS -g -O0 -DDEBUG"
CFLAGS="$CFLAGS -g -O0 -DDEBUG"
LDFLAGS="$LDFLAGS -g -O0 -DDEBUG"
# Disable silent Build, sample:
# CXX ../cabrio/main.o
AM_SILENT_RULES([no])
AC_MSG_RESULT([enable])
],[
CPPFLAGS="$CPPFLAGS -DNDEBUG"
CFLAGS="$CFLAGS -DNDEBUG"
LDFLAGS="$LDFLAGS -DNDEBUG"
AC_MSG_RESULT([not enable flags])
])

dnl ---------------------------------------------------------------------------
dnl Turn on (almost) all warnings when using gcc
dnl ---------------------------------------------------------------------------
if test "x$GCC" = "xyes"; then
CPPFLAGS="$CPPFLAGS -Wall"
## CFLAGS="$CFLAGS --std=c99 -Wall -Wextra -Werror -pedantic"
CFLAGS="$CFLAGS -Wall"
## CFLAGS="$CFLAGS -Wno-pointer-sign -Wno-unused -Wno-sign-compare"
#CFLAGS="$CFLAGS -Wmissing-declarations -Wmissing-prototypes"
LDFLAGS="$LDFLAGS -Wall"
AC_SUBST([NO_UNUSED_CFLAGS], [-Wno-unused])
fi

# Search for dlopen dep.
AC_SEARCH_LIBS([dlopen], [dl dld], [],
[
AC_MSG_ERROR([unable to find the dlopen() function]
)
])

# Workaroud to show some vars.
abs_builddir=`pwd`
abs_top_builddir=`pwd`
cd $srcdir

abs_srcdir=`pwd`
abs_top_srcdir=`pwd`
cd $abs_builddir

# Check and expand install path vars.
if test "x${prefix}" = "xNONE"; then
prefix="${ac_default_prefix}"
fi
if test "x${exec_prefix}" = "xNONE"; then
exec_prefix="${prefix}"
fi
AC_DEFINE_UNQUOTED([PREFIX], "$(eval echo ${prefix})", [Install prefix directory.])
AC_DEFINE_UNQUOTED([EXEC_PREFIX], ["$(eval echo $exec_prefix)"], [Exec-prefix directory.])
AC_DEFINE_UNQUOTED([LIBDIR], ["$(eval eval echo $libdir)"], [Library directory.] )
AC_SUBST( libdir, ["$(eval eval echo $libdir)"])
AC_SUBST( includedir, ["$(eval eval echo $includedir)"])
AS_IF([ test "x$pkgsrvdir" = "x" -o "x$pkgsrvdir" = "xNONE" -o "x$pkgsrvdir" = "xnone" ],[
AC_SUBST( pkgsrvdir, ["$(eval eval echo $localstatedir)/${PACKAGE_NAME}-${PACKAGE_VERSION_MAJOR}"])
])



# Add required deps for linker
# Add required deps for compiler
# Add source code include dir for make. The builddir is add here for de case
# of build in another dir, because the *.in files is generate in the builddir.
CPPFLAGS="$CPPFLAGS -I${abs_top_srcdir}/src"
CFLAGS="$CFLAGS -I${abs_top_srcdir}/src"

CPPFLAGS="$CPPFLAGS -I${abs_top_builddir}/src"
CFLAGS="$CFLAGS -I${abs_top_builddir}/src"

# Override the template file name of the generated .pc file, so that there
# is no need to rename the template file when the API version changes.
AC_CONFIG_FILES([
Makefile src/Makefile test/Makefile
src/config.hpp
packages/debian/control
cabrio.spec
])

AC_CONFIG_HEADERS([config.h])

AC_OUTPUT

10 changes: 10 additions & 0 deletions packages/debian/control.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source: @PACKAGE_NAME@
Section: Server
Priority: optional
Maintainer: @PACKAGE_AUTHOR@ <@PACKAGE_AUTHOR_EMAIL@>
Version: @PACKAGE_VERSION_API@
Package: @PACKAGE_NAME@
Architecture: any
Depends: @PACKAGE_REQUIRED_RUNTIME@
Description: @PACKAGE_DESCRIPTION_SHORT@
@PACKAGE_DESCRIPTION_LONG@
22 changes: 22 additions & 0 deletions src/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}

AUTOMAKE_OPTIONS=subdir-objects -Wall -Werror

# The name of program appended the version string.
bin_PROGRAMS = cabrio-@PACKAGE_VERSION_API@

## Define the source file list for the "@PACKAGE_NAME@-@PACKAGE_VERSION_API@"
## target. Note that @PACKAGE_VERSION_API@ is not interpreted by Automake and
## will therefore be treated as if it were literally part of the target name,
## and the variable name derived from that.
## Note that it is not necessary to list header files
## which are already listed elsewhere in a _HEADERS variable assignment.
cabrio_@PACKAGE_VERSION_API@_SOURCES = bg.c config.c emulator.c focus.c \
frame.c game_sel.c key.c lookup.c media.c ogl.c platform.c sdl_wrapper.c \
snap.c submenu.c category.c control.c event.c font.c game.c hint.c \
location.c menu.c packet.c sdl_ogl.c setup.c sound.c video.c main.c


File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
17 changes: 17 additions & 0 deletions test/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
## Additional flags to pass to aclocal when it is invoked automatically at
## make time. The ${ACLOCAL_FLAGS} variable is picked up from the environment
## to provide a way for the user to supply additional arguments.
ACLOCAL_AMFLAGS = ${ACLOCAL_FLAGS}

AUTOMAKE_OPTIONS = subdir-objects parallel-tests -Wall -Werror

#AM_LDFLAGS = -lboost_unit_test_framework $(abs_top_builddir)/src/cabrio-@PACKAGE_VERSION_MAJOR@.la

TESTS = debug.build default_flags_to_configure.build rpm.build simple.build \
deb.build

XFAIL_TESTS = deb.build

TEST_EXTENSIONS = .build
BUILD_LOG_COMPILER = $(SHELL) $(abs_top_srcdir)/test/build_script $(abs_top_srcdir) $(abs_top_builddir)

73 changes: 73 additions & 0 deletions test/build_script
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
#!/bin/sh -e

export abs_top_srcdir="${1}"
export abs_top_builddir="${2}"

shift
shift

get_option() {
while read OPT_NAME OPT_ARG ; do
if [ "x${OPT_NAME}" = "x${1}" ] ; then
echo "${OPT_ARG}"
return 0;
fi
done <"$2"
}

MAKE_OPTIONS="` get_option make "$1" `"
CONFIGURE_OPTIONS="` get_option configure "$1" `"
INSTALL_OPTIONS="` get_option install "$1" `"

echo "[BUILD] Testing build for $1 ..."
TEMP_DIR=` if [ "${abs_top_builddir}" != "${abs_top_srcdir}" ] ; then
mktemp -d -p \`pwd\`
else
mktemp -d
fi
`
(
cp -rf "${abs_top_srcdir}"/* "${TEMP_DIR}"/
cd "${TEMP_DIR}"/
make clean
make distclean
rm -rf "${TEMP_DIR}"/config.status
)

(
cd "${TEMP_DIR}"

echo "[BUILD] Testing build for $1 : ./configure ${CONFIGURE_OPTIONS}"
./configure ${CONFIGURE_OPTIONS} || exit 1
echo "[BUILD] Testing build for $1 : make ${MAKE_OPTIONS}"
make ${MAKE_OPTIONS} || exit 1

rm -rf "${TEMP_DIR}" config.status
)

echo "[BUILD] Testing shadow build for $1 ..."
TEMP_DIR2=` if [ "${abs_top_builddir}" != "${abs_top_srcdir}" ] ; then
mktemp -d -p \`pwd\`
else
mktemp -d
fi
`
(
cp -rf "${abs_top_srcdir}"/ "${TEMP_DIR}"/
cd "${TEMP_DIR}"/
make clean
make distclean
rm -rf "${TEMP_DIR}"/config.status
)

(
cd "${TEMP_DIR2}"

echo "[BUILD] Testing shadow build for $1 : ${TEMP_DIR}/configure ${CONFIGURE_OPTIONS}"
"${TEMP_DIR}/configure" ${CONFIGURE_OPTIONS} || exit 1
echo "[BUILD] Testing shadow build for $1 : make ${MAKE_OPTIONS}"
make ${MAKE_OPTIONS} || exit 1

rm -rf "${TEMP_DIR}" "${TEMP_DIR2}"
)

3 changes: 3 additions & 0 deletions test/deb.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test creation of rpm package with make
configure --enable-debug
make pkg-deb
1 change: 1 addition & 0 deletions test/debug.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
configure --enable-debug
4 changes: 4 additions & 0 deletions test/default_flags_to_configure.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# Build with default arguments for the configure
# this args are generate by autotools
configure --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc/cabrio --bindir=/usr/bin --sbindir=/usr/sbin --libexecdir=/usr/libexec --sharedstatedir=/usr/com --localstatedir=/var --libdir=/usr/lib --includedir=/usr/include --oldincludedir=/usr/include --datarootdir=/usr/share --datadir=/usr/share --infodir=/usr/share/info --localedir=/usr/share/locale --mandir=/usr/share/man --docdir=/usr/share/doc/cabrio --htmldir=/usr/share/doc/cabrio --dvidir=/usr/share/doc/cabrio --pdfdir=/usr/share/doc/cabrio --psdir=/usr/share/doc/cabrio

3 changes: 3 additions & 0 deletions test/rpm.build
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Test creation of rpm package with make
configure --enable-debug
make pkg-rpm
1 change: 1 addition & 0 deletions test/simple.build
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Simple build with default flags