2011-04-08 20:58:15 +08:00
|
|
|
# -*- Autoconf -*-
|
|
|
|
# Process this file with autoconf to produce a configure script.
|
|
|
|
|
2011-05-24 10:51:25 +08:00
|
|
|
AC_PREREQ([2.61])
|
2018-08-21 09:41:59 +08:00
|
|
|
AC_INIT([libsearpc], [3.1.0], [info@seafile.com])
|
2011-04-15 14:33:25 +08:00
|
|
|
AC_CONFIG_SRCDIR([lib/searpc-server.c])
|
2011-04-08 20:58:15 +08:00
|
|
|
AC_CONFIG_HEADERS([config.h])
|
|
|
|
AC_CONFIG_MACRO_DIR([m4])
|
|
|
|
|
|
|
|
|
2011-05-18 11:06:01 +08:00
|
|
|
AM_INIT_AUTOMAKE([1.9 foreign])
|
2016-07-04 12:07:02 +08:00
|
|
|
#AC_MINGW32
|
|
|
|
AC_CANONICAL_BUILD
|
2011-04-08 20:58:15 +08:00
|
|
|
# Checks for programs.
|
|
|
|
AC_PROG_CC
|
2014-08-12 14:52:48 +03:00
|
|
|
LT_INIT
|
2011-04-09 17:33:28 +08:00
|
|
|
|
2011-04-08 20:58:15 +08:00
|
|
|
# Checks for header files.
|
2013-01-03 16:56:30 +08:00
|
|
|
#AC_CHECK_HEADERS([arpa/inet.h netinet/in.h stdint.h stdlib.h string.h sys/socket.h sys/time.h unistd.h])
|
2011-04-08 20:58:15 +08:00
|
|
|
|
|
|
|
# Checks for typedefs, structures, and compiler characteristics.
|
2013-01-03 16:56:30 +08:00
|
|
|
#AC_C_INLINE
|
|
|
|
#AC_TYPE_SIZE_T
|
|
|
|
#AC_TYPE_SSIZE_T
|
|
|
|
#AC_TYPE_UINT16_T
|
2011-04-08 20:58:15 +08:00
|
|
|
|
|
|
|
# Checks for library functions.
|
2013-01-03 16:56:30 +08:00
|
|
|
#AC_CHECK_FUNCS([memset socket strerror strndup])
|
2011-04-08 20:58:15 +08:00
|
|
|
|
2011-04-09 17:33:28 +08:00
|
|
|
# Options about demos and pysearpc
|
|
|
|
|
|
|
|
# option: compile-demo
|
2011-04-09 18:40:55 +08:00
|
|
|
# default: yes
|
2011-04-09 17:33:28 +08:00
|
|
|
AC_ARG_ENABLE([compile-demo],
|
2011-04-09 18:40:55 +08:00
|
|
|
[AS_HELP_STRING([--enable-compile-demo],
|
2011-04-09 17:33:28 +08:00
|
|
|
[compile demo programs @<:@default: yes@:>@])],
|
|
|
|
[compile_demo=${enableval}], [compile_demo=yes])
|
|
|
|
|
|
|
|
AM_CONDITIONAL([COMPILE_DEMO], [test x${compile_demo} = xyes])
|
|
|
|
|
2012-03-19 21:54:13 +08:00
|
|
|
AC_ARG_ENABLE(server-pkg,
|
|
|
|
AC_HELP_STRING([--enable-server-pkg], [enable static compile]),
|
|
|
|
[server_pkg=$enableval],[server_pkg="no"])
|
|
|
|
|
2011-09-18 22:36:29 +08:00
|
|
|
dnl - check if the macro WIN32 is defined on this compiler.
|
|
|
|
AC_MSG_CHECKING(for WIN32)
|
|
|
|
|
2016-07-04 12:07:02 +08:00
|
|
|
if test "$build_os" = "mingw32" -o "$build_os" = "mingw64"; then
|
2011-09-18 22:36:29 +08:00
|
|
|
bwin32=true
|
2011-12-01 18:42:17 +08:00
|
|
|
LIB_WS32=-lws2_32
|
|
|
|
AC_SUBST(LIB_WS32)
|
2016-07-04 12:07:02 +08:00
|
|
|
AC_MSG_RESULT(compile in mingw)
|
2011-09-18 22:36:29 +08:00
|
|
|
fi
|
|
|
|
|
2011-12-01 18:42:17 +08:00
|
|
|
AM_CONDITIONAL([WIN32], [test "$MINGW32" = "yes"])
|
|
|
|
AC_SUBST(WIN32)
|
|
|
|
|
2012-04-29 21:55:49 +08:00
|
|
|
AC_MSG_CHECKING(for Mac)
|
|
|
|
|
2014-07-23 15:19:58 +08:00
|
|
|
if test "$(uname -s)" = "Darwin"; then
|
2012-04-29 21:55:49 +08:00
|
|
|
bmac=yes
|
2011-09-18 22:36:29 +08:00
|
|
|
fi
|
2012-04-29 21:55:49 +08:00
|
|
|
|
|
|
|
if test x$bmac = "xyes"; then
|
|
|
|
server_pkg=no
|
|
|
|
AC_MSG_RESULT(compile in mac)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([MACOS], [test "$bmac" = "yes"])
|
|
|
|
AC_SUBST(MACOS)
|
2011-09-18 22:36:29 +08:00
|
|
|
|
2019-02-27 15:27:52 -07:00
|
|
|
AC_MSG_CHECKING(for FreeBSD)
|
|
|
|
|
|
|
|
if test "$(uname -s)" = "FreeBSD"; then
|
|
|
|
bfbsd=yes
|
|
|
|
fi
|
|
|
|
|
|
|
|
if test x$bfbsd = "xyes"; then
|
|
|
|
server_pkg=no
|
|
|
|
AC_MSG_RESULT(compile in FreeBSD)
|
|
|
|
fi
|
|
|
|
|
|
|
|
AM_CONDITIONAL([FBSD], [test "$bfbsd" = "yes"])
|
|
|
|
AC_SUBST(FBSD)
|
|
|
|
|
2011-04-09 17:33:28 +08:00
|
|
|
# Checks for libraries.
|
2011-04-08 20:58:15 +08:00
|
|
|
|
2013-08-09 12:56:37 +08:00
|
|
|
GLIB_REQUIRED=2.26.0
|
2011-04-08 20:58:15 +08:00
|
|
|
|
2011-04-09 17:33:28 +08:00
|
|
|
# check and subst gobject
|
2012-05-08 11:59:31 +08:00
|
|
|
PKG_CHECK_MODULES(GLIB, [gobject-2.0 >= $GLIB_REQUIRED])
|
|
|
|
AC_SUBST(GLIB_CFLAGS)
|
|
|
|
AC_SUBST(GLIB_LIBS)
|
2011-04-08 20:58:15 +08:00
|
|
|
|
2013-08-09 12:56:37 +08:00
|
|
|
JANSSON_REQUIRED=2.2.1
|
2013-08-08 16:24:20 +08:00
|
|
|
|
|
|
|
PKG_CHECK_MODULES(JANSSON, [jansson >= $JANSSON_REQUIRED])
|
|
|
|
AC_SUBST(JANSSON_CFLAGS)
|
|
|
|
AC_SUBST(JANSSON_LIBS)
|
2012-07-08 13:57:43 +08:00
|
|
|
|
2020-06-17 16:56:04 +08:00
|
|
|
if test "$bwin32" = "true" -o "$bmac" = "yes"; then
|
|
|
|
AM_PATH_PYTHON([2.7])
|
|
|
|
else
|
|
|
|
AM_PATH_PYTHON([3.5])
|
|
|
|
fi
|
|
|
|
|
2012-07-08 13:57:43 +08:00
|
|
|
if test "$bwin32" = true; then
|
|
|
|
if test x$PYTHON_DIR != x; then
|
|
|
|
# set pyexecdir to somewhere like /c/Python26/Lib/site-packages
|
|
|
|
pyexecdir=${PYTHON_DIR}/Lib/site-packages
|
|
|
|
pythondir=${pyexecdir}
|
|
|
|
pkgpyexecdir=${pyexecdir}/${PACKAGE}
|
|
|
|
pkgpythondir=${pythondir}/${PACKAGE}
|
2011-12-11 23:50:48 +08:00
|
|
|
fi
|
2011-04-09 17:33:28 +08:00
|
|
|
fi
|
|
|
|
|
2011-04-08 20:58:15 +08:00
|
|
|
AC_CONFIG_FILES([Makefile
|
2011-04-15 14:33:25 +08:00
|
|
|
lib/Makefile
|
|
|
|
demo/Makefile
|
2011-04-08 20:58:15 +08:00
|
|
|
pysearpc/Makefile
|
2012-05-08 11:59:31 +08:00
|
|
|
libsearpc.pc
|
2011-04-08 20:58:15 +08:00
|
|
|
tests/Makefile])
|
|
|
|
AC_OUTPUT
|
2011-04-09 17:33:28 +08:00
|
|
|
|
|
|
|
|