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...
This commit is contained in:
Adam Sampson 2008-05-07 13:06:27 +00:00
parent 7567e5e499
commit 441b2ee344
5 changed files with 17 additions and 21 deletions

View File

@ -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

View File

@ -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

8
config/Paths.hs.in Normal file
View File

@ -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@@"

View File

@ -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

View File

@ -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