Changes to Makefile for building on 64-bit RHEL

This commit is contained in:
Douglas Clowes
2014-07-30 11:40:47 +10:00
parent 972e3232cd
commit 6f2226fa40

View File

@ -25,65 +25,88 @@ INCFLAGS = -Ihardsup -I.. $(INC_HDF5) $(INC_TCL8)
# may be in different locations. This code tries to find the include files and
# libraries required in descending order of preference.
# TCL 8.4 or 8.5
LIB_TCL8 := $(firstword $(wildcard /usr/lib/libtcl8.5.a /usr/lib/libtcl8.5.so /usr/lib/libtcl8.4.a /usr/lib/libtcl8.4.so /usr/lib/libtcl.so))
LIB_TCL8 := $(firstword $(wildcard /usr/lib/libtcl8.5.so /usr/lib/libtcl8.5.so /usr/lib/libtcl8.4.so /usr/lib/libtcl8.4.so /usr/lib/libtcl.so))
libsearch = $(wildcard /usr/lib*/lib$(1).so /usr/lib*/lib$(1).so.? /usr/lib*/lib$(1).so.??* /usr/lib*/lib$(1).a)
libsearch1 = $(firstword $(call libsearch,$(1)))
incsearch = $(wildcard /usr/include/$(1) /usr/local/include/$(1))
incsearch1 = $(firstword $(call incsearch,$(1)))
ifeq (1,$(VERBOSE))
mylibs := tcl8.5 hdf5 mxml json ghttp
$(foreach mylib,$(mylibs),$(info libsearch($(mylib)) = $(call libsearch,$(mylib))))
$(foreach mylib,$(mylibs),$(info libsearch1($(mylib)) = $(call libsearch1,$(mylib))))
myincs := tcl.h tcl8.5/tcl.h tcl8.4/tcl.h hdf5.h mxml.h json/json.h ghttp.h
$(foreach myinc,$(myincs),$(info incsearch($(myinc)) = $(call incsearch,$(myinc))))
$(foreach myinc,$(myincs),$(info incsearch1($(myinc)) = $(call incsearch1,$(myinc))))
endif
# TCL 8.5 or 8.4
LIB_TCL8 = $(firstword $(call libsearch1,tcl8.5) $(call libsearch1,tcl8.4))
INC_TCL8 = $(firstword $(call incsearch1,tcl.h) $(call incsearch1,tcl8.5/tcl.h) $(call incsearch1,tcl8.4/tcl.h))
ifeq (,$(LIB_TCL8))
$(warning LIB_TCL8 not found)
else
XLIB_TCL8 := -L$(dir $(LIB_TCL8)) -l$(subst lib,,$(basename $(notdir $(LIB_TCL8))))
# $(info LIB_TCL8 = $(LIB_TCL8))
$(info LIB_TCL8 = $(LIB_TCL8))
endif
#
INC_TCL8 := $(firstword $(wildcard /usr/include/tcl.h /usr/include/tcl8.5/tcl.h /usr/lib/tcl8.4/tcl.h))
ifeq (,$(INC_TCL8))
$(warning INC_TCL8 not found)
else
$(info "INC_TCL8 is $(dir $(INC_TCL8))")
ifeq ($(dir $(INC_TCL8)),"/usr/include/")
$(info "TCL8 in /usr/include")
$(info TCL8 is $(INC_TCL8))
ifeq ("$(dir $(INC_TCL8))","/usr/include/")
$(info TCL8 in /usr/include)
INC_TCL8 :=
else
INC_TCL8 := -isystem $(dir $(INC_TCL8))
endif
# $(info INC_TCL8 = $(INC_TCL8))
$(info INC_TCL8 = $(INC_TCL8))
endif
# HDF5
LIB_HDF5 := $(firstword $(wildcard /usr/lib/libhdf5.a /usr/lib/libhdf5.so /usr/local/lib/libhdf5.a))
LIB_HDF5 := $(call libsearch1,hdf5)
ifeq (,$(LIB_HDF5))
$(warning LIB_HDF5 not found)
else
$(info LIB_HDF5 = $(LIB_HDF5))
endif
#
INC_HDF5 := $(firstword $(wildcard /usr/include/hdf5.h /usr/local/include/hdf5.h))
INC_HDF5 := $(call incsearch1,hdf5.h)
ifeq (,$(INC_HDF5))
$(warning INC_HDF5 not found)
else
$(info "INC_HDF5 is $(dir $(INC_HDF5))")
$(info HDF5 is $(INC_HDF5))
ifeq ("$(dir $(INC_HDF5))","/usr/include/")
$(info "HDF5 in /usr/include")
$(info HDF5 in /usr/include)
INC_HDF5 :=
else
INC_HDF5 := -I$(dir $(INC_HDF5))
endif
$(info INC_HDF5 = $(INC_HDF5))
endif
# JSON-C
LIB_JSON := $(firstword $(wildcard /usr/lib/libjson.a /usr/lib/libjson.so /usr/local/lib/libjson.a))
LIB_JSON = $(firstword $(call libsearch1,json-c) $(call libsearch1,json))
ifeq (,$(LIB_JSON))
$(warning LIB_JSON not found)
else
$(info LIB_JSON = $(LIB_JSON))
endif
# MXML
LIB_MXML := $(firstword $(wildcard /usr/lib/libmxml.a /usr/local/lib/libmxml.a))
LIB_MXML := $(call libsearch1,mxml)
ifeq (,$(LIB_MXML))
$(warning LIB_MXML not found)
else
$(info LIB_MXML = $(LIB_MXML))
endif
# GHTTP
LIB_HTTP := $(firstword $(wildcard /usr/lib/libghttp.a /usr/local/lib/libghttp.a))
LIB_HTTP := $(call libsearch1,ghttp)
ifeq (,$(LIB_HTTP))
$(warning LIB_HTTP not found)
else
$(info LIB_HTTP = $(LIB_HTTP))
endif
#