1dnl ProFTPD - mod_load
2dnl Copyright (c) 2012-2017 TJ Saunders <tj@castaglia.org>
3dnl
4dnl This program is free software; you can redistribute it and/or modify
5dnl it under the terms of the GNU General Public License as published by
6dnl the Free Software Foundation; either version 2 of the License, or
7dnl (at your option) any later version.
8dnl
9dnl This program is distributed in the hope that it will be useful,
10dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
11dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12dnl GNU General Public License for more details.
13dnl
14dnl You should have received a copy of the GNU General Public License
15dnl along with this program; if not, write to the Free Software
16dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA.
17dnl
18dnl Process this file with autoconf to produce a configure script.
19
20AC_INIT(./mod_load.c)
21
22AC_CANONICAL_SYSTEM
23
24ostype=`echo $build_os | sed 's/\..*$//g' | sed 's/-.*//g' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
25
26AC_PROG_CC
27AC_PROG_CPP
28AC_AIX
29AC_ISC_POSIX
30AC_MINIX
31
32dnl Need to support/handle the --with-includes and --with-libraries options
33AC_ARG_WITH(includes,
34  [AC_HELP_STRING(
35    [--with-includes=LIST],
36    [add additional include paths to proftpd. LIST is a colon-separated list of include paths to add e.g. --with-includes=/some/mysql/include:/my/include])
37  ],
38  [ ac_addl_includes=`echo "$withval" | sed -e 's/:/ /g'` ;
39    for ainclude in $ac_addl_includes; do
40      if test x"$ac_build_addl_includes" = x ; then
41        ac_build_addl_includes="-I$ainclude"
42      else
43        ac_build_addl_includes="-I$ainclude $ac_build_addl_includes"
44      fi
45    done
46    CPPFLAGS="$CPPFLAGS $ac_build_addl_includes"
47  ])
48
49AC_ARG_WITH(libraries,
50  [AC_HELP_STRING(
51    [--with-libraries=LIST],
52    [add additional library paths to proftpd. LIST is a colon-separated list of include paths to add e.g. --with-libraries=/some/mysql/libdir:/my/libs])
53  ],
54  [ ac_addl_libdirs=`echo "$withval" | sed -e 's/:/ /g'` ;
55    for alibdir in $ac_addl_libdirs; do
56      if test x"$ac_build_addl_libdirs" = x ; then
57        ac_build_addl_libdirs="-L$alibdir"
58      else
59        ac_build_addl_libdirs="-L$alibdir $ac_build_addl_libdirs"
60      fi
61    done
62    LDFLAGS="$LDFLAGS $ac_build_addl_libdirs"
63  ])
64
65AC_HEADER_STDC
66AC_CHECK_HEADERS(stdlib.h unistd.h limits.h fcntl.h)
67
68dnl _Must_ come before AC_FUNC_GETLOADAVG
69AC_CHECK_LIB(kstat, kstat_open)
70
71dnl Supposedly in AC_FUNC_GETLOADAVG, but...?
72AC_CHECK_FUNCS(pstat_getdynamic)
73AC_FUNC_GETLOADAVG
74
75INCLUDES="$ac_build_addl_includes"
76LIBDIRS="$ac_build_addl_libdirs"
77
78AC_SUBST(INCLUDES)
79AC_SUBST(LDFLAGS)
80AC_SUBST(LIBDIRS)
81
82MODULE_LIBS=
83if test "$ostype" = "SOLARIS" ; then
84  MODULE_LIBS="-lkstat"
85fi
86AC_SUBST(MODULE_LIBS)
87
88AC_CONFIG_HEADER(mod_load.h)
89AC_OUTPUT(Makefile)
90