configure.ac 2.03 KB
Newer Older
1 2 3 4
# -*- shell-script -*-
# Copyright (c) 2007 Cisco Systems, Inc.  All rights reserved.

# Startup
5
AC_INIT([openfoam-selector],
6
        [m4_normalize(esyscmd([cat VERSION]))],
7
        [], [openfoam-selector])
8 9 10 11 12 13 14 15 16 17 18 19 20 21
AM_INIT_AUTOMAKE([foreign dist-bzip2])

# Setup some directory names and filenames that are common across all
# the scripts
prefix_save=$prefix
if test "NONE" = "$prefix"; then
    prefix=/usr/local
fi

AC_MSG_CHECKING([shell startup file directory])
AC_ARG_WITH([shell-startup-dir],
    AC_HELP_STRING([--with-shell-startup-dir=<dir>],
                   [Directory where shell startup files are installed (default: $pkgdatadir)]))
if test "$with_shell_startup_dir" == ""; then
22
    OPENFOAM_SELECTOR_SHELL_STARTUP_DIR='$(pkgdatadir)'
23
else
24
    OPENFOAM_SELECTOR_SHELL_STARTUP_DIR=$with_shell_startup_dir
25
fi
26 27
AC_SUBST(OPENFOAM_SELECTOR_SHELL_STARTUP_DIR)
AC_MSG_RESULT([$OPENFOAM_SELECTOR_SHELL_STARTUP_DIR])
28 29 30 31

AC_MSG_CHECKING([repository directory])
localstatedir_save="$localstatedir"
eval localstatedir="$localstatedir"
32 33
eval OPENFOAM_SELECTOR_DATADIR="$localstatedir/openfoam-selector/data"
AC_SUBST(OPENFOAM_SELECTOR_DATADIR)
34
localstatedir="$localstatedir_save"
35
AC_MSG_RESULT([$OPENFOAM_SELECTOR_DATADIR])
36 37 38 39

AC_MSG_CHECKING([system configuration directory])
sysconfdir_save="$sysconfdir"
eval sysconfdir="$sysconfdir"
40 41
eval OPENFOAM_SELECTOR_SYSCONFDIR="$sysconfdir/sysconfig"
AC_SUBST(OPENFOAM_SELECTOR_SYSCONFDIR)
42
sysconfdir="$sysconfdir_save"
43
AC_MSG_RESULT([$OPENFOAM_SELECTOR_SYSCONFDIR])
44

45 46 47 48
OPENFOAM_SELECTOR_SYSCONFIG_FILE="openfoam-selector"
OPENFOAM_SELECTOR_HOME_FILE=".openfoam-selector"
AC_SUBST(OPENFOAM_SELECTOR_SYSCONFIG_FILE)
AC_SUBST(OPENFOAM_SELECTOR_HOME_FILE)
49 50 51 52 53 54 55 56 57 58 59

prefix=$prefix_save

# Information for the man page
MAN_DATE=`date "+%B %d, %Y"`
AC_SUBST(MAN_DATE)

# Party on
AC_CONFIG_FILES([
    Makefile

60 61 62
    openfoam-selector
    openfoam-selector.sh
    openfoam-selector.csh
63 64
])
AC_CONFIG_COMMANDS([tasty], [
65
for file in openfoam-selector openfoam-selector.sh;
66 67 68 69 70 71 72
do
  if test -f "$file"; then
     chmod -w $file
     chmod +x $file
  fi
done])
AC_OUTPUT