Updated build system as per Ralf's suggestions to Chapter 9 in Autotools book.
git-svn-id: https://svn.code.sf.net/p/flaim/code/trunk@1108 0109f412-320b-0410-ab79-c3e0c5ffbbe6
This commit is contained in:
@@ -10,16 +10,13 @@ SUBDIRS = src util obs $(DOXYDIR)
|
||||
|
||||
doc_DATA = AUTHORS ChangeLog COPYING INSTALL NEWS README
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libflaimtk.pc
|
||||
|
||||
RPM = rpm
|
||||
|
||||
rpms srcrpm: dist
|
||||
(cd obs && $(MAKE) $(AM_MAKEFLAGS) $@) || exit 1
|
||||
rpmarch=`$(RPM) --showrc | grep "^build arch" | sed 's/\(.*: \)\(.*\)/\2/'`; \
|
||||
test -z "$$rpmarch" || ( mv $$rpmarch/* . && rm -rf $$rpmarch )
|
||||
rm -rf $(distdir)
|
||||
test -z "obs/$$rpmarch" || ( mv obs/$$rpmarch/* . && rm -rf obs/$$rpmarch )
|
||||
rm -rf obs/$(distdir)
|
||||
|
||||
dist-hook:
|
||||
rm -rf `find $(distdir) -name .svn`
|
||||
|
||||
@@ -18,7 +18,7 @@ AC_PROG_CXX
|
||||
AC_PROG_INSTALL
|
||||
|
||||
# Checks for optional programs.
|
||||
AC_PROG_TRY_DOXYGEN
|
||||
FLM_PROG_TRY_DOXYGEN
|
||||
|
||||
# Configure options: --enable-debug[=no].
|
||||
AC_ARG_ENABLE([debug],
|
||||
@@ -110,29 +110,34 @@ gcc_opt_flags="-O -foptimize-sibling-calls
|
||||
case $host in
|
||||
sparc-*-solaris*)
|
||||
LDFLAGS="$LDFLAGS -R /usr/lib/lwp"
|
||||
if "x$CXX" != "xg++"; then
|
||||
if "x$debug" = xno; then
|
||||
CXXFLAGS="$CXXFLAGS -xO3"
|
||||
fi
|
||||
SUN_STUDIO_COMPILER=`"$CXX" -V | grep "Sun C++"`
|
||||
if "x$SUN_STUDIO_COMPILER" = "xSun C++"; then
|
||||
CXXFLAGS="$CXXFLAGS -errwarn=%all -errtags -erroff=hidef,inllargeuse,doubunder"
|
||||
fi
|
||||
fi ;;
|
||||
case $CXX in
|
||||
*g++*) ;;
|
||||
*)
|
||||
if "x$debug" = xno; then
|
||||
CXXFLAGS="$CXXFLAGS -xO3"
|
||||
fi
|
||||
SUN_STUDIO_COMPILER=`$CXX -V | grep "Sun C++"`
|
||||
if "x$SUN_STUDIO_COMPILER" = "xSun C++"; then
|
||||
CXXFLAGS="$CXXFLAGS -errwarn=%all -errtags -erroff=hidef,inllargeuse,doubunder"
|
||||
fi ;;
|
||||
esac ;;
|
||||
|
||||
*-apple-darwin*)
|
||||
AC_DEFINE([OSX], [1], [Define if building on Apple OSX.]) ;;
|
||||
|
||||
*-*-aix*)
|
||||
if "x$CXX" != "xg++"; then
|
||||
CXXFLAGS="$CXXFLAGS -qstrict"
|
||||
fi ;;
|
||||
case $CXX in
|
||||
*g++*) ;;
|
||||
*) CXXFLAGS="$CXXFLAGS -qstrict" ;;
|
||||
esac ;;
|
||||
|
||||
*-*-hpux*)
|
||||
if "x$CXX" != "xg++"; then
|
||||
# Disable "Placement operator delete invocation is not yet implemented" warning
|
||||
CXXFLAGS="$CXXFLAGS +W930"
|
||||
fi ;;
|
||||
case $CXX in
|
||||
*g++*) ;;
|
||||
*)
|
||||
# Disable "Placement operator delete invocation is not yet implemented" warning
|
||||
CXXFLAGS="$CXXFLAGS +W930" ;;
|
||||
esac ;;
|
||||
esac
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
@@ -141,7 +146,7 @@ AC_CONFIG_FILES([Makefile
|
||||
obs/flaimtk.spec
|
||||
src/Makefile
|
||||
util/Makefile
|
||||
libflaimtk.pc])
|
||||
src/libflaimtk.pc])
|
||||
|
||||
AC_OUTPUT
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# AC_PROG_TRY_DOXYGEN(["quiet"])
|
||||
# FLM_PROG_TRY_DOXYGEN(["quiet"])
|
||||
# ------------------------------
|
||||
# AC_PROG_TRY_DOXYGEN tests for an existing doxygen source
|
||||
# FLM_PROG_TRY_DOXYGEN tests for an existing doxygen source
|
||||
# documentation program. It sets or uses the environment
|
||||
# variable DOXYGEN.
|
||||
#
|
||||
@@ -19,7 +19,7 @@
|
||||
# Modified: 2009-04-27
|
||||
# License: AllPermissive
|
||||
#
|
||||
AC_DEFUN([AC_PROG_TRY_DOXYGEN],
|
||||
AC_DEFUN([FLM_PROG_TRY_DOXYGEN],
|
||||
[AC_REQUIRE([AC_EXEEXT])dnl
|
||||
AC_ARG_VAR([DOXYGEN], [Doxygen source doc generation program])dnl
|
||||
AC_CHECK_PROGS([DOXYGEN], [doxygen$EXEEXT])
|
||||
@@ -27,4 +27,4 @@ ifelse([$1],,
|
||||
[if test -z "$DOXYGEN"; then
|
||||
AC_MSG_WARN([Doxygen program not found - continuing without Doxygen])
|
||||
fi], [$1], [quiet],, [m4_fatal([Invalid option '$1' in $0])])
|
||||
])# AC_PROG_TRY_DOXYGEN
|
||||
])# FLM_PROG_TRY_DOXYGEN
|
||||
@@ -1,25 +1,26 @@
|
||||
rpmspec = $(PACKAGE_TARNAME).spec
|
||||
|
||||
rpmmacros =\
|
||||
--define='_rpmdir $(PWD)/..'\
|
||||
--define='_srcrpmdir $(PWD)/..'\
|
||||
--define='_sourcedir $(PWD)/..'\
|
||||
--define='_specdir $(PWD)/..'\
|
||||
--define='_builddir $(PWD)/..'
|
||||
--define="_rpmdir $${PWD}"\
|
||||
--define="_srcrpmdir $${PWD}"\
|
||||
--define="_sourcedir $${PWD}/.."\
|
||||
--define="_specdir $${PWD}"\
|
||||
--define="_builddir $${PWD}"
|
||||
|
||||
rpmopts = --nodeps --buildroot='$(PWD)/_rpm'
|
||||
RPMBUILD = rpmbuild
|
||||
RPMFLAGS = --nodeps --buildroot="$${PWD}/_rpm"
|
||||
|
||||
rpmcheck:
|
||||
@which rpmbuild &> /dev/null; \
|
||||
if [ $$? -ne 0 ]; then \
|
||||
if [ which rpmbuild &> /dev/null ]; then \
|
||||
echo "*** This make target requires an rpm-based linux distribution."; \
|
||||
(exit 1); exit 1; \
|
||||
fi
|
||||
|
||||
srcrpm: rpmcheck $(rpmspec)
|
||||
rpmbuild -bs $(rpmmacros) $(rpmopts) $(rpmspec)
|
||||
$(RPMBUILD) $(RPMFLAGS) -bs $(rpmmacros) $(rpmspec)
|
||||
|
||||
rpms: rpmcheck $(rpmspec)
|
||||
rpmbuild -ba $(rpmmacros) $(rpmopts) $(rpmspec)
|
||||
$(RPMBUILD) $(RPMFLAGS) -ba $(rpmmacros) $(rpmspec)
|
||||
|
||||
.PHONY: rpmcheck srcrpm rpms
|
||||
|
||||
|
||||
@@ -3,6 +3,9 @@ EXTRA_DIST = ftknlm.h
|
||||
lib_LTLIBRARIES = libflaimtk.la
|
||||
include_HEADERS = flaimtk.h
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
pkgconfig_DATA = libflaimtk.pc
|
||||
|
||||
libflaimtk_la_SOURCES = \
|
||||
ftkarg.cpp \
|
||||
ftkbtree.cpp \
|
||||
|
||||
Reference in New Issue
Block a user