This repository has been archived by the owner on Jan 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
71 lines (59 loc) · 1.49 KB
/
configure.in
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
AC_PREREQ(2.50)
AC_INIT(pdb_mysql,[],[[email protected]])
AC_CONFIG_SRCDIR([pdb_mysql.c])
AC_CONFIG_HEADER(config.h)
AC_PROG_CC
# Only add -Wall if we're using GCC
if test "x$GCC" = "xyes"; then
CFLAGS="-Wall $CFLAGS"
fi
AC_SUBST(CFLAGS)
SHLIBEXT="so"
AC_SUBST(SHLIBEXT)
AC_PROG_INSTALL
modules=""
AC_SUBST(modules)
AC_SUBST(SOURCEDIR)
AC_SUBST(LIBDIR)
AC_MSG_CHECKING(for Samba source directory)
AC_ARG_WITH(samba-dir,
[ --with-samba-dir Path to Samba sources],
[
SOURCEDIR="$withval"
],
[
if which smbd >/dev/null 2>/dev/null; then
SOURCEDIR="`smbd -b | grep SRCDIR | awk '{ print $2; }'`"
LIBDIR="`smbd -b | grep LIBDIR | awk '{ print $2; }'`"
else
AC_MSG_ERROR([smbd not found, please specify --with-samba-dir])
fi
])
if test -f "$SOURCEDIR/source3/dynconfig.c"; then
SOURCEDIR="$SOURCEDIR"
else if test -f "$SOURCEDIR/dynconfig.c"; then
SOURCEDIR="$SOURCEDIR/.."
else
AC_MSG_ERROR([Unable to find Samba sources in $SOURCEDIR. Please specify correct value to --with-samba-dir=])
fi
fi
if test -z "$LIBDIR"; then
prefix=`grep "^prefix=" $SOURCEDIR/source3/Makefile | cut -d = -f 2`
LIBDIR="$prefix/lib"
fi
AC_MSG_RESULT([$SOURCEDIR])
## pdb_mysql
AM_PATH_MYSQL(
[modules="$modules mysql";
CFLAGS="$CFLAGS $MYSQL_CFLAGS"
],[
AC_MSG_WARN([Can't find MySQL libraries, not building pdb_mysql])
])
## pdb_pgsql
AM_PATH_PGSQL(
[modules="$modules pgsql";
CFLAGS="$CFLAGS $PGSQL_CFLAGS"
],[
AC_MSG_WARN([Can't find PostGreSQL libraries, not building pdb_pgsql])
])
AC_OUTPUT(Makefile)