normalize-0.7.7-m4.patch 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554
  1. --- /m4/extra.m4
  2. +++ /m4/extra.m4
  3. @@ -0,0 +1,550 @@
  4. +# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
  5. +# 2005 Free Software Foundation, Inc.
  6. +# This file is free software; the Free Software Foundation
  7. +# gives unlimited permission to copy and/or distribute it,
  8. +# with or without modifications, as long as this notice is preserved.
  9. +
  10. +# This program is distributed in the hope that it will be useful,
  11. +# but WITHOUT ANY WARRANTY, to the extent permitted by law; without
  12. +# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  13. +# PARTICULAR PURPOSE.
  14. +# Configure paths for GLIB
  15. +# Owen Taylor 97-11-3
  16. +
  17. +dnl AM_PATH_GLIB([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  18. +dnl Test for GLIB, and define GLIB_CFLAGS and GLIB_LIBS, if "gmodule" or
  19. +dnl gthread is specified in MODULES, pass to glib-config
  20. +dnl
  21. +AC_DEFUN(AM_PATH_GLIB,
  22. +[dnl
  23. +dnl Get the cflags and libraries from the glib-config script
  24. +dnl
  25. +AC_ARG_WITH(glib-prefix,[ --with-glib-prefix=PFX Prefix where GLIB is installed (optional)],
  26. + glib_config_prefix="$withval", glib_config_prefix="")
  27. +AC_ARG_WITH(glib-exec-prefix,[ --with-glib-exec-prefix=PFX Exec prefix where GLIB is installed (optional)],
  28. + glib_config_exec_prefix="$withval", glib_config_exec_prefix="")
  29. +AC_ARG_ENABLE(glibtest, [ --disable-glibtest Do not try to compile and run a test GLIB program],
  30. + , enable_glibtest=yes)
  31. +
  32. + if test x$glib_config_exec_prefix != x ; then
  33. + glib_config_args="$glib_config_args --exec-prefix=$glib_config_exec_prefix"
  34. + if test x${GLIB_CONFIG+set} != xset ; then
  35. + GLIB_CONFIG=$glib_config_exec_prefix/bin/glib-config
  36. + fi
  37. + fi
  38. + if test x$glib_config_prefix != x ; then
  39. + glib_config_args="$glib_config_args --prefix=$glib_config_prefix"
  40. + if test x${GLIB_CONFIG+set} != xset ; then
  41. + GLIB_CONFIG=$glib_config_prefix/bin/glib-config
  42. + fi
  43. + fi
  44. +
  45. + for module in . $4
  46. + do
  47. + case "$module" in
  48. + gmodule)
  49. + glib_config_args="$glib_config_args gmodule"
  50. + ;;
  51. + gthread)
  52. + glib_config_args="$glib_config_args gthread"
  53. + ;;
  54. + esac
  55. + done
  56. +
  57. + AC_PATH_PROG(GLIB_CONFIG, glib-config, no)
  58. + min_glib_version=ifelse([$1], ,0.99.7,$1)
  59. + AC_MSG_CHECKING(for GLIB - version >= $min_glib_version)
  60. + no_glib=""
  61. + if test "$GLIB_CONFIG" = "no" ; then
  62. + no_glib=yes
  63. + else
  64. + GLIB_CFLAGS=`$GLIB_CONFIG $glib_config_args --cflags`
  65. + GLIB_LIBS=`$GLIB_CONFIG $glib_config_args --libs`
  66. + glib_config_major_version=`$GLIB_CONFIG $glib_config_args --version | \
  67. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  68. + glib_config_minor_version=`$GLIB_CONFIG $glib_config_args --version | \
  69. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  70. + glib_config_micro_version=`$GLIB_CONFIG $glib_config_args --version | \
  71. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  72. + if test "x$enable_glibtest" = "xyes" ; then
  73. + ac_save_CFLAGS="$CFLAGS"
  74. + ac_save_LIBS="$LIBS"
  75. + CFLAGS="$CFLAGS $GLIB_CFLAGS"
  76. + LIBS="$GLIB_LIBS $LIBS"
  77. +dnl
  78. +dnl Now check if the installed GLIB is sufficiently new. (Also sanity
  79. +dnl checks the results of glib-config to some extent
  80. +dnl
  81. + rm -f conf.glibtest
  82. + AC_TRY_RUN([
  83. +#include <glib.h>
  84. +#include <stdio.h>
  85. +#include <stdlib.h>
  86. +
  87. +int
  88. +main ()
  89. +{
  90. + int major, minor, micro;
  91. + char *tmp_version;
  92. +
  93. + system ("touch conf.glibtest");
  94. +
  95. + /* HP/UX 9 (%@#!) writes to sscanf strings */
  96. + tmp_version = g_strdup("$min_glib_version");
  97. + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  98. + printf("%s, bad version string\n", "$min_glib_version");
  99. + exit(1);
  100. + }
  101. +
  102. + if ((glib_major_version != $glib_config_major_version) ||
  103. + (glib_minor_version != $glib_config_minor_version) ||
  104. + (glib_micro_version != $glib_config_micro_version))
  105. + {
  106. + printf("\n*** 'glib-config --version' returned %d.%d.%d, but GLIB (%d.%d.%d)\n",
  107. + $glib_config_major_version, $glib_config_minor_version, $glib_config_micro_version,
  108. + glib_major_version, glib_minor_version, glib_micro_version);
  109. + printf ("*** was found! If glib-config was correct, then it is best\n");
  110. + printf ("*** to remove the old version of GLIB. You may also be able to fix the error\n");
  111. + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  112. + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  113. + printf("*** required on your system.\n");
  114. + printf("*** If glib-config was wrong, set the environment variable GLIB_CONFIG\n");
  115. + printf("*** to point to the correct copy of glib-config, and remove the file config.cache\n");
  116. + printf("*** before re-running configure\n");
  117. + }
  118. + else if ((glib_major_version != GLIB_MAJOR_VERSION) ||
  119. + (glib_minor_version != GLIB_MINOR_VERSION) ||
  120. + (glib_micro_version != GLIB_MICRO_VERSION))
  121. + {
  122. + printf("*** GLIB header files (version %d.%d.%d) do not match\n",
  123. + GLIB_MAJOR_VERSION, GLIB_MINOR_VERSION, GLIB_MICRO_VERSION);
  124. + printf("*** library (version %d.%d.%d)\n",
  125. + glib_major_version, glib_minor_version, glib_micro_version);
  126. + }
  127. + else
  128. + {
  129. + if ((glib_major_version > major) ||
  130. + ((glib_major_version == major) && (glib_minor_version > minor)) ||
  131. + ((glib_major_version == major) && (glib_minor_version == minor) && (glib_micro_version >= micro)))
  132. + {
  133. + return 0;
  134. + }
  135. + else
  136. + {
  137. + printf("\n*** An old version of GLIB (%d.%d.%d) was found.\n",
  138. + glib_major_version, glib_minor_version, glib_micro_version);
  139. + printf("*** You need a version of GLIB newer than %d.%d.%d. The latest version of\n",
  140. + major, minor, micro);
  141. + printf("*** GLIB is always available from ftp://ftp.gtk.org.\n");
  142. + printf("***\n");
  143. + printf("*** If you have already installed a sufficiently new version, this error\n");
  144. + printf("*** probably means that the wrong copy of the glib-config shell script is\n");
  145. + printf("*** being found. The easiest way to fix this is to remove the old version\n");
  146. + printf("*** of GLIB, but you can also set the GLIB_CONFIG environment to point to the\n");
  147. + printf("*** correct copy of glib-config. (In this case, you will have to\n");
  148. + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  149. + printf("*** so that the correct libraries are found at run-time))\n");
  150. + }
  151. + }
  152. + return 1;
  153. +}
  154. +],, no_glib=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  155. + CFLAGS="$ac_save_CFLAGS"
  156. + LIBS="$ac_save_LIBS"
  157. + fi
  158. + fi
  159. + if test "x$no_glib" = x ; then
  160. + AC_MSG_RESULT(yes)
  161. + ifelse([$2], , :, [$2])
  162. + else
  163. + AC_MSG_RESULT(no)
  164. + if test "$GLIB_CONFIG" = "no" ; then
  165. + echo "*** The glib-config script installed by GLIB could not be found"
  166. + echo "*** If GLIB was installed in PREFIX, make sure PREFIX/bin is in"
  167. + echo "*** your path, or set the GLIB_CONFIG environment variable to the"
  168. + echo "*** full path to glib-config."
  169. + else
  170. + if test -f conf.glibtest ; then
  171. + :
  172. + else
  173. + echo "*** Could not run GLIB test program, checking why..."
  174. + CFLAGS="$CFLAGS $GLIB_CFLAGS"
  175. + LIBS="$LIBS $GLIB_LIBS"
  176. + AC_TRY_LINK([
  177. +#include <glib.h>
  178. +#include <stdio.h>
  179. +], [ return ((glib_major_version) || (glib_minor_version) || (glib_micro_version)); ],
  180. + [ echo "*** The test program compiled, but did not run. This usually means"
  181. + echo "*** that the run-time linker is not finding GLIB or finding the wrong"
  182. + echo "*** version of GLIB. If it is not finding GLIB, you'll need to set your"
  183. + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  184. + echo "*** to the installed location Also, make sure you have run ldconfig if that"
  185. + echo "*** is required on your system"
  186. + echo "***"
  187. + echo "*** If you have an old version installed, it is best to remove it, although"
  188. + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  189. + echo "***"
  190. + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  191. + echo "*** came with the system with the command"
  192. + echo "***"
  193. + echo "*** rpm --erase --nodeps gtk gtk-devel" ],
  194. + [ echo "*** The test program failed to compile or link. See the file config.log for the"
  195. + echo "*** exact error that occured. This usually means GLIB was incorrectly installed"
  196. + echo "*** or that you have moved GLIB since it was installed. In the latter case, you"
  197. + echo "*** may want to edit the glib-config script: $GLIB_CONFIG" ])
  198. + CFLAGS="$ac_save_CFLAGS"
  199. + LIBS="$ac_save_LIBS"
  200. + fi
  201. + fi
  202. + GLIB_CFLAGS=""
  203. + GLIB_LIBS=""
  204. + ifelse([$3], , :, [$3])
  205. + fi
  206. + AC_SUBST(GLIB_CFLAGS)
  207. + AC_SUBST(GLIB_LIBS)
  208. + rm -f conf.glibtest
  209. +])
  210. +
  211. +# Configure paths for GTK+
  212. +# Owen Taylor 97-11-3
  213. +
  214. +dnl AM_PATH_GTK([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND [, MODULES]]]])
  215. +dnl Test for GTK, and define GTK_CFLAGS and GTK_LIBS
  216. +dnl
  217. +AC_DEFUN(AM_PATH_GTK,
  218. +[dnl
  219. +dnl Get the cflags and libraries from the gtk-config script
  220. +dnl
  221. +AC_ARG_WITH(gtk-prefix,[ --with-gtk-prefix=PFX Prefix where GTK is installed (optional)],
  222. + gtk_config_prefix="$withval", gtk_config_prefix="")
  223. +AC_ARG_WITH(gtk-exec-prefix,[ --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)],
  224. + gtk_config_exec_prefix="$withval", gtk_config_exec_prefix="")
  225. +AC_ARG_ENABLE(gtktest, [ --disable-gtktest Do not try to compile and run a test GTK program],
  226. + , enable_gtktest=yes)
  227. +
  228. + for module in . $4
  229. + do
  230. + case "$module" in
  231. + gthread)
  232. + gtk_config_args="$gtk_config_args gthread"
  233. + ;;
  234. + esac
  235. + done
  236. +
  237. + if test x$gtk_config_exec_prefix != x ; then
  238. + gtk_config_args="$gtk_config_args --exec-prefix=$gtk_config_exec_prefix"
  239. + if test x${GTK_CONFIG+set} != xset ; then
  240. + GTK_CONFIG=$gtk_config_exec_prefix/bin/gtk-config
  241. + fi
  242. + fi
  243. + if test x$gtk_config_prefix != x ; then
  244. + gtk_config_args="$gtk_config_args --prefix=$gtk_config_prefix"
  245. + if test x${GTK_CONFIG+set} != xset ; then
  246. + GTK_CONFIG=$gtk_config_prefix/bin/gtk-config
  247. + fi
  248. + fi
  249. +
  250. + AC_PATH_PROG(GTK_CONFIG, gtk-config, no)
  251. + min_gtk_version=ifelse([$1], ,0.99.7,$1)
  252. + AC_MSG_CHECKING(for GTK - version >= $min_gtk_version)
  253. + no_gtk=""
  254. + if test "$GTK_CONFIG" = "no" ; then
  255. + no_gtk=yes
  256. + else
  257. + GTK_CFLAGS=`$GTK_CONFIG $gtk_config_args --cflags`
  258. + GTK_LIBS=`$GTK_CONFIG $gtk_config_args --libs`
  259. + gtk_config_major_version=`$GTK_CONFIG $gtk_config_args --version | \
  260. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  261. + gtk_config_minor_version=`$GTK_CONFIG $gtk_config_args --version | \
  262. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  263. + gtk_config_micro_version=`$GTK_CONFIG $gtk_config_args --version | \
  264. + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  265. + if test "x$enable_gtktest" = "xyes" ; then
  266. + ac_save_CFLAGS="$CFLAGS"
  267. + ac_save_LIBS="$LIBS"
  268. + CFLAGS="$CFLAGS $GTK_CFLAGS"
  269. + LIBS="$GTK_LIBS $LIBS"
  270. +dnl
  271. +dnl Now check if the installed GTK is sufficiently new. (Also sanity
  272. +dnl checks the results of gtk-config to some extent
  273. +dnl
  274. + rm -f conf.gtktest
  275. + AC_TRY_RUN([
  276. +#include <gtk/gtk.h>
  277. +#include <stdio.h>
  278. +#include <stdlib.h>
  279. +
  280. +int
  281. +main ()
  282. +{
  283. + int major, minor, micro;
  284. + char *tmp_version;
  285. +
  286. + system ("touch conf.gtktest");
  287. +
  288. + /* HP/UX 9 (%@#!) writes to sscanf strings */
  289. + tmp_version = g_strdup("$min_gtk_version");
  290. + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
  291. + printf("%s, bad version string\n", "$min_gtk_version");
  292. + exit(1);
  293. + }
  294. +
  295. + if ((gtk_major_version != $gtk_config_major_version) ||
  296. + (gtk_minor_version != $gtk_config_minor_version) ||
  297. + (gtk_micro_version != $gtk_config_micro_version))
  298. + {
  299. + printf("\n*** 'gtk-config --version' returned %d.%d.%d, but GTK+ (%d.%d.%d)\n",
  300. + $gtk_config_major_version, $gtk_config_minor_version, $gtk_config_micro_version,
  301. + gtk_major_version, gtk_minor_version, gtk_micro_version);
  302. + printf ("*** was found! If gtk-config was correct, then it is best\n");
  303. + printf ("*** to remove the old version of GTK+. You may also be able to fix the error\n");
  304. + printf("*** by modifying your LD_LIBRARY_PATH enviroment variable, or by editing\n");
  305. + printf("*** /etc/ld.so.conf. Make sure you have run ldconfig if that is\n");
  306. + printf("*** required on your system.\n");
  307. + printf("*** If gtk-config was wrong, set the environment variable GTK_CONFIG\n");
  308. + printf("*** to point to the correct copy of gtk-config, and remove the file config.cache\n");
  309. + printf("*** before re-running configure\n");
  310. + }
  311. +#if defined (GTK_MAJOR_VERSION) && defined (GTK_MINOR_VERSION) && defined (GTK_MICRO_VERSION)
  312. + else if ((gtk_major_version != GTK_MAJOR_VERSION) ||
  313. + (gtk_minor_version != GTK_MINOR_VERSION) ||
  314. + (gtk_micro_version != GTK_MICRO_VERSION))
  315. + {
  316. + printf("*** GTK+ header files (version %d.%d.%d) do not match\n",
  317. + GTK_MAJOR_VERSION, GTK_MINOR_VERSION, GTK_MICRO_VERSION);
  318. + printf("*** library (version %d.%d.%d)\n",
  319. + gtk_major_version, gtk_minor_version, gtk_micro_version);
  320. + }
  321. +#endif /* defined (GTK_MAJOR_VERSION) ... */
  322. + else
  323. + {
  324. + if ((gtk_major_version > major) ||
  325. + ((gtk_major_version == major) && (gtk_minor_version > minor)) ||
  326. + ((gtk_major_version == major) && (gtk_minor_version == minor) && (gtk_micro_version >= micro)))
  327. + {
  328. + return 0;
  329. + }
  330. + else
  331. + {
  332. + printf("\n*** An old version of GTK+ (%d.%d.%d) was found.\n",
  333. + gtk_major_version, gtk_minor_version, gtk_micro_version);
  334. + printf("*** You need a version of GTK+ newer than %d.%d.%d. The latest version of\n",
  335. + major, minor, micro);
  336. + printf("*** GTK+ is always available from ftp://ftp.gtk.org.\n");
  337. + printf("***\n");
  338. + printf("*** If you have already installed a sufficiently new version, this error\n");
  339. + printf("*** probably means that the wrong copy of the gtk-config shell script is\n");
  340. + printf("*** being found. The easiest way to fix this is to remove the old version\n");
  341. + printf("*** of GTK+, but you can also set the GTK_CONFIG environment to point to the\n");
  342. + printf("*** correct copy of gtk-config. (In this case, you will have to\n");
  343. + printf("*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf\n");
  344. + printf("*** so that the correct libraries are found at run-time))\n");
  345. + }
  346. + }
  347. + return 1;
  348. +}
  349. +],, no_gtk=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  350. + CFLAGS="$ac_save_CFLAGS"
  351. + LIBS="$ac_save_LIBS"
  352. + fi
  353. + fi
  354. + if test "x$no_gtk" = x ; then
  355. + AC_MSG_RESULT(yes)
  356. + ifelse([$2], , :, [$2])
  357. + else
  358. + AC_MSG_RESULT(no)
  359. + if test "$GTK_CONFIG" = "no" ; then
  360. + echo "*** The gtk-config script installed by GTK could not be found"
  361. + echo "*** If GTK was installed in PREFIX, make sure PREFIX/bin is in"
  362. + echo "*** your path, or set the GTK_CONFIG environment variable to the"
  363. + echo "*** full path to gtk-config."
  364. + else
  365. + if test -f conf.gtktest ; then
  366. + :
  367. + else
  368. + echo "*** Could not run GTK test program, checking why..."
  369. + CFLAGS="$CFLAGS $GTK_CFLAGS"
  370. + LIBS="$LIBS $GTK_LIBS"
  371. + AC_TRY_LINK([
  372. +#include <gtk/gtk.h>
  373. +#include <stdio.h>
  374. +], [ return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ],
  375. + [ echo "*** The test program compiled, but did not run. This usually means"
  376. + echo "*** that the run-time linker is not finding GTK or finding the wrong"
  377. + echo "*** version of GTK. If it is not finding GTK, you'll need to set your"
  378. + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  379. + echo "*** to the installed location Also, make sure you have run ldconfig if that"
  380. + echo "*** is required on your system"
  381. + echo "***"
  382. + echo "*** If you have an old version installed, it is best to remove it, although"
  383. + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"
  384. + echo "***"
  385. + echo "*** If you have a RedHat 5.0 system, you should remove the GTK package that"
  386. + echo "*** came with the system with the command"
  387. + echo "***"
  388. + echo "*** rpm --erase --nodeps gtk gtk-devel" ],
  389. + [ echo "*** The test program failed to compile or link. See the file config.log for the"
  390. + echo "*** exact error that occured. This usually means GTK was incorrectly installed"
  391. + echo "*** or that you have moved GTK since it was installed. In the latter case, you"
  392. + echo "*** may want to edit the gtk-config script: $GTK_CONFIG" ])
  393. + CFLAGS="$ac_save_CFLAGS"
  394. + LIBS="$ac_save_LIBS"
  395. + fi
  396. + fi
  397. + GTK_CFLAGS=""
  398. + GTK_LIBS=""
  399. + ifelse([$3], , :, [$3])
  400. + fi
  401. + AC_SUBST(GTK_CFLAGS)
  402. + AC_SUBST(GTK_LIBS)
  403. + rm -f conf.gtktest
  404. +])
  405. +
  406. +# CFLAGS and library paths for XMMS
  407. +# written 15 December 1999 by Ben Gertzfield <che@debian.org>
  408. +
  409. +dnl Usage:
  410. +dnl AM_PATH_XMMS([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
  411. +dnl
  412. +dnl Example:
  413. +dnl AM_PATH_XMMS(0.9.5.1, , AC_MSG_ERROR([*** XMMS >= 0.9.5.1 not installed - please install first ***]))
  414. +dnl
  415. +dnl Defines XMMS_CFLAGS, XMMS_LIBS, XMMS_DATA_DIR, XMMS_PLUGIN_DIR,
  416. +dnl XMMS_VISUALIZATION_PLUGIN_DIR, XMMS_INPUT_PLUGIN_DIR,
  417. +dnl XMMS_OUTPUT_PLUGIN_DIR, XMMS_GENERAL_PLUGIN_DIR, XMMS_EFFECT_PLUGIN_DIR,
  418. +dnl and XMMS_VERSION for your plugin pleasure.
  419. +dnl
  420. +
  421. +dnl XMMS_TEST_VERSION(AVAILABLE-VERSION, NEEDED-VERSION [, ACTION-IF-OKAY [, ACTION-IF-NOT-OKAY]])
  422. +AC_DEFUN(XMMS_TEST_VERSION, [
  423. +
  424. +# Determine which version number is greater. Prints 2 to stdout if
  425. +# the second number is greater, 1 if the first number is greater,
  426. +# 0 if the numbers are equal.
  427. +
  428. +# Written 15 December 1999 by Ben Gertzfield <che@debian.org>
  429. +# Revised 15 December 1999 by Jim Monty <monty@primenet.com>
  430. +
  431. + AC_PROG_AWK
  432. + xmms_got_version=[` $AWK ' \
  433. +BEGIN { \
  434. + print vercmp(ARGV[1], ARGV[2]); \
  435. +} \
  436. + \
  437. +function vercmp(ver1, ver2, ver1arr, ver2arr, \
  438. + ver1len, ver2len, \
  439. + ver1int, ver2int, len, i, p) { \
  440. + \
  441. + ver1len = split(ver1, ver1arr, /\./); \
  442. + ver2len = split(ver2, ver2arr, /\./); \
  443. + \
  444. + len = ver1len > ver2len ? ver1len : ver2len; \
  445. + \
  446. + for (i = 1; i <= len; i++) { \
  447. + p = 1000 ^ (len - i); \
  448. + ver1int += ver1arr[i] * p; \
  449. + ver2int += ver2arr[i] * p; \
  450. + } \
  451. + \
  452. + if (ver1int < ver2int) \
  453. + return 2; \
  454. + else if (ver1int > ver2int) \
  455. + return 1; \
  456. + else \
  457. + return 0; \
  458. +}' $1 $2`]
  459. +
  460. + if test $xmms_got_version -eq 2; then # failure
  461. + ifelse([$4], , :, $4)
  462. + else # success!
  463. + ifelse([$3], , :, $3)
  464. + fi
  465. +])
  466. +
  467. +AC_DEFUN(AM_PATH_XMMS,
  468. +[
  469. +AC_ARG_WITH(xmms-prefix,[ --with-xmms-prefix=PFX Prefix where XMMS is installed (optional)],
  470. + xmms_config_prefix="$withval", xmms_config_prefix="")
  471. +AC_ARG_WITH(xmms-exec-prefix,[ --with-xmms-exec-prefix=PFX Exec prefix where XMMS is installed (optional)],
  472. + xmms_config_exec_prefix="$withval", xmms_config_exec_prefix="")
  473. +
  474. +if test x$xmms_config_exec_prefix != x; then
  475. + xmms_config_args="$xmms_config_args --exec-prefix=$xmms_config_exec_prefix"
  476. + if test x${XMMS_CONFIG+set} != xset; then
  477. + XMMS_CONFIG=$xmms_config_exec_prefix/bin/xmms-config
  478. + fi
  479. +fi
  480. +
  481. +if test x$xmms_config_prefix != x; then
  482. + xmms_config_args="$xmms_config_args --prefix=$xmms_config_prefix"
  483. + if test x${XMMS_CONFIG+set} != xset; then
  484. + XMMS_CONFIG=$xmms_config_prefix/bin/xmms-config
  485. + fi
  486. +fi
  487. +
  488. +AC_PATH_PROG(XMMS_CONFIG, xmms-config, no)
  489. +min_xmms_version=ifelse([$1], ,0.9.5.1, $1)
  490. +
  491. +if test "$XMMS_CONFIG" = "no"; then
  492. + no_xmms=yes
  493. +else
  494. + XMMS_CFLAGS=`$XMMS_CONFIG $xmms_config_args --cflags`
  495. + XMMS_LIBS=`$XMMS_CONFIG $xmms_config_args --libs`
  496. + XMMS_VERSION=`$XMMS_CONFIG $xmms_config_args --version`
  497. + XMMS_DATA_DIR=`$XMMS_CONFIG $xmms_config_args --data-dir`
  498. + XMMS_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args --plugin-dir`
  499. + XMMS_VISUALIZATION_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args \
  500. + --visualization-plugin-dir`
  501. + XMMS_INPUT_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args --input-plugin-dir`
  502. + XMMS_OUTPUT_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args --output-plugin-dir`
  503. + XMMS_EFFECT_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args --effect-plugin-dir`
  504. + XMMS_GENERAL_PLUGIN_DIR=`$XMMS_CONFIG $xmms_config_args --general-plugin-dir`
  505. +
  506. + XMMS_TEST_VERSION($XMMS_VERSION, $min_xmms_version, ,no_xmms=version)
  507. +fi
  508. +
  509. +AC_MSG_CHECKING(for XMMS - version >= $min_xmms_version)
  510. +
  511. +if test "x$no_xmms" = x; then
  512. + AC_MSG_RESULT(yes)
  513. + ifelse([$2], , :, [$2])
  514. +else
  515. + AC_MSG_RESULT(no)
  516. +
  517. + if test "$XMMS_CONFIG" = "no" ; then
  518. + echo "*** The xmms-config script installed by XMMS could not be found."
  519. + echo "*** If XMMS was installed in PREFIX, make sure PREFIX/bin is in"
  520. + echo "*** your path, or set the XMMS_CONFIG environment variable to the"
  521. + echo "*** full path to xmms-config."
  522. + else
  523. + if test "$no_xmms" = "version"; then
  524. + echo "*** An old version of XMMS, $XMMS_VERSION, was found."
  525. + echo "*** You need a version of XMMS newer than $min_xmms_version."
  526. + echo "*** The latest version of XMMS is always available from"
  527. + echo "*** http://www.xmms.org/"
  528. + echo "***"
  529. +
  530. + echo "*** If you have already installed a sufficiently new version, this error"
  531. + echo "*** probably means that the wrong copy of the xmms-config shell script is"
  532. + echo "*** being found. The easiest way to fix this is to remove the old version"
  533. + echo "*** of XMMS, but you can also set the XMMS_CONFIG environment to point to the"
  534. + echo "*** correct copy of xmms-config. (In this case, you will have to"
  535. + echo "*** modify your LD_LIBRARY_PATH enviroment variable, or edit /etc/ld.so.conf"
  536. + echo "*** so that the correct libraries are found at run-time)"
  537. + fi
  538. + fi
  539. + XMMS_CFLAGS=""
  540. + XMMS_LIBS=""
  541. + ifelse([$3], , :, [$3])
  542. +fi
  543. +AC_SUBST(XMMS_CFLAGS)
  544. +AC_SUBST(XMMS_LIBS)
  545. +AC_SUBST(XMMS_VERSION)
  546. +AC_SUBST(XMMS_DATA_DIR)
  547. +AC_SUBST(XMMS_PLUGIN_DIR)
  548. +AC_SUBST(XMMS_VISUALIZATION_PLUGIN_DIR)
  549. +AC_SUBST(XMMS_INPUT_PLUGIN_DIR)
  550. +AC_SUBST(XMMS_OUTPUT_PLUGIN_DIR)
  551. +AC_SUBST(XMMS_GENERAL_PLUGIN_DIR)
  552. +AC_SUBST(XMMS_EFFECT_PLUGIN_DIR)
  553. +])