KVirc – next generation IRC client
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.
 
 
 
 
 
 

2843 lines
101 KiB

  1. dnl # // ##################################################################################################################
  2. dnl # // ## Initialization
  3. dnl # // ##################################################################################################################
  4. AC_DEFUN([AC_SS_INIT_VARIABLES],
  5. [
  6. SS_BUILD_FLAGS=""
  7. SS_BUILD_NUMBER=""
  8. dnl # // X Stuff
  9. SS_X_INCDIR=""
  10. SS_X_LIBDIR=""
  11. SS_X_LDFLAGS=""
  12. SS_X_CPPFLAGS=""
  13. dnl # // Qt Stuff
  14. SS_QT3_GENERAL_DIR=""
  15. SS_QT3_INCDIR=""
  16. SS_QT3_LIBDIR=""
  17. SS_QT3_MOC=""
  18. dnl # // KDE Stuff
  19. SS_KDE_REQUESTED="no"
  20. SS_KDE_GENERAL_DIR=""
  21. SS_KDE_INCDIR=""
  22. SS_KDE_LIBDIR=""
  23. SS_KDE_SERVICESDIR=""
  24. SS_KDE_ICONS32DIR=""
  25. dnl # // Perl stuff
  26. SS_PERL_ENABLE="no"
  27. SS_PERL_CCFLAGS=""
  28. SS_PERL_LDFLAGS=""
  29. SS_PERL_BINARY="true"
  30. dnl # // CXXFLAGS, will be set by AC_SS_CXXFLAGS
  31. dnl # CXXFLAGS=""
  32. dnl Build flags:
  33. dnl g - Debug version
  34. dnl h - Memory checks
  35. dnl m - Memory profiling
  36. dnl s - System memmove
  37. dnl S - splash screen
  38. dnl o = openssl support
  39. dnl b - Big channels
  40. dnl x - ix86 asm
  41. dnl T - tips
  42. dnl c - crypt
  43. dnl I - IPC
  44. dnl G - GSM codec
  45. dnl 8 - local 8 bit
  46. dnl A - dcc sound audio support
  47. dnl a - ignore sigalarm
  48. dnl i - ipv6
  49. dnl B - big endian
  50. dnl k - KDE
  51. dnl p - pseudo transparency
  52. dnl e - Esound daemon support
  53. dnl r - Arts daemon support
  54. dnl f - Audiofile support
  55. dnl P - profiling support
  56. dnl p - perl scripting support
  57. ])
  58. dnl # // ##################################################################################################################
  59. dnl # // ## OUTPUT MACROS
  60. dnl # // ##################################################################################################################
  61. AC_DEFUN([AC_CROSS_COLOR],
  62. [
  63. TPUT=0
  64. PRINTF=0
  65. COLOR=0
  66. IFS_OLD=$IFS
  67. IFS=":"
  68. for i in $PATH; do
  69. if test -x "$i/tput"; then
  70. TPUT=1
  71. fi
  72. done
  73. type printf >/dev/null 2>&1 && PRINTF=1
  74. for i in $PATH; do
  75. if test -x "$i/printf"; then
  76. PRINTF=1
  77. fi
  78. done
  79. if test "$TPUT" = "1" -o "$PRINTF" = "1"; then
  80. COLOR=1
  81. fi
  82. if test "$COLOR" = 1; then
  83. if test "$TPUT" = "1"; then
  84. if test "$1" = "1"; then
  85. tput bold
  86. else
  87. tput sgr0
  88. fi
  89. if test "$2" != ""; then
  90. tput setaf $2
  91. fi
  92. elif test "$PRINTF" = "1"; then
  93. if test "$2" != ""; then
  94. printf "\033\1330$1;3$2m"
  95. fi
  96. fi
  97. fi
  98. IFS=$IFS_OLD
  99. ])
  100. AC_DEFUN([AC_SS_HEADER],
  101. [
  102. AC_CROSS_COLOR([1],[2])
  103. echo "################################################################################"
  104. echo "### $1"
  105. echo "################################################################################"
  106. AC_CROSS_COLOR([0],[9])
  107. ])
  108. AC_DEFUN([AC_SS_SECTION],
  109. [
  110. AC_CROSS_COLOR([1],[3])
  111. echo "### $1"
  112. AC_CROSS_COLOR([0],[9])
  113. ])
  114. AC_DEFUN([AC_SS_SET_REDINK],
  115. [
  116. AC_CROSS_COLOR([1],[1])
  117. ])
  118. AC_DEFUN([AC_SS_SET_GREENINK],
  119. [
  120. AC_CROSS_COLOR([1],[2])
  121. ])
  122. AC_DEFUN([AC_SS_SET_NORMALINK],
  123. [
  124. AC_CROSS_COLOR([0],[9])
  125. ])
  126. dnl # // ##################################################################################################################
  127. dnl # // ## FILE LOOKUP MACROS
  128. dnl # // ##################################################################################################################
  129. AC_DEFUN([AC_SS_FIND_FILE_PATH],
  130. [
  131. $3="FAILED"
  132. for a_dir in $2; do
  133. for a_file in $1; do
  134. if test -r "$a_dir/$a_file"; then
  135. $3=$(echo "$a_dir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g')
  136. break 2
  137. fi
  138. done
  139. done
  140. ])
  141. AC_DEFUN([AC_SS_FIND_FILE_PATH_EXT],
  142. [
  143. $4="FAILED"
  144. for a_dir in $2; do
  145. for a_semidir in $3; do
  146. for a_file in $1; do
  147. if test -r "$a_dir/$a_semidir/$a_file"; then
  148. $4=$(echo "$a_dir/$a_semidir" | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g' | sed -e 's/\/\.\//\//g' | sed -e 's/\/\//\//g')
  149. break 3
  150. fi
  151. done
  152. done
  153. done
  154. ])
  155. dnl # // ##################################################################################################################
  156. dnl # // ## BASIC COMPILER FLAGS
  157. dnl # // ##################################################################################################################
  158. AC_DEFUN([AC_SS_CXXFLAGS_DEBUG_SYMBOLS],
  159. [
  160. dnl # // Checks if the --with-debug-symbols option has been passed to configure
  161. dnl # // adds -g to SS_CXXFLAGS
  162. dnl # // adds g to SS_BUILD_FLAGS
  163. AC_MSG_CHECKING([if you want the debug symbols])
  164. SS_LOCAL_ADD_DEBUG_SYMBOLS=""
  165. AC_ARG_ENABLE(debug,
  166. AC_HELP_STRING([--enable-debug],[Compile an executable suitable for debugging]),
  167. [SS_LOCAL_ADD_DEBUG_SYMBOLS="true"])
  168. if test -n "$SS_LOCAL_ADD_DEBUG_SYMBOLS"; then
  169. AC_MSG_RESULT([yes])
  170. if test -n "$SS_CXXFLAGS"; then
  171. SS_CXXFLAGS="$SS_CXXFLAGS -g"
  172. else
  173. SS_CXXFLAGS="-g"
  174. fi
  175. SS_BUILD_FLAGS="g$SS_BUILD_FLAGS"
  176. else
  177. AC_MSG_RESULT([no])
  178. fi
  179. ])
  180. AC_DEFUN([AC_SS_CXXFLAGS_PIPES],
  181. [
  182. dnl # // Checks if the --with-pipes option has been passed to configure
  183. dnl # // adds -pipe to CXXFLAGS
  184. AC_MSG_CHECKING([if you want to use pipes for compilation])
  185. SS_LOCAL_USE_PIPES=""
  186. AC_ARG_ENABLE(pipes,
  187. AC_HELP_STRING([--enable-pipes],[Use pipes instead of files for the compilation]),
  188. [SS_LOCAL_USE_PIPES="true"])
  189. if test -n "$SS_LOCAL_USE_PIPES"; then
  190. AC_MSG_RESULT([yes])
  191. if test -n "$SS_CXXFLAGS"; then
  192. SS_CXXFLAGS="$SS_CXXFLAGS -pipe"
  193. else
  194. SS_CXXFLAGS="-pipe"
  195. fi
  196. else
  197. AC_MSG_RESULT([no])
  198. fi
  199. ])
  200. AC_DEFUN([AC_SS_CXXFLAGS_PROFILING],
  201. [
  202. AC_MSG_CHECKING([if you want the profiling information])
  203. SS_LOCAL_ADD_PROFILING=""
  204. AC_ARG_ENABLE(profiling,
  205. AC_HELP_STRING([--enable-profiling],[Compile an executable suitable for profiling]),
  206. [SS_LOCAL_ADD_PROFILING="true"])
  207. if test -n "$SS_LOCAL_ADD_PROFILING"; then
  208. AC_MSG_RESULT([yes])
  209. if test -n "$SS_CXXFLAGS"; then
  210. SS_CXXFLAGS="$SS_CXXFLAGS -pg"
  211. else
  212. SS_CXXFLAGS="-pg"
  213. fi
  214. if test -n "$SS_LDFLAGS"; then
  215. SS_LDFLAGS="$SS_LDFLAGS -pg"
  216. else
  217. SS_LDFLAGS="-pg"
  218. fi
  219. SS_BUILD_FLAGS="P$SS_BUILD_FLAGS"
  220. else
  221. AC_MSG_RESULT([no])
  222. fi
  223. ])
  224. AC_DEFUN([AC_SS_CXXFLAGS_FNORTTI],
  225. [
  226. AC_MSG_CHECKING([if you want to use -fno-rtti])
  227. SS_LOCAL_FNORTTI=""
  228. AC_ARG_ENABLE(fno-rtti,
  229. AC_HELP_STRING([--enable-fno-rtti],[Disable runtime type information (dangerous)]),
  230. SS_LOCAL_FNORTTI="true")
  231. if test -n "$SS_LOCAL_FNORTTI"; then
  232. AC_MSG_RESULT([yes])
  233. if test -n "$SS_CXXFLAGS"; then
  234. SS_CXXFLAGS="$SS_CXXFLAGS -fno-rtti"
  235. else
  236. SS_CXXFLAGS="-fno-rtti"
  237. fi
  238. else
  239. AC_MSG_RESULT([no])
  240. fi
  241. ])
  242. AC_DEFUN([AC_SS_CXXFLAGS_ANSI],
  243. [
  244. SS_ANSI_COMPILATION=""
  245. AC_MSG_CHECKING([if you want a strict ansi compilation])
  246. AC_ARG_ENABLE(ansi,
  247. AC_HELP_STRING([--enable-ansi],[Strict ansi compilation (might not compile)]),
  248. SS_ANSI_COMPILATION="true")
  249. if test -n "$SS_ANSI_COMPILATION"; then
  250. AC_MSG_RESULT([yes])
  251. if test -n "$SS_CXXFLAGS"; then
  252. SS_CXXFLAGS="$SS_CXXFLAGS -ansi"
  253. else
  254. SS_CXXFLAGS="-ansi"
  255. fi
  256. else
  257. AC_MSG_RESULT([no])
  258. fi
  259. ])
  260. AC_DEFUN([AC_SS_CXXFLAGS_WALL],
  261. [
  262. SS_WALL_COMPILATION=""
  263. AC_MSG_CHECKING([if you want gcc to be paranoic])
  264. AC_ARG_ENABLE(wall,
  265. AC_HELP_STRING([--enable-wall],[Make gcc be paranoic (might not compile)]),
  266. SS_WALL_COMPILATION="true")
  267. if test -n "$SS_WALL_COMPILATION"; then
  268. AC_MSG_RESULT([yes])
  269. if test -n "$SS_CXXFLAGS"; then
  270. SS_CXXFLAGS="$SS_CXXFLAGS -Wall"
  271. else
  272. SS_CXXFLAGS="-Wall"
  273. fi
  274. else
  275. AC_MSG_RESULT([no])
  276. fi
  277. ])
  278. AC_DEFUN([AC_SS_CXXFLAGS_PEDANTIC],
  279. [
  280. SS_PEDANTIC_COMPILATION=""
  281. AC_MSG_CHECKING([if you want a strict ansi compilation])
  282. AC_ARG_ENABLE(pedantic,
  283. AC_HELP_STRING([--enable-pedantic],[Pedantic compilation (might not compile)]),
  284. SS_PEDANTIC_COMPILATION="true")
  285. if test -n "$SS_PEDANTIC_COMPILATION"; then
  286. AC_MSG_RESULT([yes])
  287. if test -n "$SS_CXXFLAGS"; then
  288. SS_CXXFLAGS="$SS_CXXFLAGS -pedantic"
  289. else
  290. SS_CXXFLAGS="-pedantic"
  291. fi
  292. else
  293. AC_MSG_RESULT([no])
  294. fi
  295. ])
  296. AC_DEFUN([AC_SS_CXXFLAGS_OPTIMISATION],
  297. [
  298. AC_MSG_CHECKING([for the optimisation level])
  299. SS_LOCAL_OPTIMISATION=""
  300. AC_ARG_ENABLE(optimisation,
  301. AC_HELP_STRING([--enable-optimisation=N],[Use optimisation level N when compiling]),
  302. SS_LOCAL_OPTIMISATION="$enableval")
  303. if test -n "$SS_LOCAL_OPTIMISATION"; then
  304. AC_MSG_RESULT([using -O$SS_LOCAL_OPTIMISATION])
  305. if test -n "$SS_CXXFLAGS"; then
  306. SS_CXXFLAGS="$SS_CXXFLAGS -O$SS_LOCAL_OPTIMISATION"
  307. else
  308. SS_CXXFLAGS="-O$SS_LOCAL_OPTIMISATION"
  309. fi
  310. SS_BUILD_FLAGS="$SS_LOCAL_OPTIMISATION$SS_BUILD_FLAGS"
  311. else
  312. AC_MSG_RESULT([using no optimisation flag])
  313. fi
  314. ])
  315. AC_DEFUN([AC_SS_CXXFLAGS],
  316. [
  317. SS_CXXFLAGS=""
  318. AC_SS_CXXFLAGS_DEBUG_SYMBOLS
  319. AC_SS_CXXFLAGS_PROFILING
  320. AC_SS_CXXFLAGS_PIPES
  321. AC_SS_CXXFLAGS_OPTIMISATION
  322. AC_SS_CXXFLAGS_FNORTTI
  323. AC_SS_CXXFLAGS_ANSI
  324. AC_SS_CXXFLAGS_PEDANTIC
  325. AC_SS_CXXFLAGS_WALL
  326. if test -n "$SS_CXXFLAGS"; then
  327. if test -n "$CXXFLAGS"; then
  328. CXXFLAGS="$CXXFLAGS $SS_CXXFLAGS"
  329. else
  330. CXXFLAGS="$SS_CXXFLAGS"
  331. fi
  332. fi
  333. ])
  334. dnl ###################################################################################################################
  335. dnl ### HEADERS AND FUNCTIONS
  336. dnl ###################################################################################################################
  337. AC_DEFUN([AC_SS_HEADER_CHECKS],
  338. [
  339. SS_HAS_OSS_SUPPORT="false"
  340. AC_CHECK_HEADER(strings.h)
  341. AC_CHECK_HEADERS(linux/soundcard.h sys/soundcard.h soundcard.h,SS_HAS_OSS_SUPPORT="true")
  342. if test "$SS_HAS_OSS_SUPPORT" = "true"; then
  343. AC_DEFINE([COMPILE_OSS_SUPPORT], 1, [define if you want to enable OSS sound support])
  344. fi
  345. ])
  346. AC_DEFUN([AC_SS_FUNCTION_CHECKS],
  347. [
  348. SS_HAVE_IPV6_FUNCTIONS="true"
  349. AC_CHECK_FUNCS(getenv strerror)
  350. AC_CHECK_FUNCS(inet_ntoa inet_aton)
  351. AC_CHECK_FUNCS(setenv unsetenv putenv)
  352. AC_CHECK_FUNCS(gmtime_r localtime_r)
  353. AC_CHECK_FUNC(inet_ntop,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
  354. AC_CHECK_FUNC(inet_pton,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
  355. AC_CHECK_FUNC(getaddrinfo,SS_HAVE_IPV6_FUNCTIONS="true",SS_HAVE_IPV6_FUNCTIONS="false")
  356. AC_CHECK_FUNCS(getnameinfo)
  357. ])
  358. dnl ###################################################################################################################
  359. dnl ### MISC OPTIONS
  360. dnl ###################################################################################################################
  361. AC_DEFUN([AC_SS_MISC_OPTIONS],
  362. [
  363. AC_MSG_CHECKING([if you want the memory profiling])
  364. AC_ARG_WITH(memory-profile, [ --with-memory-profile Compile the memory profile],SS_COMPILE_MEMORY_PROFILE="true")
  365. if test "$SS_COMPILE_MEMORY_PROFILE" = "true"; then
  366. AC_MSG_RESULT(yes)
  367. AC_DEFINE([COMPILE_MEMORY_PROFILE], 1, [define if you want the gcc memory profile])
  368. SS_BUILD_FLAGS="m$SS_BUILD_FLAGS"
  369. else
  370. AC_MSG_RESULT(no)
  371. fi
  372. AC_MSG_CHECKING([how to waste your time])
  373. AC_MSG_RESULT(by performing senseless checks)
  374. AC_MSG_CHECKING([if you want memory checking in malloc])
  375. AC_ARG_WITH(memory-checks, [ --with-memory-checks Enable malloc memory checks],SS_COMPILE_MEMORY_CHECKS="true")
  376. if test "$SS_COMPILE_MEMORY_CHECKS" = "true"; then
  377. AC_MSG_RESULT(yes)
  378. AC_DEFINE([COMPILE_MEMORY_CHECKS], 1, [define if you want the memory checks])
  379. SS_BUILD_FLAGS="h$SS_BUILD_FLAGS"
  380. else
  381. AC_MSG_RESULT(no)
  382. fi
  383. AC_MSG_CHECKING([if you want to use system memmove])
  384. AC_ARG_WITH(system-memmove, [ --without-system-memmove Do not use system memmove and memcpy],SS_DO_NOT_USE_SYSTEM_MEMMOVE="true")
  385. if test "$SS_DO_NOT_USE_SYSTEM_MEMMOVE" = "true"; then
  386. AC_MSG_RESULT(no)
  387. else
  388. AC_DEFINE([COMPILE_WITH_SYSTEM_MEMMOVE], 1, [define if you trust your memmove() function])
  389. AC_MSG_RESULT(yes)
  390. SS_BUILD_FLAGS="s$SS_BUILD_FLAGS"
  391. fi
  392. AC_MSG_CHECKING([if you want to optimize for big channels])
  393. AC_ARG_WITH(big-channels, [ --with-big-channels Optimize for big irc channels],SS_OPTIMIZE_BIG_CHANNELS="true")
  394. if test "$SS_OPTIMIZE_BIG_CHANNELS" = "true"; then
  395. AC_MSG_RESULT(yes: using 349 as dict size)
  396. AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],349, [define this to the number of average channel users])
  397. SS_BUILD_FLAGS="b$SS_BUILD_FLAGS"
  398. else
  399. AC_MSG_RESULT(no: using 101 as dict size)
  400. AC_DEFINE_UNQUOTED([AVERAGE_CHANNEL_USERS],101, [define this to the number of average channel users])
  401. fi
  402. AC_MSG_CHECKING([if you want ix86 assembly optimisations])
  403. AC_ARG_WITH(ix86-asm, [ --with-ix86-asm Compile ix86 assembly optimisations],SS_COMPILE_ix86_ASM="true")
  404. if test "$SS_COMPILE_ix86_ASM" = "true"; then
  405. AC_MSG_RESULT(yes)
  406. AC_MSG_CHECKING(target system CPU)
  407. if test "$target_cpu" = "i386"; then
  408. AC_MSG_RESULT(i386 : compiling asm code)
  409. else
  410. if test "$target_cpu" = "i486"; then
  411. AC_MSG_RESULT(i486 : compiling asm code)
  412. else
  413. if test "$target_cpu" = "i586"; then
  414. AC_MSG_RESULT(i586 : compiling asm code)
  415. else
  416. if test "$target_cpu" = "i686"; then
  417. AC_MSG_RESULT(i686 : compiling asm code)
  418. else
  419. AC_MSG_RESULT($target_cpu , no i386 optimisations)
  420. unset SS_COMPILE_ix86_ASM
  421. fi
  422. fi
  423. fi
  424. fi
  425. if test "$SS_COMPILE_ix86_ASM" = "true"; then
  426. AC_DEFINE([COMPILE_ix86_ASM], 1, [define if you want the i386 asm code])
  427. SS_BUILD_FLAGS="x$SS_BUILD_FLAGS"
  428. fi
  429. else
  430. AC_MSG_RESULT(no)
  431. fi
  432. AC_PATH_PROG(SS_MSGFMT,msgfmt,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin)
  433. if test -z "SS_MSGFMT"; then
  434. SS_MSGFMT=":"
  435. fi
  436. AC_SUBST(SS_MSGFMT)
  437. AC_MSG_CHECKING([if you want the DCC VOICE sound support])
  438. AC_ARG_WITH(dcc-sound,[ --without-dcc-sound Do not compile the DCC VOICE sound support],SS_NO_SOUND="true")
  439. if test "$SS_NO_SOUND" = "true"; then
  440. AC_MSG_RESULT(no)
  441. AC_DEFINE([COMPILE_DISABLE_DCC_VOICE], 1, [define if you want to disable DCC VOICE sound support])
  442. else
  443. AC_MSG_RESULT(yes)
  444. SS_BUILD_FLAGS="A$SS_BUILD_FLAGS"
  445. fi
  446. SS_BUILD_FLAGS="T$SS_BUILD_FLAGS"
  447. AC_DEFINE([COMPILE_INFO_TIPS], 1, [define if you want the info tips to be compiled in])
  448. AC_MSG_CHECKING([if you want to disable the ipV6 support])
  449. AC_ARG_WITH(ipv6-support,[ --without-ipv6-support Do not compile the IpV6 support],SS_NOIPV6_SUPPORT="true")
  450. if test "$SS_NOIPV6_SUPPORT" = "true"; then
  451. AC_MSG_RESULT(yes)
  452. else
  453. AC_MSG_RESULT(no)
  454. fi
  455. AC_MSG_CHECKING([if you want to disable the cryptography support])
  456. AC_ARG_WITH(crypt-support,[ --without-crypt-support Do not compile the cryptography support],SS_NOCRYPT_SUPPORT="true")
  457. if test "$SS_NOCRYPT_SUPPORT" = "true"; then
  458. AC_MSG_RESULT(yes)
  459. else
  460. AC_MSG_RESULT(no)
  461. AC_DEFINE([COMPILE_CRYPT_SUPPORT], 1, [define if you want to compile the crypt support])
  462. SS_BUILD_FLAGS="c$SS_BUILD_FLAGS"
  463. fi
  464. AC_MSG_CHECKING([if you want to disable the X bell support])
  465. AC_ARG_WITH(x-bell,[ --without-x-bell Disable the X bell support],SS_NO_X_BELL="true")
  466. if test "$SS_NO_X_BELL" = "true"; then
  467. AC_MSG_RESULT(yes)
  468. AC_DEFINE([COMPILE_NO_X_BELL], 1, [define if you want to disable the X bell support])
  469. else
  470. AC_MSG_RESULT(no)
  471. fi
  472. AC_DEFINE([COMPILE_NEW_KVS], 1, [define if you want to enable the new KVS parser])
  473. AC_DEFINE([COMPILE_ONLY_NEW_KVS], 1, [define if you want to use only the new KVS parser])
  474. AC_MSG_CHECKING([if you want to link to the embedded version of qt])
  475. AC_ARG_WITH(qt-embedded,[ --with-qt-embedded Link to qt-embedded (see INSTALL)],SS_QT3_EMBEDDED="true")
  476. if test "$SS_QT3_EMBEDDED" = "true"; then
  477. AC_MSG_RESULT(yes)
  478. SS_BUILD_FLAGS="E$SS_BUILD_FLAGS"
  479. else
  480. AC_MSG_RESULT(no)
  481. fi
  482. AC_MSG_CHECKING([if you want to disable inter-process communication])
  483. AC_ARG_WITH(ipc,[ --without-ipc Disable inter-process communication support],SS_NO_IPC="true")
  484. if test "$SS_NO_IPC" = "true"; then
  485. AC_MSG_RESULT(yes)
  486. SS_BUILD_FLAGS="I$SS_BUILD_FLAGS"
  487. AC_DEFINE([COMPILE_NO_IPC], 1, [define this if you want to disable the inter-process communication support])
  488. else
  489. AC_MSG_RESULT(no)
  490. fi
  491. AC_MSG_CHECKING([if you want to explicitly disable the gsm codec support])
  492. AC_ARG_WITH(gsm,[ --without-gsm Disable gsm codec support],SS_NO_GSM="true")
  493. if test "$SS_NO_GSM" = "true"; then
  494. AC_MSG_RESULT(yes)
  495. else
  496. AC_DEFINE([COMPILE_USE_GSM], 1, [define if you have libgsm and want the GSM code to be compiled])
  497. SS_BUILD_FLAGS="G$SS_BUILD_FLAGS"
  498. AC_MSG_RESULT(no)
  499. fi
  500. AC_MSG_CHECKING([if you want to ignore SIGALARM])
  501. AC_ARG_WITH(ignore-sigalarm, [ --with-ignore-sigalarm Ignore SIGALARM in all threads],SS_IGNORE_SIGALARM="true")
  502. if test "$SS_IGNORE_SIGALARM" = "true"; then
  503. AC_MSG_RESULT(yes)
  504. AC_DEFINE([COMPILE_IGNORE_SIGALARM], 1, [define this if you want to ignore the SIGALARM signal])
  505. SS_BUILD_FLAGS="a$SS_BUILD_FLAGS"
  506. else
  507. AC_MSG_RESULT(no)
  508. fi
  509. AC_MSG_CHECKING([if you want the pseudo-transparency support])
  510. AC_ARG_WITH(transparency, [ --without-transparency Do NOT compile the pseudo-transparency support],SS_NO_PSEUDO_TRANSPARENCY="true")
  511. if test "$SS_NO_PSEUDO_TRANSPARENCY" = "true"; then
  512. AC_MSG_RESULT(no)
  513. else
  514. AC_MSG_RESULT(yes)
  515. AC_DEFINE([COMPILE_PSEUDO_TRANSPARENCY], 1, [define if you have the KDE support and want the pseudo transparency])
  516. SS_BUILD_FLAGS="p$SS_BUILD_FLAGS"
  517. fi
  518. AC_ARG_WITH(pizza,[ --with-pizza Use this when hungry],SS_PIZZA="true")
  519. ])
  520. dnl ###################################################################################################################
  521. dnl ### DYNAMIC LABELS
  522. dnl ###################################################################################################################
  523. AC_DEFUN([AC_SS_CHECK_DYNAMIC_LABELS],
  524. [
  525. AC_MSG_CHECKING([if the compiler supports dynamic labels])
  526. AC_ARG_WITH(dyn-labels, [ --without-dyn-labels Disable usage of the dynamic label jumps],SS_DISABLE_DYNAMIC_LABELS="true")
  527. if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then
  528. AC_MSG_RESULT("no: trusting you")
  529. else
  530. AC_TRY_RUN([
  531. int main(int argc,char ** argv)
  532. {
  533. int retVal = 10;
  534. void * label = &&action4;
  535. goto action2;
  536. action1:
  537. retVal -= 4;
  538. label = &&endofcode;
  539. goto *label;
  540. action2:
  541. retVal -= 5;
  542. goto *label;
  543. action3:
  544. retVal += 40;
  545. action4:
  546. retVal -= 1;
  547. label = &&action1;
  548. goto *label;
  549. endofcode:
  550. return retVal;
  551. }
  552. ],SS_DISABLE_DYNAMIC_LABELS="false",SS_DISABLE_DYNAMIC_LABELS="true",SS_DISABLE_DYNAMIC_LABELS="true")
  553. if test "$SS_DISABLE_DYNAMIC_LABELS" = "true"; then
  554. AC_MSG_RESULT("no")
  555. else
  556. AC_MSG_RESULT("yes")
  557. AC_DEFINE([COMPILE_USE_DYNAMIC_LABELS], 1, [define if your compiler supports gotos do dynamic labels])
  558. fi
  559. fi
  560. ])
  561. dnl ###################################################################################################################
  562. dnl ### BIG_ENDIAN
  563. dnl ###################################################################################################################
  564. AC_DEFUN([AC_SS_CHECK_BIG_ENDIAN],
  565. [
  566. AC_MSG_CHECKING([if this system is big endian])
  567. AC_TRY_RUN([
  568. int main(int argc,char ** argv)
  569. {
  570. int nl;
  571. unsigned char * nlc;
  572. nl = 0x12CAFE34;
  573. nlc = (unsigned char *)(&nl);
  574. if((nlc[0] == 0x12) && (nlc[1] == 0xCA) && (nlc[2] == 0xFE) && (nlc[3] == 0x34))return 0;
  575. return 1;
  576. }
  577. ],SS_BIG_ENDIAN_MACHINE="true",SS_BIG_ENDIAN_MACHINE="false",SS_BIG_ENDIAN_MACHINE="false")
  578. dnl # This will fail if we're cross compiling...
  579. if test "$SS_BIG_ENDIAN_MACHINE" = "true"; then
  580. AC_MSG_RESULT([yes])
  581. SS_BUILD_FLAGS="B$SS_BUILD_FLAGS"
  582. AC_DEFINE([BIG_ENDIAN_MACHINE_BYTE_ORDER], 1, [define this if you are on a big endian machine])
  583. else
  584. AC_MSG_RESULT([no])
  585. fi
  586. ])
  587. dnl ###################################################################################################################
  588. dnl ### DLOPEN
  589. dnl ###################################################################################################################
  590. AC_DEFUN([AC_SS_CHECK_DL],
  591. [
  592. AC_MSG_CHECKING([for dlopen capabilities])
  593. SS_LINK_TO_LIBDL="no"
  594. SS_SAVE_LIBS="$LIBS"
  595. LIBS="-rdynamic"
  596. AC_TRY_LINK([
  597. #include <dlfcn.h>
  598. ],[
  599. /* sparc-unknown-openbsd3.0 hack */
  600. #ifndef RTLD_NOW
  601. #define RTLD_NOW RTLD_LAZY
  602. #endif
  603. dlopen("/lib/libc.so.6",RTLD_NOW);
  604. ],
  605. eval "SS_DLOPEN_OK=yes"
  606. ,
  607. eval "SS_DLOPEN_OK=no"
  608. )
  609. LIBS="$SS_SAVE_LIBS"
  610. if test "$SS_DLOPEN_OK" = "yes"; then
  611. AC_MSG_RESULT([builtin in libc])
  612. else
  613. SS_SAVE_LIBS="$LIBS"
  614. LIBS="-rdynamic -ldl"
  615. AC_TRY_LINK([
  616. #include <dlfcn.h>
  617. ],[
  618. /* sparc-unknown-openbsd3.0 hack */
  619. #ifndef RTLD_NOW
  620. #define RTLD_NOW RTLD_LAZY
  621. #endif
  622. dlopen("/usr/lib/libdl.so",RTLD_NOW);
  623. ],
  624. eval "SS_DLOPEN_OK=yes",
  625. eval "SS_DLOPEN_OK=no"
  626. )
  627. LIBS="$SS_SAVE_LIBS"
  628. if test "$SS_DLOPEN_OK" = "yes"; then
  629. SS_LINK_TO_LIBDL="yes"
  630. AC_MSG_RESULT([external in libdl])
  631. else
  632. AC_MSG_RESULT([FAILED])
  633. AC_SS_SET_REDINK
  634. echo "################################################################################"
  635. echo "### CONFIGURE ERROR:"
  636. echo "### No dlopen capabilities found."
  637. echo "### It looks that your system has no interface to the dynamic linker ?"
  638. echo "### If you're on linux, you either miss libdl , or the linker is not"
  639. echo "### able to find it. Make sure that libdl is in /lib or /usr/lib."
  640. echo "### If you're sure you have libdl, make sure you have also g++ installed."
  641. echo "### If you're not on linux, please drop a mail to pragma at kvirc dot net"
  642. echo "### describing your system and I'll try to fix it."
  643. echo "################################################################################"
  644. AC_SS_SET_NORMALINK
  645. AC_MSG_ERROR(["This was fatal...aborting"])
  646. fi
  647. fi
  648. ])
  649. dnl ###################################################################################################################
  650. dnl ### PERL
  651. dnl ###################################################################################################################
  652. AC_DEFUN([AC_SS_CHECK_PERL],
  653. [
  654. SS_PERL_ENABLE="yes"
  655. SS_PERL_CCFLAGS=""
  656. SS_PERL_LDFLAGS=""
  657. SS_PERL_BINARY="true"
  658. SS_PERL_RESULT_MESSAGE=""
  659. AC_ARG_ENABLE(perl,AC_HELP_STRING([--enable-perl],[Enable perl scripting support (default=detect)]),eval "SS_PERL_ENABLE=$enableval")
  660. if test "$SS_PERL_ENABLE" = "yes"; then
  661. AC_PATH_PROG(SS_PERL_BINARY,perl,":",$PATH:/bin:/usr/bin:/bin:/usr/local/bin:/usr/X11R6/bin:/usr/lib/qt/bin:/usr/local/qt/bin:/usr/X11R6/qt/bin:/usr/qt/bin:/usr/build/qt/bin)
  662. if test -z "SS_PERL_BINARY"; then
  663. SS_PERL_RESULT_MESSAGE="disabled: can't find the perl binary"
  664. SS_PERL_ENABLE="no"
  665. SS_PERL_BINARY="true"
  666. fi
  667. else
  668. SS_PERL_RESULT_MESSAGE="disabled by user"
  669. fi
  670. if test "$SS_PERL_ENABLE" = "yes"; then
  671. AC_MSG_CHECKING([if perl il compiled with MULTIPLICITY option])
  672. SS_PERL_TEMP=$($SS_PERL_BINARY -V | grep MULTIPLICITY)
  673. if test -z "$SS_PERL_TEMP"; then
  674. AC_MSG_RESULT([no])
  675. SS_PERL_ENABLE="no"
  676. SS_PERL_BINARY="true"
  677. SS_PERL_RESULT_MESSAGE="disabled: MULTIPLICITY not defined"
  678. fi
  679. fi
  680. if test "$SS_PERL_ENABLE" = "yes"; then
  681. AC_MSG_CHECKING([for the system perl directory])
  682. SS_PERL_DIR=$($SS_PERL_BINARY -MConfig -e 'print $Config{archlib}')
  683. SS_PERL_DIR="$SS_PERL_DIR/CORE"
  684. AC_MSG_RESULT([got $SS_PERL_DIR])
  685. AC_MSG_CHECKING([for the perl ccflags])
  686. SS_PERL_CCFLAGS=$($SS_PERL_BINARY -MConfig -e 'print $Config{ccflags}')
  687. AC_MSG_RESULT([got $SS_PERL_CCFLAGS])
  688. AC_MSG_CHECKING([for the perl ldflags])
  689. SS_PERL_LDFLAGS=$($SS_PERL_BINARY -MExtUtils::Embed -e ldopts)
  690. AC_MSG_RESULT([got $SS_PERL_LDFLAGS])
  691. AC_MSG_CHECKING([if we can compile a perl application])
  692. SS_SAVED_LIBS="$LIBS"
  693. SS_SAVED_CFLAGS="$CFLAGS"
  694. SS_SAVED_CCFLAGS="$CCFLAGS"
  695. SS_SAVED_LDFLAGS="$LDFLAGS"
  696. SS_SAVED_CXXFLAGS="$CXXFLAGS"
  697. SS_SAVED_CPPFLAGS="$CPPFLAGS"
  698. LIBS="$SS_PERL_LDFLAGS"
  699. LDFLAGS="$LIBS"
  700. CFLAGS="$SS_PERL_CCFLAGS -I$SS_PERL_DIR"
  701. CCFLAGS="$CFLAGS"
  702. CXXFLAGS="$CFLAGS"
  703. CPPFLAGS="$CFLAGS"
  704. AC_TRY_LINK([
  705. #include <EXTERN.h>
  706. #include <perl.h>
  707. #include <XSUB.h>
  708. extern "C" void boot_DynaLoader(pTHX_ CV* cv);
  709. extern "C" void xs_init(pTHX)
  710. {
  711. char * file = __FILE__;
  712. newXS("DynaLoader::boot_DynaLoader",boot_DynaLoader,file);
  713. }
  714. ],[
  715. PerlInterpreter *my_perl;
  716. my_perl = perl_alloc();
  717. perl_construct(my_perl);
  718. perl_parse(my_perl,xs_init, 0, 0, (char **)NULL);
  719. perl_run(my_perl);
  720. perl_destruct(my_perl);
  721. perl_free(my_perl);
  722. ],
  723. eval "SS_PERL_ENABLE=yes",
  724. eval "SS_PERL_ENABLE=no"
  725. )
  726. SS_PERL_LDFLAGS="$LDFLAGS"
  727. SS_PERL_CCFLAGS="$CCFLAGS"
  728. LIBS="$SS_SAVED_LIBS"
  729. CFLAGS="$SS_SAVED_CFLAGS"
  730. LDFLAGS="$SS_SAVED_LDFLAGS"
  731. CXXFLAGS="$SS_SAVED_CXXFLAGS"
  732. CPPFLAGS="$SS_SAVED_CPPFLAGS"
  733. CCFLAGS="$SS_SAVED_CCFLAGS"
  734. if test "$SS_PERL_ENABLE" = "yes"; then
  735. AC_MSG_RESULT([seems ok])
  736. AC_DEFINE([COMPILE_PERL_SUPPORT], 1, [define if you have perl and want the perl scripting support in kvirc])
  737. SS_BUILD_FLAGS="p$SS_BUILD_FLAGS"
  738. SS_PERL_RESULT_MESSAGE="enabled"
  739. else
  740. AC_MSG_RESULT([seems broken])
  741. SS_PERL_RESULT_MESSAGE="disabled: failed to compile the test program"
  742. SS_PERL_LDFLAGS=""
  743. SS_PERL_CCFLAGS=""
  744. fi
  745. fi
  746. AC_SUBST(SS_PERL_CCFLAGS)
  747. AC_SUBST(SS_PERL_LDFLAGS)
  748. AC_SUBST(SS_PERL_BINARY)
  749. AC_MSG_CHECKING([for perl scripting support])
  750. AC_MSG_RESULT([$SS_PERL_RESULT_MESSAGE])
  751. ])
  752. dnl ###################################################################################################################
  753. dnl ### OPENSSL
  754. dnl ###################################################################################################################
  755. AC_DEFUN([AC_SS_CHECK_OPENSSL],
  756. [
  757. SS_LINK_TO_LIBSSL="false"
  758. SS_SSL_RESULT_MESSAGE=""
  759. SS_ENABLE_SSL_SUPPORT="yes"
  760. AC_ARG_ENABLE(ssl,AC_HELP_STRING([--disable-ssl],[Disable OpenSSL support]),eval "SS_ENABLE_SSL_SUPPORT=$enableval")
  761. if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
  762. AC_MSG_CHECKING([If we can compile and link a small SSL test application])
  763. SS_SAVED_LIBS="$LIBS"
  764. LIBS="-lcrypto -lssl"
  765. AC_TRY_LINK([
  766. #include <openssl/ssl.h>
  767. ],[
  768. SSL_new(0);
  769. ],
  770. eval "SS_ENABLE_SSL_SUPPORT=yes",
  771. eval "SS_ENABLE_SSL_SUPPORT=no"
  772. )
  773. LIBS="$SS_SAVED_LIBS"
  774. if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
  775. AC_MSG_RESULT([yes])
  776. AC_CHECK_HEADER(openssl/ssl.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
  777. AC_CHECK_HEADER(openssl/err.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
  778. AC_CHECK_HEADER(openssl/asn1.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
  779. AC_CHECK_HEADER(openssl/evp.h,SS_DUMMY="yes",SS_ENABLE_SSL_SUPPORT="no")
  780. if test "$SS_ENABLE_SSL_SUPPORT" = "yes"; then
  781. AC_DEFINE([COMPILE_SSL_SUPPORT], 1, [define if you have openssl and want the ssl support in kvirc])
  782. SS_LINK_TO_LIBSSL="true"
  783. SS_BUILD_FLAGS="o$SS_BUILD_FLAGS"
  784. SS_SSL_RESULT_MESSAGE="enabled"
  785. else
  786. SS_SSL_RESULT_MESSAGE="disabled: missing header files"
  787. fi
  788. else
  789. AC_MSG_RESULT([no])
  790. SS_SSL_RESULT_MESSAGE="disabled: failed to compile the test program"
  791. fi
  792. else
  793. SS_SSL_RESULT_MESSAGE="disabled by user"
  794. fi
  795. AC_MSG_CHECKING([for secure connections support])
  796. AC_MSG_RESULT([$SS_SSL_RESULT_MESSAGE])
  797. ])
  798. dnl ###################################################################################################################
  799. dnl ### ESD
  800. dnl ###################################################################################################################
  801. AC_DEFUN([AC_SS_CHECK_ESD],
  802. [
  803. SS_LINK_TO_LIBESD="false"
  804. SS_DISABLE_ESD_SUPPORT="true"
  805. SS_SAVED_LIBS=$LIBS
  806. LIBS="$LIBS -lesd"
  807. AC_CHECK_LIB(esd,esd_play_file,SS_DISABLE_ESD_SUPPORT="false")
  808. LIBS="$SS_SAVED_LIBS"
  809. if test "$SS_DISABLE_ESD_SUPPORT" = "false"; then
  810. SS_DISABLE_ESD_SUPPORT="true"
  811. AC_CHECK_HEADER(esd.h,SS_DISABLE_ESD_SUPPORT="false")
  812. fi
  813. AC_MSG_CHECKING([for Esound daemon support])
  814. AC_ARG_WITH(esd-support, [ --without-esd-support Disable Esound daemon support],SS_DISABLE_ESD_SUPPORT="true")
  815. if test "$SS_DISABLE_ESD_SUPPORT" = "true"; then
  816. AC_MSG_RESULT(disabled by user)
  817. else
  818. AC_MSG_RESULT(yes: have libs and headers)
  819. AC_DEFINE([COMPILE_ESD_SUPPORT], 1, [define if you want to enable the Esound daemon support])
  820. SS_LINK_TO_LIBESD="true"
  821. SS_BUILD_FLAGS="e$SS_BUILD_FLAGS"
  822. fi
  823. ])
  824. dnl ###################################################################################################################
  825. dnl ### ZLIB
  826. dnl ###################################################################################################################
  827. AC_DEFUN([AC_SS_CHECK_ZLIB],
  828. [
  829. SS_LINK_TO_LIBZLIB="no"
  830. SS_DISABLE_ZLIB_SUPPORT="true"
  831. SS_SAVED_LIBS=$LIBS
  832. LIBS="$LIBS -lz"
  833. AC_CHECK_LIB(z,gzopen,SS_DISABLE_ZLIB_SUPPORT="false")
  834. LIBS="$SS_SAVED_LIBS"
  835. if test "$SS_DISABLE_ZLIB_SUPPORT" = "false"; then
  836. SS_DISABLE_ZLIB_SUPPORT="true"
  837. AC_CHECK_HEADER(zlib.h,SS_DISABLE_ZLIB_SUPPORT="false")
  838. fi
  839. AC_MSG_CHECKING([for GZip support])
  840. AC_ARG_WITH(zlib-support, [ --without-zlib-support Disable ZLIB support],SS_DISABLE_ZLIB_SUPPORT="true")
  841. if test "$SS_DISABLE_ZLIB_SUPPORT" = "true"; then
  842. AC_MSG_RESULT(disabled by user)
  843. else
  844. AC_MSG_RESULT(yes: have libs and headers)
  845. AC_DEFINE([COMPILE_ZLIB_SUPPORT], 1, [define if you want to enable the ZLib library support])
  846. SS_LINK_TO_LIBZ="yes"
  847. SS_BUILD_FLAGS="Z$SS_BUILD_FLAGS"
  848. fi
  849. ])
  850. dnl ###################################################################################################################
  851. dnl ### XSS
  852. dnl ###################################################################################################################
  853. AC_DEFUN([AC_SS_CHECK_XSS],
  854. [
  855. SS_LINK_TO_XSS="no"
  856. SS_COMPILE_XSS_SUPPORT="false"
  857. SS_SAVED_LIBS=$LIBS
  858. LIBS="$LIBS -lXss"
  859. AC_CHECK_LIB(Xss,XScreenSaverAllocInfo,SS_COMPILE_XSS_SUPPORT="true")
  860. LIBS="$SS_SAVED_LIBS"
  861. AC_MSG_CHECKING([for Xss support])
  862. if test "$SS_COMPILE_XSS_SUPPORT" = "false"; then
  863. AC_MSG_RESULT(disabled)
  864. else
  865. AC_MSG_RESULT(yes: lib is ok)
  866. AC_DEFINE([COMPILE_XSS_SUPPORT], 1, [define if you want to enable the ZLib library support])
  867. SS_LINK_TO_XSS="yes"
  868. SS_BUILD_FLAGS="$SS_BUILD_FLAGS"
  869. fi
  870. ])
  871. dnl ###################################################################################################################
  872. dnl ### Audiofile library
  873. dnl ###################################################################################################################
  874. AC_DEFUN([AC_SS_CHECK_AUDIOFILE],
  875. [
  876. SS_LINK_TO_LIBAUDIOFILE="false"
  877. SS_DISABLE_AUDIOFILE_SUPPORT="true"
  878. SS_SAVED_LIBS=$LIBS
  879. LIBS="$LIBS -laudiofile"
  880. AC_CHECK_LIB(audiofile,afOpenFile,SS_DISABLE_AUDIOFILE_SUPPORT="false")
  881. if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then
  882. SS_DISABLE_AUDIOFILE_SUPPORT="true"
  883. AC_CHECK_LIB(audiofile,afGetVirtualFrameSize,SS_DISABLE_AUDIOFILE_SUPPORT="false")
  884. fi
  885. LIBS="$SS_SAVED_LIBS"
  886. if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "false"; then
  887. SS_DISABLE_AUDIOFILE_SUPPORT="true"
  888. AC_CHECK_HEADER(audiofile.h,SS_DISABLE_AUDIOFILE_SUPPORT="false")
  889. fi
  890. AC_MSG_CHECKING([for audiofile support])
  891. if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then
  892. AC_MSG_RESULT(missing header or libs or wrong version)
  893. else
  894. if test "$SS_HAS_OSS_SUPPORT" = "false"; then
  895. SS_DISABLE_AUDIOFILE_SUPPORT="true"
  896. AC_MSG_RESULT(no oss support at all)
  897. else
  898. AC_ARG_WITH(af-support, [ --without-af-support Disable Audiofile library for playing files to OSS support], SS_DISABLE_AUDIOFILE_SUPPORT="true")
  899. if test "$SS_DISABLE_AUDIOFILE_SUPPORT" = "true"; then
  900. AC_MSG_RESULT(disabled by user)
  901. else
  902. AC_MSG_RESULT(yes: have libs and headers)
  903. AC_DEFINE([COMPILE_AUDIOFILE_SUPPORT], 1, [define if you want to enable the Audiofile library support])
  904. SS_LINK_TO_LIBAUDIOFILE="true"
  905. SS_BUILD_FLAGS="f$SS_BUILD_FLAGS"
  906. fi
  907. fi
  908. fi
  909. ])
  910. dnl ###################################################################################################################
  911. dnl ### ARTS
  912. dnl ###################################################################################################################
  913. AC_DEFUN([AC_SS_CHECK_ARTS],
  914. [
  915. SS_LINK_TO_LIBARTS="false"
  916. SS_DISABLE_ARTS_SUPPORT="false"
  917. AC_MSG_CHECKING([if Arts support is requested])
  918. AC_ARG_WITH(arts-support, [ --without-arts-support Disable Arts daemon support],SS_DISABLE_ARTS_SUPPORT="true")
  919. if test "$SS_KDE_REQUESTED" = "yes"; then
  920. if test "$SS_DISABLE_ARTS_SUPPORT" = "true"; then
  921. AC_MSG_RESULT(disabled by user)
  922. else
  923. AC_MSG_RESULT([yes])
  924. AC_MSG_CHECKING(if we can compile a simple Arts application)
  925. AC_LANG_CPLUSPLUS
  926. ss_save_CPPFLAGS="$CPPFLAGS"
  927. ss_save_CXXFLAGS="$CXXFLAGS"
  928. ss_save_LDFLAGS="$LDFLAGS"
  929. ss_save_LIBS="$LIBS"
  930. CPPFLAGS="-I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR $CPPFLAGS $X_CFLAGS"
  931. CXXFLAGS="-O2 -Wall $CXXFLAGS"
  932. LIBS="-L$SS_KDE_LIBDIR -L$SS_X_LIBDIR $SS_X_LDFLAGS $SS_X_LIBLINK -L$SS_QT3_LIBDIR $LIBS -lsoundserver_idl -ltdecore -lmcop -l$SS_QTLIB_NAME -Wl,-rpath $SS_KDE_LIBDIR"
  933. if test "$SS_LINK_TO_LIBDL" = "yes"; then
  934. LIBS="$LIBS -ldl";
  935. fi
  936. LDFLAGS="-s $LDFLAGS"
  937. AC_TRY_LINK([
  938. #include <arts/soundserver.h>
  939. ],[
  940. Arts::Dispatcher * d = new Arts::Dispatcher();
  941. Arts::SimpleSoundServer *server = new Arts::SimpleSoundServer(Arts::Reference("global:Arts_SimpleSoundServer"));
  942. ],
  943. SS_ARTS_LINKED_OK="TRUE",
  944. SS_ARTS_LINKED_OK="FALSE"
  945. )
  946. if test "$SS_ARTS_LINKED_OK" = "FALSE"; then
  947. AC_MSG_RESULT(failed)
  948. else
  949. AC_MSG_RESULT(success)
  950. AC_DEFINE([COMPILE_ARTS_SUPPORT], 1, [define if you want to enable the Arts daemon support])
  951. SS_LINK_TO_LIBARTS="true"
  952. SS_BUILD_FLAGS="r$SS_BUILD_FLAGS"
  953. fi
  954. LIBS="$ss_save_LIBS"
  955. LDFLAGS="$ss_save_LDFLAGS"
  956. CXXFLAGS="$ss_save_CXXFLAGS"
  957. CPPFLAGS="$ss_save_CPPFLAGS"
  958. fi
  959. else
  960. SS_DISABLE_ARTS_SUPPORT="true"
  961. AC_MSG_RESULT([no KDE so no Arts])
  962. fi
  963. ])
  964. dnl ###################################################################################################################
  965. dnl ### INTERFACE ADDRESS STUFF
  966. dnl ###################################################################################################################
  967. AC_DEFUN([AC_SS_CHECK_IFADDR_STUFF],
  968. [
  969. AC_MSG_CHECKING([if we can get interface addresses])
  970. AC_TRY_LINK([
  971. #include <stdio.h>
  972. #include <sys/ioctl.h>
  973. #include <net/if.h>
  974. #include <netinet/in.h>
  975. #include <arpa/inet.h>
  976. #include <string.h>
  977. ],[
  978. struct ifreq ifr;
  979. int ret;
  980. struct sockaddr * sa;
  981. ret = IFNAMSIZ;
  982. ret = ioctl(ret,SIOCGIFADDR,&ifr);
  983. if(ifr.ifr_name != 0)sa = (struct sockaddr *)&(ifr.ifr_addr);
  984. ],
  985. eval "SS_DISABLE_IFADDR=false"
  986. ,
  987. eval "SS_DISABLE_IFADDR=true"
  988. )
  989. if test "$SS_DISABLE_IFADDR" = "true"; then
  990. AC_MSG_RESULT("no")
  991. else
  992. AC_MSG_RESULT("yes")
  993. AC_DEFINE([COMPILE_GET_INTERFACE_ADDRESS], 1, [define if you have the SIOCGIFADDR ioctl and the related headers])
  994. fi
  995. ])
  996. dnl ###################################################################################################################
  997. dnl ### PTHREAD
  998. dnl ###################################################################################################################
  999. AC_DEFUN([AC_SS_CHECK_THREAD_STUFF],
  1000. [
  1001. SS_THREAD_LIBLINK=""
  1002. AC_MSG_CHECKING([if you want to use the solaris lthread])
  1003. SS_DO_IT="false"
  1004. AC_ARG_WITH(solaris-lthread, [ --with-solaris-lthread Use the Solaris native libthread],SS_DO_IT="true")
  1005. if test "$SS_DO_IT" = "true"; then
  1006. AC_MSG_RESULT(yes)
  1007. SS_THREAD_LIBLINK="-lthread"
  1008. AC_DEFINE([COMPILE_THREADS_USE_SOLARIS_LIBTHREAD], 1, [define if you want to use the solaris libthread])
  1009. else
  1010. AC_MSG_RESULT(no)
  1011. AC_MSG_CHECKING([if you want to use freebsd native pthread support])
  1012. SS_DO_IT="false"
  1013. AC_ARG_WITH(freebsd-pthread, [ --with-freebsd-pthread Use the FreeBSD native libc_r for threading],SS_DO_IT="true")
  1014. if test "$SS_DO_IT" = "true"; then
  1015. AC_MSG_RESULT(yes)
  1016. SS_THREAD_LIBLINK="-pthread"
  1017. AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
  1018. else
  1019. AC_MSG_RESULT(no..using lpthread)
  1020. SS_THREAD_LIBLINK="-lpthread"
  1021. AC_DEFINE([COMPILE_THREADS_USE_POSIX], 1, [define if you want to use the pthreads library])
  1022. fi
  1023. AC_MSG_CHECKING([if your pthread implementation works])
  1024. SS_DO_IT="false"
  1025. AC_ARG_WITH(no-pthread-check, [ --with-no-pthread-check Do not check if pthreads stuff compiles],SS_DO_IT="true")
  1026. if test "$SS_DO_IT" = "true"; then
  1027. AC_MSG_RESULT(yes, trusting you)
  1028. else
  1029. SS_SAVE_LIBS="$LIBS"
  1030. LIBS="$SS_THREAD_LIBLINK"
  1031. AC_TRY_LINK([
  1032. #include <pthread.h>
  1033. ],[
  1034. pthread_mutex_lock(0);
  1035. ],
  1036. eval "SS_PTHREAD_OK=yes"
  1037. ,
  1038. eval "SS_PTHREAD_OK=no"
  1039. )
  1040. LIBS="$SS_SAVE_LIBS"
  1041. if test "$SS_PTHREAD_OK" = "yes"; then
  1042. AC_MSG_RESULT(yes, it seems to)
  1043. else
  1044. AC_MSG_RESULT(["FAILED"])
  1045. AC_SS_SET_REDINK
  1046. if test "$SS_THREAD_LIBLINK" = "-pthread"; then
  1047. echo "################################################################################"
  1048. echo "### CONFIGURE ERROR:"
  1049. echo "### Failed to compile the pthread test program."
  1050. echo "### You have specified to use the native FreeBSD libc_r for threading"
  1051. echo "### but it looks that this does not work."
  1052. echo "### Make sure that you have libc_r floating around your system"
  1053. echo "### and that the -pthread special gcc flag works."
  1054. echo "### (You need to use the native FreeBSD gcc compiler for this to work)"
  1055. echo "################################################################################"
  1056. else
  1057. echo "################################################################################"
  1058. echo "### CONFIGURE ERROR:"
  1059. echo "### Failed to compile the pthread test program."
  1060. echo "### It looks that you either don't have libpthread installed or"
  1061. echo "### it is not reachable by the linker."
  1062. echo "### Make sure that libpthread is in /lib or /usr/lib."
  1063. echo "### If you're on solaris you might try the --with-solaris-lthread"
  1064. echo "### configure option. If you're on FreeBSD you should use"
  1065. echo "### --with-freebsd-pthread."
  1066. echo "### Good luck :)"
  1067. echo "################################################################################"
  1068. fi
  1069. AC_SS_SET_NORMALINK
  1070. AC_MSG_ERROR(["This was fatal...aborting"])
  1071. fi
  1072. fi
  1073. fi
  1074. ])
  1075. dnl ###################################################################################################################
  1076. dnl ### X
  1077. dnl ###################################################################################################################
  1078. AC_DEFUN([AC_SS_FIND_X],
  1079. [
  1080. SS_DISABLE_X_SUPPORT="false"
  1081. AC_MSG_CHECKING([if you want to ignore X at all])
  1082. AC_ARG_ENABLE(x-support, [ --disable-x-support Ignore X Windows completely],SS_DISABLE_X_SUPPORT="true")
  1083. if test $SS_DISABLE_X_SUPPORT = "true"; then
  1084. AC_DEFINE([COMPILE_NO_X], 1, [define if you want to ignore X Windows completely])
  1085. SS_X_INCDIR="/usr/include"
  1086. SS_X_LIBDIR="/usr/lib"
  1087. SS_X_LDFLAGS=""
  1088. SS_X_CPPFLAGS=""
  1089. SS_X_LIBLINK=""
  1090. AC_MSG_RESULT(yes)
  1091. else
  1092. AC_MSG_RESULT(no, proceeding with checks)
  1093. AC_PATH_XTRA
  1094. if test -n "$no_x"; then
  1095. AC_SS_SET_REDINK
  1096. echo "################################################################################"
  1097. echo "### CONFIGURE ERROR:"
  1098. echo "### Can not find the X libraries."
  1099. echo "### Make sure that X is installed on your system and try to run configure again,"
  1100. echo "### this time passing the --x-includes and --x-libraries options."
  1101. echo "### You may also take a look at the config.log file in this directory,"
  1102. echo "### that will tell you which checks have failed and maybe more about the"
  1103. echo "### reason of the failure."
  1104. echo "###"
  1105. echo "### If you use an environment that does not require X support such as Qt-Mac"
  1106. echo "### you may try to rerun configure with --disable-x-support"
  1107. echo "################################################################################"
  1108. AC_SS_SET_NORMALINK
  1109. AC_MSG_ERROR([This was a fatal one...aborting])
  1110. else
  1111. # Set the X include and lib dir
  1112. SS_X_INCDIR="$x_includes"
  1113. SS_X_LIBDIR="$x_libraries"
  1114. SS_X_LIBLINK="-lX11 -lXext"
  1115. if test -z "$SS_X_INCDIR"; then
  1116. # Ops... X headers not found ?
  1117. AC_TRY_COMPILE([
  1118. #include <X11/Xlib.h>
  1119. ],[
  1120. Display * d = XOpenDisplay(0);
  1121. XCloseDisplay(d);
  1122. ],
  1123. eval "ss_x_incdir_found=yes"
  1124. ,
  1125. eval "ss_x_incdir_found=no"
  1126. )
  1127. if test "$ss_x_incdir_found" = "no"; then
  1128. AC_SS_SET_REDINK
  1129. echo "################################################################################"
  1130. echo "### CONFIGURE ERROR:"
  1131. echo "### Can not find the X headers."
  1132. echo "### Possible reasons:"
  1133. echo "### 1) You miss the X server development files (Xlib.h for example)"
  1134. echo "###"
  1135. echo "### 2) Autoconf/Automake wasn't able to find the headers"
  1136. echo "### for some ugly reason."
  1137. echo "###"
  1138. echo "### You might try looking for a file named Xlib.h in your hard-drive"
  1139. echo "### and try passing the --x-includes option to ./configure"
  1140. echo "### Remember that if you find Xlib.h in /somepath/include/X11/Xlib.h"
  1141. echo "### Then you must pass --x-includes=/somepath/include to ./configure"
  1142. echo "### For example, my Xlib.h is in /usr/X11R6/include/X11/Xlib.h"
  1143. echo "### then i would try: ./configure --x-includes=/usr/X11R6/include"
  1144. echo "### If you can't find Xlib.h on your hard drive then install the X-devel"
  1145. echo "### package from your distribution."
  1146. echo "### If Xlib.h is there and --x-includes doesn't help, well , there is something"
  1147. echo "### wrong with X , autoconf or automake."
  1148. echo "### You may also take a look at the config.log file in this directory,"
  1149. echo "### that will tell you which checks have failed and maybe more about the"
  1150. echo "### reason of the failure."
  1151. echo "###"
  1152. echo "### If you use an environment that does not require X support such as Qt-Mac"
  1153. echo "### you may try to rerun configure with --disable-x-support"
  1154. echo "################################################################################"
  1155. AC_SS_SET_NORMALINK
  1156. AC_MSG_ERROR([This was a fatal one...aborting])
  1157. else
  1158. # We can compile X programs without any additional path... use a dummy include path then
  1159. # Should we print a warning ?
  1160. SS_X_INCDIR="/usr/include"
  1161. fi
  1162. fi
  1163. if test -z "$SS_X_LIBDIR"; then
  1164. # Ops... X libs not found ?
  1165. SS_SAVE_LIBS="$LIBS"
  1166. SS_SAVE_CFLAGS="$CFLAGS"
  1167. SS_SAVE_CPPFLAGS="$CPPFLAGS"
  1168. SS_SAVE_CXXFLAGS="$CXXFLAGS"
  1169. CFLAGS="-I$SS_X_INCDIR"
  1170. CPPFLAGS="$CFLAGS"
  1171. CXXFLAGS="$CFLAGS"
  1172. LIBS="$SS_X_LIBLINK"
  1173. AC_TRY_LINK([
  1174. #include <X11/Xlib.h>
  1175. ],[
  1176. Display * d = XOpenDisplay(0);
  1177. XCloseDisplay(d);
  1178. ],
  1179. eval "ss_x_libdir_found=yes"
  1180. ,
  1181. eval "ss_x_libdir_found=no"
  1182. )
  1183. LIBS="$SS_SAVE_LIBS"
  1184. CFLAGS="$SS_SAVE_CFLAGS"
  1185. CPPFLAGS="$SS_SAVE_CPPFLAGS"
  1186. CXXFLAGS="$SS_SAVE_CXXFLAGS"
  1187. if test "$ss_x_libdir_found" = "no"; then
  1188. AC_SS_SET_REDINK
  1189. echo "################################################################################"
  1190. echo "### CONFIGURE ERROR:"
  1191. echo "### Can not find the X libraries."
  1192. echo "### Possible reasons:"
  1193. echo "### 1) You have no X server : KVIrc can't run on this system"
  1194. echo "###"
  1195. echo "### 2) Autoconf/Automake wasn't able to find the libraries"
  1196. echo "### for some ugly reason."
  1197. echo "###"
  1198. echo "### You might try looking for a file named libX11.so in your hard-drive"
  1199. echo "### and try passing the --x-libraries option to ./configure"
  1200. echo "### Remember that if you find libX11.so in /somepath/lib/libX11.so"
  1201. echo "### Then you must pass --x-libraries=/somepath/lib to ./configure"
  1202. echo "### For example, my libX11.so is in /usr/X11R6/lib/libX11.so"
  1203. echo "### then i would try: ./configure --x-libraries=/usr/X11R6/lib"
  1204. echo "### If you can't find libX11.so on your hard drive then install the X server"
  1205. echo "### package from your distribution."
  1206. echo "### If libX11.so is there and --x-libraries doesn't help, well , there is something"
  1207. echo "### wrong with X , autoconf or automake."
  1208. echo "### You may also take a look at the config.log file in this directory,"
  1209. echo "### that will tell you which checks have failed and maybe more about the"
  1210. echo "### reason of the failure."
  1211. echo "###"
  1212. echo "### If you use an environment that does not require X support such as Qt-Mac"
  1213. echo "### you may try to rerun configure with --disable-x-support"
  1214. echo "################################################################################"
  1215. AC_SS_SET_NORMALINK
  1216. AC_MSG_ERROR([This was a fatal one...aborting])
  1217. else
  1218. # We can link X programs without any additional path... use a dummy lib path then
  1219. # Should we print a warning ?
  1220. SS_X_LIBDIR="/usr/lib"
  1221. fi
  1222. fi
  1223. # Add any extra libs needed
  1224. SS_X_LDFLAGS=""
  1225. if test -n "$X_PRE_LIBS"; then
  1226. SS_X_LDFLAGS="$X_PRE_LIBS $SS_X_LDFLAGS"
  1227. fi
  1228. if test -n "$X_EXTRA_LIBS"; then
  1229. SS_X_LDFLAGS="$SS_X_LDFLAGS $X_EXTRA_LIBS"
  1230. fi
  1231. if test -n "$X_LIBS"; then
  1232. SS_X_LDFLAGS="$SS_X_LDFLAGS $X_LIBS"
  1233. fi
  1234. # Add any extra gcc flags
  1235. SS_X_CPPFLAGS=$X_CFLAGS
  1236. fi
  1237. fi
  1238. ])
  1239. dnl ###################################################################################################################
  1240. dnl ### QT
  1241. dnl ###################################################################################################################
  1242. AC_DEFUN([AC_SS_FIND_QT],
  1243. [
  1244. AC_ARG_ENABLE(qt-check,
  1245. AC_HELP_STRING([--disable-qt-check],[Do not check if Qt and X compile]),
  1246. SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_QTX_COMPILE="NOTGIVEN")
  1247. AC_ARG_ENABLE(qt4,
  1248. AC_HELP_STRING([--enable-qt4],[Enable WORK IN PROGRESS Qt4 support]),
  1249. SS_USE_QT4="$withval",SS_USE_QT4="no")
  1250. if test "$SS_USE_QT4" = "no"; then
  1251. AC_SS_FIND_QT3_NAME
  1252. AC_SS_FIND_QT3_GENERAL_DIR
  1253. AC_SS_FIND_QT3_LIBRARY_DIR
  1254. AC_SS_FIND_QT3_INCLUDE_DIR
  1255. AC_SS_FIND_QT3_MOC
  1256. AC_SS_FIND_QT3_MT
  1257. if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then
  1258. AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3
  1259. fi
  1260. else
  1261. AC_SS_FIND_QT4_GENERAL_DIR
  1262. AC_SS_FIND_QT4_LIBRARY_DIR
  1263. AC_SS_FIND_QT4_INCLUDE_DIR
  1264. AC_SS_FIND_QT4_MOC
  1265. if test "$SS_CHECK_QTX_COMPILE" = "NOTGIVEN"; then
  1266. AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4
  1267. fi
  1268. fi
  1269. ])
  1270. AC_DEFUN([AC_SS_FIND_QT3_NAME],
  1271. [
  1272. AC_MSG_CHECKING([for the Qt library name])
  1273. AC_ARG_WITH(qt-name,[ --with-qt-name=NAME Use NAME instead of \"qt\" as Qt library name],SS_QTLIB_NAME="$withval",SS_QTLIB_NAME="qt")
  1274. AC_MSG_RESULT("$SS_QTLIB_NAME")
  1275. ])
  1276. AC_DEFUN([AC_SS_FIND_QT3_GENERAL_DIR],
  1277. [
  1278. AC_MSG_CHECKING([for the general Qt3.x directory])
  1279. ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /"
  1280. ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde"
  1281. if test -n "$HOME"; then
  1282. ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib"
  1283. fi
  1284. if test -n "$QTDIR"; then
  1285. ss_qt_general_test_dirs="$QTDIR $ss_qt_general_test_dirs"
  1286. fi
  1287. ss_qt_general_test_path_suffix="qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1288. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1289. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED"
  1290. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1291. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED$SS_QT3_PATCH_LEVEL_REQUIRED"
  1292. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1293. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1294. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED"
  1295. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1296. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED$SS_QT3_MINOR_VERSION_REQUIRED"
  1297. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT3_MAJOR_VERSION_REQUIRED"
  1298. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1299. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT3_MAJOR_VERSION_REQUIRED"
  1300. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib"
  1301. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ."
  1302. AC_SS_FIND_FILE_PATH_EXT($SS_TQT3_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT3_GENERAL_DIR)
  1303. if test "$SS_QT3_GENERAL_DIR" = "FAILED"; then
  1304. AC_SS_FIND_FILE_PATH_EXT($SS_QT3_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT3_GENERAL_DIR)
  1305. if test "$SS_QT3_GENERAL_DIR" = "FAILED"; then
  1306. AC_MSG_RESULT([failed...continuing with normal checks])
  1307. unset SS_QT3_GENERAL_DIR
  1308. else
  1309. AC_MSG_RESULT([Seems to be $SS_QT3_GENERAL_DIR])
  1310. fi
  1311. else
  1312. AC_MSG_RESULT([Seems to be $SS_QT3_GENERAL_DIR])
  1313. fi
  1314. ])
  1315. AC_DEFUN([AC_SS_FIND_QT4_GENERAL_DIR],
  1316. [
  1317. AC_MSG_CHECKING([for the general Qt4.x directory])
  1318. ss_qt_general_test_dirs="/usr/local /usr /usr/X11R6 /usr/lib /opt /opt/kde /kde /usr/kde /usr/build /usr/src /usr/local/lib /"
  1319. ss_qt_general_test_dirs="$ss_qt_general_test_dirs /usr/local/kde /usr/opt/kde /usr/lib/qt4 /usr/local/lib/qt4"
  1320. if test -n "$HOME"; then
  1321. ss_qt_general_test_dirs="$ss_qt_general_test_dirs $HOME $HOME/lib"
  1322. fi
  1323. if test -n "$QTDIR"; then
  1324. ss_qt_general_test_dirs="$QTDIR $ss_qt_general_test_dirs"
  1325. fi
  1326. ss_qt_general_test_path_suffix="qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
  1327. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
  1328. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED"
  1329. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
  1330. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED$SS_QT4_PATCH_LEVEL_REQUIRED"
  1331. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
  1332. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
  1333. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED"
  1334. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
  1335. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED$SS_QT4_MINOR_VERSION_REQUIRED"
  1336. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt$SS_QT4_MAJOR_VERSION_REQUIRED"
  1337. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt.$SS_QT4_MAJOR_VERSION_REQUIRED"
  1338. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt-$SS_QT4_MAJOR_VERSION_REQUIRED"
  1339. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix lib"
  1340. ss_qt_general_test_path_suffix="$ss_qt_general_test_path_suffix qt ."
  1341. AC_SS_FIND_FILE_PATH_EXT($SS_QT4_GENERAL_FILE_TO_SEARCH,$ss_qt_general_test_dirs,$ss_qt_general_test_path_suffix,SS_QT4_GENERAL_DIR)
  1342. if test "$SS_QT4_GENERAL_DIR" = "FAILED"; then
  1343. AC_MSG_RESULT([failed...continuing with normal checks])
  1344. unset SS_QT4_GENERAL_DIR
  1345. else
  1346. AC_MSG_RESULT([Seems to be $SS_QT4_GENERAL_DIR])
  1347. fi
  1348. ])
  1349. AC_DEFUN([AC_SS_FIND_QT3_INCLUDE_DIR],
  1350. [
  1351. AC_ARG_WITH(qt-include-dir,[ --with-qt-include-dir path to the Qt 3.x headers ],SS_QT3_INCDIR="$withval",SS_QT3_INCDIR="NOTGIVEN")
  1352. if test "$SS_QT3_INCDIR" = "NOTGIVEN"; then
  1353. AC_MSG_CHECKING([for the Qt 3.x header files])
  1354. ss_qt_include_test_dirs="$SS_QT3_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
  1355. test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs"
  1356. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/tqt3 /usr/include/qt3 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
  1357. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/tqt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT3_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED"
  1358. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/tqt$SS_QT3_MAJOR_VERSION_REQUIRED /include/qt$SS_QT3_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT3_MAJOR_VERSION_REQUIRED"
  1359. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT3_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
  1360. AC_SS_FIND_FILE_PATH($SS_TQT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR)
  1361. if test "$SS_QT3_INCDIR" = "FAILED"; then
  1362. AC_SS_FIND_FILE_PATH($SS_QT3_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT3_INCDIR)
  1363. fi
  1364. if test "$SS_QT3_INCDIR" = "FAILED"; then
  1365. dnl HACK HACK HACK
  1366. ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
  1367. test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs"
  1368. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
  1369. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
  1370. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
  1371. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
  1372. AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR)
  1373. SS_QT3_INCDIR="$SS_QT4_INCDIR -I/usr/include/tqt -include tqt.h"
  1374. AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_INCDIR])
  1375. dnl AC_MSG_RESULT([FAILED])
  1376. dnl AC_SS_SET_REDINK
  1377. dnl echo "################################################################################"
  1378. dnl echo "### CONFIGURE ERROR:"
  1379. dnl echo "### Can not find the qt 3.x header files."
  1380. dnl echo "### Make sure that qt is correctly installed on your system,"
  1381. dnl echo "### and the qt version is the one requested by this version of kvirc."
  1382. dnl echo "### Try to run configure again, this time passing the --with-qt-include-dir"
  1383. dnl echo "### option (see ./configure --help)."
  1384. dnl echo "### You may also take a look at the config.log file in this directory,"
  1385. dnl echo "### that will tell you which check has failed and maybe more about the reason"
  1386. dnl echo "### of the failure."
  1387. dnl echo "### If you're feeling that this may be a bug in this configure script"
  1388. dnl echo "### and want to report this to me , please include your configure script,"
  1389. dnl echo "### the config.log file as well as the complete configure output."
  1390. dnl echo "################################################################################"
  1391. dnl AC_SS_SET_NORMALINK
  1392. dnl AC_MSG_ERROR([This was a fatal one...aborting])
  1393. else
  1394. SS_QT3_INCDIR="$SS_QT3_INCDIR -I/usr/include/tqt -include tqt.h"
  1395. AC_MSG_RESULT([found in $SS_QT3_INCDIR])
  1396. fi
  1397. else
  1398. AC_MSG_RESULT([using user supplied path for the Qt 3.x include files $SS_QT3_INCDIR])
  1399. SS_QT3_INCDIR="$SS_QT3_INCDIR -I/usr/include/tqt -include tqt.h"
  1400. fi
  1401. ])
  1402. AC_DEFUN([AC_SS_FIND_QT4_INCLUDE_DIR],
  1403. [
  1404. AC_ARG_WITH(qt4-include-dir,[ --with-qt4-include-dir path to the Qt 4.x headers ],SS_QT4_INCDIR="$withval",SS_QT4_INCDIR="NOTGIVEN")
  1405. if test "$SS_QT4_INCDIR" = "NOTGIVEN"; then
  1406. AC_MSG_CHECKING([for the Qt 4.x header files])
  1407. ss_qt_include_test_dirs="$SS_QT4_GENERAL_DIR/include /include /usr/include /usr/local/include /usr/qt/include /usr/include/qt4 /usr/qt4/include /usr/local/qt/include /usr/X11R6/include /usr/lib/qt/include /usr/lib/qt /usr/include/X11"
  1408. test -n "$QTDIR" && ss_qt_include_test_dirs="$QTDIR/include $QTDIR $ss_qt_include_test_dirs"
  1409. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt /usr/include/qt4 /usr/local/include/qt /include/qt /usr/X11R6/include/qt /usr/build/qt/include"
  1410. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/include/qt-$SS_QT4_MAJOR_VERSION_REQUIRED /usr/local/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
  1411. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /include/qt$SS_QT4_MAJOR_VERSION_REQUIRED /usr/X11R6/include/qt$SS_QT4_MAJOR_VERSION_REQUIRED"
  1412. ss_qt_include_test_dirs="$ss_qt_include_test_dirs /usr/include/X11/qt$SS_QT4_MAJOR_VERSION_REQUIRED /opt/qt /opt/kde/qt"
  1413. AC_SS_FIND_FILE_PATH($SS_QT4_INCLUDE_FILE_TO_SEARCH,$ss_qt_include_test_dirs,SS_QT4_INCDIR)
  1414. if test "$SS_QT4_INCDIR" = "FAILED"; then
  1415. AC_MSG_RESULT([FAILED])
  1416. AC_SS_SET_REDINK
  1417. echo "################################################################################"
  1418. echo "### CONFIGURE ERROR:"
  1419. echo "### Can not find the qt 4.x header files."
  1420. echo "### Make sure that qt is correctly installed on your system,"
  1421. echo "### and the qt version is the one requested by this version of kvirc."
  1422. echo "### Try to run configure again, this time passing the --with-qt4-include-dir"
  1423. echo "### option (see ./configure --help)."
  1424. echo "### You may also take a look at the config.log file in this directory,"
  1425. echo "### that will tell you which check has failed and maybe more about the reason"
  1426. echo "### of the failure."
  1427. echo "### If you're feeling that this may be a bug in this configure script"
  1428. echo "### and want to report this to me , please include your configure script,"
  1429. echo "### the config.log file as well as the complete configure output."
  1430. echo "################################################################################"
  1431. AC_SS_SET_NORMALINK
  1432. AC_MSG_ERROR([This was a fatal one...aborting])
  1433. else
  1434. AC_MSG_RESULT([found in $SS_QT4_INCDIR])
  1435. fi
  1436. else
  1437. AC_MSG_RESULT([using user supplied path for the Qt 4.x include files $SS_QT4_INCDIR])
  1438. fi
  1439. SS_QT4_INCDIRECTORIES="-I$SS_QT4_INCDIR -I$SS_QT4_INCDIR/Qt/ -I$SS_QT4_INCDIR/QtCore/ -I$SS_QT4_INCDIR/QtGui/";
  1440. ])
  1441. AC_DEFUN([AC_SS_FIND_QT3_LIBRARY_DIR],
  1442. [
  1443. AC_ARG_WITH(qt-library-dir,[ --with-qt-library-dir path to the Qt 3.x library ],SS_QT3_LIBDIR="$withval",SS_QT3_LIBDIR="NOTGIVEN")
  1444. if test "$SS_QT3_LIBDIR" = "NOTGIVEN"; then
  1445. AC_MSG_CHECKING([for the Qt library])
  1446. ss_qt_library_test_dirs="$SS_QT3_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
  1447. test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs"
  1448. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
  1449. # NATIVE TQT3
  1450. ss_qt_libs_to_find="libt$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1451. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1452. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1453. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.so"
  1454. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1455. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1456. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1457. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.so"
  1458. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
  1459. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
  1460. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
  1461. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.dylib"
  1462. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
  1463. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
  1464. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
  1465. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.dylib"
  1466. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME-mt.a"
  1467. ss_qt_libs_to_find="$ss_qt_libs_to_find libt$SS_QTLIB_NAME.a"
  1468. AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_TQT3_LIBDIR)
  1469. if test "$SS_TQT3_LIBDIR" != "FAILED"; then
  1470. AC_MSG_RESULT([Native TQt3 detected])
  1471. SS_QTLIB_NAME="tqt"
  1472. fi
  1473. ss_qt_libs_to_find="lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1474. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1475. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1476. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so"
  1477. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1478. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1479. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1480. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.so"
  1481. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
  1482. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
  1483. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
  1484. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.dylib"
  1485. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
  1486. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
  1487. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
  1488. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.dylib"
  1489. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.a"
  1490. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME.a"
  1491. AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT3_LIBDIR)
  1492. if test "$SS_QT3_LIBDIR" = "FAILED"; then
  1493. dnl HACK HACK HACK
  1494. AC_MSG_CHECKING([for the Qt 4.x libraries])
  1495. ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
  1496. test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs"
  1497. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
  1498. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4"
  1499. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib"
  1500. ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
  1501. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
  1502. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED"
  1503. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so"
  1504. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib"
  1505. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib"
  1506. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib"
  1507. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a"
  1508. AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR)
  1509. SS_QT3_LIBDIR="$SS_QT4_LIBDIR"
  1510. SS_QTLIB_NAME="tqt"
  1511. AC_MSG_RESULT([TQt4 detected--Qt4 found in $SS_QT3_LIBDIR])
  1512. dnl AC_MSG_RESULT([FAILED])
  1513. dnl AC_SS_SET_REDINK
  1514. dnl echo "################################################################################"
  1515. dnl echo "### CONFIGURE ERROR:"
  1516. dnl echo "### Can not find the qt 3.x library file."
  1517. dnl echo "### Make sure that qt is correctly installed on your system,"
  1518. dnl echo "### and the qt version is the one requested by this version of kvirc."
  1519. dnl echo "### (Usually a greater version is OK too)"
  1520. dnl echo "### Try to run configure again, this time passing the --with-qt-library-dir"
  1521. dnl echo "### option (see ./configure --help)."
  1522. dnl echo "### You may also take a look at the config.log file in this directory,"
  1523. dnl echo "### that will tell you which check has failed and maybe more about the reason"
  1524. dnl echo "### of the failure."
  1525. dnl echo "### If you're feeling that this may be a bug in this configure script"
  1526. dnl echo "### and want to report this to me , please include your configure script,"
  1527. dnl echo "### the config.log file as well as the complete configure output."
  1528. dnl echo "################################################################################"
  1529. dnl AC_SS_SET_NORMALINK
  1530. dnl AC_MSG_ERROR([This was a fatal one...aborting])
  1531. else
  1532. AC_MSG_RESULT([TQt3 found in $SS_QT3_LIBDIR])
  1533. fi
  1534. else
  1535. AC_MSG_RESULT([using user supplied path for the Qt library $SS_QT3_LIBDIR])
  1536. fi
  1537. ])
  1538. AC_DEFUN([AC_SS_FIND_QT4_LIBRARY_DIR],
  1539. [
  1540. AC_ARG_WITH(qt4-library-dir,[ --with-qt4-library-dir path to the Qt 4.x library ],SS_QT4_LIBDIR="$withval",SS_QT4_LIBDIR="NOTGIVEN")
  1541. if test "$SS_QT4_LIBDIR" = "NOTGIVEN"; then
  1542. AC_MSG_CHECKING([for the Qt 4.x libraries])
  1543. ss_qt_library_test_dirs="$SS_QT4_GENERAL_DIR/lib /lib /usr/lib /usr/local/lib /usr/qt/lib /usr/local/qt/lib /usr/X11R6/lib /usr/lib/qt/lib /usr/lib/qt /usr/local/lib/qt/lib"
  1544. test -n "$QTDIR" && ss_qt_library_test_dirs="$QTDIR/lib $QTDIR $ss_qt_library_test_dirs"
  1545. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/local/lib/qt /usr/X11R6/lib/qt /usr/build/qt/lib /opt/lib /opt/qt/lib"
  1546. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/lib/qt4 /usr/local/lib/qt4 /usr/X11R6/lib/qt4"
  1547. ss_qt_library_test_dirs="$ss_qt_library_test_dirs /usr/build/qt4/lib /opt/qt4/lib"
  1548. ss_qt_libs_to_find="libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.$SS_QT4_PATCH_LEVEL_REQUIRED"
  1549. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED"
  1550. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED"
  1551. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so"
  1552. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.$SS_QT4_MINOR_VERSION_REQUIRED.dylib"
  1553. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.$SS_QT4_MAJOR_VERSION_REQUIRED.dylib"
  1554. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.dylib"
  1555. ss_qt_libs_to_find="$ss_qt_libs_to_find libQtCore.so.a"
  1556. AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$ss_qt_library_test_dirs,SS_QT4_LIBDIR)
  1557. if test "$SS_QT4_LIBDIR" = "FAILED"; then
  1558. AC_MSG_RESULT([FAILED])
  1559. AC_SS_SET_REDINK
  1560. echo "################################################################################"
  1561. echo "### CONFIGURE ERROR:"
  1562. echo "### Can not find the qt 4.x library files."
  1563. echo "### Make sure that qt is correctly installed on your system,"
  1564. echo "### and the qt version is the one requested by this version of kvirc."
  1565. echo "### (Usually a greater version is OK too)"
  1566. echo "### Try to run configure again, this time passing the --with-qt4-library-dir"
  1567. echo "### option (see ./configure --help)."
  1568. echo "### You may also take a look at the config.log file in this directory,"
  1569. echo "### that will tell you which check has failed and maybe more about the reason"
  1570. echo "### of the failure."
  1571. echo "### If you're feeling that this may be a bug in this configure script"
  1572. echo "### and want to report this to me , please include your configure script,"
  1573. echo "### the config.log file as well as the complete configure output."
  1574. echo "################################################################################"
  1575. AC_SS_SET_NORMALINK
  1576. AC_MSG_ERROR([This was a fatal one...aborting])
  1577. else
  1578. AC_MSG_RESULT([found in $SS_QT4_LIBDIR])
  1579. fi
  1580. else
  1581. AC_MSG_RESULT([using user supplied path for the Qt 4.x library $SS_QT4_LIBDIR])
  1582. fi
  1583. ])
  1584. AC_DEFUN([AC_SS_FIND_QT3_MOC],
  1585. [
  1586. AC_ARG_WITH(qt-moc,[ --with-qt-moc filename of the Qt 3.x meta object compiler ],SS_QT3_MOC="$withval",SS_QT3_MOC="NOTGIVEN")
  1587. if test "$SS_QT3_MOC" = "NOTGIVEN"; then
  1588. AC_MSG_CHECKING([for the Qt 3.x tmoc])
  1589. unset SS_QT3_MOC
  1590. ss_moc_test_dirs="$QTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin"
  1591. if test -n "$SS_QT3_GENERAL_DIR"; then
  1592. ss_moc_test_dirs="$SS_QT3_GENERAL_DIR/bin $ss_moc_test_dirs"
  1593. fi
  1594. AC_SS_FIND_FILE_PATH(tmoc,$ss_moc_test_dirs,SS_QT3_MOC)
  1595. if test "$SS_QT3_MOC" = "FAILED"; then
  1596. AC_MSG_RESULT([FAILED])
  1597. AC_SS_SET_REDINK
  1598. echo "################################################################################"
  1599. echo "### CONFIGURE ERROR:"
  1600. echo "### The Qt meta object compiler can not be found."
  1601. echo "### Make sure that qt is correctly installed on your system, it is on your path,"
  1602. echo "### and the qt version is the one requested by this version of kvirc."
  1603. echo "### Try to run configure again, this time passing the --with-qt-moc"
  1604. echo "### option (see ./configure --help)."
  1605. echo "### You may also take a look at the config.log file in this directory,"
  1606. echo "### that will tell you which check has failed and maybe more about the reason"
  1607. echo "### of the failure."
  1608. echo "### If you're feeling that this may be a bug in this configure script"
  1609. echo "### and want to report this to me , please include your configure script,"
  1610. echo "### the config.log file as well as the complete configure output."
  1611. echo "################################################################################"
  1612. AC_SS_SET_NORMALINK
  1613. AC_MSG_ERROR([This was a fatal one...aborting])
  1614. else
  1615. SS_QT3_MOC="$SS_QT3_MOC/tmoc"
  1616. AC_MSG_RESULT([found as $SS_QT3_MOC])
  1617. fi
  1618. else
  1619. AC_MSG_RESULT([trusting you: using $SS_QT3_MOC])
  1620. fi
  1621. ])
  1622. AC_DEFUN([AC_SS_FIND_QT4_MOC],
  1623. [
  1624. AC_ARG_WITH(qt4-moc,[ --with-qt4-moc filename of the Qt 4.x meta object compiler ],SS_QT4_MOC="$withval",SS_QT4_MOC="NOTGIVEN")
  1625. if test "$SS_QT4_MOC" = "NOTGIVEN"; then
  1626. AC_MSG_CHECKING([for the Qt 4.x moc])
  1627. unset SS_QT4_MOC
  1628. ss_moc_test_dirs="$QTDIR/bin $PATH /usr/bin /bin /usr/local/bin /usr/X11R6/bin /usr/lib/qt/bin /usr/local/qt/bin /usr/X11R6/qt/bin /usr/qt/bin /usr/build/qt/bin"
  1629. if test -n "$SS_QT4_GENERAL_DIR"; then
  1630. ss_moc_test_dirs="$SS_QT4_GENERAL_DIR/bin $ss_moc_test_dirs"
  1631. fi
  1632. AC_SS_FIND_FILE_PATH(moc,$ss_moc_test_dirs,SS_QT4_MOC)
  1633. if test "$SS_QT4_MOC" = "FAILED"; then
  1634. AC_MSG_RESULT([FAILED])
  1635. AC_SS_SET_REDINK
  1636. echo "################################################################################"
  1637. echo "### CONFIGURE ERROR:"
  1638. echo "### The Qt 4.x meta object compiler can not be found."
  1639. echo "### Make sure that qt is correctly installed on your system, it is on your path,"
  1640. echo "### and the qt version is the one requested by this version of kvirc."
  1641. echo "### In particular you should make sure that the moc compiler is NOT the one"
  1642. echo "### shipped with Qt 3.x."
  1643. echo "### Try to run configure again, this time passing the --with-qt4-moc"
  1644. echo "### option (see ./configure --help)."
  1645. echo "### You may also take a look at the config.log file in this directory,"
  1646. echo "### that will tell you which check has failed and maybe more about the reason"
  1647. echo "### of the failure."
  1648. echo "### If you're feeling that this may be a bug in this configure script"
  1649. echo "### and want to report this to me , please include your configure script,"
  1650. echo "### the config.log file as well as the complete configure output."
  1651. echo "################################################################################"
  1652. AC_SS_SET_NORMALINK
  1653. AC_MSG_ERROR([This was a fatal one...aborting])
  1654. else
  1655. SS_QT4_MOC="$SS_QT4_MOC/moc"
  1656. AC_MSG_RESULT([found as $SS_QT4_MOC])
  1657. fi
  1658. else
  1659. AC_MSG_RESULT([trusting you: using $SS_QT4_MOC])
  1660. fi
  1661. ])
  1662. AC_DEFUN([AC_SS_FIND_QT3_MT],
  1663. [
  1664. AC_ARG_ENABLE(qt-mt,[ --disable-qt-mt ignore the threaded version of Qt],SS_QT3_NOMT="$withval",SS_QT3_NOMT="NOTGIVEN")
  1665. AC_MSG_CHECKING([for the multithreaded version of Qt])
  1666. if test "$SS_QT3_NOMT" = "NOTGIVEN"; then
  1667. ss_qt_libs_to_find="lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED"
  1668. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED"
  1669. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so.$SS_QT3_MAJOR_VERSION_REQUIRED"
  1670. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.so"
  1671. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.$SS_QT3_PATCH_LEVEL_REQUIRED.dylib"
  1672. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.$SS_QT3_MINOR_VERSION_REQUIRED.dylib"
  1673. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.$SS_QT3_MAJOR_VERSION_REQUIRED.dylib"
  1674. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.dylib"
  1675. ss_qt_libs_to_find="$ss_qt_libs_to_find lib$SS_QTLIB_NAME-mt.a"
  1676. AC_SS_FIND_FILE_PATH($ss_qt_libs_to_find,$SS_QT3_LIBDIR,SS_QTMTLIBDIR)
  1677. if test "$SS_QTMTLIBDIR" = "FAILED"; then
  1678. AC_MSG_RESULT([not found])
  1679. else
  1680. AC_MSG_RESULT([seems to be available])
  1681. SS_QTLIB_NAME="$SS_QTLIB_NAME-mt"
  1682. fi
  1683. else
  1684. AC_MSG_RESULT([disabled by user])
  1685. fi
  1686. ])
  1687. AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT3],
  1688. [
  1689. AC_MSG_CHECKING([if we can compile an X-Qt 3.x application])
  1690. AC_LANG_CPLUSPLUS
  1691. ss_save_CPPFLAGS="$CPPFLAGS"
  1692. ss_save_CXXFLAGS="$CXXFLAGS"
  1693. ss_save_LDFLAGS="$LDFLAGS"
  1694. ss_save_LIBS="$LIBS"
  1695. if test -n "$SS_X_INCDIR"; then
  1696. CPPFLAGS="-I$SS_X_INCDIR"
  1697. else
  1698. CPPFLAGS=""
  1699. fi
  1700. CPPFLAGS="$CPPFLAGS -I$SS_QT3_INCDIR"
  1701. CXXFLAGS="-O2 -Wall -I/usr/include/tqt -include tqt.h $CXXFLAGS"
  1702. if test -n "$SS_X_LIBDIR"; then
  1703. LIBS="-L$SS_X_LIBDIR"
  1704. else
  1705. LIBS=""
  1706. fi
  1707. LIBS="$LIBS -L$SS_QT3_LIBDIR -l$SS_QTLIB_NAME"
  1708. if test -n "$SS_X_LDFLAGS"; then
  1709. LIBS="$LIBS $SS_X_LDFLAGS"
  1710. fi
  1711. if test -n "$SS_X_LIBLINK"; then
  1712. LIBS="$LIBS $SS_X_LIBLINK"
  1713. fi
  1714. LDFLAGS="-s $LDFLAGS"
  1715. AC_TRY_LINK([
  1716. #include <tqglobal.h>
  1717. ],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE")
  1718. if test "$SS_QTX_LINKED_OK" = "FALSE"; then
  1719. AC_MSG_RESULT([FAILED]);
  1720. AC_SS_SET_REDINK
  1721. echo "################################################################################"
  1722. echo "### CONFIGURE ERROR:"
  1723. echo "### Failed to compile the Qt library test program."
  1724. echo "### This may be a bad sign :)"
  1725. echo "### First of all, make sure that qt is correctly installed on your system,"
  1726. echo "### and the qt version is the one requested by this version of kvirc."
  1727. echo "### Ensure that you have only one copy of qt visible at a time."
  1728. echo "### You may also take a look at the config.log file in this directory,"
  1729. echo "### that will tell you which check has failed and maybe more about the reason"
  1730. echo "### of the failure."
  1731. echo "### The CPPFLAGS used were:"
  1732. for a_flag in $CPPFLAGS ; do
  1733. echo "### $a_flag"
  1734. done
  1735. echo "### The CXXFLAGS used were:"
  1736. for a_flag in $CXXFLAGS ; do
  1737. echo "### $a_flag"
  1738. done
  1739. echo "### The LIBS used were:"
  1740. for a_flag in $LIBS ; do
  1741. echo "### $a_flag"
  1742. done
  1743. echo "### The LDFLAGS used were:"
  1744. for a_flag in $LDFLAGS ; do
  1745. echo "### $a_flag"
  1746. done
  1747. echo "### If you're sure that qt is correctly installed , you may force configure"
  1748. echo "### to skip this check and try to compile kvirc anyway."
  1749. echo "### Try using the --without-qt-check option."
  1750. echo "### If you're feeling that this may be a bug in this configure script"
  1751. echo "### and want to report this to me , please include your configure script,"
  1752. echo "### the config.log file as well as the complete configure output."
  1753. echo "################################################################################"
  1754. AC_SS_SET_NORMALINK
  1755. AC_MSG_ERROR([This was a fatal one...aborting])
  1756. fi
  1757. LIBS="$ss_save_LIBS"
  1758. LDFLAGS="$ss_save_LDFLAGS"
  1759. CXXFLAGS="$ss_save_CXXFLAGS"
  1760. CPPFLAGS="$ss_save_CPPFLAGS"
  1761. AC_MSG_RESULT([success])
  1762. ])
  1763. AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_AND_QT4],
  1764. [
  1765. AC_MSG_CHECKING([if we can compile an X-Qt 4.x application])
  1766. AC_LANG_CPLUSPLUS
  1767. ss_save_CPPFLAGS="$CPPFLAGS"
  1768. ss_save_CXXFLAGS="$CXXFLAGS"
  1769. ss_save_LDFLAGS="$LDFLAGS"
  1770. ss_save_LIBS="$LIBS"
  1771. if test -n "$SS_X_INCDIR"; then
  1772. CPPFLAGS="-I$SS_X_INCDIR"
  1773. else
  1774. CPPFLAGS=""
  1775. fi
  1776. CPPFLAGS="$CPPFLAGS $SS_QT4_INCDIRECTORIES"
  1777. CXXFLAGS="-O2 -Wall $CXXFLAGS"
  1778. if test -n "$SS_X_LIBDIR"; then
  1779. LIBS="-L$SS_X_LIBDIR"
  1780. else
  1781. LIBS=""
  1782. fi
  1783. LIBS="$LIBS -L$SS_QT4_LIBDIR -lQtCore"
  1784. if test -n "$SS_X_LDFLAGS"; then
  1785. LIBS="$LIBS $SS_X_LDFLAGS"
  1786. fi
  1787. if test -n "$SS_X_LIBLINK"; then
  1788. LIBS="$LIBS $SS_X_LIBLINK"
  1789. fi
  1790. LDFLAGS="-s $LDFLAGS"
  1791. AC_TRY_LINK([
  1792. #include <qglobal.h>
  1793. #if (TQT_VERSION < 0x040000)
  1794. #error "Bad qt version: too old"
  1795. #endif
  1796. ],[return 0; ],SS_QTX_LINKED_OK="TRUE",SS_QTX_LINKED_OK="FALSE")
  1797. if test "$SS_QTX_LINKED_OK" = "FALSE"; then
  1798. AC_MSG_RESULT([FAILED]);
  1799. AC_SS_SET_REDINK
  1800. echo "################################################################################"
  1801. echo "### CONFIGURE ERROR:"
  1802. echo "### Failed to compile the Qt 4.x library test program."
  1803. echo "### This may be a bad sign :)"
  1804. echo "### First of all, make sure that qt is correctly installed on your system,"
  1805. echo "### and the qt version is the one requested by this version of kvirc."
  1806. echo "### Ensure that you have only one copy of qt visible at a time."
  1807. echo "### You may also take a look at the config.log file in this directory,"
  1808. echo "### that will tell you which check has failed and maybe more about the reason"
  1809. echo "### of the failure."
  1810. echo "### The CPPFLAGS used were:"
  1811. for a_flag in $CPPFLAGS ; do
  1812. echo "### $a_flag"
  1813. done
  1814. echo "### The CXXFLAGS used were:"
  1815. for a_flag in $CXXFLAGS ; do
  1816. echo "### $a_flag"
  1817. done
  1818. echo "### The LIBS used were:"
  1819. for a_flag in $LIBS ; do
  1820. echo "### $a_flag"
  1821. done
  1822. echo "### The LDFLAGS used were:"
  1823. for a_flag in $LDFLAGS ; do
  1824. echo "### $a_flag"
  1825. done
  1826. echo "### If you're sure that qt is correctly installed , you may force configure"
  1827. echo "### to skip this check and try to compile kvirc anyway."
  1828. echo "### Try using the --without-qt-check option."
  1829. echo "### If you're feeling that this may be a bug in this configure script"
  1830. echo "### and want to report this to me , please include your configure script,"
  1831. echo "### the config.log file as well as the complete configure output."
  1832. echo "################################################################################"
  1833. AC_SS_SET_NORMALINK
  1834. AC_MSG_ERROR([This was a fatal one...aborting])
  1835. fi
  1836. LIBS="$ss_save_LIBS"
  1837. LDFLAGS="$ss_save_LDFLAGS"
  1838. CXXFLAGS="$ss_save_CXXFLAGS"
  1839. CPPFLAGS="$ss_save_CPPFLAGS"
  1840. AC_MSG_RESULT([success])
  1841. ])
  1842. dnl ###################################################################################################################
  1843. dnl ### KDE
  1844. dnl ###################################################################################################################
  1845. AC_DEFUN([AC_SS_FIND_KDE],
  1846. [
  1847. AC_SS_CHECK_IF_KDE_IS_REQUESTED
  1848. if test "$SS_KDE_REQUESTED" = "yes"; then
  1849. AC_SS_FIND_KDE_GENERAL_DIR
  1850. if test "$SS_KDE_REQUESTED" = "yes"; then
  1851. AC_SS_FIND_KDE_SERVICES_DIR
  1852. AC_SS_FIND_KDE_LIBRARY_DIR
  1853. if test "$SS_KDE_REQUESTED" = "yes"; then
  1854. AC_SS_FIND_KDE_INCLUDE_DIR
  1855. if test "$SS_KDE_REQUESTED" = "yes"; then
  1856. AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE
  1857. fi
  1858. fi
  1859. fi
  1860. fi
  1861. ])
  1862. AC_DEFUN([AC_SS_CHECK_IF_KDE_IS_REQUESTED],
  1863. [
  1864. AC_MSG_CHECKING([if KDE support is requested])
  1865. if test "$SS_USE_QT4" = "no"; then
  1866. SS_KDE_REQUESTED="yes"
  1867. AC_ARG_WITH(kde-support,[ --without-kde-support Disable the KDE support even if it is detected ],SS_KDE_REQUESTED="$withval")
  1868. if test "$SS_KDE_REQUESTED" = "yes"; then
  1869. AC_MSG_RESULT([yes])
  1870. else
  1871. AC_MSG_RESULT([no])
  1872. fi
  1873. else
  1874. SS_KDE_REQUESTED="no"
  1875. AC_MSG_RESULT([unsupported with qt 4.x])
  1876. fi
  1877. ])
  1878. AC_DEFUN([AC_SS_FIND_KDE_GENERAL_DIR],
  1879. [
  1880. AC_MSG_CHECKING([for the general KDE directory])
  1881. ss_kde_general_test_dirs="/usr /usr/local /usr /usr/local /usr/build /usr/X11R6 /opt /usr/opt /usr/lib /usr/lib /usr/src /usr/lib /usr/local/lib"
  1882. if test -n "$HOME"; then
  1883. ss_kde_general_test_dirs="$ss_kde_general_test_dirs $HOME $HOME/lib"
  1884. fi
  1885. if test -n "$TDEDIR"; then
  1886. ss_kde_general_test_dirs="$TDEDIR $ss_kde_general_test_dirs"
  1887. fi
  1888. ss_kde_general_test_path_suffix="trinity tde TDE kde kde3.0 kde3 KDE Kde KDE3 kde3 ."
  1889. AC_SS_FIND_FILE_PATH_EXT($SS_KDE_GENERAL_FILE_TO_SEARCH,$ss_kde_general_test_dirs,$ss_kde_general_test_path_suffix,SS_KDE_GENERAL_DIR)
  1890. if test "$SS_KDE_GENERAL_DIR" = "FAILED"; then
  1891. AC_MSG_RESULT([failed...continuing with normal checks])
  1892. unset SS_KDE_GENERAL_DIR
  1893. else
  1894. AC_MSG_RESULT([Seems to be $SS_KDE_GENERAL_DIR])
  1895. fi
  1896. ])
  1897. AC_DEFUN([AC_SS_FIND_KDE_SERVICES_DIR],
  1898. [
  1899. AC_ARG_WITH(kde-services-dir,[ --with-kde-services-dir path to the KDE protocol services dir ],SS_KDE_SERVICESDIR="$withval",SS_KDE_SERVICESDIR="NOTGIVEN")
  1900. if test "$SS_KDE_SERVICESDIR" = "NOTGIVEN"; then
  1901. AC_MSG_CHECKING([for KDE services directory])
  1902. ss_kde_services_test_dirs="/usr/share/services /usr/local/share/services /usr/kde/share/services /usr/local/kde/share/services /usr/X11R6/share/services /opt/kde/share/services /usr/lib/kde/share/services"
  1903. test -n "$TDEDIR" && ss_kde_services_test_dirs="$TDEDIR/share/services $ss_kde_services_test_dirs"
  1904. ss_kde_services_test_dirs="$ss_kde_services_test_dirs /usr/share/kde/services"
  1905. test -n "$SS_KDE_GENERAL_DIR" && ss_kde_services_test_dirs="$SS_KDE_GENERAL_DIR/share/services $ss_kde_services_test_dirs"
  1906. AC_SS_FIND_FILE_PATH("http.protocol",$ss_kde_services_test_dirs,SS_KDE_SERVICESDIR)
  1907. if test "$SS_KDE_SERVICESDIR" = "FAILED"; then
  1908. SS_KDE_SERVICESDIR=""
  1909. AC_MSG_RESULT([unknown])
  1910. else
  1911. AC_MSG_RESULT([found in $SS_KDE_SERVICESDIR])
  1912. fi
  1913. else
  1914. AC_MSG_RESULT([using user supplied path for the KDE services dir $SS_KDE_SERVICESDIR])
  1915. fi
  1916. ])
  1917. AC_DEFUN([AC_SS_FIND_KDE_INCLUDE_DIR],
  1918. [
  1919. AC_ARG_WITH(kde-include-dir,[ --with-kde-include-dir path to the KDE headers ],SS_KDE_INCDIR="$withval",SS_KDE_INCDIR="NOTGIVEN")
  1920. if test "$SS_KDE_INCDIR" = "NOTGIVEN"; then
  1921. AC_MSG_CHECKING([for KDE header files])
  1922. ss_kde_include_test_dirs="/include /usr/include /usr/local/include /usr/kde/include /usr/local/kde/include /usr/X11R6/include /opt/kde/include /usr/lib/kde/include /usr/lib/kde /usr/include/X11"
  1923. test -n "$TDEDIR" && ss_kde_include_test_dirs="$TDEDIR/include $TDEDIR $ss_kde_include_test_dirs"
  1924. ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/tde /usr/local/include/tde /include/tde /usr/X11R6/include/tde /usr/build/kde/include"
  1925. ss_kde_include_test_dirs="$ss_kde_include_test_dirs /usr/include/tde2 /usr/local/include/tde2 /include/tde2 /usr/X11R6/include/tde2 /usr/include/X11/kde2"
  1926. test -n "$SS_KDE_GENERAL_DIR" && ss_kde_include_test_dirs="$SS_KDE_GENERAL_DIR/include $ss_kde_include_test_dirs"
  1927. AC_SS_FIND_FILE_PATH($SS_KDE_INCLUDE_FILE_TO_SEARCH,$ss_kde_include_test_dirs,SS_KDE_INCDIR)
  1928. if test "$SS_KDE_INCDIR" = "FAILED"; then
  1929. AC_MSG_RESULT("FAILED")
  1930. SS_KDE_REQUESTED="no"
  1931. SS_KDE_INCDIR=""
  1932. else
  1933. AC_MSG_RESULT([found in $SS_KDE_INCDIR])
  1934. fi
  1935. else
  1936. AC_MSG_RESULT([using user supplied path for the KDE include files $SS_KDE_INCDIR])
  1937. fi
  1938. if test -z "$SS_KDE_GENERAL_DIR"; then
  1939. # Set it.... we need it :)...
  1940. SS_KDE_GENERAL_DIR=`echo $SS_KDE_INCDIR | sed -e 's/\/include\$//'`
  1941. fi
  1942. ])
  1943. AC_DEFUN([AC_SS_FIND_KDE_LIBRARY_DIR],
  1944. [
  1945. AC_ARG_WITH(kde-library-dir,[ --with-kde-library-dir path to the KDE libraries ],SS_KDE_LIBDIR="$withval",SS_KDE_LIBDIR="NOTGIVEN")
  1946. if test "$SS_KDE_LIBDIR" = "NOTGIVEN"; then
  1947. AC_MSG_CHECKING([for the KDE libraries])
  1948. ss_kde_library_test_dirs="/lib /usr/lib /usr/local/lib /usr/kde/lib /opt/kde/lib /opt/lib /usr/opt/kde/lib /usr/local/kde/lib /usr/X11R6/lib /usr/lib/kde/lib /usr/lib/kde /usr/local/lib/kde/lib"
  1949. test -n "$TDEDIR" && ss_kde_library_test_dirs="$TDEDIR/lib $TDEDIR $ss_kde_library_test_dirs"
  1950. ss_kde_library_test_dirs="$ss_kde_library_test_dirs /usr/local/lib/kde /usr/X11R6/lib/kde /usr/build/kde/lib"
  1951. if test -n "$SS_KDE_GENERAL_DIR"; then
  1952. ss_kde_library_test_dirs="$SS_KDE_GENERAL_DIR/lib $ss_kde_library_test_dirs"
  1953. fi
  1954. AC_SS_FIND_FILE_PATH(libtdecore.so.6 libtdecore.so.5 libtdecore.so.4 libtdecore.so.3 libtdecore.so,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
  1955. if test "$SS_KDE_LIBDIR" = "FAILED"; then
  1956. AC_SS_FIND_FILE_PATH(libtdecore.so.8 libtdecore.so.7 libtdecore.so.4.0.0 libtdecore.so.4.1.0 libtdecore.so.4.2.0 ,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
  1957. if test "$SS_KDE_LIBDIR" = "FAILED"; then
  1958. # Try the senseless too
  1959. AC_SS_FIND_FILE_PATH(libtdecore.so.4.0.0 libtdecore.so.4.1.0 libtdecore.so.4.2.0 libtdecore.so.4.3.0,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
  1960. if test "$SS_KDE_LIBDIR" = "FAILED"; then
  1961. AC_SS_FIND_FILE_PATH(libtdecore.so.4.4.0 libtdecore.so.4.5.0 libtdecore.so.4.6.0 libtdecore.so.4.7.0 libtdecore.a,$ss_kde_library_test_dirs,SS_KDE_LIBDIR)
  1962. fi
  1963. fi
  1964. fi
  1965. if test "$SS_KDE_LIBDIR" = "FAILED"; then
  1966. AC_MSG_RESULT("FAILED")
  1967. SS_KDE_REQUESTED="no"
  1968. SS_KDE_LIBDIR=""
  1969. else
  1970. AC_MSG_RESULT([found in $SS_KDE_LIBDIR])
  1971. fi
  1972. else
  1973. AC_MSG_RESULT([using user supplied path for the KDE libraries $SS_KDE_LIBDIR])
  1974. fi
  1975. if test -z "$SS_KDE_GENERAL_DIR"; then
  1976. # Set it.... we need it :)...
  1977. SS_KDE_GENERAL_DIR=`echo $SS_KDE_LIBDIR | sed -e 's/\/lib\$//'`
  1978. fi
  1979. ])
  1980. AC_DEFUN([AC_SS_ENSURE_CAN_COMPILE_X_QT3_AND_KDE],
  1981. [
  1982. AC_ARG_WITH(kde-check,[ --without-kde-check Do not check if Qt,KDE and X compile ],SS_CHECK_QTX_COMPILE="$withval",SS_CHECK_KQTX_COMPILE="yes")
  1983. if test "$SS_CHECK_KQTX_COMPILE" = "yes"; then
  1984. AC_MSG_CHECKING(if we can compile an X-Qt-KDE application)
  1985. AC_LANG_CPLUSPLUS
  1986. ss_save_CPPFLAGS="$CPPFLAGS"
  1987. ss_save_CXXFLAGS="$CXXFLAGS"
  1988. ss_save_LDFLAGS="$LDFLAGS"
  1989. ss_save_LIBS="$LIBS"
  1990. if test -n "$SS_X_INCDIR"; then
  1991. CPPFLAGS="-I$SS_X_INCDIR"
  1992. else
  1993. CPPFLAGS=""
  1994. fi
  1995. CPPFLAGS="$CPPFLAGS -I$SS_X_INCDIR -I$SS_QT3_INCDIR -I$SS_KDE_INCDIR"
  1996. CXXFLAGS="-O2 -Wall $CXXFLAGS"
  1997. if test -n "$SS_X_LIBDIR"; then
  1998. LIBS="-L$SS_X_LIBDIR"
  1999. else
  2000. LIBS=""
  2001. fi
  2002. if test -n "$SS_X_LDFLAGS"; then
  2003. LIBS="$SS_X_LDFLAGS $LIBS"
  2004. fi
  2005. if test -n "$SS_X_LIBLINK"; then
  2006. LIBS="$LIBS $SS_X_LIBLINK"
  2007. fi
  2008. LIBS="-L$SS_KDE_LIBDIR -L$SS_QT3_LIBDIR -ltdecore -l$SS_QTLIB_NAME $LIBS -Wl,-rpath $SS_KDE_LIBDIR"
  2009. if test "$SS_LINK_TO_LIBDL" = "yes"; then
  2010. LIBS="$LIBS -ldl";
  2011. fi
  2012. LDFLAGS="-s $LDFLAGS"
  2013. AC_TRY_LINK([
  2014. #include "kapp.h"
  2015. #include "twin.h"
  2016. ],[
  2017. int a = KWin::currentDesktop();
  2018. TDEApplication app(a,0,"kvirc");
  2019. ],
  2020. SS_KQTX_LINKED_OK="TRUE",
  2021. SS_KQTX_LINKED_OK="FALSE"
  2022. )
  2023. if test "$SS_KQTX_LINKED_OK" = "FALSE"; then
  2024. AC_MSG_RESULT(failed)
  2025. AC_MSG_ERROR([This was a fatal one...aborting])
  2026. else
  2027. AC_MSG_RESULT(success)
  2028. fi
  2029. LIBS="$ss_save_LIBS"
  2030. LDFLAGS="$ss_save_LDFLAGS"
  2031. CXXFLAGS="$ss_save_CXXFLAGS"
  2032. CPPFLAGS="$ss_save_CPPFLAGS"
  2033. fi
  2034. ])
  2035. AC_DEFUN([AC_SS_CHECK_OTHER_LIBS],
  2036. [
  2037. SS_OTHER_LIBDIRS=""
  2038. SS_OTHER_LIBLINK=""
  2039. SS_OTHER_INCDIRS=""
  2040. AC_MSG_CHECKING([if you want to link to libresolv])
  2041. SS_DO_IT="false"
  2042. AC_ARG_WITH(libresolv, [ --with-libresolv Link to libresolv],SS_DO_IT="true")
  2043. if test "$SS_DO_IT" = "true"; then
  2044. AC_MSG_RESULT(yes)
  2045. SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lresolv"
  2046. else
  2047. AC_MSG_RESULT(no)
  2048. fi
  2049. AC_MSG_CHECKING([if you want to link to libsocket])
  2050. SS_DO_IT="false"
  2051. AC_ARG_WITH(libsocket, [ --with-libsocket Link to libsocket],SS_DO_IT="true")
  2052. if test "$SS_DO_IT" = "true"; then
  2053. AC_MSG_RESULT(yes)
  2054. SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lsocket"
  2055. else
  2056. AC_MSG_RESULT(no)
  2057. fi
  2058. AC_MSG_CHECKING([if you want to link to libnsl])
  2059. SS_DO_IT="false"
  2060. AC_ARG_WITH(libnsl, [ --with-libnsl Link to libnsl],SS_DO_IT="true")
  2061. if test "$SS_DO_IT" = "true"; then
  2062. AC_MSG_RESULT(yes)
  2063. SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lnsl"
  2064. else
  2065. AC_MSG_RESULT(no)
  2066. fi
  2067. AC_MSG_CHECKING([if you want to link to libcompat])
  2068. SS_DO_IT="false"
  2069. AC_ARG_WITH(libnsl, [ --with-libcompat Link to libcompat],SS_DO_IT="true")
  2070. if test "$SS_DO_IT" = "true"; then
  2071. AC_MSG_RESULT(yes)
  2072. SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK -lcompat"
  2073. else
  2074. AC_MSG_RESULT(no)
  2075. fi
  2076. AC_MSG_CHECKING([if you want to link to other libraries])
  2077. SS_DO_IT="false"
  2078. AC_ARG_WITH(other-libs, [ --with-other-libs=... Link to the specified libraries],SS_DO_IT="$withval")
  2079. if test "$SS_DO_IT" != "false"; then
  2080. AC_MSG_RESULT([yes])
  2081. SS_OTHER_LIBLINK="$SS_OTHER_LIBLINK $SS_DO_IT"
  2082. else
  2083. AC_MSG_RESULT([no])
  2084. fi
  2085. AC_MSG_CHECKING([if you want to add other library search paths])
  2086. SS_DO_IT="false"
  2087. AC_ARG_WITH(other-ldirs, [ --with-other-ldirs=... Add the specified library paths],SS_DO_IT="$withval")
  2088. if test "$SS_DO_IT" != "false"; then
  2089. AC_MSG_RESULT([yes])
  2090. SS_OTHER_LIBDIRS="$SS_OTHER_LIBDIRS $SS_DO_IT"
  2091. else
  2092. AC_MSG_RESULT([no])
  2093. fi
  2094. AC_MSG_CHECKING([if you want to add other include search paths])
  2095. SS_DO_IT="false"
  2096. AC_ARG_WITH(other-idirs, [ --with-other-idirs=... Add the specified include search paths],SS_DO_IT="$withval")
  2097. if test "$SS_DO_IT" != "false"; then
  2098. AC_MSG_RESULT([yes])
  2099. SS_OTHER_INCDIRS="$SS_OTHER_INCDIRS $SS_DO_IT"
  2100. else
  2101. AC_MSG_RESULT([no])
  2102. fi
  2103. ])
  2104. AC_DEFUN([AC_SS_FINAL_CONFIG],
  2105. [
  2106. AC_MSG_CHECKING([if we finally have to compile the IpV6 support])
  2107. if test "$SS_NOIPV6_SUPPORT" = "true"; then
  2108. AC_MSG_RESULT([no: disabled by user])
  2109. else
  2110. if test "$SS_HAVE_IPV6_FUNCTIONS" = "true"; then
  2111. AC_MSG_RESULT([yes])
  2112. AC_DEFINE([COMPILE_IPV6_SUPPORT], 1, [define if you want the IpV6 support])
  2113. SS_BUILD_FLAGS="i$SS_BUILD_FLAGS"
  2114. else
  2115. AC_MSG_RESULT([no: the system lacks support])
  2116. fi
  2117. fi
  2118. dnl # // Toplevel source directory
  2119. SS_TOPSRCDIR=`pwd`
  2120. AC_SUBST(SS_TOPSRCDIR)
  2121. SS_CPPFLAGS="-D_REENTRANT -DREENTRANT"
  2122. if test -n "$SS_X_CPPFLAGS"; then
  2123. SS_CPPFLAGS="$SS_CPPFLAGS $SS_X_CPPFLAGS"
  2124. fi
  2125. if test "$SS_USE_QT4" = "no"; then
  2126. SS_INCDIRS="-I$SS_QT3_INCDIR -I$SS_X_INCDIR"
  2127. else
  2128. AC_DEFINE([COMPILE_USE_QT4], 1, [define if you want to compile the Qt 4.x support])
  2129. SS_INCDIRS="$SS_QT4_INCDIRECTORIES -I$SS_X_INCDIR"
  2130. SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_SUPPORT"
  2131. fi
  2132. if test -n "$SS_X_INCDIR"; then
  2133. SS_INCDIRS="$SS_INCDIRS -I$SS_X_INCDIR"
  2134. fi
  2135. if test -n "$SS_X_LDFLAGS"; then
  2136. SS_LDFLAGS="$SS_X_LDFLAGS"
  2137. else
  2138. SS_LDFLAGS=""
  2139. fi
  2140. if test "$SS_USE_QT4" = "no"; then
  2141. SS_RPATH="-rpath $SS_QT3_LIBDIR -rpath $libdir"
  2142. else
  2143. SS_RPATH="-rpath $SS_QT4_LIBDIR -rpath $libdir"
  2144. fi
  2145. if test -n "$SS_X_LIBDIR"; then
  2146. SS_RPATH="$SS_RPATH -rpath $SS_X_LIBDIR"
  2147. fi
  2148. if test "$SS_USE_QT4" = "no"; then
  2149. SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT3_LIBDIR"
  2150. else
  2151. SS_LIBDIRS="-L$SS_TOPSRCDIR/src/kvilib/build/ -L$SS_QT4_LIBDIR"
  2152. fi
  2153. if test -n "$SS_X_LIBDIR"; then
  2154. SS_LIBDIRS="$SS_LIBDIRS -L$SS_X_LIBDIR"
  2155. fi
  2156. if test "$SS_USE_QT4" = "no"; then
  2157. SS_LIBLINK="-l$SS_QTLIB_NAME"
  2158. else
  2159. #if test -n "SS_LOCAL_ADD_DEBUG_SYMBOLS"; then
  2160. # SS_LIBLINK="-lQtCore_debug -lQtGui_debug -lQt3Support_debug"
  2161. #else
  2162. SS_LIBLINK="-lQtCore -lQtGui -lQt3Support"
  2163. #fi
  2164. fi
  2165. if test -n "$SS_X_LIBLINK"; then
  2166. SS_LIBLINK="$SS_LIBLINK $SS_X_LIBLINK"
  2167. fi
  2168. SS_LIBLINK="$SS_LIBLINK $SS_THREAD_LIBLINK"
  2169. if test "$SS_LINK_TO_LIBSSL" = "true"; then
  2170. SS_LIBLINK="$SS_LIBLINK -lssl -lcrypto"
  2171. fi
  2172. if test "$SS_LINK_TO_LIBESD" = "true"; then
  2173. SS_LIBLINK="$SS_LIBLINK -lesd"
  2174. fi
  2175. if test "$SS_LINK_TO_LIBARTS" = "true"; then
  2176. SS_LIBLINK="$SS_LIBLINK -lsoundserver_idl"
  2177. fi
  2178. if test "$SS_LINK_TO_LIBAUDIOFILE" = "true"; then
  2179. SS_LIBLINK="$SS_LIBLINK -laudiofile -lm"
  2180. fi
  2181. if test "$SS_LOCAL_8BIT" = "true"; then
  2182. SS_CPPFLAGS="$SS_CPPFLAGS -DQT3_NO_ASCII_CAST -DQT3_NO_COMPAT"
  2183. fi
  2184. if test "$SS_QT3_EMBEDDED" = "true"; then
  2185. SS_CPPFLAGS="$SS_CPPFLAGS -DQWS"
  2186. fi
  2187. if test "$SS_KDE_REQUESTED" = "yes"; then
  2188. SS_INCDIRS="$SS_INCDIRS -I$SS_KDE_INCDIR"
  2189. SS_RPATH="$SS_RPATH -rpath $SS_KDE_LIBDIR"
  2190. SS_LIBDIRS="$SS_LIBDIRS -L$SS_KDE_LIBDIR"
  2191. SS_LIBLINK="-ltdecore -ltdeui -lkparts -lDCOP -ltdefx -lkio $SS_LIBLINK"
  2192. AC_DEFINE([COMPILE_TDE_SUPPORT], 1, [define if you want to compile the TDE support])
  2193. AC_DEFINE_UNQUOTED([TDE_DIR], "$SS_KDE_GENERAL_DIR", [contain path to TDE if compiled with the TDE support])
  2194. AC_DEFINE_UNQUOTED([TDE_LIBDIR], "$SS_KDE_LIBDIR", [contain path to TDE libs if compiled with the TDE support])
  2195. SS_BUILD_FLAGS="k$SS_BUILD_FLAGS"
  2196. else
  2197. AC_DEFINE_UNQUOTED([TDE_DIR], "", [contain path to TDE if compiled with the TDE support])
  2198. AC_DEFINE_UNQUOTED([TDE_LIBDIR], "", [contain path to TDE libs if compiled with the TDE support])
  2199. fi
  2200. if test -n "$SS_OTHER_LIBLINK"; then
  2201. SS_LIBLINK="$SS_LIBLINK $SS_OTHER_LIBLINK"
  2202. fi
  2203. if test -n "$SS_OTHER_LIBDIRS"; then
  2204. SS_LIBDIRS="$SS_LIBDIRS $SS_OTHER_LIBDIRS"
  2205. SS_OTHER_LIBDIRS=`echo "$SS_OTHER_LIBDIRS" | sed -e s/-L//g`
  2206. SS_RPATH="$SS_RPATH -rpath $SS_OTHER_LIBDIRS"
  2207. fi
  2208. if test -n "$SS_OTHER_INCDIRS"; then
  2209. SS_INCDIRS="$SS_INCDIRS $SS_OTHER_INCDIRS"
  2210. fi
  2211. if test "$SS_LINK_TO_LIBDL" = "yes"; then
  2212. SS_LIBLINK="$SS_LIBLINK -ldl"
  2213. fi
  2214. if test "$SS_LINK_TO_LIBZ" = "yes"; then
  2215. SS_LIBLINK="$SS_LIBLINK -lz"
  2216. fi
  2217. if test "$SS_LINK_TO_XSS" = "yes"; then
  2218. SS_LIBLINK="$SS_LIBLINK -lXss"
  2219. fi
  2220. AC_SUBST(SS_CPPFLAGS)
  2221. AC_SUBST(SS_INCDIRS)
  2222. AC_SUBST(SS_LDFLAGS)
  2223. AC_SUBST(SS_RPATH)
  2224. AC_SUBST(SS_LIBDIRS)
  2225. AC_SUBST(SS_LIBLINK)
  2226. if test "$SS_USE_QT4" = "no"; then
  2227. SS_QT_MOC=$SS_QT3_MOC
  2228. SS_QT_MOC_FLAGS=""
  2229. else
  2230. SS_QT_MOC=$SS_QT4_MOC
  2231. SS_QT_MOC_FLAGS="-DCOMPILE_USE_QT4"
  2232. fi
  2233. AC_SUBST(SS_QT_MOC)
  2234. AC_SUBST(SS_QT_MOC_FLAGS)
  2235. build_date=`date -u`
  2236. if test -z "$build_date"; then
  2237. build_date=`date`
  2238. fi
  2239. if test -z "$build_date"; then
  2240. build_date="unknown"
  2241. fi
  2242. AC_DEFINE_UNQUOTED([BUILD_DATE],"$build_date", [this is the build date (configure date rather)])
  2243. dnl # Let's sort the build flags
  2244. SS_AUX_CHARS="a b c d e f g h i j k l m n o p q r s t u v w x y z A B C D E F G H I J K L M N O P Q R S T U V W X Y Z 0 1 2 3 4 5 6 7 8 9"
  2245. buid_flags=""
  2246. for achar in $SS_AUX_CHARS; do
  2247. tmp_val=`echo "$SS_BUILD_FLAGS" | grep $achar`
  2248. if test "$tmp_val"; then
  2249. build_flags="$build_flags$achar"
  2250. fi
  2251. done
  2252. SS_DIRTAG=`echo $VERSION | cut -d . -f 1,2`
  2253. AC_DEFINE_UNQUOTED([VERSION_BRANCH], "$SS_DIRTAG", [MAJOR.MINOR part of version])
  2254. AC_DEFINE_UNQUOTED([BUILD_FLAGS],"$target_cpu-$build_flags", [these are the build flags])
  2255. globalkvircdir="\${datadir}/kvirc/$SS_DIRTAG"
  2256. AC_SUBST(globalkvircdir)
  2257. configdir="\${globalkvircdir}/config"
  2258. AC_SUBST(configdir)
  2259. picsdir="\${globalkvircdir}/pics"
  2260. AC_SUBST(picsdir)
  2261. helpdir="\${globalkvircdir}/help/en"
  2262. AC_SUBST(helpdir)
  2263. pluglibdir="\${globalkvircdir}/modules"
  2264. AC_SUBST(pluglibdir)
  2265. modulelibdir="\${globalkvircdir}/modules"
  2266. AC_SUBST(modulelibdir)
  2267. defscriptdir="\${globalkvircdir}/defscript"
  2268. AC_SUBST(defscriptdir)
  2269. themedir="\${globalkvircdir}/themes"
  2270. AC_SUBST(themedir)
  2271. msgcolorsdir="\${globalkvircdir}/msgcolors"
  2272. AC_SUBST(msgcolorsdir)
  2273. if test -z "$mandir"; then
  2274. mandir="\${exec_prefix}/man/man1"
  2275. fi
  2276. AC_SUBST(mandir)
  2277. licensedir="\${globalkvircdir}/license"
  2278. AC_SUBST(licensedir)
  2279. if test -n "$SS_KDE_SERVICESDIR"; then
  2280. kdeservicesdir="$SS_KDE_SERVICESDIR"
  2281. else
  2282. kdeservicesdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/protocols"
  2283. fi
  2284. AC_SUBST(kdeservicesdir)
  2285. if test "$SS_KDE_REQUESTED" = "yes"; then
  2286. iconapps16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/apps"
  2287. iconapps32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/apps"
  2288. iconapps48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/apps"
  2289. iconapps64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/apps"
  2290. iconapps128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/apps"
  2291. iconappsscalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/apps"
  2292. iconmime16datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/16x16/mimetypes"
  2293. iconmime32datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/32x32/mimetypes"
  2294. iconmime48datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/48x48/mimetypes"
  2295. iconmime64datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/64x64/mimetypes"
  2296. iconmime128datadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/128x128/mimetypes"
  2297. iconmimescalabledatadir="$SS_KDE_GENERAL_DIR/share/icons/hicolor/scalable/mimetypes"
  2298. applnkdir="$SS_KDE_GENERAL_DIR/share/applnk/Internet"
  2299. mimelnkdir="$SS_KDE_GENERAL_DIR/share/mimelnk/text"
  2300. else
  2301. iconapps16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16"
  2302. iconapps32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32"
  2303. iconapps48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48"
  2304. iconapps64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64"
  2305. iconapps128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128"
  2306. iconappsscalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable"
  2307. iconmime16datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/16x16"
  2308. iconmime32datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/32x32"
  2309. iconmime48datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/48x48"
  2310. iconmime64datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/64x64"
  2311. iconmime128datadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/128x128"
  2312. iconmimescalabledatadir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/icons/scalable"
  2313. applnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/applnk"
  2314. mimelnkdir="\${exec_prefix}/share/kvirc/$SS_DIRTAG/mimelnk"
  2315. fi
  2316. AC_SUBST(iconapps16datadir)
  2317. AC_SUBST(iconapps32datadir)
  2318. AC_SUBST(iconapps48datadir)
  2319. AC_SUBST(iconapps64datadir)
  2320. AC_SUBST(iconapps128datadir)
  2321. AC_SUBST(iconappsscalabledatadir)
  2322. AC_SUBST(iconmime16datadir)
  2323. AC_SUBST(iconmime32datadir)
  2324. AC_SUBST(iconmime48datadir)
  2325. AC_SUBST(iconmime64datadir)
  2326. AC_SUBST(iconmime128datadir)
  2327. AC_SUBST(iconmimescalabledatadir)
  2328. AC_SUBST(applnkdir)
  2329. AC_SUBST(mimelnkdir)
  2330. localedir="\${globalkvircdir}/locale"
  2331. AC_SUBST(localedir)
  2332. headersdir="\${exec_prefix}/include/kvirc/$VERSION"
  2333. AC_SUBST(headersdir)
  2334. configmodulesdir="\${globalkvircdir}/config/modules"
  2335. AC_SUBST(configmodulesdir)
  2336. topdir=`pwd`
  2337. AC_SUBST(topdir)
  2338. AC_SS_HEADER([Configuration status:])
  2339. AC_SS_SET_GREENINK
  2340. echo "### The kvirc binary will be installed in:"
  2341. echo "### $bindir"
  2342. echo "### The libraries will be installed in:"
  2343. echo "### $libdir"
  2344. echo "### Modules will be installed in:"
  2345. echo "### $pluglibdir"
  2346. AC_SS_SET_NORMALINK
  2347. AC_SS_HEADER([Take a look at the paths above just to be sure that they're correct])
  2348. ])
  2349. dnl just a wrapper to clean up configure.in
  2350. AC_DEFUN([KVIRC_PROG_LIBTOOL],
  2351. [
  2352. AM_PROG_LIBTOOL
  2353. LIBTOOL_SHELL="/bin/sh ./libtool"
  2354. # LIBTOOL="$LIBTOOL --silent"
  2355. AC_ARG_ENABLE(objprelink, [ --enable-objprelink prelink apps (experimental, needs objprelink in path)],
  2356. kvirc_use_objprelink=$enableval, kvirc_use_objprelink=no)
  2357. if test "x$kvirc_use_objprelink" = "xyes"; then
  2358. echo Patching libtool to run objprelink.
  2359. mv libtool libtool.orig
  2360. cat > libtool <<\EOF
  2361. #! /bin/sh
  2362. ALREADYPRELINKED=""
  2363. for n
  2364. do
  2365. case $n in
  2366. *.o) k=$n
  2367. if test -r $k; then
  2368. ISELF=`file $k | grep ELF`
  2369. if test -n "$ISELF"; then
  2370. ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
  2371. if test -z "$ALREADY"; then
  2372. echo objprelink $k
  2373. objprelink $k
  2374. ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
  2375. fi
  2376. fi
  2377. fi
  2378. ;;
  2379. *.lo) k=$n
  2380. if test -r $k; then
  2381. ISELF=`file $k | grep ELF`
  2382. if test -n "$ISELF"; then
  2383. ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
  2384. if test -z "$ALREADY"; then
  2385. echo objprelink $k
  2386. objprelink $k
  2387. ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
  2388. fi
  2389. fi
  2390. fi
  2391. ASHORTNAME=`echo $n | sed -e 's/\.lo$//'`
  2392. k=".libs/$ASHORTNAME.o"
  2393. if test -r $k; then
  2394. ISELF=`file $k | grep ELF`
  2395. if test -n "$ISELF"; then
  2396. ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
  2397. if test -z "$ALREADY"; then
  2398. echo objprelink $k
  2399. objprelink $k
  2400. ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
  2401. fi
  2402. fi
  2403. fi
  2404. k=".libs/$ASHORTNAME.lo"
  2405. if test -r $k; then
  2406. ISELF=`file $k | grep ELF`
  2407. if test -n "$ISELF"; then
  2408. ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
  2409. if test -z "$ALREADY"; then
  2410. echo objprelink $k
  2411. objprelink $k
  2412. ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
  2413. fi
  2414. fi
  2415. fi
  2416. k="$ASHORTNAME.o"
  2417. if test -r $k; then
  2418. ISELF=`file $k | grep ELF`
  2419. if test -n "$ISELF"; then
  2420. ALREADY=`echo $ALREADYPRELINKED | grep "!!!$k"`
  2421. if test -z "$ALREADY"; then
  2422. echo objprelink $k
  2423. objprelink $k
  2424. ALREADYPRELINKED="$ALREADYPRELINKED !!!$k"
  2425. fi
  2426. fi
  2427. fi
  2428. ;;
  2429. esac
  2430. done
  2431. EOF
  2432. cat >> libtool libtool.orig
  2433. rm libtool.orig
  2434. chmod a+x libtool
  2435. fi
  2436. ])