TDE core libraries
Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

configure.in.in 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411
  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. MAKEKDEWIDGETS="compiled"
  83. dnl Checks for libraries etc
  84. AC_BASE_PATH_KDE([don't test]) dnl tdelibs is a special case
  85. KDE_ENABLE_HIDDEN_VISIBILITY
  86. AC_CREATE_KFSSTND(default)
  87. AC_SUBST_KFSSTND
  88. KDE_CREATE_LIBS_ALIASES
  89. AC_DEFUN([KDE_DO_UIC_AGAIN],
  90. [
  91. AC_REQUIRE([AC_PATH_QT_MOC_UIC])
  92. UIC=$UIC_PATH
  93. if test x$ac_uic_supports_nounload = xyes; then
  94. UIC="$UIC -nounload"
  95. fi
  96. AC_SUBST(UIC)
  97. ])
  98. KDE_DO_UIC_AGAIN
  99. # configure would do this very late. Too late for us!
  100. test "x$prefix" = xNONE && prefix=$ac_default_prefix
  101. AC_DEFINE_UNQUOTED(TDEDIR, "$prefix", [The prefix to use as fallback])
  102. KDE_EXPAND_MAKEVAR(ac_kde_sysconfdir, sysconfdir)
  103. AC_DEFINE_UNQUOTED(KDESYSCONFDIR, "$ac_kde_sysconfdir", [The compiled in system configuration prefix])
  104. ac_cpp_safe=$ac_cpp
  105. ac_CPPFLAGS_safe=$CPPFLAGS
  106. CPPFLAGS="$CPPFLAGS $X_INCLUDES"
  107. ac_cpp='$CXXCPP $CPPFLAGS'
  108. KDE_CHECK_HEADERS(X11/extensions/shape.h,,,
  109. [
  110. #include <X11/Xlib.h>
  111. #include <X11/Xutil.h>
  112. ])
  113. KDE_CHECK_HEADERS(X11/extensions/XShm.h,
  114. [have_mitshm=yes], [have_mitshm=no], [#include <X11/Xlib.h>])
  115. KDE_CHECK_HEADERS(X11/ICE/ICElib.h)
  116. KDE_CHECK_HEADER(sys/sendfile.h, [have_sendfile=yes], )
  117. ac_cpp=$ac_cpp_safe
  118. CPPFLAGS=$ac_CPPFLAGS_safe
  119. dnl Checks for typedefs, structures, and compiler characteristics.
  120. AC_HEADER_TIME
  121. AC_LANG_SAVE
  122. AC_LANG_C
  123. dnl AC_C_BIGENDIAN has a bug (one of its tests uses "main()" instead of
  124. dnl "int main()") so C++ compilers would break. Thats why we switch languages
  125. AC_C_BIGENDIAN
  126. AC_LANG_RESTORE
  127. dnl check if the compiler has bool
  128. AC_CHECK_BOOL
  129. dnl Checks for library functions.
  130. AC_CHECK_SETENV
  131. AC_CHECK_UNSETENV
  132. AC_CHECK_RANDOM
  133. AC_CHECK_MKSTEMPS
  134. AC_CHECK_MKSTEMP
  135. AC_CHECK_MKDTEMP
  136. AC_CHECK_FUNCS(strtoll socket seteuid setegid strfmon stpcpy gettimeofday readdir_r setpriority tcgetattr tcsetattr)
  137. AH_BOTTOM([
  138. /* provide a definition for a 32 bit entity, usable as a typedef, possibly
  139. extended by "unsigned" */
  140. #undef INT32_BASETYPE
  141. #ifdef SIZEOF_INT
  142. #if SIZEOF_INT == 4
  143. #define INT32_BASETYPE int
  144. #endif
  145. #endif
  146. #if !defined(INT32_BASETYPE) && defined(SIZEOF_LONG)
  147. #if SIZEOF_LONG == 4
  148. #define INT32_BASETYPE long
  149. #endif
  150. #endif
  151. #ifndef INT32_BASETYPE
  152. #define INT32_BASETYPE int
  153. #endif
  154. #ifndef HAVE_SETEUID
  155. #define HAVE_SETEUID
  156. #define HAVE_SETEUID_FAKE
  157. #ifdef __cplusplus
  158. extern "C"
  159. #endif
  160. int seteuid(INT32_BASETYPE euid); /* defined in fakes.c */
  161. #endif
  162. ])
  163. AC_CHECK_USLEEP
  164. AC_CHECK_GETHOSTNAME
  165. AC_CHECK_RANDOM
  166. AC_CHECK_S_ISSOCK
  167. AC_CHECK_INITGROUPS
  168. AC_MSG_CHECKING([for mount tab file])
  169. AC_CACHE_VAL(kde_cv_mtab_file,
  170. [
  171. kde_cv_mtab_file=no
  172. for ac_file in \
  173. \
  174. /etc/mtab \
  175. /etc/mnttab \
  176. ; \
  177. do
  178. if test -r "$ac_file"; then
  179. kde_cv_mtab_file=$ac_file
  180. break
  181. fi
  182. done
  183. ])
  184. AC_MSG_RESULT($kde_cv_mtab_file)
  185. if test "$kde_cv_mtab_file" != "no"; then
  186. AC_DEFINE_UNQUOTED(MTAB_FILE, "$kde_cv_mtab_file", [Define the file for mount entries])
  187. fi
  188. if test -n "$qt_includes"; then
  189. QNAMESPACE_H="$qt_includes/qnamespace.h"
  190. fi
  191. AC_SUBST(QNAMESPACE_H)
  192. AC_LANG_SAVE
  193. AC_LANG_CPLUSPLUS
  194. AC_MSG_CHECKING([if getmntinfo() uses struct statvfs])
  195. AC_TRY_LINK([#include <sys/types.h>
  196. #include <sys/statvfs.h>
  197. ],[int flags = 0; struct statvfs *mntbufp; return getmntinfo(&mntbufp, flags);],
  198. [AC_MSG_RESULT(yes)
  199. AC_DEFINE(GETMNTINFO_USES_STATVFS,,[getmntinfo() uses struct statvfs])],
  200. AC_MSG_RESULT(no))
  201. AC_LANG_RESTORE
  202. dnl output files
  203. AC_SUBST(x_includes)
  204. AC_SUBST(x_libraries)
  205. AC_SUBST(LIBSOCKET)
  206. AC_SUBST(LIBCOMPAT)
  207. AC_SUBST(LIBUTIL)
  208. AC_SUBST(LIBRESOLV)
  209. AC_SUBST(LIBICE)
  210. AC_SUBST(LIB_KAB, '$(top_builddir)/kab/libkab.la')
  211. AC_SUBST(LIB_KABC, '$(top_builddir)/tdeabc/libkabc.la')
  212. AC_SUBST(LIB_TDECORE, '$(top_builddir)/tdecore/libtdecore.la')
  213. AC_SUBST(LIB_TDEUI, '$(top_builddir)/tdeui/libtdeui.la')
  214. AC_SUBST(LIB_KIO, '$(top_builddir)/tdeio/libtdeio.la')
  215. AC_SUBST(LIB_TDEFILE, '$(top_builddir)/tdeio/libtdeio.la')
  216. AC_SUBST(LIB_KSYCOCA, '$(top_builddir)/tdeio/libtdeio.la')
  217. AC_SUBST(LIB_TDEHTML, '$(top_builddir)/tdehtml/libtdehtml.la')
  218. AC_SUBST(LIB_TDEPRINT, '$(top_builddir)/tdeprint/libtdeprint.la')
  219. AC_SUBST(LIB_KPARTS, '$(top_builddir)/tdeparts/libtdeparts.la')
  220. AC_SUBST(LIB_KIMGIO, '$(top_builddir)/kimgio/libkimgio.la')
  221. AC_SUBST(LIB_KNEWSTUFF, '$(top_builddir)/knewstuff/libknewstuff.la')
  222. AC_SUBST(LIB_KUNITTEST, '$(top_builddir)/tdeunittest/libtdeunittest.la')
  223. case $host in
  224. *cygwin*) lib_kded='$(top_builddir)/kded/libtdeinit_kded.la' ;;
  225. *) lib_kded='' ;;
  226. esac
  227. AC_SUBST(LIB_KDED, $lib_kded)
  228. AC_SUBST(EXTRA_SUBDIRS)
  229. AC_MSG_CHECKING(if sendfile() is wanted)
  230. AC_ARG_ENABLE(sendfile,
  231. AC_HELP_STRING([--enable-sendfile],[enable the use of sendfile() (Linux only)]),
  232. [if test "$enableval" = yes; then
  233. AC_MSG_RESULT(yes)
  234. want_sendfile="yes"
  235. else
  236. AC_MSG_RESULT(no)
  237. fi], [AC_MSG_RESULT(no)])
  238. if test "$want_sendfile" = "yes" -a "$have_sendfile" = "yes"; then
  239. AC_SUBST(HAVE_SENDFILE)
  240. AC_DEFINE(HAVE_SENDFILE,1,[Define if you want sendfile() support])
  241. fi
  242. AC_MSG_CHECKING(if MIT-SHM support is wanted)
  243. AC_ARG_ENABLE(mitshm,
  244. AC_HELP_STRING([--enable-mitshm],[use MIT-SHM for pixmap loading/saving]),
  245. [if test "$enableval" = yes; then
  246. AC_MSG_RESULT(yes)
  247. want_mitshm="yes"
  248. else
  249. AC_MSG_RESULT(no)
  250. fi], [AC_MSG_RESULT(yes); want_mitshm="yes"])
  251. if test "$want_mitshm" = "yes" -a "$have_mitshm" = "yes"; then
  252. AC_SUBST(HAVE_MITSHM)
  253. AC_DEFINE(HAVE_MITSHM,1,[Define if you want MIT-SHM support])
  254. fi
  255. AC_CHECK_FUNC(posix_fadvise,[AC_DEFINE(HAVE_FADVISE,1,[Define is posix_fadvise is supported] )])
  256. AC_SUBST(ICE_SUBDIR, 'ICE')
  257. AC_SUBST(ICE_RLIB, 'ICE/libkICE.la')
  258. AC_SUBST(DCOPIDL, '$(top_builddir)/dcop/dcopidl/dcopidl')
  259. AC_SUBST(DCOPIDLNG, '$(top_srcdir)/dcop/dcopidlng/dcopidlng')
  260. AC_SUBST(DCOPIDL2CPP, '$(top_builddir)/dcop/dcopidl2cpp/dcopidl2cpp')
  261. AC_SUBST(MAKEKDEWIDGETS, '$(top_builddir)/kdewidgets/makekdewidgets')
  262. AC_SUBST(KCONFIG_COMPILER, '$(top_builddir)/tdecore/tdeconfig_compiler/tdeconfig_compiler')
  263. ac_save_LIBS="$LIBS"
  264. LIBS="$LIBS $X_LDFLAGS -lICE"
  265. AC_CHECK_FUNCS(_IceTransNoListen)
  266. LIBS="$ac_save_LIBS"
  267. if test "x$kde_use_qt_emb" != "xyes"; then
  268. CXXFLAGS="$CXXFLAGS $USE_RTTI"
  269. fi
  270. AC_ARG_WITH([rgbfile],
  271. AC_HELP_STRING([--with-rgbfile=path], [Define custom path for rgb.txt. (default: \$(x11libdir)/X11/rgb.txt)]),
  272. [rgb_file=$withval], [rgb_file="$x_libraries/X11/rgb.txt"])
  273. AC_DEFINE_UNQUOTED(X11_RGBFILE, "$rgb_file", [where rgb.txt is in])
  274. AC_MSG_CHECKING([for Compiler version])
  275. case "$CXX" in
  276. xlC*)
  277. # The __IBMCPP__ macro contains the C++ compiler version in decimal notation.
  278. echo "__IBMCPP__" > conftest.C
  279. # Preprocess and at least make sure it's returned a number.
  280. changequote(, )dnl
  281. $CXX -E conftest.C 2>&1 | grep "^[0-9][0-9][0-9]" > conftest.i
  282. changequote([, ])dnl
  283. # "502" would signify version 5.0.2.
  284. clean_compiler_version="$CXX version "`cut -b1 conftest.i`"."`cut -b2 conftest.i`"."`cut -b3 conftest.i`
  285. rm -f conftest.C conftest.i
  286. ;;
  287. KCC*)
  288. # KCC doesn't give it's version, if nothing is compiled (the frontend
  289. # isn't called in that case)
  290. rm -f conftest.C conftest.o
  291. echo "void f(void) {}" > conftest.C
  292. clean_compiler_version=`$CXX -V -c conftest.C -o conftest.o 2>&1 | sed 's/--.*//'`
  293. rm -f conftest.C conftest.o
  294. ;;
  295. *)
  296. for flag in '-v' '-V' '--version' '-version'; do
  297. compiler_version=`$CXX $flag 2>&1 | egrep -v "Reading specs|Using built-?in specs|Configured with|Thread model" | head -n 1`
  298. clean_compiler_version=`echo $compiler_version | egrep -vi 'Usage|ERROR|unknown option|WARNING|missing|###'`
  299. test -n "$clean_compiler_version" && break
  300. done
  301. ;;
  302. esac
  303. # Quote backslashesm, as we are going to make this a string.
  304. clean_compiler_version=`echo $clean_compiler_version | sed 's/\([\\\\]\)/\\\\\\1/g'`
  305. if test -z "$clean_compiler_version"; then
  306. clean_compiler_version="unknown"
  307. fi
  308. AC_DEFINE_UNQUOTED(KDE_COMPILER_VERSION, "$clean_compiler_version", [what C++ compiler was used for compilation])
  309. AC_MSG_RESULT($clean_compiler_version)
  310. AC_MSG_CHECKING([for uname])
  311. case `uname -s` in
  312. AIX)
  313. IBM_ARCH=PowerPC #good default
  314. if [ -x /usr/sbin/lsdev -a -x /usr/sbin/lsattr ]; then
  315. IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | head -n 1 | awk '{ print $1 }'`
  316. if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
  317. IBM_ARCH=POWER
  318. fi
  319. fi
  320. uname_string=`uname -svr | awk '{ print $1" "$3"."$2 }'`" ${IBM_ARCH}"
  321. ;;
  322. *)
  323. uname_string=`uname -smr`
  324. ;;
  325. esac
  326. AC_DEFINE_UNQUOTED(KDE_COMPILING_OS, "$uname_string", [what OS used for compilation])
  327. AC_MSG_RESULT($uname_string)
  328. AC_MSG_CHECKING([for distribution channel])
  329. AC_ARG_WITH(distribution,
  330. AC_HELP_STRING([--with-distribution],[indicate the distribution in bug reports]),
  331. [kde_distribution_text="$withval"
  332. ], [kde_distribution_text='compiled sources'])
  333. AC_DEFINE_UNQUOTED(KDE_DISTRIBUTION_TEXT, "$kde_distribution_text", [Distribution Text to append to OS])
  334. AC_MSG_RESULT($kde_distribution_text)
  335. AC_ARG_WITH(utempter,
  336. [AC_HELP_STRING([--with-utempter], [use utempter for utmp management @<:@default=check@:>@])],
  337. [], with_utempter=check)
  338. if test "x$with_utempter" != xno; then
  339. kde_have_utempter=yes
  340. AC_CHECK_LIB(utempter, addToUtmp, [LIBUTEMPTER=-lutempter], kde_have_utempter=no)
  341. AC_SUBST(LIBUTEMPTER)
  342. if test "$kde_have_utempter" = "yes"; then
  343. AC_DEFINE_UNQUOTED(HAVE_UTEMPTER, 1, [Define if you have the utempter helper for utmp managment])
  344. fi
  345. if test "x$with_utempter" != xcheck && test "x$kde_have_utempter" != xyes; then
  346. AC_MSG_ERROR([--with-utempter was given, but test for utempter failed])
  347. fi
  348. fi
  349. KDE_INIT_DOXYGEN([The KDE API Reference], [Version $VERSION])
  350. KDE_CHECK_BINUTILS