#!/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 -lgif -lblosc -lz -lpcre2-8 -lspatialite -lsqlite3 -lexpat.1.8.10 -lm -lxml2 -lgeos_c.1.18.1 -lcurl -lproj"
CONFIG_PREFIX="/opt/local"
CONFIG_CFLAGS="-I/opt/local/include"
CONFIG_DATA="/opt/local/share/gdal"
CONFIG_VERSION="3.8.3"
CONFIG_GNM_ENABLED=yes
CONFIG_FORMATS="JPEG raw GTIFF MEM vrt Derived HFA SDTS NITF GXF AAIGrid CEOS SAR_CEOS XPM DTED JDEM Envisat ELAS FIT L1B RS2 ILWIS RMF Leveller SGI SRTMHGT IDRISI GSG ERS PALSARJaxa DIMAP GFF COSAR PDS ADRG COASP TSX Terragen BLX MSGN TIL R northwood SAGA XYZ ESRIC HF2 KMLSUPEROVERLAY CTG ZMap NGSGEOID IRIS MAP CALS SAFE SENTINEL2 PRF MRF WMTS GRIB BMP TGA STACTA BSB AIGrid ARG USGSDEM AirSAR OZI PCIDSK SIGDEM STACIT PNG GIF WCS Zarr DAAS EEDA PLMOSAIC WMS OGCAPI Rasterlite MBTiles PCRaster MEM geojson TAB Shape KML VRT AVC GML CSV DGN GMT NTF S57 Tiger Geoconcept GeoRSS DXF PGDump GPSBabel EDIGEO SXF OpenFileGDB WAsP Selafin JML VDV FlatGeobuf MapML JSONFG SDTS GPX SVG 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
