home *** CD-ROM | disk | FTP | other *** search
/ Chip 2004 July / CMCD0704.ISO / Software / Freeware / Utilitare / VisualBoyAdvance-1.7.2 / acinclude.m4 < prev    next >
Encoding:
M4 Source File  |  2004-04-25  |  27.0 KB  |  803 lines

  1. # Configure paths for SDL
  2. # Sam Lantinga 9/21/99
  3. # stolen from Manish Singh
  4. # stolen back from Frank Belew
  5. # stolen from Manish Singh
  6. # Shamelessly stolen from Owen Taylor
  7.  
  8. dnl AM_PATH_SDL([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
  9. dnl Test for SDL, and define SDL_CFLAGS and SDL_LIBS
  10. dnl
  11. AC_DEFUN(AM_PATH_SDL,
  12. [dnl 
  13. dnl Get the cflags and libraries from the sdl-config script
  14. dnl
  15. AC_ARG_WITH(sdl-prefix,[  --with-sdl-prefix=PFX   Prefix where SDL is installed (optional)],
  16.             sdl_prefix="$withval", sdl_prefix="")
  17. AC_ARG_WITH(sdl-exec-prefix,[  --with-sdl-exec-prefix=PFX Exec prefix where SDL is installed (optional)],
  18.             sdl_exec_prefix="$withval", sdl_exec_prefix="")
  19. AC_ARG_ENABLE(sdltest, [  --disable-sdltest       Do not try to compile and run a test SDL program],
  20.             , enable_sdltest=yes)
  21.  
  22.   if test x$sdl_exec_prefix != x ; then
  23.      sdl_args="$sdl_args --exec-prefix=$sdl_exec_prefix"
  24.      if test x${SDL_CONFIG+set} != xset ; then
  25.         SDL_CONFIG=$sdl_exec_prefix/bin/sdl-config
  26.      fi
  27.   fi
  28.   if test x$sdl_prefix != x ; then
  29.      sdl_args="$sdl_args --prefix=$sdl_prefix"
  30.      if test x${SDL_CONFIG+set} != xset ; then
  31.         SDL_CONFIG=$sdl_prefix/bin/sdl-config
  32.      fi
  33.   fi
  34.  
  35.   AC_REQUIRE([AC_CANONICAL_TARGET])
  36.   AC_PATH_PROG(SDL_CONFIG, sdl-config, no)
  37.   min_sdl_version=ifelse([$1], ,0.11.0,$1)
  38.   AC_MSG_CHECKING(for SDL - version >= $min_sdl_version)
  39.   no_sdl=""
  40.   if test "$SDL_CONFIG" = "no" ; then
  41.     no_sdl=yes
  42.   else
  43.     SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags`
  44.     SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs`
  45.  
  46.     sdl_major_version=`$SDL_CONFIG $sdl_args --version | \
  47.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  48.     sdl_minor_version=`$SDL_CONFIG $sdl_args --version | \
  49.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  50.     sdl_micro_version=`$SDL_CONFIG $sdl_config_args --version | \
  51.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  52.     if test "x$enable_sdltest" = "xyes" ; then
  53.       ac_save_CFLAGS="$CFLAGS"
  54.       ac_save_LIBS="$LIBS"
  55.       CFLAGS="$CFLAGS $SDL_CFLAGS"
  56.       LIBS="$LIBS $SDL_LIBS"
  57. dnl
  58. dnl Now check if the installed SDL is sufficiently new. (Also sanity
  59. dnl checks the results of sdl-config to some extent
  60. dnl
  61.       rm -f conf.sdltest
  62.       AC_TRY_RUN([
  63. #include <stdio.h>
  64. #include <stdlib.h>
  65. #include <string.h>
  66. #include "SDL.h"
  67.  
  68. char*
  69. my_strdup (char *str)
  70. {
  71.   char *new_str;
  72.   
  73.   if (str)
  74.     {
  75.       new_str = (char *)malloc ((strlen (str) + 1) * sizeof(char));
  76.       strcpy (new_str, str);
  77.     }
  78.   else
  79.     new_str = NULL;
  80.   
  81.   return new_str;
  82. }
  83.  
  84. int main (int argc, char *argv[])
  85. {
  86.   int major, minor, micro;
  87.   char *tmp_version;
  88.  
  89.   /* This hangs on some systems (?)
  90.   system ("touch conf.sdltest");
  91.   */
  92.   { FILE *fp = fopen("conf.sdltest", "a"); if ( fp ) fclose(fp); }
  93.  
  94.   /* HP/UX 9 (%@#!) writes to sscanf strings */
  95.   tmp_version = my_strdup("$min_sdl_version");
  96.   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
  97.      printf("%s, bad version string\n", "$min_sdl_version");
  98.      exit(1);
  99.    }
  100.  
  101.    if (($sdl_major_version > major) ||
  102.       (($sdl_major_version == major) && ($sdl_minor_version > minor)) ||
  103.       (($sdl_major_version == major) && ($sdl_minor_version == minor) && ($sdl_micro_version >= micro)))
  104.     {
  105.       return 0;
  106.     }
  107.   else
  108.     {
  109.       printf("\n*** 'sdl-config --version' returned %d.%d.%d, but the minimum version\n", $sdl_major_version, $sdl_minor_version, $sdl_micro_version);
  110.       printf("*** of SDL required is %d.%d.%d. If sdl-config is correct, then it is\n", major, minor, micro);
  111.       printf("*** best to upgrade to the required version.\n");
  112.       printf("*** If sdl-config was wrong, set the environment variable SDL_CONFIG\n");
  113.       printf("*** to point to the correct copy of sdl-config, and remove the file\n");
  114.       printf("*** config.cache before re-running configure\n");
  115.       return 1;
  116.     }
  117. }
  118.  
  119. ],, no_sdl=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  120.        CFLAGS="$ac_save_CFLAGS"
  121.        LIBS="$ac_save_LIBS"
  122.      fi
  123.   fi
  124.   if test "x$no_sdl" = x ; then
  125.      AC_MSG_RESULT(yes)
  126.      ifelse([$2], , :, [$2])     
  127.   else
  128.      AC_MSG_RESULT(no)
  129.      if test "$SDL_CONFIG" = "no" ; then
  130.        echo "*** The sdl-config script installed by SDL could not be found"
  131.        echo "*** If SDL was installed in PREFIX, make sure PREFIX/bin is in"
  132.        echo "*** your path, or set the SDL_CONFIG environment variable to the"
  133.        echo "*** full path to sdl-config."
  134.      else
  135.        if test -f conf.sdltest ; then
  136.         :
  137.        else
  138.           echo "*** Could not run SDL test program, checking why..."
  139.           CFLAGS="$CFLAGS $SDL_CFLAGS"
  140.           LIBS="$LIBS $SDL_LIBS"
  141.           AC_TRY_LINK([
  142. #include <stdio.h>
  143. #include "SDL.h"
  144.  
  145. int main(int argc, char *argv[])
  146. { return 0; }
  147. #undef  main
  148. #define main K_and_R_C_main
  149. ],      [ return 0; ],
  150.         [ echo "*** The test program compiled, but did not run. This usually means"
  151.           echo "*** that the run-time linker is not finding SDL or finding the wrong"
  152.           echo "*** version of SDL. If it is not finding SDL, you'll need to set your"
  153.           echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
  154.           echo "*** to the installed location  Also, make sure you have run ldconfig if that"
  155.           echo "*** is required on your system"
  156.       echo "***"
  157.           echo "*** If you have an old version installed, it is best to remove it, although"
  158.           echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
  159.         [ echo "*** The test program failed to compile or link. See the file config.log for the"
  160.           echo "*** exact error that occured. This usually means SDL was incorrectly installed"
  161.           echo "*** or that you have moved SDL since it was installed. In the latter case, you"
  162.           echo "*** may want to edit the sdl-config script: $SDL_CONFIG" ])
  163.           CFLAGS="$ac_save_CFLAGS"
  164.           LIBS="$ac_save_LIBS"
  165.        fi
  166.      fi
  167.      SDL_CFLAGS=""
  168.      SDL_LIBS=""
  169.      ifelse([$3], , :, [$3])
  170.   fi
  171.   AC_SUBST(SDL_CFLAGS)
  172.   AC_SUBST(SDL_LIBS)
  173.   rm -f conf.sdltest
  174. ])
  175. # Configure paths for SMPEG
  176. # Nicolas Vignal 11/19/2000
  177. # stolen from Sam Lantinga
  178. # stolen from Manish Singh
  179. # stolen back from Frank Belew
  180. # stolen from Manish Singh
  181. # Shamelessly stolen from Owen Taylor
  182.  
  183. dnl AM_PATH_SMPEG([MINIMUM-VERSION, [ACTION-IF-FOUND [, 
  184. ACTION-IF-NOT-FOUND]]])
  185. dnl Test for SMPEG, and define SMPEG_CFLAGS and SMPEG_LIBS
  186. dnl
  187. AC_DEFUN(AM_PATH_SMPEG,
  188. [dnl
  189. dnl Get the cflags and libraries from the smpeg-config script
  190. dnl
  191. AC_ARG_WITH(smpeg-prefix,[  --with-smpeg-prefix=PFX   Prefix where SMPEG is 
  192. installed (optional)],
  193.             smpeg_prefix="$withval", smpeg_prefix="")
  194. AC_ARG_WITH(smpeg-exec-prefix,[  --with-smpeg-exec-prefix=PFX Exec prefix 
  195. where SMPEG is installed (optional)],
  196.             smpeg_exec_prefix="$withval", smpeg_exec_prefix="")
  197. AC_ARG_ENABLE(smpegtest, [  --disable-smpegtest       Do not try to compile 
  198. and run a test SMPEG program],
  199.                     , enable_smpegtest=yes)
  200.  
  201.   if test x$smpeg_exec_prefix != x ; then
  202.      smpeg_args="$smpeg_args --exec-prefix=$smpeg_exec_prefix"
  203.      if test x${SMPEG_CONFIG+set} != xset ; then
  204.         SMPEG_CONFIG=$smpeg_exec_prefix/bin/smpeg-config
  205.      fi
  206.   fi
  207.   if test x$smpeg_prefix != x ; then
  208.      smpeg_args="$smpeg_args --prefix=$smpeg_prefix"
  209.      if test x${SMPEG_CONFIG+set} != xset ; then
  210.         SMPEG_CONFIG=$smpeg_prefix/bin/smpeg-config
  211.      fi
  212.   fi
  213.  
  214.   AC_PATH_PROG(SMPEG_CONFIG, smpeg-config, no)
  215.   min_smpeg_version=ifelse([$1], ,0.2.7,$1)
  216.   AC_MSG_CHECKING(for SMPEG - version >= $min_smpeg_version)
  217.   no_smpeg=""
  218.   if test "$SMPEG_CONFIG" = "no" ; then
  219.     no_smpeg=yes
  220.   else
  221.     SMPEG_CFLAGS=`$SMPEG_CONFIG $smpegconf_args --cflags`
  222.     SMPEG_LIBS=`$SMPEG_CONFIG $smpegconf_args --libs`
  223.  
  224.     smpeg_major_version=`$SMPEG_CONFIG $smpeg_args --version | \
  225.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
  226.     smpeg_minor_version=`$SMPEG_CONFIG $smpeg_args --version | \
  227.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
  228.     smpeg_micro_version=`$SMPEG_CONFIG $smpeg_config_args --version | \
  229.            sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
  230.     if test "x$enable_smpegtest" = "xyes" ; then
  231.       ac_save_CFLAGS="$CFLAGS"
  232.       ac_save_LIBS="$LIBS"
  233.       CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
  234.       LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
  235. dnl
  236. dnl Now check if the installed SMPEG is sufficiently new. (Also sanity
  237. dnl checks the results of smpeg-config to some extent
  238. dnl
  239.       rm -f conf.smpegtest
  240.       AC_TRY_RUN([
  241. #include <stdio.h>
  242. #include <stdlib.h>
  243. #include <string.h>
  244. #include "smpeg.h"
  245.  
  246. char*
  247. my_strdup (char *str)
  248. {
  249.   char *new_str;
  250.  
  251.   if (str)
  252.     {
  253.       new_str = (char *)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 (int argc, char *argv[])
  263. {
  264.   int major, minor, micro;
  265.   char *tmp_version;
  266.  
  267.   /* This hangs on some systems (?)
  268.   system ("touch conf.smpegtest");
  269.   */
  270.   { FILE *fp = fopen("conf.smpegtest", "a"); if ( fp ) fclose(fp); }
  271.  
  272.   /* HP/UX 9 (%@#!) writes to sscanf strings */
  273.   tmp_version = my_strdup("$min_smpeg_version");
  274.   if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
  275.      printf("%s, bad version string\n", "$min_smpeg_version");
  276.      exit(1);
  277.    }
  278.  
  279.    if (($smpeg_major_version > major) ||
  280.       (($smpeg_major_version == major) && ($smpeg_minor_version > minor)) ||
  281.       (($smpeg_major_version == major) && ($smpeg_minor_version == minor) 
  282. && ($smpeg_micro_version >= micro)))
  283.     {
  284.       return 0;
  285.     }
  286.   else
  287.     {
  288.       printf("\n*** 'smpeg-config --version' returned %d.%d.%d, but the 
  289. minimum version\n", $smpeg_major_version, $smpeg_minor_version, 
  290. $smpeg_micro_version);
  291.       printf("*** of SMPEG required is %d.%d.%d. If smpeg-config is 
  292. correct, then it is\n", major, minor, micro);
  293.       printf("*** best to upgrade to the required version.\n");
  294.       printf("*** If smpeg-config was wrong, set the environment variable 
  295. SMPEG_CONFIG\n");
  296.       printf("*** to point to the correct copy of smpeg-config, and remove 
  297. the file\n");
  298.       printf("*** config.cache before re-running configure\n");
  299.       return 1;
  300.     }
  301. }
  302.  
  303. ],, no_smpeg=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
  304.        CFLAGS="$ac_save_CFLAGS"
  305.        LIBS="$ac_save_LIBS"
  306.      fi
  307.   fi
  308.   if test "x$no_smpeg" = x ; then
  309.      AC_MSG_RESULT(yes)
  310.      ifelse([$2], , :, [$2])
  311.   else
  312.      AC_MSG_RESULT(no)
  313.      if test "$SMPEG_CONFIG" = "no" ; then
  314.        echo "*** The smpeg-config script installed by SMPEG could not be 
  315. found"
  316.        echo "*** If SMPEG was installed in PREFIX, make sure PREFIX/bin is 
  317. in"
  318.        echo "*** your path, or set the SMPEG_CONFIG environment variable to 
  319. the"
  320.        echo "*** full path to smpeg-config."
  321.      else
  322.        if test -f conf.smpegtest ; then
  323.         :
  324.        else
  325.           echo "*** Could not run SMPEG test program, checking why..."
  326.           CFLAGS="$CFLAGS $SMPEG_CFLAGS $SDL_CFLAGS"
  327.           LIBS="$LIBS $SMPEG_LIBS $SDL_LIBS"
  328.           AC_TRY_LINK([
  329. #include <stdio.h>
  330. #include "smpeg.h"
  331. ],      [ return 0; ],
  332.         [ echo "*** The test program compiled, but did not run. This 
  333. usually means"
  334.           echo "*** that the run-time linker is not finding SMPEG or 
  335. finding the wrong"
  336.           echo "*** version of SMPEG. If it is not finding SMPEG, you'll 
  337. need to set your"
  338.           echo "*** LD_LIBRARY_PATH environment variable, or edit 
  339. /etc/ld.so.conf to point"
  340.           echo "*** to the installed location  Also, make sure you have run 
  341. ldconfig if that"
  342.           echo "*** is required on your system"
  343.           echo "***"
  344.           echo "*** If you have an old version installed, it is best to 
  345. remove it, although"
  346.           echo "*** you may also be able to get things to work by modifying 
  347. LD_LIBRARY_PATH"],
  348.         [ echo "*** The test program failed to compile or link. See the 
  349. file config.log for the"
  350.           echo "*** exact error that occured. This usually means SMPEG was 
  351. incorrectly installed"
  352.           echo "*** or that you have moved SMPEG since it was installed. In 
  353. the latter case, you"
  354.           echo "*** may want to edit the smpeg-config script: 
  355. $SMPEG_CONFIG" ])
  356.           CFLAGS="$ac_save_CFLAGS"
  357.           LIBS="$ac_save_LIBS"
  358.        fi
  359.      fi
  360.      SMPEG_CFLAGS=""
  361.      SMPEG_LIBS=""
  362.      ifelse([$3], , :, [$3])
  363.   fi
  364.   AC_SUBST(SMPEG_CFLAGS)
  365.   AC_SUBST(SMPEG_LIBS)
  366.   rm -f conf.smpegtest
  367. ])
  368. ## libtool.m4 - Configure libtool for the target system. -*-Shell-script-*-
  369. ## Copyright (C) 1996-1999, 2000 Free Software Foundation, Inc.
  370. ## Originally by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
  371. ##
  372. ## This program is free software; you can redistribute it and/or modify
  373. ## it under the terms of the GNU General Public License as published by
  374. ## the Free Software Foundation; either version 2 of the License, or
  375. ## (at your option) any later version.
  376. ##
  377. ## This program is distributed in the hope that it will be useful, but
  378. ## WITHOUT ANY WARRANTY; without even the implied warranty of
  379. ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  380. ## General Public License for more details.
  381. ##
  382. ## You should have received a copy of the GNU General Public License
  383. ## along with this program; if not, write to the Free Software
  384. ## Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  385. ##
  386. ## As a special exception to the GNU General Public License, if you
  387. ## distribute this file as part of a program that contains a
  388. ## configuration script generated by Autoconf, you may include it under
  389. ## the same distribution terms that you use for the rest of that program.
  390.  
  391. # serial 40 AC_PROG_LIBTOOL
  392. AC_DEFUN(AC_PROG_LIBTOOL,
  393. [AC_REQUIRE([AC_LIBTOOL_SETUP])dnl
  394.  
  395. # Save cache, so that ltconfig can load it
  396. AC_CACHE_SAVE
  397.  
  398. # Actually configure libtool.  ac_aux_dir is where install-sh is found.
  399. CC="$CC" CFLAGS="$CFLAGS" CPPFLAGS="$CPPFLAGS" \
  400. LD="$LD" LDFLAGS="$LDFLAGS" LIBS="$LIBS" \
  401. LN_S="$LN_S" NM="$NM" RANLIB="$RANLIB" \
  402. DLLTOOL="$DLLTOOL" AS="$AS" OBJDUMP="$OBJDUMP" \
  403. ${CONFIG_SHELL-/bin/sh} $ac_aux_dir/ltconfig --no-reexec \
  404. $libtool_flags --no-verify $ac_aux_dir/ltmain.sh $lt_target \
  405. || AC_MSG_ERROR([libtool configure failed])
  406.  
  407. # Reload cache, that may have been modified by ltconfig
  408. AC_CACHE_LOAD
  409.  
  410. # This can be used to rebuild libtool when needed
  411. LIBTOOL_DEPS="$ac_aux_dir/ltconfig $ac_aux_dir/ltmain.sh"
  412.  
  413. # Always use our own libtool.
  414. LIBTOOL='$(SHELL) $(top_builddir)/libtool'
  415. AC_SUBST(LIBTOOL)dnl
  416.  
  417. # Redirect the config.log output again, so that the ltconfig log is not
  418. # clobbered by the next message.
  419. exec 5>>./config.log
  420. ])
  421.  
  422. AC_DEFUN(AC_LIBTOOL_SETUP,
  423. [AC_PREREQ(2.13)dnl
  424. AC_REQUIRE([AC_ENABLE_SHARED])dnl
  425. AC_REQUIRE([AC_ENABLE_STATIC])dnl
  426. AC_REQUIRE([AC_ENABLE_FAST_INSTALL])dnl
  427. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  428. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  429. AC_REQUIRE([AC_PROG_RANLIB])dnl
  430. AC_REQUIRE([AC_PROG_CC])dnl
  431. AC_REQUIRE([AC_PROG_LD])dnl
  432. AC_REQUIRE([AC_PROG_NM])dnl
  433. AC_REQUIRE([AC_PROG_LN_S])dnl
  434. dnl
  435.  
  436. case "$target" in
  437. NONE) lt_target="$host" ;;
  438. *) lt_target="$target" ;;
  439. esac
  440.  
  441. # Check for any special flags to pass to ltconfig.
  442. libtool_flags="--cache-file=$cache_file"
  443. test "$enable_shared" = no && libtool_flags="$libtool_flags --disable-shared"
  444. test "$enable_static" = no && libtool_flags="$libtool_flags --disable-static"
  445. test "$enable_fast_install" = no && libtool_flags="$libtool_flags --disable-fast-install"
  446. test "$ac_cv_prog_gcc" = yes && libtool_flags="$libtool_flags --with-gcc"
  447. test "$ac_cv_prog_gnu_ld" = yes && libtool_flags="$libtool_flags --with-gnu-ld"
  448. ifdef([AC_PROVIDE_AC_LIBTOOL_DLOPEN],
  449. [libtool_flags="$libtool_flags --enable-dlopen"])
  450. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  451. [libtool_flags="$libtool_flags --enable-win32-dll"])
  452. AC_ARG_ENABLE(libtool-lock,
  453.   [  --disable-libtool-lock  avoid locking (might break parallel builds)])
  454. test "x$enable_libtool_lock" = xno && libtool_flags="$libtool_flags --disable-lock"
  455. test x"$silent" = xyes && libtool_flags="$libtool_flags --silent"
  456.  
  457. # Some flags need to be propagated to the compiler or linker for good
  458. # libtool support.
  459. case "$lt_target" in
  460. *-*-irix6*)
  461.   # Find out which ABI we are using.
  462.   echo '[#]line __oline__ "configure"' > conftest.$ac_ext
  463.   if AC_TRY_EVAL(ac_compile); then
  464.     case "`/usr/bin/file conftest.o`" in
  465.     *32-bit*)
  466.       LD="${LD-ld} -32"
  467.       ;;
  468.     *N32*)
  469.       LD="${LD-ld} -n32"
  470.       ;;
  471.     *64-bit*)
  472.       LD="${LD-ld} -64"
  473.       ;;
  474.     esac
  475.   fi
  476.   rm -rf conftest*
  477.   ;;
  478.  
  479. *-*-sco3.2v5*)
  480.   # On SCO OpenServer 5, we need -belf to get full-featured binaries.
  481.   SAVE_CFLAGS="$CFLAGS"
  482.   CFLAGS="$CFLAGS -belf"
  483.   AC_CACHE_CHECK([whether the C compiler needs -belf], lt_cv_cc_needs_belf,
  484.     [AC_TRY_LINK([],[],[lt_cv_cc_needs_belf=yes],[lt_cv_cc_needs_belf=no])])
  485.   if test x"$lt_cv_cc_needs_belf" != x"yes"; then
  486.     # this is probably gcc 2.8.0, egcs 1.0 or newer; no need for -belf
  487.     CFLAGS="$SAVE_CFLAGS"
  488.   fi
  489.   ;;
  490.  
  491. ifdef([AC_PROVIDE_AC_LIBTOOL_WIN32_DLL],
  492. [*-*-cygwin* | *-*-mingw*)
  493.   AC_CHECK_TOOL(DLLTOOL, dlltool, false)
  494.   AC_CHECK_TOOL(AS, as, false)
  495.   AC_CHECK_TOOL(OBJDUMP, objdump, false)
  496.   ;;
  497. ])
  498. esac
  499. ])
  500.  
  501. # AC_LIBTOOL_DLOPEN - enable checks for dlopen support
  502. AC_DEFUN(AC_LIBTOOL_DLOPEN, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])])
  503.  
  504. # AC_LIBTOOL_WIN32_DLL - declare package support for building win32 dll's
  505. AC_DEFUN(AC_LIBTOOL_WIN32_DLL, [AC_BEFORE([$0], [AC_LIBTOOL_SETUP])])
  506.  
  507. # AC_ENABLE_SHARED - implement the --enable-shared flag
  508. # Usage: AC_ENABLE_SHARED[(DEFAULT)]
  509. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  510. #   `yes'.
  511. AC_DEFUN(AC_ENABLE_SHARED, [dnl
  512. define([AC_ENABLE_SHARED_DEFAULT], ifelse($1, no, no, yes))dnl
  513. AC_ARG_ENABLE(shared,
  514. changequote(<<, >>)dnl
  515. <<  --enable-shared[=PKGS]  build shared libraries [default=>>AC_ENABLE_SHARED_DEFAULT],
  516. changequote([, ])dnl
  517. [p=${PACKAGE-default}
  518. case "$enableval" in
  519. yes) enable_shared=yes ;;
  520. no) enable_shared=no ;;
  521. *)
  522.   enable_shared=no
  523.   # Look at the argument we got.  We use all the common list separators.
  524.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  525.   for pkg in $enableval; do
  526.     if test "X$pkg" = "X$p"; then
  527.       enable_shared=yes
  528.     fi
  529.   done
  530.   IFS="$ac_save_ifs"
  531.   ;;
  532. esac],
  533. enable_shared=AC_ENABLE_SHARED_DEFAULT)dnl
  534. ])
  535.  
  536. # AC_DISABLE_SHARED - set the default shared flag to --disable-shared
  537. AC_DEFUN(AC_DISABLE_SHARED, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  538. AC_ENABLE_SHARED(no)])
  539.  
  540. # AC_ENABLE_STATIC - implement the --enable-static flag
  541. # Usage: AC_ENABLE_STATIC[(DEFAULT)]
  542. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  543. #   `yes'.
  544. AC_DEFUN(AC_ENABLE_STATIC, [dnl
  545. define([AC_ENABLE_STATIC_DEFAULT], ifelse($1, no, no, yes))dnl
  546. AC_ARG_ENABLE(static,
  547. changequote(<<, >>)dnl
  548. <<  --enable-static[=PKGS]  build static libraries [default=>>AC_ENABLE_STATIC_DEFAULT],
  549. changequote([, ])dnl
  550. [p=${PACKAGE-default}
  551. case "$enableval" in
  552. yes) enable_static=yes ;;
  553. no) enable_static=no ;;
  554. *)
  555.   enable_static=no
  556.   # Look at the argument we got.  We use all the common list separators.
  557.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  558.   for pkg in $enableval; do
  559.     if test "X$pkg" = "X$p"; then
  560.       enable_static=yes
  561.     fi
  562.   done
  563.   IFS="$ac_save_ifs"
  564.   ;;
  565. esac],
  566. enable_static=AC_ENABLE_STATIC_DEFAULT)dnl
  567. ])
  568.  
  569. # AC_DISABLE_STATIC - set the default static flag to --disable-static
  570. AC_DEFUN(AC_DISABLE_STATIC, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  571. AC_ENABLE_STATIC(no)])
  572.  
  573.  
  574. # AC_ENABLE_FAST_INSTALL - implement the --enable-fast-install flag
  575. # Usage: AC_ENABLE_FAST_INSTALL[(DEFAULT)]
  576. #   Where DEFAULT is either `yes' or `no'.  If omitted, it defaults to
  577. #   `yes'.
  578. AC_DEFUN(AC_ENABLE_FAST_INSTALL, [dnl
  579. define([AC_ENABLE_FAST_INSTALL_DEFAULT], ifelse($1, no, no, yes))dnl
  580. AC_ARG_ENABLE(fast-install,
  581. changequote(<<, >>)dnl
  582. <<  --enable-fast-install[=PKGS]  optimize for fast installation [default=>>AC_ENABLE_FAST_INSTALL_DEFAULT],
  583. changequote([, ])dnl
  584. [p=${PACKAGE-default}
  585. case "$enableval" in
  586. yes) enable_fast_install=yes ;;
  587. no) enable_fast_install=no ;;
  588. *)
  589.   enable_fast_install=no
  590.   # Look at the argument we got.  We use all the common list separators.
  591.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}:,"
  592.   for pkg in $enableval; do
  593.     if test "X$pkg" = "X$p"; then
  594.       enable_fast_install=yes
  595.     fi
  596.   done
  597.   IFS="$ac_save_ifs"
  598.   ;;
  599. esac],
  600. enable_fast_install=AC_ENABLE_FAST_INSTALL_DEFAULT)dnl
  601. ])
  602.  
  603. # AC_ENABLE_FAST_INSTALL - set the default to --disable-fast-install
  604. AC_DEFUN(AC_DISABLE_FAST_INSTALL, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  605. AC_ENABLE_FAST_INSTALL(no)])
  606.  
  607. # AC_PROG_LD - find the path to the GNU or non-GNU linker
  608. AC_DEFUN(AC_PROG_LD,
  609. [AC_ARG_WITH(gnu-ld,
  610. [  --with-gnu-ld           assume the C compiler uses GNU ld [default=no]],
  611. test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no)
  612. AC_REQUIRE([AC_PROG_CC])dnl
  613. AC_REQUIRE([AC_CANONICAL_HOST])dnl
  614. AC_REQUIRE([AC_CANONICAL_BUILD])dnl
  615. ac_prog=ld
  616. if test "$ac_cv_prog_gcc" = yes; then
  617.   # Check if gcc -print-prog-name=ld gives a path.
  618.   AC_MSG_CHECKING([for ld used by GCC])
  619.   ac_prog=`($CC -print-prog-name=ld) 2>&5`
  620.   case "$ac_prog" in
  621.     # Accept absolute paths.
  622. changequote(,)dnl
  623.     [\\/]* | [A-Za-z]:[\\/]*)
  624.       re_direlt='/[^/][^/]*/\.\./'
  625. changequote([,])dnl
  626.       # Canonicalize the path of ld
  627.       ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'`
  628.       while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do
  629.     ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"`
  630.       done
  631.       test -z "$LD" && LD="$ac_prog"
  632.       ;;
  633.   "")
  634.     # If it fails, then pretend we aren't using GCC.
  635.     ac_prog=ld
  636.     ;;
  637.   *)
  638.     # If it is relative, then search for the first ld in PATH.
  639.     with_gnu_ld=unknown
  640.     ;;
  641.   esac
  642. elif test "$with_gnu_ld" = yes; then
  643.   AC_MSG_CHECKING([for GNU ld])
  644. else
  645.   AC_MSG_CHECKING([for non-GNU ld])
  646. fi
  647. AC_CACHE_VAL(ac_cv_path_LD,
  648. [if test -z "$LD"; then
  649.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  650.   for ac_dir in $PATH; do
  651.     test -z "$ac_dir" && ac_dir=.
  652.     if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then
  653.       ac_cv_path_LD="$ac_dir/$ac_prog"
  654.       # Check to see if the program is GNU ld.  I'd rather use --version,
  655.       # but apparently some GNU ld's only accept -v.
  656.       # Break only if it was the GNU/non-GNU ld that we prefer.
  657.       if "$ac_cv_path_LD" -v 2>&1 < /dev/null | egrep '(GNU|with BFD)' > /dev/null; then
  658.     test "$with_gnu_ld" != no && break
  659.       else
  660.     test "$with_gnu_ld" != yes && break
  661.       fi
  662.     fi
  663.   done
  664.   IFS="$ac_save_ifs"
  665. else
  666.   ac_cv_path_LD="$LD" # Let the user override the test with a path.
  667. fi])
  668. LD="$ac_cv_path_LD"
  669. if test -n "$LD"; then
  670.   AC_MSG_RESULT($LD)
  671. else
  672.   AC_MSG_RESULT(no)
  673. fi
  674. test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH])
  675. AC_PROG_LD_GNU
  676. ])
  677.  
  678. AC_DEFUN(AC_PROG_LD_GNU,
  679. [AC_CACHE_CHECK([if the linker ($LD) is GNU ld], ac_cv_prog_gnu_ld,
  680. [# I'd rather use --version here, but apparently some GNU ld's only accept -v.
  681. if $LD -v 2>&1 </dev/null | egrep '(GNU|with BFD)' 1>&5; then
  682.   ac_cv_prog_gnu_ld=yes
  683. else
  684.   ac_cv_prog_gnu_ld=no
  685. fi])
  686. ])
  687.  
  688. # AC_PROG_NM - find the path to a BSD-compatible name lister
  689. AC_DEFUN(AC_PROG_NM,
  690. [AC_MSG_CHECKING([for BSD-compatible nm])
  691. AC_CACHE_VAL(ac_cv_path_NM,
  692. [if test -n "$NM"; then
  693.   # Let the user override the test.
  694.   ac_cv_path_NM="$NM"
  695. else
  696.   IFS="${IFS=     }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}"
  697.   for ac_dir in $PATH /usr/ccs/bin /usr/ucb /bin; do
  698.     test -z "$ac_dir" && ac_dir=.
  699.     if test -f $ac_dir/nm || test -f $ac_dir/nm$ac_exeext ; then
  700.       # Check to see if the nm accepts a BSD-compat flag.
  701.       # Adding the `sed 1q' prevents false positives on HP-UX, which says:
  702.       #   nm: unknown option "B" ignored
  703.       if ($ac_dir/nm -B /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  704.     ac_cv_path_NM="$ac_dir/nm -B"
  705.     break
  706.       elif ($ac_dir/nm -p /dev/null 2>&1 | sed '1q'; exit 0) | egrep /dev/null >/dev/null; then
  707.     ac_cv_path_NM="$ac_dir/nm -p"
  708.     break
  709.       else
  710.     ac_cv_path_NM=${ac_cv_path_NM="$ac_dir/nm"} # keep the first match, but
  711.     continue # so that we can try to find one that supports BSD flags
  712.       fi
  713.     fi
  714.   done
  715.   IFS="$ac_save_ifs"
  716.   test -z "$ac_cv_path_NM" && ac_cv_path_NM=nm
  717. fi])
  718. NM="$ac_cv_path_NM"
  719. AC_MSG_RESULT([$NM])
  720. ])
  721.  
  722. # AC_CHECK_LIBM - check for math library
  723. AC_DEFUN(AC_CHECK_LIBM,
  724. [AC_REQUIRE([AC_CANONICAL_HOST])dnl
  725. LIBM=
  726. case "$lt_target" in
  727. *-*-beos* | *-*-cygwin*)
  728.   # These system don't have libm
  729.   ;;
  730. *-ncr-sysv4.3*)
  731.   AC_CHECK_LIB(mw, _mwvalidcheckl, LIBM="-lmw")
  732.   AC_CHECK_LIB(m, main, LIBM="$LIBM -lm")
  733.   ;;
  734. *)
  735.   AC_CHECK_LIB(m, main, LIBM="-lm")
  736.   ;;
  737. esac
  738. ])
  739.  
  740. # AC_LIBLTDL_CONVENIENCE[(dir)] - sets LIBLTDL to the link flags for
  741. # the libltdl convenience library and INCLTDL to the include flags for
  742. # the libltdl header and adds --enable-ltdl-convenience to the
  743. # configure arguments.  Note that LIBLTDL and INCLTDL are not
  744. # AC_SUBSTed, nor is AC_CONFIG_SUBDIRS called.  If DIR is not
  745. # provided, it is assumed to be `libltdl'.  LIBLTDL will be prefixed
  746. # with '${top_builddir}/' and INCLTDL will be prefixed with
  747. # '${top_srcdir}/' (note the single quotes!).  If your package is not
  748. # flat and you're not using automake, define top_builddir and
  749. # top_srcdir appropriately in the Makefiles.
  750. AC_DEFUN(AC_LIBLTDL_CONVENIENCE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  751.   case "$enable_ltdl_convenience" in
  752.   no) AC_MSG_ERROR([this package needs a convenience libltdl]) ;;
  753.   "") enable_ltdl_convenience=yes
  754.       ac_configure_args="$ac_configure_args --enable-ltdl-convenience" ;;
  755.   esac
  756.   LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdlc.la
  757.   INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  758. ])
  759.  
  760. # AC_LIBLTDL_INSTALLABLE[(dir)] - sets LIBLTDL to the link flags for
  761. # the libltdl installable library and INCLTDL to the include flags for
  762. # the libltdl header and adds --enable-ltdl-install to the configure
  763. # arguments.  Note that LIBLTDL and INCLTDL are not AC_SUBSTed, nor is
  764. # AC_CONFIG_SUBDIRS called.  If DIR is not provided and an installed
  765. # libltdl is not found, it is assumed to be `libltdl'.  LIBLTDL will
  766. # be prefixed with '${top_builddir}/' and INCLTDL will be prefixed
  767. # with '${top_srcdir}/' (note the single quotes!).  If your package is
  768. # not flat and you're not using automake, define top_builddir and
  769. # top_srcdir appropriately in the Makefiles.
  770. # In the future, this macro may have to be called after AC_PROG_LIBTOOL.
  771. AC_DEFUN(AC_LIBLTDL_INSTALLABLE, [AC_BEFORE([$0],[AC_LIBTOOL_SETUP])dnl
  772.   AC_CHECK_LIB(ltdl, main,
  773.   [test x"$enable_ltdl_install" != xyes && enable_ltdl_install=no],
  774.   [if test x"$enable_ltdl_install" = xno; then
  775.      AC_MSG_WARN([libltdl not installed, but installation disabled])
  776.    else
  777.      enable_ltdl_install=yes
  778.    fi
  779.   ])
  780.   if test x"$enable_ltdl_install" = x"yes"; then
  781.     ac_configure_args="$ac_configure_args --enable-ltdl-install"
  782.     LIBLTDL='${top_builddir}/'ifelse($#,1,[$1],['libltdl'])/libltdl.la
  783.     INCLTDL='-I${top_srcdir}/'ifelse($#,1,[$1],['libltdl'])
  784.   else
  785.     ac_configure_args="$ac_configure_args --enable-ltdl-install=no"
  786.     LIBLTDL="-lltdl"
  787.     INCLTDL=
  788.   fi
  789. ])
  790.  
  791. dnl old names
  792. AC_DEFUN(AM_PROG_LIBTOOL, [indir([AC_PROG_LIBTOOL])])dnl
  793. AC_DEFUN(AM_ENABLE_SHARED, [indir([AC_ENABLE_SHARED], $@)])dnl
  794. AC_DEFUN(AM_ENABLE_STATIC, [indir([AC_ENABLE_STATIC], $@)])dnl
  795. AC_DEFUN(AM_DISABLE_SHARED, [indir([AC_DISABLE_SHARED], $@)])dnl
  796. AC_DEFUN(AM_DISABLE_STATIC, [indir([AC_DISABLE_STATIC], $@)])dnl
  797. AC_DEFUN(AM_PROG_LD, [indir([AC_PROG_LD])])dnl
  798. AC_DEFUN(AM_PROG_NM, [indir([AC_PROG_NM])])dnl
  799.  
  800. dnl This is just to silence aclocal about the macro not being used
  801. ifelse([AC_DISABLE_FAST_INSTALL])dnl
  802.  
  803.