forked from ImageMagick/ImageMagick6
-
Notifications
You must be signed in to change notification settings - Fork 0
/
configure.ac
4135 lines (3680 loc) · 129 KB
/
configure.ac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# Copyright 1999-2019 ImageMagick Studio LLC, a non-profit organization
# dedicated to making software imaging solutions freely available.
#
# You may not use this file except in compliance with the License. You may
# obtain a copy of the License at
#
# https://imagemagick.org/script/license.php
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Copyright (C) 2003 - 2008 GraphicsMagick Group
#
# Copying and distribution of this file, with or without modification,
# are permitted in any medium without royalty provided the copyright
# notice and this notice are preserved.
# Process this file with autoconf to create configure script.
AC_PREREQ(2.69)
# ==============================================================================
# ImageMagick release.
# ==============================================================================
m4_define([magick_major_version], [6])
m4_define([magick_minor_version], [9])
m4_define([magick_micro_version], [10])
m4_define([magick_patchlevel_version], [54])
m4_define([magick_version],
[magick_major_version.magick_minor_version.magick_micro_version-magick_patchlevel_version])
m4_define([magick_git_revision], esyscmd([sh -c "(gitversion.sh .) | awk '{ print \$1 }' | tr -d '\n'"]))
m4_define([magick_tar_name],[ImageMagick])
# ==============================================================================
# Initalize Automake
# ==============================================================================
AC_INIT([ImageMagick],
[magick_version],
[https://github.com/ImageMagick/ImageMagick6/issues],
[magick_tar_name],
[https://imagemagick.org])
AC_CONFIG_SRCDIR([magick/MagickCore.h])
AC_CONFIG_AUX_DIR([config])
AC_REQUIRE_AUX_FILE([tap-driver.sh])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_HEADERS([config/config.h])
AX_PREFIX_CONFIG_H([magick/magick-baseconfig.h],[MagickCore])
AC_CANONICAL_SYSTEM
AC_CANONICAL_TARGET
AM_INIT_AUTOMAKE([foreign color-tests -Wall -Wno-portability subdir-objects dist-bzip2 dist-lzip dist-xz dist-zip tar-ustar])
AM_SILENT_RULES([yes])
#
# Save initial user-tunable values
#
USER_LIBS=$LIBS
for var in CC CFLAGS CPPFLAGS CXX CXXCPP LDFLAGS LIBS ; do
eval isset=\${$var+set}
if test "$isset" = 'set'; then
eval val=$`echo $var`
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS}'${var}=${val}' "
fi
done
AC_SUBST(DISTCHECK_CONFIG_FLAGS)
CONFIGURE_ARGS="$0 ${ac_configure_args}"
AC_SUBST(CONFIGURE_ARGS)
AC_ARG_ENABLE([reproducible-build],
[AC_HELP_STRING([--enable-reproducible-build],
[enable reproducible build])],
[enable_reproducible_build=$enableval],
[enable_reproducible_build='no'])
# Source file containing package/library versioning information.
. ${srcdir}/version.sh
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
MAGICK_TARGET_CPU=$host_cpu
AC_SUBST(MAGICK_TARGET_CPU)
AC_DEFINE_UNQUOTED(MAGICK_TARGET_CPU,$MAGICK_TARGET_CPU,[Target Host CPU])
MAGICK_TARGET_VENDOR=$host_vendor
AC_SUBST(MAGICK_TARGET_VENDOR)
AC_DEFINE_UNQUOTED(MAGICK_TARGET_VENDOR,$MAGICK_TARGET_VENDOR,[Target Host Vendor])
MAGICK_TARGET_OS=$host_os
AC_SUBST(MAGICK_TARGET_OS)
AC_DEFINE_UNQUOTED(MAGICK_TARGET_OS,$MAGICK_TARGET_OS,[Target Host OS])
# Substitute versioning
AC_SUBST([MAGICK_MAJOR_VERSION],[magick_major_version])
AC_SUBST([MAGICK_MINOR_VERSION],[magick_minor_version])
AC_SUBST([MAGICK_MICRO_VERSION],[magick_micro_version])
AC_SUBST([MAGICK_PATCHLEVEL_VERSION],[magick_patchlevel_version])
AC_SUBST([MAGICK_VERSION],[magick_version])
AC_SUBST([MAGICK_GIT_REVISION],[magick_git_revision])
# Substitute library versioning
AC_SUBST(MAGICK_LIBRARY_CURRENT)dnl
AC_SUBST(MAGICK_LIBRARY_REVISION)dnl
AC_SUBST(MAGICK_LIBRARY_AGE)dnl
AC_SUBST([MAGICK_LIBRARY_CURRENT_MIN],
[`expr $MAGICK_LIBRARY_CURRENT - $MAGICK_LIBRARY_AGE`])
AC_SUBST([MAGICK_LIBRARY_VERSION_INFO],
[$MAGICK_LIBRARY_CURRENT:$MAGICK_LIBRARY_REVISION:$MAGICK_LIBRARY_AGE])
AC_SUBST(MAGICKPP_LIBRARY_CURRENT)dnl
AC_SUBST(MAGICKPP_LIBRARY_REVISION)dnl
AC_SUBST(MAGICKPP_LIBRARY_AGE)dnl
AC_SUBST([MAGICKPP_LIBRARY_CURRENT_MIN],
[`expr $MAGICKPP_LIBRARY_CURRENT - $MAGICKPP_LIBRARY_AGE`])
AC_SUBST([MAGICKPP_LIBRARY_VERSION_INFO],
[$MAGICKPP_LIBRARY_CURRENT:$MAGICKPP_LIBRARY_REVISION:$MAGICKPP_LIBRARY_AGE])
AC_SUBST(PACKAGE_NAME)dnl
AC_SUBST(PACKAGE_VERSION)dnl
AC_SUBST(PACKAGE_PERL_VERSION)dnl
AC_SUBST(PACKAGE_RELEASE)dnl
AC_SUBST(PACKAGE_CHANGE_DATE)dnl
AC_SUBST(PACKAGE_LIB_VERSION)dnl
AC_SUBST(PACKAGE_LIB_VERSION_NUMBER)dnl
AS_IF([test X$enable_reproducible_build = Xyes],
[PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_REPRODUCIBLE],
[PACKAGE_RELEASE_DATE=$PACKAGE_RELEASE_DATE_RAW],
)
AC_SUBST(PACKAGE_RELEASE_DATE)dnl
AC_SUBST(PACKAGE_VERSION_ADDENDUM)dnl
# Ensure that make can run correctly
AM_SANITY_CHECK
# versioning of library
MAGICK_LIB_VERSION="0x"
if test ${MAGICK_LIBRARY_CURRENT} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_CURRENT}
if test ${MAGICK_LIBRARY_AGE} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_AGE}
if test ${MAGICK_LIBRARY_REVISION} -lt 10 ; then
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}0
fi
MAGICK_LIB_VERSION=${MAGICK_LIB_VERSION}${MAGICK_LIBRARY_REVISION}
AC_SUBST(MAGICK_LIB_VERSION)
# Definition used to define MagickLibVersionText in version.h
MAGICK_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
AC_SUBST(MAGICK_LIB_VERSION_TEXT)
# Definition used to define MagickLibVersionNumber in version.h
MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
MAGICKPP_LIB_VERSION="0x"
if test ${MAGICKPP_LIBRARY_CURRENT} -lt 10 ; then
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
fi
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_CURRENT}
if test ${MAGICKPP_LIBRARY_AGE} -lt 10 ; then
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
fi
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_AGE}
if test ${MAGICKPP_LIBRARY_REVISION} -lt 10 ; then
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}0
fi
MAGICKPP_LIB_VERSION=${MAGICKPP_LIB_VERSION}${MAGICKPP_LIBRARY_REVISION}
AC_SUBST(MAGICKPP_LIB_VERSION)
# Definition used to define MagickLibVersionText in version.h
MAGICKPP_LIB_VERSION_TEXT="${PACKAGE_VERSION}"
AC_SUBST(MAGICKPP_LIB_VERSION_TEXT)
# Definition used to define MagickLibVersionNumber in version.h
MAGICK_LIB_VERSION_NUMBER="${MAGICK_LIBRARY_CURRENT},${MAGICK_LIBRARY_AGE},${MAGICK_LIBRARY_REVISION}"
AC_SUBST(MAGICK_LIB_VERSION_NUMBER)
# Regenerate config.status if ChangeLog or version.sh is updated.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/version.sh'])
PERLMAINCC=$CC
MAGICK_CFLAGS=''
MAGICK_CPPFLAGS=$CPPFLAGS_USER
MAGICK_PCFLAGS=$CPPFLAGS_USER
MAGICK_LDFLAGS=''
MAGICK_LIBS=''
MAGICK_FEATURES=''
#
# Evaluate shell variable equivalents to Makefile directory variables
#
if test "x$prefix" = xNONE; then
prefix=$ac_default_prefix
fi
# Let make expand exec_prefix.
if test "x$exec_prefix" = xNONE; then
exec_prefix='${prefix}'
fi
#
eval "eval PREFIX_DIR=${prefix}"
AC_SUBST(PREFIX_DIR)
eval "eval EXEC_PREFIX_DIR=${exec_prefix}"
AC_SUBST(EXEC_PREFIX_DIR)
eval "eval BIN_DIR=$bindir"
AC_SUBST(BIN_DIR)
eval "eval SBIN_DIR=$sbindir"
AC_SUBST(SBIN_DIR)
eval "eval LIBEXEC_DIR=$libexecdir"
AC_SUBST(LIBEXEC_DIR)
eval "eval DATA_DIR=$datadir"
AC_SUBST(DATA_DIR)
eval "eval DOC_DIR=$datadir/doc"
AC_SUBST(DOC_DIR)
eval "eval SYSCONF_DIR=$sysconfdir"
AC_SUBST(SYSCONF_DIR)
eval "eval SHAREDSTATE_DIR=$sharedstatedir"
AC_SUBST(SHAREDSTATE_DIR)
eval "eval LOCALSTATE_DIR=$localstatedir"
AC_SUBST(LOCALSTATE_DIR)
eval "eval LIB_DIR=$libdir"
AC_SUBST(LIB_DIR)
eval "eval INCLUDE_DIR=$includedir"
AC_SUBST(INCLUDE_DIR)
eval "eval PERSISTINCLUDE_DIR=$oldincludedir"
AC_SUBST(PERSISTINCLUDE_DIR)
eval "eval INFO_DIR=$infodir"
AC_SUBST(INFO_DIR)
eval "eval MAN_DIR=$mandir"
AC_SUBST(MAN_DIR)
# Get full paths to source and build directories
srcdirfull="`cd $srcdir && pwd`"
builddir="`pwd`"
#
# Compute variables useful for running uninstalled software.
#
MAGICK_CODER_MODULE_PATH="${builddir}/coders"
MAGICK_CONFIGURE_SRC_PATH="${srcdirfull}/config"
MAGICK_CONFIGURE_BUILD_PATH="${builddir}/config"
MAGICK_FILTER_MODULE_PATH="${builddir}/filters"
DIRSEP=':'
case "${build_os}" in
mingw* )
MAGICK_CODER_MODULE_PATH=`$WinPathScript "${MAGICK_CODER_MODULE_PATH}" 0`
MAGICK_CONFIGURE_SRC_PATH=`$WinPathScript "${MAGICK_CONFIGURE_SRC_PATH}" 0`
MAGICK_CONFIGURE_BUILD_PATH=`$WinPathScript "${MAGICK_CONFIGURE_BUILD_PATH}" 0`
MAGICK_FILTER_MODULE_PATH=`$WinPathScript "${MAGICK_FILTER_MODULE_PATH}" 0`
DIRSEP=';'
;;
esac
case "${host_os}" in
mingw* )
DIRSEP=';'
;;
esac
AC_SUBST(MAGICK_CODER_MODULE_PATH)
AC_SUBST(MAGICK_CONFIGURE_SRC_PATH)
AC_SUBST(MAGICK_CONFIGURE_BUILD_PATH)
AC_SUBST(MAGICK_FILTER_MODULE_PATH)
AC_SUBST(DIRSEP)
#
# Enable OS features.
#
AC_USE_SYSTEM_EXTENSIONS
# ==============================================================================
# Find required base packages
# ==============================================================================
m4_ifdef([AM_PROG_AR], [AM_PROG_AR])
AC_PROG_CC
AC_PROG_CXX
AC_PROG_CC_STDC
AC_PROG_CPP
AC_PROG_LD
AC_SUBST(LD)
AC_PROG_CC_C99
AM_PROG_CC_C_O
AX_CFLAGS_WARN_ALL
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_SED
AC_PROG_AWK
AC_PROG_MKDIR_P
AM_WITH_DMALLOC
AX_C___ATTRIBUTE__
AX_GCC_ARCHFLAG([yes])
PKG_PROG_PKG_CONFIG([0.20])
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# Test for 64-bit build.
AC_CHECK_SIZEOF([size_t])
AX_COMPILER_VENDOR
if test "x$GCC" = "xyes"; then
CFLAGS="$CFLAGS -fexceptions"
touch local.exp
else
cat > local.exp <<EOF
set CC_FOR_TARGET "$CC"
EOF
fi
# Check for linker script support
gl_LD_VERSION_SCRIPT
#
# Enable run-time checking.
#
AC_ARG_ENABLE([bounds-checking],
[AC_HELP_STRING([--enable-bounds-checking],
[enable run-time bounds-checking])],
[enable_bounds_checking=$enableval],
[enable_bounds_checking='no'])
if test "$enable_bounds_checking" = yes; then
AC_DEFINE([_FORTIFY_SOURCE], [2],
[enable run-time bounds-checking])
fi
#
# Tests for Windows
#
AC_EXEEXT
AC_OBJEXT
GDI32_LIBS=''
WS2_32_LIBS=''
native_win32_build='no'
cygwin_build='no'
case "${host_os}" in
cygwin* )
cygwin_build='yes'
GDI32_LIBS='-lgdi32'
;;
mingw* )
native_win32_build='yes'
GDI32_LIBS='-lgdi32'
OLE_LIBS='-loleaut32'
WS2_32_LIBS="-lws2_32"
;;
esac
if test "${GDI32_LIBS}x" != 'x'; then
AC_DEFINE(WINGDI32_DELEGATE,1,Define to use the Windows GDI32 library)
fi
AC_SUBST(GDI32_LIBS)
AC_SUBST(OLE_LIBS)
AC_SUBST(WS2_32_LIBS)
AM_CONDITIONAL(WINGDI32_DELEGATE, test "${GDI32_LIBS}x" != 'x' )
AM_CONDITIONAL(WIN32_NATIVE_BUILD, test "${native_win32_build}" = 'yes' )
AM_CONDITIONAL(CYGWIN_BUILD, test "${cygwin_build}" = 'yes' )
AM_CONDITIONAL(USING_CL, test "x${CC}" = 'xcl.exe' )
WinPathScript="${srcdirfull}/winpath.sh"
AC_SUBST(WinPathScript)
#
# Compiler flags tweaks
#
if test "${GCC}" != "yes"; then
case "${host}" in
*-*-hpux* )
# aCC: HP ANSI C++ B3910B A.03.34
CFLAGS="${CFLAGS} -Wp,-H30000"
if test -n "${CXXFLAGS}"; then
CXXFLAGS='-AA'
else
CXXFLAGS="${CXXFLAGS} -AA"
fi
;;
*-dec-osf5.* )
# Compaq alphaev68-dec-osf5.1 compiler
if test -n "${CXXFLAGS}"; then
CXXFLAGS='-std strict_ansi -noimplicit_include'
else
CXXFLAGS="${CXXFLAGS} -std strict_ansi -noimplicit_include"
fi
esac
fi
# Check for lazy-loading.
AC_CACHE_CHECK([for linker lazyload option],[im_cv_ld_lazyload],
[
im_cv_ld_lazyload='none'
case "${host}" in
*-*-solaris2.8 | *-*-solaris2.9 | *-*-solaris2.1? )
if test "$lt_cv_prog_gnu_ld" != 'yes' ; then
im_cv_ld_lazyload='-Wl,-zlazyload'
fi
;;
esac
])
if test "${im_cv_ld_lazyload}" != 'none' ; then
if test -z "${LDFLAGS}" ; then
LDFLAGS="${im_cv_ld_lazyload}"
else
LDFLAGS="${im_cv_ld_lazyload} ${LDFLAGS}"
fi
fi
dnl Platform-specific stuff
case "$host" in
*darwin* | *-macos10*)
dnl Disable FORTIFY_SOURCE to fix a bug in LVVM / OpenMP support
CFLAGS="${CFLAGS} -D_FORTIFY_SOURCE=0"
dnl OS X universal binary support, requires --disable-dependency-tracking
AC_ARG_ENABLE([osx-universal-binary],
AC_HELP_STRING([--enable-osx-universal-binary],
[build universal binary on OS X [[default=no]]]),
[build_osxuniversal="${enableval}"], [build_osxuniversal=no])
if test "${build_osxuniversal}" != no ; then
if test "$enable_dependency_tracking" != no ; then
AC_MSG_ERROR([--enable-osx-universal-binary requires --disable-dependency-tracking.
Please re-run configure with these options:
--disable-dependency-tracking --enable-osx-universal-binary
])
fi
CFLAGS="$CFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
CXXFLAGS="$CXXFLAGS -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
LDFLAGS="$LDFLAGS -Wl,-syslibroot,/Developer/SDKs/MacOSX10.5.sdk -arch ppc -arch i386"
fi
;;
esac
#
# ARCH specific include directory
#
AC_ARG_WITH([includearch-dir],
[AC_HELP_STRING([--includearch-dir=DIR],
[ARCH specific include directory])],
[includearch_dir=$withval],
[includearch_dir=$INCLUDE_DIR])
eval "eval INCLUDEARCH_DIR=$includearch_dir"
AC_SUBST(INCLUDEARCH_DIR)
#
# ARCH specific configuration directory
#
AC_ARG_WITH([sharearch-dir],
[AC_HELP_STRING([--sharearch-dir=DIR],
[ARCH specific config directory])],
[sharearch_dir=$withval],
[sharearch_dir="${LIB_DIR}"])
eval "eval SHAREARCH_DIR=$sharearch_dir"
AC_SUBST(SHAREARCH_DIR)
# Path to the pkgconfig folder
AC_ARG_WITH([pkgconfigdir], AS_HELP_STRING([--with-pkgconfigdir=DIR],
[Path to the pkgconfig directory @<:@LIBDIR/pkgconfig@:>@]),
[pkgconfigdir="$withval"], [pkgconfigdir='${libdir}/pkgconfig'])
AC_SUBST([pkgconfigdir])
#
# Enable support for threads
#
# Find Posix threads library
#
AC_ARG_WITH([threads],
[AC_HELP_STRING([--without-threads], [disable threads support])],
[with_threads=$withval],
[with_threads='yes'])
THREAD_LIBS=''
have_threads=no
if test "$with_threads" != 'no'; then
AX_PTHREAD()
if test "$ax_pthread_ok" = yes; then
have_threads=yes
DEF_THREAD="$PTHREAD_CFLAGS"
CFLAGS="$CFLAGS $DEF_THREAD"
CXXFLAGS="$CXXFLAGS $DEF_THREAD"
THREAD_LIBS="$PTHREAD_LIBS"
if test "$CC" != "$PTHREAD_CC"; then
AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
CC="$PTHREAD_CC"
fi
AC_DEFINE(THREAD_SUPPORT,1,[Define if you have POSIX threads libraries and header files.])
fi
fi
LIBS="$LIBS $THREAD_LIBS"
AC_SUBST(THREAD_LIBS)
# Enable support for OpenMP
if test "$have_threads" != 'yes'; then
ac_cv_prog_c_openmp=unsupported
fi
AC_OPENMP([C])
CFLAGS="$OPENMP_CFLAGS $CFLAGS"
MAGICK_PCFLAGS="$MAGICK_PCFLAGS $OPENMP_CFLAGS"
AC_SUBST(OPENMP_CFLAGS)
if test "$enable_openmp" != no; then
if test "$ac_cv_prog_c_openmp" != 'unsupported'; then
MAGICK_FEATURES="OpenMP $MAGICK_FEATURES"
fi
fi
# Enable support for OpenCL
AX_OPENCL([C])
CFLAGS="$CL_CFLAGS $CFLAGS"
CPPFLAGS="$CL_CFLAGS $CPPFLAGS"
LIBS="$CL_LIBS $LIBS"
AC_SUBST(CL_CFLAGS)
if test "$enable_opencl" != no; then
if test "X$ax_cv_check_cl_libcl" != Xno; then :
MAGICK_FEATURES="OpenCL $MAGICK_FEATURES"
fi
fi
########
#
# Check for large file support
#
########
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
LFS_CPPFLAGS=''
if test "$enable_largefile" != no; then
case $ac_cv_sys_file_offset_bits in
no)
# nothing to do here as the host supports LFS fine
;;
unknown)
AC_MSG_CHECKING([for native large file support])
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <unistd.h>
main () {
exit(!(sizeof(off_t) == 8));
}])],
[ac_cv_sys_file_offset_bits=64; AC_DEFINE(_FILE_OFFSET_BITS,64)
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])
;;
*)
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
;;
esac
if test "$ac_cv_sys_large_files" != 'no'; then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGE_FILES=1"
fi
if test "$ac_cv_sys_largefile_source" != 'no'; then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_LARGEFILE_SOURCE=1"
fi
fi
AC_SUBST(LFS_CPPFLAGS)
# Configure libtool
AC_LIBTOOL_DLOPEN
LT_INIT([win32-dll])
LT_LANG([C++])
AC_SUBST(LIBTOOL_DEPS)
# Check to see if building shared libraries
libtool_build_shared_libs='no'
if test "$enable_shared" = 'yes'; then
libtool_build_shared_libs='yes'
fi
# Check to see if building static libraries
libtool_build_static_libs='no'
if test "$enable_static" = 'yes'; then
libtool_build_static_libs='yes'
fi
AM_CONDITIONAL(WITH_SHARED_LIBS, test "${libtool_build_shared_libs}" = 'yes')
#
# Enable support for building loadable modules
#
build_modules='no'
AC_ARG_WITH([modules],
[AC_HELP_STRING([--with-modules],
[enable building dynamically loadable modules])],
[with_modules=$withval],
[with_modules='no'])
# Only allow building loadable modules if we are building shared libraries
if test "$with_modules" != 'no' ; then
if test "$libtool_build_shared_libs" = 'no'; then
AC_MSG_WARN([Modules may only be built if building shared libraries is enabled.])
build_modules='no'
else
build_modules='yes'
fi
fi
if test "$build_modules" != 'no' ; then
AC_DEFINE(BUILD_MODULES,1,Define if coders and filters are to be built as modules.)
MAGICK_FEATURES="$MAGICK_FEATURES Modules"
fi
AM_CONDITIONAL(WITH_MODULES, test "$build_modules" != 'no')
# Enable build using delegate libraries built in subdirectories rather than installed
# delegate libraries (bzlib fftw fpx gslib jp2 jbig jpeg lcms lzma png tiff ttf wmf xml zlib)
AC_ARG_ENABLE([delegate-build],
[AC_HELP_STRING([--enable-delegate-build],
[look for delegate libraries in build directory])],
[enable_delegate_build=$enableval],
[enable_delegate_build='no'])
AC_ARG_ENABLE([deprecated],
[AC_HELP_STRING([--disable-deprecated],
[exclude deprecated methods in MagickCore and MagickWand APIs])],
[enable_deprecated=$enableval],
[enable_deprecated='no'])
if test "$enable_deprecated" = 'yes'; then
AC_DEFINE(EXCLUDE_DEPRECATED,1,[exclude deprecated methods in MagickCore API])
else
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-deprecated "
fi
# Build a version of ImageMagick which operates uninstalled.
# Used to build distributions located via MAGICK_HOME / executable path
AC_ARG_ENABLE([installed],
[AC_HELP_STRING([--disable-installed],
[Formally install ImageMagick under PREFIX])],
[enable_installed=$enableval],
[enable_installed='yes'])
if test "$enable_installed" = 'yes'; then
AC_DEFINE(INSTALLED_SUPPORT,1,[ImageMagick is formally installed under prefix])
else
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
fi
# Permit enciphering and deciphering image pixels.
AC_ARG_ENABLE([cipher],
[AC_HELP_STRING([--disable-cipher],
[disable enciphering and deciphering image pixels])],
[enable_cipher=$enableval],
[enable_cipher='yes'])
if test "$enable_cipher" = 'yes'; then
AC_DEFINE(CIPHER_SUPPORT,1,[permit enciphering and deciphering image pixels])
MAGICK_FEATURES="Cipher $MAGICK_FEATURES"
fi
# Build a zero-configuration version of ImageMagick.
AC_ARG_ENABLE([zero-configuration],
[AC_HELP_STRING([--enable-zero-configuration],
[enable self-contained, embeddable, zero-configuration ImageMagick])],
[enable_zero_configuration=$enableval],
[enable_zero_configuration='no'])
if test "$enable_zero_configuration" = 'yes'; then
AC_DEFINE(ZERO_CONFIGURATION_SUPPORT,1,[Build self-contained, embeddable, zero-configuration ImageMagick])
MAGICK_FEATURES="Zero-configuration $MAGICK_FEATURES"
fi
# Build a high dynamic range version of ImageMagick.
AC_ARG_ENABLE([hdri],
[AC_HELP_STRING([--enable-hdri],
[accurately represent the wide range of intensity levels found in real scenes])],
[enable_hdri=$enableval],
[enable_hdri='no'])
MAGICK_HDRI=""
if test "$enable_hdri" = 'yes'; then
MAGICK_HDRI="HDRI"
magick_hdri_enable='1';
MAGICK_FEATURES="HDRI $MAGICK_FEATURES"
else
magick_hdri_enable='0'
fi
AC_DEFINE_UNQUOTED(HDRI_ENABLE_OBSOLETE_IN_H,$magick_hdri_enable,[Whether hdri is enabled or not])
AC_SUBST(MAGICK_HDRI)dnl
MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
CFLAGS="$CFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
CPPFLAGS="$CPPFLAGS -DMAGICKCORE_HDRI_ENABLE=$magick_hdri_enable"
# Enable pipes (|) in filenames.
AC_ARG_ENABLE([pipes],
[AC_HELP_STRING([--enable-pipes],
[enable pipes (|) in filenames])],
[enable_pipes=$enableval],
[enable_pipes='no'])
if test "$enable_pipes" = 'yes'; then
AC_DEFINE(PIPES_SUPPORT,1,[enable pipes (|) in filenames])
MAGICK_FEATURES="Pipes $MAGICK_FEATURES"
fi
# Build a version of ImageMagick with assert statements.
AC_ARG_ENABLE([assert],
[AC_HELP_STRING([--disable-assert],
[disable assert() statements in build])],
[enable_assert=$enableval],
[enable_assert='yes'])
if test "$enable_assert" = 'no'; then
AC_DEFINE(NDEBUG,1,[Turn off assert statements])
fi
# Don't emit "rebuild rules" for configure, Makefile.ins, etc.
AM_MAINTAINER_MODE
# Enable hugepages support
AC_ARG_ENABLE([hugepages],
[AC_HELP_STRING([--enable-hugepages],
[enable 'huge pages' support])],
[enable_hugepages=$enableval],
[enable_hugepages='no'])
# Enable ccmalloc memory debugging support
AC_ARG_ENABLE([ccmalloc],
[AC_HELP_STRING([--enable-ccmalloc],
[enable 'ccmalloc' memory debug support])],
[enable_ccmalloc=$enableval],
[enable_ccmalloc='no'])
# Enable Electric Fence memory debugging support
AC_ARG_ENABLE([efence],
[AC_HELP_STRING([--enable-efence],
[enable 'efence' memory debug support])],
[enable_efence=$enableval],
[enable_efence='no'])
# Enable prof-based profiling support
AC_ARG_ENABLE([prof],
[AC_HELP_STRING([--enable-prof],
[enable 'prof' profiling support])],
[enable_prof=$enableval],
[enable_prof='no'])
# Enable gprof-based profiling support
AC_ARG_ENABLE([gprof],
[AC_HELP_STRING([--enable-gprof],
[enable 'gprof' profiling support])],
[enable_gprof=$enableval],
[enable_gprof='no'])
# Enable gcov-based profiling support
AC_ARG_ENABLE([gcov],
[AC_HELP_STRING([--enable-gcov],
[enable 'gcov' profiling support])],
[enable_gcov=$enableval],
[enable_gcov='no'])
enable_profiling='no'
if test "$enable_prof" = 'yes' || test "$enable_gprof" = 'yes' || test "$enable_gcov" = 'yes'; then
enable_profiling='yes'
if test "$libtool_build_shared_libs" = 'yes'; then
echo "Warning: Can not profile code using shared libraries"
fi
fi
# Magick API method prefix
AC_ARG_WITH([method-prefix],
[AC_HELP_STRING([--with-method-prefix=PREFIX],
[prefix MagickCore API methods])],
[with_method_prefix=$withval],
[with_method_prefix='no'])
if test "$with_method_prefix" != 'no'; then
AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX,$with_method_prefix,[Magick API method prefix])
AC_DEFINE_UNQUOTED(NAMESPACE_PREFIX_TAG,["$with_method_prefix"],[Magick API method prefix tag])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-method-prefix "
fi
# Enable legacy support (default no)
AC_ARG_ENABLE(legacy-support,
[ --enable-legacy-support install legacy command-line utilities (default disabled)],
[with_legacy_support=$enableval],
[with_legacy_support='no'])
AM_CONDITIONAL(LEGACY_SUPPORT, test "$with_legacy_support" != 'no')
# Number of bits in a Quantum
AC_ARG_WITH([quantum-depth],
[AC_HELP_STRING([--with-quantum-depth=DEPTH],
[number of bits in a pixel quantum (default 16)])],
[with_quantum_depth=$withval],
[with_quantum_depth=16])
if test "$with_quantum_depth" != '8'; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-quantum-depth=$with_quantum_depth "
fi
case "${with_quantum_depth}" in
8 ) ;;
16 ) ;;
32 ) ;;
64 ) ;;
* ) AC_MSG_ERROR("Pixel quantum depth must have value of 8, 16, 32, or 64") ;;
esac
QUANTUM_DEPTH="$with_quantum_depth"
AC_DEFINE_UNQUOTED(QUANTUM_DEPTH_OBSOLETE_IN_H,$QUANTUM_DEPTH,[Number of bits in a pixel Quantum (8/16/32/64)])
AC_SUBST(QUANTUM_DEPTH)dnl
MAGICK_PCFLAGS="$MAGICK_PCFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
CFLAGS="$CFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
CPPFLAGS="$CPPFLAGS -DMAGICKCORE_QUANTUM_DEPTH=$QUANTUM_DEPTH"
# define a lib suffix for abi purpose
MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}"
if test "$enable_hdri" = 'yes'; then
MAGICK_ABI_SUFFIX="Q${QUANTUM_DEPTH}${MAGICK_HDRI}"
fi
AC_SUBST(MAGICK_ABI_SUFFIX)
# Set pixel cache threshold
AC_ARG_WITH([cache],
[AC_HELP_STRING([--with-cache=THRESHOLD],
[set pixel cache threshhold in MB (default available memory)])],
[with_cache=$withval],
[with_cache=''])
if test "$with_cache" != ''; then
AC_DEFINE_UNQUOTED(PixelCacheThreshold,$with_cache,[Pixel cache threshold in MB (defaults to available memory)])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-cache=$with_cache "
fi
# Disable/Enable support for full delegate paths
AC_ARG_WITH([frozenpaths],
[AC_HELP_STRING([--with-frozenpaths],
[freeze delegate paths])],
[with_frozenpaths=$withval],
[with_frozenpaths='no'])
# Enable build/install of Magick++
AC_ARG_WITH([magick-plus-plus],
[AC_HELP_STRING([--without-magick-plus-plus],
[disable build/install of Magick++])],
[with_magick_plus_plus=$withval],
[with_magick_plus_plus='yes'])
# Encode the this name into the shared library.
AC_ARG_WITH([package-release-name],
[AC_HELP_STRING([--with-package-release-name=NAME],
[encode this name into the shared library])],
[MAGICK_LT_RELEASE_OPTS="-release $withval"])
AC_SUBST(MAGICK_LT_RELEASE_OPTS)
# Disable build/install of PerlMagick.
AC_ARG_WITH([perl],
[AC_HELP_STRING([--with-perl],
[enable build/install of PerlMagick])],
[with_perl=$withval],
[with_perl='no'])
# Options to pass when configuring PerlMagick
AC_ARG_WITH([perl-options],
[AC_HELP_STRING([--with-perl-options=OPTIONS],
[options to pass on command-line when generating PerlMagick build file])],
PERL_MAKE_OPTIONS=$withval)
AC_SUBST(PERL_MAKE_OPTIONS)
# Enable jemalloc, object-caching memory allocation library.
AC_ARG_WITH(jemalloc,
[ --with-jemalloc enable jemalloc memory allocation library support],
[with_jemalloc=$withval],
[with_jemalloc='no'])
if test "$with_jemalloc" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jemalloc=$with_jemalloc "
fi
# Enable umem, object-caching memory allocation library.
AC_ARG_WITH(umem,
[ --with-umem enable umem memory allocation library support],
[with_umem=$withval],
[with_umem='no'])
if test "$with_umem" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
fi
#
# Specify path to shared libstdc++ if not in normal location
#
AC_ARG_WITH([libstdc],
[AC_HELP_STRING([--with-libstdc=DIR],
[ use libstdc++ in DIR (for GNU C++)])],
[with_libstdc=$withval],
[with_libstdc=''])
if test "$with_libstdc" != ''; then
if test -d "$with_libstdc"; then
LIBSTDCLDFLAGS="-L$with_libstdc"
fi
fi
AC_SUBST(LIBSTDCLDFLAGS)
# Does gcc required -traditional?
AC_PROG_GCC_TRADITIONAL
########
#
# Set defines required to build DLLs and modules using MinGW
#
########
# These options are set for multi-thread DLL module build
# libMagickCore: _DLL _MAGICKMOD_ _MAGICKLIB_
# module: _DLL
# executable/Magick++: _DLL _MAGICKMOD_
MODULE_EXTRA_CPPFLAGS=''
LIBRARY_EXTRA_CPPFLAGS=''
if test "${native_win32_build}" = 'yes'; then
if test "${libtool_build_shared_libs}" = 'yes'; then
CPPFLAGS="$CPPFLAGS -D_DLL"
MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_DLL"
MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_DLL"
LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKLIB_"
if test "$build_modules" = 'yes'; then
LIBRARY_EXTRA_CPPFLAGS="$LIBRARY_EXTRA_CPPFLAGS -D_MAGICKMOD_"
else
MODULE_EXTRA_CPPFLAGS="$MODULE_EXTRA_CPPFLAGS -D_MAGICKLIB_"
fi
else
CPPFLAGS="$CPPFLAGS -D_LIB"
MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_LIB"
MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_LIB"
fi
if test "$with_threads" = 'yes'; then
CPPFLAGS="$CPPFLAGS -D_MT"
MAGICK_CPPFLAGS="$MAGICK_CPPFLAGS -D_MT"
MAGICK_PCFLAGS="$MAGICK_PCFLAGS -D_MT"
fi
fi
AC_SUBST(MODULE_EXTRA_CPPFLAGS)
AC_SUBST(LIBRARY_EXTRA_CPPFLAGS)
# Check standard headers
AC_HEADER_STDC
if ! test x"$ac_cv_header_stdc" = x"yes"; then
AC_MSG_WARN([configure has detected that you do not have the ANSI standard C
header files. Compilation cannot proceed. Please install the ANSI C
headers and rerun this script.]);
fi
AC_HEADER_ASSERT
AC_HEADER_DIRENT
# Check additional headers
AC_CHECK_HEADERS(arm/limits.h arpa/inet.h complex.h errno.h fcntl.h limits.h linux/unistd.h locale.h machine/param.h mach-o/dyld.h netinet/in.h OS.h process.h sun_prefetch.h stdarg.h sys/ipc.h sys/mman.h sys/resource.h sys/sendfile.h sys/socket.h sys/syslimits.h sys/time.h sys/timeb.h sys/times.h sys/wait.h utime.h wchar.h xlocale.h)
########
#
# Checks for typedefs, structures, and compiler characteristics.
#
########
AC_HEADER_STDBOOL
AC_C_VOLATILE
AC_C_STRINGIZE
AC_HEADER_STAT
AC_HEADER_TIME
AC_STRUCT_TM
AC_STRUCT_TIMEZONE
AC_SYS_INTERPRETER
#
# Checks for language qualifiers and semantics.
#
AC_C_CHAR_UNSIGNED
AC_C_CONST
AC_C_INLINE
AC_C_RESTRICT
AC_C_VOLATILE
# If words are stored with the most significant byte first (like
# Motorola and SPARC CPUs), define `WORDS_BIGENDIAN'.
AC_C_BIGENDIAN
# Define to a suitable type, if standard headers do not define it.
AC_TYPE_INT8_T
AC_TYPE_INT16_T
AC_TYPE_INT32_T
AC_TYPE_INT64_T
AC_TYPE_INTMAX_T
AC_TYPE_INTPTR_T
AC_TYPE_LONG_DOUBLE
AC_TYPE_LONG_DOUBLE_WIDER
AC_TYPE_LONG_LONG_INT
AC_TYPE_MBSTATE_T
AC_TYPE_MODE_T
AC_TYPE_OFF_T
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_TYPE_SSIZE_T
AC_TYPE_UID_T
AC_TYPE_UINT8_T
AC_TYPE_UINT16_T
AC_TYPE_UINT32_T
AC_TYPE_UINT64_T
AC_TYPE_UINTMAX_T
AC_TYPE_UINTPTR_T
AC_TYPE_UNSIGNED_LONG_LONG_INT