From b87dbee02fa1965ac261d6586813089effee3199 Mon Sep 17 00:00:00 2001 From: Nick Bowler Date: Thu, 19 Nov 2009 11:23:33 -0500 Subject: [PATCH] build: Add an autoconf configure script to determine CFLAGS. --- .gitignore | 4 ++++ Setup.lhs | 2 +- altfloat.buildinfo.in | 1 + configure.ac | 24 ++++++++++++++++++++++++ 4 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 altfloat.buildinfo.in create mode 100644 configure.ac diff --git a/.gitignore b/.gitignore index c17082e..65fc6d8 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,7 @@ *.o *.hi dist +altfloat.buildinfo +autom4te.cache +configure +config.* diff --git a/Setup.lhs b/Setup.lhs index 3eb981e..9ff7fa8 100755 --- a/Setup.lhs +++ b/Setup.lhs @@ -1,4 +1,4 @@ #!/usr/bin/env runhaskell > import Distribution.Simple -> main = defaultMain +> main = defaultMainWithHooks autoconfUserHooks diff --git a/altfloat.buildinfo.in b/altfloat.buildinfo.in new file mode 100644 index 0000000..50a4ee9 --- /dev/null +++ b/altfloat.buildinfo.in @@ -0,0 +1 @@ +CC-Options: @CC_OPTS@ @CFLAGS@ diff --git a/configure.ac b/configure.ac new file mode 100644 index 0000000..61012c4 --- /dev/null +++ b/configure.ac @@ -0,0 +1,24 @@ +dnl Copyright (C) 2009 Nick Bowler +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. This file is offered as-is, +dnl without any warranty. + +AC_PREREQ(2.62) +AC_INIT([altfloat],[0.1],[nbowler@draconx.ca]) +AC_CONFIG_SRCDIR([altfloat.cabal]) + +dnl We don't actually care, but this shuts up the warning. +AC_ARG_WITH([compiler], [AS_HELP_STRING([--with-compiler], + [specify which Haskell compiler to use])]) + +AC_PROG_CC_C99 + +dnl Cabal won't let us specify the C compiler, so we need this hack. +CC_OPTS=`echo $CC | sed 's/@<:@^@<:@:space:@:>@@:>@*//'` +AC_SUBST([CC_OPTS]) + +AC_CONFIG_FILES([ + altfloat.buildinfo +]) +AC_OUTPUT -- 2.11.4.GIT