From: simonpj@microsoft.com Date: Mon, 6 Jul 2009 10:34:13 +0000 (+0000) Subject: Windows fixes to build system: use the 'find' and 'sort' found by configure X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=b41067a9f85d660e42f2105a9484e7935fd02169 Windows fixes to build system: use the 'find' and 'sort' found by configure The build system should use 'find' and 'sort' that are discovered by configure, not the ones in your path. On Windows the ones in your path might well be the non-Unixy Windows versions. This patch fixes the ones I tripped over. There may be more. --- diff --git a/aclocal.m4 b/aclocal.m4 index bb717ad..f98d5f3 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -1017,7 +1017,7 @@ if test "$RELEASE" = "NO"; then elif test -d _darcs; then # TODO: Remove this branch after conversion to Git changequote(, )dnl - ver_date=`darcs changes --quiet --no-summary --xml | head -500 | grep 'date=' | sed "s/^.*date='\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*$/\1/g" | sort -n | tail -1` + ver_date=`darcs changes --quiet --no-summary --xml | head -500 | grep 'date=' | sed "s/^.*date='\([0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]\).*$/\1/g" | ${SortCmd} -n | tail -1` if echo $ver_date | grep '^[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]$' 2>&1 >/dev/null; then true; else changequote([, ])dnl AC_MSG_ERROR([failed to detect version date: check that darcs is in your path]) diff --git a/configure.ac b/configure.ac index db44d16..872cdc7 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,17 @@ fi AC_SUBST([CONFIGURE_ARGS], [$ac_configure_args]) +dnl ---------------------------------------------------------- +dnl ** Find unixy sort and find commands, +dnl ** which are needed by FP_SETUP_PROJECT_VERSION + +dnl ** Find find command (for Win32's benefit) +FP_PROG_FIND + +dnl ** Find sort command (for the benefit of Win32 environs) +FP_PROG_SORT + +dnl ---------------------------------------------------------- FP_SETUP_PROJECT_VERSION # Hmmm, we fix the RPM release number to 1 here... Is this convenient? @@ -552,12 +563,6 @@ AC_SUBST(SRC_LD_OPTS) dnl ** figure out how to do context diffs FP_PROG_CONTEXT_DIFF -dnl ** Find find command (for Win32's benefit) -FP_PROG_FIND - -dnl ** Find sort command (for the benefit of Win32 environs) -FP_PROG_SORT - dnl Let's make sure install-sh is executable here. If we got it from dnl a darcs repo, it might not be (see bug #978). chmod +x install-sh diff --git a/rules/build-package-way.mk b/rules/build-package-way.mk index e67d301..faa4192 100644 --- a/rules/build-package-way.mk +++ b/rules/build-package-way.mk @@ -30,12 +30,12 @@ $$($1_PACKAGE)-$($1_$2_VERSION)_$2_$3_LIB = $$($1_$2_$3_LIB) $1_$2_$3_DEPS_LIBS=$$(foreach dep,$$($1_$2_DEPS),$$($$(dep)_$2_$3_LIB)) ifneq "$$(BootingFromHc)" "YES" -$1_$2_$3_MKSTUBOBJS = find $1/$2/build -name "*_stub.$$($3_osuf)" -print +$1_$2_$3_MKSTUBOBJS = $$(FIND) $1/$2/build -name "*_stub.$$($3_osuf)" -print # HACK ^^^ we tried to use $(wildcard), but apparently it fails due to # make using cached directory contents, or something. else $1_$2_$3_MKSTUBOBJS = true -$1_$2_$3_C_OBJS += $$(shell find $1/$2/build -name "*_stub.c" -print | sed 's/c$$$$/o/') +$1_$2_$3_C_OBJS += $$(shell $$(FIND) $1/$2/build -name "*_stub.c" -print | sed 's/c$$$$/o/') endif ifeq "$3" "dyn" @@ -51,7 +51,7 @@ else ifeq "$$($1_$2_SplitObjs)" "YES" $$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) "$$(RM)" $$(RM_OPTS) $$@ - (echo $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS); find $$(patsubst %.$$($3_osuf),%_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ + (echo $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) `$$($1_$2_$3_MKSTUBOBJS)` $$($1_$2_EXTRA_OBJS); $$(FIND) $$(patsubst %.$$($3_osuf),%_split,$$($1_$2_$3_HS_OBJS)) -name '*.$$($3_osuf)' -print) | $$(XARGS) $$(AR) $$(EXTRA_AR_ARGS) $$@ else $$($1_$2_$3_LIB) : $$($1_$2_$3_HS_OBJS) $$($1_$2_$3_CMM_OBJS) $$($1_$2_$3_C_OBJS) $$($1_$2_$3_S_OBJS) $$($1_$2_EXTRA_OBJS) "$$(RM)" $$(RM_OPTS) $$@