瀏覽代碼

build: check for getcwd() and _getcwd() and configure time.

legacy
Sam Hocevar sam 12 年之前
父節點
當前提交
e7806e96cc
共有 2 個檔案被更改,包括 8 行新增2 行删除
  1. +2
    -0
      configure.ac
  2. +6
    -2
      src/sys/init.cpp

+ 2
- 0
configure.ac 查看文件

@@ -80,6 +80,8 @@ AC_CHECK_HEADERS(linux/kdev_t.h linux/major.h)
AC_CHECK_HEADERS(security/pam_appl.h security/pam_misc.h)
AC_CHECK_HEADERS(pam/pam_appl.h pam/pam_misc.h)

AC_CHECK_FUNCS(getcwd _getcwd)

if test "${enable_debug}" = "yes"; then
AC_DEFINE(LOL_DEBUG, 1, Define to 1 to activate debug)
OPT="-O"


+ 6
- 2
src/sys/init.cpp 查看文件

@@ -38,14 +38,18 @@ namespace System
void Init(int argc, char *argv[],
String const projectdir, String const solutiondir)
{
using namespace std;

/*
* Retrieve binary directory, defaulting to current dir.
*/

#if defined _WIN32
#if defined HAVE_GETCWD
char *cwd = getcwd(NULL, 0);
#elif defined HAVE__GETCWD || (defined _WIN32 && !defined _XBOX)
char *cwd = _getcwd(NULL, 0);
#else
char *cwd = getcwd(NULL, 0);
char *cwd = NULL;
#endif
String binarydir = String(cwd ? cwd : ".") + SEPARATOR;
free(cwd);


Loading…
取消
儲存