]> git.ipfire.org Git - thirdparty/make.git/commitdiff
Add preprocessor macros for different platforms
authorPaul Smith <psmith@gnu.org>
Mon, 17 Oct 2022 21:56:18 +0000 (17:56 -0400)
committerPaul Smith <psmith@gnu.org>
Tue, 18 Oct 2022 18:20:44 +0000 (14:20 -0400)
* configure.ac: MK_CONFIGURE shows config.h was generated by configure.
* src/config.ami: Define MK_AMIGAOS.
* src/config.h-vms: Define MK_VMS.
* src/configh.dos: Define MK_DJGPP.
* src/config.h.W32: Define MK_W32 and WINDOWS32.
* src/build_w32.bat: Let WINDOWS32 be defined by config.h.  Remove
unused setting of WIN32.
* src/job.c: Clean up use of WIN32.
* src/main.c: Ditto.
* tests/scripts/features/default_names: Ditto.

build_w32.bat
configure.ac
src/config.ami
src/config.h-vms
src/config.h.W32
src/configh.dos
src/job.c
src/main.c
tests/scripts/features/default_names

index 5153ee8c1cf633b61281bbadbab2e0a729f917dd..1ca7fe9e6e5d98befa9d718dee45a75c6ca93642 100644 (file)
@@ -313,21 +313,21 @@ if "%COMPILER%" == "tcc" goto TccCompile
 \r
 :: MSVC Compile\r
 if "%VERBOSE%" == "Y" echo on\r
-call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D WINDOWS32 /D WIN32 /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c\r
+call %COMPILER% /nologo /MT /W4 /EHsc %OPTS% /I %OUTDIR%/src /I src /I %OUTDIR%/lib /I lib /I src/w32/include /D _CONSOLE /D HAVE_CONFIG_H /FR%OUTDIR% /Fp%OUTDIR%\%MAKE%.pch /Fo%OUTDIR%\%1.%O% /Fd%OUTDIR%\%MAKE%.pdb %EXTRAS% /c %1.c\r
 @echo off\r
 goto CompileDone\r
 \r
 :GccCompile\r
 :: GCC Compile\r
 if "%VERBOSE%" == "Y" echo on\r
-call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
+call %COMPILER% -mthreads -Wall -std=gnu99 -gdwarf-2 -g3 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
 @echo off\r
 goto CompileDone\r
 \r
 :TccCompile\r
 :: TCC Compile\r
 if "%VERBOSE%" == "Y" echo on\r
-call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DWINDOWS32 -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
+call %COMPILER% -mthreads -Wall -std=c11 %OPTS% -I%OUTDIR%/src -I./src -I%OUTDIR%/lib -I./lib -I./src/w32/include -D_cdecl= -D_MSC_VER -DHAVE_CONFIG_H %EXTRAS% -o %OUTDIR%/%1.%O% -c %1.c\r
 @echo off\r
 goto CompileDone\r
 \r
index e9a668986605f8ae537e3fac63037f0d7c7b1a3e..61670b8bf67d5f83f7d6ba6b3f530ea7d62eb857 100644 (file)
@@ -425,8 +425,8 @@ AS_CASE([$host],
   [*-*-mingw32],
    [AM_CONDITIONAL([WINDOWSENV], [true])
     w32_target_env=yes
-    AC_DEFINE([WINDOWS32], [1], [Use platform specific coding])
-    AC_DEFINE([HAVE_DOS_PATHS], [1], [Use platform specific coding])
+    AC_DEFINE([WINDOWS32], [1], [Build for the WINDOWS32 API.])
+    AC_DEFINE([HAVE_DOS_PATHS], [1], [Support DOS-style pathnames.])
   ])
 
 AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
@@ -435,6 +435,11 @@ AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
 AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
         [Define to 1 if you have the declaration of 'getloadavg'.])
 
+# Remember that we ran configure to generate config.h
+
+AC_DEFINE([MK_CONFIGURE], [1],
+          [Define to 1 if config.h is generated by running the configure script.])
+
 # Include the Maintainer's Makefile section, if it's here.
 
 MAINT_MAKEFILE=/dev/null
