Blame configure.ac

rpm-build 8267b0
# -*- Autoconf -*-
rpm-build 8267b0
dnl Process this file with autoconf to produce a configure script.
rpm-build 8267b0
rpm-build 8267b0
# Copyright (C) 2013, by Joe Da Silva
rpm-build 8267b0
rpm-build 8267b0
AC_PREREQ([2.61])
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# PackageTimestamp version
rpm-build 8267b0
m4_define([spiro_package_stamp], [20150131])
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Making point releases:
rpm-build 8267b0
#   spiro_major_version += 0;
rpm-build 8267b0
#   spiro_minor_version += 1; (patches or added function(s))
rpm-build 8267b0
#
rpm-build 8267b0
# If any new functions have been added:
rpm-build 8267b0
#   spiro_major_version += 0;
rpm-build 8267b0
#   spiro_minor_version += 1; (added function(s))
rpm-build 8267b0
#
rpm-build 8267b0
# If backwards compatibility has been broken:
rpm-build 8267b0
#   spiro_major_version += 1;
rpm-build 8267b0
#   spiro_minor_version = 0;
rpm-build 8267b0
#
rpm-build 8267b0
m4_define([spiro_major_version], [0])
rpm-build 8267b0
m4_define([spiro_minor_version], [3])
rpm-build 8267b0
m4_define([spiro_version],
rpm-build 8267b0
          [spiro_major_version.spiro_minor_version.spiro_package_stamp])
rpm-build 8267b0
m4_define([spiro_info],
rpm-build 8267b0
          [spiro_major_version:spiro_minor_version:0])
