104 |
104 |
105 # Check for SDL |
105 # Check for SDL |
106 SDL_CFLAGS="" |
106 SDL_CFLAGS="" |
107 SDL_LIBS="" |
107 SDL_LIBS="" |
108 SDL="No" |
108 SDL="No" |
109 AC_MSG_CHECKING(SDL2 library) |
109 AC_MSG_CHECKING(SDL library) |
110 pkg-config --exists sdl |
110 pkg-config --exists sdl |
111 if test "$?" = "0"; then |
111 if test "$?" = "0"; then |
112 AC_MSG_RESULT(yes) |
112 AC_MSG_RESULT(yes) |
113 AC_MSG_CHECKING(sdl2 library v2.0.0 or newer) |
113 AC_MSG_CHECKING(sdl library v2.0.0 or newer) |
114 pkg-config --atleast-version=2.0.0 sdl2 |
114 pkg-config --atleast-version=2.0.0 sdl2 |
115 if test "$?" = "0"; then |
115 if test "$?" = "0"; then |
116 AC_MSG_RESULT(found) |
116 AC_MSG_RESULT(found) |
|
117 SDL_CFLAGS="$(pkg-config --cflags sdl2)" |
|
118 SDL_LIBS="$(pkg-config --libs sdl2)" |
|
119 AC_CHECK_HEADERS(SDL2/SDL.h) |
|
120 SDL="Yes" |
117 else |
121 else |
118 AC_MSG_ERROR(not found) |
122 AC_MSG_RESULT(not found) |
119 fi |
123 fi |
120 SDL_CFLAGS="$(pkg-config --cflags sdl2)" |
|
121 SDL_LIBS="$(pkg-config --libs sdl2)" |
|
122 AC_CHECK_HEADERS(SDL2/SDL.h) |
|
123 SDL="Yes" |
|
124 else |
124 else |
125 AC_MSG_RESULT(no) |
125 AC_MSG_RESULT(no) |
126 fi |
126 fi |
127 |
127 |
128 # Check for SDL_ttf |
128 # Check for SDL_ttf if base SDL2 is found. |
129 AC_MSG_CHECKING(SDL2_ttf library) |
129 if test "$SDL" = "Yes"; then |
130 pkg-config --exists SDL2_ttf |
130 AC_MSG_CHECKING(SDL2_ttf library) |
131 if test "$?" = "0"; then |
131 pkg-config --exists SDL2_ttf |
132 AC_MSG_RESULT(yes) |
|
133 AC_MSG_CHECKING(sdl2 library v2.0.0 or newer) |
|
134 pkg-config --atleast-version=2.0.0 SDL2_ttf |
|
135 if test "$?" = "0"; then |
132 if test "$?" = "0"; then |
136 AC_MSG_RESULT(found) |
133 AC_MSG_RESULT(yes) |
|
134 AC_MSG_CHECKING(sdl2 library v2.0.0 or newer) |
|
135 pkg-config --atleast-version=2.0.0 SDL2_ttf |
|
136 if test "$?" = "0"; then |
|
137 AC_MSG_RESULT(found) |
|
138 # Override flags |
|
139 SDL_CFLAGS="$(pkg-config --cflags SDL2_ttf)" |
|
140 SDL_LIBS="$(pkg-config --libs SDL2_ttf)" |
|
141 else |
|
142 AC_MSG_ERROR(not found) |
|
143 SDL="No" |
|
144 fi |
137 else |
145 else |
138 AC_MSG_ERROR(not found) |
146 AC_MSG_RESULT(no) |
139 fi |
147 fi |
140 # Override flags |
|
141 SDL_CFLAGS="$(pkg-config --cflags SDL2_ttf)" |
|
142 SDL_LIBS="$(pkg-config --libs SDL2_ttf)" |
|
143 else |
|
144 AC_MSG_RESULT(no) |
|
145 fi |
148 fi |
146 |
149 |
147 dnl Checks for header files. |
150 dnl Checks for header files. |
148 AC_HEADER_STDC |
151 AC_HEADER_STDC |
149 |
152 |