File: aclocal_libs.m4

package info (click to toggle)
mpich2 1.2.1.1-5
  • links: PTS, VCS
  • area: main
  • in suites: squeeze
  • size: 73,904 kB
  • ctags: 65,947
  • sloc: ansic: 343,583; makefile: 55,174; java: 34,959; sh: 27,558; perl: 17,355; cpp: 10,472; python: 9,649; f90: 5,753; fortran: 5,128; cs: 4,019; csh: 152; xml: 91; php: 8
file content (53 lines) | stat: -rw-r--r-- 2,063 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53

dnl PAC_SET_HEADER_LIB_PATH(with_option)
dnl This macro looks for the --with-xxx=, --with-xxx-include and --with-xxx-lib=
dnl options and sets the library and include paths.
AC_DEFUN([PAC_SET_HEADER_LIB_PATH],[
    AC_ARG_WITH($1, 
    		AC_HELP_STRING([--with-$1=path],
			       [specify path where $1 include directory and lib directory can be found]),
        if test "${with_$1}" != "yes" -a "${with_$1}" != "no" ; then
            LDFLAGS="$LDFLAGS -L${with_$1}/lib64 -L${with_$1}/lib"
    	    CPPFLAGS="$CPPFLAGS -I${with_$1}/include"
        fi,
    )
    AC_ARG_WITH($1-include, 
    		AC_HELP_STRING([--with-$1-include=path],
			       [specify path where $1 include directory can be found]),
        if test "${with_$1_include}" != "yes" -a "${with_$1_include}" != "no" ; then
    	    CPPFLAGS="$CPPFLAGS -I${with_$1_include}/include"
        fi,
    )
    AC_ARG_WITH($1-lib, 
    		AC_HELP_STRING([--with-$1-lib=path],
			       [specify path where $1 lib directory can be found]),
        if test "${with_$1_lib}" != "yes" -a "${with_$1_lib}" != "no" ; then
            LDFLAGS="$LDFLAGS -L${with_$1_lib}/lib64 -L${with_$1_lib}/lib"
        fi,
    )
])


dnl PAC_CHECK_HEADER_LIB(with_option, header.h, libname, function, action-if-yes, action-if-no)
dnl This macro checks for a header and lib.  It is assumed that the
dnl user can specify a path to the includes and libs using --with-xxx=.
dnl The xxx is specified in the "with_option" parameter.
AC_DEFUN([PAC_CHECK_HEADER_LIB],[
    failure=no
    AC_CHECK_HEADER([$2],,failure=yes)
    AC_CHECK_LIB($3,$4,,failure=yes)
    if test "$failure" = "no" ; then
       $5
    else
       $6
    fi
])

dnl PAC_CHECK_HEADER_LIB_FATAL(with_option, header.h, libname, function)
dnl Similar to PAC_CHECK_HEADER_LIB, but errors out on failure
AC_DEFUN([PAC_CHECK_HEADER_LIB_FATAL],[
	PAC_CHECK_HEADER_LIB($1,$2,$3,$4,success=yes,success=no)
	if test "$success" = "no" ; then
	   AC_MSG_ERROR(['$2 or lib$3 library not found. Did you specify --with-$1= or --with-$1-include= or --with-$1-lib=?'])
	fi
])