rpm-build 8267b0
m4_define([spiro_package_name], [libspiro])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
AC_INIT([spiro],[spiro_version],[fontforge-devel@lists.sourceforge.net],
rpm-build 8267b0
	[spiro_package_name],[https://github.com/fontforge/libspiro])
rpm-build 8267b0
AC_CONFIG_SRCDIR([spiro.c])
rpm-build 8267b0
AM_INIT_AUTOMAKE([foreign -Wall])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
AC_CONFIG_MACRO_DIR([m4])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# automake 1.12 seems to require AM_PROG_AR,
rpm-build 8267b0
# but automake 1.11 doesn't recognize it.
rpm-build 8267b0
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
rpm-build 8267b0
rpm-build 8267b0
LT_INIT
rpm-build 8267b0
AC_SUBST(LIBTOOL_DEPS)
rpm-build 8267b0
rpm-build 8267b0
AC_PROG_CC
rpm-build 8267b0
AC_PROG_INSTALL
rpm-build 8267b0
AC_ENABLE_SHARED
rpm-build 8267b0
AC_PROG_LN_S
rpm-build 8267b0
AC_PROG_MKDIR_P
rpm-build 8267b0
AC_PROG_MAKE_SET
rpm-build 8267b0
AC_PROG_SED
rpm-build 8267b0
AC_CONFIG_HEADERS([spiro-config.h])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Indicate this is a release build and that
rpm-build 8267b0
# dependancies for changes between Makefile.am
rpm-build 8267b0
# and Makefile.in should not be checked. This
rpm-build 8267b0
# makes compiling faster. If you are working
rpm-build 8267b0
# on the library, run:
rpm-build 8267b0
# ./configure --enable-maintainer-mode
rpm-build 8267b0
# to enable the dependancies
rpm-build 8267b0
dnl AM_MAINTAINER_MODE([enable])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Enable silent build rules by default, this
rpm-build 8267b0
# requires atleast Automake-1.11. Disable by
rpm-build 8267b0
# either passing --disable-silent-rules to
rpm-build 8267b0
# configure or passing V=1 to make
rpm-build 8267b0
m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])],[AC_SUBST([AM_DEFAULT_VERBOSITY],[1])])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Check for libraries
rpm-build 8267b0
AC_SEARCH_LIBS([cos],[m])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Check for finite or isfinite. Use one.
rpm-build 8267b0
AC_CHECK_FUNCS(finite, ,[
rpm-build 8267b0
  AC_MSG_CHECKING(for finite in <math.h>)
rpm-build 8267b0
  AC_LINK_IFELSE(
rpm-build 8267b0
    [AC_LANG_PROGRAM([[#include <math.h>]],[[double f = 0.0; finite(f)]])],
rpm-build 8267b0
    [AC_DEFINE([HAVE_FINITE],[1],[Define to 1 if you have the finite function.])
rpm-build 8267b0
     AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)
rpm-build 8267b0
     AC_MSG_CHECKING(for isfinite in <math.h>)
rpm-build 8267b0
     AC_LINK_IFELSE(
rpm-build 8267b0
       [AC_LANG_PROGRAM([[#include <math.h>]],[[float f = 0.0; isfinite(f)]])],
rpm-build 8267b0
       [AC_DEFINE([HAVE_ISFINITE],[1],[Define to 1 if you have the isfinite function.])
rpm-build 8267b0
	AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)])])])
rpm-build 8267b0
AC_SUBST(HAVE_FINITE)
rpm-build 8267b0
AC_SUBST(HAVE_ISFINITE)
rpm-build 8267b0
AH_BOTTOM([/* Define IS_FINITE(x) to finite(x) or isfinite(x) */
rpm-build 8267b0
#ifdef HAVE_FINITE
rpm-build 8267b0
#define IS_FINITE(x) finite(x)
rpm-build 8267b0
#else
rpm-build 8267b0
#define IS_FINITE(x) isfinite(x)
rpm-build 8267b0
#endif])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Enable VERBOSE flag in library
rpm-build 8267b0
AC_ARG_ENABLE([verbose_lib],AS_HELP_STRING([--enable-verbose_lib],[Verbose library output (for debugging).]),
rpm-build 8267b0
  [case "${enableval}" in
rpm-build 8267b0
    yes) verbose_lib=true ;;
rpm-build 8267b0
    no)  verbose_lib=false ;;
rpm-build 8267b0
    *) AC_MSG_ERROR([bad value ${enableval} for --enable-verbose_lib]) ;;
rpm-build 8267b0
   esac],[verbose_lib=false])
rpm-build 8267b0
if test x"${verbose_lib}" = xtrue; then
rpm-build 8267b0
   AC_DEFINE(VERBOSE,[1],[Verbose library printf() output enabled for debugging.])
rpm-build 8267b0
fi
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Enable input CHECK_INPUT_FINITENESS flag
rpm-build 8267b0
AC_ARG_ENABLE([test_inputs],AS_HELP_STRING([--enable-test_inputs],[Test input values for finiteness.]),
rpm-build 8267b0
  [case "${enableval}" in
rpm-build 8267b0
    yes) test_inputs=true ;;
rpm-build 8267b0
    no)  test_inputs=false ;;
rpm-build 8267b0
    *) AC_MSG_ERROR([bad value ${enableval} for --enable-test_inputs]) ;;
rpm-build 8267b0
   esac],[test_inputs=false])
rpm-build 8267b0
if test x"${test_inputs}" = xtrue; then
rpm-build 8267b0
   AC_DEFINE(CHECK_INPUT_FINITENESS,[1],[Check if input values are realistic and not infinite in value.])
rpm-build 8267b0
fi
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# call-test uses pthread for testing (if you
rpm-build 8267b0
# have it), but libspiro doesn't require it.
rpm-build 8267b0
AC_CHECK_HEADERS(pthread.h,[havepthreads=true]
rpm-build 8267b0
  AC_DEFINE(HAVE_PTHREADS,[1],[Have pthreads.h. Do multi-user check in call-test.]),
rpm-build 8267b0
  [have_pthreads = xfalse])
rpm-build 8267b0
AM_CONDITIONAL([WANTPTHREADS],[test x$havepthreads = xtrue])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Platform specific stuff ($host)
rpm-build 8267b0
AC_CANONICAL_HOST
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Pass variables to MAKEFILE.AM
rpm-build 8267b0
AC_SUBST(HOST,[host])
rpm-build 8267b0
AC_SUBST(LIBSPIRO_VERSION,[spiro_info])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Check for and add usable compiler warnings
rpm-build 8267b0
AC_LANG_PUSH([C])
rpm-build 8267b0
AC_SUBST([WCFLAGS],[])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wall],[WCFLAGS+=" -Wall"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wextra],[WCFLAGS+=" -Wextra"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wcast-align],[WCFLAGS+=" -Wcast-align"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wbad-function-cast],[WCFLAGS+=" -Wbad-function-cast"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wc++-compat],[WCFLAGS+=" -Wc++-compat"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wmissing-prototypes],[WCFLAGS+=" -Wmissing-prototypes"])
rpm-build 8267b0
AX_CHECK_COMPILE_FLAG([-Wunused],[WCFLAGS+=" -Wunused"])
rpm-build 8267b0
AC_LANG_POP
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
# Put ifdef wrapper around spiro-config.h so
rpm-build 8267b0
# that we don't accidently call it twice.
rpm-build 8267b0
AH_TOP([#ifndef _SPIRO_CONFIG_H
rpm-build 8267b0
#define _SPIRO_CONFIG_H 1])
rpm-build 8267b0
AH_BOTTOM([#endif])
rpm-build 8267b0
rpm-build 8267b0
#-------------------------------------------
rpm-build 8267b0
AC_PROG_LIBTOOL
rpm-build 8267b0
rpm-build 8267b0
AC_CONFIG_FILES([
rpm-build 8267b0
Makefile
rpm-build 8267b0
tests/Makefile
rpm-build 8267b0
libspiro.pc
rpm-build 8267b0
])
rpm-build 8267b0
rpm-build 8267b0
AC_OUTPUT