index 503b4b03e9599aff43baeca28d2febbf7871a33b..5f32511c7c996739a3cd31b65dceee4e02ccda9a 100644 (file)
@@ -16,6 +16,8 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "mkconfig.h"
 
+#define MK_AMIGAOS 1
+
 /* Define if on AIX 3.
    System headers sometimes define this.
    We just want to avoid a redefinition error message.  */
index 5c8ba49d810b5458a741368bc3a443e26c87c3ce..c7c1d0e813fdf529ba1597d728971f4ebe2f45df 100644 (file)
@@ -17,6 +17,8 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "mkconfig.h"
 
+#define MK_VMS 1
+
 /* Pull in types.h here to get __CRTL_VER defined for old versions of the
    compiler which don't define it. */
 #ifdef __DECC
index ecda22d896913b06f8f89057429994959a1f03ea..32aa25450409bf79ca6b5412191231999715281e 100644 (file)
@@ -17,6 +17,11 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "mkconfig.h"
 
+#define MK_W32 1
+
+/* Build for the WINDOWS32 API. */
+#define WINDOWS32 1
+
 /* Suppress some Visual C++ warnings.
    Maybe after the code cleanup for ISO C we can remove some/all of these.  */
 #if _MSC_VER > 1000
@@ -106,7 +111,7 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 # define HAVE_DIRECT_H 1
 #endif
 
-/* Use platform specific coding */
+/* Support DOS-style pathnames. */
 #define HAVE_DOS_PATHS 1
 
 /* Define to 1 if you have the 'dup' function. */
index 068b865d70773fa8a925dbec57651864318597f3..58e992f28af075b2c90fac8fee029355c18a7164 100644 (file)
@@ -17,6 +17,8 @@ this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "mkconfig.h"
 
+#define MK_DJGPP 1
+
 /* Include this header to make __DJGPP_MINOR__ available because DJGPP ports
    of GCC 4.3.0 and later no longer do it automatically.  */
 #include <sys/version.h>
index a47824a7507c7b566c4dd104cd3bea4929699dfe..4bbdc99068a245968c14f79203c2acec3502af50 100644 (file)
--- a/src/job.c
+++ b/src/job.c
@@ -3480,7 +3480,7 @@ construct_command_argv_internal (char *line, char **restp, const char *shell,
 
 #ifdef WINDOWS32
     /* Some shells do not work well when invoked as 'sh -c xxx' to run a
-       command line (e.g. Cygnus GNUWIN32 sh.exe on WIN32 systems).  In these
+       command line (e.g. Cygnus GNUWIN32 sh.exe on W32 systems).  In these
        cases, run commands via a script file.  */
     if (just_print_flag && !(flags & COMMANDS_RECURSE))
       {
index d9068ae0cce04e23473a2109182643decb2efc52..8adce3a56bf47dbe656a2c4f7d9a6bad7300d181 100644 (file)
@@ -989,7 +989,7 @@ handle_runtime_exceptions (struct _EXCEPTION_POINTERS *exinfo)
 }
 
 /*
- * On WIN32 systems we don't have the luxury of a /bin directory that
+ * On W32 systems we don't have the luxury of a /bin directory that
  * is mapped globally to every drive mounted to the system. Since make could
  * be invoked from any drive, and we don't want to propagate /bin/sh
  * to every single drive. Allow ourselves a chance to search for
index 2e838806e8e9b75398da9e62430606293ff19946..3ecbaab91141f4bcdd20bbef6073d759cefe5b2c 100644 (file)
@@ -15,7 +15,7 @@ open(MAKEFILE,"> makefile");
 print MAKEFILE "SECOND: ; \@echo It chose makefile\n";
 close(MAKEFILE);
 
-# DOS/WIN32/MacOSX platforms are case-insensitive / case-preserving, so
+# DOS/W32/MacOSX platforms are case-insensitive / case-preserving, so
 # Makefile is the same file as makefile.  Just test what we can here.
 
 my $case_sensitive = 0;