The Trinity Qt Interface
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.in.in 10KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363
  1. # Original Author was Kalle@kde.org
  2. # I lifted it in some mater. (Stephan Kulow)
  3. # I used much code from Janos Farkas
  4. dnl Process this file with autoconf to produce a configure script.
  5. AC_INIT(acinclude.m4) dnl a source file from your sub dir
  6. dnl This is so we can use kde-common
  7. AC_CONFIG_AUX_DIR(admin)
  8. dnl Setting the prefix for tdelibs uses a special version of KDE_SET_PREFIX
  9. dnl (since that one normally looks for existing kde installations)
  10. KDE_SET_PREFIX_CORE
  11. AC_CANONICAL_SYSTEM
  12. AC_ARG_PROGRAM
  13. dnl Automake doc recommends to do this only here. (Janos)
  14. AM_INIT_AUTOMAKE(@MODULENAME@, @VERSION@) dnl searches for some needed programs
  15. AM_MAINTAINER_MODE
  16. AC_PROG_INSTALL
  17. dnl generate the config header
  18. AM_CONFIG_HEADER(config.h) dnl at the distribution this done
  19. dnl Checks for programs.
  20. AC_CHECK_COMPILERS
  21. AC_LIBLTDL_CONVENIENCE
  22. AC_ENABLE_SHARED(yes)
  23. AC_ENABLE_STATIC(no)
  24. KDE_PROG_LIBTOOL
  25. AC_LANG_SAVE
  26. AC_LANG_C
  27. KDE_LIB_LTDL
  28. AC_LANG_RESTORE
  29. dnl for NLS support. Call them in this order!
  30. dnl WITH_NLS is for the po files, GNU_GETTEXT for the sources
  31. AM_KDE_WITH_NLS
  32. AM_KDE_GNU_GETTEXT
  33. dnl Checks for header files.
  34. KDE_CHECK_STL
  35. AC_HEADER_DIRENT
  36. AC_HEADER_STDC
  37. AC_CHECK_HEADERS(sys/param.h sys/mman.h sys/time.h sysent.h strings.h sys/stat.h sys/select.h paths.h malloc.h limits.h sys/soundcard.h dlfcn.h termios.h sys/prctl.h)
  38. AC_ARG_WITH(acl,
  39. [AC_HELP_STRING(--with-acl,
  40. [enable support for POSIX ACLs @<:@default=check@:>@])],
  41. [], with_acl=check)
  42. ACL_LIBS=""
  43. if test "x$with_acl" != xno; then
  44. USE_POSIX_ACL=yes
  45. HAVE_NON_POSIX_ACL_EXTENSIONS=no
  46. KDE_CHECK_HEADER(sys/acl.h, ,[USE_POSIX_ACL="no"])
  47. HAVE_SYS_XATTR_H=no
  48. KDE_CHECK_HEADER(sys/xattr.h,[HAVE_SYS_XATTR_H="yes"],)
  49. if test "$HAVE_SYS_XATTR_H" = "yes" ; then
  50. AC_DEFINE([HAVE_SYS_XATTR_H], 1, [Define if system has the sys/xattr.h header.])
  51. fi
  52. case $host in
  53. *-*-freebsd*)
  54. KDE_CHECK_LIB(c,acl_init,[ACL_LIBS="-lc"],[USE_POSIX_ACL="no"])
  55. ;;
  56. *)
  57. KDE_CHECK_HEADER(attr/libattr.h, ,[USE_POSIX_ACL="no"])
  58. KDE_CHECK_LIB(acl,acl_init,[ACL_LIBS="-lacl -lattr"],[USE_POSIX_ACL="no"])
  59. KDE_CHECK_HEADER(acl/libacl.h,[HAVE_NON_POSIX_ACL_EXTENSIONS="yes"],)
  60. if test "$HAVE_SYS_XATTR_H" = "no" ; then
  61. USE_POSIX_ACL="no"
  62. fi
  63. ;;
  64. esac
  65. if test "$USE_POSIX_ACL" = "yes" ; then
  66. AC_DEFINE([USE_POSIX_ACL], 1, [Define if system has POSIX ACL support.])
  67. if test "$HAVE_NON_POSIX_ACL_EXTENSIONS" = "yes" ; then
  68. AC_DEFINE([HAVE_NON_POSIX_ACL_EXTENSIONS], 1, [Define if system has non-POSIX extensions to the ACL support.])
  69. fi
  70. fi
  71. if test "x$with_acl" != xcheck && test "$USE_POSIX_ACL" != "yes"; then
  72. AC_MSG_ERROR([--with-acl was given, but test for POSIX ACLs failed])
  73. fi
  74. fi
  75. AC_SUBST(ACL_LIBS)
  76. DCOPIDL2CPP="compiled"
  77. DCOPIDL="compiled"
  78. DCOPIDLNG="compiled"
  79. MEINPROC="compiled"
  80. KDECONFIG="compiled"
  81. KCONFIG_COMPILER="compiled"
  82. MAKETDEWIDGETS="compiled"
  83. dnl Checks for libraries etc
  84. ac_cpp_safe=$ac_cpp
  85. ac_CPPFLAGS_safe=$CPPFLAGS
  86. CPPFLAGS="$CPPFLAGS $X_INCLUDES"
  87. ac_cpp='$CXXCPP $CPPFLAGS'
  88. KDE_CHECK_HEADERS(X11/extensions/shape.h,,,
  89. [
  90. #include <X11/Xlib.h>
  91. #include <X11/Xutil.h>
  92. ])
  93. KDE_CHECK_HEADERS(X11/extensions/XShm.h,
  94. [have_mitshm=yes], [have_mitshm=no], [#include <X11/Xlib.h>])
  95. KDE_CHECK_HEADERS(X11/ICE/ICElib.h)
  96. KDE_CHECK_HEADER(sys/sendfile.h, [have_sendfile=yes], )
  97. ac_cpp=$ac_cpp_safe
  98. CPPFLAGS=$ac_CPPFLAGS_safe
  99. dnl Checks for typedefs, structures, and compiler characteristics.
  100. AC_HEADER_TIME
  101. AC_LANG_SAVE
  102. AC_LANG_C
  103. dnl AC_C_BIGENDIAN has a bug (one of its tests uses "main()" instead of
  104. dnl "int main()") so C++ compilers would break. Thats why we switch languages
  105. AC_C_BIGENDIAN
  106. AC_LANG_RESTORE
  107. dnl check if the compiler has bool
  108. AC_CHECK_BOOL
  109. dnl Checks for library functions.
  110. AC_CHECK_SETENV
  111. AC_CHECK_UNSETENV
  112. AC_CHECK_RANDOM
  113. AC_CHECK_MKSTEMPS
  114. AC_CHECK_MKSTEMP
  115. AC_CHECK_MKDTEMP
  116. AC_CHECK_FUNCS(strtoll socket seteuid setegid strfmon stpcpy gettimeofday readdir_r setpriority tcgetattr tcsetattr)
  117. AH_BOTTOM([
  118. /* provide a definition for a 32 bit entity, usable as a typedef, possibly
  119. extended by "unsigned" */
  120. #undef INT32_BASETYPE
  121. #ifdef SIZEOF_INT
  122. #if SIZEOF_INT == 4
  123. #define INT32_BASETYPE int
  124. #endif
  125. #endif
  126. #if !defined(INT32_BASETYPE) && defined(SIZEOF_LONG)
  127. #if SIZEOF_LONG == 4
  128. #define INT32_BASETYPE long
  129. #endif
  130. #endif
  131. #ifndef INT32_BASETYPE
  132. #define INT32_BASETYPE int
  133. #endif
  134. #ifndef HAVE_SETEUID
  135. #define HAVE_SETEUID
  136. #define HAVE_SETEUID_FAKE
  137. #ifdef __cplusplus
  138. extern "C"
  139. #endif
  140. int seteuid(INT32_BASETYPE euid); /* defined in fakes.c */
  141. #endif
  142. ])
  143. AC_CHECK_USLEEP
  144. AC_CHECK_GETHOSTNAME
  145. AC_CHECK_RANDOM
  146. AC_CHECK_S_ISSOCK
  147. AC_CHECK_INITGROUPS
  148. AC_MSG_CHECKING([for mount tab file])
  149. AC_CACHE_VAL(kde_cv_mtab_file,
  150. [
  151. kde_cv_mtab_file=no
  152. for ac_file in \
  153. \
  154. /etc/mtab \
  155. /etc/mnttab \
  156. ; \
  157. do
  158. if test -r "$ac_file"; then
  159. kde_cv_mtab_file=$ac_file
  160. break
  161. fi
  162. done
  163. ])
  164. AC_MSG_RESULT($kde_cv_mtab_file)
  165. if test "$kde_cv_mtab_file" != "no"; then
  166. AC_DEFINE_UNQUOTED(MTAB_FILE, "$kde_cv_mtab_file", [Define the file for mount entries])
  167. fi
  168. dnl Check for Qt
  169. AC_PATH_TQT
  170. if test -n "$tqt_includes"; then
  171. QNAMESPACE_H="$tqt_includes/qnamespace.h"
  172. fi
  173. AC_SUBST(QNAMESPACE_H)
  174. AC_LANG_SAVE
  175. AC_LANG_CPLUSPLUS
  176. AC_MSG_CHECKING([if getmntinfo() uses struct statvfs])
  177. AC_TRY_LINK([#include <sys/types.h>
  178. #include <sys/statvfs.h>
  179. ],[int flags = 0; struct statvfs *mntbufp; return getmntinfo(&mntbufp, flags);],
  180. [AC_MSG_RESULT(yes)
  181. AC_DEFINE(GETMNTINFO_USES_STATVFS,,[getmntinfo() uses struct statvfs])],
  182. AC_MSG_RESULT(no))
  183. AC_LANG_RESTORE
  184. dnl output files
  185. AC_SUBST(x_includes)
  186. AC_SUBST(x_libraries)
  187. AC_SUBST(LIBSOCKET)
  188. AC_SUBST(LIBCOMPAT)
  189. AC_SUBST(LIBUTIL)
  190. AC_SUBST(LIBRESOLV)
  191. AC_SUBST(LIBICE)
  192. AC_SUBST(LIB_TQT, '$(top_builddir)/qtinterface/libtqt.la')
  193. AC_SUBST(EXTRA_SUBDIRS)
  194. AC_MSG_CHECKING(if sendfile() is wanted)
  195. AC_ARG_ENABLE(sendfile,
  196. AC_HELP_STRING([--enable-sendfile],[enable the use of sendfile() (Linux only)]),
  197. [if test "$enableval" = yes; then
  198. AC_MSG_RESULT(yes)
  199. want_sendfile="yes"
  200. else
  201. AC_MSG_RESULT(no)
  202. fi], [AC_MSG_RESULT(no)])
  203. if test "$want_sendfile" = "yes" -a "$have_sendfile" = "yes"; then
  204. AC_SUBST(HAVE_SENDFILE)
  205. AC_DEFINE(HAVE_SENDFILE,1,[Define if you want sendfile() support])
  206. fi
  207. AC_MSG_CHECKING(if MIT-SHM support is wanted)
  208. AC_ARG_ENABLE(mitshm,
  209. AC_HELP_STRING([--enable-mitshm],[use MIT-SHM for pixmap loading/saving]),
  210. [if test "$enableval" = yes; then
  211. AC_MSG_RESULT(yes)
  212. want_mitshm="yes"
  213. else
  214. AC_MSG_RESULT(no)
  215. fi], [AC_MSG_RESULT(yes); want_mitshm="yes"])
  216. if test "$want_mitshm" = "yes" -a "$have_mitshm" = "yes"; then
  217. AC_SUBST(HAVE_MITSHM)
  218. AC_DEFINE(HAVE_MITSHM,1,[Define if you want MIT-SHM support])
  219. fi
  220. AC_CHECK_FUNC(posix_fadvise,[AC_DEFINE(HAVE_FADVISE,1,[Define is posix_fadvise is supported] )])
  221. ac_save_LIBS="$LIBS"
  222. LIBS="$LIBS $X_LDFLAGS -lICE"
  223. AC_CHECK_FUNCS(_IceTransNoListen)
  224. LIBS="$ac_save_LIBS"
  225. if test "x$kde_use_qt_emb" != "xyes"; then
  226. CXXFLAGS="$CXXFLAGS $USE_RTTI"
  227. fi
  228. AC_ARG_WITH([rgbfile],
  229. AC_HELP_STRING([--with-rgbfile=path], [Define custom path for rgb.txt. (default: \$(x11libdir)/X11/rgb.txt)]),
  230. [rgb_file=$withval], [rgb_file="$x_libraries/X11/rgb.txt"])
  231. AC_DEFINE_UNQUOTED(X11_RGBFILE, "$rgb_file", [where rgb.txt is in])
  232. AC_MSG_CHECKING([for Compiler version])
  233. case "$CXX" in
  234. xlC*)
  235. # The __IBMCPP__ macro contains the C++ compiler version in decimal notation.
  236. echo "__IBMCPP__" > conftest.C
  237. # Preprocess and at least make sure it's returned a number.
  238. changequote(, )dnl
  239. $CXX -E conftest.C 2>&1 | grep "^[0-9][0-9][0-9]" > conftest.i
  240. changequote([, ])dnl
  241. # "502" would signify version 5.0.2.
  242. clean_compiler_version="$CXX version "`cut -b1 conftest.i`"."`cut -b2 conftest.i`"."`cut -b3 conftest.i`
  243. rm -f conftest.C conftest.i
  244. ;;
  245. KCC*)
  246. # KCC doesn't give it's version, if nothing is compiled (the frontend
  247. # isn't called in that case)
  248. rm -f conftest.C conftest.o
  249. echo "void f(void) {}" > conftest.C
  250. clean_compiler_version=`$CXX -V -c conftest.C -o conftest.o 2>&1 | sed 's/--.*//'`
  251. rm -f conftest.C conftest.o
  252. ;;
  253. *)
  254. for flag in '-v' '-V' '--version' '-version'; do
  255. compiler_version=`$CXX $flag 2>&1 | egrep -v "Reading specs|Using built-?in specs|Configured with|Thread model" | head -n 1`
  256. clean_compiler_version=`echo $compiler_version | egrep -vi 'Usage|ERROR|unknown option|WARNING|missing|###'`
  257. test -n "$clean_compiler_version" && break
  258. done
  259. ;;
  260. esac
  261. # Quote backslashesm, as we are going to make this a string.
  262. clean_compiler_version=`echo $clean_compiler_version | sed 's/\([\\\\]\)/\\\\\\1/g'`
  263. if test -z "$clean_compiler_version"; then
  264. clean_compiler_version="unknown"
  265. fi
  266. AC_DEFINE_UNQUOTED(KDE_COMPILER_VERSION, "$clean_compiler_version", [what C++ compiler was used for compilation])
  267. AC_MSG_RESULT($clean_compiler_version)
  268. AC_MSG_CHECKING([for uname])
  269. case `uname -s` in
  270. AIX)
  271. IBM_ARCH=PowerPC #good default
  272. if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
  273. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -n 1 | awk '{ print $1 }'`
  274. if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  275. IBM_ARCH=POWER
  276. fi
  277. fi
  278. uname_string=`uname -svr | awk '{ print $1" "$3"."$2 }'`" ${IBM_ARCH}"
  279. ;;
  280. *)
  281. uname_string=`uname -smr`
  282. ;;
  283. esac
  284. AC_DEFINE_UNQUOTED(KDE_COMPILING_OS, "$uname_string", [what OS used for compilation])
  285. AC_MSG_RESULT($uname_string)
  286. AC_MSG_CHECKING([for distribution channel])
  287. AC_ARG_WITH(distribution,
  288. AC_HELP_STRING([--with-distribution],[indicate the distribution in bug reports]),
  289. [kde_distribution_text="$withval"
  290. ], [kde_distribution_text='compiled sources'])
  291. AC_DEFINE_UNQUOTED(KDE_DISTRIBUTION_TEXT, "$kde_distribution_text", [Distribution Text to append to OS])
  292. AC_MSG_RESULT($kde_distribution_text)
  293. AC_ARG_WITH(utempter,
  294. [AC_HELP_STRING([--with-utempter], [use utempter for utmp management @<:@default=check@:>@])],
  295. [], with_utempter=check)
  296. if test "x$with_utempter" != xno; then
  297. kde_have_utempter=yes
  298. AC_CHECK_LIB(utempter, addToUtmp, [LIBUTEMPTER=-lutempter], kde_have_utempter=no)
  299. AC_SUBST(LIBUTEMPTER)
  300. if test "$kde_have_utempter" = "yes"; then
  301. AC_DEFINE_UNQUOTED(HAVE_UTEMPTER, 1, [Define if you have the utempter helper for utmp managment])
  302. fi
  303. if test "x$with_utempter" != xcheck && test "x$kde_have_utempter" != xyes; then
  304. AC_MSG_ERROR([--with-utempter was given, but test for utempter failed])
  305. fi
  306. fi
  307. KDE_INIT_DOXYGEN([The KDE API Reference], [Version $VERSION])
  308. KDE_CHECK_BINUTILS