🛠️🐜 Antkeeper superbuild with dependencies included https://antkeeper.com
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

166 lines
3.6 KiB

  1. dnl Process this file with autoconf to produce a configure script.
  2. AC_INIT([sdlvisualtest], [0.01], [apoorvupreti@gmail.com])
  3. dnl Detect the canonical build and host environments
  4. AC_CONFIG_AUX_DIRS($srcdir/../build-scripts)
  5. AC_CANONICAL_HOST
  6. dnl Check for tools
  7. AC_PROG_CC
  8. dnl Check for compiler environment
  9. AC_C_CONST
  10. dnl We only care about this for building testnative at the moment, so these
  11. dnl values shouldn't be considered absolute truth.
  12. dnl (Haiku, for example, sets none of these.)
  13. ISUNIX="false"
  14. ISWINDOWS="false"
  15. ISMACOSX="false"
  16. dnl Figure out which math or extra library to use
  17. case "$host" in
  18. *-*-cygwin* | *-*-mingw32*)
  19. ISWINDOWS="true"
  20. EXE=".exe"
  21. MATHLIB=""
  22. EXTRALIB="-lshlwapi"
  23. SYS_GL_LIBS="-lopengl32"
  24. ;;
  25. *-*-haiku*)
  26. EXE=""
  27. MATHLIB=""
  28. EXTRALIB=""
  29. SYS_GL_LIBS="-lGL"
  30. ;;
  31. *-*-darwin* )
  32. ISMACOSX="true"
  33. EXE=""
  34. MATHLIB=""
  35. EXTRALIB=""
  36. ;;
  37. *-*-aix*)
  38. ISUNIX="true"
  39. EXE=""
  40. if test x$ac_cv_prog_gcc = xyes; then
  41. CFLAGS="-mthreads"
  42. fi
  43. MATHLIB=""
  44. EXTRALIB=""
  45. SYS_GL_LIBS=""
  46. ;;
  47. *-*-mint*)
  48. EXE=""
  49. MATHLIB=""
  50. EXTRALIB=""
  51. AC_PATH_PROG(OSMESA_CONFIG, osmesa-config, no)
  52. if test "x$OSMESA_CONFIG" = "xyes"; then
  53. OSMESA_CFLAGS=`$OSMESA_CONFIG --cflags`
  54. OSMESA_LIBS=`$OSMESA_CONFIG --libs`
  55. CFLAGS="$CFLAGS $OSMESA_CFLAGS"
  56. SYS_GL_LIBS="$OSMESA_LIBS"
  57. else
  58. SYS_GL_LIBS="-lOSMesa"
  59. fi
  60. ;;
  61. *-*-qnx*)
  62. EXE=""
  63. MATHLIB=""
  64. EXTRALIB=""
  65. SYS_GL_LIBS="-lGLES_CM"
  66. ;;
  67. *)
  68. dnl Oh well, call it Unix...
  69. ISUNIX="true"
  70. EXE=""
  71. MATHLIB="-lm"
  72. EXTRALIB=""
  73. SYS_GL_LIBS="-lGL"
  74. ;;
  75. esac
  76. AC_SUBST(EXE)
  77. AC_SUBST(MATHLIB)
  78. AC_SUBST(EXTRALIB)
  79. AC_SUBST(ISMACOSX)
  80. AC_SUBST(ISWINDOWS)
  81. AC_SUBST(ISUNIX)
  82. dnl Check for SDL
  83. SDL_VERSION=2.0.0
  84. AM_PATH_SDL2($SDL_VERSION,
  85. :,
  86. AC_MSG_ERROR([*** SDL version $SDL_VERSION not found!])
  87. )
  88. CFLAGS="$CFLAGS $SDL_CFLAGS"
  89. LIBS="$LIBS -lSDL2_test $SDL_LIBS $EXTRALIB"
  90. dnl Check for X11 path, needed for OpenGL on some systems
  91. AC_PATH_X
  92. if test x$have_x = xyes; then
  93. if test x$ac_x_includes = xno || test x$ac_x_includes = x; then
  94. :
  95. else
  96. CFLAGS="$CFLAGS -I$ac_x_includes"
  97. fi
  98. if test x$ac_x_libraries = xno || test x$ac_x_libraries = x; then
  99. :
  100. else
  101. XPATH="-L$ac_x_libraries"
  102. fi
  103. fi
  104. dnl Check for OpenGL
  105. AC_MSG_CHECKING(for OpenGL support)
  106. have_opengl=no
  107. AC_TRY_COMPILE([
  108. #include "SDL_opengl.h"
  109. ],[
  110. ],[
  111. have_opengl=yes
  112. ])
  113. AC_MSG_RESULT($have_opengl)
  114. dnl Check for OpenGL ES
  115. AC_MSG_CHECKING(for OpenGL ES support)
  116. have_opengles=no
  117. AC_TRY_COMPILE([
  118. #if defined (__IPHONEOS__)
  119. #include <OpenGLES/ES1/gl.h>
  120. #else
  121. #include <GLES/gl.h>
  122. #endif /* __QNXNTO__ */
  123. ],[
  124. ],[
  125. have_opengles=yes
  126. ])
  127. AC_MSG_RESULT($have_opengles)
  128. GLLIB=""
  129. if test x$have_opengles = xyes; then
  130. CFLAGS="$CFLAGS -DHAVE_OPENGLES"
  131. GLLIB="$XPATH -lGLESv1_CM"
  132. elif test x$have_opengl = xyes; then
  133. CFLAGS="$CFLAGS -DHAVE_OPENGL"
  134. GLLIB="$XPATH $SYS_GL_LIBS"
  135. else
  136. GLLIB=""
  137. fi
  138. AC_SUBST(GLLIB)
  139. dnl Check for SDL_ttf
  140. AC_CHECK_LIB(SDL2_ttf, TTF_Init, have_SDL_ttf=yes)
  141. if test x$have_SDL_ttf = xyes; then
  142. CFLAGS="$CFLAGS -DHAVE_SDL_TTF"
  143. SDL_TTF_LIB="-lSDL2_ttf"
  144. fi
  145. AC_SUBST(SDL_TTF_LIB)
  146. dnl Finally create all the generated files
  147. dnl AC_OUTPUT([Makefile])
  148. AC_CONFIG_HEADERS([config.h])
  149. AC_CONFIG_FILES([Makefile])
  150. AC_OUTPUT()