TDE frontend for power management
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

configure.in.in 5.8KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. #MIN_CONFIG(3.2.0)
  2. AM_INIT_AUTOMAKE(tdepowersave, 0.7.3, danny.kukawka@web.de)
  3. AC_C_BIGENDIAN
  4. AC_CHECK_KDEMAXPATHLEN
  5. AC_ARG_ENABLE(debug-msg, [ --enable-debug-msg build with debug messages],enable_debug_msg=$enableval,enable_debug_msg=auto)
  6. AC_ARG_ENABLE(yast-entry, [ --enable-yast-entry build with a YaST entry in the applet menu],enable_yast_entry=$enableval,enable_yast_entry=auto)
  7. AC_ARG_ENABLE(fake-cpu, [ --enable-fake-cpu use fake cpu environment],enable_fake_cpu=$enableval,enable_fake_cpu=auto)
  8. AC_ARG_ENABLE(suse-sles, [ --enable-suse-sles set SLES/SLED as distribution],enable_suse_sles=$enableval,enable_suse_sles=auto)
  9. YAST_ENTRY="no"
  10. PKG_PROG_PKG_CONFIG
  11. if test x$enable_suse_sles = xyes; then
  12. AC_DEFINE([DISTRO_IS_SUSE],1,[define if the distro is SUSE])
  13. AC_DEFINE([DISTRO_IS_SLES_SLED],1,[define if the distro is a SUSE Linux Enterprise product])
  14. YAST_ENTRY="yes"
  15. echo "detected distribution: SUSE Linux / a SUSE Linux Enterprise product"
  16. elif test -f /etc/SuSE-release ; then
  17. AC_DEFINE([DISTRO_IS_SUSE],1,[define if the distro is SUSE])
  18. echo -n "detected distribution: SUSE Linux "
  19. YAST_ENTRY="yes"
  20. if test -x /usr/bin/lsb_release ; then
  21. /usr/bin/lsb_release -d -s > lsb_id.tmp
  22. if test -f lsb_id.tmp; then
  23. read LSB_ID < lsb_id.tmp
  24. case "$LSB_ID" in
  25. *SUSE*Linux*Enterprise*)
  26. AC_DEFINE([DISTRO_IS_SLES_SLED],1,[define if the distro is a SUSE Linux Enterprise product])
  27. echo "/ a SUSE Linux Enterprise product"
  28. ;;
  29. *)
  30. /usr/bin/lsb_release -r -s > lsb_release.tmp
  31. if test -f lsb_release.tmp; then
  32. read LSB_RELEASE < lsb_release.tmp
  33. case "$LSB_RELEASE" in
  34. *10)
  35. ;;
  36. *10.1)
  37. ;;
  38. *10.2)
  39. ;;
  40. *)
  41. YAST_ENTRY="no"
  42. ;;
  43. esac
  44. rm -f lsb_release.tmp;
  45. fi
  46. echo ""
  47. ;;
  48. esac
  49. rm -f lsb_id.tmp;
  50. else
  51. echo ""
  52. fi
  53. fi
  54. elif test -f /etc/altlinux-release ; then
  55. AC_DEFINE([DISTRO_IS_ALTLINUX],1,[define if the distro is AltLinux])
  56. echo "detected distribution: ALT Linux"
  57. elif test -f /etc/fedora-release ; then
  58. AC_DEFINE([DISTRO_IS_FEDORA],1,[define if the distro is RedHat/Fedora])
  59. echo "detected distribution: RedHat/Fedora"
  60. elif test -f /etc/mandrake-release -o -f /etc/mandriva-release -o -f /etc/mandrakelinux-release; then
  61. AC_DEFINE([DISTRO_IS_MANDRAKE],1,[define if the distro is Mandrake])
  62. echo "detected distribution: Mandrake/Mandriva"
  63. elif test -f /etc/pardus-release ; then
  64. AC_DEFINE([DISTRO_IS_PARDUS],1,[define if the distro is Pardus])
  65. echo "detected distribution: Pardus"
  66. elif test -f /etc/redhat-release ; then
  67. AC_DEFINE([DISTRO_IS_REDHAT],1,[define if the distro is RedHat])
  68. echo "detected distribution: RedHat"
  69. elif test -f /etc/gentoo-release ; then
  70. AC_DEFINE([DISTRO_IS_GENTOO],1,[define if the distro is Gentoo])
  71. echo "detected distribution: Gentoo"
  72. elif test -f /etc/slackware-version ; then
  73. AC_DEFINE([DISTRO_IS_SLACKWARE],1,[define if the distro is Slackware])
  74. echo "detected distribution: Slackware"
  75. elif test -f /etc/debian_version ; then
  76. if test -x /bin/lsb_release ; then
  77. /bin/lsb_release -id -s > lsb_id.tmp
  78. if test -f lsb_id.tmp; then
  79. read LSB_ID < lsb_id.tmp
  80. case "$LSB_ID" in
  81. Ubuntu*)
  82. AC_DEFINE([DISTRO_IS_UBUNTU],1,[define if the distro is Ubuntu/Kubuntu])
  83. echo "detected distribution: Ubuntu/Kubuntu"
  84. ;;
  85. *)
  86. # couldn't detect special derivat, set to Debian
  87. AC_DEFINE([DISTRO_IS_DEBIAN],1,[define if the distro is Debian])
  88. echo "detected distribution: Debian"
  89. ;;
  90. esac
  91. rm -f lsb_id.tmp;
  92. else
  93. # paranoid Fallback
  94. AC_DEFINE([DISTRO_IS_DEBIAN],1,[define if the distro is Debian])
  95. echo "detected distribution: Debian"
  96. fi
  97. else
  98. # Fallback if /bin/lsb_release is not available
  99. AC_DEFINE([DISTRO_IS_DEBIAN],1,[define if the distro is Debian])
  100. echo "detected distribution: Debian"
  101. fi
  102. else
  103. AC_DEFINE([DISTRO_IS_UNKNOW],1,[define if the distro is unknown])
  104. echo "detected distribution: unknown"
  105. fi
  106. if test x$enable_debug_msg = xyes; then
  107. AC_DEFINE([ENABLE_DEBUG_MSG_MODE],1,[Support a verbose mode with debug messages])
  108. echo "enabled debug messages: yes"
  109. else
  110. echo "enabled debug messages: no"
  111. fi
  112. if test x$enable_yast_entry = xyes; then
  113. AC_DEFINE([ENABLE_YAST_ENTRY],1,[Add YaST entry in the applet menu])
  114. echo "enabled YaST menu entry: yes"
  115. else
  116. echo "enabled YaST menu entry: $YAST_ENTRY"
  117. if test x$YAST_ENTRY = xyes; then
  118. AC_DEFINE([ENABLE_YAST_ENTRY],1,[Add YaST entry in the applet menu])
  119. fi
  120. fi
  121. if test x$enable_fake_cpu = xyes; then
  122. AC_DEFINE([FAKE_CPU],1,[Fake /sys and /proc - for developing])
  123. echo "enabled faked sysfs - proc environment: yes"
  124. else
  125. echo "enabled faked sysfs - proc environment: no"
  126. fi
  127. pkg_modules="dbus-1 >= 0.6"
  128. PKG_CHECK_MODULES(PACKAGE, [$pkg_modules])
  129. # get dbus system bus socket
  130. DBUS_SYSTEM_BUS_SOCKET="`pkg-config --variable=system_bus_default_address dbus-1`"
  131. if test -z "$DBUS_SYSTEM_BUS_SOCKET"; then
  132. # use default
  133. DBUS_SYSTEM_BUS_SOCKET="unix:path=/var/run/dbus/system_bus_socket"
  134. fi
  135. AC_DEFINE_UNQUOTED(DBUS_SYSTEM_BUS_SOCKET, ["$DBUS_SYSTEM_BUS_SOCKET"],
  136. [dbus system bus socket path])
  137. # check for dbus qt bindings --> copied from KNetworkmanager
  138. safe_CPPFLAGS=$CPPFLAGS
  139. CPPFLAGS="$CPPFLAGS $PACKAGE_CFLAGS $all_includes"
  140. AC_LANG_SAVE
  141. AC_LANG_CPLUSPLUS
  142. AC_CHECK_HEADER([dbus/connection.h],,[AC_MSG_ERROR([You need D-BUS/Qt3 bindings])])
  143. AC_CHECK_HEADER([dbus/message.h],,[AC_MSG_ERROR([You need D-BUS/Qt3 bindings])])
  144. CPPFLAGS=$safe_CPPFLAGS
  145. AC_LANG_RESTORE
  146. # call needed substitutions
  147. AC_SUBST(PACKAGE_CFLAGS)
  148. AC_SUBST(PACKAGE_LIBS)
  149. AC_SUBST(XGETTEXT)
  150. AC_SUBST(CXXFLAGS)