m4/artsc.m4

Tue, 14 Feb 2006 05:43:43 +0000

author
Richard Laager <rlaager@pidgin.im>
date
Tue, 14 Feb 2006 05:43:43 +0000
changeset 13281
3558cb15ebb9
parent 2179
27b003c6830f
permissions
-rw-r--r--

[gaim-migrate @ 15646]
Always show a vertical scrollbar on conversations imhtmls. This will solve the shrinking conversation window bug. I chose this approach instead of saving the size of the window (as I had previous talked about), as this prevents the contents of the scrollback from rewrapping when the scrollbars appear or disappear. It also just seems to feel like the right thing to do, but maybe that's me being lazy.

2179
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
1 dnl Test for the ArtsC interface.
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
2
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
3 AC_DEFUN([AM_PATH_ARTSC],
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
4 [
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
5 AC_ARG_ENABLE(artsc-test,
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
6 [ --disable-artsc-test Do not compile and run a test ArtsC program.],
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
7 [artsc_test="yes"],
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
8 [artsc_test="no"])
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
9
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
10 dnl Search for the arts-config program.
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
11 AC_PATH_PROG(ARTSC_CONFIG, artsc-config, no)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
12 min_artsc_version=ifelse([$1],,0.9.5,$1)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
13 AC_MSG_CHECKING(for ArtsC - version >= $min_artsc_version)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
14
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
15 no_artsc=""
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
16 if test "x$ARTSC_CONFIG" != "xno"; then
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
17 ARTSC_CFLAGS=`$ARTSC_CONFIG --cflags`
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
18 ARTSC_LIBS=`$ARTSC_CONFIG --libs`
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
19
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
20 artsc_major_version=`$ARTSC_CONFIG $artsc_args --version | \
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
21 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
22 artsc_minor_version=`$ARTSC_CONFIG $artsc_args --version | \
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
23 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
24 artsc_micro_version=`$ARTSC_CONFIG $artsc_config_args --version | \
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
25 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
26
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
27 # Test if a simple ArtsC program can be created.
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
28 if test "x$artsc_test" = "xyes"; then
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
29 ac_save_CFLAGS="$CFLAGS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
30 ac_save_LIBS="$LIBS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
31 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
32 LIBS="$LIBS $ARTSC_LIBS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
33
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
34 rm -f conf.artsc
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
35 AC_TRY_RUN([
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
36 #include <stdio.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
37 #include <stdlib.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
38 #include <string.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
39
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
40 #include <artsc.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
41
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
42 char*
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
43 my_strdup(char *str)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
44 {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
45 char *new_str;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
46
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
47 if (str) {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
48 new_str = malloc((strlen(str) + 1) * sizeof(char));
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
49 strcpy(new_str, str);
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
50 } else {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
51 new_str = NULL;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
52 }
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
53
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
54 return new_str;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
55 }
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
56
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
57 int main()
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
58 {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
59 int major, minor, micro;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
60 char *tmp_version;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
61
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
62 system ("touch conf.artsc");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
63
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
64 /* HP/UX 9 writes to sscanf strings */
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
65 tmp_version = my_strdup("$min_artsc_version");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
66 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
67 printf("%s, bad version string\n", "$min_artsc_version");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
68 exit(1);
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
69 }
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
70
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
71 if (($artsc_major_version > major) ||
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
72 (($artsc_major_version == major) && ($artsc_minor_version > minor)) ||
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
73 (($artsc_major_version == major) && ($artsc_minor_version == minor)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
74 && ($artsc_micro_version >= micro))) {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
75 return 0;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
76 } else {
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
77 printf("\n*** 'artsc-config --version' returned %d.%d.%d, but the minimum version\n", $artsc_major_version, $artsc_minor_version, $artsc_micro_version);
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
78 printf("*** of ARTSC required is %d.%d.%d. If artsc-config is correct, then it is\n", major, minor, micro);
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
79 printf("*** best to upgrade to the required version.\n");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
80 printf("*** If artsc-config was wrong, set the environment variable ARTSC_CONFIG\n");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
81 printf("*** to point to the correct copy of artsc-config, and remove the file\n");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
82 printf("*** config.cache before re-running configure\n");
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
83 return 1;
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
84 }
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
85 }
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
86 ],, no_artsc=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
87 CFLAGS="$ac_save_CFLAGS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
88 LIBS="$ac_save_LIBS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
89 fi
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
90 else
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
91 no_artsc=yes
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
92 fi
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
93
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
94 if test "x$no_artsc" != "xyes"; then
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
95 AC_MSG_RESULT(yes)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
96 ifelse([$2], , :, [$2])
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
97 else
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
98 AC_MSG_RESULT(no)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
99
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
100 if test "x$ARTSC_CONFIG" = "xno" ; then
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
101 echo "*** The artsc-config script installed by ArtsC could not be found"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
102 echo "*** If ArtsC was installed in PREFIX, make sure PREFIX/bin is in"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
103 echo "*** your path, or set the ARTSC_CONFIG environment variable to the"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
104 echo "*** full path to artsc-config."
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
105 else
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
106 if test -f conf.artsc ; then
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
107 :
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
108 else
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
109 echo "*** Could not run ArtsC test program, checking why..."
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
110 CFLAGS="$CFLAGS $ARTSC_CFLAGS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
111 LIBS="$LIBS $ARTSC_LIBS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
112 AC_TRY_LINK([
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
113 #include <stdio.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
114 #include <artsc.h>
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
115 ],[return 0;],
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
116 [ echo "*** The test program compiled, but did not run. This usually means"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
117 echo "*** that the run-time linker is not finding ArtsC or finding the wrong"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
118 echo "*** version of ArtsC. If it is not finding ArtsC, you'll need to set your"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
119 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
120 echo "*** to the installed location Also, make sure you have run ldconfig if that"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
121 echo "*** is required on your system"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
122 echo "***"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
123 echo "*** If you have an old version installed, it is best to remove it, although"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
124 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
125 [ echo "*** The test program failed to compile or link. See the file config.log for the"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
126 echo "*** exact error that occured. This usually means ArtsC was incorrectly installed"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
127 echo "*** or that you have moved ArtsC since it was installed. In the latter case, you"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
128 echo "*** may want to edit the artsc-config script: $ARTSC_CONFIG" ])
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
129 CFLAGS="$ac_save_CFLAGS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
130 LIBS="$ac_save_LIBS"
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
131 fi
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
132 fi
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
133 ARTSC_CFLAGS=""
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
134 ARTSC_LIBS=""
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
135 ifelse([$3], , :, [$3])
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
136 fi
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
137
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
138 AC_SUBST(ARTSC_CFLAGS)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
139 AC_SUBST(ARTSC_LIBS)
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
140 rm -f conf.artsc
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
141
27b003c6830f [gaim-migrate @ 2189]
Tom Dyas
parents:
diff changeset
142 ])

mercurial