diff --git a/config.d/library_functions.m4 b/config.d/library_functions.m4 index 674262193..e53ca3efb 100644 --- a/config.d/library_functions.m4 +++ b/config.d/library_functions.m4 @@ -10,11 +10,11 @@ AC_FUNC_VPRINTF AC_FUNC_VA_COPY AC_FUNC__VA_COPY AC_CHECK_FUNCS( - access _access connect dlopen fcntl ftime _ftime getaddrinfo \ + access _access connect dlopen execvp fcntl ftime _ftime getaddrinfo \ gethostbyname gethostname getnameinfo getpagesize gettimeofday getuid \ getwd ioctl mkdir _mkdir mprotect putenv select snprintf _snprintf \ socket stat strcasestr strerror strnlen strsep strstr vsnprintf \ - _vsnprintf + _vsnprintf wait ) DL_LIBS="" diff --git a/tools/qfcc/source/cpp.c b/tools/qfcc/source/cpp.c index 6e41179db..38c5dec73 100644 --- a/tools/qfcc/source/cpp.c +++ b/tools/qfcc/source/cpp.c @@ -259,7 +259,11 @@ preprocess_file (const char *filename, const char *ext) printf ("%s ", *a); puts(""); } +#ifdef HAVE_EXECVP execvp (cpp_argv[0], (char **)cpp_argv); +#else + execve (cpp_argv[0], (char **)cpp_argv, environ); +#endif perror (cpp_argv[0]); exit (1); } else { @@ -268,7 +272,12 @@ preprocess_file (const char *filename, const char *ext) pid_t rc; // printf ("pid = %d\n", pid); - if ((rc = waitpid (0, &status, 0 | WUNTRACED)) != pid) { +#ifdef HAVE_WAITPID + rc = waitpid (0, &status, 0 | WUNTRACED); +#else + rc = wait (&status); +#endif + if ((rc) != pid) { if (rc == -1) { perror ("wait"); return 0;