-
Notifications
You must be signed in to change notification settings - Fork 5
Basic 'starter support' for PL/I #16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
MikeFultonDev
wants to merge
23
commits into
main
Choose a base branch
from
altcmp
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d6e0a52
getting started with PL/I experiment
c7ed102
basic starter for describing PL/I
379a5f7
fix some typos and add new patch file
e68f3aa
fix some typos
ff0bb26
switch order of parms around
3b1501a
remove -o object for compile
80ffa37
compile and link not quite right
e25fbc4
add in a pli.cmake file
9b2f118
fix compilation errors in source
03f27db
tweaks to improve PL/I ... added -I option but still doesn't manage d…
603627e
create simple hello-world for C to do tracing
64cedd1
get PL/I compiler to determine version info
606db7e
add version info for the PL/I compiler
a426cb3
switch to ninja
c4c917f
use ninja
8db5310
try a different approach akin to zoslib
aa3f3f8
switch to clang compiler and use better names for the scripts
94bed44
add basic test to validate that dependency (touch) of C and H files w…
b301cca
complete up config script
1c9d2f7
fix up code for dep specification
7a99255
forgot quotes
91a2afb
move CompilerId.cmake partial patch into separate patch file outside …
c9f07a6
incorporating some of Sean's feedback. Not ready to merge yet
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
CMake | ||
log | ||
install | ||
nohup.out | ||
tests/build | ||
tests/hw.trace |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/Modules/CMakeCompilerIdDetection.cmake b/Modules/CMakeCompilerIdDetection.cmake | ||
index f15974ae01..8a18ac9610 100644 | ||
--- a/Modules/CMakeCompilerIdDetection.cmake | ||
+++ b/Modules/CMakeCompilerIdDetection.cmake | ||
@@ -14,7 +14,7 @@ endfunction() | ||
function(compiler_id_detection outvar lang) | ||
|
||
if (NOT "x${lang}" STREQUAL "xFortran" AND NOT "x${lang}" STREQUAL "xCSharp" | ||
- AND NOT "x${lang}" STREQUAL "xISPC") | ||
+ AND NOT "x${lang}" STREQUAL "xISPC" AND NOT "x${lang}" STREQUAL "xPLI") | ||
file(GLOB lang_files | ||
"${CMAKE_ROOT}/Modules/Compiler/*-DetermineCompiler.cmake") | ||
set(nonlang CXX) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
diff --git a/Modules/CMakeDetermineCompilerId.cmake b/Modules/CMakeDetermineCompilerId.cmake | ||
index 2b19736d47..5a7acce657 100644 | ||
--- a/Modules/CMakeDetermineCompilerId.cmake | ||
+++ b/Modules/CMakeDetermineCompilerId.cmake | ||
@@ -5,6 +5,11 @@ macro(__determine_compiler_id_test testflags_var userflags_var) | ||
separate_arguments(testflags UNIX_COMMAND "${${testflags_var}}") | ||
CMAKE_DETERMINE_COMPILER_ID_BUILD("${lang}" "${testflags}" "${${userflags_var}}" "${src}") | ||
CMAKE_DETERMINE_COMPILER_ID_MATCH_VENDOR("${lang}" "${COMPILER_${lang}_PRODUCED_OUTPUT}") | ||
+ foreach(vendor ${CMAKE_${lang}_COMPILER_ID_MATCH_VENDORS}) | ||
+ if(${COMPILER_${lang}_PRODUCED_OUTPUT} MATCHES ${CMAKE_${lang}_COMPILER_ID_MATCH_VERSION_REGEX_${vendor}}) | ||
+ set(CMAKE_${lang}_COMPILER_VERSION "${CMAKE_MATCH_1}") | ||
+ endif() | ||
+ endforeach() | ||
|
||
if(NOT CMAKE_${lang}_COMPILER_ID) | ||
foreach(file ${COMPILER_${lang}_PRODUCED_FILES}) | ||
@@ -32,6 +37,11 @@ function(CMAKE_DETERMINE_COMPILER_ID lang flagvar src) | ||
endif() | ||
string(REPLACE " " ";" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS}") | ||
|
||
+ # Drop qASCII Flag for z/OS for correct encoding of string literals. | ||
+ if(CMAKE_SYSTEM_NAME MATCHES "OS390") | ||
+ string(REGEX REPLACE "-(qASCII|qascii|fzos-le-char-mode=ascii);?" "" CMAKE_${lang}_COMPILER_ID_FLAGS_LIST "${CMAKE_${lang}_COMPILER_ID_FLAGS_LIST}") | ||
+ endif() | ||
+ | ||
# Compute the directory in which to run the test. | ||
set(CMAKE_${lang}_COMPILER_ID_DIR ${CMAKE_PLATFORM_INFO_DIR}/CompilerId${lang}) | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,132 @@ | ||
diff --git a/Modules/CMakeDeterminePLICompiler.cmake b/Modules/CMakeDeterminePLICompiler.cmake | ||
new file mode 100644 | ||
index 0000000000..b8ff84164c | ||
--- /dev/null | ||
+++ b/Modules/CMakeDeterminePLICompiler.cmake | ||
@@ -0,0 +1,126 @@ | ||
+# Distributed under the OSI-approved BSD 3-Clause License. See accompanying | ||
+# file Copyright.txt or https://cmake.org/licensing for details. | ||
+ | ||
+ | ||
+# determine the compiler to use for PLI programs | ||
+# NOTE, a generator may set CMAKE_PLI_COMPILER before | ||
+# loading this file to force a compiler. | ||
+# use environment variable PC first if defined by user, next use | ||
+# the cmake variable CMAKE_GENERATOR_PC which can be defined by a generator | ||
+# as a default compiler | ||
+ | ||
+include(${CMAKE_ROOT}/Modules/CMakeDetermineCompiler.cmake) | ||
+include(Platform/${CMAKE_SYSTEM_NAME}-Determine-PLI OPTIONAL) | ||
+include(Platform/${CMAKE_SYSTEM_NAME}-PLI OPTIONAL) | ||
+if(NOT CMAKE_PLI_COMPILER_NAMES) | ||
+ set(CMAKE_PLI_COMPILER_NAMES pli) | ||
+endif() | ||
+ | ||
+if(NOT CMAKE_PLI_COMPILER) | ||
+ # prefer the environment variable PC | ||
+ if(NOT $ENV{PC} STREQUAL "") | ||
+ get_filename_component(CMAKE_PLI_COMPILER_INIT $ENV{PC} PROGRAM PROGRAM_ARGS CMAKE_PLI_FLAGS_ENV_INIT) | ||
+ if(CMAKE_PLI_FLAGS_ENV_INIT) | ||
+ set(CMAKE_PLI_COMPILER_ARG1 "${CMAKE_PLI_FLAGS_ENV_INIT}" CACHE STRING "Arguments to PLI compiler") | ||
+ endif() | ||
+ if(EXISTS ${CMAKE_PLI_COMPILER_INIT}) | ||
+ else() | ||
+ message(FATAL_ERROR "Could not find compiler set in environment variable PC:\n$ENV{PC}.") | ||
+ endif() | ||
+ endif() | ||
+ | ||
+ # next try prefer the compiler specified by the generator | ||
+ if(CMAKE_GENERATOR_PC) | ||
+ if(NOT CMAKE_PLI_COMPILER_INIT) | ||
+ set(CMAKE_PLI_COMPILER_INIT ${CMAKE_GENERATOR_PC}) | ||
+ endif() | ||
+ endif() | ||
+ | ||
+ # finally list compilers to try | ||
+ if(NOT CMAKE_PLI_COMPILER_INIT) | ||
+ # Known compilers: | ||
+ # pli: generic compiler names | ||
+ set(CMAKE_PLI_COMPILER_LIST | ||
+ pli | ||
+ ) | ||
+ | ||
+ # Vendor-specific compiler names. | ||
+ set(_PLI_COMPILER_NAMES_ZOS pli) | ||
+ endif() | ||
+ | ||
+ _cmake_find_compiler(PLI) | ||
+ | ||
+else() | ||
+ _cmake_find_compiler_path(PLI) | ||
+endif() | ||
+mark_as_advanced(CMAKE_PLI_COMPILER) | ||
+ | ||
+# Each entry in this list is a set of extra flags to try | ||
+# adding to the compile line to see if it helps produce | ||
+# a valid identification executable. | ||
+set(CMAKE_PLI_COMPILER_ID_TEST_FLAGS_FIRST | ||
+ # Get verbose output to help distinguish compilers. | ||
+ "-v" | ||
+ ) | ||
+set(CMAKE_PLI_COMPILER_ID_TEST_FLAGS | ||
+ # Try compiling to an object file only. | ||
+ "-c" | ||
+ ) | ||
+ | ||
+# Build a small source file to identify the compiler. | ||
+if(NOT CMAKE_PLI_COMPILER_ID_RUN) | ||
+ set(CMAKE_PLI_COMPILER_ID_RUN 1) | ||
+ | ||
+ | ||
+ # Table of per-vendor compiler id flags with expected output. | ||
+ list(APPEND CMAKE_PLI_COMPILER_ID_VENDORS IBM) | ||
+ set(CMAKE_PLI_COMPILER_ID_VENDOR_FLAGS_IBM "-v") | ||
+ set(CMAKE_PLI_COMPILER_ID_VENDOR_REGEX_IBM "15655-PL[.]*") | ||
+ list(APPEND CMAKE_PLI_COMPILER_ID_MATCH_VENDORS "${CMAKE_PLI_COMPILER_ID_VENDORS}") | ||
+ set(CMAKE_PLI_COMPILER_ID_MATCH_VENDOR_REGEX_IBM "${CMAKE_PLI_COMPILER_ID_VENDOR_REGEX_IBM}") | ||
+ set(CMAKE_PLI_COMPILER_ID_MATCH_VERSION_REGEX_IBM "[.]*Enterprise PL/I for z/OS[ ]*([0-9\.]+)[.]*") | ||
+# [=[ V([0-9]+)\.([0-9]+)\.([0-9]+)]=]) | ||
+ include(${CMAKE_ROOT}/Modules/CMakeDetermineCompilerId.cmake) | ||
+ CMAKE_DETERMINE_COMPILER_ID(PLI PLIFLAGS CMakePLICompilerId.pli) | ||
+ | ||
+ unset(_version_info) | ||
+ | ||
+endif () | ||
+ | ||
+set(_CMAKE_PROCESSING_LANGUAGE "PLI") | ||
+include(CMakeFindBinUtils) | ||
+include(Compiler/${CMAKE_PLI_COMPILER_ID}-FindBinUtils OPTIONAL) | ||
+unset(_CMAKE_PROCESSING_LANGUAGE) | ||
+ | ||
+if(CMAKE_PLI_COMPILER_SYSROOT) | ||
+ string(CONCAT _SET_CMAKE_PLI_COMPILER_SYSROOT | ||
+ "set(CMAKE_PLI_COMPILER_SYSROOT \"${CMAKE_PLI_COMPILER_SYSROOT}\")\n" | ||
+ "set(CMAKE_COMPILER_SYSROOT \"${CMAKE_PLI_COMPILER_SYSROOT}\")") | ||
+else() | ||
+ set(_SET_CMAKE_PLI_COMPILER_SYSROOT "") | ||
+endif() | ||
+ | ||
+if(CMAKE_PLI_COMPILER_ARCHITECTURE_ID) | ||
+ set(_SET_CMAKE_PLI_COMPILER_ARCHITECTURE_ID | ||
+ "set(CMAKE_PLI_COMPILER_ARCHITECTURE_ID ${CMAKE_PLI_COMPILER_ARCHITECTURE_ID})") | ||
+else() | ||
+ set(_SET_CMAKE_PLI_COMPILER_ARCHITECTURE_ID "") | ||
+endif() | ||
+ | ||
+if(CMAKE_PLI_COMPILER_ID) | ||
+ set(_SET_CMAKE_PLI_COMPILER_ID | ||
+ "set(CMAKE_PLI_COMPILER_ID ${CMAKE_PLI_COMPILER_ID})") | ||
+else() | ||
+ set(_SET_CMAKE_PLI_COMPILER_ID "") | ||
+endif() | ||
+ | ||
+if(MSVC_PLI_ARCHITECTURE_ID) | ||
+ set(SET_MSVC_PLI_ARCHITECTURE_ID | ||
+ "set(MSVC_PLI_ARCHITECTURE_ID ${MSVC_PLI_ARCHITECTURE_ID})") | ||
+endif() | ||
+# configure variables set in this file for fast reload later on | ||
+configure_file(${CMAKE_ROOT}/Modules/CMakePLICompiler.cmake.in | ||
+ ${CMAKE_PLATFORM_INFO_DIR}/CMakePLICompiler.cmake | ||
+ @ONLY | ||
+ ) | ||
+set(CMAKE_PLI_COMPILER_ENV_VAR "PC") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
diff --git a/Modules/CMakePLICompiler.cmake.in b/Modules/CMakePLICompiler.cmake.in | ||
new file mode 100644 | ||
index 0000000000..f2cad7ca1e | ||
--- /dev/null | ||
+++ b/Modules/CMakePLICompiler.cmake.in | ||
@@ -0,0 +1,52 @@ | ||
+set(CMAKE_PLI_COMPILER "@CMAKE_PLI_COMPILER@") | ||
+set(CMAKE_PLI_COMPILER_ARG1 "@CMAKE_PLI_COMPILER_ARG1@") | ||
+set(CMAKE_PLI_COMPILER_ID "@CMAKE_PLI_COMPILER_ID@") | ||
+set(CMAKE_PLI_COMPILER_VERSION "@CMAKE_PLI_COMPILER_VERSION@") | ||
+set(CMAKE_PLI_COMPILER_WRAPPER "@CMAKE_PLI_COMPILER_WRAPPER@") | ||
+set(CMAKE_PLI_PLATFORM_ID "@CMAKE_PLI_PLATFORM_ID@") | ||
+set(CMAKE_PLI_SIMULATE_ID "@CMAKE_PLI_SIMULATE_ID@") | ||
+set(CMAKE_PLI_COMPILER_FRONTEND_VARIANT "@CMAKE_PLI_COMPILER_FRONTEND_VARIANT@") | ||
+set(CMAKE_PLI_SIMULATE_VERSION "@CMAKE_PLI_SIMULATE_VERSION@") | ||
+@_SET_CMAKE_PLI_XL_CPP@ | ||
+@_SET_CMAKE_PLI_COMPILER_ARCHITECTURE_ID@ | ||
+@_SET_CMAKE_PLI_COMPILER_SYSROOT@ | ||
+@SET_MSVC_PLI_ARCHITECTURE_ID@ | ||
+set(CMAKE_AR "@CMAKE_AR@") | ||
+set(CMAKE_PLI_COMPILER_AR "@CMAKE_PLI_COMPILER_AR@") | ||
+set(CMAKE_RANLIB "@CMAKE_RANLIB@") | ||
+set(CMAKE_PLI_COMPILER_RANLIB "@CMAKE_PLI_COMPILER_RANLIB@") | ||
+set(CMAKE_PLI_COMPILER_LOADED 1) | ||
+set(CMAKE_PLI_COMPILER_WORKS @CMAKE_PLI_COMPILER_WORKS@) | ||
+set(CMAKE_PLI_ABI_COMPILED @CMAKE_PLI_ABI_COMPILED@) | ||
+ | ||
+set(CMAKE_PLI_COMPILER_ENV_VAR "PC") | ||
+ | ||
+set(CMAKE_PLI_COMPILER_ID_RUN 1) | ||
+set(CMAKE_PLI_SOURCE_FILE_EXTENSIONS pli;pl1;PLI;PL1) | ||
+set(CMAKE_PLI_IGNORE_EXTENSIONS inc;include;INC;INCLUDE;o;O) | ||
+ | ||
+# Save compiler ABI information. | ||
+set(CMAKE_PLI_SIZEOF_DATA_PTR "@CMAKE_PLI_SIZEOF_DATA_PTR@") | ||
+set(CMAKE_PLI_COMPILER_ABI "@CMAKE_PLI_COMPILER_ABI@") | ||
+set(CMAKE_PLI_LIBRARY_ARCHITECTURE "@CMAKE_PLI_LIBRARY_ARCHITECTURE@") | ||
+ | ||
+if(CMAKE_PLI_SIZEOF_DATA_PTR AND NOT CMAKE_SIZEOF_VOID_P) | ||
+ set(CMAKE_SIZEOF_VOID_P "${CMAKE_PLI_SIZEOF_DATA_PTR}") | ||
+endif() | ||
+ | ||
+if(CMAKE_PLI_COMPILER_ABI) | ||
+ set(CMAKE_INTERNAL_PLATFORM_ABI "${CMAKE_PLI_COMPILER_ABI}") | ||
+endif() | ||
+ | ||
+if(CMAKE_PLI_LIBRARY_ARCHITECTURE) | ||
+ set(CMAKE_LIBRARY_ARCHITECTURE "@CMAKE_PLI_LIBRARY_ARCHITECTURE@") | ||
+endif() | ||
+ | ||
+@CMAKE_PLI_COMPILER_CUSTOM_CODE@ | ||
+@CMAKE_PLI_SYSROOT_FLAG_CODE@ | ||
+@CMAKE_PLI_OSX_DEPLOYMENT_TARGET_FLAG_CODE@ | ||
+ | ||
+set(CMAKE_PLI_IMPLICIT_INCLUDE_DIRECTORIES "@CMAKE_PLI_IMPLICIT_INCLUDE_DIRECTORIES@") | ||
+set(CMAKE_PLI_IMPLICIT_LINK_LIBRARIES "@CMAKE_PLI_IMPLICIT_LINK_LIBRARIES@") | ||
+set(CMAKE_PLI_IMPLICIT_LINK_DIRECTORIES "@CMAKE_PLI_IMPLICIT_LINK_DIRECTORIES@") | ||
+set(CMAKE_PLI_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES "@CMAKE_PLI_IMPLICIT_LINK_FRAMEWORK_DIRECTORIES@") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
diff --git a/Modules/CMakePLICompilerABI.pli b/Modules/CMakePLICompilerABI.pli | ||
new file mode 100644 | ||
index 0000000000..574e18322b | ||
--- /dev/null | ||
+++ b/Modules/CMakePLICompilerABI.pli | ||
@@ -0,0 +1,7 @@ | ||
+*Process Limits( Extname( 100 ) ); | ||
+ CMakePLICompileABI: PROC OPTIONS(MAIN); | ||
+ /* need to add 64-bit support too */ | ||
+ PUT SKIP LIST('INFO:sizeof_dptr[4]'); | ||
+ PUT SKIP LIST('ABI Detection'); | ||
+ END CMakePLICompileABI; | ||
+ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
diff --git a/Modules/CMakePLICompilerId.pli.in b/Modules/CMakePLICompilerId.pli.in | ||
new file mode 100644 | ||
index 0000000000..8951d0a63c | ||
--- /dev/null | ||
+++ b/Modules/CMakePLICompilerId.pli.in | ||
@@ -0,0 +1,5 @@ | ||
+*Process Limits( Extname( 100 ) ); | ||
+ CMakePLICompilerId: PROC OPTIONS(MAIN); | ||
+ /* need to add 64-bit support too */ | ||
+ PUT SKIP LIST('PL/I Compiler 6.2'); | ||
+ END CMakePLICompilerId; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.