summaryrefslogtreecommitdiffstats
path: root/c++
diff options
context:
space:
mode:
authorBill Wendling <wendling@ncsa.uiuc.edu>2001-08-01 21:00:25 (GMT)
committerBill Wendling <wendling@ncsa.uiuc.edu>2001-08-01 21:00:25 (GMT)
commitb5d11111b020618ba8716c9b8d4216303f0b2a30 (patch)
tree7b20e78965261b8282e9629b2e3b4f783cf4e579 /c++
parent0d6d3eafe4458b141f44a1ef119ee1fc72b01714 (diff)
downloadhdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.zip
hdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.tar.gz
hdf5-b5d11111b020618ba8716c9b8d4216303f0b2a30.tar.bz2
[svn-r4292]
Purpose: Bug Fix Description: The way we were generating Dependencies and .depend files was broken. If the $srcdir or other macros began with a ".", then it would match anything and cause problems since it would then overwrite the beginning of the header file's path. Solution: Wrote a Perl script which can handle this type of weirdness better. It's only used when the environment is a GNU one with a GCC compiler... Platforms tested: Linux
Diffstat (limited to 'c++')
-rw-r--r--c++/config/depend1.in47
-rwxr-xr-xc++/configure75
-rw-r--r--c++/configure.in9
3 files changed, 88 insertions, 43 deletions
diff --git a/c++/config/depend1.in b/c++/config/depend1.in
index f00bfd4..eaa7488 100644
--- a/c++/config/depend1.in
+++ b/c++/config/depend1.in
@@ -21,34 +21,31 @@
## tilde to the file name.
##
$(srcdir)/Dependencies: .depend
- @if test "$(srcdir)" != "."; then \
- echo '## This file is machine generated on GNU systems.' >$@; \
- echo '## Only temporary changes may be made here.' >>$@; \
- echo >>$@; \
- perl -p $(top_srcdir)/bin/distdep .depend >>$@; \
- else \
- echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
- fi
+ @if test "$(srcdir)" != "."; then \
+ echo '## This file is machine generated on GNU systems.' >$@; \
+ echo '## Only temporary changes may be made here.' >>$@; \
+ echo >>$@; \
+ $(PERL) -p $(top_srcdir)/bin/distdep .depend >>$@; \
+ else \
+ echo 'Dependencies cannot be built when $$srcdir == $$builddir'; \
+ fi
.depend: $(LIB_SRC) $(TEST_SRC) $(PROG_SRC)
@touch .depend
- @for dep in $? dummy; do \
- if [ $$dep != "dummy" ]; then \
- case "$$dep" in \
- *.cpp) \
- echo Building dependencies for $$dep; \
- obj=`basename $$dep .cpp`.lo; \
- sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
- $(TRACE) $$dep; \
- $(CC) -MM -MG $(CPPFLAGS) $$dep 2>/dev/null | \
- sed 's% $(srcdir)/% $$(srcdir)/%g' | \
- sed 's% $(top_srcdir)/% $$(top_srcdir)/%g' | \
- sed 's% $(top_builddir)/% $$(top_builddir)/%g' | \
- sed 's/\.o/.lo/' >>$@; \
- ;; \
- esac; \
- fi; \
- done;
+ @for dep in $? dummy; do \
+ if test $$dep != "dummy" -a -n "$(PERL)"; then \
+ case "$$dep" in \
+ *.c) \
+ echo Building dependencies for $$dep; \
+ obj=`basename $$dep .c`.lo; \
+ sed '\%^'"$$obj"':%,\%[^\\]$$%d' <$@ >$@- && mv $@- $@; \
+ $(TRACE) $$dep; \
+ $(CC) -MM -MG $(CPPFLAGS) $$dep 2>/dev/null >>$@; \
+ $(PERL) -w $(top_srcdir)/bin/dependencies --srcdir=$(srcdir) --top_srcdir=$(top_srcdir) --top_builddir=$(top_builddir) $@; \
+ ;; \
+ esac; \
+ fi; \
+ done
-include .depend
diff --git a/c++/configure b/c++/configure
index 877db1e..cc7545c 100755
--- a/c++/configure
+++ b/c++/configure
@@ -1692,13 +1692,51 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
exec 5>>./config.log
+ PERL=""
+if test "X$GCC" = "Xyes"; then
+ for ac_prog in perl
+do
+# Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
+echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
+echo "configure:1703: checking for $ac_word" >&5
+if eval "test \"`echo '$''{'ac_cv_prog_PERL'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ if test -n "$PERL"; then
+ ac_cv_prog_PERL="$PERL" # Let the user override the test.
+else
+ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":"
+ ac_dummy="$PATH"
+ for ac_dir in $ac_dummy; do
+ test -z "$ac_dir" && ac_dir=.
+ if test -f $ac_dir/$ac_word; then
+ ac_cv_prog_PERL="$ac_prog"
+ break
+ fi
+ done
+ IFS="$ac_save_ifs"
+fi
+fi
+PERL="$ac_cv_prog_PERL"
+if test -n "$PERL"; then
+ echo "$ac_t""$PERL" 1>&6
+else
+ echo "$ac_t""no" 1>&6
+fi
+
+test -n "$PERL" && break
+done
+
+fi
+
if test -z "$AR"; then
for ac_prog in ar xar
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
set dummy $ac_prog; ac_word=$2
echo $ac_n "checking for $ac_word""... $ac_c" 1>&6
-echo "configure:1702: checking for $ac_word" >&5
+echo "configure:1740: checking for $ac_word" >&5
if eval "test \"`echo '$''{'ac_cv_prog_AR'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
@@ -1733,7 +1771,7 @@ fi
if test -z "$SEARCH"; then
echo $ac_n "checking how make searches directories""... $ac_c" 1>&6
-echo "configure:1737: checking how make searches directories" >&5
+echo "configure:1775: checking how make searches directories" >&5
while true; do #for break
cat >maketest <<EOF
VPATH=$srcdir/config $srcdir/src $srcdir/bin
@@ -1797,7 +1835,7 @@ EOF
fi
echo $ac_n "checking for production mode""... $ac_c" 1>&6
-echo "configure:1801: checking for production mode" >&5
+echo "configure:1839: checking for production mode" >&5
# Check whether --enable-production or --disable-production was given.
if test "${enable_production+set}" = set; then
enableval="$enable_production"
@@ -1831,7 +1869,7 @@ case "X-$enable_production" in
esac
echo $ac_n "checking if should build only statically linked executables""... $ac_c" 1>&6
-echo "configure:1835: checking if should build only statically linked executables" >&5
+echo "configure:1873: checking if should build only statically linked executables" >&5
# Check whether --enable-static_exec or --disable-static_exec was given.
if test "${enable_static_exec+set}" = set; then
enableval="$enable_static_exec"
@@ -1857,12 +1895,12 @@ cross_compiling=$ac_cv_prog_cxx_cross
echo $ac_n "checking if $CXX can handle namespaces""... $ac_c" 1>&6
-echo "configure:1861: checking if $CXX can handle namespaces" >&5
+echo "configure:1899: checking if $CXX can handle namespaces" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1866 "configure"
+#line 1904 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
@@ -1881,7 +1919,7 @@ int main(void) {
}
EOF
-if { (eval echo configure:1885: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1923: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo yes
@@ -1900,12 +1938,12 @@ fi
echo $ac_n "checking if $CXX needs old style header files in includes""... $ac_c" 1>&6
-echo "configure:1904: checking if $CXX needs old style header files in includes" >&5
+echo "configure:1942: checking if $CXX needs old style header files in includes" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1909 "configure"
+#line 1947 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
@@ -1916,7 +1954,7 @@ extern "C" void exit(int);
int main(void) { return 0; }
EOF
-if { (eval echo configure:1920: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1958: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo no
@@ -1935,12 +1973,12 @@ fi
echo $ac_n "checking if $CXX supports bool types""... $ac_c" 1>&6
-echo "configure:1939: checking if $CXX supports bool types" >&5
+echo "configure:1977: checking if $CXX supports bool types" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1944 "configure"
+#line 1982 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
@@ -1952,7 +1990,7 @@ int main(void) {
}
EOF
-if { (eval echo configure:1956: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:1994: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo yes
@@ -1971,12 +2009,12 @@ fi
echo $ac_n "checking if $CXX can handle static cast""... $ac_c" 1>&6
-echo "configure:1975: checking if $CXX can handle static cast" >&5
+echo "configure:2013: checking if $CXX can handle static cast" >&5
if test "$cross_compiling" = yes; then
{ echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; }
else
cat > conftest.$ac_ext <<EOF
-#line 1980 "configure"
+#line 2018 "configure"
#include "confdefs.h"
#ifdef __cplusplus
extern "C" void exit(int);
@@ -1991,7 +2029,7 @@ int main(void) {
}
EOF
-if { (eval echo configure:1995: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
+if { (eval echo configure:2033: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null
then
echo yes
@@ -2059,7 +2097,7 @@ rm -f confcache
echo $ac_n "checking make""... $ac_c" 1>&6
-echo "configure:2063: checking make" >&5
+echo "configure:2101: checking make" >&5
if test "`${MAKE-make} --version -f /dev/null 2>/dev/null |\
sed -n 1p|cut -c1-8`" = "GNU Make"; then
@@ -2076,7 +2114,7 @@ fi
if test -z "$DEPEND"; then
echo $ac_n "checking how to include a makefile""... $ac_c" 1>&6
-echo "configure:2080: checking how to include a makefile" >&5
+echo "configure:2118: checking how to include a makefile" >&5
cat >makeinc <<EOF
foo:
@@ -2312,6 +2350,7 @@ s%@RANLIB@%$RANLIB%g
s%@CC@%$CC%g
s%@LN_S@%$LN_S%g
s%@LIBTOOL@%$LIBTOOL%g
+s%@PERL@%$PERL%g
s%@AR@%$AR%g
s%@LT_STATIC_EXEC@%$LT_STATIC_EXEC%g
/@DEPEND@/r $DEPEND
diff --git a/c++/configure.in b/c++/configure.in
index b811450..f4bba77 100644
--- a/c++/configure.in
+++ b/c++/configure.in
@@ -125,6 +125,15 @@ AC_PROG_MAKE_SET
AC_PROG_INSTALL
AM_PROG_LIBTOOL
+dnl ----------------------------------------------------------------------
+dnl Check if they have Perl installed on their system. We only need Perl
+dnl if they're using a GNU compiler.
+dnl
+AC_SUBST(PERL) PERL=""
+if test "X$GCC" = "Xyes"; then
+ AC_CHECK_PROGS(PERL, perl,, $PATH)
+fi
+
if test -z "$AR"; then
AC_CHECK_PROGS(AR,ar xar,:,$PATH)
fi