GetTIOCGWINSZ.sh 483 B

1234567891011121314151617
  1. #!/bin/bash
  2. # Create output directory if it doesn't exist
  3. mkdir -p ../../compiled-binaries
  4. # Determine the output file extension based on the OS
  5. if [[ "$OSTYPE" == "linux-gnu"* ]]; then
  6. OUTPUT_FILE="../../compiled-binaries/libGetTIOCGWINSZ.so"
  7. elif [[ "$OSTYPE" == "darwin"* ]]; then
  8. OUTPUT_FILE="../../compiled-binaries/libGetTIOCGWINSZ.dylib"
  9. else
  10. echo "Unsupported OS: $OSTYPE"
  11. exit 1
  12. fi
  13. # Compile the C file
  14. gcc -shared -fPIC -o "$OUTPUT_FILE" GetTIOCGWINSZ.c