comparison m4/acinclude.m4 @ 15166:8750f2cdc4f1

Remove obsolete m4 macro OCTAVE_SMART_PUTENV. * configure.ac: Remove call to macro OCTAVE_SMART_PUTENV. * m4/acinclude.m4: Remove macro definition for OCTAVE_SMART_PUTENV.
author Rik <rik@octave.org>
date Mon, 13 Aug 2012 12:56:53 -0700
parents 9cc337ced51a
children c4779a180134
comparison
equal deleted inserted replaced
15165:84d7a1ed5f29 15166:8750f2cdc4f1
1670 AC_DEFUN([AC_CHECK_FT2], [ 1670 AC_DEFUN([AC_CHECK_FT2], [
1671 dnl 1671 dnl
1672 dnl Get the cflags and libraries from the freetype-config script 1672 dnl Get the cflags and libraries from the freetype-config script
1673 dnl 1673 dnl
1674 AC_ARG_WITH([ft-prefix], 1674 AC_ARG_WITH([ft-prefix],
1675 dnl don't quote AS_HELP_STRING! 1675 [AS_HELP_STRING([--with-ft-prefix=PREFIX],
1676 AS_HELP_STRING([--with-ft-prefix=PREFIX], 1676 [Prefix where FreeType is installed (optional)])],
1677 [Prefix where FreeType is installed (optional)]),
1678 [ft_config_prefix="$withval"], 1677 [ft_config_prefix="$withval"],
1679 [ft_config_prefix=""]) 1678 [ft_config_prefix=""])
1680 1679
1681 AC_ARG_WITH([ft-exec-prefix], 1680 AC_ARG_WITH([ft-exec-prefix],
1682 dnl don't quote AS_HELP_STRING! 1681 [AS_HELP_STRING([--with-ft-exec-prefix=PREFIX],
1683 AS_HELP_STRING([--with-ft-exec-prefix=PREFIX], 1682 [Exec prefix where FreeType is installed (optional)])],
1684 [Exec prefix where FreeType is installed (optional)]),
1685 [ft_config_exec_prefix="$withval"], 1683 [ft_config_exec_prefix="$withval"],
1686 [ft_config_exec_prefix=""]) 1684 [ft_config_exec_prefix=""])
1687 1685
1688 AC_ARG_ENABLE([freetypetest], 1686 AC_ARG_ENABLE([freetypetest],
1689 [AS_HELP_STRING([--disable-freetypetest], 1687 [AS_HELP_STRING([--disable-freetypetest],
1690 [Do not try to compile and run a test FreeType program])], 1688 [Do not try to compile and run a test FreeType program])],
1691 [], 1689 [],
1692 [enable_fttest=yes]) 1690 [enable_fttest=yes])
1693 1691
1694 if test x$ft_config_exec_prefix != x ; then 1692 if test x$ft_config_exec_prefix != x ; then
1695 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix" 1693 ft_config_args="$ft_config_args --exec-prefix=$ft_config_exec_prefix"
1998 ifelse([$3], , :, [$3]) 1996 ifelse([$3], , :, [$3])
1999 fi[]dnl 1997 fi[]dnl
2000 ])# PKG_CHECK_MODULES 1998 ])# PKG_CHECK_MODULES
2001 dnl end of pkg.m4 1999 dnl end of pkg.m4
2002 2000
2003 dnl
2004 dnl The following test is from Karl Berry's Kpathsearch library. I'm
2005 dnl including it here in case we someday want to make the use of
2006 dnl kpathsea optional.
2007 dnl
2008 dnl Some BSD putenv's, e.g., FreeBSD, do malloc/free's on the environment.
2009 dnl This test program is due to Mike Hibler <mike@cs.utah.edu>.
2010 dnl We don't actually need to run this if we don't have putenv, but it
2011 dnl doesn't hurt.
2012 dnl
2013 AC_DEFUN([OCTAVE_SMART_PUTENV],
2014 [AC_MSG_CHECKING([whether putenv uses malloc])
2015 AC_CACHE_VAL(octave_cv_func_putenv_malloc,
2016 [AC_RUN_IFELSE([AC_LANG_SOURCE([[
2017 #define VAR "YOW_VAR"
2018 #define STRING1 "GabbaGabbaHey"
2019 #define STRING2 "Yow!!" /* should be shorter than STRING1 */
2020 extern char *getenv (); /* in case char* and int don't mix gracefully */
2021 main ()
2022 {
2023 char *str1, *rstr1, *str2, *rstr2;
2024 str1 = getenv (VAR);
2025 if (str1)
2026 exit (1);
2027 str1 = malloc (strlen (VAR) + 1 + strlen (STRING1) + 1);
2028 if (str1 == 0)
2029 exit (2);
2030 strcpy (str1, VAR);
2031 strcat (str1, "=");
2032 strcat (str1, STRING1);
2033 if (putenv (str1) < 0)
2034 exit (3);
2035 rstr1 = getenv (VAR);
2036 if (rstr1 == 0)
2037 exit (4);
2038 rstr1 -= strlen (VAR) + 1;
2039 if (strncmp (rstr1, VAR, strlen (VAR)))
2040 exit (5);
2041 str2 = malloc (strlen (VAR) + 1 + strlen (STRING2) + 1);
2042 if (str2 == 0 || str1 == str2)
2043 exit (6);
2044 strcpy (str2, VAR);
2045 strcat (str2, "=");
2046 strcat (str2, STRING2);
2047 if (putenv (str2) < 0)
2048 exit (7);
2049 rstr2 = getenv (VAR);
2050 if (rstr2 == 0)
2051 exit (8);
2052 rstr2 -= strlen (VAR) + 1;
2053 #if 0
2054 printf ("rstr1=0x%x, rstr2=0x%x\n", rstr1, rstr2);
2055 /*
2056 * If string from first call was reused for the second call,
2057 * you had better not do a free on the first string!
2058 */
2059 if (rstr1 == rstr2)
2060 printf ("#define SMART_PUTENV\n");
2061 else
2062 printf ("#undef SMART_PUTENV\n");
2063 #endif
2064 exit (rstr1 == rstr2 ? 0 : 1);
2065 }]])], octave_cv_func_putenv_malloc=yes, octave_cv_func_putenv_malloc=no,
2066 octave_cv_func_putenv_malloc=no)])dnl
2067 AC_MSG_RESULT([$octave_cv_func_putenv_malloc])
2068 if test $octave_cv_func_putenv_malloc = yes; then
2069 AC_DEFINE(SMART_PUTENV,1,[To quiet autoheader.])
2070 fi])