Nexus Nexus - MATLAB Compatible Computing Platform
← Back to Plans

BUILD-OPTIONS.md

# Build Options for GPL Replacement

## Overview

The build system now supports a compile-time option to choose between:
- **Original GPL libraries** (default)
- **Proprietary rewritten libraries** (GPL replacement)

Both versions include all new features:
- Dynamic properties
- Unit tests
- JIT compiler
- All other enhancements

## Usage

### Build with Original GPL Libraries (Default)
```bash
./configure
make
```

### Build with Proprietary Rewritten Libraries
```bash
./configure --enable-gpl-replacement
make
```

## How It Works

The `--enable-gpl-replacement` option:
1. Defines `OCTAVE_USE_GPL_REPLACEMENT` preprocessor macro
2. Uses conditional compilation (`#ifdef`) to select implementations
3. Both versions are in the same source files
4. Tests work for both configurations

## Example in Source Code

```cpp
#ifdef OCTAVE_USE_GPL_REPLACEMENT
  // Proprietary implementation - replaces GPL code
  void my_function() {
    // New implementation
  }
#else
  // Original GPL implementation
  void my_function() {
    // Original code
  }
#endif
```

## Benefits

- **Safety**: Always have a working version (original)
- **Testing**: Can test both versions
- **Gradual Migration**: Switch to rewritten version when ready
- **Compatibility**: Both versions have same features

## Status

- ✅ Configure option added
- ⏳ Conditional compilation guards (in progress)
- ⏳ Build system integration (in progress)
- ⏳ Testing both configurations (pending)