[openib-general] [PATCH] osm: add a main auto tools project for osm
Eitan Zahavi
eitan at mellanox.co.il
Mon Aug 15 07:23:57 PDT 2005
Hi Hal
I'm now using xemacs as my mail client. This is pure unix and
tested to work.
This patch includes:
1. Added a top level autotools project for OpenSM.
So now you need autogen.sh && configure && make && make install just
once for osm
(previously needed 4: complib, libvendor, opensm, osmtest).
2. Cleanup the direct override of libdir, bindir. Support --prefix
3. Move osm lib, bin into default prefix (/usr/local)
4. Support debug build for OpenSM using --enable-debug
This is important to allow for asserts during runtime and various
other additional debug features.
Since the generated compilb can not be used with the release version
we also use a special header file that stores the type of build
for applications that wish to link with it.
5. Cleanup stale use of AC_CHECK_LIB with no parameters
6. Resolved another bug: iba/ib_types.h not installed correctly
I tested the patch on :
2.6.12.3-smp SuSE Linux 9.3 (i586)
Signed-off-by: Eitan Zahavi eitan at mellanox.co.il
Index: include/configure.in
===================================================================
--- include/configure.in (revision 3083)
+++ include/configure.in (working copy)
@@ -13,7 +13,7 @@ dnl Checks for programs
AC_PROG_CC
dnl Checks for libraries
-AC_CHECK_LIB
+dnl AC_CHECK_LIB - need to provide symbol and library... what do we depend on?
dnl Checks for header files.
AC_HEADER_STDC
Index: include/Makefile.am
===================================================================
--- include/Makefile.am (revision 3083)
+++ include/Makefile.am (working copy)
@@ -1,17 +1,9 @@
-
-libincdir = ${exec_prefix}/ib/lib
+# HACK: as we do not use the standard "prefix/include" subdir
+includedir = ${prefix}/include/infiniband
SUBDIRS = .
-INCLUDES =
-
-lib_LTLIBRARIES =
-
-lib_version_script =
-
-libincincludedir = $(includedir)/infiniband/iba
-
-libincinclude_HEADERS = $(srcdir)/iba/ib_types.h
+nobase_include_HEADERS = iba/ib_types.h
EXTRA_DIST = $(srcdir)/iba/ib_types.h
Index: include/autogen.sh
===================================================================
--- include/autogen.sh (revision 3083)
+++ include/autogen.sh (working copy)
@@ -1,5 +1,8 @@
#! /bin/sh
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
set -x
aclocal -I config
libtoolize --force --copy
Index: libvendor/configure.in
===================================================================
--- libvendor/configure.in (revision 3083)
+++ libvendor/configure.in (working copy)
@@ -60,5 +60,15 @@ AC_CACHE_CHECK(whether ld accepts --vers
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
+dnl support debug mode
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on debug mode],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+
AC_CONFIG_FILES([Makefile libosmvendor.spec])
AC_OUTPUT
Index: libvendor/Makefile.am
===================================================================
--- libvendor/Makefile.am (revision 3083)
+++ libvendor/Makefile.am (working copy)
@@ -1,15 +1,19 @@
-libdir = ${exec_prefix}/ib/lib
-
SUBDIRS = .
+if DEBUG
+DBGFLAGS = -g -O0 -D_DEBUG_
+else
+DBGFLAGS = -g -O2
+endif
+
INCLUDES = -I$(srcdir)/../include \
-I$(srcdir)/../../libibcommon/include/infiniband \
-I$(srcdir)/../../libibumad/include/infiniband
lib_LTLIBRARIES = libosmvendor.la
-libosmvendor_la_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT
+libosmvendor_la_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
if HAVE_LD_VERSION_SCRIPT
libosmvendor_version_script = -Wl,--version-script=$(srcdir)/libosmvendor.map
Index: libvendor/autogen.sh
===================================================================
--- libvendor/autogen.sh (revision 3083)
+++ libvendor/autogen.sh (working copy)
@@ -1,5 +1,8 @@
#! /bin/sh
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
set -x
aclocal -I config
libtoolize --force --copy
Index: AUTHORS
===================================================================
--- AUTHORS (revision 0)
+++ AUTHORS (revision 0)
@@ -0,0 +1,7 @@
+
+By the chronological order of involvement:
+Steve King, Intel
+Anil Keshavamurthy, Intel
+Eitan Zahavi, Mellanox Technologies, eitan at mellanox.co.il
+Yael Kalka, Mellanox Technologies, yael at mellanox.co.il
+Hal Rosenstock, Voltaire, halr at voltaire.com
Index: complib/autogen.sh
===================================================================
--- complib/autogen.sh (revision 3083)
+++ complib/autogen.sh (working copy)
@@ -1,5 +1,8 @@
#! /bin/sh
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
set -x
aclocal -I config
libtoolize --force --copy
Index: complib/configure.in
===================================================================
--- complib/configure.in (revision 3083)
+++ complib/configure.in (working copy)
@@ -31,6 +31,7 @@ AC_C_INLINE
AC_TYPE_SIZE_T
AC_HEADER_TIME
+dnl We use --version-script with ld if possible
AC_CACHE_CHECK(whether ld accepts --version-script, ac_cv_version_script,
if test -n "`$LD --help < /dev/null 2>/dev/null | grep version-script`"; then
ac_cv_version_script=yes
@@ -40,5 +41,15 @@ AC_CACHE_CHECK(whether ld accepts --vers
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
+dnl Support debug mode build - if enable-debug provided the DEBUG variable is set
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on debug mode],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+
AC_CONFIG_FILES([Makefile libosmcomp.spec])
AC_OUTPUT
Index: complib/Makefile.am
===================================================================
--- complib/Makefile.am (revision 3083)
+++ complib/Makefile.am (working copy)
@@ -1,13 +1,15 @@
-libdir = ${exec_prefix}/ib/lib
-
-SUBDIRS = .
-
INCLUDES = -I$(srcdir)/../include
lib_LTLIBRARIES = libosmcomp.la
-libosmcomp_la_CFLAGS = -Wall
+if DEBUG
+DBGFLAGS = -g -O0 -D_DEBUG_
+else
+DBGFLAGS = -g -O2
+endif
+
+libosmcomp_la_CFLAGS = -Wall $(DBGFLAGS)
if HAVE_LD_VERSION_SCRIPT
libosmcomp_version_script = -Wl,--version-script=$(srcdir)/libosmcomp.map
Index: configure.in
===================================================================
--- configure.in (revision 0)
+++ configure.in (revision 0)
@@ -0,0 +1,39 @@
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT(autogen.sh)
+
+dnl use local config dir for extras
+AC_CONFIG_AUX_DIR(config)
+
+dnl Defines the Language
+AC_LANG_C
+
+dnl Auto make
+AM_INIT_AUTOMAKE(osm,1.0)
+
+dnl Provides control over re-making of all auto files
+dnl We also use it to define swig dependencies so end
+dnl users do not see them.
+AM_MAINTAINER_MODE
+
+dnl Required for cases make defines a MAKE=make ??? Why
+AC_PROG_MAKE_SET
+
+dnl Define an input config option to control debug compile
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on debugging],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+
+dnl Configure the following subdirs
+AC_CONFIG_SUBDIRS(complib libvendor opensm osmtest include)
+
+dnl Create the following Makefiles
+AC_OUTPUT(Makefile)
+
+
+
Index: ChangeLog
===================================================================
--- ChangeLog (revision 0)
+++ ChangeLog (revision 0)
@@ -0,0 +1,6 @@
+2005-08-14 Eitan Zahavi <eitan at mellanox.co.il>
+
+ * Provided a top level auto tools project so there is no need to
+ cd into each of the sub directories and do:
+ ./autogen.sh && configure && make && make install
+
Index: README
===================================================================
--- README (revision 0)
+++ README (revision 0)
@@ -0,0 +1,20 @@
+OpenSM README:
+--------------
+
+OpenSM provides an implementation for an InfiniBand Subnet Manager and
+Administrator. Such a software entity is required to run for in order
+to initialize the InfiniBand hardware (at least one per each
+InfiniBand subnet).
+
+The full list of OpenSM features is described in the user manual
+provided in the doc sub directory.
+
+The installation of OpenSM includes:
+
+bin/
+ opensm - the SM/SA executable
+ osmtest - a test program for the SM/SA
+lib/
+ libosmcomp.{a,so} - component library with generic services and containers
+ libopensm.{a,so} - opensm services for logs and mad buffer pool
+ libosmvendor.{a,so} - interface to the user mad service of the driver
Index: osmtest/configure.in
===================================================================
--- osmtest/configure.in (revision 3083)
+++ osmtest/configure.in (working copy)
@@ -52,5 +52,15 @@ AC_CACHE_CHECK(whether ld accepts --vers
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
+dnl support debug mode
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on debug mode],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Index: osmtest/Makefile.am
===================================================================
--- osmtest/Makefile.am (revision 3083)
+++ osmtest/Makefile.am (working copy)
@@ -1,6 +1,9 @@
-bindir = ${exec_prefix}/ib/bin
-libdir = ${exec_prefix}/ib/lib
+if DEBUG
+DBGFLAGS = -g -O0 -D_DEBUG_
+else
+DBGFLAGS = -g -O2
+endif
INCLUDES = -I$(srcdir)/include \
-I$(srcdir)/../include \
@@ -11,12 +14,9 @@ bin_PROGRAMS = osmtest
osmtest_SOURCES = main.c osmtest.c osmt_service.c osmt_slvl_vl_arb.c \
osmt_multicast.c osmt_inform.c
-osmtest_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT
-osmtest_LDADD = $(libdir)/libibumad.la \
- $(libdir)/libibcommon.la \
- $(libdir)/libopensm.la \
- $(libdir)/libosmcomp.la \
- $(libdir)/libosmvendor.la
+osmtest_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
+osmtest_LDADD = -L../complib -L../libvendor -L../opensm -L$(libdir) \
+ -libumad -libcommon -lopensm -losmcomp -losmvendor
osmtest_LDFLAGS = -Wl,--rpath -Wl,$(libdir) -lpthread -L../opensm
Index: osmtest/autogen.sh
===================================================================
--- osmtest/autogen.sh (revision 3083)
+++ osmtest/autogen.sh (working copy)
@@ -1,5 +1,8 @@
#! /bin/sh
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
set -x
aclocal -I config
libtoolize --force --copy
Index: opensm/configure.in
===================================================================
--- opensm/configure.in (revision 3083)
+++ opensm/configure.in (working copy)
@@ -52,5 +52,15 @@ AC_CACHE_CHECK(whether ld accepts --vers
AM_CONDITIONAL(HAVE_LD_VERSION_SCRIPT, test "$ac_cv_version_script" = "yes")
+dnl support debug mode
+AC_ARG_ENABLE(debug,
+[ --enable-debug Turn on debug mode],
+[case "${enableval}" in
+ yes) debug=true ;;
+ no) debug=false ;;
+ *) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
+esac],[debug=false])
+AM_CONDITIONAL(DEBUG, test x$debug = xtrue)
+
AC_CONFIG_FILES([Makefile])
AC_OUTPUT
Index: opensm/autogen.sh
===================================================================
--- opensm/autogen.sh (revision 3083)
+++ opensm/autogen.sh (working copy)
@@ -1,5 +1,8 @@
#! /bin/sh
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
set -x
aclocal -I config
libtoolize --force --copy
Index: opensm/Makefile.am
===================================================================
--- opensm/Makefile.am (revision 3083)
+++ opensm/Makefile.am (working copy)
@@ -1,14 +1,17 @@
-bindir = ${exec_prefix}/ib/bin
-libdir = ${exec_prefix}/ib/lib
-
INCLUDES = -I$(srcdir)/../include \
-I$(srcdir)/../../libibcommon/include/infiniband \
-I$(srcdir)/../../libibumad/include/infiniband
lib_LTLIBRARIES = libopensm.la
-libopensm_la_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT
+if DEBUG
+DBGFLAGS = -g -O0 -D_DEBUG_
+else
+DBGFLAGS = -g -O2
+endif
+
+libopensm_la_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
if HAVE_LD_VERSION_SCRIPT
libopensm_version_script = -Wl,--version-script=$(srcdir)/libopensm.map
@@ -60,12 +63,13 @@ opensm_SOURCES = main.c osm_drop_mgr.c o
osm_ucast_mgr.c osm_ucast_updn.c \
osm_vl15intf.c osm_vl_arb_rcv.c\
osm_vl_arb_rcv_ctrl.c
-opensm_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT
-opensm_LDADD = $(libdir)/libibumad.la \
- $(libdir)/libibcommon.la \
- $(srcdir)/libopensm.la \
- $(libdir)/libosmcomp.la \
- $(libdir)/libosmvendor.la
+opensm_CFLAGS = -Wall -DOSM_VENDOR_INTF_OPENIB -DVENDOR_RMPP_SUPPORT $(DBGFLAGS)
+
+# we need to be able to load libraries from local build subtree before make install
+# we always give precedence to local tree libs and then use the pre-installed ones.
+opensm_LDADD = -L../complib -L../libvendor -L$(libdir) \
+ -libumad -lopensm -losmcomp -losmvendor
+
opensm_LDFLAGS = -Wl,--rpath -Wl,$(libdir) -lpthread
opensmincludedir = $(includedir)/infiniband/opensm
@@ -79,4 +83,3 @@ EXTRA_DIST = $(srcdir)/../include/opensm
$(srcdir)/../include/opensm/osm_log.h \
$(srcdir)/../include/opensm/osm_madw.h \
$(srcdir)/../include/opensm/osm_mad_pool.h
-
Index: INSTALL
===================================================================
--- INSTALL (revision 0)
+++ INSTALL (revision 0)
@@ -0,0 +1,231 @@
+Installation Instructions
+*************************
+
+Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004 Free
+Software Foundation, Inc.
+
+This file is free documentation; the Free Software Foundation gives
+unlimited permission to copy, distribute and modify it.
+
+Basic Installation
+==================
+
+These are generic installation instructions.
+
+ The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation. It uses
+those values to create a `Makefile' in each directory of the package.
+It may also create one or more `.h' files containing system-dependent
+definitions. Finally, it creates a shell script `config.status' that
+you can run in the future to recreate the current configuration, and a
+file `config.log' containing compiler output (useful mainly for
+debugging `configure').
+
+ It can also use an optional file (typically called `config.cache'
+and enabled with `--cache-file=config.cache' or simply `-C') that saves
+the results of its tests to speed up reconfiguring. (Caching is
+disabled by default to prevent problems with accidental use of stale
+cache files.)
+
+ If you need to do unusual things to compile the package, please try
+to figure out how `configure' could check whether to do them, and mail
+diffs or instructions to the address given in the `README' so they can
+be considered for the next release. If you are using the cache, and at
+some point `config.cache' contains results you don't want to keep, you
+may remove or edit it.
+
+ The file `configure.ac' (or `configure.in') is used to create
+`configure' by a program called `autoconf'. You only need
+`configure.ac' if you want to change it or regenerate `configure' using
+a newer version of `autoconf'.
+
+The simplest way to compile this package is:
+
+ 1. `cd' to the directory containing the package's source code and type
+ `./configure' to configure the package for your system. If you're
+ using `csh' on an old version of System V, you might need to type
+ `sh ./configure' instead to prevent `csh' from trying to execute
+ `configure' itself.
+
+ Running `configure' takes awhile. While running, it prints some
+ messages telling which features it is checking for.
+
+ 2. Type `make' to compile the package.
+
+ 3. Optionally, type `make check' to run any self-tests that come with
+ the package.
+
+ 4. Type `make install' to install the programs and any data files and
+ documentation.
+
+ 5. You can remove the program binaries and object files from the
+ source code directory by typing `make clean'. To also remove the
+ files that `configure' created (so you can compile the package for
+ a different kind of computer), type `make distclean'. There is
+ also a `make maintainer-clean' target, but that is intended mainly
+ for the package's developers. If you use it, you may have to get
+ all sorts of other programs in order to regenerate files that came
+ with the distribution.
+
+Compilers and Options
+=====================
+
+Some systems require unusual options for compilation or linking that the
+`configure' script does not know about. Run `./configure --help' for
+details on some of the pertinent environment variables.
+
+ You can give `configure' initial values for configuration parameters
+by setting variables in the command line or in the environment. Here
+is an example:
+
+ ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
+
+ *Note Defining Variables::, for more details.
+
+Compiling For Multiple Architectures
+====================================
+
+You can compile the package for more than one kind of computer at the
+same time, by placing the object files for each architecture in their
+own directory. To do this, you must use a version of `make' that
+supports the `VPATH' variable, such as GNU `make'. `cd' to the
+directory where you want the object files and executables to go and run
+the `configure' script. `configure' automatically checks for the
+source code in the directory that `configure' is in and in `..'.
+
+ If you have to use a `make' that does not support the `VPATH'
+variable, you have to compile the package for one architecture at a
+time in the source code directory. After you have installed the
+package for one architecture, use `make distclean' before reconfiguring
+for another architecture.
+
+Installation Names
+==================
+
+By default, `make install' will install the package's files in
+`/usr/local/bin', `/usr/local/man', etc. You can specify an
+installation prefix other than `/usr/local' by giving `configure' the
+option `--prefix=PREFIX'.
+
+ You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If you
+give `configure' the option `--exec-prefix=PREFIX', the package will
+use PREFIX as the prefix for installing programs and libraries.
+Documentation and other data files will still use the regular prefix.
+
+ In addition, if you use an unusual directory layout you can give
+options like `--bindir=DIR' to specify different values for particular
+kinds of files. Run `configure --help' for a list of the directories
+you can set and what kinds of files go in them.
+
+ If the package supports it, you can cause programs to be installed
+with an extra prefix or suffix on their names by giving `configure' the
+option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'.
+
+Optional Features
+=================
+
+Some packages pay attention to `--enable-FEATURE' options to
+`configure', where FEATURE indicates an optional part of the package.
+They may also pay attention to `--with-PACKAGE' options, where PACKAGE
+is something like `gnu-as' or `x' (for the X Window System). The
+`README' should mention any `--enable-' and `--with-' options that the
+package recognizes.
+
+ For packages that use the X Window System, `configure' can usually
+find the X include and library files automatically, but if it doesn't,
+you can use the `configure' options `--x-includes=DIR' and
+`--x-libraries=DIR' to specify their locations.
+
+Specifying the System Type
+==========================
+
+There may be some features `configure' cannot figure out automatically,
+but needs to determine by the type of machine the package will run on.
+Usually, assuming the package is built to be run on the _same_
+architectures, `configure' can figure that out, but if it prints a
+message saying it cannot guess the machine type, give it the
+`--build=TYPE' option. TYPE can either be a short name for the system
+type, such as `sun4', or a canonical name which has the form:
+
+ CPU-COMPANY-SYSTEM
+
+where SYSTEM can have one of these forms:
+
+ OS KERNEL-OS
+
+ See the file `config.sub' for the possible values of each field. If
+`config.sub' isn't included in this package, then this package doesn't
+need to know the machine type.
+
+ If you are _building_ compiler tools for cross-compiling, you should
+use the `--target=TYPE' option to select the type of system they will
+produce code for.
+
+ If you want to _use_ a cross compiler, that generates code for a
+platform different from the build platform, you should specify the
+"host" platform (i.e., that on which the generated programs will
+eventually be run) with `--host=TYPE'.
+
+Sharing Defaults
+================
+
+If you want to set default values for `configure' scripts to share, you
+can create a site shell script called `config.site' that gives default
+values for variables like `CC', `cache_file', and `prefix'.
+`configure' looks for `PREFIX/share/config.site' if it exists, then
+`PREFIX/etc/config.site' if it exists. Or, you can set the
+`CONFIG_SITE' environment variable to the location of the site script.
+A warning: not all `configure' scripts look for a site script.
+
+Defining Variables
+==================
+
+Variables not defined in a site shell script can be set in the
+environment passed to `configure'. However, some packages may run
+configure again during the build, and the customized values of these
+variables may be lost. In order to avoid this problem, you should set
+them in the `configure' command line, using `VAR=value'. For example:
+
+ ./configure CC=/usr/local2/bin/gcc
+
+will cause the specified gcc to be used as the C compiler (unless it is
+overridden in the site shell script).
+
+`configure' Invocation
+======================
+
+`configure' recognizes the following options to control how it operates.
+
+`--help'
+`-h'
+ Print a summary of the options to `configure', and exit.
+
+`--version'
+`-V'
+ Print the version of Autoconf used to generate the `configure'
+ script, and exit.
+
+`--cache-file=FILE'
+ Enable the cache: use and save the results of the tests in FILE,
+ traditionally `config.cache'. FILE defaults to `/dev/null' to
+ disable caching.
+
+`--config-cache'
+`-C'
+ Alias for `--cache-file=config.cache'.
+
+`--quiet'
+`--silent'
+`-q'
+ Do not print messages saying which checks are being made. To
+ suppress all normal output, redirect it to `/dev/null' (any error
+ messages will still be shown).
+
+`--srcdir=DIR'
+ Look for the package's source code in directory DIR. Usually
+ `configure' can determine that directory automatically.
+
+`configure' also accepts some other, not widely useful, options. Run
+`configure --help' for more details.
+
Index: COPYING
===================================================================
--- COPYING (revision 0)
+++ COPYING (revision 0)
@@ -0,0 +1,32 @@
+ Copyright (c) 2004, 2005 Voltaire, Inc. All rights reserved.
+ Copyright (c) 2002-2005 Mellanox Technologies LTD. All rights reserved.
+ Copyright (c) 1996-2003 Intel Corporation. All rights reserved.
+
+ This software is available to you under a choice of one of two
+ licenses. You may choose to be licensed under the terms of the GNU
+ General Public License (GPL) Version 2, available from the file
+ COPYING in the main directory of this source tree, or the
+ OpenIB.org BSD license below:
+
+ Redistribution and use in source and binary forms, with or
+ without modification, are permitted provided that the following
+ conditions are met:
+
+ - Redistributions of source code must retain the above
+ copyright notice, this list of conditions and the following
+ disclaimer.
+
+ - Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials
+ provided with the distribution.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+
Index: Makefile.am
===================================================================
--- Makefile.am (revision 0)
+++ Makefile.am (revision 0)
@@ -0,0 +1,16 @@
+
+# note that order matters: make the lib first then use it
+SUBDIRS = complib libvendor opensm osmtest include
+
+# this will control the update of the files in order
+MAINTAINERCLEANFILES = Makefile.in aclocal.m4 configure config-h.in
+
+ACLOCAL = aclocal -I $(ac_aux_dir)
+
+# we should provide a hint for other apps about the build mode of this project
+install-exec-hook:
+if DEBUG
+ echo "define osm_build_type \"debug\"" > $(includedir)/infiniband/opensm/osm_build_id.h
+else
+ echo "define osm_build_type \"free\"" > $(includedir)/infiniband/opensm/osm_build_id.h
+endif
Index: autogen.sh
===================================================================
--- autogen.sh (revision 0)
+++ autogen.sh (revision 0)
@@ -0,0 +1,74 @@
+#!/bin/bash
+
+# We change dir since the later utilities assume to work in the project dir
+cd ${0%*/*}
+
+# make sure autoconf is up-to-date
+ac_ver=`autoconf --version | head -1 | awk '{print $NF}'`
+ac_maj=`echo $ac_ver|sed 's/\..*//'`
+ac_min=`echo $ac_ver|sed 's/.*\.//'`
+if [[ $ac_maj < 2 ]]; then
+ echo Min autoconf version is 2.59
+ exit
+fi
+if [[ $ac_maj = 2 && $ac_min < 59 ]]; then
+ echo Min autoconf version is 2.59
+ exit
+fi
+
+# make sure automake is up-to-date
+am_ver=`automake --version | head -1 | awk '{print $NF}'`
+am_maj=`echo $am_ver|sed 's/\..*//'`
+am_min=`echo $am_ver|sed 's/.*\.\([^\.]*\)\..*/\1/'`
+am_sub=`echo $am_ver|sed 's/.*\.//'`
+if [[ $am_maj < 1 ]]; then
+ echo Min automake version is 1.9.3
+ exit
+fi
+if [[ $am_maj = 1 && $am_min < 9 ]]; then
+ echo "automake version is too old:$am_maj.$am_min.$am_sub < required 1.9.3"
+ exit
+fi
+if [[ $am_maj = 1 && $am_min = 9 && $am_sub < 3 ]]; then
+ echo "automake version is too old:$am_maj.$am_min.$am_sub < required 1.9.3"
+ exit
+fi
+
+# make sure libtool is up-to-date
+lt_ver=`libtool --version | head -1 | awk '{print $4}'`
+lt_maj=`echo $lt_ver|sed 's/\..*//'`
+lt_min=`echo $lt_ver|sed 's/.*\.\([^\.]*\)\..*/\1/'`
+lt_sub=`echo $lt_ver|sed 's/.*\.//'`
+if [[ $lt_maj < 1 ]]; then
+ echo Min libtool version is 1.4.2
+ exit
+fi
+if [[ $lt_maj = 1 && $lt_min < 4 ]]; then
+ echo "automake version is too old:$lt_maj.$lt_min.$lt_sub < required 1.4.2"
+ exit
+fi
+if [[ $lt_maj = 1 && $lt_min = 4 && $lt_sub < 2 ]]; then
+ echo "automake version is too old:$lt_maj.$lt_min.$lt_sub < required 1.4.2"
+ exit
+fi
+
+# cleanup
+find . \( -name Makefile.in -o -name aclocal.m4 -o -name autom4te.cache -o -name configure -o -name aclocal.m4 \) -exec \rm -rf {} \; -prune
+
+# handle our own autoconf:
+aclocal -I config 2>&1 | grep -v "arning: underquoted definition of"
+automake --add-missing --gnu
+autoconf
+
+# visit all sub directories with autogen.sh
+anyErr=0
+for a in `ls */autogen.sh`; do
+ echo Visiting $a
+ $a 2>& 1 | sed 's/^/| /'
+ if test $? != 0; then
+ echo $a failed
+ anyErr=1
+ fi
+done
+
+exit $anyErr
Property changes on: autogen.sh
___________________________________________________________________
Name: svn:executable
+ *
Index: NEWS
===================================================================
--- NEWS (revision 0)
+++ NEWS (revision 0)
@@ -0,0 +1,2 @@
+
+This file will hold news about the OpenSM project.
Index: Makefile
===================================================================
--- Makefile (revision 3083)
+++ Makefile (working copy)
@@ -1,44 +0,0 @@
-LIBS:= complib libvendor
-BIN:= opensm
-UTIL:= include
-
-SUBDIRS=$(BIN) $(UTIL)
-
-all: BUILD_TARG=all
-all: libs_install subdirs
- @echo Make all done
-
-install: BUILD_TARG=install
-install: subdirs
- @echo Install done
-
-clean: SUBDIRS= $(LIBS) $(BIN)
-clean: BUILD_TARG=clean
-clean: subdirs
- @echo Clean done
-
-rmdep:
- find $(SUBDIRS) -name ".depend" | xargs rm -f
-
-depend: SUBDIRS= $(LIBS) $(BIN) $(UTIL)
-depend: BUILD_TARG=depend
-depend: rmdep subdirs
- @echo Depend done
-
-.PHONY : subdirs
-subdirs:
- @for i in $(SUBDIRS); do\
- if [ -e $$i/Makefile ]; then\
- if !(cd $$i; make $(BUILD_TARG)); then exit 1; fi\
- fi\
- done\
-
-.PHONY : libs_install
-libs_install:
- @for i in $(LIBS); do\
- if [ -e $$i/Makefile ]; then\
- if !(cd $$i; make install); then exit 1; fi\
- fi\
- done\
-
-export BUILD_TARG
More information about the general
mailing list