~ubuntu-branches/ubuntu/raring/ibutils/raring-proposed

« back to all changes in this revision

Viewing changes to .pc/03-remove-rpath.patch/ibdm/ibdm/Makefile.am

  • Committer: Package Import Robot
  • Author(s): Roland Dreier
  • Date: 2012-12-03 11:45:32 UTC
  • Revision ID: package-import@ubuntu.com-20121203114532-zz0zk41tw0hzdy7w
Tags: 1.5.7-1
* Acknowledge NMU. (Closes: #690603)
* Convert to minimized rules file.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#--
 
2
# Copyright (c) 2004-2010 Mellanox Technologies LTD. All rights reserved.
 
3
#
 
4
# This software is available to you under a choice of one of two
 
5
# licenses.  You may choose to be licensed under the terms of the GNU
 
6
# General Public License (GPL) Version 2, available from the file
 
7
# COPYING in the main directory of this source tree, or the
 
8
# OpenIB.org BSD license below:
 
9
#
 
10
#     Redistribution and use in source and binary forms, with or
 
11
#     without modification, are permitted provided that the following
 
12
#     conditions are met:
 
13
#
 
14
#      - Redistributions of source code must retain the above
 
15
#        copyright notice, this list of conditions and the following
 
16
#        disclaimer.
 
17
#
 
18
#      - Redistributions in binary form must reproduce the above
 
19
#        copyright notice, this list of conditions and the following
 
20
#        disclaimer in the documentation and/or other materials
 
21
#        provided with the distribution.
 
22
#
 
23
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 
24
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 
25
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 
26
# NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
 
27
# BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 
28
# ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
 
29
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
 
30
# SOFTWARE.
 
31
#--
 
32
 
 
33
# we would like to export these headers during install
 
34
pkginclude_HEADERS = git_version.h Fabric.h RouteSys.h Bipartite.h \
 
35
                 SubnMgt.h TraceRoute.h CredLoops.h Regexp.h \
 
36
                 TopoMatch.h SysDef.h Congestion.h ibnl_parser.h ibdm.i
 
37
 
 
38
# ibdm shared library version triplet is:
 
39
# API_ID:API_VER:NUM_PREV_API_SUP = x:y:z
 
40
# * change of API_ID means new API
 
41
# * change of AGE means how many API backward compt
 
42
# * change of API_VER is required every version
 
43
# Results with SO version: x-z:z:y
 
44
LIB_VER_TRIPLET="2:1:1"
 
45
LIB_FILE_TRIPLET=1.1.1
 
46
 
 
47
AM_YFLAGS = -d
 
48
 
 
49
# we are going to have here 3 targets:
 
50
# libibdmcom - common convinient library of objects
 
51
# libibdm - the TCL shared lib to be used as a package
 
52
# ibdmsh - the TCL shell
 
53
 
 
54
common_SOURCES = Fabric.cpp RouteSys.cc Bipartite.cc \
 
55
        SubnMgt.cpp TraceRoute.cpp CredLoops.cpp TopoMatch.cpp SysDef.cpp \
 
56
        LinkCover.cpp Congestion.cpp ibnl_parser.cc ibnl_scanner.cc FatTree.cpp
 
57
 
 
58
# Support debug mode through config variable
 
59
if DEBUG
 
60
DBG = -O0 -g
 
61
else
 
62
DBG = -O2
 
63
endif
 
64
 
 
65
# We have a special mode where we know the package will be eventually moved
 
66
# to $with_final_prefix
 
67
if USE_FINAL_PREFIX
 
68
IBNL_PATH=-DIBDM_IBNL_DIR='"$(with_final_prefix)/lib/ibdm$(VERSION)"'
 
69
else
 
70
IBNL_PATH=-DIBDM_IBNL_DIR='"$(libdir)/ibdm$(VERSION)"'
 
71
endif
 
72
 
 
73
AM_CXXFLAGS = $(DBG) $(IBNL_PATH) $(TCL_CPPFLAGS)
 
74
AM_CFLAGS =   $(DBG) $(IBNL_PATH) $(TCL_CFLAGS)
 
75
 
 
76
lib_LTLIBRARIES = libibdmcom.la libibdm.la
 
77
libibdmcom_la_SOURCES = $(common_SOURCES)
 
78
libibdmcom_la_LIBADD = 
 
79
libibdmcom_la_LDFLAGS = -version-info $(LIB_VER_TRIPLET)
 
80
 
 
81
libibdm_la_SOURCES = ibdm_wrap.cpp ibdm.i $(common_SOURCES)
 
82
libibdm_la_LIBADD = $(TCL_LIBS) 
 
83
libibdm_la_LDFLAGS = -Wl,-rpath -Wl,$(TCL_PREFIX)/lib -version-info $(LIB_VER_TRIPLET) -no-undefined
 
84
 
 
85
bin_PROGRAMS  = ibdmsh
 
86
ibdmsh_SOURCES = ibdmsh_wrap.cpp
 
87
ibdmsh_LDADD =  -libdmcom $(TCL_LIBS)
 
88
ibdmsh_LDFLAGS = -static -Wl,-rpath -Wl,$(TCL_PREFIX)/lib
 
89
ibdmsh_DEPENDENCIES=$(lib_LTLIBRARIES)
 
90
 
 
91
$(srcdir)/Fabric.cpp: $(srcdir)/git_version.h
 
92
 
 
93
# track latest GIT version for this tree:
 
94
GIT=$(shell which git)
 
95
 
 
96
$(srcdir)/git_version.h:  @MAINTAINER_MODE_TRUE@ FORCE
 
97
        if test x$(GIT) != x ; then \
 
98
           gitver=`cd $(srcdir) ; git rev-parse --verify HEAD`; \
 
99
           changes=`cd $(srcdir) ; git diff . | grep ^diff | wc -l`; \
 
100
        else \
 
101
           gitver=undefined; changes=0; \
 
102
        fi ; \
 
103
        if test $$changes != 0; then gitver="$$gitver with-local-mods"; fi; \
 
104
        echo "#define IBDM_CODE_VERSION \"$$gitver\"" > .git_version.h ;\
 
105
        if test -f $(srcdir)/git_version.h ; then \
 
106
                if test `diff .git_version.h $(srcdir)/git_version.h | wc -l` != 0; then \
 
107
                        mv -f .git_version.h $(srcdir)/git_version.h; \
 
108
                        echo "Updated code version to: $$gitver"; \
 
109
                fi; \
 
110
        else \
 
111
                mv -f .git_version.h $(srcdir)/git_version.h; \
 
112
                echo "Creates code version to: $$gitver"; \
 
113
        fi;
 
114
 
 
115
FORCE:
 
116
 
 
117
# Workaound for libtool to use g++ for linking (verified as un-needed but JIC)
 
118
# CXXLINK = $(LIBTOOL) --tag=CXX --mode=link \
 
119
#           $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) $(LDFLAGS) -o $@
 
120
 
 
121
# only generate the swig wrappers if they do not exist...
 
122
# so we avoid un-needed swig dependency
 
123
if HAS_SWIG
 
124
$(srcdir)/ibdm_wrap.cpp: @MAINTAINER_MODE_TRUE@ $(srcdir)/ibdm.i
 
125
        swig -c++ -dhtml -tcl8 -o swig_wrap.c $(srcdir)/ibdm.i
 
126
        $(srcdir)/fixSwigWrapper -g -s -p -o $@
 
127
        rm -f swig_wrap.c
 
128
 
 
129
$(srcdir)/ibdmsh_wrap.cpp: @MAINTAINER_MODE_TRUE@ $(srcdir)/ibdm.i
 
130
        swig -c++ -dhtml -tcl8  -ltclsh.i -o swig_wrap.c $(srcdir)/ibdm.i
 
131
        $(srcdir)/fixSwigWrapper -g -s -p -r ibdm -o $@
 
132
        rm -f swig_wrap.c
 
133
endif
 
134
 
 
135
swigclean:
 
136
        rm -f $(srcdir)/ibdm_wrap.cpp $(srcdir)/ibdmsh_wrap.cpp *wrap.o
 
137
 
 
138
ibnl_parser.cc: @MAINTAINER_MODE_TRUE@ $(srcdir)/ibnl_parser.yy
 
139
        $(srcdir)/../config/ylwrap $(srcdir)/ibnl_parser.yy \
 
140
                y.tab.c ibnl_parser.cc \
 
141
                y.tab.h ibnl_parser.h \
 
142
                y.output ibnl_parser.output -- bison -y -d
 
143
        if test ! ibnl_parser.cc -ef $(srcdir)/ibnl_parser.cc ; then cp ibnl_parser.cc $(srcdir)/ibnl_parser.cc ; fi
 
144
        if test ! ibnl_parser.h -ef $(srcdir)/ibnl_parser.h ; then cp ibnl_parser.h $(srcdir)/ibnl_parser.h; fi
 
145
 
 
146
ibnl_scanner.cc: @MAINTAINER_MODE_TRUE@ $(srcdir)/ibnl_scanner.ll
 
147
        $(srcdir)/../config/ylwrap $(srcdir)/ibnl_scanner.ll \
 
148
                lex.yy.c ibnl_scanner.cc -- flex
 
149
        if test ! ibnl_scanner.cc -ef $(srcdir)/ibnl_scanner.cc ; then cp ibnl_scanner.cc $(srcdir)/ibnl_scanner.cc; fi
 
150
 
 
151
# Don't distribute common.h, since it is build host dependent!
 
152
dist-hook: git_version.h
 
153
        rm -f $(distdir)/common.h
 
154
 
 
155
# we need there extra in the distribution as their dependency is not defined
 
156
EXTRA_DIST = swig_alternate_mangling.cpp fixSwigWrapper pkgIndex.tcl ibdm.i
 
157
 
 
158
# this actually over write the lib install
 
159
install-exec-am: install-binPROGRAMS
 
160
        mkdir -p $(DESTDIR)$(libdir)/ibdm$(VERSION)
 
161
        cp .libs/$(shell grep dlname libibdm.la | sed 's/.*=\(.*\)/\1/') \
 
162
           $(DESTDIR)$(libdir)/ibdm$(VERSION)/libibdm.so.$(VERSION)
 
163
        sed 's/%VERSION%/'$(VERSION)'/g' $(srcdir)/pkgIndex.tcl > $(DESTDIR)$(libdir)/ibdm$(VERSION)/pkgIndex.tcl
 
164