From 2df8f5306a770b5691a77f50f084f571ca560eb1 Mon Sep 17 00:00:00 2001 From: "Jose A. Lopes" Date: Tue, 5 Nov 2013 20:30:26 +0100 Subject: [PATCH] Add 'AF_INET*' constants to Haskell's 'AutoConf' Add 'AF_INET*' constants to the Haskell 'AutoConf' module, which requires extending the 'm4' invocation with additional substitutions, in the 'Makefile' target for 'src/AutoConf.hs'. Signed-off-by: Jose A. Lopes Reviewed-by: Klaus Aehlig --- Makefile.am | 6 +++++- src/AutoConf.hs.in | 6 ++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/Makefile.am b/Makefile.am index 85739da39..3b1bee038 100644 --- a/Makefile.am +++ b/Makefile.am @@ -37,6 +37,7 @@ CHECK_IMPORTS = $(top_srcdir)/autotools/check-imports DOCPP = $(top_srcdir)/autotools/docpp REPLACE_VARS_SED = autotools/replace_vars.sed CONVERT_CONSTANTS = $(top_srcdir)/autotools/convert-constants +PRINT_PY_CONSTANTS = $(top_srcdir)/autotools/print-py-constants BUILD_RPC = $(top_srcdir)/autotools/build-rpc SHELL_ENV_INIT = autotools/shell-env-init @@ -1785,7 +1786,8 @@ lib/_constants.py: Makefile lib/_constants.py.in src/hs2py-constants \ lib/constants.py: lib/_constants.py -src/AutoConf.hs: Makefile src/AutoConf.hs.in | stamp-directories +src/AutoConf.hs: Makefile src/AutoConf.hs.in $(PRINT_PY_CONSTANTS) \ + | $(built_base_sources) @echo "m4 ... >" $@ @m4 -DPACKAGE_VERSION="$(PACKAGE_VERSION)" \ -DVERSION_MAJOR="$(VERSION_MAJOR)" \ @@ -1850,6 +1852,8 @@ src/AutoConf.hs: Makefile src/AutoConf.hs.in | stamp-directories -DMAN_PAGES="$$(for i in $(notdir $(man_MANS)); do \ echo -n "$$i" | sed -re 's/^(.*)\.([0-9]+)$$/("\1",\2):/g'; \ done)" \ + -DAF_INET4="$$(PYTHONPATH=. python $(PRINT_PY_CONSTANTS) AF_INET4)" \ + -DAF_INET6="$$(PYTHONPATH=. python $(PRINT_PY_CONSTANTS) AF_INET6)" \ $(abs_top_srcdir)/src/AutoConf.hs.in > $@ lib/_vcsversion.py: Makefile vcs-version | stamp-directories diff --git a/src/AutoConf.hs.in b/src/AutoConf.hs.in index 9c00056ff..6454300e6 100644 --- a/src/AutoConf.hs.in +++ b/src/AutoConf.hs.in @@ -218,3 +218,9 @@ hasGnuLn = HAS_GNU_LN -- number as the value manPages :: [(String, Int)] manPages = MAN_PAGES[] + +pyAfInet4 :: Int +pyAfInet4 = AF_INET4 + +pyAfInet6 :: Int +pyAfInet6 = AF_INET6 -- GitLab