Re: [Request for help] mash
Hi Helmut,
On Wed, Mar 10, 2021 at 08:54:30PM +0100, Helmut Grohne wrote:
> Hi Nilesh,
> It's an issue with the Makefile.in. While configure correctly detects a
> cross compiler, the Makefile.in fails to pick it up. Usually a
> Makefile.in contains lines such as:
>
> CXX = @CXX@
>
> This one does not. When using automake, the Makefile.in is generated and
> automake generates these lines. Since automake is not being used here,
> these assignments must be given manually.
Thanks a lot for explaining (I've very limited autotools foo there)
Adding it manually fixes cross-build
I've attached a patch towards the end, and would really appreciate
another review
> Also running uname -s in Makefile.in is bad (for cross compilation).
> Such detection should happen at configure time and the resulting value
> should be substituted (e.g. using AC_SUBST).
Since it is _only_ used to determine if the machine is darwin or not, and
passing some flags if it is -- this is practically useless for our
usecase, so I purged it altogether
> > -include /usr/share/dpkg/architecture.mk
> > +#include /usr/share/dpkg/architecture.mk
>
> Why?
>
> > +include /usr/share/dpkg/buildtools.mk
>
> How do you use this include?
Argh, the above were done while I was trying to debug something, I
mistakenly included these, it wasn't intended
> > - dh $@ --with sphinxdoc
> > + dh $@
>
> Why do you entirely disable the sphinxdoc addon? I think it should be
> enabled for arch:all builds. An easy way of doing so is adding
> dh-sequence-sphinxdoc to Build-Depends-Indep.
ACK.
> > -override_dh_auto_build:
> > - dh_auto_build
> > +override_dh_auto_build-indep:
> > + dh_auto_build --indep
>
> Consider using execute_after_dh_auto_build-indep.
ACK.
diff --git a/debian/control b/debian/control
index f5c5142..ed7ab9d 100644
--- a/debian/control
+++ b/debian/control
@@ -8,10 +8,12 @@ Build-Depends: debhelper (>= 12~),
libcapnp-dev (>= 0.6.1),
libgsl-dev,
zlib1g-dev,
- python3-sphinx,
- libjs-mathjax,
asciidoctor,
- libmurmurhash-dev
+ libmurmurhash-dev,
+ pkg-config
+Build-Depends-Indep: python3-sphinx,
+ libjs-mathjax,
+ dh-sequence-sphinxdoc
Standards-Version: 4.4.0
Vcs-Browser: https://salsa.debian.org/med-team/mash
Vcs-Git: https://salsa.debian.org/med-team/mash.git
diff --git a/debian/patches/series b/debian/patches/series
index 6d50371..af1f782 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -4,3 +4,4 @@ drop_memcpy_wrapper.patch
link_dynamically_against_capnp.patch
parallel.patch
use_debian_packaged_libmurmurhash.patch
+use-CXX-from-configure.patch
diff --git a/debian/patches/use-CXX-from-configure.patch b/debian/patches/use-CXX-from-configure.patch
new file mode 100644
index 0000000..1ed026f
--- /dev/null
+++ b/debian/patches/use-CXX-from-configure.patch
@@ -0,0 +1,16 @@
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -1,12 +1,7 @@
++CXX = @CXX@
+ CXXFLAGS += -O3 -std=c++14 -Isrc -I@capnp@/include -I@mathinc@
+ CPPFLAGS += @amcppflags@
+
+-UNAME_S=$(shell uname -s)
+-
+-ifeq ($(UNAME_S),Darwin)
+- CXXFLAGS += -mmacosx-version-min=10.7 -stdlib=libc++
+-endif
+-
+ SOURCES=\
+ src/mash/Command.cpp \
+ src/mash/CommandBounds.cpp \
diff --git a/debian/rules b/debian/rules
index 578b4ca..0fc4abf 100755
--- a/debian/rules
+++ b/debian/rules
@@ -11,7 +11,7 @@ endif
export DEB_CPPFLAGS_MAINT_APPEND
%:
- dh $@ --with sphinxdoc
+ dh $@
override_dh_auto_clean:
dh_auto_clean
@@ -20,8 +20,7 @@ override_dh_auto_clean:
override_dh_auto_configure:
dh_auto_configure -- --with-capnp=/usr --with-gsl=/usr --prefix=$(CURDIR)/debian/tmp/usr
-override_dh_auto_build:
- dh_auto_build
+execute_after_dh_auto_build-indep:
sphinx-build doc/sphinx $(CURDIR)/debian/sphinxdoc
override_dh_installman:
Nilesh
Reply to: