1 # Local macros for the SDL configure.in script
3 dnl Function to link an architecture specific file
4 dnl LINK_ARCH_SRC(source_dir, arch, source_file)
5 AC_DEFUN([COPY_ARCH_SRC],
10 echo "Creating directory $1"
13 echo "Copying $old -> $new"
15 /* WARNING: This file was automatically generated!
25 # Configure paths for ESD
26 # Manish Singh 98-9-30
27 # stolen back from Frank Belew
28 # stolen from Manish Singh
29 # Shamelessly stolen from Owen Taylor
31 dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
32 dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
34 AC_DEFUN([AM_PATH_ESD],
36 dnl Get the cflags and libraries from the esd-config script
38 AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
39 esd_prefix="$withval", esd_prefix="")
40 AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
41 esd_exec_prefix="$withval", esd_exec_prefix="")
42 AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
45 if test x$esd_exec_prefix != x ; then
46 esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
47 if test x${ESD_CONFIG+set} != xset ; then
48 ESD_CONFIG=$esd_exec_prefix/bin/esd-config
51 if test x$esd_prefix != x ; then
52 esd_args="$esd_args --prefix=$esd_prefix"
53 if test x${ESD_CONFIG+set} != xset ; then
54 ESD_CONFIG=$esd_prefix/bin/esd-config
58 AC_PATH_PROG(ESD_CONFIG, esd-config, no)
59 min_esd_version=ifelse([$1], ,0.2.7,$1)
60 AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
62 if test "$ESD_CONFIG" = "no" ; then
65 ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
66 ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
68 esd_major_version=`$ESD_CONFIG $esd_args --version | \
69 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
70 esd_minor_version=`$ESD_CONFIG $esd_args --version | \
71 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
72 esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
73 sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
74 if test "x$enable_esdtest" = "xyes" ; then
75 ac_save_CFLAGS="$CFLAGS"
77 CFLAGS="$CFLAGS $ESD_CFLAGS"
78 LIBS="$LIBS $ESD_LIBS"
80 dnl Now check if the installed ESD is sufficiently new. (Also sanity
81 dnl checks the results of esd-config to some extent
97 new_str = malloc ((strlen (str) + 1) * sizeof(char));
98 strcpy (new_str, str);
108 int major, minor, micro;
111 system ("touch conf.esdtest");
113 /* HP/UX 9 (%@#!) writes to sscanf strings */
114 tmp_version = my_strdup("$min_esd_version");
115 if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
116 printf("%s, bad version string\n", "$min_esd_version");
120 if (($esd_major_version > major) ||
121 (($esd_major_version == major) && ($esd_minor_version > minor)) ||
122 (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
128 printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
129 printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
130 printf("*** best to upgrade to the required version.\n");
131 printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
132 printf("*** to point to the correct copy of esd-config, and remove the file\n");
133 printf("*** config.cache before re-running configure\n");
138 ],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
139 CFLAGS="$ac_save_CFLAGS"
143 if test "x$no_esd" = x ; then
145 ifelse([$2], , :, [$2])
148 if test "$ESD_CONFIG" = "no" ; then
149 echo "*** The esd-config script installed by ESD could not be found"
150 echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
151 echo "*** your path, or set the ESD_CONFIG environment variable to the"
152 echo "*** full path to esd-config."
154 if test -f conf.esdtest ; then
157 echo "*** Could not run ESD test program, checking why..."
158 CFLAGS="$CFLAGS $ESD_CFLAGS"
159 LIBS="$LIBS $ESD_LIBS"
164 [ echo "*** The test program compiled, but did not run. This usually means"
165 echo "*** that the run-time linker is not finding ESD or finding the wrong"
166 echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
167 echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
168 echo "*** to the installed location Also, make sure you have run ldconfig if that"
169 echo "*** is required on your system"
171 echo "*** If you have an old version installed, it is best to remove it, although"
172 echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
173 [ echo "*** The test program failed to compile or link. See the file config.log for the"
174 echo "*** exact error that occured. This usually means ESD was incorrectly installed"
175 echo "*** or that you have moved ESD since it was installed. In the latter case, you"
176 echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
177 CFLAGS="$ac_save_CFLAGS"
183 ifelse([$3], , :, [$3])