⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 configure.in

📁 A*算法 A*算法 A*算法 A*算法A*算法A*算法
💻 IN
📖 第 1 页 / 共 5 页
字号:

dnl is -traditional needed for correct compilations
dnl   adds -traditional for gcc if needed
AC_PROG_GCC_TRADITIONAL

AC_LANG_SAVE
AC_LANG_CPLUSPLUS

dnl C++-compiler checks
dnl   defines CXX with the compiler to use
dnl   defines GXX with yes if using gxx
dnl   defines GXX empty if not using gxx
dnl   defines CXXFLAGS
dnl
dnl see CFLAGS line above
CXXFLAGS=${CXXFLAGS:=}
AC_BAKEFILE_PROG_CXX

AC_LANG_RESTORE

dnl ranlib command
dnl   defines RANLIB with the appropriate command
AC_PROG_RANLIB

dnl ar command
dnl   defines AR with the appropriate command
AC_CHECK_TOOL(AR, ar)
if test "x$AR" = "x" ; then
    AC_MSG_ERROR([ar is needed to build wxWidgets])
fi

dnl install checks
dnl   defines INSTALL with the appropriate command
AC_PROG_INSTALL

dnl   make install path absolute (if not already);
dnl   will fail with (some) MSDOS paths
case ${INSTALL} in
  /* ) # Absolute
     ;;
  ?:* ) # Drive letter, considered as absolute.
     ;;
  *)
     INSTALL=`pwd`/${INSTALL} ;;
esac


case "${host}" in

    dnl The other BSD's should probably go in here too, since this is
    dnl to workaround a strange static lib BSDism.
    dnl Mac OS X install seems to ignore -p option...
    *-*-darwin* )
        INSTALL_PROGRAM="cp -fp"
        INSTALL_DATA="cp -fp"
        ;;
    *)
        ;;
esac

dnl strip command
dnl   defines STRIP as strip or nothing (true) if not found
AC_CHECK_TOOL(STRIP, strip, true)

dnl Win32 tools
if test "$wxUSE_WINE" = "yes"; then
    AC_CHECK_TOOL(RESCOMP, wrc)
else
    case "${host}" in
    *-*-cygwin* | *-*-mingw32* )
        AC_CHECK_TOOL(RESCOMP, windres)
        AC_CHECK_TOOL(DLLTOOL, dlltool)
        ;;
    esac
fi

dnl does make support "-include" (only GNU make does AFAIK)?
AC_CACHE_CHECK([if make is GNU make], wx_cv_prog_makeisgnu,
[
    if ( ${SHELL-sh} -c "${MAKE-make} --version" 2> /dev/null |
            egrep -s GNU > /dev/null); then
        wx_cv_prog_makeisgnu="yes"
    else
        wx_cv_prog_makeisgnu="no"
    fi
])

if test "x$wx_cv_prog_makeisgnu" = "xyes"; then
    IF_GNU_MAKE=""
else
    IF_GNU_MAKE="#"
fi

AC_SUBST(IF_GNU_MAKE)

dnl we don't need to check for VPATH support in GNU make - it does have it
if test "x$wx_cv_prog_makeisgnu" != "xyes"; then
dnl check if VPATH works
AC_CACHE_CHECK([if make supports VPATH], wx_cv_prog_makevpath, [
dnl create Makefile
cat - << EOF > confMake
check : file
	cp \$? \$@
	cp \$? final_file
EOF

if test ! -d sub ; then
  mkdir sub
fi
echo dummy > sub/file
${MAKE-make} -f confMake VPATH=sub 2>&5 > /dev/null
RESULT=$?
rm -f sub/file check final_file confMake
rmdir sub
if test "$RESULT" = 0; then
  wx_cv_prog_makevpath="yes"
else
  wx_cv_prog_makevpath="no"
fi
])

if test "x$wx_cv_prog_makevpath" != "xyes"; then
AC_MSG_ERROR([
You need a make-utility that is able to use the variable
VPATH correctly.
If your version of make does not support VPATH correctly,
please install GNU-make (possibly as gmake), and start
configure with the following command:
export MAKE=gmake; ./configure  for sh-type shells
setenv MAKE gmake; ./configure  for csh-type shells
Also please do remember to use gmake in this case every time
you are trying to compile.
])
fi dnl make without VPATH
fi dnl not GNU make

dnl needed for making link to setup.h
AC_PROG_LN_S

dnl ------------------------------------------------------------------------
dnl Platform specific tests
dnl ------------------------------------------------------------------------

dnl xlC needs -qunique under AIX so that one source file can be
dnl compiled to multiple object files and safely linked together.
if test "x$XLCXX" = "xyes" -a "x$USE_AIX" = "x1"; then
    CXXFLAGS="$CXXFLAGS -qunique"
fi


dnl This case is for PowerPC OS X vs. everything else
case "${host}" in
  powerpc-*-darwin* )
    AC_MSG_CHECKING([if __POWERPC__ is already defined])
    AC_TRY_COMPILE([],[#ifndef __POWERPC__
        choke me for lack of PowerPC
#endif
],
        [AC_MSG_RESULT([yes])],
        [AC_MSG_RESULT([no])
        AC_DEFINE(__POWERPC__)
    ])
  ;;
esac

dnl This case is for OS X vs. everything else
case "${host}" in
  *-*-darwin* )
    AC_MSG_CHECKING([if CoreFoundation/CFBase.h is usable])
    AC_TRY_COMPILE([#include <CoreFoundation/CFBase.h>
],[],
        [AC_MSG_RESULT([yes])],
        [AC_MSG_RESULT([no])
        AC_MSG_CHECKING([if __CF_USE_FRAMEWORK_INCLUDES__ is required])
        AC_TRY_COMPILE([#define __CF_USE_FRAMEWORK_INCLUDES__
#include <CoreFoundation/CFBase.h>
        ],[],
        [AC_MSG_RESULT([yes])
        dnl We must use -D so source files that don't include wx/setup.h
        dnl but do include CFBase will work.
        CPPFLAGS="$CPPFLAGS -D__CF_USE_FRAMEWORK_INCLUDES__"],
        [AC_MSG_FAILURE([no.  CoreFoundation not available.])]
        )
        ]
    )
  ;;
esac

dnl This case is for OS/2 vs. everything else
case "${host}" in
  *-pc-os2_emx | *-pc-os2-emx )
      dnl ---------------------------------------------------------------------
      dnl When we are using gcc on OS/2, we want to be either using resources
      dnl (PM) or a more complete POSIX emulation for Motif/GTK+/X11.
      dnl Moreover we need to link explicitly against either stdcpp.a or
      dnl stdcxx.a (depending on compiler version), since we are using "gcc",
      dnl not "g++/c++".
      dnl ---------------------------------------------------------------------
      dnl (OS/2-only piece)
      if test "$wxUSE_MOTIF" = 1 -o "$wxUSE_GTK" = 1 -o "$wxUSE_X11" = 1; then
          dnl More complete Unix emulation for unix-like ports
          dnl by linking in POSIX/2's cExt (if available).
          AC_CHECK_LIB(cExt, drand48, LIBS="$LIBS -lcExt")
      else
          dnl Include resources for the "native" port (wxPM).
          RESPROGRAMOBJ="\${top_srcdir}/include/wx/os2/wx.res"
      fi
      dnl Check for the gcc version (and thereby for the C runtime library).
      dnl wx_cv_gccversion = EMX2 -> Standard EMX environment
      dnl wx_cv_gccversion = EMX3 -> EMX with gcc-3.0.3 or gcc-3.2.1
      dnl wx_cv_gccversion = Innotek5 -> gcc-3.2.2 with Innotek libc5
      dnl wx_cv_gccversion = Innotek6 -> gcc-3.3.5 with Innotek libc6.
      AC_CACHE_CHECK([for gcc/libc version], wx_cv_gccversion,[
          AC_TRY_RUN(
              dnl Check the gcc version macro.	 
              [
                  #include <stdio.h>

                  int main()
                  {
                      FILE *f=fopen("conftestval", "w");
                      if (!f) exit(1);
                      fprintf(f,
                  #if (__GNUC__ < 3)
                              "EMX2"
                  #elif (__GNUC__==3) && ((__GNUC_MINOR__ < 2) || ((__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__<2)))
                              "EMX3"
                  #elif (__GNUC__==3) && (__GNUC_MINOR__==2) && (__GNUC_PATCHLEVEL__==2)
                              "Innotek5"
                  #else
                              "Innotek6"
                  #endif
		      );
                      exit(0);
                  }
              ],
	      wx_cv_gccversion=`cat conftestval`,
              wx_cv_gccversion="EMX2",
              dnl Compilation error: Assuming standard EMX environment
              wx_cv_gccversion="EMX2"
          )
      ])
      if test "$wx_cv_gccversion" = "EMX2"; then
          LIBS="$LIBS -lstdcpp"
          LDFLAGS="$LDFLAGS -Zsysv-signals"
      else
          if test "$wx_cv_gccversion" = "EMX3"; then
              LIBS="$LIBS -lstdcxx -lgcc"
              LDFLAGS="$LDFLAGS -Zsysv-signals"
          else
              LIBS="$LIBS -lstdc++"
          fi
      fi
      if test "$wxUSE_SHARED" = "yes" -a "$wxUSE_OMF" = "no"; then
        AC_MSG_WARN([Building DLLs requires OMF mode, enabled])
        wxUSE_OMF=yes
	enable_omf=yes
      fi
      dnl (end of OS/2-only piece)
  ;;
  *)
      dnl ---------------------------------------------------------------------
      dnl look for strcasecmp() in string.h and then strings.h if it's not
      dnl there. Don't do this on OS/2, where "stricmp" is the function to be
      dnl used.
      dnl ---------------------------------------------------------------------
      dnl (non-OS/2-only piece)

      AC_LANG_SAVE
      AC_LANG_CPLUSPLUS

      AC_CACHE_CHECK([for strcasecmp() in string.h], ac_cv_string_strcasecmp, [
          AC_TRY_LINK([
              #include <string.h>
              ],
              [
                  strcasecmp("foo", "bar");
              ],
              ac_cv_string_strcasecmp=yes,
              ac_cv_string_strcasecmp=no
          )
      ])

      if test x"$ac_cv_string_strcasecmp" = "xyes"; then
          AC_DEFINE(HAVE_STRCASECMP_IN_STRING_H)
      else
          AC_CACHE_CHECK([for strcasecmp() in strings.h], ac_cv_strings_strcasecmp, [
              AC_TRY_LINK([
                  #include <strings.h>
                  ],
                  [
                      strcasecmp("foo", "bar");
                  ],
                  ac_cv_strings_strcasecmp=yes,
                  ac_cv_strings_strcasecmp=no
              )
          ])

          if test x"$ac_cv_strings_strcasecmp" = "xyes"; then
              AC_DEFINE(HAVE_STRCASECMP_IN_STRINGS_H)
          else
              AC_MSG_ERROR([No case-insensitive string comparison function found.])
          fi
      fi

      AC_LANG_RESTORE
      dnl (end of non-OS/2-only piece)
  ;;
esac

dnl ------------------------------------------------------------------------
dnl Check for headers
dnl ------------------------------------------------------------------------

dnl defines HAVE_STDLIB_H
AC_CHECK_HEADERS(stdlib.h)
dnl defines HAVE_MALLOC_H
AC_CHECK_HEADERS(malloc.h)
dnl defines HAVE_UNISTD_H
AC_CHECK_HEADERS(unistd.h)
dnl defines HAVE_WCHAR_H
AC_CHECK_HEADERS(wchar.h)

dnl maybe wchar_t is in wcstr.h if we don't have wchar.h?
if test "$ac_cv_header_wchar_h" != "yes"; then
    dnl defines HAVE_WCSTR_H
    AC_CHECK_HEADERS(wcstr.h)
fi

dnl defines HAVE_FNMATCH_H
AC_CHECK_HEADERS(fnmatch.h)

dnl defines HAVE_LANGINFO_H (GNU libc locale parameters)
AC_CHECK_HEADERS(langinfo.h)

case "${host}" in
  *-pc-os2_emx | *-pc-os2-emx )
      dnl Explicitly link -lintl if langinfo.h is available
      dnl and intl

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -