File: configure.in

package info (click to toggle)
www-sql 0.5.0-5
  • links: PTS
  • area: main
  • in suites: hamm
  • size: 624 kB
  • ctags: 759
  • sloc: ansic: 6,004; lex: 171; sh: 152; yacc: 151; makefile: 111; sql: 41
file content (155 lines) | stat: -rw-r--r-- 4,670 bytes parent folder | download
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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
dnl Process this file with autoconf to produce a configure script.
AC_INIT(www-sql.c)
AC_CONFIG_HEADER(config.h)

# which database will you be using? (current options are mysql or pgsql)
AC_ARG_WITH(database,
[  --with-database=db      use which database (mysql|pgsql)],
[if test "x$with_database" = "xmysql" || test "x$with_database" = "xpgsql";then
  TARGET="$with_database"
else
  echo "Unknown database ... Defaulting to MySQL"
  TARGET="mysql"
fi],
[TARGET="mysql"])
AC_SUBST(TARGET)
echo "Using $TARGET as the database system"

# use the old expression parser? (no floating point, but more compatible)
AC_ARG_WITH(old-expr,
[  --with-old-expr         use the new expression parser],,
[with_old_expr=no])
if test "x$with_old_expr" != xno; then
  EXPR=expr.o
else
  EXPR=newexpr.o
fi
AC_SUBST(EXPR)

dnl MySQL args
AC_ARG_WITH(mysql-headers,
[  --with-mysql-headers    include directory to resolve <mysql/mysql.h>],
[MYSQL_INCDIR="-I$with_mysql_headers"])
AC_ARG_WITH(mysql-libs,
[  --with-mysql-libs       location of libmysqlclient.(a|so|sl)],
[MYSQL_LIBDIR="-L$with_mysql_libs"])

dnl PostgreSQL args
AC_ARG_WITH(pgsql-headers,
[  --with-pgsql-headers    location of libpq-fe.h],
[PGSQL_INCDIR="-I$with_pgsql_headers"])
AC_ARG_WITH(pgsql-libs,
[  --with-pgsql-libs       location of libpq.(a|so|sl)],
[PGSQL_LIBDIR="-L$with_pgsql_libs"])

dnl Allow user to fix the only known www-sql security hole...
AC_ARG_ENABLE(apache-action-check,
[  --enable-apache-action-check   enable plug for security hole (apache only)],
[if test "x$enable_apache_action_check" != xno; then
AC_DEFINE(ONLY_APACHE_ACTION)
fi], [enable_apache_action_check=no])

AC_ARG_WITH(sysvregex,
[  --with-sysvregex        use SYSV regex instead of POSIX],
[if test "x$with_sysvregex" != xno; then
AC_DEFINE(SYSVREGEX)
fi], [with_sysvregex=no])

AC_ARG_ENABLE(recursive,
[  --enable-recursive      enable recursive extensions to www-sql],
[if test "x&enable_recursive" != xno; then
AC_DEFINE(RECURSIVE)
fi], [enable_recursive=no])

dnl Find CGI-BIN directory
AC_MSG_CHECKING([location of CGI directory])
CGI_DIR=/usr/local/etc/httpd/cgi-bin
JH_FIND_DIR(
[/home/httpd/cgi-bin /var/lib/httpd/cgi-bin /usr/local/web/cgi-bin /usr/local/roxen/cgi-bin /usr/local/apache/cgi-bin /usr/local/etc/httpd/cgi-bin],
CGI_DIR)
AC_SUBST(CGI_DIR)
AC_MSG_RESULT([$CGI_DIR])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CPP
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_INSTALL

dnl Checks for libraries.
SOCK_LIB=
dnl Solaris 2.6 needs -lxnet for socket functions (according to Todd Koeckeritz)
AC_CHECK_LIB(xnet, socket, SOCK_LIB="$SOCK_LIB -lxnet")
dnl Solaris 2.4 - 2.5 need -lsocket -lnsl (thanks Todd)
AC_CHECK_LIB(socket, socket, SOCK_LIB="$SOCK_LIB -lsocket -lnsl",, -lnsl)

AC_SUBST(SOCK_LIB)

dnl Find MySQL library
if test -z "$MYSQL_LIBDIR"; then
  JH_FIND_LIB(mysqlclient, mysql_connect,
    ["" "-L/usr/lib/mysql" "-L/usr/local/lib/mysql" "-L/usr/local/mysql/lib"],
    [MYSQL_LIBDIR=$jh_cv_lib_mysqlclient_mysql_connect],
    [echo "MySQL library not found"; MYSQL_LIBDIR=""], [-lm])
fi
AC_SUBST(MYSQL_LIBDIR)

dnl Find PostgreSQL library
if test -z "$PGSQL_LIBDIR"; then
  JH_FIND_LIB(pq, PQsetdb,
    ["" "-L/usr/local/lib/" "-L/usr/local/pgsql/lib" "-L/usr/pgsql/lib"],
    [PGSQL_LIBDIR=$jh_cv_lib_pq_PQsetdb],
    [echo "PostgreSQL library not found"; PGSQL_LIBDIR=""])
fi
AC_SUBST(PGSQL_LIBDIR)

dnl Checks for header files.
AC_HEADER_STDC

dnl Find MySQL headers
if test -z "$MYSQL_INCDIR"; then
  JH_FIND_HEADER([mysql/mysql.h],
    ["" "-I/usr/local/include" "-I/usr/local/mysql/include"],
    [MYSQL_INCDIR=$jh_cv_header_mysql_mysql_h],
    [echo "MySQL headers not found"; MYSQL_INCDIR=""])
fi
AC_SUBST(MYSQL_INCDIR)

dnl Find PostgreSQL headers
if test -z "$PGSQL_INCDIR"; then
  JH_FIND_HEADER([libpq-fe.h],
    ["" "-I/usr/local/include" "-I/usr/include/pgsql" "-I/usr/local/pgsql/include" "-I/usr/pgsql/include"],
    [PGSQL_INCDIR=$jh_cv_header_libpq_fe_h],
    [echo "PostgreSQL headers not found"; PGSQL_INCDIR=""])
fi
AC_SUBST(PGSQL_INCDIR)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE

dnl Checks for library functions.
AC_CHECK_FUNCS(strcspn strstr)
if test "x$with_sysvregex" = xno; then
  AC_CHECK_FUNCS(re_compile_pattern)
fi

EXTRA_OBJS="lib/xmalloc.o lib/xstrdup.o"
if test $ac_cv_func_strcspn = no; then
  EXTRA_OBJS="$EXTRA_OBJS lib/strcspn.o"
fi
if test $ac_cv_func_strstr = no; then
  EXTRA_OBJS="$EXTRA_OBJS lib/strstr.o"
fi
REINC=""
if test $ac_cv_func_re_compile_pattern = no &&
  test "x$with_sysvregex" = xno; then
  EXTRA_OBJS="$EXTRA_OBJS lib/regex.o"
  REINC="-I./lib"
fi
AC_SUBST(REINC)
AC_SUBST(EXTRA_OBJS)

AC_OUTPUT(Makefile)