39 else |
39 else |
40 AC_MSG_ERROR(mosquitto not found) |
40 AC_MSG_ERROR(mosquitto not found) |
41 fi |
41 fi |
42 |
42 |
43 WIRINGPI=No |
43 WIRINGPI=No |
44 AC_CHECK_LIB(wiringPi,wiringPiSetup,result=yes,result=no) |
44 AC_ARG_ENABLE(wiringpi, [ --enable-wiringpi Compile wiringPi code], [ wiringpi=$enableval ], [ wiringpi=yes ]) |
45 if test "$result" = "yes"; then |
45 if test "$wiringpi" = "yes"; then |
46 LIBS="$LIBS -lwiringPi -lwiringPiDev" |
46 AC_CHECK_LIB(wiringPi,wiringPiSetup,result=yes,result=no) |
47 AC_CHECK_HEADERS(wiringPi.h,WIRINGPI=Yes,WIRINGPI=No) |
47 if test "$result" = "yes"; then |
|
48 LIBS="$LIBS -lwiringPi -lwiringPiDev" |
|
49 AC_CHECK_HEADERS(wiringPi.h,WIRINGPI=Yes,WIRINGPI=No) |
|
50 fi |
|
51 else |
|
52 AC_MSG_RESULT(check wiringPi disabled) |
48 fi |
53 fi |
49 |
54 |
50 AC_CHECK_LIB(json-c,json_object_iter_init_default,result=yes,result=no) |
55 AC_CHECK_LIB(json-c,json_object_iter_init_default,result=yes,result=no) |
51 if test "$result" = "yes"; then |
56 if test "$result" = "yes"; then |
52 LIBS="$LIBS -ljson-c" |
57 LIBS="$LIBS -ljson-c" |
99 |
104 |
100 # Check for SDL |
105 # Check for SDL |
101 SDL_CFLAGS="" |
106 SDL_CFLAGS="" |
102 SDL_LIBS="" |
107 SDL_LIBS="" |
103 SDL="No" |
108 SDL="No" |
104 AC_MSG_CHECKING(SDL library) |
109 AC_MSG_CHECKING(SDL2 library) |
105 pkg-config --exists sdl |
110 pkg-config --exists sdl |
106 if test "$?" = "0"; then |
111 if test "$?" = "0"; then |
107 AC_MSG_RESULT(yes) |
112 AC_MSG_RESULT(yes) |
108 AC_MSG_CHECKING(sdl library v1.2.0 or newer) |
113 AC_MSG_CHECKING(sdl2 library v2.0.0 or newer) |
109 pkg-config --atleast-version=1.2.0 sdl |
114 pkg-config --atleast-version=2.0.0 sdl2 |
110 if test "$?" = "0"; then |
115 if test "$?" = "0"; then |
111 AC_MSG_RESULT(found) |
116 AC_MSG_RESULT(found) |
112 else |
117 else |
113 AC_MSG_ERROR(not found) |
118 AC_MSG_ERROR(not found) |
114 fi |
119 fi |
115 SDL_CFLAGS="$(pkg-config --cflags sdl)" |
120 SDL_CFLAGS="$(pkg-config --cflags sdl2)" |
116 SDL_LIBS="$(pkg-config --libs sdl)" |
121 SDL_LIBS="$(pkg-config --libs sdl2)" |
117 AC_CHECK_HEADERS(SDL/SDL.h) |
122 AC_CHECK_HEADERS(SDL2/SDL.h) |
118 SDL="Yes" |
123 SDL="Yes" |
119 else |
124 else |
120 AC_MSG_RESULT(no) |
125 AC_MSG_RESULT(no) |
121 fi |
126 fi |
122 |
127 |
123 # Check for SDL_ttf |
128 # Check for SDL_ttf |
124 AC_MSG_CHECKING(SDL_ttf library) |
129 AC_MSG_CHECKING(SDL2_ttf library) |
125 pkg-config --exists SDL_ttf |
130 pkg-config --exists SDL2_ttf |
126 if test "$?" = "0"; then |
131 if test "$?" = "0"; then |
127 AC_MSG_RESULT(yes) |
132 AC_MSG_RESULT(yes) |
128 AC_MSG_CHECKING(sdl library v2.0.0 or newer) |
133 AC_MSG_CHECKING(sdl2 library v2.0.0 or newer) |
129 pkg-config --atleast-version=2.0.0 SDL_ttf |
134 pkg-config --atleast-version=2.0.0 SDL2_ttf |
130 if test "$?" = "0"; then |
135 if test "$?" = "0"; then |
131 AC_MSG_RESULT(found) |
136 AC_MSG_RESULT(found) |
132 else |
137 else |
133 AC_MSG_ERROR(not found) |
138 AC_MSG_ERROR(not found) |
134 fi |
139 fi |
135 # Override flags |
140 # Override flags |
136 SDL_CFLAGS="$(pkg-config --cflags SDL_ttf)" |
141 SDL_CFLAGS="$(pkg-config --cflags SDL2_ttf)" |
137 SDL_LIBS="$(pkg-config --libs SDL_ttf)" |
142 SDL_LIBS="$(pkg-config --libs SDL2_ttf)" |
138 else |
143 else |
139 AC_MSG_RESULT(no) |
144 AC_MSG_RESULT(no) |
140 fi |
145 fi |
141 |
146 |
142 dnl Checks for header files. |
147 dnl Checks for header files. |
156 Configuration summary : |
161 Configuration summary : |
157 |
162 |
158 Version : ............ ${VERSION} |
163 Version : ............ ${VERSION} |
159 Main directory : ..... ${prefix} |
164 Main directory : ..... ${prefix} |
160 WiringPi : ........... ${WIRINGPI} |
165 WiringPi : ........... ${WIRINGPI} |
161 SDL library : ........ ${SDL} |
166 SDL2 library : ....... ${SDL} |
162 Simulator : .......... ${SIMULATOR} |
167 Simulator : .......... ${SIMULATOR} |
163 |
168 |
164 Now type 'make' and 'sudo make install' |
169 Now type 'make' and 'sudo make install' |
165 ]) |
170 ]) |
166 |
171 |