From bb98c08d928a1557630735a4c9cddb4bbe054fbd Mon Sep 17 00:00:00 2001 From: carns Date: Wed, 4 Apr 2012 17:52:56 +0000 Subject: [PATCH] added darshan-config utility fixes #74 git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@549 3b7491f3-a168-0410-bf4b-c445ed680a29 --- darshan-runtime/Makefile.in | 1 + darshan-runtime/configure | 3 ++- darshan-runtime/configure.in | 1 + darshan-runtime/darshan-config.in | 37 +++++++++++++++++++++++++++++++ 4 files changed, 41 insertions(+), 1 deletion(-) create mode 100755 darshan-runtime/darshan-config.in diff --git a/darshan-runtime/Makefile.in b/darshan-runtime/Makefile.in index c2cb497..8531ab3 100644 --- a/darshan-runtime/Makefile.in +++ b/darshan-runtime/Makefile.in @@ -98,6 +98,7 @@ endif install -m 755 darshan-gen-cc.pl $(bindir) install -m 755 darshan-gen-cxx.pl $(bindir) install -m 755 darshan-gen-fortran.pl $(bindir) + install -m 755 darshan-config $(bindir) clean:: rm -f *.o *.a lib/*.o lib/*.po lib/*.a lib/*.so diff --git a/darshan-runtime/configure b/darshan-runtime/configure index 256754e..8a4d960 100755 --- a/darshan-runtime/configure +++ b/darshan-runtime/configure @@ -4190,7 +4190,7 @@ fi -ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl" +ac_config_files="$ac_config_files Makefile darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl darshan-config" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -4901,6 +4901,7 @@ do "darshan-gen-cc.pl") CONFIG_FILES="$CONFIG_FILES darshan-gen-cc.pl" ;; "darshan-gen-cxx.pl") CONFIG_FILES="$CONFIG_FILES darshan-gen-cxx.pl" ;; "darshan-gen-fortran.pl") CONFIG_FILES="$CONFIG_FILES darshan-gen-fortran.pl" ;; + "darshan-config") CONFIG_FILES="$CONFIG_FILES darshan-config" ;; *) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;; esac diff --git a/darshan-runtime/configure.in b/darshan-runtime/configure.in index cf72435..1a78767 100644 --- a/darshan-runtime/configure.in +++ b/darshan-runtime/configure.in @@ -231,4 +231,5 @@ darshan-mk-log-dirs.pl darshan-gen-cc.pl darshan-gen-cxx.pl darshan-gen-fortran.pl +darshan-config ) diff --git a/darshan-runtime/darshan-config.in b/darshan-runtime/darshan-config.in new file mode 100755 index 0000000..5ae43c0 --- /dev/null +++ b/darshan-runtime/darshan-config.in @@ -0,0 +1,37 @@ +#!/bin/sh + +CP_WRAPPERS="@CP_WRAPPERS@" +DARSHAN_LIB_PATH="@darshan_lib_path@" +DARSHAN_LD_FLAGS="@LDFLAGS@" + +PRE_LD_FLAGS="-L$DARSHAN_LIB_PATH $DARSHAN_LD_FLAGS -ldarshan-mpi-io -lz $CP_WRAPPERS" +POST_LD_FLAGS="-L$DARSHAN_LIB_PATH -ldarshan-posix" + +usage="\ +Usage: darshan-config [--pre-ld-flags] [--post-ld-flags]" + +if test $# -eq 0; then + echo "${usage}" 1>&2 + exit 1 +fi + +while test $# -gt 0; do + case "$1" in + -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; + *) optarg= ;; + esac + + case $1 in + --pre-ld-flags) + echo $PRE_LD_FLAGS + ;; + --post-ld-flags) + echo $POST_LD_FLAGS + ;; + *) + echo "${usage}" 1>&2 + exit 1 + ;; + esac + shift +done -- 2.26.2