mirror of
https://github.com/nasa/trick.git
synced 2024-12-18 12:56:26 +00:00
Convert configure script to autoconf
Replaced our handmade configure script with one created with autoconf. Added a config_user.mk.in file that is populated with the output of a configure. Some platform specific makefile assignments that never change are included in the files config_Darwin.mk and config_Linux.mk. refs #13
This commit is contained in:
parent
77510d0ccd
commit
7f48653697
6
.gitignore
vendored
6
.gitignore
vendored
@ -1,5 +1,6 @@
|
||||
config.status.*
|
||||
config_*.mk
|
||||
config.status*
|
||||
config.log
|
||||
share/trick/makefiles/config_user.mk
|
||||
object_*
|
||||
io_src
|
||||
swig
|
||||
@ -19,3 +20,4 @@ bin/trick-fxplot
|
||||
bin/trick-gxplot
|
||||
bin/trick-trk2ascii
|
||||
bin/trick-trk2csv
|
||||
aclocal.m4
|
||||
|
4
Makefile
4
Makefile
@ -309,12 +309,8 @@ ifeq ($(USE_ER7_UTILS_INTEGRATORS), 1)
|
||||
clean_swig: make_er7_makefiles
|
||||
endif
|
||||
|
||||
ifeq ($(DEVELOPER),1)
|
||||
clean_ICG :
|
||||
$(MAKE) -C ${TRICK_HOME}/trick_source/codegen/Interface_Code_Gen clean
|
||||
else
|
||||
clean_ICG :
|
||||
endif
|
||||
|
||||
clean_unit_test:
|
||||
@/bin/rm -rf ${TRICK_HOME}/trick_test/*.xml
|
||||
|
129
configure.ac
Normal file
129
configure.ac
Normal file
@ -0,0 +1,129 @@
|
||||
AC_INIT([Trick],[16.0])
|
||||
AC_LANG(C++)
|
||||
|
||||
AC_DEFUN([AX_LLVM_HOME],[
|
||||
AC_ARG_WITH([llvm],
|
||||
AS_HELP_STRING([--with-llvm@<:@=DIR@:>@], [LLVM root directory]),
|
||||
[LLVM_HOME="$withval"],
|
||||
[LLVM_HOME="/usr"]
|
||||
)
|
||||
AC_CHECK_FILE([$LLVM_HOME/bin/llvm-config],
|
||||
[AC_SUBST([LLVM_HOME])],
|
||||
AC_MSG_ERROR([could not find $LLVM_HOME/bin/llvm-config])
|
||||
)
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_HDF5_HOME],[
|
||||
AC_ARG_WITH([hdf5],
|
||||
AS_HELP_STRING([--with-hdf5@<:@=DIR@:>@], [HDF5 root directory]),
|
||||
[HDF5_HOME="$withval"
|
||||
AC_CHECK_FILE([$HDF5_HOME/include/hdf5.h],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $HDF5_HOME/include/hdf5.h])
|
||||
)
|
||||
],
|
||||
[HDF5_HOME=""]
|
||||
)
|
||||
AC_SUBST([HDF5_HOME])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_DMTCP_HOME],[
|
||||
AC_ARG_WITH([dmtcp],
|
||||
AS_HELP_STRING([--with-dmtcp@<:@=DIR@:>@], [DMTCP root directory]),
|
||||
[DMTCP_HOME="$withval"
|
||||
AC_CHECK_FILE([$DMTCP_HOME/include/dmtcpaware.h],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $DMTCP_HOME/include/dmtcpaware.h])
|
||||
)
|
||||
],
|
||||
[DMTCP_HOME=""]
|
||||
)
|
||||
AC_SUBST([DMTCP_HOME])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_TPRO_HOME],[
|
||||
AC_ARG_WITH([tpro],
|
||||
AS_HELP_STRING([--with-tpro@<:@=DIR@:>@], [TPRO root directory]),
|
||||
[TPROCTE_HOME="$withval"
|
||||
AC_CHECK_FILE([$TPRO_HOME/h/tpro.h],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $TPRO_HOME/h/tpro.h])
|
||||
)
|
||||
],
|
||||
[TPROCTE_HOME=""]
|
||||
)
|
||||
AC_SUBST([TPROCTE_HOME])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_BC635_HOME],[
|
||||
AC_ARG_WITH([bc635],
|
||||
AS_HELP_STRING([--with-bc635@<:@=DIR@:>@], [BC635 root directory]),
|
||||
[BC635_HOME="$withval"
|
||||
AC_CHECK_FILE([$BC635_HOME/sample/bcuser.h],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $BC635_HOME/sample/bcuser.h])
|
||||
)
|
||||
],
|
||||
[BC635_HOME=""]
|
||||
)
|
||||
AC_SUBST([BC635_HOME])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_GSL_HOME],[
|
||||
AC_ARG_WITH([bc635],
|
||||
AS_HELP_STRING([--with-bc635@<:@=DIR@:>@], [GSL root directory]),
|
||||
[GSL_HOME="$withval"
|
||||
AC_CHECK_FILE([$GSL_HOME/include/gsl],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $GSL_HOME/sample/bcuser.h])
|
||||
)
|
||||
],
|
||||
[GSL_HOME=""]
|
||||
)
|
||||
AC_SUBST([GSL_HOME])
|
||||
])
|
||||
|
||||
AC_DEFUN([AX_GTEST_HOME],[
|
||||
AC_ARG_WITH([bc635],
|
||||
AS_HELP_STRING([--with-bc635@<:@=DIR@:>@], [GTEST root directory]),
|
||||
[GTEST_HOME="$withval"
|
||||
AC_CHECK_FILE([$GTEST_HOME/include/gtest],
|
||||
[],
|
||||
AC_MSG_ERROR([could not find $GTEST_HOME/sample/bcuser.h])
|
||||
)
|
||||
],
|
||||
[GTEST_HOME=""]
|
||||
)
|
||||
AC_SUBST([GTEST_HOME])
|
||||
])
|
||||
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
AC_PROG_AWK
|
||||
AC_PROG_SED
|
||||
AC_PROG_LEX
|
||||
AC_PATH_PROG(BISON, bison, bison)
|
||||
AC_PATH_PROG(PERL, perl, perl)
|
||||
AX_PKG_SWIG(1.3.29, [], [ AC_MSG_ERROR([SWIG is required to build..]) ])
|
||||
AX_PROG_JAVAC
|
||||
|
||||
AC_CHECK_LIB(xml2, main,
|
||||
[LIBXML=-lxml2
|
||||
AC_SUBST([LIBXML])]
|
||||
)
|
||||
|
||||
AX_LLVM_HOME([])
|
||||
AX_HDF5_HOME([])
|
||||
AX_DMTCP_HOME([])
|
||||
AX_TPRO_HOME([])
|
||||
AX_BC635_HOME([])
|
||||
AX_GSL_HOME([])
|
||||
AX_GTEST_HOME([])
|
||||
|
||||
AX_PYTHON_DEVEL([>='2.5'])
|
||||
AC_CHECK_HEADER(Xm/Xm.h, [MOTIF_HOME="/usr"], AC_CHECK_FILE(/sw/include/Xm/Xm.h, [MOTIF_HOME="/sw"]))
|
||||
AC_SUBST([MOTIF_HOME])
|
||||
|
||||
|
||||
AC_OUTPUT([share/trick/makefiles/config_user.mk])
|
||||
|
@ -1,14 +1,25 @@
|
||||
|
||||
ifeq ( $(shell test -e ${TRICK_HOME}/trick_source/er7_utils),0)
|
||||
$(info ER7 Utils Exists#########)
|
||||
endif
|
||||
SHELL := /bin/sh
|
||||
CD := cd
|
||||
MV := /bin/mv
|
||||
RM := /bin/rm
|
||||
CP := /bin/cp
|
||||
PWD = $(shell /bin/pwd)
|
||||
|
||||
export TRICK_HOST_TYPE := $(shell export TRICK_HOME=$(TRICK_HOME) && $(TRICK_HOME)/bin/trick-gte TRICK_HOST_TYPE)
|
||||
export TRICK_VERSION := $(shell export TRICK_HOME=$(TRICK_HOME) && $(TRICK_HOME)/bin/trick-version -v)
|
||||
export TRICK_MAJOR := $(shell export TRICK_HOME=$(TRICK_HOME) && $(TRICK_HOME)/bin/trick-version -y)
|
||||
export TRICK_MINOR := $(shell export TRICK_HOME=$(TRICK_HOME) && $(TRICK_HOME)/bin/trick-version -m)
|
||||
|
||||
-include $(TRICK_HOME)/share/trick/makefiles/config_${TRICK_HOST_TYPE}.mk
|
||||
UNAME_M := $(shell uname -m)
|
||||
ifeq ($(UNAME_M),x86_64)
|
||||
TRICK_LIB_DIR := ${TRICK_HOME}/lib64
|
||||
else
|
||||
TRICK_LIB_DIR := ${TRICK_HOME}/lib
|
||||
endif
|
||||
|
||||
include $(TRICK_HOME)/share/trick/makefiles/config_${TRICK_HOST_TYPE}.mk
|
||||
-include $(TRICK_HOME)/share/trick/makefiles/config_user.mk
|
||||
|
||||
ifndef TRICK_CC
|
||||
export TRICK_CC := $(CC)
|
||||
@ -40,18 +51,6 @@ $(error Please run $(TRICK_HOME)/configure before running make)
|
||||
endif
|
||||
endif
|
||||
|
||||
# Check if configure script has modifications
|
||||
#ifeq ($(shell test ${TRICK_HOME}/configure -nt \
|
||||
#${TRICK_HOME}/config_${TRICK_HOST_TYPE}.mk && echo "NEW_CONFIG"), NEW_CONFIG)
|
||||
# # Ignore check if using installation path of /usr/local/trick (i.e. SLAX CD)
|
||||
# # Timestamps during ISO creation may be misleading due to file copy prodecures
|
||||
# TEMP = $(shell echo "${TRICK_HOME}" | sed -e 's/\/usr\/local\/trick.*/LINUXLIVE/')
|
||||
# ifneq ($(TEMP), LINUXLIVE)
|
||||
# # Force running of the configure script if it is newer than config_*.mk)
|
||||
# $(warning [31mPlease rerun "${TRICK_HOME}/[1m[7mconfigure[0m" to get the newest configuration changes. Then follow by running "[2m[3m[4mmake -C $$TRICK_HOME clean all[0m")
|
||||
# endif
|
||||
#endif
|
||||
|
||||
# Do this section only once
|
||||
ifndef TRICK_MAKE_COMMON
|
||||
export TRICK_MAKE_COMMON := 1
|
||||
@ -73,6 +72,8 @@ TRICK_CXXFLAGS += $(TRICK_ADDITIONAL_CXXFLAGS)
|
||||
# -fexceptions is included to propogate execptions through C code.
|
||||
TRICK_CFLAGS += -fexceptions
|
||||
|
||||
HAVE_ZEROCONF ?= 0
|
||||
|
||||
ifeq ($(HAVE_ZEROCONF),1)
|
||||
TRICK_CFLAGS += -DHAVE_ZEROCONF
|
||||
TRICK_CXXFLAGS += -DHAVE_ZEROCONF
|
||||
@ -132,8 +133,8 @@ TRICK_DEFINES = $(shell $(PERL) -e '@defines = "${TRICK_CFLAGS}" =~ /-D\s*(\S+)/
|
||||
|
||||
IO_SRC_DIR := io_src/
|
||||
OBJ_DIR := object_${TRICK_HOST_CPU}
|
||||
TRICK_LIBS := -Wl,-rpath=${TRICK_HOME}/lib:${TRICK_HOME}/lib64 -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip
|
||||
TRICK_STATIC_LIB := ${TRICK_LIB_DIR}/libtrick.a
|
||||
TRICK_RANLIB =
|
||||
|
||||
DEPFILE = $(PWD)/Makefile_deps
|
||||
DEPTEMPFILE = $(PWD)/Makefile_temp_depends
|
||||
|
10
share/trick/makefiles/config_Darwin.mk
Normal file
10
share/trick/makefiles/config_Darwin.mk
Normal file
@ -0,0 +1,10 @@
|
||||
|
||||
SHARED_LIB_OPT := -dynamiclib -Wl,-undefined,dynamic_lookup
|
||||
|
||||
TRICK_LIB_DIR := ${TRICK_HOME}/lib
|
||||
TRICK_LIBS := -Wl,-rpath,${TRICK_HOME}/lib -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip
|
||||
TRICK_LDFLAGS +=
|
||||
LD_WHOLE_ARCHIVE := -Wl,-all_load
|
||||
LD_NO_WHOLE_ARCHIVE :=
|
||||
TRICK_EXEC_LINK_LIBS += -lm -lpthread -ldl -lz $(PYTHON_LIB)
|
||||
|
46
share/trick/makefiles/config_Linux.mk
Normal file
46
share/trick/makefiles/config_Linux.mk
Normal file
@ -0,0 +1,46 @@
|
||||
|
||||
SHARED_LIB_OPT := -shared
|
||||
TRICK_LIBS = -Wl,-rpath=${TRICK_HOME}/lib:${TRICK_HOME}/lib64 -L${TRICK_LIB_DIR} -ltrick -ltrick_pyip
|
||||
|
||||
ifeq ($(MAKELEVEL),0)
|
||||
export TRICK_LDFLAGS += -Wl,--export-dynamic
|
||||
export TRICK_EXEC_LINK_LIBS += -lm -lrt -lpthread -ldl -lz $(PYTHON_LIB)
|
||||
endif
|
||||
|
||||
LD_WHOLE_ARCHIVE := -Wl,-whole-archive
|
||||
LD_NO_WHOLE_ARCHIVE := -Wl,-no-whole-archive
|
||||
|
||||
ifneq ($(DMTCP),)
|
||||
TRICK_EXEC_LINK_LIBS += -L$(DMTCP)/dmtcpaware -ldmtcpaware
|
||||
endif
|
||||
|
||||
ifneq ($(TPROCTE),)
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -D_TPRO_CTE -I$(TPROCTE)/h
|
||||
TRICK_EXEC_LINK_LIBS += $(TPROCTE)/lib/libtpro.a
|
||||
endif
|
||||
|
||||
ifneq ($(BC635),)
|
||||
# BC635 driver ver 118 and earlier do not have proper include and lib dirs.
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -D_BC635 -DLINUX -I$(BC635)/sample
|
||||
TRICK_EXEC_LINK_LIBS += $(BC635)/sample/bcsdklib.a
|
||||
endif
|
||||
|
||||
ifeq ($(HAVE_ZEROCONF),1)
|
||||
TRICK_EXEC_LINK_LIBS += -lavahi-client
|
||||
endif
|
||||
|
||||
# Check BFD library version
|
||||
ifneq ($(BFD_HOME),)
|
||||
HAVE_BFD := 1
|
||||
TRICK_EXEC_LINK_LIBS += -lbfd
|
||||
endif
|
||||
|
||||
# determine if -std=c++0x or -std=c++11 compile flags are desired
|
||||
ifeq "" "c++0x"
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -std=c++0x -D_HAVE_TR1_RANDOM
|
||||
endif
|
||||
|
||||
ifeq "" "c++11"
|
||||
TRICK_ADDITIONAL_CXXFLAGS += -std=c++11 -D_HAVE_STL_RANDOM
|
||||
endif
|
||||
|
32
share/trick/makefiles/config_user.mk.in
Normal file
32
share/trick/makefiles/config_user.mk.in
Normal file
@ -0,0 +1,32 @@
|
||||
|
||||
AWK := @AWK@
|
||||
SED := @SED@
|
||||
CC = @CC@
|
||||
CXX = @CXX@
|
||||
LD = @CXX@
|
||||
PERL = @PERL@
|
||||
LEX = @LEX@
|
||||
YACC = @BISON@
|
||||
SWIG = @SWIG@
|
||||
PYTHON = @PYTHON@
|
||||
JAVAC = @JAVAC@
|
||||
|
||||
PYTHON_INCLUDES = @PYTHON_CPPFLAGS@
|
||||
PYTHON_LIB = @PYTHON_LDFLAGS@ @PYTHON_EXTRA_LIBS@
|
||||
# @PYTHON_EXTRA_LDFLAGS@
|
||||
|
||||
LLVM_HOME = @LLVM_HOME@
|
||||
MOTIF_HOME = @MOTIF_HOME@
|
||||
|
||||
HDF5 = @HDF5_HOME@
|
||||
DMTCP = @DMTCP_HOME@
|
||||
TPROCTE = @TPROCTE_HOME@
|
||||
BC635 = @BC635_HOME@
|
||||
GSL_HOME = @GSL_HOME@
|
||||
GTEST_HOME = @GTEST_HOME@
|
||||
|
||||
LIBXML = @LIBXML@
|
||||
|
||||
PREFIX = @prefix@
|
||||
CONFIG_MK = 1
|
||||
|
Loading…
Reference in New Issue
Block a user