-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfigure.ac
More file actions
4397 lines (4031 loc) · 145 KB
/
Copy pathconfigure.ac
File metadata and controls
4397 lines (4031 loc) · 145 KB
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 (C) 2003-2025 GraphicsMagick Group
# Copyright (C) 2002 ImageMagick Studio
# Copyright (C) 1998, 1999 E. I. du Pont de Nemours and Company
#
# This program is covered by multiple licenses, which are described in
# Copyright.txt. You should have received a copy of Copyright.txt with this
# package; otherwise see http://www.graphicsmagick.org/www/Copyright.html.
#
# GraphicsMagick Configure Script
#
# Written by Bob Friesenhahn <bfriesen@GraphicsMagick.org>
#
AC_PREREQ([2.71])
AC_INIT
AC_CONFIG_SRCDIR([magick/magick.h])
# Specify directory where m4 macros may be found.
AC_CONFIG_MACRO_DIR([m4])
# Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([config])
# Include the TAP driver
AC_REQUIRE_AUX_FILE([tap-driver.sh])
#
# Save initial user-tunable values
#
#printf "LIBS=${LIBS}\n"
LIBS_USER=$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)
# Source file containing package/library versioning information.
. ${srcdir}/version.sh
echo "configuring ${PACKAGE_NAME} ${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"
dnl Compute the canonical host (run-time) system type variable
AC_CANONICAL_HOST
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])
# Compute newest and oldest interface numbers.
MAGICK_LIB_INTERFACE_NEWEST=$MAGICK_LIBRARY_CURRENT
MAGICK_LIB_INTERFACE_OLDEST=`expr ${MAGICK_LIBRARY_CURRENT} - ${MAGICK_LIBRARY_AGE}`
# Substitute Magick library versioning
AC_SUBST([MAGICK_LIBRARY_CURRENT])dnl
AC_SUBST([MAGICK_LIBRARY_REVISION])dnl
AC_SUBST([MAGICK_LIBRARY_AGE])dnl
AC_SUBST([MAGICK_LIB_INTERFACE_NEWEST])
AC_SUBST([MAGICK_LIB_INTERFACE_OLDEST])
# Substitute Magick++ library versioning
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_CURRENT])
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_REVISION])
AC_SUBST([MAGICK_PLUS_PLUS_LIBRARY_AGE])
# Substitute Magick Wand library versioning
AC_SUBST([MAGICK_WAND_LIBRARY_CURRENT])
AC_SUBST([MAGICK_WAND_LIBRARY_REVISION])
AC_SUBST([MAGICK_WAND_LIBRARY_AGE])
AC_SUBST([PACKAGE_NAME])dnl
AC_SUBST([PACKAGE_VERSION])dnl
AC_SUBST([PACKAGE_VERSION_ADDENDUM])dnl
AC_SUBST([PACKAGE_CHANGE_DATE])dnl
AC_SUBST([PACKAGE_RELEASE_DATE])dnl
# Substitute Mercurial branch tag
AC_SUBST([HG_BRANCH_TAG])dnl
# Definition used to define MagickLibVersion in version.h
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])
# Ensure that make can run correctly
AM_SANITY_CHECK
# Generate configure header.
AC_CONFIG_HEADERS([magick/magick_config.h magick/magick_config_api.h])
AM_INIT_AUTOMAKE([$PACKAGE_NAME],["${PACKAGE_VERSION}${PACKAGE_VERSION_ADDENDUM}"],[' '])
# Enable support for silent build rules
AM_SILENT_RULES
# Regenerate config.status if ChangeLog or version.sh is updated.
AC_SUBST([CONFIG_STATUS_DEPENDENCIES],['$(top_srcdir)/ChangeLog $(top_srcdir)/version.sh'])
PERLMAINCC=$CC
MAGICK_API_CFLAGS=''
MAGICK_API_CPPFLAGS=''
MAGICK_API_PC_CPPFLAGS=''
MAGICK_API_LDFLAGS=''
MAGICK_API_LIBS=''
#
# Standards compliance definitions
#
#AC_DEFINE(_XOPEN_SOURCE,500,[Required X Open interface level (500)])
#AC_DEFINE(_POSIX_C_SOURCE,199506L,[Required POSIX interface level (199506L)])
#AC_DEFINE(_ISOC99_SOURCE,1,[Code may make use of ISO C '99 features])
#AC_DEFINE(__EXTENSIONS__,1,[Enable all API extensions (for Solaris)])
#AC_DEFINE(_GNU_SOURCE,1,[Enable all API extensions (for GNU Linux libc)])
#AC_DEFINE(_NETBSD_SOURCE,1,[Enable all API extensions (for NetBSD)])
AC_USE_SYSTEM_EXTENSIONS
#
# 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=$docdir"
AC_SUBST([DOC_DIR])
eval "eval HTML_DIR=$htmldir"
AC_SUBST([HTML_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 OLDINCLUDE_DIR=$oldincludedir"
AC_SUBST([OLDINCLUDE_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`"
WinPathScript="${srcdirfull}/winpath.sh"
AC_SUBST([WinPathScript])
#
# 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"
top_srcdir_native=${srcdirfull}
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`
top_srcdir_native=`$WinPathScript "${srcdirfull}"`
;;
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])
AC_SUBST([top_srcdir_native])
# Check for programs
AC_PROG_CC
AC_MSG_CHECKING([ANSI C compiler language standard version])
AC_MSG_RESULT([$ac_prog_cc_stdc])
#if test "$ac_prog_cc_stdc" = 'c89' ; then
# AC_MSG_ERROR([ANSI c99 (or later) is required!])
#fi
AC_PROG_CPP
LT_PATH_LD
AC_SUBST([LD])
AM_PROG_CC_C_O # Necessary if objects are placed in subdirectories.
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_LN_S
AC_PROG_AWK
#
# Tests for Windows
#
AC_EXEEXT
AC_OBJEXT
native_win32_build='no'
cygwin_build='no'
case "${host_os}" in
cygwin* )
cygwin_build='yes'
;;
mingw* )
native_win32_build='yes'
;;
esac
AM_CONDITIONAL([WIN32_NATIVE_BUILD],[test "${native_win32_build}" = 'yes'])
AM_CONDITIONAL([CYGWIN_BUILD],[test "${cygwin_build}" = 'yes'])
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
;;
*-*-solaris2.* )
# Solaris 2 or a derivative thereof
;;
esac
else
CFLAGS="${CFLAGS} -Wall"
fi
#
# Determine POSIX threads settings
#
# Enable support for POSIX thread APIs
AC_ARG_WITH([threads],
AS_HELP_STRING([--without-threads],
[disable POSIX threads API support]),
[with_threads=$withval],
[with_threads='yes'])
have_threads=no
if test "$with_threads" != 'no'
then
ACX_PTHREAD()
if test "$acx_pthread_ok" = yes ; then
have_threads=yes
DEF_THREAD="$PTHREAD_CFLAGS"
CFLAGS="$CFLAGS $DEF_THREAD"
CXXFLAGS="$CXXFLAGS $DEF_THREAD"
if test "$CC" != "$PTHREAD_CC" ; then
AC_MSG_WARN([Replacing compiler $CC with compiler $PTHREAD_CC to support pthreads.])
CC="$PTHREAD_CC"
fi
if test "$CXX" != "$PTHREAD_CXX" ; then
AC_MSG_WARN([Replacing compiler $CXX with compiler $PTHREAD_CXX to support pthreads.])
CXX="$PTHREAD_CXX"
fi
fi
fi
# Search for the pkg-config tool and set the PKG_CONFIG variable to first found in the path.
PKG_PROG_PKG_CONFIG()
#
# Determine options necessary to enable OpenMP support
#
# Sets Set the OPENMP_CFLAGS / OPENMP_CXXFLAGS / OPENMP_FFLAGS
# variable to these options.
#
# https://clang.llvm.org/docs/UsersManual.html#openmp-features
# https://clang.llvm.org/docs/OpenMPSupport.html
#
# Clang needs -fopenmp=libomp "Intel OpenMP" or CFLAGS=-fopenmp "GNU OpenMP".
# FIXME: AC_OPENMP() does not set OPENMP_CFLAGS for Clang 13 on Linux!
AC_OPENMP([C])
CFLAGS="$OPENMP_CFLAGS $CFLAGS"
#CXXFLAGS="$OPENMP_CXXFLAGS $CXXFLAGS"
#LDFLAGS="$LDFLAGS $OPENMP_CFLAGS"
AC_SUBST([OPENMP_CFLAGS])
AC_CHECK_DECL([_OPENMP],[OPENMP_ENABLED='yes'],[OPENMP_ENABLED='no'],[])
# Allow the user to disable use of OpenMP where algorithms sometimes run slower.
AC_ARG_ENABLE([openmp-slow],
AS_HELP_STRING([--enable-openmp-slow],
[enable OpenMP for algorithms which
sometimes run slower]),
[with_openmp_slow=$enableval],
[with_openmp_slow='no'])
if test "$with_openmp_slow" = 'no' ; then
AC_DEFINE([DisableSlowOpenMP],[1],[Disable OpenMP for algorithms which sometimes run slower])
fi
# Disable reading/writing gzip/bzip compressed files
AC_ARG_ENABLE([compressed-files],
AS_HELP_STRING([--disable-compressed-files],
[disable reading and writing of gzip/bzip files]),
[with_compressed_files=$enableval],
[with_compressed_files='yes'])
if test "$with_compressed_files" != 'yes'; then
AC_DEFINE([DISABLE_COMPRESSED_FILES],[1],[Disable reading and writing of gzip/bzip files])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-compressed-files=$with_compressed_files "
fi
########
#
# Check for large file support
#
# According to the X/Open LFS standard, setting _FILE_OFFSET_BITS to 64
# remaps standard functions to their 64-bit equivalents.
#
# The LFS_CPPFLAGS substition is used to support building PerlMagick.
#
#
########
AC_SYS_LARGEFILE
# If the `fseeko' function is available, define `HAVE_FSEEKO'. Define
# `_LARGEFILE_SOURCE' if necessary.
AC_FUNC_FSEEKO
LFS_CPPFLAGS=''
if test "$enable_largefile" != no ; then
if test "$ac_cv_sys_file_offset_bits" != 'no' && test -n "$ac_cv_sys_file_offset_bits"
then
LFS_CPPFLAGS="$LFS_CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits"
fi
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])
#
# Decide if setjmp/longjmp is thread safe based on host OS
#
case "${host_os}" in
solaris2* )
# Documented not to be MT safe
;;
*)
AC_DEFINE([SETJMP_IS_THREAD_SAFE],[1],[Setjmp/longjmp are thread safe])
;;
esac
#
# Configure libtool
#
# Configure libtool
LT_INIT([disable-shared win32-dll dlopen])
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],
AS_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([BuildMagickModules],[1],[Define if coders and filters are to be built as modules.])
fi
AM_CONDITIONAL([WITH_MODULES],[test "$build_modules" != 'no'])
# Build a version of GraphicsMagick which operates uninstalled.
# Used to build distributions located via MAGICK_HOME / executable path
AC_ARG_ENABLE([installed],
AS_HELP_STRING([--disable-installed],
[disable building an installed GraphicsMagick]),
[with_installed=$enableval],
[with_installed='yes'])
if test "$with_installed" = 'yes' ; then
AC_DEFINE([UseInstalledMagick],[1],[GraphicsMagick is formally installed under prefix])
else
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --disable-installed "
fi
# Enable broken/dangerous coders
# EnableBrokenCoders CPP define and ENABLE_BROKEN_CODERS Automake conditional)
AC_ARG_ENABLE([broken-coders],
AS_HELP_STRING([--enable-broken-coders],
[enable broken/dangerous file formats support]),
[with_broken_coders=$enableval],
[with_broken_coders='no'])
if test "$with_broken_coders" = 'yes' ; then
AC_DEFINE([EnableBrokenCoders],[1],[Enable broken/dangerous file formats support])
fi
AM_CONDITIONAL([ENABLE_BROKEN_CODERS],[test "$with_broken_coders" != 'no'])
# Add configure option --enable-maintainer-mode which enables dependency
# checking and generation useful to package maintainers. This is made an
# option to avoid confusing end users.
#
# Defines shell/Automake variable 'MAINT' to '' when enabled or '#' when not
# Also sets MAINTAINER_MODE_FALSE / MAINTAINER_MODE_TRUE with similar values.
AM_MAINTAINER_MODE
# Enable prof-based profiling support
AC_ARG_ENABLE([prof],
AS_HELP_STRING([--enable-prof],
[enable 'prof' profiling support]),
[with_prof=$enableval],
[with_prof='no'])
# Enable gprof-based profiling support
AC_ARG_ENABLE([gprof],
AS_HELP_STRING([--enable-gprof],
[enable 'gprof' profiling support]),
[with_gprof=$enableval],
[with_gprof='no'])
# Enable gcov-based profiling support
AC_ARG_ENABLE([gcov],
AS_HELP_STRING([--enable-gcov],
[enable 'gcov' profiling support]),
[with_gcov=$enableval],
[with_gcov='no'])
with_profiling='no'
if test "$with_prof" = 'yes' || test "$with_gprof" = 'yes' || test "$with_gcov" = 'yes' ; then
with_profiling='yes'
if test "$libtool_build_shared_libs" = 'yes' ; then
echo "Warning: Can not profile code using shared libraries"
fi
fi
# Enable prefixing library symbols with a common string
AC_ARG_ENABLE([symbol-prefix],
AS_HELP_STRING([--enable-symbol-prefix],
[enable prefixing library symbols with "Gm"]),
[with_symbol_prefix=$enableval],
[with_symbol_prefix='no'])
if test "$with_symbol_prefix" != 'no' ; then
AC_DEFINE([PREFIX_MAGICK_SYMBOLS],[1],[Prefix Magick library symbols with a common string.])
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --enable-symbol-prefix "
fi
# Enable ImageMagick utilities compatibility shortcuts (default no)
AC_ARG_ENABLE([magick-compat],
AS_HELP_STRING([--enable-magick-compat],
[install ImageMagick utility shortcuts]),
[with_magick_compat=$enableval],
[with_magick_compat='no'])
AM_CONDITIONAL([MAGICK_COMPAT],[test "$with_magick_compat" != 'no'])
# Number of bits in a Quantum
AC_ARG_WITH([quantum-depth],
AS_HELP_STRING([--with-quantum-depth],
[number of bits in a pixel quantum (default 8)]),
[with_quantum_depth=$withval],
[with_quantum_depth=8])
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 ) ;;
* ) AC_MSG_ERROR([Pixel quantum depth must have value of 8, 16, or 32]) ;;
esac
QuantumDepth="$with_quantum_depth"
AC_DEFINE_UNQUOTED([QuantumDepth],[$QuantumDepth],[Number of bits in a pixel Quantum (8/16/32)])
AC_SUBST([QuantumDepth])dnl
# Enable QuantumDepth in shared library names
AC_ARG_ENABLE([quantum-library-names],
AS_HELP_STRING([--enable-quantum-library-names],
[shared library name includes quantum
depth to allow shared libraries with
different quantum depths to co-exist in
same directory (only one can be used for
development)]),
[with_quantum_library_names=$enableval],
[with_quantum_library_names='no'])
MAGICK_LT_RELEASE_OPTS=
if test "$with_quantum_library_names" != 'no' ; then
MAGICK_LT_RELEASE_OPTS="-release Q${QuantumDepth}"
fi
AC_SUBST([MAGICK_LT_RELEASE_OPTS])
# Disable/Enable support for full delegate paths in delegates.mgk
AC_ARG_WITH([frozenpaths],
AS_HELP_STRING([--with-frozenpaths],
[enable frozen delegate paths]),
[with_frozenpaths=$withval],
[with_frozenpaths='no'])
# Enable build/install of Magick++
AC_ARG_WITH([magick-plus-plus],
AS_HELP_STRING([--without-magick-plus-plus],
[disable build/install of Magick++]),
[with_magick_plus_plus=$withval],
[with_magick_plus_plus='yes'])
# Enable build/install of PerlMagick.
AC_ARG_WITH([perl],
AS_HELP_STRING([--with-perl@<:@=PERL@:>@],
[enable build/install of PerlMagick and optionally specify perl to use]),
[with_perl=$withval],
[with_perl='no'])
# Options to pass when configuring PerlMagick
AC_ARG_WITH([perl-options],
AS_HELP_STRING([--with-perl-options=OPTIONS],
[options to pass on command-line when
generating PerlMagick's Makefile from Makefile.PL]),
[PERL_MAKE_OPTIONS=$withval])
AC_SUBST([PERL_MAKE_OPTIONS])
# Disable BZLIB (bzip2 library)
AC_ARG_WITH([bzlib],
AS_HELP_STRING([--without-bzlib],
[disable BZLIB support]),
[with_bzlib=$withval],
[with_bzlib='yes'])
if test "$with_bzlib" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-bzlib=$with_bzlib "
fi
# Enable FlashPIX.
AC_ARG_WITH([fpx],
AS_HELP_STRING([--with-fpx],
[enable FlashPIX support]),
[with_fpx=$withval],
[with_fpx='no'])
if test "$with_fpx" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fpx=$with_fpx "
fi
# Enable Windows gdi32/user32 libraries
AC_ARG_WITH([gdi32],
AS_HELP_STRING([--without-gdi32],
[disable Windows gdi32/user32 (clipboard) support]),
[with_gdi32=$withval],
[with_gdi32='yes'])
if test "$with_gdi32" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gdi32=$with_gdi32 "
fi
# Disable Ghostscript support.
AC_ARG_WITH([gs],
AS_HELP_STRING([--without-gs],
[disable Ghostscript support]),
[with_gs=$withval],
[with_gs='yes'])
if test "$with_gs" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs=$with_gs "
fi
if test "$with_gs" = 'yes' ; then
AC_DEFINE([HasGS],[1],[Enable use of Ghostscript])
fi
AM_CONDITIONAL([HasGS],[test "$with_gs" = 'yes'])
# Disable JBIG.
AC_ARG_WITH([jbig],
AS_HELP_STRING([--without-jbig],
[disable JBIG support]),
[with_jbig=$withval],
[with_jbig='yes'])
if test "$with_jbig" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jbig=$with_jbig "
fi
# Disable WEBP.
AC_ARG_WITH([webp],
AS_HELP_STRING([--without-webp],
[disable WEBP support]),
[with_webp=$withval],
[with_webp='yes'])
if test "$with_webp" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-webp=$with_webp "
fi
# Disable HEIF.
AC_ARG_WITH([heif],
AS_HELP_STRING([--without-heif],
[disable HEIF support]),
[with_heif=$withval],
[with_heif='yes'])
if test "$with_heif" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-heif=$with_heif "
fi
# Disable JPEG.
AC_ARG_WITH([jpeg],
AS_HELP_STRING([--without-jpeg],
[disable JPEG support]),
[with_jpeg=$withval],
[with_jpeg='yes'])
if test "$with_jpeg" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jpeg=$with_jpeg "
fi
# Disable JPEG Version 2.
AC_ARG_WITH([jp2],
AS_HELP_STRING([--without-jp2],
[disable JPEG v2 support]),
[with_jp2=$withval],
[with_jp2='yes'])
if test "$with_jp2" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jp2=$with_jp2 "
fi
# Disable JXL
AC_ARG_WITH([jxl],
AS_HELP_STRING([--without-jxl],
[disable JPEG-XL support]),
[with_jxl=$withval],
[with_jxl='yes'])
if test "$with_jxl" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-jxl=$with_jxl "
fi
# Disable LCMS2.
AC_ARG_WITH([lcms2],
AS_HELP_STRING([--without-lcms2],
[disable lcms (v2.X) support]),
[with_lcms2=$withval],
[with_lcms2='yes'])
if test "$with_lcms2" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lcms2=$with_lcms2 "
fi
# Disable LZMA (lzma library)
AC_ARG_WITH([lzma],
AS_HELP_STRING([--without-lzma],
[disable LZMA support]),
[with_lzma=$withval],
[with_lzma='yes'])
if test "$with_lzma" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-lzma=$with_lzma "
fi
# # Disable MPEG.
# AC_ARG_WITH([mpeg2],
# AS_HELP_STRING([--without-mpeg2],
# [disable MPEG support]),
# [with_mpeg2=$withval],
# [with_mpeg2='yes'])
# Disable PNG.
AC_ARG_WITH([png],
AS_HELP_STRING([--without-png],
[disable PNG support]),
[with_png=$withval],
[with_png='yes'])
if test "$with_png" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-png=$with_png "
fi
# Disable TIFF.
AC_ARG_WITH([tiff],
AS_HELP_STRING([--without-tiff],
[disable TIFF support]),
[with_tiff=$withval],
[with_tiff='yes'])
if test "$with_tiff" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tiff=$with_tiff "
fi
# Enable TRIO.
AC_ARG_WITH([trio],
AS_HELP_STRING([--with-trio],
[enable TRIO support]),
[with_trio=$withval],
[with_trio='no'])
if test "$with_trio" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-trio=$with_trio "
fi
# Disable TTF.
AC_ARG_WITH([ttf],
AS_HELP_STRING([--without-ttf],
[disable TrueType support]),
[with_ttf=$withval],
[with_ttf='yes'])
if test "$with_ttf" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-ttf=$with_ttf "
fi
# Disable LIBZIP.
AC_ARG_WITH([libzip],
AS_HELP_STRING([--without-libzip],
[disable libzip support]),
[with_libzip=$withval],
[with_libzip='yes'])
if test "$with_libzip" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-libzip=$with_libzip "
fi
# Enable use of Google tcmalloc library.
AC_ARG_WITH([tcmalloc],
AS_HELP_STRING([--with-tcmalloc],
[enable Google perftools tcmalloc (minimal) memory allocation library support]),
[with_tcmalloc=$withval],
[with_tcmalloc='no'])
if test "$with_tcmalloc" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-tcmalloc=$with_tcmalloc "
fi
# Enable use of Solaris mtmalloc library.
AC_ARG_WITH([mtmalloc],
AS_HELP_STRING([--with-mtmalloc],
[enable Solaris mtmalloc memory allocation library support]),
[with_mtmalloc=$withval],
[with_mtmalloc='no'])
if test "$with_mtmalloc" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-mtmalloc=$with_mtmalloc "
fi
# Enable use of Solaris libumem (object-caching memory allocation library).
# Available as a SourceForge project http://sourceforge.net/projects/umem/ or
# https://labs.omniti.com/trac/portableumem/.
AC_ARG_WITH([umem],
AS_HELP_STRING([--with-umem],
[enable Solaris umem memory allocation library support]),
[with_umem=$withval],
[with_umem='no'])
if test "$with_umem" != 'no' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-umem=$with_umem "
fi
# Disable WMF.
AC_ARG_WITH([wmf],
AS_HELP_STRING([--without-wmf],
[disable WMF support]),
[with_wmf=$withval],
[with_wmf='yes'])
if test "$with_wmf" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-wmf=$with_wmf "
fi
# Set default font search path
AC_ARG_WITH([fontpath],
AS_HELP_STRING([--with-fontpath=DIR],
[prepend to default font search path]),
[with_fontpath=$withval],
[with_fontpath=''])
if test "$with_fontpath" != "yes" && test -z "$with_fontpath"
then
with_fontpath=''
else
AC_DEFINE_UNQUOTED([MAGICK_FONT_PATH],["$with_fontpath"],[Define to prepend to default font search path.])
fi
if test "$with_fontpath=" != '' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-fontpath=$with_fontpath "
fi
# Set Ghostscript font directory
AC_ARG_WITH([gs-font-dir],
AS_HELP_STRING([--with-gs-font-dir=DIR],
[directory containing Ghostscript fonts]),
[with_gs_font_dir=$withval],
[with_gs_font_dir='default'])
if test "$with_gs_font_dir" != 'default' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-gs-font-dir=$with_gs_font_dir "
fi
# Set Artifex URW Base35 OTF font directory
AC_ARG_WITH([urwbase35otf-font-dir],
AS_HELP_STRING([--with-urwbase35otf-font-dir=DIR],
[directory containing Artifex URW Base35 OTF fonts]),
[with_urwbase35otf_font_dir=$withval],
[with_urwbase35otf_font_dir='default'])
if test "$with_urwbase35otf_font_dir" != 'default' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-urwbase35otf-font-dir=$with_urwbase35otf_font_dir "
fi
# Set Windows font directory
AC_ARG_WITH([windows-font-dir],
AS_HELP_STRING([--with-windows-font-dir=DIR],
[directory containing MS-Windows fonts]),
[with_windows_font_dir=$withval],
[with_windows_font_dir=''])
if test "$with_windows_font_dir" != '' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-windows-font-dir=$with_windows_font_dir "
fi
# Disable XML.
AC_ARG_WITH([xml],
AS_HELP_STRING([--without-xml],
[disable XML support]),
[with_xml=$withval],
[with_xml='yes'])
if test "$with_xml" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-xml=$with_xml "
fi
AC_ARG_WITH([zlib],
AS_HELP_STRING([--without-zlib],
[disable ZLIB support]),
[with_zlib=$withval],
[with_zlib='yes'])
if test "$with_zlib" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zlib=$with_zlib "
fi
# Disable Zstd (zstd library)
AC_ARG_WITH([zstd],
AS_HELP_STRING([--without-zstd],
[disable Zstd support]),
[with_zstd=$withval],
[with_zstd='yes'])
if test "$with_zstd" != 'yes' ; then
DISTCHECK_CONFIG_FLAGS="${DISTCHECK_CONFIG_FLAGS} --with-zstd=$with_zstd "
fi
#
# Specify path to shared libstdc++ if not in normal location
#
AC_ARG_WITH([libstdc],
AS_HELP_STRING([--with-libstdc=DIR],
[use libstdc++ in DIR (for GNU C++)]),
[if test "$withval" != no && test "$withval" != yes; then
if test -d "$withval"; then
LIBSTDCLDFLAGS="-L$withval"
fi
fi])
AC_SUBST([LIBSTDCLDFLAGS])
########
#
# Set defines required to build DLLs and modules using MinGW
#
########
# These options are set for multi-thread DLL module build
# libMagick: _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_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_DLL"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -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_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_LIB"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_LIB"
fi
if test "$with_threads" = 'yes' ; then
CPPFLAGS="$CPPFLAGS -D_MT"
MAGICK_API_CPPFLAGS="$MAGICK_API_CPPFLAGS -D_MT"
MAGICK_API_PC_CPPFLAGS="$MAGICK_API_PC_CPPFLAGS -D_MT"
fi
fi
AC_SUBST([MODULE_EXTRA_CPPFLAGS])
AC_SUBST([LIBRARY_EXTRA_CPPFLAGS])
# Check standard headers
AC_HEADER_DIRENT
# Check for the existence of inttypes.h
AC_CHECK_HEADER([inttypes.h], [AC_DEFINE([HAVE_INTTYPES_H], [1], [Define to 1 if you have the <inttypes.h> header file.])], [AC_MSG_ERROR([inttypes.h not found, cannot build])])
# Check for the existence of stdint.h
AC_CHECK_HEADER([stdint.h], [AC_DEFINE([HAVE_STDINT_H], [1], [Define to 1 if you have the <stdint.h> header file.])], [AC_MSG_ERROR([stdint.h not found, cannot build])])
# Check additional headers
AC_CHECK_HEADERS([machine/param.h mach-o/dyld.h process.h sun_prefetch.h sys/mman.h sys/resource.h sys/times.h sys/types.h])
AC_CHECK_HEADERS([wincrypt.h],[],[],[#include <windows.h>])
case "${host_os}" in
linux* )
AC_CHECK_FUNCS([mallopt])
# Linux mallopt() needs <malloc.h>
AC_CHECK_HEADERS([malloc.h])
;;
esac
########
#
# Checks for typedefs, structures, and compiler characteristics.