summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlbert Cheng <acheng@hdfgroup.org>2010-04-01 20:58:22 (GMT)
committerAlbert Cheng <acheng@hdfgroup.org>2010-04-01 20:58:22 (GMT)
commitd891ae199770c15e2c841badfbd2a68fee54b638 (patch)
treee66decced21f8db8b3f467c446c72ca8132d26cd /src
parent93c993d1f23fa663f3e64a16bcc62cac199d3226 (diff)
downloadhdf5-d891ae199770c15e2c841badfbd2a68fee54b638.zip
hdf5-d891ae199770c15e2c841badfbd2a68fee54b638.tar.gz
hdf5-d891ae199770c15e2c841badfbd2a68fee54b638.tar.bz2
[svn-r18492] Bug fix:
Testlibinfo.sh failed again. Solution: Removed the const from H5libhdf5_settings definition, again. Revamp the whole setting so that H5lib_settings.c is compiled individually, just like H5Tinit.c. Hope this will take care of the problem once for all. Tested: Jam using --disable-shared with --enable and --disable-embedded-libinfo. Will test this on the AIX platform after commit (cannot run bin/reconfigure in the AIX platform and it is too clumsy to try to ssh files back and forth and incurred "svn merge inconsistency" later too. Pretty confident this fix should work in all other platforms.
Diffstat (limited to 'src')
-rw-r--r--src/H5.c2
-rw-r--r--src/H5detect.c1
-rw-r--r--src/H5make_libsettings.c40
-rw-r--r--src/H5private.h2
-rwxr-xr-xsrc/Makefile.am16
-rw-r--r--src/Makefile.in59
6 files changed, 49 insertions, 71 deletions
diff --git a/src/H5.c b/src/H5.c
index 5dbc371..0a14c6e 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -16,14 +16,12 @@
/****************/
/* Module Setup */
/****************/
-#define H5_LIBSETTINGS_OWNER /* This module is the owner of the lib settings variable */
/***********/
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
-#include "H5lib_settings.h" /* Library build settings */
#include "H5ACprivate.h" /* Metadata cache */
#include "H5Dprivate.h" /* Datasets */
#include "H5Eprivate.h" /* Error handling */
diff --git a/src/H5detect.c b/src/H5detect.c
index 8fc1690..50b36fd 100644
--- a/src/H5detect.c
+++ b/src/H5detect.c
@@ -108,7 +108,6 @@ static void detect_C99_integers16(void);
static void detect_C99_integers32(void);
static void detect_C99_integers64(void);
static void detect_alignments(void);
-static void insert_libhdf5_settings(FILE *flibinfo);
static size_t align_g[] = {1, 2, 4, 8, 16};
static jmp_buf jbuf_g;
diff --git a/src/H5make_libsettings.c b/src/H5make_libsettings.c
index 49b17bd..d903592 100644
--- a/src/H5make_libsettings.c
+++ b/src/H5make_libsettings.c
@@ -35,7 +35,7 @@ static const char *FileHeader = "\n\
* 17 Mar 2010
* Quincey Koziol
*
- * Purpose: Generate the H5libsettings.h header file from the
+ * Purpose: Generate the H5libsettings.c file from the
* libhdf5.settings file.
*
*-------------------------------------------------------------------------
@@ -66,11 +66,7 @@ static const char *FileHeader = "\n\
static void
insert_libhdf5_settings(FILE *flibinfo)
{
- fprintf(flibinfo, "#ifndef H5_LIBSETTINGS_OWNER\n");
- fprintf(flibinfo, "extern const char H5libhdf5_settings[];\n");
- fprintf(flibinfo, "#else /* H5_LIBSETTINGS_OWNER */\n");
#ifdef H5_HAVE_EMBEDDED_LIBINFO
-{
FILE *fsettings; /* for files libhdf5.settings */
int inchar;
int bol = 0; /* indicates the beginning of a new line */
@@ -81,8 +77,8 @@ insert_libhdf5_settings(FILE *flibinfo)
} /* end if */
/* print variable definition and the string */
- /* Do not use static else AIX strings does not show it. */
- fprintf(flibinfo, "const char H5libhdf5_settings[]=\n");
+ /* Do not use const else AIX strings does not show it. */
+ fprintf(flibinfo, "char H5libhdf5_settings[]=\n");
bol++;
while(EOF != (inchar = HDgetc(fsettings))) {
if(bol) {
@@ -113,13 +109,11 @@ insert_libhdf5_settings(FILE *flibinfo)
HDperror(LIBSETTINGSFNAME);
HDexit(1);
} /* end if */
-}
#else
/* print variable definition and an empty string */
- /* Do not use static else AIX strings does not show it. */
- fprintf(flibinfo, "const char H5libhdf5_settings[]=\"\";\n");
+ /* Do not use const else AIX strings does not show it. */
+ fprintf(flibinfo, "char H5libhdf5_settings[]=\"\";\n");
#endif
- fprintf(flibinfo, "#endif /* H5_LIBSETTINGS_OWNER */\n");
} /* insert_libhdf5_settings() */
@@ -148,7 +142,7 @@ make_libinfo(void)
/*-------------------------------------------------------------------------
* Function: print_header
*
- * Purpose: Prints the H file header for the generated file.
+ * Purpose: Prints the header for the generated file.
*
* Return: void
*
@@ -253,16 +247,13 @@ information about the library build configuration\n";
for(i = 0; i < 73; i++)
HDputchar('-');
printf("\n */\n\n");
-
- printf("#ifndef _H5lib_settings_H\n");
- printf("#define _H5lib_settings_H\n\n");
}
/*-------------------------------------------------------------------------
* Function: print_footer
*
- * Purpose: Prints the H file footer for the generated file.
+ * Purpose: Prints the file footer for the generated file.
*
* Return: void
*
@@ -275,7 +266,7 @@ information about the library build configuration\n";
static void
print_footer(void)
{
- printf("#endif /* _H5lib_settings_H */\n\n");
+ /* nothing */
}
@@ -288,16 +279,8 @@ print_footer(void)
*
* Failure: exit(1)
*
- * Programmer: Robb Matzke
- * matzke@llnl.gov
- * Jun 12, 1996
- *
- * Modifications:
- * Albert Cheng, 2004/05/20
- * Some compilers, e.g., Intel C v7.0, took a long time to compile
- * with optimization when a module routine contains many code lines.
- * Divide up all those types detections macros into subroutines, both
- * to avoid the compiler optimization error and cleaner codes.
+ * Programmer: Albert Cheng
+ * 2010/4/1
*
*-------------------------------------------------------------------------
*/
@@ -311,6 +294,5 @@ main(void)
print_footer();
- return 0;
+ HDexit(0);
}
-
diff --git a/src/H5private.h b/src/H5private.h
index 277fe70..860e8ac 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -1535,6 +1535,8 @@ typedef struct H5_debug_t {
extern H5_debug_t H5_debug_g;
#define H5DEBUG(X) (H5_debug_g.pkg[H5_PKG_##X].stream)
+/* Do not use const else AIX strings does not show it. */
+extern char H5libhdf5_settings[]; /* embedded library information */
/*-------------------------------------------------------------------------
* Purpose: These macros are inserted automatically just after the
diff --git a/src/Makefile.am b/src/Makefile.am
index 735cf9d..9acfcd2 100755
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -35,8 +35,8 @@ lib_LTLIBRARIES=libhdf5.la
# Add libtool numbers to the HDF5 library (from config/lt_vers.am)
libhdf5_la_LDFLAGS= -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
-# H5Tinit.c is a generated file, and should be cleaned.
-MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.h
+# H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
+MOSTLYCLEANFILES=H5Tinit.c H5lib_settings.c
# H5pubconf.h is generated by configure, and should be cleaned.
DISTCLEANFILES=H5pubconf.h
@@ -72,7 +72,7 @@ libhdf5_la_SOURCES= H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
H5HG.c H5HGcache.c H5HGdbg.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c \
- H5HP.c H5I.c H5L.c H5Lexternal.c \
+ H5HP.c H5I.c H5L.c H5Lexternal.c H5lib_settings.c \
H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
H5MM.c H5MP.c H5MPtest.c \
H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
@@ -130,21 +130,19 @@ settings_DATA=libhdf5.settings
H5Tinit.c: H5detect$(EXEEXT)
LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
sed -e 's/-L/:/g' -e 's/ //g'`" \
- $(RUNSERIAL) ./H5detect$(EXEEXT) > H5Tinit.c || \
+ $(RUNSERIAL) ./H5detect$(EXEEXT) > $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
-H5.o H5.lo: H5lib_settings.h
-
# Build configuration header file generation
# The LD_LIBRARY_PATH setting is a kludge.
# Things should have been all set during H5make_libsettings making.
-# Remove the generated .h file if errors occur unless HDF5_Make_Ignore
+# Remove the generated .c file if errors occur unless HDF5_Make_Ignore
# is set to ignore the error.
-H5lib_settings.h: H5make_libsettings$(EXEEXT) libhdf5.settings
+H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
sed -e 's/-L/:/g' -e 's/ //g'`" \
- $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > H5lib_settings.h || \
+ $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
diff --git a/src/Makefile.in b/src/Makefile.in
index ac8e2af..40e0097 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -123,27 +123,27 @@ am_libhdf5_la_OBJECTS = H5.lo H5checksum.lo H5dbg.lo H5system.lo \
H5HFman.lo H5HFsection.lo H5HFspace.lo H5HFstat.lo H5HFtest.lo \
H5HFtiny.lo H5HG.lo H5HGcache.lo H5HGdbg.lo H5HL.lo \
H5HLcache.lo H5HLdbg.lo H5HLint.lo H5HP.lo H5I.lo H5L.lo \
- H5Lexternal.lo H5MF.lo H5MFaggr.lo H5MFdbg.lo H5MFsection.lo \
- H5MM.lo H5MP.lo H5MPtest.lo H5O.lo H5Oainfo.lo H5Oalloc.lo \
- H5Oattr.lo H5Oattribute.lo H5Obogus.lo H5Obtreek.lo \
- H5Ocache.lo H5Ocont.lo H5Ocopy.lo H5Odbg.lo H5Odrvinfo.lo \
- H5Odtype.lo H5Oefl.lo H5Ofill.lo H5Ofsinfo.lo H5Oginfo.lo \
- H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omessage.lo H5Omtime.lo \
- H5Oname.lo H5Onull.lo H5Opline.lo H5Orefcount.lo H5Osdspace.lo \
- H5Oshared.lo H5Ostab.lo H5Oshmesg.lo H5Otest.lo H5Ounknown.lo \
- H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo H5Pdeprec.lo \
- H5Pdxpl.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo H5Pgcpl.lo \
- H5Pint.lo H5Plapl.lo H5Plcpl.lo H5Pocpl.lo H5Pocpypl.lo \
- H5Pstrcpl.lo H5Ptest.lo H5R.lo H5Rdeprec.lo H5RC.lo H5RS.lo \
- H5S.lo H5Sall.lo H5Sdbg.lo H5Shyper.lo H5Smpio.lo H5Snone.lo \
- H5Spoint.lo H5Sselect.lo H5Stest.lo H5SL.lo H5SM.lo \
- H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo H5SMtest.lo H5ST.lo \
- H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo H5Tcompound.lo \
- H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo H5Tenum.lo \
- H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo H5Tnative.lo \
- H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo H5Tpad.lo \
- H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo H5TS.lo \
- H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \
+ H5Lexternal.lo H5lib_settings.lo H5MF.lo H5MFaggr.lo \
+ H5MFdbg.lo H5MFsection.lo H5MM.lo H5MP.lo H5MPtest.lo H5O.lo \
+ H5Oainfo.lo H5Oalloc.lo H5Oattr.lo H5Oattribute.lo H5Obogus.lo \
+ H5Obtreek.lo H5Ocache.lo H5Ocont.lo H5Ocopy.lo H5Odbg.lo \
+ H5Odrvinfo.lo H5Odtype.lo H5Oefl.lo H5Ofill.lo H5Ofsinfo.lo \
+ H5Oginfo.lo H5Olayout.lo H5Olinfo.lo H5Olink.lo H5Omessage.lo \
+ H5Omtime.lo H5Oname.lo H5Onull.lo H5Opline.lo H5Orefcount.lo \
+ H5Osdspace.lo H5Oshared.lo H5Ostab.lo H5Oshmesg.lo H5Otest.lo \
+ H5Ounknown.lo H5P.lo H5Pacpl.lo H5Pdapl.lo H5Pdcpl.lo \
+ H5Pdeprec.lo H5Pdxpl.lo H5Pfapl.lo H5Pfcpl.lo H5Pfmpl.lo \
+ H5Pgcpl.lo H5Pint.lo H5Plapl.lo H5Plcpl.lo H5Pocpl.lo \
+ H5Pocpypl.lo H5Pstrcpl.lo H5Ptest.lo H5R.lo H5Rdeprec.lo \
+ H5RC.lo H5RS.lo H5S.lo H5Sall.lo H5Sdbg.lo H5Shyper.lo \
+ H5Smpio.lo H5Snone.lo H5Spoint.lo H5Sselect.lo H5Stest.lo \
+ H5SL.lo H5SM.lo H5SMbtree2.lo H5SMcache.lo H5SMmessage.lo \
+ H5SMtest.lo H5ST.lo H5T.lo H5Tarray.lo H5Tbit.lo H5Tcommit.lo \
+ H5Tcompound.lo H5Tconv.lo H5Tcset.lo H5Tdbg.lo H5Tdeprec.lo \
+ H5Tenum.lo H5Tfields.lo H5Tfixed.lo H5Tfloat.lo H5Tinit.lo \
+ H5Tnative.lo H5Toffset.lo H5Toh.lo H5Topaque.lo H5Torder.lo \
+ H5Tpad.lo H5Tprecis.lo H5Tstrpad.lo H5Tvisit.lo H5Tvlen.lo \
+ H5TS.lo H5V.lo H5WB.lo H5Z.lo H5Zdeflate.lo H5Zfletcher32.lo \
H5Znbit.lo H5Zshuffle.lo H5Zszip.lo H5Zscaleoffset.lo \
H5Ztrans.lo
libhdf5_la_OBJECTS = $(am_libhdf5_la_OBJECTS)
@@ -453,8 +453,8 @@ lib_LTLIBRARIES = libhdf5.la
# Add libtool numbers to the HDF5 library (from config/lt_vers.am)
libhdf5_la_LDFLAGS = -version-info $(LT_VERS_INTERFACE):$(LT_VERS_REVISION):$(LT_VERS_AGE) $(AM_LDFLAGS)
-# H5Tinit.c is a generated file, and should be cleaned.
-MOSTLYCLEANFILES = H5Tinit.c H5lib_settings.h
+# H5Tinit.c and H5lib_settings.c are generated files and should be cleaned.
+MOSTLYCLEANFILES = H5Tinit.c H5lib_settings.c
# H5pubconf.h is generated by configure, and should be cleaned.
DISTCLEANFILES = H5pubconf.h
@@ -490,7 +490,7 @@ libhdf5_la_SOURCES = H5.c H5checksum.c H5dbg.c H5system.c H5timer.c H5trace.c \
H5HFspace.c H5HFstat.c H5HFtest.c H5HFtiny.c \
H5HG.c H5HGcache.c H5HGdbg.c \
H5HL.c H5HLcache.c H5HLdbg.c H5HLint.c \
- H5HP.c H5I.c H5L.c H5Lexternal.c \
+ H5HP.c H5I.c H5L.c H5Lexternal.c H5lib_settings.c \
H5MF.c H5MFaggr.c H5MFdbg.c H5MFsection.c \
H5MM.c H5MP.c H5MPtest.c \
H5O.c H5Oainfo.c H5Oalloc.c H5Oattr.c \
@@ -917,6 +917,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5checksum.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5dbg.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5detect-H5detect.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5lib_settings.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5make_libsettings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5system.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/H5timer.Plo@am__quote@
@@ -1245,21 +1246,19 @@ help:
H5Tinit.c: H5detect$(EXEEXT)
LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
sed -e 's/-L/:/g' -e 's/ //g'`" \
- $(RUNSERIAL) ./H5detect$(EXEEXT) > H5Tinit.c || \
+ $(RUNSERIAL) ./H5detect$(EXEEXT) > $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)
-H5.o H5.lo: H5lib_settings.h
-
# Build configuration header file generation
# The LD_LIBRARY_PATH setting is a kludge.
# Things should have been all set during H5make_libsettings making.
-# Remove the generated .h file if errors occur unless HDF5_Make_Ignore
+# Remove the generated .c file if errors occur unless HDF5_Make_Ignore
# is set to ignore the error.
-H5lib_settings.h: H5make_libsettings$(EXEEXT) libhdf5.settings
+H5lib_settings.c: H5make_libsettings$(EXEEXT) libhdf5.settings
LD_LIBRARY_PATH="$$LD_LIBRARY_PATH`echo $(LDFLAGS) | \
sed -e 's/-L/:/g' -e 's/ //g'`" \
- $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > H5lib_settings.h || \
+ $(RUNSERIAL) ./H5make_libsettings$(EXEEXT) > $@ || \
(test $$HDF5_Make_Ignore && echo "*** Error ignored") || \
($(RM) $@ ; exit 1)