/[crust]/crust/libs/GraphicsFoundation/aclocal.m4
ViewVC logotype

Diff of /crust/libs/GraphicsFoundation/aclocal.m4

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by jrydberg, Sun Aug 26 20:46:03 2001 UTC revision 1.2 by jrydberg, Mon Aug 27 22:29:49 2001 UTC
# Line 10  dnl but WITHOUT ANY WARRANTY, to the ext Line 10  dnl but WITHOUT ANY WARRANTY, to the ext
10  dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A  dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A
11  dnl PARTICULAR PURPOSE.  dnl PARTICULAR PURPOSE.
12    
13    dnl NAUTILUS_PATH_FREETYPE2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
14    dnl Test for FreeType2, and define FREETYPE2_CFLAGS and FREETYPE2_LIBS
15    dnl
16    dnl Shamelessly cut-n-pasted from AM_PATH_LIBART
17    dnl
18    dnl Renamed to AM_PATH_FREETYPE2 since we have no relation with Nautilus.
19    AC_DEFUN(AM_PATH_FREETYPE2,
20    [dnl
21    dnl Get the cflags and libraries from the freetype-config script
22    dnl
23    AC_ARG_WITH(freetype2-prefix,[  --with-freetype2-prefix=PFX   Prefix where FREETYPE2 is installed (optional)],
24                freetype2_prefix="$withval", freetype2_prefix="")
25    AC_ARG_WITH(freetype2-exec-prefix,[  --with-freetype2-exec-prefix=PFX Exec prefix where FREETYPE2 is installed (optional)],
26                freetype2_exec_prefix="$withval", freetype2_exec_prefix="")
27    AC_ARG_ENABLE(freetype2test, [  --disable-freetype2test       Do not try to compile and run a test FREETYPE2 program],
28                        , enable_freetype2test=yes)
29    
30      if test x$freetype2_exec_prefix != x ; then
31         freetype2_args="$freetype2_args --exec-prefix=$freetype2_exec_prefix"
32         if test x${FREETYPE2_CONFIG+set} != xset ; then
33            FREETYPE2_CONFIG=$freetype2_exec_prefix/bin/freetype-config
34         fi
35      fi
36      if test x$freetype2_prefix != x ; then
37         freetype2_args="$freetype2_args --prefix=$freetype2_prefix"
38         if test x${FREETYPE2_CONFIG+set} != xset ; then
39            FREETYPE2_CONFIG=$freetype2_prefix/bin/freetype-config
40         fi
41      fi
42    
43      AC_PATH_PROG(FREETYPE2_CONFIG, freetype-config, no)
44      min_freetype2_version=ifelse([$1], ,0.2.5,$1)
45      AC_MSG_CHECKING(for FREETYPE2 - version >= $min_freetype2_version)
46      no_freetype2=""
47      if test "$FREETYPE2_CONFIG" = "no" ; then
48        no_freetype2=yes
49      else
50        FREETYPE2_CFLAGS=`$FREETYPE2_CONFIG $freetype2conf_args --cflags`
51        FREETYPE2_LIBS=`$FREETYPE2_CONFIG $freetype2conf_args --libs`
52    
53        freetype2_major_version=`$FREETYPE2_CONFIG $freetype2_args --version | \
54            sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\1/'`
55        freetype2_minor_version=`$FREETYPE2_CONFIG $freetype2_args --version | \
56            sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\2/'`
57        freetype2_micro_version=`$FREETYPE2_CONFIG $freetype2_args --version | \
58            sed 's/\([[0-9]]*\)[[:.]]\([[0-9]]*\)[[:.]]\([[0-9]]*\)/\3/'`
59    
60        if test "x$enable_freetype2test" = "xyes" ; then
61          ac_save_CFLAGS="$CFLAGS"
62          ac_save_LIBS="$LIBS"
63          CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
64          LIBS="$LIBS $FREETYPE2_LIBS"
65    dnl
66    dnl Now check if the installed FREETYPE2 is sufficiently new. (Also sanity
67    dnl checks the results of freetype-config to some extent
68    dnl
69          rm -f conf.freetype2test
70          AC_TRY_RUN([
71    #include <stdio.h>
72    #include <stdlib.h>
73    #include <string.h>
74    #include <freetype/freetype.h>
75    
76    char*
77    my_strdup (char *str)
78    {
79      char *new_str;
80      
81      if (str)
82        {
83          new_str = malloc ((strlen (str) + 1) * sizeof(char));
84          strcpy (new_str, str);
85        }
86      else
87        new_str = NULL;
88      
89      return new_str;
90    }
91    
92    int main ()
93    {
94      int major, minor, micro;
95      char *tmp_version;
96    
97      system ("touch conf.freetype2test");
98    
99      /* HP/UX 9 (%@#!) writes to sscanf strings */
100      tmp_version = my_strdup("$min_freetype2_version");
101      if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
102         printf("%s, bad version string\n", "$min_freetype2_version");
103         exit(1);
104       }
105    
106       if (($freetype2_major_version > major) ||
107          (($freetype2_major_version == major) && ($freetype2_minor_version > minor)) ||
108          (($freetype2_major_version == major) && ($freetype2_minor_version == minor) && ($freetype2_micro_version >= micro)))
109        {
110          return 0;
111        }
112      else
113        {
114          printf("\n");
115          printf("*** \n");
116          printf("*** 'freetype-config --version' returned %d.%d.%d, but the minimum version\n", $freetype2_major_version, $freetype2_minor_version, $freetype2_micro_version);
117          printf("*** of FREETYPE2 required is %d.%d.%d. If freetype-config is correct, then it is\n", major, minor, micro);
118          printf("*** best to upgrade to the required version.\n");
119          printf("*** If freetype-config was wrong, set the environment variable FREETYPE2_CONFIG\n");
120          printf("*** to point to the correct copy of freetype-config, and remove the file\n");
121          printf("*** config.cache before re-running configure\n");
122          printf("*** \n");
123    
124          return 1;
125        }
126    }
127    
128    ],, no_freetype2=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
129           CFLAGS="$ac_save_CFLAGS"
130           LIBS="$ac_save_LIBS"
131         fi
132      fi
133      if test "x$no_freetype2" = x ; then
134         AC_MSG_RESULT(yes)
135         ifelse([$2], , :, [$2])    
136      else
137         AC_MSG_RESULT(no)
138         if test "$FREETYPE2_CONFIG" = "no" ; then
139           echo "*** The freetype-config script installed by FREETYPE2 could not be found"
140           echo "*** If FREETYPE2 was installed in PREFIX, make sure PREFIX/bin is in"
141           echo "*** your path, or set the FREETYPE2_CONFIG environment variable to the"
142           echo "*** full path to freetype-config."
143         else
144           if test -f conf.freetype2test ; then
145            :
146           else
147              echo "*** Could not run FREETYPE2 test program, checking why..."
148              CFLAGS="$CFLAGS $FREETYPE2_CFLAGS"
149              LIBS="$LIBS $FREETYPE2_LIBS"
150              AC_TRY_LINK([
151    #include <stdio.h>
152    #include <freetype/freetype.h>
153    ],      [ return 0; ],
154            [ echo "*** The test program compiled, but did not run. This usually means"
155              echo "*** that the run-time linker is not finding FREETYPE2 or finding the wrong"
156              echo "*** version of FREETYPE2. If it is not finding FREETYPE2, you'll need to set your"
157              echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
158              echo "*** to the installed location  Also, make sure you have run ldconfig if that"
159              echo "*** is required on your system"
160              echo "***"
161              echo "*** If you have an old version installed, it is best to remove it, although"
162              echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
163            [ echo "*** The test program failed to compile or link. See the file config.log for the"
164              echo "*** exact error that occured. This usually means FREETYPE2 was incorrectly installed"
165              echo "*** or that you have moved FREETYPE2 since it was installed. In the latter case, you"
166              echo "*** may want to edit the freetype-config script: $FREETYPE2_CONFIG" ])
167              CFLAGS="$ac_save_CFLAGS"
168              LIBS="$ac_save_LIBS"
169           fi
170         fi
171         FREETYPE2_CFLAGS=""
172         FREETYPE2_LIBS=""
173         ifelse([$3], , :, [$3])
174      fi
175      AC_SUBST(FREETYPE2_CFLAGS)
176      AC_SUBST(FREETYPE2_LIBS)
177      rm -f conf.freetype2test
178    ])
179    
180    # Configure paths for LIBART
181    # Raph Levien 98-11-18
182    # stolen from Manish Singh    98-9-30
183    # stolen back from Frank Belew
184    # stolen from Manish Singh
185    # Shamelessly stolen from Owen Taylor
186    
187    dnl AM_PATH_LIBART([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
188    dnl Test for LIBART, and define LIBART_CFLAGS and LIBART_LIBS
189    dnl
190    AC_DEFUN(AM_PATH_LIBART,
191    [dnl
192    dnl Get the cflags and libraries from the libart-config script
193    dnl
194    AC_ARG_WITH(libart-prefix,[  --with-libart-prefix=PFX   Prefix where LIBART is installed (optional)],
195                libart_prefix="$withval", libart_prefix="")
196    AC_ARG_WITH(libart-exec-prefix,[  --with-libart-exec-prefix=PFX Exec prefix where LIBART is installed (optional)],
197                libart_exec_prefix="$withval", libart_exec_prefix="")
198    AC_ARG_ENABLE(libarttest, [  --disable-libarttest       Do not try to compile and run a test LIBART program],
199                        , enable_libarttest=yes)
200    
201      if test x$libart_exec_prefix != x ; then
202         libart_args="$libart_args --exec-prefix=$libart_exec_prefix"
203         if test x${LIBART_CONFIG+set} != xset ; then
204            LIBART_CONFIG=$libart_exec_prefix/bin/libart-config
205         fi
206      fi
207      if test x$libart_prefix != x ; then
208         libart_args="$libart_args --prefix=$libart_prefix"
209         if test x${LIBART_CONFIG+set} != xset ; then
210            LIBART_CONFIG=$libart_prefix/bin/libart-config
211         fi
212      fi
213    
214      AC_PATH_PROG(LIBART_CONFIG, libart-config, no)
215      min_libart_version=ifelse([$1], ,0.2.5,$1)
216      AC_MSG_CHECKING(for LIBART - version >= $min_libart_version)
217      no_libart=""
218      if test "$LIBART_CONFIG" = "no" ; then
219        no_libart=yes
220      else
221        LIBART_CFLAGS=`$LIBART_CONFIG $libartconf_args --cflags`
222        LIBART_LIBS=`$LIBART_CONFIG $libartconf_args --libs`
223    
224        libart_major_version=`$LIBART_CONFIG $libart_args --version | \
225               sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
226        libart_minor_version=`$LIBART_CONFIG $libart_args --version | \
227               sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
228        libart_micro_version=`$LIBART_CONFIG $libart_config_args --version | \
229               sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
230        if test "x$enable_libarttest" = "xyes" ; then
231          ac_save_CFLAGS="$CFLAGS"
232          ac_save_LIBS="$LIBS"
233          CFLAGS="$CFLAGS $LIBART_CFLAGS"
234          LIBS="$LIBS $LIBART_LIBS"
235    dnl
236    dnl Now check if the installed LIBART is sufficiently new. (Also sanity
237    dnl checks the results of libart-config to some extent
238    dnl
239          rm -f conf.libarttest
240          AC_TRY_RUN([
241    #include <stdio.h>
242    #include <stdlib.h>
243    #include <string.h>
244    #include <libart_lgpl/libart.h>
245    
246    char*
247    my_strdup (char *str)
248    {
249      char *new_str;
250      
251      if (str)
252        {
253          new_str = malloc ((strlen (str) + 1) * sizeof(char));
254          strcpy (new_str, str);
255        }
256      else
257        new_str = NULL;
258      
259      return new_str;
260    }
261    
262    int main ()
263    {
264      int major, minor, micro;
265      char *tmp_version;
266    
267      system ("touch conf.libarttest");
268    
269      /* HP/UX 9 (%@#!) writes to sscanf strings */
270      tmp_version = my_strdup("$min_libart_version");
271      if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3) {
272         printf("%s, bad version string\n", "$min_libart_version");
273         exit(1);
274       }
275    
276       if (($libart_major_version > major) ||
277          (($libart_major_version == major) && ($libart_minor_version > minor)) ||
278          (($libart_major_version == major) && ($libart_minor_version == minor) && ($libart_micro_version >= micro)))
279        {
280          return 0;
281        }
282      else
283        {
284          printf("\n*** 'libart-config --version' returned %d.%d.%d, but the minimum version\n", $libart_major_version, $libart_minor_version, $libart_micro_version);
285          printf("*** of LIBART required is %d.%d.%d. If libart-config is correct, then it is\n", major, minor, micro);
286          printf("*** best to upgrade to the required version.\n");
287          printf("*** If libart-config was wrong, set the environment variable LIBART_CONFIG\n");
288          printf("*** to point to the correct copy of libart-config, and remove the file\n");
289          printf("*** config.cache before re-running configure\n");
290          return 1;
291        }
292    }
293    
294    ],, no_libart=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
295           CFLAGS="$ac_save_CFLAGS"
296           LIBS="$ac_save_LIBS"
297         fi
298      fi
299      if test "x$no_libart" = x ; then
300         AC_MSG_RESULT(yes)
301         ifelse([$2], , :, [$2])    
302      else
303         AC_MSG_RESULT(no)
304         if test "$LIBART_CONFIG" = "no" ; then
305           echo "*** The libart-config script installed by LIBART could not be found"
306           echo "*** If LIBART was installed in PREFIX, make sure PREFIX/bin is in"
307           echo "*** your path, or set the LIBART_CONFIG environment variable to the"
308           echo "*** full path to libart-config."
309         else
310           if test -f conf.libarttest ; then
311            :
312           else
313              echo "*** Could not run LIBART test program, checking why..."
314              CFLAGS="$CFLAGS $LIBART_CFLAGS"
315              LIBS="$LIBS $LIBART_LIBS"
316              AC_TRY_LINK([
317    #include <stdio.h>
318    #include <libart_lgpl/libart.h>
319    ],      [ return 0; ],
320            [ echo "*** The test program compiled, but did not run. This usually means"
321              echo "*** that the run-time linker is not finding LIBART or finding the wrong"
322              echo "*** version of LIBART. If it is not finding LIBART, you'll need to set your"
323              echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
324              echo "*** to the installed location  Also, make sure you have run ldconfig if that"
325              echo "*** is required on your system"
326              echo "***"
327              echo "*** If you have an old version installed, it is best to remove it, although"
328              echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
329            [ echo "*** The test program failed to compile or link. See the file config.log for the"
330              echo "*** exact error that occured. This usually means LIBART was incorrectly installed"
331              echo "*** or that you have moved LIBART since it was installed. In the latter case, you"
332              echo "*** may want to edit the libart-config script: $LIBART_CONFIG" ])
333              CFLAGS="$ac_save_CFLAGS"
334              LIBS="$ac_save_LIBS"
335           fi
336         fi
337         LIBART_CFLAGS=""
338         LIBART_LIBS=""
339         ifelse([$3], , :, [$3])
340      fi
341      AC_SUBST(LIBART_CFLAGS)
342      AC_SUBST(LIBART_LIBS)
343      rm -f conf.libarttest
344    ])
345    
346  # Do all the work for Automake.  This macro actually does too much --  # Do all the work for Automake.  This macro actually does too much --
347  # some checks are only needed if your package does certain things.  # some checks are only needed if your package does certain things.
348  # But this isn't really a big deal.  # But this isn't really a big deal.

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26