2
dnl Autoconf script for DevIL Library
3
dnl Written by Edouard Gomez <ed.gomez@wanadoo.fr>
8
dnl configure.in initialization
11
AC_CONFIG_SRCDIR([README])
14
dnl Minimum Autoconf version
25
DEVIL_VERSION=$DEVIL_MAJOR$DEVIL_MINOR$DEVIL_REVISION
28
dnl Note that the libtool version has nothing to do
29
dnl with the actual DevIL version, it is a version number
30
dnl describing the interface version (see libtool doc)
31
dnl wich only changes when the interface changes
34
AC_SUBST(DEVIL_LTVERSION)
40
AC_REVISION($Revision: 1.40 $)
41
AC_CONFIG_AUX_DIR(libtools)
42
AC_PREFIX_DEFAULT(/usr/local)
53
AM_INIT_AUTOMAKE("DevIL", $DEVIL_MAJOR.$DEVIL_MINOR.$DEVIL_REVISION)
54
AM_CONFIG_HEADER(include/IL/config.h)
63
AC_MSG_CHECKING(Altivec)
65
CFLAGS="-force_cpusubtype_ALL"
69
}], [AC_DEFINE([ALTIVEC])] [CFLAGS="$CFLAGS_TMP -force_cpusubtype_ALL";] [AC_MSG_RESULT(yes)], [CFLAGS="$CFLAGS_TMP";] [AC_MSG_RESULT(no)] );
72
AC_MSG_CHECKING(Altivec gcc extension)
77
vector unsigned int vec;
78
vec = vec_splat_u32(0);
80
}], [AC_DEFINE([ALTIVEC_GCC])] [CFLAGS="$CFLAGS_TMP -faltivec";] [AC_MSG_RESULT(yes)], [CFLAGS=$CFLAGS_TMP;] [AC_MSG_RESULT(no)] );
84
CFLAGS="-Wall -funroll-loops -ffast-math -fomit-frame-pointer -fexpensive-optimizations $CFLAGS"
85
LIBIL_CFLAGS="$CFLAGS"
86
LIBILU_CFLAGS="$CFLAGS"
87
LIBILUT_CFLAGS="$CFLAGS"
90
dnl Default supported formats : all except lcms
124
[ --disable-bmp Doesn't compile bmp support],
125
[case "$enable_bmp" in
136
[ --disable-dcx Doesn't compile dcx support],
137
[case "$enable_dcx" in
148
[ --disable-doom Doesn't compile wad support],
149
[case "$enable_doom" in
160
[ --disable-gif Doesn't compile gif support],
161
[case "$enable_gif" in
172
[ --disable-hdr Doesn't compile hdr support],
173
[case "$enable_hdr" in
184
[ --disable-icon Doesn't compile icon support],
185
[case "$enable_icon" in
196
[ --disable-jpeg Doesn't compile jpeg support],
197
[case "$enable_jpeg" in
208
[ --disable-lif Doesn't compile lif support],
209
[case "$enable_lif" in
220
[ --disable-lcms Doesn't compile lcms support],
221
[case "$enable_lcms" in
232
[ --disable-mdl Doesn't compile mdl support],
233
[case "$enable_mdl" in
244
[ --disable-mng Doesn't compile mng support],
245
[case "$enable_mng" in
256
[ --disable-pcd Doesn't compile pcd support],
257
[case "$enable_pcd" in
268
[ --disable-pcx Doesn't compile pcx support],
269
[case "$enable_pcx" in
280
[ --disable-pic Doesn't compile pic support],
281
[case "$enable_pic" in
292
[ --disable-pix Doesn't compile pix support],
293
[case "$enable_pix" in
304
[ --disable-png Doesn't compile png support],
305
[case "$enable_png" in
316
[ --disable-pnm Doesn't compile pnm support],
317
[case "$enable_pnm" in
328
[ --disable-psd Doesn't compile psd support],
329
[case "$enable_psd" in
340
[ --disable-psp Doesn't compile psp support],
341
[case "$enable_psp" in
352
[ --disable-pxr Doesn't compile pxr support],
353
[case "$enable_pxr" in
364
[ --disable-lcms Doesn't compile lcms support],
365
[case "$enable_lcms" in
376
[ --disable-raw Doesn't compile raw support],
377
[case "$enable_raw" in
388
[ --disable-sgi Doesn't compile sgi support],
389
[case "$enable_sgi" in
400
[ --disable-tga Doesn't compile tga support],
401
[case "$enable_tga" in
411
[ --disable-tiff Doesn't compile tiff support],
412
[case "$enable_tiff" in
423
[ --disable-wal Doesn't compile wal support],
424
[case "$enable_wal" in
435
[ --disable-xpm Doesn't compile xpm support],
436
[case "$enable_xpm" in
446
AC_ARG_ENABLE(allegro,
447
[ --disable-allegro Doesn't compile allegro support],
448
use_allegro=$enable_allegro, use_allegro="yes")
450
AC_ARG_ENABLE(directx,
451
[ --disable-directx Doesn't compile directx support],
452
use_directx=$enable_directx, use_directx="yes")
454
AC_ARG_ENABLE(opengl,
455
[ --disable-opengl Doesn't compile opengl support],
456
use_opengl=$enable_opengl, use_opengl="yes")
459
[ --disable-sdl Doesn't compile sdl support],
460
use_sdl=$enable_sdl, use_sdl="yes")
463
[ --disable-win32 Doesn't compile win32 support],
464
use_win32=$enable_win32, use_win32="yes")
466
AC_ARG_ENABLE(release,
467
[ --disable-release Compile a debug version of the library],
468
[case "$enable_release" in
478
if test "$debug_symbols" = "yes" ; then
480
LIBIL_CFLAGS="-Wall -g"
481
LIBILU_CFLAGS="-Wall -g"
482
LIBILUT_CFLAGS="-Wall -g"
487
LIBIL_CFLAGS=$LIBIL_CFLAGS" -mno-cygwin"
488
LIBILU_CFLAGS=$LIBILU_CFLAGS" -mno-cygwin"
489
LIBILUT_CFLAGS=$LIBILUT_CFLAGS" -mno-cygwin"
493
LIBILUT_WIN32LIBPATH="-L/usr/lib/w32api"
499
VERSIONINFO="-version-info $DEVIL_LTVERSION"
502
AC_SUBST(VERSIONINFO)
505
dnl Libraries development checking
509
AC_CHECK_HEADER(jpeglib.h, ,no_jpeg="yes")
510
AC_CHECK_HEADER(tiffio.h, ,no_tiff="yes")
511
AC_CHECK_HEADER(png.h, ,no_png="yes")
512
AC_CHECK_HEADER(lcms/lcms.h, ,no_lcms="yes")
513
AC_CHECK_HEADER(libmng.h, ,no_mng="yes")
514
AC_CHECK_HEADER(GL/gl.h, , use_opengl="no")
515
AC_CHECK_HEADER(d3d8.h, , use_directx="no")
516
AC_CHECK_HEADER(SDL.h, , use_sdl="no")
517
AC_CHECK_HEADER(zlib.h, LIBZ="-lz", LIBZ="")
521
dnl Now we can check for bin libraries
523
if test "$no_jpeg" = "no" ; then
524
AC_CHECK_LIB(jpeg, jpeg_start_decompress, LIBJPG="-ljpeg", LIBJPG="", )
525
if test "$LIBJPG" != "-ljpeg" ; then
528
AC_CHECK_LIB(jpeg, jpeg_init_exif_field, use_exif="yes", use_exif="no", )
529
if test "$use_exif" = "no" ; then
530
AC_DEFINE(IL_USE_JPEGLIB_UNMODIFIED)
532
AC_DEFINE(IL_USE_JPEGLIB_UNMODIFIED)
541
AC_DEFINE(IL_USE_JPEGLIB_UNMODIFIED)
545
if test "$no_tiff" = "no" ; then
546
AC_CHECK_LIB(tiff, TIFFReadRGBAImage, LIBTIFF="-ltiff", LIBTIFF="", -lm)
547
if test "$LIBTIFF" != "-ltiff" ; then
555
if test "$no_png" = "no" ; then
556
AC_CHECK_LIB(png, png_start_read_image, LIBPNG="-lpng", LIBPNG="", `libpng-config --libs`)
557
if test "$LIBPNG" != "-lpng" ; then
565
if test "$no_lcms" = "no" ; then
566
AC_CHECK_LIB(lcms, cmsOpenProfileFromFile, LIBLCMS="-llcms", LIBLCMS="", -lm)
567
if test "$LIBLCMS" != "-llcms" ; then
575
if test "$no_mng" = "no" ; then
576
AC_CHECK_LIB(mng, mng_setcb_openstream, LIBMNG="-lmng", LIBMNG="", )
577
if test "$LIBMNG" != "-lmng" ; then
586
dnl ILUT APIs checking
597
if test "$use_opengl" = "yes" ; then
598
AC_CHECK_HEADER(GL/gl.h, [have_gl_hdr=yes])
600
*-*-cygwin* | *-*-mingw32*)
601
LIBGL="-lopengl32 -lglu32"
604
LIBGL="-framework OpenGL"
605
LDFLAGS_ILUT="-framework OpenGL"
606
AC_SUBST(LDFLAGS_ILUT)
609
AC_CHECK_LIB(GL,glLoadIdentity,[LIBGL="-lGL"])
610
AC_CHECK_LIB(GLU,gluPerspective,[LIBGL="-lGLU"])
613
if test "x$have_gl_hdr" != "xyes" ; then
623
if test "$use_allegro" = "yes" ; then
624
AC_CHECK_PROG(allegro_config, allegro-config, yes, no, )
625
if test $allegro_config = no ; then
630
LIBALLEGRO=`allegro-config --libs`
631
HALLEGRO=`allegro-config --cflags`
637
if test "$use_win32" = "no" ; then
645
dnl Prepares substitutions in config.h
650
if test "$no_bmp" = "yes" ; then
653
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"BMP "
655
AM_CONDITIONAL(IL_NO_BMP, test x$no_bmp != "xyes")
657
if test "$no_dcx" = "yes" ; then
660
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"DCX "
662
AM_CONDITIONAL(IL_NO_DCX, test x$no_dcx != "xyes")
664
if test "$no_dds" = "yes" ; then
667
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"DDS "
669
AM_CONDITIONAL(IL_NO_DDS, test x$no_dds != "xyes")
671
if test "$no_doom" = "yes" ; then
672
AC_DEFINE(IL_NO_DOOM)
674
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"WAD "
676
AM_CONDITIONAL(IL_NO_DOOM, test x$no_doom != "xyes")
678
if test "$no_gif" = "yes" ; then
681
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"GIF "
683
AM_CONDITIONAL(IL_NO_GIF, test x$no_gif != "xyes")
685
if test "$no_hdr" = "yes" ; then
688
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"HDR "
690
AM_CONDITIONAL(IL_NO_HDR, test x$no_hdr != "xyes")
692
if test "$no_icon" = "yes" ; then
695
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"ICO "
697
AM_CONDITIONAL(IL_NO_ICO, test x$no_icon != "xyes")
699
if test "$no_jpeg" = "yes" ; then
702
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"JPG "
704
AM_CONDITIONAL(IL_NO_JPG, test x$no_jpeg != "xyes")
706
if test "$no_lif" = "yes" ; then
709
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"LIF "
711
AM_CONDITIONAL(IL_NO_LIF, test x$no_lif != "xyes")
713
if test "$no_lcms" = "yes" ; then
714
AC_DEFINE(IL_NO_LCMS)
716
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"LCMS "
718
AM_CONDITIONAL(IL_NO_LCMS, test x$no_lcms != "xyes")
720
if test "$no_mdl" = "yes" ; then
723
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"MDL "
725
AM_CONDITIONAL(IL_NO_MDL, test x$no_mdl != "xyes")
727
if test "$no_mng" = "yes" ; then
730
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"MNG "
732
AM_CONDITIONAL(IL_NO_MNG, test x$no_mng != "xyes")
734
if test "$no_pcd" = "yes" ; then
737
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PCD "
739
AM_CONDITIONAL(IL_NO_PCD, test x$no_pcd != "xyes")
741
if test "$no_pcx" = "yes" ; then
744
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PCX "
746
AM_CONDITIONAL(IL_NO_PCX, test x$no_pcx != "xyes")
748
if test "$no_pic" = "yes" ; then
751
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PIC "
753
AM_CONDITIONAL(IL_NO_PIC, test x$no_pic != "xyes")
755
if test "$no_pix" = "yes" ; then
758
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PIX "
760
AM_CONDITIONAL(IL_NO_PIX, test x$no_pix != "xyes")
762
if test "$no_png" = "yes" ; then
765
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PNG "
767
AM_CONDITIONAL(IL_NO_PNG, test x$no_png != "xyes")
769
if test "$no_pnm" = "yes" ; then
772
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PNM "
774
AM_CONDITIONAL(IL_NO_PNM, test x$no_pnm != "xyes")
776
if test "$no_psd" = "yes" ; then
779
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PSD "
781
AM_CONDITIONAL(IL_NO_PSD, test x$no_psd != "xyes")
783
if test "$no_psp" = "yes" ; then
786
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PSP "
788
AM_CONDITIONAL(IL_NO_PSP, test x$no_psp != "xyes")
790
if test "$no_pxr" = "yes" ; then
793
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"PXR "
795
AM_CONDITIONAL(IL_NO_PXR, test x$no_pxr != "xyes")
797
if test "$no_raw" = "yes" ; then
800
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"RAW "
802
AM_CONDITIONAL(IL_NO_RAW, test x$no_raw != "xyes")
804
if test "$no_sgi" = "yes" ; then
807
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"SGI "
809
AM_CONDITIONAL(IL_NO_SGI, test x$no_sgi != "xyes")
811
if test "$no_tga" = "yes" ; then
814
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"TGA "
816
AM_CONDITIONAL(IL_NO_TGA, test x$no_tga != "xyes")
818
if test "$no_tiff" = "yes" ; then
821
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"TIF "
823
AM_CONDITIONAL(IL_NO_TIF, test x$no_tiff != "xyes")
825
if test "$no_wal" = "yes" ; then
828
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"WAL "
830
AM_CONDITIONAL(IL_NO_WAL, test x$no_wal != "xyes")
832
if test "$no_xpm" = "yes" ; then
835
SUPPORTED_FORMATS=$SUPPORTED_FORMATS"XPM "
837
AM_CONDITIONAL(IL_NO_XPM, test x$no_xpm != "xyes")
841
AC_MSG_RESULT([+----------------------------------------+])
842
AC_MSG_RESULT([| IL library Supported formats |])
843
AC_MSG_RESULT([+----------------------------------------+-------+])
844
AC_MSG_RESULT([$SUPPORTED_FORMATS])
849
if test "$use_allegro" = "yes" ; then
850
AC_DEFINE(ILUT_USE_ALLEGRO)
851
SUPPORTED_API=$SUPPORTED_API"Allegro "
854
if test "$use_directx" = "yes" ; then
855
AC_DEFINE(ILUT_USE_DIRECTX8)
856
SUPPORTED_APPI=$SUPPORTED_API"Directx8 "
859
if test "$use_opengl" = "yes" ; then
860
AC_DEFINE(ILUT_USE_OPENGL)
861
SUPPORTED_API=$SUPPORTED_API"OpenGL "
864
LIBILUT_CFLAGS=$LIBILUT_CFLAGS" -framework OpenGL"
868
if test "$use_sdl" = "yes" ; then
869
AC_DEFINE(ILUT_USE_SDL)
870
SUPPORTED_API=$SUPPORTED_API"SDL "
873
if test "$use_win32" = "yes" ; then
874
AC_DEFINE(ILUT_USE_WIN32)
875
SUPPORTED_API=$SUPPORTED_API"Win32 "
878
if test "$use_directx" = "yes" ; then
879
AC_DEFINE(ILUT_USE_DIRECTX8)
880
SUPPORTED_API=$SUPPORTED_API"DirectX8 "
884
AC_MSG_RESULT([+----------------------------------------+])
885
AC_MSG_RESULT([| ILUT library Supported APIs |])
886
AC_MSG_RESULT([+----------------------------------------+-------+])
887
AC_MSG_RESULT([$SUPPORTED_API])
894
AC_SUBST(LIBIL_CFLAGS)
895
AC_SUBST(LIBILU_CFLAGS)
896
AC_SUBST(LIBILUT_CFLAGS)
897
AC_SUBST(LIBILUT_WIN32LIBPATH)
900
dnl Ouput files to generate
902
AC_CONFIG_FILES([Makefile \
904
src-IL/src/Makefile \
905
src-IL/include/Makefile \
907
src-ILU/src/Makefile \
908
src-ILU/include/Makefile \
910
src-ILUT/src/Makefile \
911
src-ILUT/include/Makefile \
913
include/IL/Makefile ])