| 1 |
dnl ProFTPD - mod_load |
| 2 |
dnl Copyright (c) 2012-2017 TJ Saunders <[email protected]> |
| 3 |
dnl |
| 4 |
dnl This program is free software; you can redistribute it and/or modify |
| 5 |
dnl it under the terms of the GNU General Public License as published by |
| 6 |
dnl the Free Software Foundation; either version 2 of the License, or |
| 7 |
dnl (at your option) any later version. |
| 8 |
dnl |
| 9 |
dnl This program is distributed in the hope that it will be useful, |
| 10 |
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
dnl GNU General Public License for more details. |
| 13 |
dnl |
| 14 |
dnl You should have received a copy of the GNU General Public License |
| 15 |
dnl along with this program; if not, write to the Free Software |
| 16 |
dnl Foundation, Inc., 51 Franklin Street, Suite 500, Boston, MA 02110-1335, USA. |
| 17 |
dnl |
| 18 |
dnl Process this file with autoconf to produce a configure script. |
| 19 |
|
| 20 |
AC_INIT(./mod_load.c) |
| 21 |
|
| 22 |
AC_CANONICAL_SYSTEM |
| 23 |
|
| 24 |
ostype=`echo $build_os | sed 's/\..*$//g' | sed 's/-.*//g' | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ` |
| 25 |
|
| 26 |
AC_PROG_CC |
| 27 |
AC_PROG_CPP |
| 28 |
AC_AIX |
| 29 |
AC_ISC_POSIX |
| 30 |
AC_MINIX |
| 31 |
|
| 32 |
dnl Need to support/handle the --with-includes and --with-libraries options |
| 33 |
AC_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 |
|
| 49 |
AC_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 |
|
| 65 |
AC_HEADER_STDC |
| 66 |
AC_CHECK_HEADERS(stdlib.h unistd.h limits.h fcntl.h) |
| 67 |
|
| 68 |
dnl _Must_ come before AC_FUNC_GETLOADAVG |
| 69 |
AC_CHECK_LIB(kstat, kstat_open) |
| 70 |
|
| 71 |
dnl Supposedly in AC_FUNC_GETLOADAVG, but...? |
| 72 |
AC_CHECK_FUNCS(pstat_getdynamic) |
| 73 |
AC_FUNC_GETLOADAVG |
| 74 |
|
| 75 |
INCLUDES="$ac_build_addl_includes" |
| 76 |
LIBDIRS="$ac_build_addl_libdirs" |
| 77 |
|
| 78 |
AC_SUBST(INCLUDES) |
| 79 |
AC_SUBST(LDFLAGS) |
| 80 |
AC_SUBST(LIBDIRS) |
| 81 |
|
| 82 |
MODULE_LIBS= |
| 83 |
if test "$ostype" = "SOLARIS" ; then |
| 84 |
MODULE_LIBS="-lkstat" |
| 85 |
fi |
| 86 |
AC_SUBST(MODULE_LIBS) |
| 87 |
|
| 88 |
AC_CONFIG_HEADER(mod_load.h) |
| 89 |
AC_OUTPUT(Makefile) |