1
dnl Enables export makefile specific code
3
dnl The following AM_CONDITIONALS are set for makefiles to access:
4
dnl USING_EXPORT_MAKEFILES
5
dnl USING_PERL via TAC_ARG_WITH_PERL
8
dnl The following AC_DEFINES are set:
9
dnl HAVE_EXPORT_MAKEFILES
11
dnl the following variables are set:
12
dnl PERL_EXE for the perl executable via TAC_ARG_WITH_PERL
14
dnl This file was based on tac_arg_enable_feature.m4 by Mike Heroux
15
dnl @author Roger Pawlowski <rppawlo@sandia.gov>
17
AC_DEFUN([TAC_ARG_ENABLE_EXPORT_MAKEFILES],
19
AC_ARG_ENABLE(export-makefiles,
20
AC_HELP_STRING([--enable-export-makefiles],[Creates export makefiles in the install (prefix) directory. This option requires perl to be set in your path or defined with --with-perl=<perl executable>. Note that the export makefiles are always created and used in the build directory, but will not be installable without this option to change the paths. (default is $1)]),
21
ac_cv_use_export_makefiles=$enableval,
22
ac_cv_use_export_makefiles=$1)
24
AC_MSG_CHECKING(whether to build export makefiles)
26
if test "X$ac_cv_use_export_makefiles" != "Xno"; then
29
AC_DEFINE([HAVE_EXPORT_MAKEFILES],,[Define if you want to build export makefiles.])
37
AM_CONDITIONAL(USING_EXPORT_MAKEFILES, test X${ac_cv_use_export_makefiles} = Xyes)
39
# Check for perl to run scripts (Required dependency)
42
if test "X$HAVE_PERL" != "Xyes" &&
43
test "X$ac_cv_use_export_makefiles" != "Xno"; then
45
AC_MSG_ERROR([Failed to find the perl executable. The flag --enable-export-makefiles requires perl to be either in your path or explicitly defined by the flag --with-perl=<executable>. If you do not require the export makefiles to be installed via 'make install', you can disable the export makefiles with --disable-export-makefiles.])
48
# Check for using gnumake to clean up link lines via
49
# gnumake's "shell" command. Optional dependency.
50
AC_DEFUN([TAC_ARG_WITH_GNUMAKE],
53
AC_HELP_STRING([--with-gnumake],[Gnu's make has special functions we can use to eliminate redundant paths in the build and link lines. Enable this if you use gnu-make to build Trilinos. This requires that perl is in your path or that you have specified the perl executable with --with-perl=<perl executable>. Configure will check for the existence of the perl executable and quit with an error if it is not found. (default is no)]),
54
ac_cv_use_gnumake=$withval, ac_cv_use_gnumake=no)
56
AC_MSG_CHECKING(whether gnumake specific code should be enabled)
58
if test "X$ac_cv_use_gnumake" != "Xno"; then
60
AC_DEFINE([HAVE_GNUMAKE],,[Define if you are using gnumake - this will shorten your link lines.])
64
AM_CONDITIONAL(USING_GNUMAKE, test "X$ac_cv_use_gnumake" = "Xyes")
69
if test "X$HAVE_PERL" != "Xyes" &&
70
test "X$ac_cv_use_gnumake" != "Xno"; then
72
AC_MSG_ERROR([The flag --with-gnumake requires perl to be in your path. The perl executable can alternatively be explicitly defined by the flag --with-perl=<executable>.])