root/mpich2/branches/dev/kumudb/confdb/aclocal.m4 @ 4870

Revision 4870, 5.2 KB (checked in by kumudb, 5 months ago)

Merge from trunk to kumudb r4748:r4869

Line 
1dnl
2dnl This version of aclocal.m4 simply includes all of the individual
3dnl components
4builtin(include,aclocal_am.m4)
5builtin(include,aclocal_bugfix.m4)
6builtin(include,aclocal_cache.m4)
7builtin(include,aclocal_cc.m4)
8builtin(include,aclocal_atomic.m4)
9builtin(include,aclocal_cross.m4)
10builtin(include,aclocal_cxx.m4)
11builtin(include,aclocal_f77.m4)
12builtin(include,aclocal_util.m4)
13builtin(include,aclocal_subcfg.m4)
14dnl If we're using 2.52, include new support for F90
15dnl If we're using 2.13, use the old version
16dnl If we're using 2.57, we're in trouble. 
17dnl !!!! 2.57 doesn't define AC_ACVERSION !!!!
18dnl 2.57 seems to define AC_PREPROC_IFELSE, so we use that
19dnl
20ifelse(AC_ACVERSION,[2.52],[
21builtin(include,aclangf90.m4)
22],[
23ifdef([AC_PREPROC_IFELSE],[
24builtin(include,fortran90.m4)],
25[builtin(include,aclocal_f90.m4)])
26])
27dnl builtin(include,aclocal_csharp.m4)
28builtin(include,aclocal_make.m4)
29builtin(include,aclocal_mpi.m4)
30builtin(include,aclocal_web.m4)
31dnl builtin(include,libtool.m4)
32builtin(include,aclocal_shl.m4)
33dnl builtin(include,aclocal_tcl.m4)
34builtin(include,aclocal_java.m4)
35
36dnl
37dnl Newer versions of autoconf support AC_EXEEXT and AC_OBJEXT.
38dnl If these are not available, just set them as empty
39ifdef([AC_EXEEXT],,[
40AC_DEFUN([AC_EXEEXT],[
41EXEEXT=
42AC_SUBST(EXEEXT)
43])])
44ifdef([AC_OBJEXT],,[
45AC_DEFUN([AC_OBJEXT],[
46OBJEXT=
47AC_SUBST(OBJEXT)
48])])
49dnl
50dnl PAC_MKDIRS(path)
51dnl Create any missing directories in the path
52dnl
53AC_DEFUN([PAC_MKDIRS],[
54#
55# Build any intermediate directories
56for dir in $1 ; do
57    saveIFS="$IFS"
58    IFS="/"
59    tmp_curdir=""
60    for tmp_subdir in $dir ; do
61        tmp_curdir="${tmp_curdir}$tmp_subdir"
62        if test ! -d "$tmp_curdir" ; then mkdir "$tmp_curdir" ; fi
63        tmp_curdir="${tmp_curdir}/"
64    done
65    IFS="$saveIFS"
66done
67])
68dnl
69dnl PAC_CONFIG_SUBDIRS_IMMEDIATE(DIR ...)
70dnl Perform the configuration *now*
71dnl
72dnl There is a bug in AC_OUTPUT_SUBDIRS that is tickled by this
73dnl code.  There is no step to create any of the intermediate
74dnl directories in the case that this is a vpath build. 
75dnl
76AC_DEFUN([PAC_CONFIG_SUBDIRS_IMMEDIATE],
77[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
78SAVE_subdirs="$subdirs"
79subdirs="$1"
80#
81# Build any intermediate directories
82for dir in $1 ; do
83    saveIFS="$IFS"
84    IFS="/"
85    curdir=""
86    for subdir in $dir ; do
87        curdir="${curdir}$subdir"
88        if test ! -d "$curdir" ; then mkdir "$curdir" ; fi
89        curdir="${curdir}/"
90    done
91    IFS="$saveIFS"
92done
93PAC_CACHE_CLEAN
94dnl autoconf 2.52 uses _ before *some* internal commands (!)
95dnl output_subdirs *ALSO* resets INSTALL.  It *also* requires that
96dnl ac_given_INSTALL be set to INSTALL
97SAVE_INSTALL="$INSTALL"
98ac_given_INSTALL="$INSTALL"
99ifdef([AC_OUTPUT_SUBDIRS],[AC_OUTPUT_SUBDIRS($1)],[_AC_OUTPUT_SUBDIRS($1)])
100subdirs="$SAVE_subdirs"
101INSTALL="$SAVE_INSTALL"
102])
103
104dnl
105dnl Find something to use for mkdir -p.  Eventually, this will
106dnl have a script for backup
107AC_DEFUN([PAC_PROG_MKDIR_P],[
108AC_CACHE_CHECK([whether mkdir -p works],
109pac_cv_mkdir_p,[
110pac_cv_mkdir_p=no
111rm -rf .tmp
112if mkdir -p .tmp/.foo 1>/dev/null 2>&1 ; then
113    if test -d .tmp/.foo ; then
114        pac_cv_mkdir_p=yes
115    fi
116fi
117rm -rf .tmp
118])
119if test "$pac_cv_mkdir_p" = "yes" ; then
120   MKDIR_P="mkdir -p"
121   export MKDIR_P
122else
123   AC_MSG_WARN([mkdir -p does not work; the install step may fail])
124fi
125AC_SUBST(MKDIR_P)
126])
127dnl
128dnl Test for a clean VPATH directory.  Provide this command with the names
129dnl of all of the generated files that might cause problems
130dnl (Makefiles won't cause problems because there's no VPATH usage for them)
131dnl
132dnl Synopsis
133dnl PAC_VPATH_CHECK([file-names],[directory-names])
134dnl  file-names should be files other than config.status and any header (e.g.,
135dnl fooconf.h) file that should be removed.  It is optional
136AC_DEFUN([PAC_VPATH_CHECK],[
137rm -f conftest*
138date >conftest$$
139# If creating a file in the current directory does not show up in the srcdir
140# then we're doing a VPATH build (or something is very wrong)
141if test ! -s $srcdir/conftest$$ ; then
142    pac_dirtyfiles=""
143    pac_dirtydirs=""
144    pac_header=""
145    ifdef([AC_LIST_HEADER],[pac_header=AC_LIST_HEADER])
146    for file in config.status $pac_header $1 ; do
147        if test -f $srcdir/$file ; then
148            pac_dirtyfiles="$pac_dirtyfiles $file"
149        fi
150    done
151    ifelse($2,,,[
152        for dir in $2 ; do
153            if test -d $srcdir/$dir ; then
154                pac_dirtydirs="$pac_dirtydirs $dir"
155            fi
156        done
157    ])
158
159    if test -n "$pac_dirtyfiles" -o -n "$pac_dirtydirs" ; then
160        # Create a nice message about what to remove
161        rmmsg=""
162        if test -n "$pac_dirtyfiles" ; then
163            rmmsg="files $pac_dirtyfiles"
164        fi
165        if test -n "$pac_dirtydirs" ; then
166            if test -n "$rmmsg" ; then
167                rmmsg="$rmmsg and directories $pac_dirtydirs"
168            else
169                rmmsg="directories $pac_dirtydirs"
170            fi
171        fi
172        if test -f $srcdir/Makefile ; then
173            AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
174    configured.  Run "make distclean" in $srcdir first and make sure that the
175    $rmmsg have been removed.])
176        else
177            AC_MSG_ERROR([You cannot do a VPATH build if the source directory has been
178    configured.  Remove the $rmmsg in $srcdir.])
179        fi
180    fi
181fi
182rm -f conftest*
183])
Note: See TracBrowser for help on using the browser.