FW: [Fwd: [ofa-general] [PATCH] mstflint: Convert project to autoconf tools.]

Oren Kladnitsky orenk at dev.mellanox.co.il
Tue Dec 18 08:14:26 PST 2007


 I applied this patch + added mstmcra tool (will replace mread and mwrite).

Vlad - Please change installer to use autoconf method and take spec from
this dir.

Thanks,
ORen





>
> ---------- Forwarded message ----------
> From: "Ira Weiny" <weiny2 at llnl.gov>
> To: "openfabrics" <general at lists.openfabrics.org>
> Date: Mon, 10 Dec 2007 23:35:54 +0200
> Subject: [ofa-general] [PATCH] mstflint: Convert project to autoconf
> tools.
> This patch removes the makefile and converts the mstflint git tree over to
> autoconf tools.  This works great on x86_64 but has not been tested on
> other
> arch's.  (Although it is simple enough I don't see how would not work.)
>
> Thanks,
> Ira
>
>
> >From efb3a07a1f333ea95204d2a2e9462e285e29a65f Mon Sep 17 00:00:00 2001
> From: Ira K. Weiny <weiny2 at llnl.gov>
> Date: Mon, 10 Dec 2007 13:30:22 -0800
> Subject: [PATCH] Convert project to autoconf tools.
>
>
> Signed-off-by: Ira K. Weiny <weiny2 at llnl.gov>
> ---
> Makefile         |   47 -----------------------------------------------
> Makefile.am      |   21 +++++++++++++++++++++
> autogen.sh       |   11 +++++++++++
> configure.in     |   22 ++++++++++++++++++++++
> mstflint.spec.in |   45 +++++++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 99 insertions(+), 47 deletions(-)
> delete mode 100644 Makefile
> create mode 100644 Makefile.am
> create mode 100755 autogen.sh
> create mode 100644 configure.in
> create mode 100644 mstflint.spec.in
>
> diff --git a/Makefile b/Makefile
> deleted file mode 100644
> index 889c97a..0000000
> --- a/Makefile
> +++ /dev/null
> @@ -1,47 +0,0 @@
> -#default options
> -CFLAGS += -O2
> -CFLAGS += -g
> -CFLAGS += -Wall
> -CXXFLAGS += -fno-exceptions
> -CFLAGS += -I.
> -LD=$(CXX)
> -EXTRA_LOADLIBES=-lz
> -LOADLIBES+=${EXTRA_LOADLIBES}
> -
> -all: default
> -bin: mstflint mstmread mstmwrite mstregdump mstvpd
> -
> -default: bin
> -static: bin
> -shared: bin
> -
> -.PHONY: all bin clean static shared default
> -.DELETE_ON_ERROR:
> -
> -default: EXTRA_LOADLIBES="$(shell $(CXX) ${LDFLAGS} ${CFLAGS} ${CXXFLAGS}
> -print-file-name=libz.a)" "$(shell $(CXX)  ${LDFLAGS} ${CFLAGS}
> ${CXXFLAGS} -print-file-name=libstdc++.a)"
> -default: LD=$(CC)
> -static: CFLAGS+=-static
> -
> -mstflint: mstflint.o mflash.o
> -       $(LD) ${LDFLAGS} ${CFLAGS} ${CXXFLAGS} mstflint.o mflash.o -o
> mstflint ${LOADLIBES}
> -
> -mstflint.o: flint.cpp mflash.h
> -       $(CXX) ${CFLAGS} ${CXXFLAGS} -c flint.cpp -o mstflint.o
> -
> -mflash.o: mtcr.h mflash.c mflash.h
> -       $(CC) ${CFLAGS} -c mflash.c -o mflash.o
> -
> -mstmwrite: mwrite.c mtcr.h
> -       $(CC) ${CFLAGS} mwrite.c -o mstmwrite
> -
> -mstmread: mread.c mtcr.h
> -       $(CC) ${CFLAGS} mread.c -o mstmread
> -
> -mstregdump: mstdump.c mtcr.h
> -       $(CC) ${CFLAGS} mstdump.c -o mstregdump
> -
> -mstvpd: vpd.c
> -       $(CC) ${CFLAGS} vpd.c -o mstvpd
> -
> -clean:
> -       rm -f mstvpd mstregdump mstflint mstmread mstmwrite mstflint.o
> mflash.o
> diff --git a/Makefile.am b/Makefile.am
> new file mode 100644
> index 0000000..f642d9d
> --- /dev/null
> +++ b/Makefile.am
> @@ -0,0 +1,21 @@
> +bin_PROGRAMS = mstmread \
> +                                       mstmwrite \
> +                                       mstflint \
> +                                       mstregdump \
> +                                       mstvpd
> +
> +mstmread_SOURCES = mread.c mtcr.h
> +
> +mstmwrite_SOURCES = mwrite.c mtcr.h
> +
> +mstflint_SOURCES = flint.cpp mtcr.h mflash.h mflash.c
> +mstflint_LDFLAGS = -lz
> +
> +mstregdump_SOURCES = mread.c mtcr.h
> +
> +mstvpd_SOURCES = vpd.c
> +
> +
> +EXTRA_DIST = \
> +       mstflint.spec
> +
> diff --git a/autogen.sh b/autogen.sh
> new file mode 100755
> index 0000000..4827884
> --- /dev/null
> +++ b/autogen.sh
> @@ -0,0 +1,11 @@
> +#! /bin/sh
> +
> +# create config dir if not exist
> +test -d config || mkdir config
> +
> +set -x
> +aclocal -I config
> +libtoolize --force --copy
> +autoheader
> +automake --foreign --add-missing --copy
> +autoconf
> diff --git a/configure.in b/configure.in
> new file mode 100644
> index 0000000..0924d65
> --- /dev/null
> +++ b/configure.in
> @@ -0,0 +1,22 @@
> +dnl Process this file with autoconf to produce a configure script.
> +
> +AC_INIT(mstflint)
> +
> +AC_DEFINE_UNQUOTED([PROJECT], ["mstflint"], [Define the project name.])
> +AC_SUBST([PROJECT])
> +
> +AC_DEFINE_UNQUOTED([VERSION], ["1.3"], [Define the project version.])
> +AC_SUBST([VERSION])
> +
> +AC_CONFIG_AUX_DIR(config)
> +AC_CONFIG_SRCDIR([README])
> +AM_INIT_AUTOMAKE(mstflint, 1.3)
> +
> +dnl Checks for programs
> +AC_PROG_CC
> +AC_PROG_CXX
> +AC_PROG_LIBTOOL
> +AC_CONFIG_HEADERS
> +
> +AC_CONFIG_FILES([Makefile mstflint.spec])
> +AC_OUTPUT
> diff --git a/mstflint.spec.in b/mstflint.spec.in
> new file mode 100644
> index 0000000..b5937be
> --- /dev/null
> +++ b/mstflint.spec.in
> @@ -0,0 +1,45 @@
> +Summary: Mellanox firmware burning application
> +Name: mstflint
> +Version: @VERSION@
> +Release: 1
> +License: GPL/BSD
> +Url: http://openib.org/
> +Group: System Environment/Base
> +BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}
> +Source: mstflint- at VERSION@.tar.gz
> +ExclusiveArch: i386 x86_64 ia64 ppc ppc64
> +BuildRequires: zlib-devel
> +Requires(post): chkconfig
> +
> +%description
> +This package contains a tool for burning updated firmware on to
> +Mellanox manufactured InfiniBand adapters.
> +
> +%prep
> +%setup -q
> +
> +%build
> +%configure
> +make
> +
> +%install
> +rm -rf $RPM_BUILD_ROOT
> +make DESTDIR=${RPM_BUILD_ROOT} install
> +# remove unpackaged files from the buildroot
> +rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
> +
> +%clean
> +rm -rf $RPM_BUILD_ROOT
> +
> +%files
> +%defattr(-,root,root)
> +%{_bindir}/mstmread
> +%{_bindir}/mstmwrite
> +%{_bindir}/mstflint
> +%{_bindir}/mstregdump
> +%{_bindir}/mstvpd
> +
> +%changelog
> +* Fri Dec 07 2007 Ira Weiny <weiny2 at llnl.gov> 1.0.0
> +   initial creation
> +
> --
> 1.5.1
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openfabrics.org/pipermail/general/attachments/20071218/b940fb4f/attachment.html>


More information about the general mailing list