1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
$ cat debhello-1.6/configure.ac
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ([2.69])
AC_INIT([debhello],[2.1],[foo@example.org])
AC_CONFIG_SRCDIR([src/hello.c])
AC_CONFIG_HEADERS([config.h])
echo "Standard customization chores"
AC_CONFIG_AUX_DIR([build-aux])
AM_INIT_AUTOMAKE([foreign])
# Add #define PACKAGE_AUTHOR ... in config.h with a comment
AC_DEFINE(PACKAGE_AUTHOR, ["Osamu Aoki"], [Define PACKAGE_AUTHOR])
echo "Add --with-math option functionality to ./configure"
AC_ARG_WITH([math],
[AS_HELP_STRING([--with-math],
[compile with math library @<:@default=yes@:>@])],
[],
[with_math="yes"]
)
echo "==== withval := \"$withval\""
echo "==== with_math := \"$with_math\""
# m4sh if-else construct
AS_IF([test "x$with_math" != "xno"],[
echo "==== Check include: math.h"
AC_CHECK_HEADER(math.h,[],[
AC_MSG_ERROR([Couldn't find math.h.] )
])
echo "==== Check library: libm"
AC_SEARCH_LIBS(atan, [m])
#AC_CHECK_LIB(m, atan)
echo "==== Build with LIBS := \"$LIBS\""
AC_DEFINE(WITH_MATH, [1], [Build with the math library])
],[
echo "==== Skip building with math.h."
AH_TEMPLATE(WITH_MATH, [Build without the math library])
])
# Checks for programs.
AC_PROG_CC
AC_CONFIG_FILES([Makefile
man/Makefile
src/Makefile])
AC_OUTPUT
|