From 86c82c48c5ca6f6f6bf613845f4c41ea461e2eb2 Mon Sep 17 00:00:00 2001 From: Richard Brooksby Date: Thu, 13 Sep 2012 11:59:26 +0100 Subject: [PATCH] Merging "make install" implementation from bruce mitchener . curl -O "https://github.com/datafueled/memory-pool-system/pull/8.patch" | patch -g1 Copied from Perforce Change: 179466 ServerID: perforce.ravenbrook.com --- mps/Makefile.in | 23 +++++++++++++++++++---- mps/configure | 11 ++++------- mps/configure.ac | 11 ++++------- 3 files changed, 27 insertions(+), 18 deletions(-) diff --git a/mps/Makefile.in b/mps/Makefile.in index 180bf944083..28c90d112d9 100644 --- a/mps/Makefile.in +++ b/mps/Makefile.in @@ -10,11 +10,8 @@ # MAKE=@MAKE@ -MPS_TARGET_PF=@MPS_TARGET_PF@ MPS_TARGET_NAME=@MPS_TARGET_NAME@ - -BUILD_TARGET=@BUILD_TARGET@ -CLEAN_TARGET=@CLEAN_TARGET@ +prefix=$(DESTDIR)@prefix@ all: @BUILD_TARGET@ @@ -24,12 +21,23 @@ build-via-make: clean-make-build: $(MAKE) -C code -f $(MPS_TARGET_NAME).gmk clean +install-make-build: make-install-dirs + cp -p code/mps*.h $(prefix)/include/ + cp -p code/$(MPS_TARGET_NAME)/cool/mps.a $(prefix)/lib/libmps-debug.a + cp -p code/$(MPS_TARGET_NAME)/hot/mps.a $(prefix)/lib/libmps.a + cp -p code/$(MPS_TARGET_NAME)/hot/eventcnv $(prefix)/bin/mpseventcnv + build-via-xcode: xcodebuild -project code/mps.xcodeproj clean-xcode-build: xcodebuild -project code/mps.xcodeproj clean +install-xcode-build: make-install-dirs + cp -p code/mps*.h $(prefix)/include/ + cp -p code/build/Release/libmps.a $(prefix)/lib/libmps.a + cp -p code/build/Release/eventcnv $(prefix)/bin/mpseventcnv + Makefile: Makefile.in config.status ./config.status Makefile @@ -40,3 +48,10 @@ configure: configure.ac distclean: clean rm -rf autom4te.cache/ config.log config.status Makefile + +make-install-dirs: + mkdir -p $(prefix)/bin + mkdir -p $(prefix)/lib + mkdir -p $(prefix)/include + +install: @INSTALL_TARGET@ diff --git a/mps/configure b/mps/configure index 3c6b094c176..9ee8422234a 100755 --- a/mps/configure +++ b/mps/configure @@ -587,10 +587,10 @@ PACKAGE_URL='http://www.ravenbrook.com/project/mps/' ac_unique_file="code/mps.c" ac_subst_vars='LTLIBOBJS LIBOBJS +INSTALL_TARGET CLEAN_TARGET BUILD_TARGET MPS_TARGET_NAME -MPS_TARGET_PF MAKE host_os host_vendor @@ -2642,45 +2642,42 @@ case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac $as_echo_n "checking target platform... " >&6; } BUILD_TARGET=build-via-make CLEAN_TARGET=clean-make-build +INSTALL_TARGET=install-make-build case $host in i*86-*-linux*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux x86" >&5 $as_echo "Linux x86" >&6; } - MPS_TARGET_PF=MPS_PF_LI3C MPS_TARGET_NAME=lii3gc ;; x86_64-*-linux*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Linux x86_64" >&5 $as_echo "Linux x86_64" >&6; } - MPS_TARGET_PF=MPS_PF_LII6GC MPS_TARGET_NAME=lii6gc ;; i*86-*-darwin*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86" >&5 $as_echo "Mac OS X x86" >&6; } - MPS_TARGET_PF=MPS_PF_XCI3LL MPS_TARGET_NAME=xci3ll BUILD_TARGET=build-via-xcode CLEAN_TARGET=clean-xcode-build + INSTALL_TARGET=install-xcode-build ;; x86_64-apple-darwin*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: Mac OS X x86_64" >&5 $as_echo "Mac OS X x86_64" >&6; } - MPS_TARGET_PF=MPS_PF_XCI6LL MPS_TARGET_NAME=xci6ll BUILD_TARGET=build-via-xcode CLEAN_TARGET=clean-xcode-build + INSTALL_TARGET=install-xcode-build ;; i*86-*-freebsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86" >&5 $as_echo "FreeBSD x86" >&6; } - MPS_TARGET_PF=MPS_PF_FRI3GC MPS_TARGET_NAME=fri3gc ;; amd64-*-freebsd*) { $as_echo "$as_me:${as_lineno-$LINENO}: result: FreeBSD x86_64" >&5 $as_echo "FreeBSD x86_64" >&6; } - MPS_TARGET_PF=MPS_PF_FRI6GC MPS_TARGET_NAME=fri6gc ;; *) diff --git a/mps/configure.ac b/mps/configure.ac index 66f90ba17ca..1d1dac2da9a 100644 --- a/mps/configure.ac +++ b/mps/configure.ac @@ -30,39 +30,36 @@ AC_CANONICAL_HOST AC_MSG_CHECKING([target platform]) BUILD_TARGET=build-via-make CLEAN_TARGET=clean-make-build +INSTALL_TARGET=install-make-build case $host in i*86-*-linux*) AC_MSG_RESULT([Linux x86]) - MPS_TARGET_PF=MPS_PF_LI3C MPS_TARGET_NAME=lii3gc ;; x86_64-*-linux*) AC_MSG_RESULT([Linux x86_64]) - MPS_TARGET_PF=MPS_PF_LII6GC MPS_TARGET_NAME=lii6gc ;; i*86-*-darwin*) AC_MSG_RESULT([Mac OS X x86]) - MPS_TARGET_PF=MPS_PF_XCI3LL MPS_TARGET_NAME=xci3ll BUILD_TARGET=build-via-xcode CLEAN_TARGET=clean-xcode-build + INSTALL_TARGET=install-xcode-build ;; x86_64-apple-darwin*) AC_MSG_RESULT([Mac OS X x86_64]) - MPS_TARGET_PF=MPS_PF_XCI6LL MPS_TARGET_NAME=xci6ll BUILD_TARGET=build-via-xcode CLEAN_TARGET=clean-xcode-build + INSTALL_TARGET=install-xcode-build ;; i*86-*-freebsd*) AC_MSG_RESULT([FreeBSD x86]) - MPS_TARGET_PF=MPS_PF_FRI3GC MPS_TARGET_NAME=fri3gc ;; amd64-*-freebsd*) AC_MSG_RESULT([FreeBSD x86_64]) - MPS_TARGET_PF=MPS_PF_FRI6GC MPS_TARGET_NAME=fri6gc ;; *) @@ -74,10 +71,10 @@ if ! $MAKE --version | grep -q "GNU" 2> /dev/null; then AC_MSG_ERROR([MPS requires GNU make to build from configure, but see manual/build.txt]) fi -AC_SUBST(MPS_TARGET_PF) AC_SUBST(MPS_TARGET_NAME) AC_SUBST(BUILD_TARGET) AC_SUBST(CLEAN_TARGET) +AC_SUBST(INSTALL_TARGET) AC_CONFIG_FILES(Makefile) AC_OUTPUT