Commit 88186f04 authored by Philip Carns's avatar Philip Carns

added --enable-shared option to darshan-util configure script


git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@886 3b7491f3-a168-0410-bf4b-c445ed680a29
parent 757f99dc
......@@ -12,17 +12,21 @@ bindir = $(DESTDIR)@bindir@
libdir = $(DESTDIR)@libdir@
pkgconfigdir = $(DESTDIR)$(libdir)/pkgconfig
DISABLE_LDPRELOAD = @DISABLE_LDPRELOAD@
DARSHAN_LOG_FORMAT = $(srcdir)/../darshan-log-format.h
DARSHAN_ENABLE_SHARED=@DARSHAN_ENABLE_SHARED@
VPATH = $(srcdir)
ifeq ($(DARSHAN_ENABLE_SHARED),1)
all: libdarshan-util.so
endif
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
# deliberately avoid large file support for host side utilities to avoid
# potentially buggy libz 64 bit offset support
CFLAGS = -I . -I $(srcdir) -I $(srcdir)/../ -DDARSHAN_CONFIG_H=\"darshan-util-config.h\" @CFLAGS@ @CPPFLAGS@
CFLAGS_SHARED = $(CFLAGS) -shared -fpic -DPIC
LDFLAGS=@LDFLAGS@
CC=@CC@
......@@ -58,7 +62,12 @@ darshan-diff.o: darshan-diff.c
$(CC) $(CFLAGS) -c $< -o $@
darshan-logutils.o: darshan-logutils.c
$(CC) $(CFLAGS) -c $< -o $@
darshan-logutils.po: darshan-logutils.c
$(CC) $(CFLAGS_SHARED) -c $< -o $@
libdarshan-util.so: darshan-logutils.po
$(CC) $(CFLAGS_SHARED) $(LDFLAGS) -o $@ $^ $(LIBS)
darshan-util-lib: darshan-logutils.o
ar rcs libdarshan-util.a $<
......@@ -82,6 +91,9 @@ install:: all
install -m 755 darshan-analyzer $(bindir)
install -m 755 $(srcdir)/darshan-summary-per-file.sh $(bindir)
install -m 755 libdarshan-util.a $(libdir)
ifeq ($(DARSHAN_ENABLE_SHARED),1)
install -m 755 libdarshan-util.so $(libdir)
endif
install -m 644 $(srcdir)/darshan-logutils.h $(includedir)
install -m 644 $(DARSHAN_LOG_FORMAT) $(includedir)
install -m 755 darshan-job-summary/bin/darshan-job-summary.pl $(bindir)
......
......@@ -621,6 +621,7 @@ ac_includes_default="\
ac_subst_vars='LTLIBOBJS
LIBOBJS
DARSHAN_ENABLE_SHARED
__CP_PDFLATEX_HALT_ON_ERROR
__CP_ZLIB_INCLUDE_FLAGS
__CP_ZLIB_LINK_FLAGS
......@@ -683,6 +684,7 @@ ac_user_opts='
enable_option_checking
with_zlib
with_bzlib
enable_shared
'
ac_precious_vars='build_alias
host_alias
......@@ -1298,6 +1300,12 @@ if test -n "$ac_init_help"; then
esac
cat <<\_ACEOF
Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
--enable-shared enables building of shared darshan-util library
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
......@@ -4162,6 +4170,16 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$old_cflags"
DARSHAN_ENABLE_SHARED=0
# Check whether --enable-shared was given.
if test "${enable_shared+set}" = set; then :
enableval=$enable_shared; if test "x$enableval" = "xyes" ; then
DARSHAN_ENABLE_SHARED=1
fi
fi
for ac_func in strndup
do :
ac_fn_c_check_func "$LINENO" "strndup" "ac_cv_func_strndup"
......@@ -4177,6 +4195,7 @@ done
ac_config_files="$ac_config_files Makefile darshan-job-summary/bin/darshan-job-summary.pl maint/darshan-util.pc"
cat >confcache <<\_ACEOF
......
......@@ -70,11 +70,20 @@ AC_TRY_COMPILE(
)
CFLAGS="$old_cflags"
DARSHAN_ENABLE_SHARED=0
AC_ARG_ENABLE(shared,
[ --enable-shared enables building of shared darshan-util library],
[if test "x$enableval" = "xyes" ; then
DARSHAN_ENABLE_SHARED=1
fi]
,)
AC_CHECK_FUNCS([strndup])
AC_SUBST(__CP_ZLIB_LINK_FLAGS)
AC_SUBST(__CP_ZLIB_INCLUDE_FLAGS)
AC_SUBST(__CP_PDFLATEX_HALT_ON_ERROR)
AC_SUBST(DARSHAN_ENABLE_SHARED)
AC_OUTPUT(Makefile
darshan-job-summary/bin/darshan-job-summary.pl
maint/darshan-util.pc
......
......@@ -55,6 +55,9 @@ specify alternative paths for zlib and libbz2 development libraries.
darshan-util also supports VPATH or "out-of-tree" builds if you prefer that
method of compilation.
The `--enable-shared` argument to configure can be used to enable
compilation of a shared version of the darshan-util library.
== Analyzing log files
Each time a darshan-instrumented application is executed, it will generate a
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment