From 441b2ee34463e905af5571c18407059f3df3eaec Mon Sep 17 00:00:00 2001 From: Adam Sampson Date: Wed, 7 May 2008 13:06:27 +0000 Subject: [PATCH] Do away with the pkgconfig file in favour of another generated module. Paths.hs is now generated by the Makefile.am, so it can include paths. As a bonus, this actually works, since we weren't previously installing the .pc file anywhere... --- Makefile.am | 5 +++++ config/CompilerCommands.hs.in | 8 +++----- config/Paths.hs.in | 8 ++++++++ configure.ac | 2 +- tock-1.0.pc.in | 15 --------------- 5 files changed, 17 insertions(+), 21 deletions(-) create mode 100644 config/Paths.hs.in delete mode 100644 tock-1.0.pc.in diff --git a/Makefile.am b/Makefile.am index f449b67..e997b93 100644 --- a/Makefile.am +++ b/Makefile.am @@ -76,7 +76,12 @@ data/TagAST.hs: GenTagAST$(EXEEXT) data/OrdAST.hs: GenOrdAST$(EXEEXT) ./GenOrdAST$(EXEEXT) > data/OrdAST.hs +config/Paths.hs: config/Paths.hs.in + @sed -e 's,@@pkgincludedir@@,$(pkgincludedir),g' \ + config/Paths.hs.in >config/Paths.hs + config_sources = config/CompilerCommands.hs +config_sources += config/Paths.hs config_sources += config/TypeSizes.hs BUILT_SOURCES = data/OrdAST.hs diff --git a/config/CompilerCommands.hs.in b/config/CompilerCommands.hs.in index 8bc5aa0..8352956 100644 --- a/config/CompilerCommands.hs.in +++ b/config/CompilerCommands.hs.in @@ -3,12 +3,10 @@ module CompilerCommands where import Data.List --- Because we can't know for sure yet where Tock will be installed, --- we must include this pkg-config call to be executed each time --- to find out where our headers live. Suggestions for a better way --- are welcome. +import Paths + tockIncludeFlags :: String -tockIncludeFlags = "`pkg-config --cflags tock-1.0`" +tockIncludeFlags = "-I" ++ pkgIncludeDir cCommand :: String -> String -> String cCommand inp out = "@CC@ @TOCK_CFLAGS@ " ++ tockIncludeFlags ++ " -c -o " ++ out ++ " " ++ inp diff --git a/config/Paths.hs.in b/config/Paths.hs.in new file mode 100644 index 0000000..1ffbc20 --- /dev/null +++ b/config/Paths.hs.in @@ -0,0 +1,8 @@ +-- | Installation path information for Tock. +-- This module is auto-generated by Makefile.am from Paths.hs.in. +-- (It can't be generated by autoconf, because you can't expand paths in a +-- configure script.) +module Paths where + +pkgIncludeDir :: String +pkgIncludeDir = "@@pkgincludedir@@" diff --git a/configure.ac b/configure.ac index 7a68fe7..b639b5b 100644 --- a/configure.ac +++ b/configure.ac @@ -169,5 +169,5 @@ AC_SUBST(ccsp_available) AC_SUBST(cppcsp_available) AC_SUBST(MKDIR_P) -AC_CONFIG_FILES([Makefile config/TypeSizes.hs config/CompilerCommands.hs tock-1.0.pc]) +AC_CONFIG_FILES([Makefile config/TypeSizes.hs config/CompilerCommands.hs]) AC_OUTPUT diff --git a/tock-1.0.pc.in b/tock-1.0.pc.in deleted file mode 100644 index 441dad7..0000000 --- a/tock-1.0.pc.in +++ /dev/null @@ -1,15 +0,0 @@ -prefix=@prefix@ -exec_prefix=@exec_prefix@ -libdir=@libdir@ -includedir=@includedir@ -pkgincludedir=${includedir}/@PACKAGE@ - -Name: Tock -Description: A compiler for concurrent languages -Requires: -Version: @VERSION@ -Libs: -Cflags: -I${pkgincludedir} -URL: https://www.cs.kent.ac.uk/research/groups/sys/wiki/Tock - -