summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--configure.ac40
-rw-r--r--gs/configure.ac33
2 files changed, 53 insertions, 20 deletions
diff --git a/configure.ac b/configure.ac
index d20e9bcf9..8c28b6643 100644
--- a/configure.ac
+++ b/configure.ac
@@ -203,24 +203,40 @@ dnl --------------------------------------------------
203dnl check for big/little endian for LCMS 203dnl check for big/little endian for LCMS
204dnl -------------------------------------------------- 204dnl --------------------------------------------------
205 205
206BIGENDIAN=
207
206AC_MSG_CHECKING([for big endian]) 208AC_MSG_CHECKING([for big endian])
207 209
208AC_RUN_IFELSE( 210AC_ARG_ENABLE([big-endian], AC_HELP_STRING([--enable-big-endian],
209 [AC_LANG_PROGRAM([#include <stdio.h>], [ 211 [Force big endian]), [BIGENDIAN=1])
210 static const int one = 1;
211 return (*(char*)&one == 0 ? 0 : 1);
212 ])],
213 [LCMS_BIGENDIAN=1],
214 [LCMS_BIGENDIAN=0])
215 212
216if test "x$LCMS_BIGENDIAN" != "x0"; then 213if test x$BIGENDIAN = x; then
217 LCMS_ENDIAN="-DUSE_BIG_ENDIAN=$LCMS_BIGENDIAN" 214 AC_ARG_ENABLE([little-endian], AC_HELP_STRING([--enable-little-endian],
218 LCMS2_ENDIAN="-DCMS_USE_BIG_ENDIAN=$LCMS_BIGENDIAN" 215 [Force little endian]), [BIGENDIAN=0])
219 AC_MSG_RESULT(yes) 216fi
217
218if test x$BIGENDIAN = x ; then
219 AC_RUN_IFELSE(
220 [AC_LANG_PROGRAM([#include <stdio.h>], [
221 static const int one = 1;
222 return (*(char*)&one == 0 ? 0 : 1);
223 ])],
224 [BIGENDIAN=1;AC_MSG_RESULT(big)],
225 [BIGENDIAN=0;AC_MSG_RESULT(little)])
226else
227 if test x$BIGENDIAN = x1 ; then
228 AC_MSG_RESULT(big)
229 else
230 AC_MSG_RESULT(little)
231 fi
232fi
233
234if test x$BIGENDIAN = x1 ; then
235 LCMS_ENDIAN="-DUSE_BIG_ENDIAN=$BIGENDIAN"
236 LCMS2_ENDIAN="-DCMS_USE_BIG_ENDIAN=$BIGENDIAN"
220else 237else
221 LCMS_ENDIAN= 238 LCMS_ENDIAN=
222 LCMS2_ENDIAN= 239 LCMS2_ENDIAN=
223 AC_MSG_RESULT(no)
224fi 240fi
225 241
226AC_SUBST(LCMS_ENDIAN) 242AC_SUBST(LCMS_ENDIAN)
diff --git a/gs/configure.ac b/gs/configure.ac
index 1bea46db9..a4d30437f 100644
--- a/gs/configure.ac
+++ b/gs/configure.ac
@@ -258,16 +258,33 @@ dnl ----------------------------
258dnl check for big/little endian 258dnl check for big/little endian
259dnl ---------------------------- 259dnl ----------------------------
260 260
261BIGENDIAN=
262
261AC_MSG_CHECKING([for big endian]) 263AC_MSG_CHECKING([for big endian])
262 264
263AC_RUN_IFELSE( 265AC_ARG_ENABLE([big-endian], AC_HELP_STRING([--enable-big-endian],
264 [AC_LANG_PROGRAM([#include <stdio.h>], [ 266 [Force big endian]), [BIGENDIAN=1])
265 static const int one = 1;
266 return (*(char*)&one == 0 ? 0 : 1);
267 ])],
268 [BIGENDIAN=1;AC_MSG_RESULT(big)],
269 [BIGENDIAN=0;AC_MSG_RESULT(little)])
270 267
268if test x$BIGENDIAN = x; then
269 AC_ARG_ENABLE([little-endian], AC_HELP_STRING([--enable-little-endian],
270 [Force little endian]), [BIGENDIAN=0])
271fi
272
273if test x$BIGENDIAN = x ; then
274 AC_RUN_IFELSE(
275 [AC_LANG_PROGRAM([#include <stdio.h>], [
276 static const int one = 1;
277 return (*(char*)&one == 0 ? 0 : 1);
278 ])],
279 [BIGENDIAN=1;AC_MSG_RESULT(big)],
280 [BIGENDIAN=0;AC_MSG_RESULT(little)])
281else
282 if test x$BIGENDIAN = x1 ; then
283 AC_MSG_RESULT(big)
284 else
285 AC_MSG_RESULT(little)
286 fi
287fi
271 288
272 289
273dnl -------------------------------------------------- 290dnl --------------------------------------------------
@@ -275,7 +292,7 @@ dnl Enable thread safe build
275dnl -------------------------------------------------- 292dnl --------------------------------------------------
276AC_ARG_ENABLE([threadsafe], AC_HELP_STRING([--enable-threadsafe], 293AC_ARG_ENABLE([threadsafe], AC_HELP_STRING([--enable-threadsafe],
277 [enable a thread safe build - NOTE: this will exclude non-threadsafe devices])) 294 [enable a thread safe build - NOTE: this will exclude non-threadsafe devices]))
278if test x$enable_threadsafe = xyes; then 295if test x$enable_threadsafe = xyes ; then
279 CFLAGS="-DGS_THREADSAFE" 296 CFLAGS="-DGS_THREADSAFE"
280fi 297fi
281 298