summaryrefslogtreecommitdiffabout
path: root/configure.ac
blob: 7e18fda59247003cd635d6aab98d15968771eded (plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
dnl This file is part of Gamma
dnl Copyright (C) 2002,2004 Sergey Poznyakoff 
dnl
dnl This program is free software; you can redistribute it and/or modify
dnl it under the terms of the GNU General Public License as published by
dnl the Free Software Foundation; either version 2 of the License, or
dnl (at your option) any later version.
dnl
dnl This program is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
dnl GNU General Public License for more details.
dnl
dnl You should have received a copy of the GNU General Public License
dnl along with this program; if not, write to the Free Software Foundation,
dnl Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */

dnl Process this file with autoconf to produce a configure script.

AC_PREREQ(2.59)

AC_INIT(gamma, 0.2, gray@mirddin.farlep.net)
AC_CONFIG_SRCDIR(src/guile-sql.h)
AC_CONFIG_AUX_DIR([scripts])
AC_CANONICAL_SYSTEM
AM_INIT_AUTOMAKE
AC_CONFIG_HEADERS([config.h])

dnl Checks for programs.
AC_PROG_AWK
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_LN_S
AM_PROG_LIBTOOL
AM_C_PROTOTYPES

AC_SUBST(INCLUDEPATH)
AC_MSG_CHECKING(for additional includes)
AC_ARG_WITH(include-path,
	[  --with-include-path=PATH      specify additional include paths.
                                         PATH is a ':' separated list of additional
                                         include paths.  ],
	[ for path in `echo $withval | sed 's/:/ /g'`
          do
            INCLUDEPATH="$INCLUDEPATH -I$path"
          done])
AC_MSG_RESULT($INCLUDEPATH)

AC_MSG_CHECKING(for additional libraries)
AC_ARG_WITH(lib-path,    
	[  --with-lib-path=PATH          specify additional library paths.],
	[ for path in `echo $withval | sed 's/:/ /g'`
          do
            LIBS="$LIBS -L$path"
          done])
AC_MSG_RESULT($LIBS)

dnl Checks for libraries.
MU_CHECK_GUILE

dnl Checks for gettext
AC_CHECK_HEADERS(locale.h)
AM_GNU_GETTEXT(external, need-ngettext)
AM_GNU_GETTEXT_VERSION(0.13)

dnl Checks for library functions.
AC_HEADER_STDC
AC_CHECK_FUNCS(strdup)

if test $mu_cv_lib_guile = yes; then
  MYSQL=yes
  PGSQL=yes

  AC_ARG_WITH(mysql,
          [  --without-mysql        Configure to work without MySQL],
	  [MYSQL=$withval])
  AC_ARG_WITH(postgres,
          [  --without-postgres     Configure to work without Postgres],
	  [PGSQL=$withval])

  SQLLIBS=""
  # Check individual libraries
  RA_CHECK_LIB(mysqlclient, mysql_real_connect, "-lm",
              [ AC_DEFINE(USE_SQL_MYSQL,1,
                          [Define this if you are going to use MySQL])
                AC_DEFINE(HAVE_LIBMYSQL,1,
                          [Define this if you have mysqlclient library])
                SQLLIBS="$SQLLIBS $ra_cv_lib_mysqlclient" ],
              [ MYSQL=no ],
              [/usr/local/lib/mysql /usr/lib/mysql])

  RA_CHECK_LIB(pq, PQconnectStart, [],
  	      [ AC_DEFINE(USE_SQL_PGSQL,1,
                          [Define this if you are going to use PostgreSQL])
                AC_DEFINE(HAVE_LIBPQ,1,
                          [Define this if you have libp]) 
                SQLLIBS="$SQLLIBS $ra_cv_lib_pq" ],
              [ PGSQL=no ],
              [/usr/local/pgsql/lib /usr/pgsql/lib])

  if test "x$SQLLIBS" != "x"; then
    LIBS="$LIBS $SQLLIBS"
    BUILD_LIBS="$BUILD_LIBS \$(LIB_SQL)"
    BUILD_DATA="$BUILD_DATA \$(SCM_SQL)"
    BUILD_X="$BUILD_X \$(X_SQL)"
    INSTALL_HOOKS="$INSTALL_HOOKS install-sql-hook"

    if test $MYSQL = yes ; then
      AC_LIBOBJ(mysql)
    fi
    if test $PGSQL = yes ; then
      AC_LIBOBJ(pgsql)
    fi
  fi
fi

if test x"$USE_NLS" != x; then
  BUILD_LIBS="$BUILD_LIBS \$(LIB_GETTEXT)"
  BUILD_DATA="$BUILD_DATA \$(SCM_GETTEXT)"
  BUILD_X="$BUILD_X \$(X_GETTEXT)"
  INSTALL_HOOKS="$INSTALL_HOOKS install-gettext-hook"
fi

if test x"$BUILD_LIBS" = x; then
  AC_MSG_ERROR([Nothing to build!])
fi

AC_SUBST(BUILD_LIBS)
AC_SUBST(BUILD_DATA)
AC_SUBST(BUILD_X)
AC_SUBST(INSTALL_HOOKS)

AC_CONFIG_FILES(Makefile src/Makefile scripts/Makefile examples/Makefile po/Makefile.in)

AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.