Commit 341ef39b authored by Shane Snyder's avatar Shane Snyder

Update darshan configure, installed headers, and darshan-util pkg-config file...

Update darshan configure, installed headers, and darshan-util pkg-config file to allow darshan-util lib to be linked with external software

git-svn-id: https://svn.mcs.anl.gov/repos/darshan/trunk@826 3b7491f3-a168-0410-bf4b-c445ed680a29
parent d2374dcc
...@@ -6,39 +6,16 @@ ...@@ -6,39 +6,16 @@
#ifndef __DARSHAN_LOG_FORMAT_H #ifndef __DARSHAN_LOG_FORMAT_H
#define __DARSHAN_LOG_FORMAT_H #define __DARSHAN_LOG_FORMAT_H
#ifndef DARSHAN_CONFIG_H
#error Must define DARSHAN_CONFIG_H
#endif
#include DARSHAN_CONFIG_H
#include <unistd.h> #include <unistd.h>
#include <sys/types.h> #include <sys/types.h>
#include <stdint.h> #include <stdint.h>
#ifdef HAVE_INTTYPES_H #include <inttypes.h>
#include <inttypes.h>
#endif
#if !defined PRId64 || defined(PRI_MACROS_BROKEN) #if !defined PRId64
#ifndef __WORDSIZE #error failed to detect PRId64
#error failed to detect PRId64 or word size
#endif
# undef PRId64
#if __WORDSIZE == 64
# define PRId64 "ld"
#else
# define PRId64 "lld"
#endif
#endif
#if !defined PRIu64 || defined(PRI_MACROS_BROKEN)
#ifndef __WORDSIZE
#error failed to detect PRId64 or word size
#endif
# undef PRIu64
#if __WORDSIZE == 64
# define PRIu64 "lu"
#else
# define PRIu64 "llu"
#endif #endif
#if !defined PRIu64
#error failed to detect PRIu64
#endif #endif
/* update this on file format changes */ /* update this on file format changes */
......
...@@ -3830,6 +3830,24 @@ _ACEOF ...@@ -3830,6 +3830,24 @@ _ACEOF
fi fi
if test x$PRI_MACROS_BROKEN == xyes; then
as_fn_error $? "PRI_xx macros are broken" "$LINENO" 5
else
for ac_header in inttypes.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
if test "x$ac_cv_header_inttypes_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_INTTYPES_H 1
_ACEOF
else
as_fn_error $? "Couldn't find inttypes.h" "$LINENO" 5
fi
done
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether byte ordering is bigendian" >&5
$as_echo_n "checking whether byte ordering is bigendian... " >&6; } $as_echo_n "checking whether byte ordering is bigendian... " >&6; }
...@@ -4056,7 +4074,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h ...@@ -4056,7 +4074,6 @@ $as_echo "#define AC_APPLE_UNIVERSAL_BUILD 1" >>confdefs.h
esac esac
old_cflags="$CFLAGS" old_cflags="$CFLAGS"
CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE" CFLAGS="$CFLAGS -D_FILE_OFFSET_BITS=64 -D_LARGEFILE64_SOURCE"
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct aiocb64" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for struct aiocb64" >&5
......
...@@ -130,11 +130,15 @@ fi ...@@ -130,11 +130,15 @@ fi
# checks to see how we can print 64 bit values on this architecture # checks to see how we can print 64 bit values on this architecture
gt_INTTYPES_PRI gt_INTTYPES_PRI
if test x$PRI_MACROS_BROKEN == xyes; then
AC_MSG_ERROR(PRI_xx macros are broken)
else
AC_CHECK_HEADERS(inttypes.h, , [AC_MSG_ERROR(Couldn't find inttypes.h)])
fi
dnl Check byte ordering dnl Check byte ordering
AC_C_BIGENDIAN AC_C_BIGENDIAN
dnl temporarily set large file flags just for this test; we don't want dnl temporarily set large file flags just for this test; we don't want
dnl it to propagate to the makefile because of zlib bugs dnl it to propagate to the makefile because of zlib bugs
old_cflags="$CFLAGS" old_cflags="$CFLAGS"
......
...@@ -625,6 +625,7 @@ __CP_PDFLATEX_HALT_ON_ERROR ...@@ -625,6 +625,7 @@ __CP_PDFLATEX_HALT_ON_ERROR
__CP_ZLIB_INCLUDE_FLAGS __CP_ZLIB_INCLUDE_FLAGS
__CP_ZLIB_LINK_FLAGS __CP_ZLIB_LINK_FLAGS
HAVE_PDFLATEX HAVE_PDFLATEX
PRI_MACROS_BROKEN
LIBBZ2 LIBBZ2
EGREP EGREP
GREP GREP
...@@ -3757,6 +3758,84 @@ fi ...@@ -3757,6 +3758,84 @@ fi
# checks to see how we can print 64 bit values on this architecture
for ac_header in inttypes.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
if test "x$ac_cv_header_inttypes_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_INTTYPES_H 1
_ACEOF
fi
done
if test $ac_cv_header_inttypes_h = yes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the inttypes.h PRIxNN macros are broken" >&5
$as_echo_n "checking whether the inttypes.h PRIxNN macros are broken... " >&6; }
if ${gt_cv_inttypes_pri_broken+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
#include <inttypes.h>
#ifdef PRId32
char *p = PRId32;
#endif
int
main ()
{
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
gt_cv_inttypes_pri_broken=no
else
gt_cv_inttypes_pri_broken=yes
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $gt_cv_inttypes_pri_broken" >&5
$as_echo "$gt_cv_inttypes_pri_broken" >&6; }
fi
if test "$gt_cv_inttypes_pri_broken" = yes; then
cat >>confdefs.h <<_ACEOF
#define PRI_MACROS_BROKEN 1
_ACEOF
PRI_MACROS_BROKEN=1
else
PRI_MACROS_BROKEN=0
fi
if test x$PRI_MACROS_BROKEN == xyes; then
as_fn_error $? "PRI_xx macros are broken" "$LINENO" 5
else
for ac_header in inttypes.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "inttypes.h" "ac_cv_header_inttypes_h" "$ac_includes_default"
if test "x$ac_cv_header_inttypes_h" = xyes; then :
cat >>confdefs.h <<_ACEOF
#define HAVE_INTTYPES_H 1
_ACEOF
else
as_fn_error $? "Couldn't find inttypes.h" "$LINENO" 5
fi
done
fi
# Extract the first word of "pdflatex", so it can be a program name with args. # Extract the first word of "pdflatex", so it can be a program name with args.
set dummy pdflatex; ac_word=$2 set dummy pdflatex; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
......
...@@ -15,6 +15,14 @@ AC_PROG_INSTALL ...@@ -15,6 +15,14 @@ AC_PROG_INSTALL
CHECK_ZLIB CHECK_ZLIB
CHECK_BZLIB CHECK_BZLIB
# checks to see how we can print 64 bit values on this architecture
gt_INTTYPES_PRI
if test x$PRI_MACROS_BROKEN == xyes; then
AC_MSG_ERROR(PRI_xx macros are broken)
else
AC_CHECK_HEADERS(inttypes.h, , [AC_MSG_ERROR(Couldn't find inttypes.h)])
fi
AC_CHECK_PROG(HAVE_PDFLATEX, pdflatex, yes, no) AC_CHECK_PROG(HAVE_PDFLATEX, pdflatex, yes, no)
if test x$HAVE_PDFLATEX == xyes; then if test x$HAVE_PDFLATEX == xyes; then
......
...@@ -15,8 +15,27 @@ ...@@ -15,8 +15,27 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#include <zlib.h>
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
#endif
#include "darshan-logutils.h" #include "darshan-logutils.h"
struct darshan_fd_s
{
gzFile gzf;
#ifdef HAVE_LIBBZ2
BZFILE* bzf;
#endif
int64_t pos;
char mode[2];
int swap_flag;
char version[10];
int job_struct_size;
char* name;
};
/* isn't there a clever c way to avoid this? */ /* isn't there a clever c way to avoid this? */
char *darshan_names[] = { char *darshan_names[] = {
"CP_INDEP_OPENS", "CP_INDEP_OPENS",
......
...@@ -6,24 +6,7 @@ ...@@ -6,24 +6,7 @@
#ifndef __DARSHAN_LOG_UTILS_H #ifndef __DARSHAN_LOG_UTILS_H
#define __DARSHAN_LOG_UTILS_H #define __DARSHAN_LOG_UTILS_H
#include <darshan-log-format.h> #include <darshan-log-format.h>
#include <zlib.h>
#ifdef HAVE_LIBBZ2
#include <bzlib.h>
#endif
struct darshan_fd_s
{
gzFile gzf;
#ifdef HAVE_LIBBZ2
BZFILE* bzf;
#endif
int64_t pos;
char mode[2];
int swap_flag;
char version[10];
int job_struct_size;
char* name;
};
typedef struct darshan_fd_s* darshan_fd; typedef struct darshan_fd_s* darshan_fd;
extern char *darshan_names[]; extern char *darshan_names[];
...@@ -92,5 +75,4 @@ void darshan_log_print_version_warnings(struct darshan_job *job); ...@@ -92,5 +75,4 @@ void darshan_log_print_version_warnings(struct darshan_job *job);
memcpy(__ptr, __dst_char, 4); \ memcpy(__ptr, __dst_char, 4); \
} while(0) } while(0)
#endif #endif
...@@ -60,6 +60,9 @@ ...@@ -60,6 +60,9 @@
/* Define to the version of this package. */ /* Define to the version of this package. */
#undef PACKAGE_VERSION #undef PACKAGE_VERSION
/* Define if <inttypes.h> exists and defines unusable PRI* macros. */
#undef PRI_MACROS_BROKEN
/* Define to 1 if you have the ANSI C header files. */ /* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS #undef STDC_HEADERS
......
...@@ -3,14 +3,15 @@ exec_prefix = @exec_prefix@ ...@@ -3,14 +3,15 @@ exec_prefix = @exec_prefix@
libdir = @libdir@ libdir = @libdir@
includedir = @includedir@ includedir = @includedir@
abs_top_builddir = @abs_top_builddir@ abs_top_builddir = @abs_top_builddir@
LIBBZ2 = @LIBBZ2@
cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@ cp_zlib_include_flags = @__CP_ZLIB_INCLUDE_FLAGS@
cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@ cp_zlib_link_flags = @__CP_ZLIB_LINK_FLAGS@
LIBBZ2 = @LIBBZ2@
Name: darshan-util Name: darshan-util
Description: Library for parsing and summarizing log files produced by Darshan runtime Description: Library for parsing and summarizing log files produced by Darshan runtime
Version: @DARSHAN_UTIL_VERSION@ Version: @DARSHAN_UTIL_VERSION@
URL: http://trac.mcs.anl.gov/projects/darshan/ URL: http://trac.mcs.anl.gov/projects/darshan/
Requires: Requires:
Libs: -L${libdir} -ldarshan-util ${cp_zlib_link_flags} -lz ${LIBBZ2} Libs: -L${libdir} -ldarshan-util
Cflags: -I${includedir} -DDARSHAN_CONFIG_H=\"${abs_top_builddir}/darshan-util-config.h\" ${cp_zlib_include_flags} Libs.private: ${cp_zlib_link_flags} -lz ${LIBBZ2}
Cflags: -I${includedir} ${cp_zlib_include_flags}
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