summaryrefslogtreecommitdiffabout
path: root/configure.ac
blob: e92c238ed80112c5d4727b31a136f495e4e784c9 (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
136
137
138
139
# This file is part of Wydawca
# Copyright (C) 2007 Sergey Poznyakoff
#
# Wydawca is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3, or (at your option)
# any later version.
#
# Wydawca is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with wydawca.  If not, see <http://www.gnu.org/licenses/>.

AC_PREREQ(2.59)
AC_INIT([wydawca], 1.0, [gray@gnu.org.ua])
AC_CONFIG_SRCDIR([src/wydawca.c])
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADER([config.h])
AM_INIT_AUTOMAKE
	
# Checks for programs.
AC_PROG_CC
gl_EARLY	
AC_PROG_LEX
AC_PROG_YACC
AC_PROG_RANLIB

# Checks for libraries.

# Checks for header files.
AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS([stdlib.h string.h sys/file.h unistd.h sys/sendfile.h])

# Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIGNAL	
AC_TYPE_UID_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_STDBOOL

# Checks for library functions.
gl_INIT  
AC_FUNC_FORK
AC_FUNC_MALLOC
AC_FUNC_MEMCMP
AC_FUNC_STAT
AC_FUNC_VPRINTF
AC_CHECK_FUNCS([memset strchr strdup strerror strrchr setegid setregid setresgid seteuid setreuid vsyslog sysconf getdtablesize])

# ***********************************
# Sendfile
# ***********************************
AC_ARG_ENABLE([sendfile],
	      [AC_HELP_STRING([--enable-sendfile],
	                      [Attempt to use sendfile(2) when possible])],
              [case $enableval in
	       yes) USE_SENDFILE=1;;
	       no)  USE_SENDFILE=0;;
	       *) AC_MSG_FAILURE([Invalid argument for --enable-sendfile])
	       esac],
	      [USE_SENDFILE=1])

if test "$USE_SENDFILE" = 1; then
  case $host in
  *-linux-*) AC_DEFINE_UNQUOTED([USE_SENDFILE], 1,
                                [Define to 1 to use sendfile(2) on GNU/Linux]);;
  esac
fi
      
# **********************	
# Mailutils
# **********************	
status_mailutils=no

AC_PATH_PROG(MU_CONFIG, mailutils-config, none, $PATH)
if test "$MU_CONFIG" != "none"; then
  status_mailutils=yes
  AC_SUBST(MAILUTILS_VERSION, `$MU_CONFIG --info version|sed s/.*=//`)
  AC_SUBST(MAILUTILS_INCLUDES, `$MU_CONFIG --compile`)
  AC_SUBST(MAILUTILS_LIBS, `$MU_CONFIG --link mailer`)
else
  AC_MSG_FAILURE([The requested library libmailutils is not found])
fi
	
# **********************	
# MySQL	
# **********************	
status_mysql=no

AC_SUBST(SQLLIB)		
AH_TEMPLATE(HAVE_MYSQL,[Define if you have libmysql])

MU_CHECK_LIB(mysqlclient, 
             mysql_real_connect, 
	     [-lm],
             [ AC_DEFINE(HAVE_MYSQL)
	       SQLLIB="$mu_cv_lib_mysqlclient"
               status_mysql=yes ],
	     [ AC_MSG_FAILURE([The requested library libmysqlclient is not found or is unusable])],
             [/usr/lib/mysql /usr/local/lib/mysql])

# **********************	
# GPGME
# **********************	

status_gpgme=no
AC_SUBST(GPGMELIB)
AH_TEMPLATE(HAVE_GPGME,[Define if you have gpgme])

AC_CHECK_HEADERS(gpgme.h)
MU_CHECK_LIB([gpgme],[main],[],
             [GPGMELIB="$mu_cv_lib_gpgme"
              AC_DEFINE(HAVE_GPGME)
	      status_gpgme=yes ],
	     [ AC_MSG_FAILURE([The requested library libgpgme is not found or is unusable])],
	     [/usr/pkg/lib /opt/lib /sw/lib])

AH_BOTTOM([
#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 7)
#  define __attribute__(x)
#endif

#ifndef GSC_PRINTFLIKE
# define GSC_PRINTFLIKE(fmt,narg) __attribute__ ((__format__ (__printf__, fmt, narg)))
#endif
])
	
AC_CONFIG_FILES([Makefile
                 doc/Makefile
		 gnu/Makefile
	         lib/Makefile
		 src/Makefile])
		 
AC_OUTPUT

Return to:

Send suggestions and report system problems to the System administrator.