root/trunk/midgard/data/configure.ac

Revision 11960, 5.3 kB (checked in by piotras, 1 year ago)

Create datagard script

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 dnl $Id$
2 dnl
3 dnl Process this file with autoconf to produce a configure script.
4 dnl
5 AC_INIT([midgard-data],[1.9.0alpha1])
6 AC_CONFIG_HEADERS([config.h])
7
8 dnl Automake is needed for the build system.
9 dnl
10 AM_INIT_AUTOMAKE([1.6 dist-bzip2])
11 AM_MAINTAINER_MODE
12
13 AC_PROG_CC(gcc cc)
14 AC_LANG(C)
15
16 dnl Check for midgard-config
17 AC_ARG_WITH([midgard-config],
18             AC_HELP_STRING([--with-midgard-config=PATH],
19                            [Location of the midgard-config program]),
20             [MIDGARD_CONFIG="$withval"],
21             [AC_PATH_PROG([MIDGARD_CONFIG],["midgard-config"])])
22 test -x "$MIDGARD_CONFIG" || AC_MSG_ERROR([midgard-config not found, use --with-midgard-config])
23 MIDGARD_CFLAGS=`"$MIDGARD_CONFIG" --cppflags`
24 MIDGARD_LIBS=`"$MIDGARD_CONFIG" --libs`
25 MIDGARD_PREFIX=`"$MIDGARD_CONFIG" --prefix`
26 AC_SUBST([MIDGARD_CFLAGS])
27 AC_SUBST([MIDGARD_LIBS])
28 AC_SUBST([MIDGARD_PREFIX])
29
30 if test "$MIDGARD_PREFIX" = "/usr"; then
31   MGD_USR_PATH="/usr"
32   MGD_ETC_PATH="/etc"
33   MGD_VAR_PATH="/var"
34 else
35   MGD_USR_PATH="$MIDGARD_PREFIX"
36   MGD_ETC_PATH="$MIDGARD_PREFIX/etc"
37   if test "$MIDGARD_PREFIX" = "/usr/local"; then
38     MGD_VAR_PATH="/var/local"
39   else
40     MGD_VAR_PATH="$MIDGARD_PREFIX/var"
41   fi
42 fi
43 AC_SUBST([MGD_USR_PATH])
44 AC_SUBST([MGD_VAR_PATH])
45 AC_SUBST([MGD_ETC_PATH])
46
47 MGD_BLOB_DIR="$MGD_VAR_PATH/lib/midgard/blobs"
48 MGD_SHARE_PATH="$MGD_USR_PATH/share/midgard"
49 MGD_CONFIG_PATH="$MGD_ETC_PATH/midgard"
50 AC_SUBST([MGD_BLOB_DIR])
51 AC_SUBST([MGD_SHARE_PATH])
52 AC_SUBST([MGD_CONFIG_PATH])
53
54 dnl Check php binary
55 dnl Check for midgard-config
56 AC_ARG_WITH([php],
57         AC_HELP_STRING([--with-php=PATH],
58         [Location of the php binary]),
59         [PHP_BINARY="$withval"],
60         [AC_PATH_PROG([PHP_BINARY],["php"])])
61 test -x "$PHP_BINARY" || AC_MSG_ERROR([php binary not found, use --with-php])
62 AC_SUBST([PHP_BINARY])
63
64 dnl Check for mysql binaries
65 AC_ARG_WITH([mysql-path],
66             AC_HELP_STRING([--with-mysql-path=PATH],
67                            [Path containing the MySQL binaries]),
68             [MYSQL_PATH=$withval],
69             [MYSQL_PATH=$PATH])
70 AC_ARG_WITH([mysql],
71             AC_HELP_STRING([--with-mysql=PATH],
72                            [Location of the mysql program]),
73             [MYSQL=$withval],
74             [AC_PATH_PROG([MYSQL],[mysql],[mysql],[$MYSQL_PATH])])
75 test -x "$MYSQL" || AC_MSG_ERROR([mysql not found, use --with-mysql])
76 AC_SUBST([MYSQL])
77 AC_ARG_WITH([mysqladmin],
78             AC_HELP_STRING([--with-mysqladmin=PATH],
79                            [Location of the mysqladmin program]),
80             [MYSQLADMIN=$withval],
81             [AC_PATH_PROG([MYSQLADMIN],[mysqladmin],[mysqladmin],[$MYSQL_PATH])])
82 test -x "$MYSQLADMIN" || AC_MSG_ERROR([mysqladmin not found, use --with-mysqladmin])
83 AC_SUBST([MYSQLADMIN])
84 AC_ARG_WITH([mysqldump],
85             AC_HELP_STRING([--with-mysqldump=PATH],
86                            [Location of the mysqldump program]),
87             [MYSQLDUMP=$withval],
88             [AC_PATH_PROG([MYSQLDUMP],[mysqldump],[mysqldump],[$MYSQL_PATH])])
89 test -x "$MYSQLDUMP" || AC_MSG_ERROR([mysqldump not found, use --with-mysqldump])
90 AC_SUBST([MYSQLDUMP])
91
92 dnl Check for apxs binary
93 AC_ARG_WITH([apxs],
94             AC_HELP_STRING([--with-apxs=PATH],
95                            [Location of the apxs program]),
96             [APXS=$withval],
97             [AC_PATH_PROG([APXS],[apxs])])
98 test -x "$APXS" || AC_MSG_ERROR([apxs not found, use --with-apxs])
99 AC_SUBST([APXS])
100
101 dnl Check for Apache settings
102
103 AC_MSG_CHECKING([for the Apache executable])
104 APACHE=`$APXS -q SBINDIR`/`$APXS -q TARGET`
105 AC_MSG_RESULT($APACHE)
106 AC_SUBST(APACHE)
107
108 AC_MSG_CHECKING([for the Apache module directory])
109 APACHE_LIBEXEC_PATH=`$APXS -q LIBEXECDIR`
110 AC_MSG_RESULT($APACHE_LIBEXEC_PATH)
111 AC_SUBST(APACHE_LIBEXEC_PATH)
112
113 AC_MSG_CHECKING([for the Apache configuration directory])
114 APACHE_CONF_PATH=`$APXS -q SYSCONFDIR`
115 AC_MSG_RESULT($APACHE_CONF_PATH)
116 AC_SUBST(APACHE_CONF_PATH)
117
118 AC_MSG_CHECKING([for the Apache configuration file])
119 APACHE_CONF=`$APACHE  -V | grep SERVER_CONFIG_FILE | sed 's/^.*FILE=//1' | sed 's/"//g'`
120 APACHE_CONF=$APACHE_CONF_PATH/`basename $APACHE_CONF`
121 AC_MSG_RESULT($APACHE_CONF)
122 AC_SUBST(APACHE_CONF)
123
124 dnl Check for Apache user and group
125
126 AC_MSG_CHECKING(for Apache user)
127 AC_ARG_WITH([apache-user],
128             AC_HELP_STRING([--with-apache-user=user],
129                            [The username of the Apache process]),
130             [APACHE_USER=$withval],
131             [APACHE_USER=`grep '^User ' $APACHE_CONF | sed -e 's/^User //'`])
132 id $APACHE_USER > /dev/null 2>&1 || \
133   AC_MSG_ERROR([Apache user not found, use --with-apache-user])
134 AC_MSG_RESULT($APACHE_USER)
135 AC_SUBST(APACHE_USER)
136
137 AC_MSG_CHECKING(for Apache group)
138 AC_ARG_WITH([apache-group],
139             AC_HELP_STRING([--with-apache-group=group],
140                            [The group of the Apache process]),
141             [APACHE_GROUP=$withval],
142             [APACHE_GROUP=$APACHE_USER])
143 dnl TODO verify that the APACHE_GROUP exists
144 AC_MSG_RESULT($APACHE_GROUP)
145 AC_SUBST(APACHE_GROUP)
146                    
147 dnl find 'install' command
148 AC_PROG_INSTALL
149
150 dnl Checks for libraries.
151
152 dnl Checks for header files.
153 AC_HEADER_STDC
154
155 dnl Checks for typedefs, structures, and compiler characteristics.
156 AC_C_CONST
157
158 dnl Follow midgard core prefix
159 prefix="$MIDGARD_PREFIX"
160
161 SCHEMADIR_TEMP="$datadir/$PACKAGE"
162 eval "SCHEMADIR=$SCHEMADIR_TEMP"
163 AC_SUBST(SCHEMADIR)
164 AC_SUBST(REPLIGARD_OWNER)
165
166 AC_CONFIG_FILES([Makefile midgard_setup_globals.php datagard])
167 AC_OUTPUT
Note: See TracBrowser for help on using the browser.