| 1 | dnl Process this file with autoconf to produce a configure script. |
|---|
| 2 | AC_INIT(src/licq.h) |
|---|
| 3 | AC_CONFIG_AUX_DIR(admin) |
|---|
| 4 | AC_CANONICAL_SYSTEM |
|---|
| 5 | AC_ARG_PROGRAM |
|---|
| 6 | |
|---|
| 7 | dnl All versioning is done via these defines |
|---|
| 8 | INT_VERSION=1035 |
|---|
| 9 | AM_INIT_AUTOMAKE(licq, 1.3.6) |
|---|
| 10 | |
|---|
| 11 | AM_CONFIG_HEADER(config.h) |
|---|
| 12 | |
|---|
| 13 | dnl Chuck #defines for PACKAGE and VERSION into config.h |
|---|
| 14 | AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") |
|---|
| 15 | AC_DEFINE_UNQUOTED(VERSION, "$VERSION") |
|---|
| 16 | AC_DEFINE_UNQUOTED(INT_VERSION,$INT_VERSION, [Licq version number as int]) |
|---|
| 17 | AC_DEFINE_UNQUOTED(USE_FIFO, 1, [Undefine if it causes problems]) |
|---|
| 18 | |
|---|
| 19 | |
|---|
| 20 | dnl Expand prefix and exec_prefix |
|---|
| 21 | test "x${prefix}" = "xNONE" && prefix="${ac_default_prefix}" |
|---|
| 22 | test "x${exec_prefix}" = "xNONE" && exec_prefix='${prefix}' |
|---|
| 23 | |
|---|
| 24 | dnl (May) need to expand libdir and datadir more than once: |
|---|
| 25 | dnl $libdir => $exec_prefix/lib => $prefix/lib => /some/path/lib |
|---|
| 26 | install_libdir=$(eval "echo \"$(eval "echo \"${libdir}\"")\"") |
|---|
| 27 | AC_DEFINE_UNQUOTED(INSTALL_LIBDIR, "${install_libdir}/licq/", [Directory where plugins go]) |
|---|
| 28 | |
|---|
| 29 | dnl $datadir => $datarootdir => $prefix/share => /some/path/share |
|---|
| 30 | install_datadir=$(eval "echo \"$(eval "echo \"${datadir}\"")\"") |
|---|
| 31 | AC_DEFINE_UNQUOTED(INSTALL_SHAREDIR, "${install_datadir}/licq/", [Directory where shared data go]) |
|---|
| 32 | |
|---|
| 33 | |
|---|
| 34 | AC_ARG_ENABLE( |
|---|
| 35 | hebrew, |
|---|
| 36 | [ --enable-hebrew include support for hebrew reverse string], |
|---|
| 37 | USE_HEBREW=yes, USE_HEBREW=no) |
|---|
| 38 | if test "$USE_HEBREW" = "yes"; then |
|---|
| 39 | AC_DEFINE_UNQUOTED(USE_HEBREW, 1, [reverse string support]) |
|---|
| 40 | fi |
|---|
| 41 | |
|---|
| 42 | dnl Also substitute PACKAGE and VERSION in the AC_OUTPUT files |
|---|
| 43 | AC_SUBST(PACKAGE) |
|---|
| 44 | AC_SUBST(VERSION) |
|---|
| 45 | |
|---|
| 46 | dnl Checks for programs. |
|---|
| 47 | AC_PROG_CC |
|---|
| 48 | AC_PROG_CPP |
|---|
| 49 | AC_PROG_CXX |
|---|
| 50 | LICQDAEMON_CXX_FLAGS |
|---|
| 51 | LICQ_CXX_WEXTRA |
|---|
| 52 | AC_PROG_CXXCPP |
|---|
| 53 | AC_ISC_POSIX |
|---|
| 54 | AC_PROG_MAKE_SET |
|---|
| 55 | AC_PROG_INSTALL |
|---|
| 56 | AC_PATH_PROG(PROG_STRIP,strip,:) |
|---|
| 57 | AC_PATH_PROG(PROG_SIZE,size,:) |
|---|
| 58 | |
|---|
| 59 | dnl Required for GPGME... |
|---|
| 60 | AC_SYS_LARGEFILE |
|---|
| 61 | |
|---|
| 62 | dnl Set up some operating system specific options |
|---|
| 63 | case "$host" in |
|---|
| 64 | *-*-openbsd*) |
|---|
| 65 | CFLAGS="$CFLAGS -pthread" |
|---|
| 66 | CPPFLAGS="$CPPFLAGS -D_REENTRANT" |
|---|
| 67 | CXXFLAGS="$CXXFLAGS -pthread" |
|---|
| 68 | echo "Setting OpenBSD compilation options" |
|---|
| 69 | ;; |
|---|
| 70 | *-*-freebsd*) |
|---|
| 71 | CFLAGS="$CFLAGS -pthread" |
|---|
| 72 | CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" |
|---|
| 73 | CXXFLAGS="$CXXFLAGS -pthread" |
|---|
| 74 | echo "Setting FreeBSD compilation options" |
|---|
| 75 | ;; |
|---|
| 76 | *-*-solaris*) |
|---|
| 77 | CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DPIC -fPIC" |
|---|
| 78 | LDFLAGS="$LDFLAGS -mimpure-text" |
|---|
| 79 | echo "Setting Solaris compilation options" |
|---|
| 80 | ;; |
|---|
| 81 | *-*-linux*) |
|---|
| 82 | CPPFLAGS="$CPPFLAGS -fPIC -DPIC -D_REENTRANT" |
|---|
| 83 | echo "Setting Linux compilation options" |
|---|
| 84 | ;; |
|---|
| 85 | *-*-aix*) |
|---|
| 86 | CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE" |
|---|
| 87 | LIBS="$LIBS -lc_r" |
|---|
| 88 | echo "Setting AIX compilation options" |
|---|
| 89 | ;; |
|---|
| 90 | *-*-irix*) |
|---|
| 91 | LDFLAGS="$LDFLAGS -L/usr/lib32" |
|---|
| 92 | echo "Setting Irix compilation options" |
|---|
| 93 | ;; |
|---|
| 94 | *) |
|---|
| 95 | echo "Licq may not compile on this system. Good luck :-)" |
|---|
| 96 | ;; |
|---|
| 97 | esac |
|---|
| 98 | |
|---|
| 99 | dnl Checks for header files. |
|---|
| 100 | AC_HEADER_DIRENT |
|---|
| 101 | AC_HEADER_STDC |
|---|
| 102 | AC_CHECK_HEADERS(errno.h fcntl.h getopt.h limits.h malloc.h pwd.h unistd.h paths.h) |
|---|
| 103 | |
|---|
| 104 | dnl Check for headers we can use to get endian for system and maybe some bswap functions |
|---|
| 105 | AC_CHECK_HEADERS(byteswap.h endian.h machine/endian.h sys/byteorder.h) |
|---|
| 106 | |
|---|
| 107 | dnl Checks for library functions. |
|---|
| 108 | AC_CHECK_LIB(xnet,inet_addr) |
|---|
| 109 | AC_CHECK_LIB(socket, socket) |
|---|
| 110 | LICQ_CHECK_GETHOSTBYNAME |
|---|
| 111 | AC_CHECK_LIB(c_r,pthread_cancel, [], [ |
|---|
| 112 | AC_CHECK_LIB(pthread, pthread_cancel, [], [ |
|---|
| 113 | AC_CHECK_LIB(thread, pthread_cancel, [], [ |
|---|
| 114 | AC_CHECK_LIB(pthreads, pthread_cancel, [], [ |
|---|
| 115 | cat <<EOF; |
|---|
| 116 | |
|---|
| 117 | Please install/update your POSIX threads (pthreads) library. Updates should be |
|---|
| 118 | available from either your system vendor, or, for GNU/Linux systems, go to |
|---|
| 119 | http://pauillac.inria.fr/~xleroy/linuxthreads/. GNU Pth can also be used if |
|---|
| 120 | configured with --enable-pthread. |
|---|
| 121 | |
|---|
| 122 | EOF |
|---|
| 123 | exit 1 |
|---|
| 124 | ]) |
|---|
| 125 | ]) |
|---|
| 126 | ]) |
|---|
| 127 | ]) |
|---|
| 128 | |
|---|
| 129 | |
|---|
| 130 | AC_CHECK_LIB(c_r, dlopen, [], [ |
|---|
| 131 | AC_CHECK_LIB(c, dlopen, [], [ |
|---|
| 132 | AC_CHECK_LIB(dl, dlopen, [], [ |
|---|
| 133 | echo "I can't find the library containing dlopen()" |
|---|
| 134 | exit 1 |
|---|
| 135 | ]) |
|---|
| 136 | ]) |
|---|
| 137 | ]) |
|---|
| 138 | |
|---|
| 139 | AC_MSG_CHECKING([for dlopen modes]) |
|---|
| 140 | AC_TRY_COMPILE([ |
|---|
| 141 | #include <stdio.h> |
|---|
| 142 | #include <dlfcn.h> |
|---|
| 143 | ],[ |
|---|
| 144 | dlopen(NULL, RTLD_NOW) |
|---|
| 145 | ],[ |
|---|
| 146 | AC_MSG_RESULT([RTLD_NOW]) |
|---|
| 147 | AC_DEFINE_UNQUOTED(DLOPEN_POLICY, RTLD_NOW, [2nd dlopen parameter]) |
|---|
| 148 | ],[ |
|---|
| 149 | AC_TRY_COMPILE([ |
|---|
| 150 | #include <stdio.h> |
|---|
| 151 | #include <dlfcn.h> |
|---|
| 152 | ],[ |
|---|
| 153 | dlopen(NULL, RTLD_LAZY) |
|---|
| 154 | ],[ |
|---|
| 155 | AC_MSG_RESULT([RTLD_LAZY]) |
|---|
| 156 | AC_DEFINE_UNQUOTED(DLOPEN_POLICY, RTLD_LAZY, [2nd dlopen parameter]) |
|---|
| 157 | ],[ |
|---|
| 158 | AC_MSG_RESULT([cannot determine, bailing]) |
|---|
| 159 | exit 1; |
|---|
| 160 | ]) |
|---|
| 161 | ]) |
|---|
| 162 | |
|---|
| 163 | |
|---|
| 164 | AC_CHECK_FUNCS(inet_addr inet_aton mktime select strdup strerror hstrerror readdir_r) |
|---|
| 165 | |
|---|
| 166 | AC_CHECK_FUNC(pthread_kill_other_threads_np,[AC_DEFINE([HAVE_PTHREAD_KILL_OTHER_THREADS_NP], |
|---|
| 167 | [], [we are not using NTPL])]) |
|---|
| 168 | AC_CHECK_SOCKS5 |
|---|
| 169 | LICQ_CHECK_GPGME |
|---|
| 170 | LICQ_CHECK_OPENSSL |
|---|
| 171 | AX_BOOST_BASE([1.33.1]) |
|---|
| 172 | |
|---|
| 173 | dnl Switch to C++ mode and check for needed C++ headers |
|---|
| 174 | AC_LANG_SAVE |
|---|
| 175 | AC_LANG_CPLUSPLUS |
|---|
| 176 | |
|---|
| 177 | AC_CHECK_HEADER(vector,, |
|---|
| 178 | AC_MSG_ERROR(You need to have the libstdc++ headers installed)) |
|---|
| 179 | |
|---|
| 180 | AC_LANG_RESTORE |
|---|
| 181 | |
|---|
| 182 | dnl Checks for typedefs, structures, and compiler characteristics. |
|---|
| 183 | AC_C_CONST |
|---|
| 184 | AC_TYPE_SIZE_T |
|---|
| 185 | AC_C_SOCKLEN_T |
|---|
| 186 | AC_HEADER_TIME |
|---|
| 187 | AC_STRUCT_TM |
|---|
| 188 | LICQ_SYS_ERRLIST |
|---|
| 189 | LICQ_CHECK_GMTOFF |
|---|
| 190 | LICQ_CHECK_TIMEZONE |
|---|
| 191 | |
|---|
| 192 | dnl libtool stuff |
|---|
| 193 | AC_OBJEXT |
|---|
| 194 | AC_EXEEXT |
|---|
| 195 | AC_LIBTOOL_DLOPEN |
|---|
| 196 | AC_DISABLE_SHARED |
|---|
| 197 | m4_defun([_LT_AC_LANG_F77_CONFIG], [:]) |
|---|
| 198 | AC_PROG_LIBTOOL |
|---|
| 199 | AC_LIBTOOL_CXX |
|---|
| 200 | |
|---|
| 201 | AM_GNU_GETTEXT([external]) |
|---|
| 202 | AM_ICONV |
|---|
| 203 | if test "$am_cv_func_iconv" != "yes"; then |
|---|
| 204 | AC_MSG_ERROR(Please install the iconv library.) |
|---|
| 205 | fi |
|---|
| 206 | |
|---|
| 207 | AC_OUTPUT( |
|---|
| 208 | po/Makefile.in \ |
|---|
| 209 | bin/Makefile \ |
|---|
| 210 | share/Makefile \ |
|---|
| 211 | src/Makefile \ |
|---|
| 212 | include/Makefile \ |
|---|
| 213 | Makefile ) |
|---|
| 214 | |
|---|
| 215 | |
|---|
| 216 | echo "" |
|---|
| 217 | echo "" |
|---|
| 218 | |
|---|
| 219 | if test "$WITH_SOCKS5" = "no"; then |
|---|
| 220 | echo "SOCKS5 support is disabled." |
|---|
| 221 | else |
|---|
| 222 | echo "SOCKS5 support is enabled." |
|---|
| 223 | fi |
|---|
| 224 | |
|---|
| 225 | if test "$WITH_GPGME" = "no"; then |
|---|
| 226 | echo "GPGME support is disabled." |
|---|
| 227 | else |
|---|
| 228 | echo "GPGME support is enabled." |
|---|
| 229 | fi |
|---|
| 230 | |
|---|
| 231 | if test "$WITH_OPENSSL" = "no"; then |
|---|
| 232 | echo "" |
|---|
| 233 | echo "OpenSSL support is not available. Licq will not be able to" |
|---|
| 234 | echo "establish secure communication channels. This is not required" |
|---|
| 235 | echo "for proper function (i.e. it is optional). If you really desire this" |
|---|
| 236 | echo "functionality then install OpenSSL (libraries and headers) and" |
|---|
| 237 | echo "rebuild Licq. OpenSSL can be found at http://www.openssl.org" |
|---|
| 238 | echo "or as RPM from your local distribution site." |
|---|
| 239 | echo "" |
|---|
| 240 | echo "Note you need version 0.9.5a or greater." |
|---|
| 241 | else |
|---|
| 242 | echo "OpenSSL secure channel support is enabled." |
|---|
| 243 | fi |
|---|
| 244 | |
|---|
| 245 | dnl Check for msgfmt and gmsgfmt |
|---|
| 246 | if test "$GMSGFMT" = ":"; then |
|---|
| 247 | if test "$MSGFMT" = ":"; then |
|---|
| 248 | echo "** msgfmt and gmsgfmt could not be found. You're loosing daemon localization." |
|---|
| 249 | fi |
|---|
| 250 | fi |
|---|
| 251 | |
|---|
| 252 | echo "" |
|---|
| 253 | echo "--- Now type \"gmake\" to build Licq ---" |
|---|
| 254 | echo "--- If gmake is not working, try \"make\" ---" |
|---|
| 255 | echo "" |
|---|