Makefile.def: Add libmpx.
* Makefile.def: Add libmpx. * configure.ac: Add libmpx. * Makefile.in: Regenerate. * configure: Regenerate. gcc/ * config/i386/linux-common.h (LIBMPX_LIBS): New. (LIBMPX_SPEC): New. (CHKP_SPEC): New. * gcc.c (CHKP_SPEC): New. (LINK_COMMAND_SPEC): Add CHKP_SPEC. * c-family/c.opt (static-libmpx): New. libmpx/ Initial commit. From-SVN: r221311
This commit is contained in:
parent
5a43417885
commit
5373cd33a8
27 changed files with 22045 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
2015-03-10 Ilya Enkovich <ilya.enkovich@intel.com>
|
||||
|
||||
* Makefile.def: Add libmpx.
|
||||
* configure.ac: Add libmpx.
|
||||
* Makefile.in: Regenerate.
|
||||
* configure: Regenerate.
|
||||
|
||||
2015-03-06 Kirill Yukhin <kirill.yukhin@intel.com>
|
||||
|
||||
* MAINTAINERS (CPU Port Maintainers): Add myself
|
||||
|
|
|
@ -130,6 +130,9 @@ target_modules = { module= libsanitizer;
|
|||
bootstrap=true;
|
||||
lib_path=.libs;
|
||||
raw_cxx=true; };
|
||||
target_modules = { module= libmpx;
|
||||
bootstrap=true;
|
||||
lib_path=.libs; };
|
||||
target_modules = { module= libvtv;
|
||||
bootstrap=true;
|
||||
lib_path=.libs;
|
||||
|
|
1018
Makefile.in
1018
Makefile.in
File diff suppressed because it is too large
Load diff
30
configure
vendored
30
configure
vendored
|
@ -2751,6 +2751,7 @@ target_libraries="target-libgcc \
|
|||
target-libstdc++-v3 \
|
||||
target-libsanitizer \
|
||||
target-libvtv \
|
||||
target-libmpx \
|
||||
target-libssp \
|
||||
target-libquadmath \
|
||||
target-libgfortran \
|
||||
|
@ -3290,6 +3291,30 @@ $as_echo "yes" >&6; }
|
|||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Enable libmpx on supported systems by request.
|
||||
if test -d ${srcdir}/libmpx; then
|
||||
if test x$enable_libmpx = xyes; then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libmpx support" >&5
|
||||
$as_echo_n "checking for libmpx support... " >&6; }
|
||||
if (srcdir=${srcdir}/libmpx; \
|
||||
. ${srcdir}/configure.tgt; \
|
||||
test "$LIBMPX_SUPPORTED" != "yes")
|
||||
then
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
|
||||
$as_echo "no" >&6; }
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
else
|
||||
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
|
||||
$as_echo "yes" >&6; }
|
||||
fi
|
||||
else
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Disable libquadmath for some systems.
|
||||
case "${target}" in
|
||||
avr-*-*)
|
||||
|
@ -7032,6 +7057,11 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
|
|||
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
|
||||
fi
|
||||
|
||||
# If we are building libmpx, bootstrap it.
|
||||
if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
|
||||
bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
|
||||
fi
|
||||
|
||||
# Determine whether gdb needs tk/tcl or not.
|
||||
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
|
||||
# and in that case we want gdb to be built without tk. Ugh!
|
||||
|
|
27
configure.ac
27
configure.ac
|
@ -162,6 +162,7 @@ target_libraries="target-libgcc \
|
|||
target-libstdc++-v3 \
|
||||
target-libsanitizer \
|
||||
target-libvtv \
|
||||
target-libmpx \
|
||||
target-libssp \
|
||||
target-libquadmath \
|
||||
target-libgfortran \
|
||||
|
@ -640,6 +641,27 @@ if test -d ${srcdir}/libvtv; then
|
|||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Enable libmpx on supported systems by request.
|
||||
if test -d ${srcdir}/libmpx; then
|
||||
if test x$enable_libmpx = xyes; then
|
||||
AC_MSG_CHECKING([for libmpx support])
|
||||
if (srcdir=${srcdir}/libmpx; \
|
||||
. ${srcdir}/configure.tgt; \
|
||||
test "$LIBMPX_SUPPORTED" != "yes")
|
||||
then
|
||||
AC_MSG_RESULT([no])
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
else
|
||||
AC_MSG_RESULT([yes])
|
||||
fi
|
||||
else
|
||||
noconfigdirs="$noconfigdirs target-libmpx"
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
|
||||
# Disable libquadmath for some systems.
|
||||
case "${target}" in
|
||||
avr-*-*)
|
||||
|
@ -2672,6 +2694,11 @@ if echo " ${target_configdirs} " | grep " libvtv " > /dev/null 2>&1 &&
|
|||
bootstrap_target_libs=${bootstrap_target_libs}target-libvtv,
|
||||
fi
|
||||
|
||||
# If we are building libmpx, bootstrap it.
|
||||
if echo " ${target_configdirs} " | grep " libmpx " > /dev/null 2>&1; then
|
||||
bootstrap_target_libs=${bootstrap_target_libs}target-libmpx,
|
||||
fi
|
||||
|
||||
# Determine whether gdb needs tk/tcl or not.
|
||||
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
|
||||
# and in that case we want gdb to be built without tk. Ugh!
|
||||
|
|
|
@ -1,3 +1,12 @@
|
|||
2015-03-10 Ilya Enkovich <ilya.enkovich@intel.com>
|
||||
|
||||
* config/i386/linux-common.h (LIBMPX_LIBS): New.
|
||||
(LIBMPX_SPEC): New.
|
||||
(CHKP_SPEC): New.
|
||||
* gcc.c (CHKP_SPEC): New.
|
||||
(LINK_COMMAND_SPEC): Add CHKP_SPEC.
|
||||
* c-family/c.opt (static-libmpx): New.
|
||||
|
||||
2015-03-10 Richard Biener <rguenther@suse.de>
|
||||
|
||||
PR middle-end/44563
|
||||
|
|
|
@ -1041,6 +1041,9 @@ fchkp-instrument-marked-only
|
|||
C ObjC C++ ObjC++ LTO Report Var(flag_chkp_instrument_marked_only) Init(0)
|
||||
Instrument only functions marked with bnd_instrument attribute.
|
||||
|
||||
static-libmpx
|
||||
Driver
|
||||
|
||||
fcilkplus
|
||||
C ObjC C++ ObjC++ LTO Report Var(flag_cilkplus) Init(0)
|
||||
Enable Cilk Plus
|
||||
|
|
|
@ -53,3 +53,27 @@ along with GCC; see the file COPYING3. If not see
|
|||
GNU_USER_TARGET_ENDFILE_SPEC, \
|
||||
GNU_USER_TARGET_MATHFILE_SPEC " " \
|
||||
ANDROID_ENDFILE_SPEC)
|
||||
|
||||
#ifndef LIBMPX_LIBS
|
||||
#define LIBMPX_LIBS "\
|
||||
%:include(libmpx.spec)%(link_libmpx)"
|
||||
#endif
|
||||
|
||||
#ifndef LIBMPX_SPEC
|
||||
#if defined(HAVE_LD_STATIC_DYNAMIC)
|
||||
#define LIBMPX_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:\
|
||||
%{static:--whole-archive -lmpx --no-whole-archive" LIBMPX_LIBS "}\
|
||||
%{!static:%{static-libmpx:" LD_STATIC_OPTION " --whole-archive}\
|
||||
-lmpx %{static-libmpx:--no-whole-archive " LD_DYNAMIC_OPTION \
|
||||
LIBMPX_LIBS "}}}}"
|
||||
#else
|
||||
#define LIBMPX_SPEC "\
|
||||
%{mmpx:%{fcheck-pointer-bounds:-lmpx" LIBMPX_LIBS "}}"
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CHKP_SPEC
|
||||
#define CHKP_SPEC "\
|
||||
%{!nostdlib:%{!nodefaultlibs:" LIBMPX_SPEC "}}"
|
||||
#endif
|
||||
|
|
|
@ -812,6 +812,10 @@ proper position among the other output files. */
|
|||
%{fvtable-verify=preinit: -lvtv -u_vtable_map_vars_start -u_vtable_map_vars_end}}"
|
||||
#endif
|
||||
|
||||
#ifndef CHKP_SPEC
|
||||
#define CHKP_SPEC ""
|
||||
#endif
|
||||
|
||||
/* -u* was put back because both BSD and SysV seem to support it. */
|
||||
/* %{static:} simply prevents an error message if the target machine
|
||||
doesn't handle -static. */
|
||||
|
@ -832,6 +836,7 @@ proper position among the other output files. */
|
|||
"%X %{o*} %{e*} %{N} %{n} %{r}\
|
||||
%{s} %{t} %{u*} %{z} %{Z} %{!nostdlib:%{!nostartfiles:%S}} " VTABLE_VERIFICATION_SPEC " \
|
||||
%{static:} %{L*} %(mfwrap) %(link_libgcc) " SANITIZER_EARLY_SPEC " %o\
|
||||
" CHKP_SPEC " \
|
||||
%{fopenacc|fopenmp|ftree-parallelize-loops=*:%:include(libgomp.spec)%(link_gomp)}\
|
||||
%{fcilkplus:%:include(libcilkrts.spec)%(link_cilkrts)}\
|
||||
%{fgnu-tm:%:include(libitm.spec)%(link_itm)}\
|
||||
|
|
3
libmpx/ChangeLog
Normal file
3
libmpx/ChangeLog
Normal file
|
@ -0,0 +1,3 @@
|
|||
2015-03-10 Ilya Enkovich <ilya.enkovich@intel.com>
|
||||
|
||||
Initial commit.
|
47
libmpx/Makefile.am
Normal file
47
libmpx/Makefile.am
Normal file
|
@ -0,0 +1,47 @@
|
|||
ACLOCAL_AMFLAGS = -I .. -I ../config
|
||||
|
||||
if LIBMPX_SUPPORTED
|
||||
SUBDIRS = mpxrt
|
||||
nodist_toolexeclib_HEADERS = libmpx.spec
|
||||
endif
|
||||
|
||||
## May be used by toolexeclibdir.
|
||||
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
|
||||
|
||||
# Work around what appears to be a GNU make bug handling MAKEFLAGS
|
||||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"JC1FLAGS=$(JC1FLAGS)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"includedir=$(includedir)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"LD=$(LD)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"NM=$(NM)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"DESTDIR=$(DESTDIR)"
|
643
libmpx/Makefile.in
Normal file
643
libmpx/Makefile.in
Normal file
|
@ -0,0 +1,643 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = .
|
||||
DIST_COMMON = ChangeLog $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
|
||||
$(top_srcdir)/configure $(am__configure_deps) \
|
||||
$(srcdir)/config.h.in $(srcdir)/../mkinstalldirs \
|
||||
$(srcdir)/libmpx.spec.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/libstdc++-raw-cxx.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
configure.lineno config.status.lineno
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = config.h
|
||||
CONFIG_CLEAN_FILES = libmpx.spec
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
SOURCES =
|
||||
MULTISRCTOP =
|
||||
MULTIBUILDTOP =
|
||||
MULTIDIRS =
|
||||
MULTISUBDIR =
|
||||
MULTIDO = true
|
||||
MULTICLEAN = true
|
||||
RECURSIVE_TARGETS = all-recursive check-recursive dvi-recursive \
|
||||
html-recursive info-recursive install-data-recursive \
|
||||
install-dvi-recursive install-exec-recursive \
|
||||
install-html-recursive install-info-recursive \
|
||||
install-pdf-recursive install-ps-recursive install-recursive \
|
||||
installcheck-recursive installdirs-recursive pdf-recursive \
|
||||
ps-recursive uninstall-recursive
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(toolexeclibdir)"
|
||||
HEADERS = $(nodist_toolexeclib_HEADERS)
|
||||
RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \
|
||||
distclean-recursive maintainer-clean-recursive
|
||||
AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
|
||||
$(RECURSIVE_CLEAN_TARGETS:-recursive=) tags TAGS ctags CTAGS
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
DIST_SUBDIRS = mpxrt
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSTDCXX_RAW_CXX_CXXFLAGS = @LIBSTDCXX_RAW_CXX_CXXFLAGS@
|
||||
LIBSTDCXX_RAW_CXX_LDFLAGS = @LIBSTDCXX_RAW_CXX_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XCFLAGS = @XCFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
enable_shared = @enable_shared@
|
||||
enable_static = @enable_static@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
link_libmpx = @link_libmpx@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
multi_basedir = @multi_basedir@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_noncanonical = @target_noncanonical@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
toolexecdir = @toolexecdir@
|
||||
toolexeclibdir = @toolexeclibdir@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
ACLOCAL_AMFLAGS = -I .. -I ../config
|
||||
@LIBMPX_SUPPORTED_TRUE@SUBDIRS = mpxrt
|
||||
@LIBMPX_SUPPORTED_TRUE@nodist_toolexeclib_HEADERS = libmpx.spec
|
||||
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
|
||||
|
||||
# Work around what appears to be a GNU make bug handling MAKEFLAGS
|
||||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"JC1FLAGS=$(JC1FLAGS)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"includedir=$(includedir)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"LD=$(LD)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"NM=$(NM)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"DESTDIR=$(DESTDIR)"
|
||||
|
||||
all: config.h
|
||||
$(MAKE) $(AM_MAKEFLAGS) all-recursive
|
||||
|
||||
.SUFFIXES:
|
||||
am--refresh:
|
||||
@:
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
echo ' cd $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps'; \
|
||||
$(am__cd) $(srcdir) && $(AUTOMAKE) --foreign --ignore-deps \
|
||||
&& exit 0; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign --ignore-deps Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
echo ' $(SHELL) ./config.status'; \
|
||||
$(SHELL) ./config.status;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
$(SHELL) ./config.status --recheck
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
$(am__cd) $(srcdir) && $(AUTOCONF)
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
$(am__cd) $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)
|
||||
$(am__aclocal_m4_deps):
|
||||
|
||||
config.h: stamp-h1
|
||||
@if test ! -f $@; then \
|
||||
rm -f stamp-h1; \
|
||||
$(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
|
||||
else :; fi
|
||||
|
||||
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
|
||||
@rm -f stamp-h1
|
||||
cd $(top_builddir) && $(SHELL) ./config.status config.h
|
||||
$(srcdir)/config.h.in: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
($(am__cd) $(top_srcdir) && $(AUTOHEADER))
|
||||
rm -f stamp-h1
|
||||
touch $@
|
||||
|
||||
distclean-hdr:
|
||||
-rm -f config.h stamp-h1
|
||||
libmpx.spec: $(top_builddir)/config.status $(srcdir)/libmpx.spec.in
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $@
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
distclean-libtool:
|
||||
-rm -f libtool config.lt
|
||||
|
||||
# GNU Make needs to see an explicit $(MAKE) variable in the command it
|
||||
# runs to enable its job server during parallel builds. Hence the
|
||||
# comments below.
|
||||
all-multi:
|
||||
$(MULTIDO) $(AM_MAKEFLAGS) DO=all multi-do # $(MAKE)
|
||||
install-multi:
|
||||
$(MULTIDO) $(AM_MAKEFLAGS) DO=install multi-do # $(MAKE)
|
||||
|
||||
mostlyclean-multi:
|
||||
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=mostlyclean multi-clean # $(MAKE)
|
||||
clean-multi:
|
||||
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=clean multi-clean # $(MAKE)
|
||||
distclean-multi:
|
||||
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=distclean multi-clean # $(MAKE)
|
||||
maintainer-clean-multi:
|
||||
$(MULTICLEAN) $(AM_MAKEFLAGS) DO=maintainer-clean multi-clean # $(MAKE)
|
||||
install-nodist_toolexeclibHEADERS: $(nodist_toolexeclib_HEADERS)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
|
||||
@list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
|
||||
echo "$$d$$p"; \
|
||||
done | $(am__base_list) | \
|
||||
while read files; do \
|
||||
echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(toolexeclibdir)'"; \
|
||||
$(INSTALL_HEADER) $$files "$(DESTDIR)$(toolexeclibdir)" || exit $$?; \
|
||||
done
|
||||
|
||||
uninstall-nodist_toolexeclibHEADERS:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(nodist_toolexeclib_HEADERS)'; test -n "$(toolexeclibdir)" || list=; \
|
||||
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
|
||||
test -n "$$files" || exit 0; \
|
||||
echo " ( cd '$(DESTDIR)$(toolexeclibdir)' && rm -f" $$files ")"; \
|
||||
cd "$(DESTDIR)$(toolexeclibdir)" && rm -f $$files
|
||||
|
||||
# This directory's subdirectories are mostly independent; you can cd
|
||||
# into them and run `make' without going through this Makefile.
|
||||
# To change the values of `make' variables: instead of editing Makefiles,
|
||||
# (1) if the variable is set in `config.status', edit `config.status'
|
||||
# (which will cause the Makefiles to be regenerated when you run `make');
|
||||
# (2) otherwise, pass the desired values on the `make' command line.
|
||||
$(RECURSIVE_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
dot_seen=yes; \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done; \
|
||||
if test "$$dot_seen" = "no"; then \
|
||||
$(MAKE) $(AM_MAKEFLAGS) "$$target-am" || exit 1; \
|
||||
fi; test -z "$$fail"
|
||||
|
||||
$(RECURSIVE_CLEAN_TARGETS):
|
||||
@fail= failcom='exit 1'; \
|
||||
for f in x $$MAKEFLAGS; do \
|
||||
case $$f in \
|
||||
*=* | --[!k]*);; \
|
||||
*k*) failcom='fail=yes';; \
|
||||
esac; \
|
||||
done; \
|
||||
dot_seen=no; \
|
||||
case "$@" in \
|
||||
distclean-* | maintainer-clean-*) list='$(DIST_SUBDIRS)' ;; \
|
||||
*) list='$(SUBDIRS)' ;; \
|
||||
esac; \
|
||||
rev=''; for subdir in $$list; do \
|
||||
if test "$$subdir" = "."; then :; else \
|
||||
rev="$$subdir $$rev"; \
|
||||
fi; \
|
||||
done; \
|
||||
rev="$$rev ."; \
|
||||
target=`echo $@ | sed s/-recursive//`; \
|
||||
for subdir in $$rev; do \
|
||||
echo "Making $$target in $$subdir"; \
|
||||
if test "$$subdir" = "."; then \
|
||||
local_target="$$target-am"; \
|
||||
else \
|
||||
local_target="$$target"; \
|
||||
fi; \
|
||||
($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) $$local_target) \
|
||||
|| eval $$failcom; \
|
||||
done && test -z "$$fail"
|
||||
tags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) tags); \
|
||||
done
|
||||
ctags-recursive:
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
test "$$subdir" = . || ($(am__cd) $$subdir && $(MAKE) $(AM_MAKEFLAGS) ctags); \
|
||||
done
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: tags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
if ($(ETAGS) --etags-include --version) >/dev/null 2>&1; then \
|
||||
include_option=--etags-include; \
|
||||
empty_fix=.; \
|
||||
else \
|
||||
include_option=--include; \
|
||||
empty_fix=; \
|
||||
fi; \
|
||||
list='$(SUBDIRS)'; for subdir in $$list; do \
|
||||
if test "$$subdir" = .; then :; else \
|
||||
test ! -f $$subdir/TAGS || \
|
||||
set "$$@" "$$include_option=$$here/$$subdir/TAGS"; \
|
||||
fi; \
|
||||
done; \
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: ctags-recursive $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
check-am: all-am
|
||||
check: check-recursive
|
||||
all-am: Makefile all-multi $(HEADERS) config.h
|
||||
installdirs: installdirs-recursive
|
||||
installdirs-am:
|
||||
for dir in "$(DESTDIR)$(toolexeclibdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-recursive
|
||||
install-exec: install-exec-recursive
|
||||
install-data: install-data-recursive
|
||||
uninstall: uninstall-recursive
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-recursive
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-multi clean-recursive
|
||||
|
||||
clean-am: clean-generic clean-libtool mostlyclean-am
|
||||
|
||||
distclean: distclean-multi distclean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-generic distclean-hdr \
|
||||
distclean-libtool distclean-tags
|
||||
|
||||
dvi: dvi-recursive
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-recursive
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-recursive
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-recursive
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-multi install-nodist_toolexeclibHEADERS
|
||||
|
||||
install-html: install-html-recursive
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-recursive
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-recursive
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-recursive
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-multi maintainer-clean-recursive
|
||||
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
|
||||
-rm -rf $(top_srcdir)/autom4te.cache
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-multi mostlyclean-recursive
|
||||
|
||||
mostlyclean-am: mostlyclean-generic mostlyclean-libtool
|
||||
|
||||
pdf: pdf-recursive
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-recursive
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-nodist_toolexeclibHEADERS
|
||||
|
||||
.MAKE: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) all all-multi \
|
||||
clean-multi ctags-recursive distclean-multi install-am \
|
||||
install-multi install-strip maintainer-clean-multi \
|
||||
mostlyclean-multi tags-recursive
|
||||
|
||||
.PHONY: $(RECURSIVE_CLEAN_TARGETS) $(RECURSIVE_TARGETS) CTAGS GTAGS \
|
||||
all all-am all-multi am--refresh check check-am clean \
|
||||
clean-generic clean-libtool clean-multi ctags ctags-recursive \
|
||||
distclean distclean-generic distclean-hdr distclean-libtool \
|
||||
distclean-multi distclean-tags dvi dvi-am html html-am info \
|
||||
info-am install install-am install-data install-data-am \
|
||||
install-dvi install-dvi-am install-exec install-exec-am \
|
||||
install-html install-html-am install-info install-info-am \
|
||||
install-man install-multi install-nodist_toolexeclibHEADERS \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip installcheck installcheck-am installdirs \
|
||||
installdirs-am maintainer-clean maintainer-clean-generic \
|
||||
maintainer-clean-multi mostlyclean mostlyclean-generic \
|
||||
mostlyclean-libtool mostlyclean-multi pdf pdf-am ps ps-am tags \
|
||||
tags-recursive uninstall uninstall-am \
|
||||
uninstall-nodist_toolexeclibHEADERS
|
||||
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
12
libmpx/acinclude.m4
Normal file
12
libmpx/acinclude.m4
Normal file
|
@ -0,0 +1,12 @@
|
|||
dnl ----------------------------------------------------------------------
|
||||
dnl This whole bit snagged from libgfortran.
|
||||
|
||||
sinclude(../libtool.m4)
|
||||
dnl The lines below arrange for aclocal not to bring an installed
|
||||
dnl libtool.m4 into aclocal.m4, while still arranging for automake to
|
||||
dnl add a definition of LIBTOOL to Makefile.in.
|
||||
ifelse(,,,[AC_SUBST(LIBTOOL)
|
||||
AC_DEFUN([AM_PROG_LIBTOOL])
|
||||
AC_DEFUN([AC_LIBTOOL_DLOPEN])
|
||||
AC_DEFUN([AC_PROG_LD])
|
||||
])
|
701
libmpx/aclocal.m4
vendored
Normal file
701
libmpx/aclocal.m4
vendored
Normal file
|
@ -0,0 +1,701 @@
|
|||
# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.64],,
|
||||
[m4_warning([this file was generated for autoconf 2.64.
|
||||
You have another version of autoconf. It may work, but is not guaranteed to.
|
||||
If you have problems, you may need to regenerate the build system entirely.
|
||||
To do so, use the procedure documented by the package, typically `autoreconf'.])])
|
||||
|
||||
# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_AUTOMAKE_VERSION(VERSION)
|
||||
# ----------------------------
|
||||
# Automake X.Y traces this macro to ensure aclocal.m4 has been
|
||||
# generated from the m4 files accompanying Automake X.Y.
|
||||
# (This private macro should not be called outside this file.)
|
||||
AC_DEFUN([AM_AUTOMAKE_VERSION],
|
||||
[am__api_version='1.11'
|
||||
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
|
||||
dnl require some minimum version. Point them to the right macro.
|
||||
m4_if([$1], [1.11.1], [],
|
||||
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
|
||||
])
|
||||
|
||||
# _AM_AUTOCONF_VERSION(VERSION)
|
||||
# -----------------------------
|
||||
# aclocal traces this macro to find the Autoconf version.
|
||||
# This is a private macro too. Using m4_define simplifies
|
||||
# the logic in aclocal, which can simply ignore this definition.
|
||||
m4_define([_AM_AUTOCONF_VERSION], [])
|
||||
|
||||
# AM_SET_CURRENT_AUTOMAKE_VERSION
|
||||
# -------------------------------
|
||||
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
|
||||
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
|
||||
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
|
||||
[AM_AUTOMAKE_VERSION([1.11.1])dnl
|
||||
m4_ifndef([AC_AUTOCONF_VERSION],
|
||||
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
|
||||
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
|
||||
|
||||
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
|
||||
# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
|
||||
# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
|
||||
#
|
||||
# Of course, Automake must honor this variable whenever it calls a
|
||||
# tool from the auxiliary directory. The problem is that $srcdir (and
|
||||
# therefore $ac_aux_dir as well) can be either absolute or relative,
|
||||
# depending on how configure is run. This is pretty annoying, since
|
||||
# it makes $ac_aux_dir quite unusable in subdirectories: in the top
|
||||
# source directory, any form will work fine, but in subdirectories a
|
||||
# relative path needs to be adjusted first.
|
||||
#
|
||||
# $ac_aux_dir/missing
|
||||
# fails when called from a subdirectory if $ac_aux_dir is relative
|
||||
# $top_srcdir/$ac_aux_dir/missing
|
||||
# fails if $ac_aux_dir is absolute,
|
||||
# fails when called from a subdirectory in a VPATH build with
|
||||
# a relative $ac_aux_dir
|
||||
#
|
||||
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
|
||||
# are both prefixed by $srcdir. In an in-source build this is usually
|
||||
# harmless because $srcdir is `.', but things will broke when you
|
||||
# start a VPATH build or use an absolute $srcdir.
|
||||
#
|
||||
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
|
||||
# iff we strip the leading $srcdir from $ac_aux_dir. That would be:
|
||||
# am_aux_dir='\$(top_srcdir)/'`expr "$ac_aux_dir" : "$srcdir//*\(.*\)"`
|
||||
# and then we would define $MISSING as
|
||||
# MISSING="\${SHELL} $am_aux_dir/missing"
|
||||
# This will work as long as MISSING is not called from configure, because
|
||||
# unfortunately $(top_srcdir) has no meaning in configure.
|
||||
# However there are other variables, like CC, which are often used in
|
||||
# configure, and could therefore not use this "fixed" $ac_aux_dir.
|
||||
#
|
||||
# Another solution, used here, is to always expand $ac_aux_dir to an
|
||||
# absolute PATH. The drawback is that using absolute paths prevent a
|
||||
# configured tree to be moved without reconfiguration.
|
||||
|
||||
AC_DEFUN([AM_AUX_DIR_EXPAND],
|
||||
[dnl Rely on autoconf to set up CDPATH properly.
|
||||
AC_PREREQ([2.50])dnl
|
||||
# expand $ac_aux_dir to an absolute path
|
||||
am_aux_dir=`cd $ac_aux_dir && pwd`
|
||||
])
|
||||
|
||||
# AM_CONDITIONAL -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 9
|
||||
|
||||
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
|
||||
# -------------------------------------
|
||||
# Define a conditional.
|
||||
AC_DEFUN([AM_CONDITIONAL],
|
||||
[AC_PREREQ(2.52)dnl
|
||||
ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
|
||||
[$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
|
||||
AC_SUBST([$1_TRUE])dnl
|
||||
AC_SUBST([$1_FALSE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
|
||||
_AM_SUBST_NOTMAKE([$1_FALSE])dnl
|
||||
m4_define([_AM_COND_VALUE_$1], [$2])dnl
|
||||
if $2; then
|
||||
$1_TRUE=
|
||||
$1_FALSE='#'
|
||||
else
|
||||
$1_TRUE='#'
|
||||
$1_FALSE=
|
||||
fi
|
||||
AC_CONFIG_COMMANDS_PRE(
|
||||
[if test -z "${$1_TRUE}" && test -z "${$1_FALSE}"; then
|
||||
AC_MSG_ERROR([[conditional "$1" was never defined.
|
||||
Usually this means the macro was only invoked conditionally.]])
|
||||
fi])])
|
||||
|
||||
# Do all the work for Automake. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
|
||||
# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 16
|
||||
|
||||
# This macro actually does too much. Some checks are only needed if
|
||||
# your package does certain things. But this isn't really a big deal.
|
||||
|
||||
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
|
||||
# AM_INIT_AUTOMAKE([OPTIONS])
|
||||
# -----------------------------------------------
|
||||
# The call with PACKAGE and VERSION arguments is the old style
|
||||
# call (pre autoconf-2.50), which is being phased out. PACKAGE
|
||||
# and VERSION should now be passed to AC_INIT and removed from
|
||||
# the call to AM_INIT_AUTOMAKE.
|
||||
# We support both call styles for the transition. After
|
||||
# the next Automake release, Autoconf can make the AC_INIT
|
||||
# arguments mandatory, and then we can depend on a new Autoconf
|
||||
# release and drop the old call support.
|
||||
AC_DEFUN([AM_INIT_AUTOMAKE],
|
||||
[AC_PREREQ([2.62])dnl
|
||||
dnl Autoconf wants to disallow AM_ names. We explicitly allow
|
||||
dnl the ones we care about.
|
||||
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
|
||||
AC_REQUIRE([AM_SET_CURRENT_AUTOMAKE_VERSION])dnl
|
||||
AC_REQUIRE([AC_PROG_INSTALL])dnl
|
||||
if test "`cd $srcdir && pwd`" != "`pwd`"; then
|
||||
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
|
||||
# is not polluted with repeated "-I."
|
||||
AC_SUBST([am__isrc], [' -I$(srcdir)'])_AM_SUBST_NOTMAKE([am__isrc])dnl
|
||||
# test to see if srcdir already configured
|
||||
if test -f $srcdir/config.status; then
|
||||
AC_MSG_ERROR([source directory already configured; run "make distclean" there first])
|
||||
fi
|
||||
fi
|
||||
|
||||
# test whether we have cygpath
|
||||
if test -z "$CYGPATH_W"; then
|
||||
if (cygpath --version) >/dev/null 2>/dev/null; then
|
||||
CYGPATH_W='cygpath -w'
|
||||
else
|
||||
CYGPATH_W=echo
|
||||
fi
|
||||
fi
|
||||
AC_SUBST([CYGPATH_W])
|
||||
|
||||
# Define the identity of the package.
|
||||
dnl Distinguish between old-style and new-style calls.
|
||||
m4_ifval([$2],
|
||||
[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
|
||||
AC_SUBST([PACKAGE], [$1])dnl
|
||||
AC_SUBST([VERSION], [$2])],
|
||||
[_AM_SET_OPTIONS([$1])dnl
|
||||
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
|
||||
m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
|
||||
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
|
||||
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
|
||||
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
|
||||
|
||||
_AM_IF_OPTION([no-define],,
|
||||
[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
|
||||
AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
|
||||
|
||||
# Some tools Automake needs.
|
||||
AC_REQUIRE([AM_SANITY_CHECK])dnl
|
||||
AC_REQUIRE([AC_ARG_PROGRAM])dnl
|
||||
AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOCONF, autoconf)
|
||||
AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
|
||||
AM_MISSING_PROG(AUTOHEADER, autoheader)
|
||||
AM_MISSING_PROG(MAKEINFO, makeinfo)
|
||||
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
|
||||
AC_REQUIRE([AM_PROG_MKDIR_P])dnl
|
||||
# We need awk for the "check" target. The system "awk" is bad on
|
||||
# some platforms.
|
||||
AC_REQUIRE([AC_PROG_AWK])dnl
|
||||
AC_REQUIRE([AC_PROG_MAKE_SET])dnl
|
||||
AC_REQUIRE([AM_SET_LEADING_DOT])dnl
|
||||
_AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
|
||||
[_AM_IF_OPTION([tar-pax], [_AM_PROG_TAR([pax])],
|
||||
[_AM_PROG_TAR([v7])])])
|
||||
_AM_IF_OPTION([no-dependencies],,
|
||||
[AC_PROVIDE_IFELSE([AC_PROG_CC],
|
||||
[_AM_DEPENDENCIES(CC)],
|
||||
[define([AC_PROG_CC],
|
||||
defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_CXX],
|
||||
[_AM_DEPENDENCIES(CXX)],
|
||||
[define([AC_PROG_CXX],
|
||||
defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
|
||||
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
|
||||
[_AM_DEPENDENCIES(OBJC)],
|
||||
[define([AC_PROG_OBJC],
|
||||
defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
|
||||
])
|
||||
_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
|
||||
dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
|
||||
dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
|
||||
dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
|
||||
AC_CONFIG_COMMANDS_PRE(dnl
|
||||
[m4_provide_if([_AM_COMPILER_EXEEXT],
|
||||
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
|
||||
])
|
||||
|
||||
dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
|
||||
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
|
||||
dnl mangled by Autoconf and run in a shell conditional statement.
|
||||
m4_define([_AC_COMPILER_EXEEXT],
|
||||
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
|
||||
|
||||
|
||||
# When config.status generates a header, we must update the stamp-h file.
|
||||
# This file resides in the same directory as the config header
|
||||
# that is generated. The stamp files are numbered to have different names.
|
||||
|
||||
# Autoconf calls _AC_AM_CONFIG_HEADER_HOOK (when defined) in the
|
||||
# loop where config.status creates the headers, so we can generate
|
||||
# our stamp files there.
|
||||
AC_DEFUN([_AC_AM_CONFIG_HEADER_HOOK],
|
||||
[# Compute $1's index in $config_headers.
|
||||
_am_arg=$1
|
||||
_am_stamp_count=1
|
||||
for _am_header in $config_headers :; do
|
||||
case $_am_header in
|
||||
$_am_arg | $_am_arg:* )
|
||||
break ;;
|
||||
* )
|
||||
_am_stamp_count=`expr $_am_stamp_count + 1` ;;
|
||||
esac
|
||||
done
|
||||
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_SH
|
||||
# ------------------
|
||||
# Define $install_sh.
|
||||
AC_DEFUN([AM_PROG_INSTALL_SH],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
if test x"${install_sh}" != xset; then
|
||||
case $am_aux_dir in
|
||||
*\ * | *\ *)
|
||||
install_sh="\${SHELL} '$am_aux_dir/install-sh'" ;;
|
||||
*)
|
||||
install_sh="\${SHELL} $am_aux_dir/install-sh"
|
||||
esac
|
||||
fi
|
||||
AC_SUBST(install_sh)])
|
||||
|
||||
# Add --enable-maintainer-mode option to configure. -*- Autoconf -*-
|
||||
# From Jim Meyering
|
||||
|
||||
# Copyright (C) 1996, 1998, 2000, 2001, 2002, 2003, 2004, 2005, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_MAINTAINER_MODE([DEFAULT-MODE])
|
||||
# ----------------------------------
|
||||
# Control maintainer-specific portions of Makefiles.
|
||||
# Default is to disable them, unless `enable' is passed literally.
|
||||
# For symmetry, `disable' may be passed as well. Anyway, the user
|
||||
# can override the default with the --enable/--disable switch.
|
||||
AC_DEFUN([AM_MAINTAINER_MODE],
|
||||
[m4_case(m4_default([$1], [disable]),
|
||||
[enable], [m4_define([am_maintainer_other], [disable])],
|
||||
[disable], [m4_define([am_maintainer_other], [enable])],
|
||||
[m4_define([am_maintainer_other], [enable])
|
||||
m4_warn([syntax], [unexpected argument to AM@&t@_MAINTAINER_MODE: $1])])
|
||||
AC_MSG_CHECKING([whether to am_maintainer_other maintainer-specific portions of Makefiles])
|
||||
dnl maintainer-mode's default is 'disable' unless 'enable' is passed
|
||||
AC_ARG_ENABLE([maintainer-mode],
|
||||
[ --][am_maintainer_other][-maintainer-mode am_maintainer_other make rules and dependencies not useful
|
||||
(and sometimes confusing) to the casual installer],
|
||||
[USE_MAINTAINER_MODE=$enableval],
|
||||
[USE_MAINTAINER_MODE=]m4_if(am_maintainer_other, [enable], [no], [yes]))
|
||||
AC_MSG_RESULT([$USE_MAINTAINER_MODE])
|
||||
AM_CONDITIONAL([MAINTAINER_MODE], [test $USE_MAINTAINER_MODE = yes])
|
||||
MAINT=$MAINTAINER_MODE_TRUE
|
||||
AC_SUBST([MAINT])dnl
|
||||
]
|
||||
)
|
||||
|
||||
AU_DEFUN([jm_MAINTAINER_MODE], [AM_MAINTAINER_MODE])
|
||||
|
||||
# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# AM_PROG_CC_C_O
|
||||
# --------------
|
||||
# Like AC_PROG_CC_C_O, but changed for automake.
|
||||
AC_DEFUN([AM_PROG_CC_C_O],
|
||||
[AC_REQUIRE([AC_PROG_CC_C_O])dnl
|
||||
AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([compile])dnl
|
||||
# FIXME: we rely on the cache variable name because
|
||||
# there is no other way.
|
||||
set dummy $CC
|
||||
am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
|
||||
eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
|
||||
if test "$am_t" != yes; then
|
||||
# Losing compiler, so override with the script.
|
||||
# FIXME: It is wrong to rewrite CC.
|
||||
# But if we don't then we get into trouble of one sort or another.
|
||||
# A longer-term fix would be to have automake use am__CC in this case,
|
||||
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
|
||||
CC="$am_aux_dir/compile $CC"
|
||||
fi
|
||||
dnl Make sure AC_PROG_CC is never called again, or it will override our
|
||||
dnl setting of CC.
|
||||
m4_define([AC_PROG_CC],
|
||||
[m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
|
||||
])
|
||||
|
||||
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6
|
||||
|
||||
# AM_MISSING_PROG(NAME, PROGRAM)
|
||||
# ------------------------------
|
||||
AC_DEFUN([AM_MISSING_PROG],
|
||||
[AC_REQUIRE([AM_MISSING_HAS_RUN])
|
||||
$1=${$1-"${am_missing_run}$2"}
|
||||
AC_SUBST($1)])
|
||||
|
||||
|
||||
# AM_MISSING_HAS_RUN
|
||||
# ------------------
|
||||
# Define MISSING if not defined so far and test if it supports --run.
|
||||
# If it does, set am_missing_run to use it, otherwise, to nothing.
|
||||
AC_DEFUN([AM_MISSING_HAS_RUN],
|
||||
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
|
||||
AC_REQUIRE_AUX_FILE([missing])dnl
|
||||
if test x"${MISSING+set}" != xset; then
|
||||
case $am_aux_dir in
|
||||
*\ * | *\ *)
|
||||
MISSING="\${SHELL} \"$am_aux_dir/missing\"" ;;
|
||||
*)
|
||||
MISSING="\${SHELL} $am_aux_dir/missing" ;;
|
||||
esac
|
||||
fi
|
||||
# Use eval to expand $SHELL
|
||||
if eval "$MISSING --run true"; then
|
||||
am_missing_run="$MISSING --run "
|
||||
else
|
||||
am_missing_run=
|
||||
AC_MSG_WARN([`missing' script is too old or missing])
|
||||
fi
|
||||
])
|
||||
|
||||
# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_MKDIR_P
|
||||
# ---------------
|
||||
# Check for `mkdir -p'.
|
||||
AC_DEFUN([AM_PROG_MKDIR_P],
|
||||
[AC_PREREQ([2.60])dnl
|
||||
AC_REQUIRE([AC_PROG_MKDIR_P])dnl
|
||||
dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
|
||||
dnl while keeping a definition of mkdir_p for backward compatibility.
|
||||
dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
|
||||
dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
|
||||
dnl Makefile.ins that do not define MKDIR_P, so we do our own
|
||||
dnl adjustment using top_builddir (which is defined more often than
|
||||
dnl MKDIR_P).
|
||||
AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
|
||||
case $mkdir_p in
|
||||
[[\\/$]]* | ?:[[\\/]]*) ;;
|
||||
*/*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
|
||||
esac
|
||||
])
|
||||
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 4
|
||||
|
||||
# _AM_MANGLE_OPTION(NAME)
|
||||
# -----------------------
|
||||
AC_DEFUN([_AM_MANGLE_OPTION],
|
||||
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
# _AM_SET_OPTION(NAME)
|
||||
# ------------------------------
|
||||
# Set option NAME. Presently that only means defining a flag for this option.
|
||||
AC_DEFUN([_AM_SET_OPTION],
|
||||
[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
|
||||
|
||||
# _AM_SET_OPTIONS(OPTIONS)
|
||||
# ----------------------------------
|
||||
# OPTIONS is a space-separated list of Automake options.
|
||||
AC_DEFUN([_AM_SET_OPTIONS],
|
||||
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
|
||||
|
||||
# _AM_IF_OPTION(OPTION, IF-SET, [IF-NOT-SET])
|
||||
# -------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
AC_DEFUN([_AM_IF_OPTION],
|
||||
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
|
||||
|
||||
# Check to make sure that the build environment is sane. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
|
||||
# Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5
|
||||
|
||||
# AM_SANITY_CHECK
|
||||
# ---------------
|
||||
AC_DEFUN([AM_SANITY_CHECK],
|
||||
[AC_MSG_CHECKING([whether build environment is sane])
|
||||
# Just in case
|
||||
sleep 1
|
||||
echo timestamp > conftest.file
|
||||
# Reject unsafe characters in $srcdir or the absolute working directory
|
||||
# name. Accept space and tab only in the latter.
|
||||
am_lf='
|
||||
'
|
||||
case `pwd` in
|
||||
*[[\\\"\#\$\&\'\`$am_lf]]*)
|
||||
AC_MSG_ERROR([unsafe absolute working directory name]);;
|
||||
esac
|
||||
case $srcdir in
|
||||
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
|
||||
AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
|
||||
esac
|
||||
|
||||
# Do `set' in a subshell so we don't clobber the current shell's
|
||||
# arguments. Must try -L first in case configure is actually a
|
||||
# symlink; some systems play weird games with the mod time of symlinks
|
||||
# (eg FreeBSD returns the mod time of the symlink's containing
|
||||
# directory).
|
||||
if (
|
||||
set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
|
||||
if test "$[*]" = "X"; then
|
||||
# -L didn't work.
|
||||
set X `ls -t "$srcdir/configure" conftest.file`
|
||||
fi
|
||||
rm -f conftest.file
|
||||
if test "$[*]" != "X $srcdir/configure conftest.file" \
|
||||
&& test "$[*]" != "X conftest.file $srcdir/configure"; then
|
||||
|
||||
# If neither matched, then we have a broken ls. This can happen
|
||||
# if, for instance, CONFIG_SHELL is bash and it inherits a
|
||||
# broken ls alias from the environment. This has actually
|
||||
# happened. Such a system could not be considered "sane".
|
||||
AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
|
||||
alias in your environment])
|
||||
fi
|
||||
|
||||
test "$[2]" = conftest.file
|
||||
)
|
||||
then
|
||||
# Ok.
|
||||
:
|
||||
else
|
||||
AC_MSG_ERROR([newly created file is older than distributed files!
|
||||
Check your system clock])
|
||||
fi
|
||||
AC_MSG_RESULT(yes)])
|
||||
|
||||
# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# AM_PROG_INSTALL_STRIP
|
||||
# ---------------------
|
||||
# One issue with vendor `install' (even GNU) is that you can't
|
||||
# specify the program used to strip binaries. This is especially
|
||||
# annoying in cross-compiling environments, where the build's strip
|
||||
# is unlikely to handle the host's binaries.
|
||||
# Fortunately install-sh will honor a STRIPPROG variable, so we
|
||||
# always use install-sh in `make install-strip', and initialize
|
||||
# STRIPPROG with the value of the STRIP variable (set by the user).
|
||||
AC_DEFUN([AM_PROG_INSTALL_STRIP],
|
||||
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
|
||||
# Installed binaries are usually stripped using `strip' when the user
|
||||
# run `make install-strip'. However `strip' might not be the right
|
||||
# tool to use in cross-compilation environments, therefore Automake
|
||||
# will honor the `STRIP' environment variable to overrule this program.
|
||||
dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
|
||||
if test "$cross_compiling" != no; then
|
||||
AC_CHECK_TOOL([STRIP], [strip], :)
|
||||
fi
|
||||
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
|
||||
AC_SUBST([INSTALL_STRIP_PROGRAM])])
|
||||
|
||||
# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
|
||||
# This macro is traced by Automake.
|
||||
AC_DEFUN([_AM_SUBST_NOTMAKE])
|
||||
|
||||
# AM_SUBST_NOTMAKE(VARIABLE)
|
||||
# ---------------------------
|
||||
# Public sister of _AM_SUBST_NOTMAKE.
|
||||
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
|
||||
|
||||
# Check how to create a tarball. -*- Autoconf -*-
|
||||
|
||||
# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 2
|
||||
|
||||
# _AM_PROG_TAR(FORMAT)
|
||||
# --------------------
|
||||
# Check how to create a tarball in format FORMAT.
|
||||
# FORMAT should be one of `v7', `ustar', or `pax'.
|
||||
#
|
||||
# Substitute a variable $(am__tar) that is a command
|
||||
# writing to stdout a FORMAT-tarball containing the directory
|
||||
# $tardir.
|
||||
# tardir=directory && $(am__tar) > result.tar
|
||||
#
|
||||
# Substitute a variable $(am__untar) that extract such
|
||||
# a tarball read from stdin.
|
||||
# $(am__untar) < result.tar
|
||||
AC_DEFUN([_AM_PROG_TAR],
|
||||
[# Always define AMTAR for backward compatibility.
|
||||
AM_MISSING_PROG([AMTAR], [tar])
|
||||
m4_if([$1], [v7],
|
||||
[am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
|
||||
[m4_case([$1], [ustar],, [pax],,
|
||||
[m4_fatal([Unknown tar format])])
|
||||
AC_MSG_CHECKING([how to create a $1 tar archive])
|
||||
# Loop over all known methods to create a tar archive until one works.
|
||||
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
|
||||
_am_tools=${am_cv_prog_tar_$1-$_am_tools}
|
||||
# Do not fold the above two line into one, because Tru64 sh and
|
||||
# Solaris sh will not grok spaces in the rhs of `-'.
|
||||
for _am_tool in $_am_tools
|
||||
do
|
||||
case $_am_tool in
|
||||
gnutar)
|
||||
for _am_tar in tar gnutar gtar;
|
||||
do
|
||||
AM_RUN_LOG([$_am_tar --version]) && break
|
||||
done
|
||||
am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
|
||||
am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
|
||||
am__untar="$_am_tar -xf -"
|
||||
;;
|
||||
plaintar)
|
||||
# Must skip GNU tar: if it does not support --format= it doesn't create
|
||||
# ustar tarball either.
|
||||
(tar --version) >/dev/null 2>&1 && continue
|
||||
am__tar='tar chf - "$$tardir"'
|
||||
am__tar_='tar chf - "$tardir"'
|
||||
am__untar='tar xf -'
|
||||
;;
|
||||
pax)
|
||||
am__tar='pax -L -x $1 -w "$$tardir"'
|
||||
am__tar_='pax -L -x $1 -w "$tardir"'
|
||||
am__untar='pax -r'
|
||||
;;
|
||||
cpio)
|
||||
am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
|
||||
am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
|
||||
am__untar='cpio -i -H $1 -d'
|
||||
;;
|
||||
none)
|
||||
am__tar=false
|
||||
am__tar_=false
|
||||
am__untar=false
|
||||
;;
|
||||
esac
|
||||
|
||||
# If the value was cached, stop now. We just wanted to have am__tar
|
||||
# and am__untar set.
|
||||
test -n "${am_cv_prog_tar_$1}" && break
|
||||
|
||||
# tar/untar a dummy directory, and stop if the command works
|
||||
rm -rf conftest.dir
|
||||
mkdir conftest.dir
|
||||
echo GrepMe > conftest.dir/file
|
||||
AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
|
||||
rm -rf conftest.dir
|
||||
if test -s conftest.tar; then
|
||||
AM_RUN_LOG([$am__untar <conftest.tar])
|
||||
grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
|
||||
fi
|
||||
done
|
||||
rm -rf conftest.dir
|
||||
|
||||
AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
|
||||
AC_MSG_RESULT([$am_cv_prog_tar_$1])])
|
||||
AC_SUBST([am__tar])
|
||||
AC_SUBST([am__untar])
|
||||
]) # _AM_PROG_TAR
|
||||
|
||||
m4_include([../config/acx.m4])
|
||||
m4_include([../config/lead-dot.m4])
|
||||
m4_include([../config/libstdc++-raw-cxx.m4])
|
||||
m4_include([../config/multi.m4])
|
||||
m4_include([../config/override.m4])
|
||||
m4_include([../libtool.m4])
|
||||
m4_include([../ltoptions.m4])
|
||||
m4_include([../ltsugar.m4])
|
||||
m4_include([../ltversion.m4])
|
||||
m4_include([../lt~obsolete.m4])
|
100
libmpx/config.h.in
Normal file
100
libmpx/config.h.in
Normal file
|
@ -0,0 +1,100 @@
|
|||
/* config.h.in. Generated from configure.ac by autoheader. */
|
||||
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
/* Define to 1 if you have the <memory.h> header file. */
|
||||
#undef HAVE_MEMORY_H
|
||||
|
||||
/* Define to 1 if you have the `secure_getenv' function. */
|
||||
#undef HAVE_SECURE_GETENV
|
||||
|
||||
/* Define to 1 if you have the <stdint.h> header file. */
|
||||
#undef HAVE_STDINT_H
|
||||
|
||||
/* Define to 1 if you have the <stdlib.h> header file. */
|
||||
#undef HAVE_STDLIB_H
|
||||
|
||||
/* Define to 1 if you have the <strings.h> header file. */
|
||||
#undef HAVE_STRINGS_H
|
||||
|
||||
/* Define to 1 if you have the <string.h> header file. */
|
||||
#undef HAVE_STRING_H
|
||||
|
||||
/* Define to 1 if you have the <sys/stat.h> header file. */
|
||||
#undef HAVE_SYS_STAT_H
|
||||
|
||||
/* Define to 1 if you have the <sys/types.h> header file. */
|
||||
#undef HAVE_SYS_TYPES_H
|
||||
|
||||
/* Define to 1 if you have the <unistd.h> header file. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Define to 1 if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
/* Define to the address where bug reports for this package should be sent. */
|
||||
#undef PACKAGE_BUGREPORT
|
||||
|
||||
/* Define to the full name of this package. */
|
||||
#undef PACKAGE_NAME
|
||||
|
||||
/* Define to the full name and version of this package. */
|
||||
#undef PACKAGE_STRING
|
||||
|
||||
/* Define to the one symbol short name of this package. */
|
||||
#undef PACKAGE_TARNAME
|
||||
|
||||
/* Define to the home page for this package. */
|
||||
#undef PACKAGE_URL
|
||||
|
||||
/* Define to the version of this package. */
|
||||
#undef PACKAGE_VERSION
|
||||
|
||||
/* Define to 1 if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Enable extensions on AIX 3, Interix. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif
|
||||
/* Enable GNU extensions on systems that have them. */
|
||||
#ifndef _GNU_SOURCE
|
||||
# undef _GNU_SOURCE
|
||||
#endif
|
||||
/* Enable threading extensions on Solaris. */
|
||||
#ifndef _POSIX_PTHREAD_SEMANTICS
|
||||
# undef _POSIX_PTHREAD_SEMANTICS
|
||||
#endif
|
||||
/* Enable extensions on HP NonStop. */
|
||||
#ifndef _TANDEM_SOURCE
|
||||
# undef _TANDEM_SOURCE
|
||||
#endif
|
||||
/* Enable general extensions on Solaris. */
|
||||
#ifndef __EXTENSIONS__
|
||||
# undef __EXTENSIONS__
|
||||
#endif
|
||||
|
||||
|
||||
/* Version number of package */
|
||||
#undef VERSION
|
||||
|
||||
/* Define to 1 if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to 2 if the system does not provide POSIX.1 features except with
|
||||
this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define to 1 if you need to in order for `stat' and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
17538
libmpx/configure
vendored
Normal file
17538
libmpx/configure
vendored
Normal file
File diff suppressed because it is too large
Load diff
133
libmpx/configure.ac
Normal file
133
libmpx/configure.ac
Normal file
|
@ -0,0 +1,133 @@
|
|||
# -*- Autoconf -*-
|
||||
# Process this file with autoconf to produce a configure script.
|
||||
|
||||
AC_PREREQ([2.64])
|
||||
AC_INIT(package-unused, version-unused, libmpx)
|
||||
|
||||
# -------
|
||||
# Options
|
||||
# -------
|
||||
AC_MSG_CHECKING([for --enable-version-specific-runtime-libs])
|
||||
AC_ARG_ENABLE(version-specific-runtime-libs,
|
||||
[ --enable-version-specific-runtime-libs Specify that runtime libraries should be installed in a compiler-specific directory ],
|
||||
[case "$enableval" in
|
||||
yes) version_specific_libs=yes ;;
|
||||
no) version_specific_libs=no ;;
|
||||
*) AC_MSG_ERROR([Unknown argument to enable/disable version-specific libs]);;
|
||||
esac],
|
||||
[version_specific_libs=no])
|
||||
AC_MSG_RESULT($version_specific_libs)
|
||||
|
||||
# Do not delete or change the following two lines. For why, see
|
||||
# http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html
|
||||
AC_CANONICAL_SYSTEM
|
||||
target_alias=${target_alias-$host_alias}
|
||||
AC_SUBST(target_alias)
|
||||
GCC_LIBSTDCXX_RAW_CXX_FLAGS
|
||||
|
||||
# See if supported.
|
||||
unset LIBMPX_SUPPORTED
|
||||
AC_MSG_CHECKING([for target support for Intel MPX runtime library])
|
||||
echo "int i[sizeof (void *) == 4 ? 1 : -1] = { __x86_64__ };" > conftest.c
|
||||
if AC_TRY_COMMAND([${CC} ${CFLAGS} -c -o conftest.o conftest.c 1>&AS_MESSAGE_LOG_FD])
|
||||
then
|
||||
LIBMPX_SUPPORTED=no
|
||||
else
|
||||
LIBMPX_SUPPORTED=yes
|
||||
fi
|
||||
rm -f conftest.o conftest.c
|
||||
AC_MSG_RESULT($LIBMPX_SUPPORTED)
|
||||
AM_CONDITIONAL(LIBMPX_SUPPORTED, [test "x$LIBMPX_SUPPORTED" = "xyes"])
|
||||
|
||||
link_libmpx="-lpthread"
|
||||
AC_SUBST(link_libmpx)
|
||||
|
||||
AM_INIT_AUTOMAKE(foreign no-dist no-dependencies)
|
||||
AM_ENABLE_MULTILIB(, ..)
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
AC_GNU_SOURCE
|
||||
AC_CHECK_FUNCS([secure_getenv])
|
||||
|
||||
# Calculate toolexeclibdir
|
||||
# Also toolexecdir, though it's only used in toolexeclibdir
|
||||
case ${version_specific_libs} in
|
||||
yes)
|
||||
# Need the gcc compiler version to know where to install libraries
|
||||
# and header files if --enable-version-specific-runtime-libs option
|
||||
# is selected.
|
||||
toolexecdir='$(libdir)/gcc/$(target_alias)'
|
||||
toolexeclibdir='$(toolexecdir)/$(gcc_version)$(MULTISUBDIR)'
|
||||
;;
|
||||
no)
|
||||
if test -n "$with_cross_host" &&
|
||||
test x"$with_cross_host" != x"no"; then
|
||||
# Install a library built with a cross compiler in tooldir, not libdir.
|
||||
toolexecdir='$(exec_prefix)/$(target_alias)'
|
||||
toolexeclibdir='$(toolexecdir)/lib'
|
||||
else
|
||||
toolexecdir='$(libdir)/gcc-lib/$(target_alias)'
|
||||
toolexeclibdir='$(libdir)'
|
||||
fi
|
||||
multi_os_directory=`$CC -print-multi-os-directory`
|
||||
case $multi_os_directory in
|
||||
.) ;; # Avoid trailing /.
|
||||
*) toolexeclibdir=$toolexeclibdir/$multi_os_directory ;;
|
||||
esac
|
||||
;;
|
||||
esac
|
||||
AC_SUBST(toolexecdir)
|
||||
AC_SUBST(toolexeclibdir)
|
||||
|
||||
# Check for programs.
|
||||
m4_rename([_AC_ARG_VAR_PRECIOUS],[real_PRECIOUS])
|
||||
m4_define([_AC_ARG_VAR_PRECIOUS],[])
|
||||
AC_PROG_CC
|
||||
AC_PROG_CXX
|
||||
m4_rename_force([real_PRECIOUS],[_AC_ARG_VAR_PRECIOUS])
|
||||
|
||||
AM_PROG_CC_C_O
|
||||
|
||||
AC_SUBST(CFLAGS)
|
||||
|
||||
# Newer automakes demand CCAS and CCASFLAGS.
|
||||
: ${CCAS='$(CC)'}
|
||||
: ${CCASFLAGS='$(CFLAGS)'}
|
||||
AC_SUBST(CCAS)
|
||||
AC_SUBST(CCASFLAGS)
|
||||
|
||||
AC_CHECK_TOOL(AS, as)
|
||||
AC_CHECK_TOOL(AR, ar)
|
||||
AC_CHECK_TOOL(RANLIB, ranlib, :)
|
||||
|
||||
# Configure libtool
|
||||
AC_LIBTOOL_DLOPEN
|
||||
AM_PROG_LIBTOOL
|
||||
AC_SUBST(enable_shared)
|
||||
AC_SUBST(enable_static)
|
||||
|
||||
XCFLAGS="-Wall -Wextra"
|
||||
AC_SUBST(XCFLAGS)
|
||||
|
||||
if test "${multilib}" = "yes"; then
|
||||
multilib_arg="--enable-multilib"
|
||||
else
|
||||
multilib_arg=
|
||||
fi
|
||||
|
||||
AC_CONFIG_FILES([Makefile libmpx.spec])
|
||||
AC_CONFIG_HEADERS(config.h)
|
||||
AC_CONFIG_FILES(AC_FOREACH([DIR], [mpxrt], [DIR/Makefile]),
|
||||
[cat > vpsed$$ << \_EOF
|
||||
s!`test -f '$<' || echo '$(srcdir)/'`!!
|
||||
_EOF
|
||||
sed -f vpsed$$ $ac_file > tmp$$
|
||||
mv tmp$$ $ac_file
|
||||
rm vpsed$$
|
||||
echo 'MULTISUBDIR =' >> $ac_file
|
||||
ml_norecursion=yes
|
||||
. ${multi_basedir}/config-ml.in
|
||||
AS_UNSET([ml_norecursion])
|
||||
])
|
||||
|
||||
AC_OUTPUT
|
29
libmpx/configure.tgt
Normal file
29
libmpx/configure.tgt
Normal file
|
@ -0,0 +1,29 @@
|
|||
# -*- shell-script -*-
|
||||
# Copyright (C) 2014 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
# the Free Software Foundation; either version 2 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with this program; if not see <http://www.gnu.org/licenses/>.
|
||||
|
||||
# This is the target specific configuration file. This is invoked by the
|
||||
# autoconf generated configure script. Putting it in a separate shell file
|
||||
# lets us skip running autoconf when modifying target specific information.
|
||||
|
||||
# Filter out unsupported systems.
|
||||
LIBMPX_SUPPORTED=no
|
||||
case "${target}" in
|
||||
x86_64-*-linux* | i?86-*-linux*)
|
||||
LIBMPX_SUPPORTED=yes
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
3
libmpx/libmpx.spec.in
Normal file
3
libmpx/libmpx.spec.in
Normal file
|
@ -0,0 +1,3 @@
|
|||
# This spec file is read by gcc when linking. It is used to specify the
|
||||
# standard libraries we need in order to link with libcilkrts.
|
||||
*link_libmpx: @link_libmpx@
|
6
libmpx/libtool-version
Normal file
6
libmpx/libtool-version
Normal file
|
@ -0,0 +1,6 @@
|
|||
# This file is used to maintain libtool version info for libmpx. See
|
||||
# the libtool manual to understand the meaning of the fields. This is
|
||||
# a separate file so that version updates don't involve re-running
|
||||
# automake.
|
||||
# CURRENT:REVISION:AGE
|
||||
0:0:0
|
60
libmpx/mpxrt/Makefile.am
Normal file
60
libmpx/mpxrt/Makefile.am
Normal file
|
@ -0,0 +1,60 @@
|
|||
ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config
|
||||
|
||||
if LIBMPX_SUPPORTED
|
||||
# May be used by toolexeclibdir.
|
||||
gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
|
||||
|
||||
AM_CPPFLAGS = -I$(top_srcdir)/..
|
||||
AM_CFLAGS = $(XCFLAGS)
|
||||
|
||||
toolexeclib_LTLIBRARIES = libmpx.la
|
||||
|
||||
libmpx_la_SOURCES = mpxrt.c mpxrt-utils.c
|
||||
|
||||
libmpx_la_CFLAGS = -fPIC
|
||||
libmpx_la_DEPENDENCIES = libmpx.map
|
||||
libmpx_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libmpx.map $(link_libmpx)
|
||||
|
||||
mpxrt.lo: mpxrt-utils.h
|
||||
mpxrt-utils.lo: mpxrt-utils.h
|
||||
endif
|
||||
|
||||
# Work around what appears to be a GNU make bug handling MAKEFLAGS
|
||||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"JC1FLAGS=$(JC1FLAGS)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"includedir=$(includedir)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"LD=$(LD)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"NM=$(NM)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"DESTDIR=$(DESTDIR)"
|
||||
|
||||
MAKEOVERRIDES=
|
549
libmpx/mpxrt/Makefile.in
Normal file
549
libmpx/mpxrt/Makefile.in
Normal file
|
@ -0,0 +1,549 @@
|
|||
# Makefile.in generated by automake 1.11.1 from Makefile.am.
|
||||
# @configure_input@
|
||||
|
||||
# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
|
||||
# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# This Makefile.in is free software; the Free Software Foundation
|
||||
# gives unlimited permission to copy and/or distribute it,
|
||||
# with or without modifications, as long as this notice is preserved.
|
||||
|
||||
# This program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
|
||||
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
|
||||
# PARTICULAR PURPOSE.
|
||||
|
||||
@SET_MAKE@
|
||||
|
||||
VPATH = @srcdir@
|
||||
pkgdatadir = $(datadir)/@PACKAGE@
|
||||
pkgincludedir = $(includedir)/@PACKAGE@
|
||||
pkglibdir = $(libdir)/@PACKAGE@
|
||||
pkglibexecdir = $(libexecdir)/@PACKAGE@
|
||||
am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd
|
||||
install_sh_DATA = $(install_sh) -c -m 644
|
||||
install_sh_PROGRAM = $(install_sh) -c
|
||||
install_sh_SCRIPT = $(install_sh) -c
|
||||
INSTALL_HEADER = $(INSTALL_DATA)
|
||||
transform = $(program_transform_name)
|
||||
NORMAL_INSTALL = :
|
||||
PRE_INSTALL = :
|
||||
POST_INSTALL = :
|
||||
NORMAL_UNINSTALL = :
|
||||
PRE_UNINSTALL = :
|
||||
POST_UNINSTALL = :
|
||||
build_triplet = @build@
|
||||
host_triplet = @host@
|
||||
target_triplet = @target@
|
||||
subdir = mpxrt
|
||||
DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/../config/acx.m4 \
|
||||
$(top_srcdir)/../config/lead-dot.m4 \
|
||||
$(top_srcdir)/../config/libstdc++-raw-cxx.m4 \
|
||||
$(top_srcdir)/../config/multi.m4 \
|
||||
$(top_srcdir)/../config/override.m4 \
|
||||
$(top_srcdir)/../libtool.m4 $(top_srcdir)/../ltoptions.m4 \
|
||||
$(top_srcdir)/../ltsugar.m4 $(top_srcdir)/../ltversion.m4 \
|
||||
$(top_srcdir)/../lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs
|
||||
CONFIG_HEADER = $(top_builddir)/config.h
|
||||
CONFIG_CLEAN_FILES =
|
||||
CONFIG_CLEAN_VPATH_FILES =
|
||||
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
|
||||
am__vpath_adj = case $$p in \
|
||||
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
|
||||
*) f=$$p;; \
|
||||
esac;
|
||||
am__strip_dir = f=`echo $$p | sed -e 's|^.*/||'`;
|
||||
am__install_max = 40
|
||||
am__nobase_strip_setup = \
|
||||
srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*|]/\\\\&/g'`
|
||||
am__nobase_strip = \
|
||||
for p in $$list; do echo "$$p"; done | sed -e "s|$$srcdirstrip/||"
|
||||
am__nobase_list = $(am__nobase_strip_setup); \
|
||||
for p in $$list; do echo "$$p $$p"; done | \
|
||||
sed "s| $$srcdirstrip/| |;"' / .*\//!s/ .*/ ./; s,\( .*\)/[^/]*$$,\1,' | \
|
||||
$(AWK) 'BEGIN { files["."] = "" } { files[$$2] = files[$$2] " " $$1; \
|
||||
if (++n[$$2] == $(am__install_max)) \
|
||||
{ print $$2, files[$$2]; n[$$2] = 0; files[$$2] = "" } } \
|
||||
END { for (dir in files) print dir, files[dir] }'
|
||||
am__base_list = \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
|
||||
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
|
||||
am__installdirs = "$(DESTDIR)$(toolexeclibdir)"
|
||||
LTLIBRARIES = $(toolexeclib_LTLIBRARIES)
|
||||
libmpx_la_LIBADD =
|
||||
@LIBMPX_SUPPORTED_TRUE@am_libmpx_la_OBJECTS = libmpx_la-mpxrt.lo \
|
||||
@LIBMPX_SUPPORTED_TRUE@ libmpx_la-mpxrt-utils.lo
|
||||
libmpx_la_OBJECTS = $(am_libmpx_la_OBJECTS)
|
||||
libmpx_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
|
||||
$(LIBTOOLFLAGS) --mode=link $(CCLD) $(libmpx_la_CFLAGS) \
|
||||
$(CFLAGS) $(libmpx_la_LDFLAGS) $(LDFLAGS) -o $@
|
||||
@LIBMPX_SUPPORTED_TRUE@am_libmpx_la_rpath = -rpath $(toolexeclibdir)
|
||||
DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)
|
||||
depcomp =
|
||||
am__depfiles_maybe =
|
||||
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
|
||||
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
|
||||
$(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
|
||||
CCLD = $(CC)
|
||||
LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
|
||||
--mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
|
||||
$(LDFLAGS) -o $@
|
||||
SOURCES = $(libmpx_la_SOURCES)
|
||||
ETAGS = etags
|
||||
CTAGS = ctags
|
||||
ACLOCAL = @ACLOCAL@
|
||||
AMTAR = @AMTAR@
|
||||
AR = @AR@
|
||||
AS = @AS@
|
||||
AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
CC = @CC@
|
||||
CCAS = @CCAS@
|
||||
CCASFLAGS = @CCASFLAGS@
|
||||
CFLAGS = @CFLAGS@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
FGREP = @FGREP@
|
||||
GREP = @GREP@
|
||||
INSTALL = @INSTALL@
|
||||
INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
LIBSTDCXX_RAW_CXX_CXXFLAGS = @LIBSTDCXX_RAW_CXX_CXXFLAGS@
|
||||
LIBSTDCXX_RAW_CXX_LDFLAGS = @LIBSTDCXX_RAW_CXX_LDFLAGS@
|
||||
LIBTOOL = @LIBTOOL@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MKDIR_P = @MKDIR_P@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
PACKAGE_STRING = @PACKAGE_STRING@
|
||||
PACKAGE_TARNAME = @PACKAGE_TARNAME@
|
||||
PACKAGE_URL = @PACKAGE_URL@
|
||||
PACKAGE_VERSION = @PACKAGE_VERSION@
|
||||
PATH_SEPARATOR = @PATH_SEPARATOR@
|
||||
RANLIB = @RANLIB@
|
||||
SED = @SED@
|
||||
SET_MAKE = @SET_MAKE@
|
||||
SHELL = @SHELL@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XCFLAGS = @XCFLAGS@
|
||||
abs_builddir = @abs_builddir@
|
||||
abs_srcdir = @abs_srcdir@
|
||||
abs_top_builddir = @abs_top_builddir@
|
||||
abs_top_srcdir = @abs_top_srcdir@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__tar = @am__tar@
|
||||
am__untar = @am__untar@
|
||||
bindir = @bindir@
|
||||
build = @build@
|
||||
build_alias = @build_alias@
|
||||
build_cpu = @build_cpu@
|
||||
build_os = @build_os@
|
||||
build_vendor = @build_vendor@
|
||||
builddir = @builddir@
|
||||
datadir = @datadir@
|
||||
datarootdir = @datarootdir@
|
||||
docdir = @docdir@
|
||||
dvidir = @dvidir@
|
||||
enable_shared = @enable_shared@
|
||||
enable_static = @enable_static@
|
||||
exec_prefix = @exec_prefix@
|
||||
host = @host@
|
||||
host_alias = @host_alias@
|
||||
host_cpu = @host_cpu@
|
||||
host_os = @host_os@
|
||||
host_vendor = @host_vendor@
|
||||
htmldir = @htmldir@
|
||||
includedir = @includedir@
|
||||
infodir = @infodir@
|
||||
install_sh = @install_sh@
|
||||
libdir = @libdir@
|
||||
libexecdir = @libexecdir@
|
||||
link_libmpx = @link_libmpx@
|
||||
localedir = @localedir@
|
||||
localstatedir = @localstatedir@
|
||||
mandir = @mandir@
|
||||
mkdir_p = @mkdir_p@
|
||||
multi_basedir = @multi_basedir@
|
||||
oldincludedir = @oldincludedir@
|
||||
pdfdir = @pdfdir@
|
||||
prefix = @prefix@
|
||||
program_transform_name = @program_transform_name@
|
||||
psdir = @psdir@
|
||||
sbindir = @sbindir@
|
||||
sharedstatedir = @sharedstatedir@
|
||||
srcdir = @srcdir@
|
||||
sysconfdir = @sysconfdir@
|
||||
target = @target@
|
||||
target_alias = @target_alias@
|
||||
target_cpu = @target_cpu@
|
||||
target_noncanonical = @target_noncanonical@
|
||||
target_os = @target_os@
|
||||
target_vendor = @target_vendor@
|
||||
toolexecdir = @toolexecdir@
|
||||
toolexeclibdir = @toolexeclibdir@
|
||||
top_build_prefix = @top_build_prefix@
|
||||
top_builddir = @top_builddir@
|
||||
top_srcdir = @top_srcdir@
|
||||
ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config
|
||||
|
||||
# May be used by toolexeclibdir.
|
||||
@LIBMPX_SUPPORTED_TRUE@gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER)
|
||||
@LIBMPX_SUPPORTED_TRUE@AM_CPPFLAGS = -I$(top_srcdir)/..
|
||||
@LIBMPX_SUPPORTED_TRUE@AM_CFLAGS = $(XCFLAGS)
|
||||
@LIBMPX_SUPPORTED_TRUE@toolexeclib_LTLIBRARIES = libmpx.la
|
||||
@LIBMPX_SUPPORTED_TRUE@libmpx_la_SOURCES = mpxrt.c mpxrt-utils.c
|
||||
@LIBMPX_SUPPORTED_TRUE@libmpx_la_CFLAGS = -fPIC
|
||||
@LIBMPX_SUPPORTED_TRUE@libmpx_la_DEPENDENCIES = libmpx.map
|
||||
@LIBMPX_SUPPORTED_TRUE@libmpx_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libmpx.map $(link_libmpx)
|
||||
|
||||
# Work around what appears to be a GNU make bug handling MAKEFLAGS
|
||||
# values defined in terms of make variables, as is the case for CC and
|
||||
# friends when we are called from the top level Makefile.
|
||||
AM_MAKEFLAGS = \
|
||||
"AR_FLAGS=$(AR_FLAGS)" \
|
||||
"CC_FOR_BUILD=$(CC_FOR_BUILD)" \
|
||||
"CFLAGS=$(CFLAGS)" \
|
||||
"CXXFLAGS=$(CXXFLAGS)" \
|
||||
"CFLAGS_FOR_BUILD=$(CFLAGS_FOR_BUILD)" \
|
||||
"CFLAGS_FOR_TARGET=$(CFLAGS_FOR_TARGET)" \
|
||||
"INSTALL=$(INSTALL)" \
|
||||
"INSTALL_DATA=$(INSTALL_DATA)" \
|
||||
"INSTALL_PROGRAM=$(INSTALL_PROGRAM)" \
|
||||
"INSTALL_SCRIPT=$(INSTALL_SCRIPT)" \
|
||||
"JC1FLAGS=$(JC1FLAGS)" \
|
||||
"LDFLAGS=$(LDFLAGS)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \
|
||||
"MAKE=$(MAKE)" \
|
||||
"MAKEINFO=$(MAKEINFO) $(MAKEINFOFLAGS)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"PICFLAG_FOR_TARGET=$(PICFLAG_FOR_TARGET)" \
|
||||
"SHELL=$(SHELL)" \
|
||||
"RUNTESTFLAGS=$(RUNTESTFLAGS)" \
|
||||
"exec_prefix=$(exec_prefix)" \
|
||||
"infodir=$(infodir)" \
|
||||
"libdir=$(libdir)" \
|
||||
"prefix=$(prefix)" \
|
||||
"includedir=$(includedir)" \
|
||||
"AR=$(AR)" \
|
||||
"AS=$(AS)" \
|
||||
"LD=$(LD)" \
|
||||
"LIBCFLAGS=$(LIBCFLAGS)" \
|
||||
"NM=$(NM)" \
|
||||
"PICFLAG=$(PICFLAG)" \
|
||||
"RANLIB=$(RANLIB)" \
|
||||
"DESTDIR=$(DESTDIR)"
|
||||
|
||||
MAKEOVERRIDES =
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
.SUFFIXES: .c .lo .o .obj
|
||||
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
|
||||
@for dep in $?; do \
|
||||
case '$(am__configure_deps)' in \
|
||||
*$$dep*) \
|
||||
( cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh ) \
|
||||
&& { if test -f $@; then exit 0; else break; fi; }; \
|
||||
exit 1;; \
|
||||
esac; \
|
||||
done; \
|
||||
echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign --ignore-deps mpxrt/Makefile'; \
|
||||
$(am__cd) $(top_srcdir) && \
|
||||
$(AUTOMAKE) --foreign --ignore-deps mpxrt/Makefile
|
||||
.PRECIOUS: Makefile
|
||||
Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
|
||||
@case '$?' in \
|
||||
*config.status*) \
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh;; \
|
||||
*) \
|
||||
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
|
||||
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
|
||||
esac;
|
||||
|
||||
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
|
||||
$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)
|
||||
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
|
||||
$(am__aclocal_m4_deps):
|
||||
install-toolexeclibLTLIBRARIES: $(toolexeclib_LTLIBRARIES)
|
||||
@$(NORMAL_INSTALL)
|
||||
test -z "$(toolexeclibdir)" || $(MKDIR_P) "$(DESTDIR)$(toolexeclibdir)"
|
||||
@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
|
||||
list2=; for p in $$list; do \
|
||||
if test -f $$p; then \
|
||||
list2="$$list2 $$p"; \
|
||||
else :; fi; \
|
||||
done; \
|
||||
test -z "$$list2" || { \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 '$(DESTDIR)$(toolexeclibdir)'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=install $(INSTALL) $(INSTALL_STRIP_FLAG) $$list2 "$(DESTDIR)$(toolexeclibdir)"; \
|
||||
}
|
||||
|
||||
uninstall-toolexeclibLTLIBRARIES:
|
||||
@$(NORMAL_UNINSTALL)
|
||||
@list='$(toolexeclib_LTLIBRARIES)'; test -n "$(toolexeclibdir)" || list=; \
|
||||
for p in $$list; do \
|
||||
$(am__strip_dir) \
|
||||
echo " $(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f '$(DESTDIR)$(toolexeclibdir)/$$f'"; \
|
||||
$(LIBTOOL) $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=uninstall rm -f "$(DESTDIR)$(toolexeclibdir)/$$f"; \
|
||||
done
|
||||
|
||||
clean-toolexeclibLTLIBRARIES:
|
||||
-test -z "$(toolexeclib_LTLIBRARIES)" || rm -f $(toolexeclib_LTLIBRARIES)
|
||||
@list='$(toolexeclib_LTLIBRARIES)'; for p in $$list; do \
|
||||
dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \
|
||||
test "$$dir" != "$$p" || dir=.; \
|
||||
echo "rm -f \"$${dir}/so_locations\""; \
|
||||
rm -f "$${dir}/so_locations"; \
|
||||
done
|
||||
libmpx.la: $(libmpx_la_OBJECTS) $(libmpx_la_DEPENDENCIES)
|
||||
$(libmpx_la_LINK) $(am_libmpx_la_rpath) $(libmpx_la_OBJECTS) $(libmpx_la_LIBADD) $(LIBS)
|
||||
|
||||
mostlyclean-compile:
|
||||
-rm -f *.$(OBJEXT)
|
||||
|
||||
distclean-compile:
|
||||
-rm -f *.tab.c
|
||||
|
||||
.c.o:
|
||||
$(COMPILE) -c $<
|
||||
|
||||
.c.obj:
|
||||
$(COMPILE) -c `$(CYGPATH_W) '$<'`
|
||||
|
||||
.c.lo:
|
||||
$(LTCOMPILE) -c -o $@ $<
|
||||
|
||||
libmpx_la-mpxrt.lo: mpxrt.c
|
||||
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmpx_la_CFLAGS) $(CFLAGS) -c -o libmpx_la-mpxrt.lo `test -f 'mpxrt.c' || echo '$(srcdir)/'`mpxrt.c
|
||||
|
||||
libmpx_la-mpxrt-utils.lo: mpxrt-utils.c
|
||||
$(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(libmpx_la_CFLAGS) $(CFLAGS) -c -o libmpx_la-mpxrt-utils.lo `test -f 'mpxrt-utils.c' || echo '$(srcdir)/'`mpxrt-utils.c
|
||||
|
||||
mostlyclean-libtool:
|
||||
-rm -f *.lo
|
||||
|
||||
clean-libtool:
|
||||
-rm -rf .libs _libs
|
||||
|
||||
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
mkid -fID $$unique
|
||||
tags: TAGS
|
||||
|
||||
TAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
set x; \
|
||||
here=`pwd`; \
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
shift; \
|
||||
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
|
||||
test -n "$$unique" || unique=$$empty_fix; \
|
||||
if test $$# -gt 0; then \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
"$$@" $$unique; \
|
||||
else \
|
||||
$(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \
|
||||
$$unique; \
|
||||
fi; \
|
||||
fi
|
||||
ctags: CTAGS
|
||||
CTAGS: $(HEADERS) $(SOURCES) $(TAGS_DEPENDENCIES) \
|
||||
$(TAGS_FILES) $(LISP)
|
||||
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
|
||||
unique=`for i in $$list; do \
|
||||
if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
|
||||
done | \
|
||||
$(AWK) '{ files[$$0] = 1; nonempty = 1; } \
|
||||
END { if (nonempty) { for (i in files) print i; }; }'`; \
|
||||
test -z "$(CTAGS_ARGS)$$unique" \
|
||||
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
|
||||
$$unique
|
||||
|
||||
GTAGS:
|
||||
here=`$(am__cd) $(top_builddir) && pwd` \
|
||||
&& $(am__cd) $(top_srcdir) \
|
||||
&& gtags -i $(GTAGS_ARGS) "$$here"
|
||||
|
||||
distclean-tags:
|
||||
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
|
||||
check-am: all-am
|
||||
check: check-am
|
||||
all-am: Makefile $(LTLIBRARIES)
|
||||
installdirs:
|
||||
for dir in "$(DESTDIR)$(toolexeclibdir)"; do \
|
||||
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
|
||||
done
|
||||
install: install-am
|
||||
install-exec: install-exec-am
|
||||
install-data: install-data-am
|
||||
uninstall: uninstall-am
|
||||
|
||||
install-am: all-am
|
||||
@$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am
|
||||
|
||||
installcheck: installcheck-am
|
||||
install-strip:
|
||||
$(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
|
||||
install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
|
||||
`test -z '$(STRIP)' || \
|
||||
echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
|
||||
mostlyclean-generic:
|
||||
|
||||
clean-generic:
|
||||
|
||||
distclean-generic:
|
||||
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
|
||||
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
|
||||
|
||||
maintainer-clean-generic:
|
||||
@echo "This command is intended for maintainers to use"
|
||||
@echo "it deletes files that may require special tools to rebuild."
|
||||
clean: clean-am
|
||||
|
||||
clean-am: clean-generic clean-libtool clean-toolexeclibLTLIBRARIES \
|
||||
mostlyclean-am
|
||||
|
||||
distclean: distclean-am
|
||||
-rm -f Makefile
|
||||
distclean-am: clean-am distclean-compile distclean-generic \
|
||||
distclean-tags
|
||||
|
||||
dvi: dvi-am
|
||||
|
||||
dvi-am:
|
||||
|
||||
html: html-am
|
||||
|
||||
html-am:
|
||||
|
||||
info: info-am
|
||||
|
||||
info-am:
|
||||
|
||||
install-data-am:
|
||||
|
||||
install-dvi: install-dvi-am
|
||||
|
||||
install-dvi-am:
|
||||
|
||||
install-exec-am: install-toolexeclibLTLIBRARIES
|
||||
|
||||
install-html: install-html-am
|
||||
|
||||
install-html-am:
|
||||
|
||||
install-info: install-info-am
|
||||
|
||||
install-info-am:
|
||||
|
||||
install-man:
|
||||
|
||||
install-pdf: install-pdf-am
|
||||
|
||||
install-pdf-am:
|
||||
|
||||
install-ps: install-ps-am
|
||||
|
||||
install-ps-am:
|
||||
|
||||
installcheck-am:
|
||||
|
||||
maintainer-clean: maintainer-clean-am
|
||||
-rm -f Makefile
|
||||
maintainer-clean-am: distclean-am maintainer-clean-generic
|
||||
|
||||
mostlyclean: mostlyclean-am
|
||||
|
||||
mostlyclean-am: mostlyclean-compile mostlyclean-generic \
|
||||
mostlyclean-libtool
|
||||
|
||||
pdf: pdf-am
|
||||
|
||||
pdf-am:
|
||||
|
||||
ps: ps-am
|
||||
|
||||
ps-am:
|
||||
|
||||
uninstall-am: uninstall-toolexeclibLTLIBRARIES
|
||||
|
||||
.MAKE: install-am install-strip
|
||||
|
||||
.PHONY: CTAGS GTAGS all all-am check check-am clean clean-generic \
|
||||
clean-libtool clean-toolexeclibLTLIBRARIES ctags distclean \
|
||||
distclean-compile distclean-generic distclean-libtool \
|
||||
distclean-tags dvi dvi-am html html-am info info-am install \
|
||||
install-am install-data install-data-am install-dvi \
|
||||
install-dvi-am install-exec install-exec-am install-html \
|
||||
install-html-am install-info install-info-am install-man \
|
||||
install-pdf install-pdf-am install-ps install-ps-am \
|
||||
install-strip install-toolexeclibLTLIBRARIES installcheck \
|
||||
installcheck-am installdirs maintainer-clean \
|
||||
maintainer-clean-generic mostlyclean mostlyclean-compile \
|
||||
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
|
||||
tags uninstall uninstall-am uninstall-toolexeclibLTLIBRARIES
|
||||
|
||||
|
||||
@LIBMPX_SUPPORTED_TRUE@mpxrt.lo: mpxrt-utils.h
|
||||
@LIBMPX_SUPPORTED_TRUE@mpxrt-utils.lo: mpxrt-utils.h
|
||||
|
||||
# Tell versions [3.59,3.63) of GNU make to not export all variables.
|
||||
# Otherwise a system limit (for SysV at least) may be exceeded.
|
||||
.NOEXPORT:
|
5
libmpx/mpxrt/libmpx.map
Normal file
5
libmpx/mpxrt/libmpx.map
Normal file
|
@ -0,0 +1,5 @@
|
|||
LIBMPX_1.0
|
||||
{
|
||||
local:
|
||||
*;
|
||||
};
|
6
libmpx/mpxrt/libtool-version
Normal file
6
libmpx/mpxrt/libtool-version
Normal file
|
@ -0,0 +1,6 @@
|
|||
# This file is used to maintain libtool version info for libmpx. See
|
||||
# the libtool manual to understand the meaning of the fields. This is
|
||||
# a separate file so that version updates don't involve re-running
|
||||
# automake.
|
||||
# CURRENT:REVISION:AGE
|
||||
1:0:0
|
505
libmpx/mpxrt/mpxrt-utils.c
Normal file
505
libmpx/mpxrt/mpxrt-utils.c
Normal file
|
@ -0,0 +1,505 @@
|
|||
/* mpxrt-utils.c -*-C++-*-
|
||||
*
|
||||
*************************************************************************
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2014, Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* @copyright
|
||||
* 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.
|
||||
* * Neither the name of Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* @copyright
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include "config.h"
|
||||
#include <inttypes.h>
|
||||
#include <unistd.h>
|
||||
#include <stdio.h>
|
||||
#include <stdarg.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <limits.h>
|
||||
#include <pthread.h>
|
||||
#include "mpxrt-utils.h"
|
||||
|
||||
#ifndef HAVE_SECURE_GETENV
|
||||
#define secure_getenv __secure_getenv
|
||||
#endif
|
||||
|
||||
#define MPX_RT_OUT "CHKP_RT_OUT_FILE"
|
||||
#define MPX_RT_ERR "CHKP_RT_ERR_FILE"
|
||||
#define MPX_RT_VERBOSE "CHKP_RT_VERBOSE"
|
||||
#define MPX_RT_VERBOSE_DEFAULT VERB_BR
|
||||
#define MPX_RT_MODE "CHKP_RT_MODE"
|
||||
#define MPX_RT_MODE_DEFAULT MPX_RT_COUNT
|
||||
#define MPX_RT_MODE_DEFAULT_STR "count"
|
||||
#define MPX_RT_HELP "CHKP_RT_HELP"
|
||||
#define MPX_RT_ADDPID "CHKP_RT_ADDPID"
|
||||
#define MPX_RT_BNDPRESERVE "CHKP_RT_BNDPRESERVE"
|
||||
#define MPX_RT_BNDPRESERVE_DEFAULT 0
|
||||
#define MPX_RT_PRINT_SUMMARY "CHKP_RT_PRINT_SUMMARY"
|
||||
|
||||
#define MAX_FILE_NAME PATH_MAX
|
||||
|
||||
typedef struct env_var_s {
|
||||
char *env_name;
|
||||
char *env_val;
|
||||
struct env_var_s *next;
|
||||
} env_var_t;
|
||||
|
||||
typedef struct {
|
||||
env_var_t *first;
|
||||
env_var_t *last;
|
||||
} env_var_list_t;
|
||||
|
||||
/* Following vars are initialized at process startup only
|
||||
and thus are considered to be thread safe. */
|
||||
static int summary;
|
||||
static int add_pid;
|
||||
static mpx_rt_mode_t mode;
|
||||
static env_var_list_t env_var_list;
|
||||
static verbose_type verbose_val;
|
||||
static FILE *out;
|
||||
static FILE *err;
|
||||
static char out_name[MAX_FILE_NAME];
|
||||
static char err_name[MAX_FILE_NAME];
|
||||
|
||||
/* Following vars are read at process finalization only.
|
||||
All write accesses use the same value and thus are
|
||||
considered to be thread safe. */
|
||||
static int out_file_dirty;
|
||||
static int err_file_dirty;
|
||||
static int files_overwritten;
|
||||
|
||||
/* Mutex used to sync output. */
|
||||
static pthread_mutex_t lock;
|
||||
|
||||
static void *
|
||||
malloc_check (size_t size)
|
||||
{
|
||||
void *res = malloc (size);
|
||||
if (!res)
|
||||
__mpxrt_print (VERB_ERROR, "Couldn't allocate %zu bytes.", size);
|
||||
else
|
||||
memset (res, 0, size);
|
||||
return res;
|
||||
}
|
||||
|
||||
static void
|
||||
env_var_list_add (const char* env, const char* val)
|
||||
{
|
||||
env_var_t* n;
|
||||
|
||||
if (val == 0)
|
||||
return;
|
||||
|
||||
n = (env_var_t *)malloc_check (sizeof (env_var_t));
|
||||
if (!n)
|
||||
return;
|
||||
|
||||
if (env_var_list.first == 0)
|
||||
env_var_list.first = n;
|
||||
|
||||
if (env_var_list.last)
|
||||
env_var_list.last->next = n;
|
||||
|
||||
env_var_list.last = n;
|
||||
|
||||
n->env_name = (char *)malloc_check (strlen (env) + 1);
|
||||
n->env_val = (char *)malloc_check (strlen (val) + 1);
|
||||
|
||||
if (!n->env_name || !n->env_val)
|
||||
return;
|
||||
|
||||
strcpy (n->env_name, env);
|
||||
strcpy (n->env_val, val);
|
||||
}
|
||||
|
||||
static void
|
||||
set_file_stream (FILE** file, char* file_name,
|
||||
const char* env, FILE* deflt)
|
||||
{
|
||||
int pid;
|
||||
if (env != 0)
|
||||
{
|
||||
if (add_pid)
|
||||
{
|
||||
pid = getpid ();
|
||||
snprintf (file_name, MAX_FILE_NAME, "%s.%d", env, pid);
|
||||
}
|
||||
else
|
||||
snprintf (file_name, MAX_FILE_NAME, "%s", env);
|
||||
|
||||
*file = fopen (file_name, "we");
|
||||
if (*file != 0)
|
||||
return;
|
||||
}
|
||||
*file = deflt;
|
||||
}
|
||||
|
||||
/*
|
||||
* this function will be called after fork in the child
|
||||
* open new files with pid of the process
|
||||
*/
|
||||
static void
|
||||
open_child_files ()
|
||||
{
|
||||
char *out_env;
|
||||
char *err_env;
|
||||
|
||||
out_env = secure_getenv (MPX_RT_OUT);
|
||||
err_env = secure_getenv (MPX_RT_ERR);
|
||||
|
||||
if (add_pid == 0 && (out_env != 0 || err_env != 0))
|
||||
{
|
||||
__mpxrt_print (VERB_ERROR, "MPX RUNTIME WARNING: out/err files are "
|
||||
"overwritten in new processes since %s was not set.\n",
|
||||
MPX_RT_ADDPID);
|
||||
files_overwritten = 1;
|
||||
}
|
||||
|
||||
set_file_stream (&out, out_name, out_env, stdout);
|
||||
if (out_env == 0 || err_env == 0 || (strcmp (out_env, err_env) != 0))
|
||||
set_file_stream (&err, err_name, err_env, stderr);
|
||||
else
|
||||
/* in case we get the same file name for err and out */
|
||||
err = out;
|
||||
}
|
||||
|
||||
/*
|
||||
* this function is called after fork in the parent
|
||||
*/
|
||||
static void
|
||||
at_fork_check (void)
|
||||
{
|
||||
char *out_env;
|
||||
char *err_env;
|
||||
|
||||
out_env = secure_getenv (MPX_RT_OUT);
|
||||
err_env = secure_getenv (MPX_RT_ERR);
|
||||
|
||||
if (add_pid == 0 && (out_env != 0 || err_env != 0))
|
||||
files_overwritten = 1;
|
||||
}
|
||||
|
||||
static mpx_rt_mode_t
|
||||
set_mpx_rt_mode (const char *env)
|
||||
{
|
||||
if (env == 0)
|
||||
return MPX_RT_MODE_DEFAULT;
|
||||
else if (strcmp (env, "stop") == 0)
|
||||
return MPX_RT_STOP;
|
||||
else if (strcmp (env,"count") == 0)
|
||||
return MPX_RT_COUNT;
|
||||
{
|
||||
__mpxrt_print (VERB_ERROR, "Illegal value '%s' for %s. Legal values are"
|
||||
"[stop | count]\nUsing default value %s\n",
|
||||
env, MPX_RT_MODE, MPX_RT_MODE_DEFAULT_STR);
|
||||
return MPX_RT_MODE_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
print_help (void)
|
||||
{
|
||||
fprintf (out, "MPX Runtime environment variables help.\n");
|
||||
|
||||
fprintf (out, "%s \t set output file for info & debug [default: stdout]\n",
|
||||
MPX_RT_OUT);
|
||||
fprintf (out, "%s \t set output file for error [default: stderr]\n",
|
||||
MPX_RT_ERR);
|
||||
fprintf (out, "%s \t set verbosity type [default: %d]\n"
|
||||
"\t\t\t 0 - print only internal run time errors\n"
|
||||
"\t\t\t 1 - just print summary\n"
|
||||
"\t\t\t 2 - print summary and bound violation information\n "
|
||||
"\t\t\t 3 - print debug information\n",
|
||||
MPX_RT_VERBOSE, MPX_RT_VERBOSE_DEFAULT);
|
||||
fprintf (out, "%s \t\t set MPX runtime behavior on #BR exception."
|
||||
" [stop | count]\n"
|
||||
"\t\t\t [default: %s]\n", MPX_RT_MODE, MPX_RT_MODE_DEFAULT_STR);
|
||||
fprintf (out, "%s \t\t generate out,err file for each process.\n"
|
||||
"\t\t\t generated file will be MPX_RT_{OUT,ERR}_FILE.pid\n"
|
||||
"\t\t\t [default: no]\n", MPX_RT_ADDPID);
|
||||
fprintf (out, "%s \t set value for BNDPRESERVE bit.\n"
|
||||
"\t\t\t BNDPRESERVE = 0 flush bounds on unprefixed call/ret/jmp\n"
|
||||
"\t\t\t BNDPRESERVE = 1 do NOT flush bounds\n"
|
||||
"\t\t\t [default: %d]\n", MPX_RT_BNDPRESERVE,
|
||||
MPX_RT_BNDPRESERVE_DEFAULT);
|
||||
fprintf (out, "%s \t print summary at the end of the run\n"
|
||||
"\t\t\t [default: no]\n", MPX_RT_PRINT_SUMMARY);
|
||||
|
||||
fprintf (out, "%s \t\t print this help and exit.\n"
|
||||
"\t\t\t [default: no]\n", MPX_RT_HELP);
|
||||
|
||||
exit (0);
|
||||
}
|
||||
|
||||
static void
|
||||
validate_bndpreserve (const char *env, int *bndpreserve)
|
||||
{
|
||||
if (env == 0)
|
||||
bndpreserve = MPX_RT_BNDPRESERVE_DEFAULT;
|
||||
else if (strcmp (env, "0") == 0)
|
||||
*bndpreserve = 0;
|
||||
else if (strcmp (env, "1") == 0)
|
||||
*bndpreserve = 1;
|
||||
else
|
||||
{
|
||||
__mpxrt_print (VERB_ERROR, "Illegal value '%s' for %s. Legal values "
|
||||
"are [0 | 1]\nUsing default value %d\n",
|
||||
env, MPX_RT_BNDPRESERVE, MPX_RT_BNDPRESERVE_DEFAULT);
|
||||
*bndpreserve = MPX_RT_BNDPRESERVE_DEFAULT;
|
||||
}
|
||||
}
|
||||
|
||||
static verbose_type
|
||||
init_verbose_val (const char *env)
|
||||
{
|
||||
if (env == 0)
|
||||
return MPX_RT_VERBOSE_DEFAULT;
|
||||
else if (strcmp(env, "0") == 0)
|
||||
return VERB_ERROR;
|
||||
else if (strcmp(env, "1") == 0)
|
||||
return VERB_INFO;
|
||||
else if (strcmp(env, "2") == 0)
|
||||
return VERB_BR;
|
||||
else if (strcmp(env, "3") == 0)
|
||||
return VERB_DEBUG;
|
||||
|
||||
__mpxrt_print (VERB_ERROR, "Illegal value '%s' for %s. Legal values "
|
||||
"are [0..3]\nUsing default value %d\n",
|
||||
env, MPX_RT_VERBOSE, (int)MPX_RT_VERBOSE_DEFAULT);
|
||||
|
||||
return MPX_RT_VERBOSE_DEFAULT;
|
||||
}
|
||||
|
||||
static void
|
||||
env_var_print_summary (void)
|
||||
{
|
||||
env_var_t* node;
|
||||
|
||||
__mpxrt_print (VERB_DEBUG, "Used environment variables:\n");
|
||||
|
||||
node = env_var_list.first;
|
||||
while (node != 0)
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, " %s = %s\n", node->env_name, node->env_val);
|
||||
node = node->next;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return 1 if passes env var value should enable feature. */
|
||||
|
||||
static int
|
||||
check_yes (const char *val)
|
||||
{
|
||||
return val && (!strcmp (val, "yes") || !strcmp (val, "1"));
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_init_env_vars (int* bndpreserve)
|
||||
{
|
||||
char *out_env;
|
||||
char *err_env;
|
||||
char *env;
|
||||
|
||||
pthread_mutex_init (&lock, NULL);
|
||||
|
||||
out_env = secure_getenv (MPX_RT_OUT);
|
||||
env_var_list_add (MPX_RT_OUT, out_env);
|
||||
|
||||
err_env = secure_getenv (MPX_RT_ERR);
|
||||
env_var_list_add (MPX_RT_ERR, err_env);
|
||||
|
||||
env = secure_getenv (MPX_RT_ADDPID);
|
||||
env_var_list_add (MPX_RT_ADDPID, env);
|
||||
add_pid = check_yes (env);
|
||||
|
||||
set_file_stream (&out, out_name, out_env, stdout);
|
||||
if (out_env == 0 || err_env == 0 || (strcmp (out_env, err_env) != 0))
|
||||
set_file_stream (&err, err_name, err_env, stderr);
|
||||
else
|
||||
/* in case we get the same file name for err and out */
|
||||
err = out;
|
||||
|
||||
env = secure_getenv (MPX_RT_VERBOSE);
|
||||
env_var_list_add (MPX_RT_VERBOSE, env);
|
||||
verbose_val = init_verbose_val (env);
|
||||
|
||||
env = secure_getenv (MPX_RT_MODE);
|
||||
env_var_list_add (MPX_RT_MODE, env);
|
||||
mode = set_mpx_rt_mode (env);
|
||||
|
||||
env = secure_getenv (MPX_RT_BNDPRESERVE);
|
||||
env_var_list_add (MPX_RT_BNDPRESERVE, env);
|
||||
validate_bndpreserve (env, bndpreserve);
|
||||
|
||||
env = secure_getenv (MPX_RT_PRINT_SUMMARY);
|
||||
env_var_list_add (MPX_RT_PRINT_SUMMARY, env);
|
||||
summary = check_yes (env);
|
||||
|
||||
env = secure_getenv (MPX_RT_HELP);
|
||||
if (check_yes (env))
|
||||
print_help ();
|
||||
|
||||
/*
|
||||
* at fork - create new files for output and err according
|
||||
* to the env vars.
|
||||
*/
|
||||
pthread_atfork (NULL, at_fork_check, open_child_files);
|
||||
|
||||
env_var_print_summary ();
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_utils_free (void)
|
||||
{
|
||||
if (files_overwritten)
|
||||
__mpxrt_print (VERB_INFO, "\nMPX RUNTIME WARNING: out/err files are"
|
||||
" overwritten in new processes since %s was not set.\n",
|
||||
MPX_RT_ADDPID);
|
||||
|
||||
if (out != stdout)
|
||||
{
|
||||
fclose (out);
|
||||
if (out_file_dirty != 1)
|
||||
remove (out_name);
|
||||
}
|
||||
|
||||
if (err != stderr)
|
||||
{
|
||||
fclose (err);
|
||||
if (err_file_dirty != 1)
|
||||
remove (err_name);
|
||||
}
|
||||
|
||||
pthread_mutex_destroy (&lock);
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_write_uint (verbose_type vt, uint64_t val, unsigned base)
|
||||
{
|
||||
static const char digits[] = {
|
||||
'0', '1', '2', '3', '4', '5', '6', '7',
|
||||
'8', '9', 'a', 'b', 'c', 'd', 'e', 'f' };
|
||||
char str[65];
|
||||
int pos = 64;;
|
||||
|
||||
str[pos--] = 0;
|
||||
|
||||
if (vt > verbose_val || base <= 1 || base > sizeof (digits))
|
||||
return;
|
||||
|
||||
if (val < base)
|
||||
str[pos--] = digits[val];
|
||||
else
|
||||
while (val)
|
||||
{
|
||||
str[pos--] = digits[val % base];
|
||||
val = val / base;
|
||||
}
|
||||
|
||||
__mpxrt_write (vt, str + pos + 1);
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_write (verbose_type vt, const char* str)
|
||||
{
|
||||
va_list argp;
|
||||
FILE *print_to;
|
||||
|
||||
if (vt > verbose_val)
|
||||
return;
|
||||
|
||||
if (vt == VERB_ERROR)
|
||||
{
|
||||
print_to = err;
|
||||
err_file_dirty = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_to = out;
|
||||
out_file_dirty = 1;
|
||||
}
|
||||
pthread_mutex_lock (&lock);
|
||||
write (fileno (print_to), str, strlen (str));
|
||||
pthread_mutex_unlock (&lock);
|
||||
va_end (argp);
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_print (verbose_type vt, const char* frmt, ...)
|
||||
{
|
||||
va_list argp;
|
||||
FILE *print_to;
|
||||
|
||||
if (vt > verbose_val)
|
||||
return;
|
||||
|
||||
va_start (argp, frmt);
|
||||
if (vt == VERB_ERROR)
|
||||
{
|
||||
print_to = err;
|
||||
err_file_dirty = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
print_to = out;
|
||||
out_file_dirty = 1;
|
||||
}
|
||||
pthread_mutex_lock (&lock);
|
||||
vfprintf (print_to, frmt, argp);
|
||||
fflush (print_to);
|
||||
pthread_mutex_unlock (&lock);
|
||||
va_end (argp);
|
||||
}
|
||||
|
||||
mpx_rt_mode_t
|
||||
__mpxrt_mode (void)
|
||||
{
|
||||
return mode;
|
||||
}
|
||||
|
||||
void
|
||||
__mpxrt_print_summary (uint64_t num_brs, uint64_t l1_size)
|
||||
{
|
||||
|
||||
if (summary == 0)
|
||||
return;
|
||||
|
||||
out_file_dirty = 1;
|
||||
|
||||
pthread_mutex_lock (&lock);
|
||||
fprintf (out, "MPX runtime summary:\n");
|
||||
fprintf (out, " Number of bounds violations: %" PRIu64 ".\n", num_brs);
|
||||
fprintf (out, " Size of allocated L1: %" PRIu64 "B\n", l1_size);
|
||||
fflush (out);
|
||||
pthread_mutex_unlock (&lock);
|
||||
}
|
65
libmpx/mpxrt/mpxrt-utils.h
Normal file
65
libmpx/mpxrt/mpxrt-utils.h
Normal file
|
@ -0,0 +1,65 @@
|
|||
/* mpxrt-utils.h -*-C++-*-
|
||||
*
|
||||
*************************************************************************
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2014, Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* @copyright
|
||||
* 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.
|
||||
* * Neither the name of Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* @copyright
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#ifndef MPXRT_UTILS_H
|
||||
#define MPXRT_UTILS_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
typedef enum {
|
||||
VERB_ERROR,
|
||||
VERB_INFO,
|
||||
VERB_BR,
|
||||
VERB_DEBUG
|
||||
} verbose_type;
|
||||
|
||||
typedef enum {
|
||||
MPX_RT_COUNT,
|
||||
MPX_RT_STOP
|
||||
} mpx_rt_mode_t;
|
||||
|
||||
void __mpxrt_init_env_vars (int* bndpreserve);
|
||||
void __mpxrt_write_uint (verbose_type vt, uint64_t val, unsigned base);
|
||||
void __mpxrt_write (verbose_type vt, const char* str);
|
||||
void __mpxrt_print (verbose_type vt, const char* frmt, ...);
|
||||
mpx_rt_mode_t __mpxrt_mode (void);
|
||||
void __mpxrt_utils_free (void);
|
||||
void __mpxrt_print_summary (uint64_t num_brs, uint64_t l1_size);
|
||||
|
||||
#endif /* MPXRT_UTILS_H */
|
515
libmpx/mpxrt/mpxrt.c
Normal file
515
libmpx/mpxrt/mpxrt.c
Normal file
|
@ -0,0 +1,515 @@
|
|||
/* mpxrt.c -*-C++-*-
|
||||
*
|
||||
*************************************************************************
|
||||
*
|
||||
* @copyright
|
||||
* Copyright (C) 2014, Intel Corporation
|
||||
* All rights reserved.
|
||||
*
|
||||
* @copyright
|
||||
* 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.
|
||||
* * Neither the name of Intel Corporation nor the names of its
|
||||
* contributors may be used to endorse or promote products derived
|
||||
* from this software without specific prior written permission.
|
||||
*
|
||||
* @copyright
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
|
||||
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
|
||||
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
||||
* WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
#define __STDC_FORMAT_MACROS
|
||||
#include "config.h"
|
||||
#include <inttypes.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <signal.h>
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <cpuid.h>
|
||||
#include "mpxrt-utils.h"
|
||||
|
||||
#ifdef __i386__
|
||||
|
||||
/* i386 directory size is 4MB */
|
||||
#define NUM_L1_BITS 20
|
||||
|
||||
#define REG_IP_IDX REG_EIP
|
||||
#define REX_PREFIX
|
||||
|
||||
#define XSAVE_OFFSET_IN_FPMEM sizeof (struct _libc_fpstate)
|
||||
|
||||
#else /* __i386__ */
|
||||
|
||||
/* x86_64 directory size is 2GB */
|
||||
#define NUM_L1_BITS 28
|
||||
|
||||
#define REG_IP_IDX REG_RIP
|
||||
#define REX_PREFIX "0x48, "
|
||||
|
||||
#define XSAVE_OFFSET_IN_FPMEM 0
|
||||
|
||||
#endif /* !__i386__ */
|
||||
|
||||
#define MPX_ENABLE_BIT_NO 0
|
||||
#define BNDPRESERVE_BIT_NO 1
|
||||
|
||||
const size_t MPX_L1_SIZE = (1UL << NUM_L1_BITS) * sizeof (void *);
|
||||
|
||||
struct xsave_hdr_struct
|
||||
{
|
||||
uint64_t xstate_bv;
|
||||
uint64_t reserved1[2];
|
||||
uint64_t reserved2[5];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct bndregs_struct
|
||||
{
|
||||
uint64_t bndregs[8];
|
||||
} __attribute__ ((packed));
|
||||
|
||||
struct bndcsr_struct {
|
||||
uint64_t cfg_reg_u;
|
||||
uint64_t status_reg;
|
||||
} __attribute__((packed));
|
||||
|
||||
struct xsave_struct
|
||||
{
|
||||
uint8_t fpu_sse[512];
|
||||
struct xsave_hdr_struct xsave_hdr;
|
||||
uint8_t ymm[256];
|
||||
uint8_t lwp[128];
|
||||
struct bndregs_struct bndregs;
|
||||
struct bndcsr_struct bndcsr;
|
||||
} __attribute__ ((packed));
|
||||
|
||||
/* Following vars are initialized at process startup only
|
||||
and thus are considered to be thread safe. */
|
||||
static void *l1base = NULL;
|
||||
static int bndpreserve;
|
||||
static int enable = 1;
|
||||
|
||||
/* Var holding number of occured BRs. It is modified from
|
||||
signal handler only and thus it should be thread safe. */
|
||||
static uint64_t num_bnd_chk = 0;
|
||||
|
||||
static inline void
|
||||
xrstor_state (struct xsave_struct *fx, uint64_t mask)
|
||||
{
|
||||
uint32_t lmask = mask;
|
||||
uint32_t hmask = mask >> 32;
|
||||
|
||||
asm volatile (".byte " REX_PREFIX "0x0f,0xae,0x2f\n\t"
|
||||
: : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline void
|
||||
xsave_state (struct xsave_struct *fx, uint64_t mask)
|
||||
{
|
||||
uint32_t lmask = mask;
|
||||
uint32_t hmask = mask >> 32;
|
||||
|
||||
asm volatile (".byte " REX_PREFIX "0x0f,0xae,0x27\n\t"
|
||||
: : "D" (fx), "m" (*fx), "a" (lmask), "d" (hmask)
|
||||
: "memory");
|
||||
}
|
||||
|
||||
static inline uint64_t
|
||||
xgetbv (uint32_t index)
|
||||
{
|
||||
uint32_t eax, edx;
|
||||
|
||||
asm volatile (".byte 0x0f,0x01,0xd0" /* xgetbv */
|
||||
: "=a" (eax), "=d" (edx)
|
||||
: "c" (index));
|
||||
return eax + ((uint64_t)edx << 32);
|
||||
}
|
||||
|
||||
static uint64_t
|
||||
read_mpx_status_sig (ucontext_t *uctxt)
|
||||
{
|
||||
uint8_t __attribute__ ((__aligned__ (64))) buffer[4096];
|
||||
struct xsave_struct *xsave_buf = (struct xsave_struct *)buffer;
|
||||
|
||||
memset (buffer, 0, sizeof (buffer));
|
||||
memcpy (buffer,
|
||||
(uint8_t *)uctxt->uc_mcontext.fpregs + XSAVE_OFFSET_IN_FPMEM,
|
||||
sizeof (struct xsave_struct));
|
||||
return xsave_buf->bndcsr.status_reg;
|
||||
}
|
||||
|
||||
static uint8_t *
|
||||
get_next_inst_ip (uint8_t *addr)
|
||||
{
|
||||
uint8_t *ip = addr;
|
||||
uint8_t sib;
|
||||
|
||||
/* Determine the prefix. */
|
||||
switch (*ip)
|
||||
{
|
||||
case 0xf2:
|
||||
case 0xf3:
|
||||
case 0x66:
|
||||
ip++;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Look for rex prefix. */
|
||||
if ((*ip & 0x40) == 0x40)
|
||||
ip++;
|
||||
|
||||
/* Make sure we have a MPX instruction. */
|
||||
if (*ip++ != 0x0f)
|
||||
return addr;
|
||||
|
||||
/* Skip the op code byte. */
|
||||
ip++;
|
||||
|
||||
/* Get the moderm byte. */
|
||||
uint8_t modrm = *ip++;
|
||||
|
||||
/* Break it down into parts. */
|
||||
uint8_t rm = modrm & 7;
|
||||
uint8_t mod = (modrm >> 6);
|
||||
|
||||
/* Init the parts of the address mode. */
|
||||
uint8_t base = 8;
|
||||
|
||||
/* Is it a mem mode? */
|
||||
if (mod != 3)
|
||||
{
|
||||
/* Look for scaled indexed addressing. */
|
||||
if (rm == 4)
|
||||
{
|
||||
/* SIB addressing. */
|
||||
sib = *ip++;
|
||||
base = sib & 7;
|
||||
switch (mod)
|
||||
{
|
||||
case 0:
|
||||
if (base == 5)
|
||||
ip += 4;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ip++;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ip += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* MODRM addressing. */
|
||||
switch (mod)
|
||||
{
|
||||
case 0:
|
||||
if (rm == 5)
|
||||
/* DISP32 addressing, no base. */
|
||||
ip += 4;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
ip++;
|
||||
break;
|
||||
|
||||
case 2:
|
||||
ip += 4;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
return ip;
|
||||
}
|
||||
|
||||
static void
|
||||
handler (int sig __attribute__ ((unused)),
|
||||
siginfo_t *info __attribute__ ((unused)),
|
||||
void *vucontext,
|
||||
struct xsave_struct *buf __attribute__ ((unused)))
|
||||
{
|
||||
ucontext_t* uctxt;
|
||||
greg_t trapno;
|
||||
greg_t ip;
|
||||
|
||||
uctxt = vucontext;
|
||||
trapno = uctxt->uc_mcontext.gregs[REG_TRAPNO];
|
||||
ip = uctxt->uc_mcontext.gregs[REG_IP_IDX];
|
||||
|
||||
if (trapno == 5)
|
||||
{
|
||||
uint64_t status = read_mpx_status_sig (uctxt);
|
||||
uint64_t br_reason = status & 0x3;
|
||||
|
||||
__mpxrt_write (VERB_BR, "Saw a #BR! status ");
|
||||
__mpxrt_write_uint (VERB_BR, status, 10);
|
||||
__mpxrt_write (VERB_BR, " at 0x");
|
||||
__mpxrt_write_uint (VERB_BR, ip, 16);
|
||||
__mpxrt_write (VERB_BR, "\n");
|
||||
|
||||
switch (br_reason)
|
||||
{
|
||||
case 1: /* traditional BR */
|
||||
num_bnd_chk++;
|
||||
uctxt->uc_mcontext.gregs[REG_IP_IDX] =
|
||||
(greg_t)get_next_inst_ip ((uint8_t *)ip);
|
||||
if (__mpxrt_mode () == MPX_RT_STOP)
|
||||
exit (255);
|
||||
return;
|
||||
|
||||
default:
|
||||
__mpxrt_write (VERB_BR, "Unexpected status with bound exception: ");
|
||||
__mpxrt_write_uint (VERB_BR, status, 10);
|
||||
__mpxrt_write (VERB_BR, "\n");
|
||||
break;
|
||||
}
|
||||
}
|
||||
else if (trapno == 14)
|
||||
{
|
||||
__mpxrt_write (VERB_ERROR, "In signal handler, trapno = ");
|
||||
__mpxrt_write_uint (VERB_ERROR, trapno, 10);
|
||||
__mpxrt_write (VERB_ERROR, ", ip = 0x");
|
||||
__mpxrt_write_uint (VERB_ERROR, ip, 16);
|
||||
__mpxrt_write (VERB_BR, "\n");
|
||||
exit (255);
|
||||
}
|
||||
else
|
||||
{
|
||||
__mpxrt_write (VERB_ERROR, "Unexpected trap ");
|
||||
__mpxrt_write_uint (VERB_ERROR, trapno, 10);
|
||||
__mpxrt_write (VERB_ERROR, "! at 0x");
|
||||
__mpxrt_write_uint (VERB_ERROR, ip, 16);
|
||||
__mpxrt_write (VERB_BR, "\n");
|
||||
exit (255);
|
||||
}
|
||||
}
|
||||
|
||||
/* Using wrapper to the real handler in order to save the bnd regs
|
||||
using xsave before any unprefixed call. an unprefixed call to
|
||||
__i686.get_pc_thunk.bx is added by the linker in 32bit at the
|
||||
beginning of handler function since there are references to
|
||||
global variables. */
|
||||
static void
|
||||
handler_wrap (int signum, siginfo_t* si, void* vucontext)
|
||||
{
|
||||
/* Since the OS currently not handling chkptr regs.
|
||||
We need to store them for later use. They might be
|
||||
init due to unprefixed call,Jcc,ret. avoiding calling
|
||||
function since the function will be unprefixed as well. */
|
||||
uint8_t __attribute__ ((__aligned__ (64))) buffer[4096];
|
||||
struct xsave_struct *xsave_buf = (struct xsave_struct *)buffer;
|
||||
uint64_t mask = 0x18;
|
||||
uint32_t lmask = mask;
|
||||
uint32_t hmask = mask >> 32;
|
||||
|
||||
asm volatile (".byte " REX_PREFIX "0x0f,0xae,0x27\n\t"
|
||||
: : "D" (xsave_buf), "m" (*xsave_buf),
|
||||
"a" (lmask), "d" (hmask)
|
||||
: "memory");
|
||||
|
||||
handler (signum, si, vucontext, xsave_buf);
|
||||
}
|
||||
|
||||
static bool
|
||||
check_mpx_support (void)
|
||||
{
|
||||
unsigned int eax, ebx, ecx, edx;
|
||||
unsigned int max_level = __get_cpuid_max (0, NULL);
|
||||
|
||||
if (max_level < 13)
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No required CPUID level support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
__cpuid_count (0, 0, eax, ebx, ecx, edx);
|
||||
if (!(ecx & bit_XSAVE))
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No XSAVE support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(ecx & bit_OSXSAVE))
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No OSXSAVE support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
__cpuid_count (7, 0, eax, ebx, ecx, edx);
|
||||
if (!(ebx & bit_MPX))
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No MPX support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
__cpuid_count (13, 0, eax, ebx, ecx, edx);
|
||||
if (!(eax & bit_BNDREGS))
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No BNDREGS support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(eax & bit_BNDCSR))
|
||||
{
|
||||
__mpxrt_print (VERB_DEBUG, "No BNDCSR support.\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
enable_mpx (void)
|
||||
{
|
||||
uint8_t __attribute__ ((__aligned__ (64))) buffer[4096];
|
||||
struct xsave_struct *xsave_buf = (struct xsave_struct *)buffer;
|
||||
|
||||
memset (buffer, 0, sizeof (buffer));
|
||||
xrstor_state (xsave_buf, 0x18);
|
||||
|
||||
__mpxrt_print (VERB_DEBUG, "Initalizing MPX...\n");
|
||||
__mpxrt_print (VERB_DEBUG, " Enable bit: %d\n", enable);
|
||||
__mpxrt_print (VERB_DEBUG, " BNDPRESERVE bit: %d\n", bndpreserve);
|
||||
|
||||
/* Enable MPX. */
|
||||
xsave_buf->xsave_hdr.xstate_bv = 0x10;
|
||||
xsave_buf->bndcsr.cfg_reg_u = (unsigned long)l1base;
|
||||
xsave_buf->bndcsr.cfg_reg_u |= enable << MPX_ENABLE_BIT_NO;
|
||||
xsave_buf->bndcsr.cfg_reg_u |= bndpreserve << BNDPRESERVE_BIT_NO;
|
||||
xsave_buf->bndcsr.status_reg = 0;
|
||||
|
||||
xrstor_state (xsave_buf, 0x10);
|
||||
}
|
||||
|
||||
static void
|
||||
disable_mpx (void)
|
||||
{
|
||||
uint8_t __attribute__ ((__aligned__ (64))) buffer[4096];
|
||||
struct xsave_struct *xsave_buf = (struct xsave_struct *)buffer;
|
||||
|
||||
memset(buffer, 0, sizeof(buffer));
|
||||
xrstor_state(xsave_buf, 0x18);
|
||||
|
||||
/* Disable MPX. */
|
||||
xsave_buf->xsave_hdr.xstate_bv = 0x10;
|
||||
xsave_buf->bndcsr.cfg_reg_u = 0;
|
||||
xsave_buf->bndcsr.status_reg = 0;
|
||||
|
||||
xrstor_state(xsave_buf, 0x10);
|
||||
}
|
||||
|
||||
static bool
|
||||
process_specific_init (void)
|
||||
{
|
||||
if (!check_mpx_support ())
|
||||
return false;
|
||||
|
||||
l1base = mmap (NULL, MPX_L1_SIZE, PROT_READ | PROT_WRITE,
|
||||
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0);
|
||||
if (l1base == MAP_FAILED)
|
||||
{
|
||||
perror ("mmap");
|
||||
exit (EXIT_FAILURE);
|
||||
}
|
||||
|
||||
enable_mpx ();
|
||||
|
||||
if (prctl (43, 0, 0, 0, 0))
|
||||
{
|
||||
__mpxrt_print (VERB_ERROR, "No MPX support\n");
|
||||
disable_mpx ();
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool
|
||||
process_specific_finish (void)
|
||||
{
|
||||
if (!check_mpx_support ())
|
||||
return false;
|
||||
|
||||
if (prctl (44, 0, 0, 0, 0))
|
||||
{
|
||||
__mpxrt_print (VERB_ERROR, "No MPX support\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
munmap (l1base, MPX_L1_SIZE);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static void
|
||||
setup_handler (void)
|
||||
{
|
||||
int r,rs;
|
||||
struct sigaction newact;
|
||||
|
||||
/* #BR is mapped to sigsegv */
|
||||
int signum = SIGSEGV;
|
||||
|
||||
newact.sa_handler = 0;
|
||||
newact.sa_sigaction = handler_wrap;
|
||||
|
||||
/* sigset_t - signals to block while in the handler
|
||||
get the old signal mask. */
|
||||
rs = sigprocmask (SIG_SETMASK, 0, &newact.sa_mask);
|
||||
assert (rs == 0);
|
||||
|
||||
/* Call sa_sigaction, not sa_handler. */
|
||||
newact.sa_flags = SA_SIGINFO;
|
||||
/* In case we call user's handler on SIGSEGV (not bound
|
||||
violation exception) we want to allow bound checking
|
||||
inside the user handler -> nested exception. */
|
||||
newact.sa_flags |= SA_NODEFER;
|
||||
|
||||
newact.sa_restorer = 0;
|
||||
r = sigaction (signum, &newact, 0);
|
||||
assert (r == 0);
|
||||
}
|
||||
|
||||
/* Set constructor priority to two to make it run after the
|
||||
constructor in sigaction.c. */
|
||||
static void __attribute__ ((constructor (1005)))
|
||||
mpxrt_prepare (void)
|
||||
{
|
||||
__mpxrt_init_env_vars (&bndpreserve);
|
||||
setup_handler ();
|
||||
process_specific_init ();
|
||||
}
|
||||
|
||||
static void __attribute__ ((destructor))
|
||||
mpxrt_cleanup (void)
|
||||
{
|
||||
__mpxrt_print_summary (num_bnd_chk, MPX_L1_SIZE);
|
||||
__mpxrt_utils_free ();
|
||||
process_specific_finish ();
|
||||
}
|
Loading…
Add table
Reference in a new issue