#!/bin/sh
CONFIG_LIBS="-Wl,-R/usr/pkg/lib -L/usr/pkg/lib -lgdal"
CONFIG_DEP_LIBS="-Wl,-R/usr/pkg/lib -L/usr/lib -larchive -lssl -lcrypto -llzma -lqhull_r -lgeotiff -ltiff -lLerc -lzstd -laec -ljpeg -lpoppler -lpng16 -lgif -lnetcdf -lwebp -lopenjp2 -lpcre2-8 -lspatialite -lsqlite3 -lxerces-c -L/usr/pkg/lib -lexpat -lxml2 -lgeos_c -lcurl -lproj -ljson-c -lz -lpthread -lstdc++ -lm"
CONFIG_PREFIX="/usr/pkg"
CONFIG_CFLAGS="-I/usr/pkg/include"
CONFIG_DATA="/usr/pkg/share/gdal"
CONFIG_VERSION="3.13.1"
CONFIG_GNM_ENABLED=yes
CONFIG_FORMATS="JPEG raw GTIFF MEM vrt Derived GTI LIBERTIFF 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 SNAP_TIFF BSB AIGrid USGSDEM AirSAR PCIDSK SIGDEM RIK STACIT PDF RCM GDALG E57 PNG GIF WCS HTTP netCDF Zarr DAAS EEDA PLMOSAIC WMS OGCAPI WEBP MBTiles JP2OpenJPEG PCRaster MiraMon GeoJSON TAB Shape KML VRT AVC GML CSV DGN GMT NTF S57 Tiger GeoRSS DXF PGDump GPSBabel EDIGEO SXF OpenFileGDB WAsP Selafin JML VDV FlatGeobuf MapML ADBC MiraMon AIVector JSONFG GPX GMLAS CSW NAS PLSCENES WFS OAPIF NGW Elastic Idrisi PDS SQLite GeoPackage OSM VFK MVT PMTiles AmigoCloud Carto ILI XLSX CAD GTFS ODS LVBAG"
CONFIG_PLUGINDIR="/usr/pkg/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
