configure.ac 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. dnl SPDX-FileCopyrightText: 2024 mio <stigma@disroot.org>
  2. dnl Copyright 2024 mio <stigma@disroot.org>
  3. dnl
  4. dnl SPDX-License-Identifier: GPL-3.0-only.
  5. dnl configuration script for pixiv_down
  6. dnl Process this file with autoconf to produce the 'configure' script.
  7. AC_INIT([pixiv_down], [2024.09], [stigma@disroot.org],
  8. [pixiv_down],
  9. [https://yume-neru.neocities.org/pixiv_down.html])
  10. AC_CONFIG_AUX_DIR([build-aux])
  11. AM_INIT_AUTOMAKE([gnu silent-rules -Wall -Wno-portability
  12. subdir-objects])
  13. AC_PROG_CC
  14. AC_CHECK_PROGS([DC], [gdc ldc2 dmd], none)
  15. AS_IF([test x"$DC" = x"none"],
  16. [ AC_MSG_ERROR([Please install a D compiler such as GDC, DMD, or LDC]) ])
  17. AM_CONDITIONAL(IS_GDC, test x$DC = xgdc)
  18. AM_CONDITIONAL(IS_LDC, test x$DC = xldc2)
  19. AM_CONDITIONAL(IS_DMD, test x$DC = xdmd)
  20. dnl This should be moved to custom M4 script.
  21. GDC_VERSION=""
  22. GDC_VERSION_MAJOR=""
  23. AS_IF([test x"$DC" = x"gdc"],
  24. AC_MSG_CHECKING([if gdc is version 12])
  25. GDC_VERSION=$($DC -dumpversion)
  26. GDC_VERSION_MAJOR=$(echo $GDC_VERSION | cut -d'.' -f1)
  27. AS_IF([test "x$GDC_VERSION_MAJOR" = "x12"],
  28. AC_MSG_RESULT([yes]),
  29. AC_MSG_RESULT([no])))
  30. AM_CONDITIONAL(IS_GDC_12, test "x$GDC_VERSION_MAJOR" = "x12")
  31. VCS_TAG="release"
  32. AC_CHECK_PROGS([GIT], git, none)
  33. AS_IF([test "x$GIT" = "xnone"], [],
  34. AS_IF([test -d ".git"],
  35. VCS_TAG=$(git rev-parse --short HEAD)))
  36. AC_SUBST(VCS_TAG)
  37. AC_CONFIG_FILES([
  38. Makefile
  39. docs/Makefile
  40. source/Makefile
  41. source/pd_version.d
  42. ])
  43. AC_OUTPUT