root/branches/licq/licq/configure.in

Revision 17, 3.7 kB (checked in by dwalker, 9 years ago)

Initial revision

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1dnl Process this file with autoconf to produce a configure script.
2AC_INIT(src/licq.h)
3AC_CONFIG_HEADER(config.h)
4
5dnl All versioning is done via these defines
6PACKAGE=Licq
7VERSION=0.70h
8INT_VERSION=708
9
10dnl Chuck #defines for PACKAGE and VERSION into config.h
11AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
12AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
13AC_DEFINE_UNQUOTED(INT_VERSION,$INT_VERSION)
14
15dnl Also substitute PACKAGE and VERSION in the AC_OUTPUT files
16AC_SUBST(PACKAGE)
17AC_SUBST(VERSION)
18
19dnl Set up some operating system specific options
20AC_CANONICAL_SYSTEM
21case "$host" in
22    *-*-openbsd*)
23        CFLAGS="$CFLAGS -pthread"
24        CPPFLAGS="$CPPFLAGS -D_REENTRANT"
25        CXXFLAGS="$CXXFLAGS -pthread"
26        echo "Setting OpenBSD compilation options"
27        ;;
28    *-*-freebsd*)
29        CFLAGS="$CFLAGS -pthread"
30        CPPFLAGS="$CPPFLAGS -D_THREAD_SAFE"
31        CXXFLAGS="$CXXFLAGS -pthread"
32        echo "Setting FreeBSD compilation options"
33        ;;
34    *-*-solaris*)
35        CPPFLAGS="$CPPFLAGS -D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS -DUSE_SOLARIS -DPIC -fPIC"
36        CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
37        echo "Setting Solaris compilation options"
38        ;;
39    *-*-linux*)
40        CPPFLAGS="$CPPFLAGS -fPIC -DPIC"
41        CXXFLAGS="$CXXFLAGS -fno-rtti -fno-exceptions"
42        echo "Setting Linux compilation options"
43        ;;
44    *)
45        echo "Licq may not compile on this system. Good luck :-)"
46        ;;
47esac
48
49dnl Checks for programs.
50AC_PROG_CC
51AC_PROG_CPP
52AC_PROG_CXX
53dnl AC_PROG_CXX_FNO_RTTI
54AC_PROG_CXXCPP
55AC_PROG_MAKE_SET
56AC_PROG_INSTALL
57AC_PROG_RANLIB
58AC_PATH_PROG(PROG_STRIP,strip,:)
59AC_PATH_PROG(PROG_SIZE,size,:)
60
61dnl Checks for header files.
62AC_HEADER_DIRENT
63AC_HEADER_STDC
64AC_CHECK_HEADERS(errno.h fcntl.h getopt.h limits.h malloc.h pwd.h unistd.h)
65
66dnl Checks for library functions.
67AC_CHECK_LIB(xnet,inet_addr)
68AC_CHECK_LIB(socket, socket)
69AC_CHECK_LIB(nsl, gethostbyname)
70
71AC_CHECK_LIB(c_r,pthread_create, [], [
72  AC_CHECK_LIB(pthread, pthread_create, [], [
73    AC_CHECK_LIB(thread, pthread_create, [], [
74      cat <<EOF;
75
76Please install/update your POSIX threads (pthreads) library. Updates should be
77available from either your system vendor, or, for GNU/Linux systems, go to
78http://pauillac.inria.fr/~xleroy/linuxthreads/
79
80EOF
81exit 1
82    ])
83  ])
84])
85
86dnl AC_CHECK_LIB(c, dlopen)
87dnl if test "$ac_cv_lib_c_dlopen" = "no"; then
88dnl   AC_CHECK_LIB(dl, dlopen)
89dnl   if test "$ac_cv_lib_dl_dlopen" = "no"; then
90dnl     echo "I can't find the library containing dlopen()"
91dnl     exit 1
92dnl   fi
93dnl fi
94
95AC_CHECK_LIB(c_r, dlopen, [], [
96  AC_CHECK_LIB(c, dlopen, [], [
97    AC_CHECK_LIB(dl, dlopen, [], [
98      echo "I can't find the library containing dlopen()"
99      exit 1
100    ])
101  ])
102])
103
104AC_MSG_CHECKING([for dlopen modes])
105AC_TRY_COMPILE([
106#include <stdio.h>
107#include <dlfcn.h>
108],[
109dlopen(NULL, RTLD_LAZY)
110],[
111  AC_MSG_RESULT([RTLD_LAZY])
112  AC_DEFINE_UNQUOTED(DLOPEN_POLICY, RTLD_LAZY)
113],[
114  AC_TRY_COMPILE([
115  #include <stdio.h>
116  #include <dlcfn.h>
117  ],[
118  dlopen(NULL, DL_LAZY)
119  ],[
120    AC_MSG_RESULT([DL_LAZY])
121    AC_DEFINE_UNQUOTED(DLOPEN_POLICY, DL_LAZY)
122  ],[
123    AC_MSG_RESULT([cannot determine, bailing])
124    exit 1;
125  ])
126])
127
128AC_CHECK_FUNCS(alphasort inet_addr inet_aton mktime select scandir strdup strerror hstrerror gethostbyname_r)
129
130AC_CHECK_SOCKS5
131
132dnl Switch to C++ mode and check for needed C++ headers
133AC_LANG_SAVE
134AC_LANG_CPLUSPLUS
135
136AC_CHECK_LIB(stdc++, getc,,
137  AC_MSG_ERROR(You need to have libstdc++ installed))
138AC_CHECK_HEADER(vector.h,,
139  AC_MSG_ERROR(You need to have the libstdc++ headers installed))
140
141AC_LANG_RESTORE
142
143dnl Checks for typedefs, structures, and compiler characteristics.
144AC_C_CONST
145AC_TYPE_SIZE_T
146AC_C_SOCKLEN_T
147AC_HEADER_TIME
148AC_STRUCT_TM
149AC_SYS_ERRLIST
150
151AC_OUTPUT(
152  share/Makefile
153  src/Makefile
154  src/daemon/Makefile
155  Makefile)
156
157echo ""
158echo "Please remember to use GNU make, often installed as gmake."
159echo ""
Note: See TracBrowser for help on using the browser.