1 --- autotrace-0.31.1/acinclude.m4.orig Thu Jan 1 01:00:00 1970
2 +++ autotrace-0.31.1/acinclude.m4 Wed Dec 18 22:37:33 2002
4 +# a macro to get the libs/cflags for libpstoedit
5 +# Copyed from gdk-pixbuf.m4
7 +dnl AM_PATH_PSTOEDIT([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
8 +dnl Test to see if libpstoedit is installed, and define PSTOEDIT_CFLAGS, LIBS
10 +AC_DEFUN(AM_PATH_PSTOEDIT,
12 +dnl Get the cflags and libraries from the pstoedit-config script
14 +AC_ARG_WITH(pstoedit-prefix,[ --with-pstoedit-prefix=PFX Prefix where Pstoedit is installed (optional)],
15 + pstoedit_prefix="$withval", pstoedit_prefix="")
16 +AC_ARG_WITH(pstoedit-exec-prefix,[ --with-pstoedit-exec-prefix=PFX Exec prefix where Pstoedit is installed (optional)],
17 + pstoedit_exec_prefix="$withval", pstoedit_exec_prefix="")
18 +AC_ARG_ENABLE(pstoedittest, [ --disable-pstoedittest Do not try to compile and run a test Pstoedit program],
19 + , enable_pstoedittest=yes)
21 + if test x$pstoedit_exec_prefix != x ; then
22 + pstoedit_args="$pstoedit_args --exec_prefix=$pstoedit_exec_prefix"
23 + if test x${PSTOEDIT_CONFIG+set} != xset ; then
24 + PSTOEDIT_CONFIG=$pstoedit_exec_prefix/bin/pstoedit-config
27 + if test x$pstoedit_prefix != x ; then
28 + pstoedit_args="$pstoedit_args --prefix=$pstoedit_prefix"
29 + if test x${PSTOEDIT_CONFIG+set} != xset ; then
30 + PSTOEDIT_CONFIG=$pstoedit_prefix/bin/pstoedit-config
34 + AC_PATH_PROG(PSTOEDIT_CONFIG, pstoedit-config, no)
35 + min_pstoedit_version=ifelse([$1], ,3.32.0,$1)
36 + AC_MSG_CHECKING(for PSTOEDIT - version >= $min_pstoedit_version)
38 + if test "$PSTOEDIT_CONFIG" = "no" ; then
41 + PSTOEDIT_CFLAGS=`$PSTOEDIT_CONFIG $pstoedit_args --cflags`
42 + PSTOEDIT_LIBS=`$PSTOEDIT_CONFIG $pstoedit_args --libs`
44 + pstoedit_major_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \
45 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
46 + pstoedit_minor_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \
47 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
48 + pstoedit_micro_version=`$PSTOEDIT_CONFIG $pstoedit_args --version | \
49 + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
50 + if test "x$enable_pstoedittest" = "xyes" ; then
51 + ac_save_CFLAGS="$CFLAGS"
52 + ac_save_LIBS="$LIBS"
53 + CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS"
54 + LIBS="$PSTOEDIT_LIBS $LIBS"
56 +dnl Now check if the installed PSTOEDIT is sufficiently new. (Also sanity
57 +dnl checks the results of pstoedit-config to some extent
59 + rm -f conf.pstoedittest
64 +#include <pstoedit/pstoedit.h>
67 +my_strdup (char *str)
73 + new_str = malloc ((strlen (str) + 1) * sizeof(char));
74 + strcpy (new_str, str);
84 + int major, minor, micro;
87 + system ("touch conf.pstoedittest");
89 + /* HP/UX 9 (%@#!) writes to sscanf strings */
90 + tmp_version = my_strdup("$min_pstoedit_version");
91 + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
92 + printf("%s, bad version string\n", "$min_pstoedit_version");
96 + if (($pstoedit_major_version > major) ||
97 + (($pstoedit_major_version == major) && ($pstoedit_minor_version > minor)) ||
98 + (($pstoedit_major_version == major) && ($pstoedit_minor_version == minor) && ($pstoedit_micro_version >= micro)))
104 + printf("\n*** 'pstoedit-config --version' returned %d.%d.%d, but the minimum version\n", $pstoedit_major_version, $pstoedit_minor_version, $pstoedit_micro_version);
105 + printf("*** of PSTOEDIT required is %d.%d.%d. If pstoedit-config is correct, then it is\n", major, minor, micro);
106 + printf("*** best to upgrade to the required version.\n");
107 + printf("*** If pstoedit-config was wrong, set the environment variable PSTOEDIT_CONFIG\n");
108 + printf("*** to point to the correct copy of pstoedit-config, and remove the file\n");
109 + printf("*** config.cache before re-running configure\n");
113 +],, no_pstoedit=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
114 + CFLAGS="$ac_save_CFLAGS"
115 + LIBS="$ac_save_LIBS"
118 + if test "x$no_pstoedit" = x ; then
120 + ifelse([$2], , :, [$2])
123 + if test "$PSTOEDIT_CONFIG" = "no" ; then
124 + echo "*** The pstoedit-config script installed by PSTOEDIT could not be found"
125 + echo "*** If PSTOEDIT was installed in PREFIX, make sure PREFIX/bin is in"
126 + echo "*** your path, or set the PSTOEDIT_CONFIG environment variable to the"
127 + echo "*** full path to pstoedit-config."
129 + if test -f conf.pstoedittest ; then
132 + echo "*** Could not run PSTOEDIT test program, checking why..."
133 + CFLAGS="$CFLAGS $PSTOEDIT_CFLAGS"
134 + LIBS="$LIBS $PSTOEDIT_LIBS"
137 +#include <pstoedit/pstoedit.h>
139 + [ echo "*** The test program compiled, but did not run. This usually means"
140 + echo "*** that the run-time linker is not finding PSTOEDIT or finding the wrong"
141 + echo "*** version of PSTOEDIT. If it is not finding PSTOEDIT, you'll need to set your"
142 + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
143 + echo "*** to the installed location Also, make sure you have run ldconfig if that"
144 + echo "*** is required on your system"
146 + echo "*** If you have an old version installed, it is best to remove it, although"
147 + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
148 + [ echo "*** The test program failed to compile or link. See the file config.log for the"
149 + echo "*** exact error that occured. This usually means PSTOEDIT was incorrectly installed"
150 + echo "*** or that you have moved PSTOEDIT since it was installed. In the latter case, you"
151 + echo "*** may want to edit the pstoedit-config script: $PSTOEDIT_CONFIG" ])
152 + CFLAGS="$ac_save_CFLAGS"
153 + LIBS="$ac_save_LIBS"
158 + ifelse([$3], , :, [$3])
160 + AC_SUBST(PSTOEDIT_CFLAGS)
161 + AC_SUBST(PSTOEDIT_LIBS)
162 + rm -f conf.pstoedittest