#!/bin/sh
CONFIG_LIBS="-L/opt/local/lib -lgdal"
CONFIG_DEP_LIBS="-liconv -L/opt/local/libexec/openssl3/lib -lssl -lcrypto -llz4 -ldeflate -lwebp -L/opt/local/lib/proj9/lib -lqhull_r -ljpeg -lLerc -lzstd -lbrunslienc-c -lbrunslidec-c -lpng -L/opt/local/lib/libaec/lib -laec -lblosc -lz -lpcre2-8 -lspatialite -lsqlite3 -lexpat.1.10.0 -lm -lxml2 -lgeos_c.1.19.2 -lcurl -lproj"
CONFIG_PREFIX="/opt/local"
CONFIG_CFLAGS="-I/opt/local/include"
CONFIG_DATA="/opt/local/share/gdal"
CONFIG_VERSION="3.11.0"
CONFIG_GNM_ENABLED=yes
CONFIG_FORMATS="JPEG raw GTIFF MEM vrt HFA NITF GXF AAIGrid CEOS SAR_CEOS DTED JDEM Envisat L1B RS2 ILWIS RMF Leveller SRTMHGT IDRISI GSG ERS PALSARJaxa DIMAP GFF COSAR PDS ADRG COASP TSX Terragen MSGN TIL northwood SAGA XYZ ESRIC HF2 KMLSUPEROVERLAY CTG ZMap NGSGEOID IRIS MAP CALS SAFE SENTINEL2 PRF MRF WMTS GRIB BMP TGA STACTA BSB AIGrid USGSDEM AirSAR PCIDSK SIGDEM STACIT PDF PNG GIF WCS Zarr DAAS EEDA HDF5 PLMOSAIC WMS OGCAPI HDF4 MBTiles KEA PCRaster GeoJSON Shape AVC GML CSV DGN GMT S57 GeoRSS DXF PGDump GPSBabel EDIGEO SXF OpenFileGDB WAsP Selafin JML VDV FlatGeobuf MapML JSONFG GPX LIBKML PLSCENES WFS NGW Elastic SQLite GeoPackage OSM VFK MVT PMTiles AmigoCloud Carto PG XLSX CAD ODS LVBAG"
CONFIG_PLUGINDIR="/opt/local/lib/gdalplugins"
usage()

{
	cat <<EOF
Usage: gdal-config [OPTIONS]
Options:
	[--prefix[=DIR]]
	[--libs]
	[--dep-libs]
	[--cflags]
	[--datadir]
	[--version]
	[--ogr-enabled]
	[--gnm-enabled]
	[--formats]
	[--plugindir]
EOF
	exit $1
}

if test $# -eq 0; then
	usage 1 1>&2
fi

case $1 in
  --libs)
    echo $CONFIG_LIBS
    ;;

  --dep-libs)
    echo $CONFIG_DEP_LIBS
    ;;

  --cflags)
    echo $CONFIG_CFLAGS
    ;;

  --datadir)
    echo $CONFIG_DATA
    ;;

  --prefix)
    echo $CONFIG_PREFIX
    ;;

  --version)
    echo $CONFIG_VERSION
    ;;

  --ogr-enabled)
    echo yes
    ;;

  --gnm-enabled)
    echo $CONFIG_GNM_ENABLED
    ;;

  --formats)
    echo $CONFIG_FORMATS
    ;;

  --plugindir)
    echo $CONFIG_PLUGINDIR
    ;;

  *)
    usage 1 1>&2
    ;;

esac
