fix: wide-codes in AddGlyph(...)
[swftools.git] / configure.in
1 dnl Process this file with autoconf to produce a configure script.
2 AC_INIT(src/)
3
4 PACKAGE=swftools
5 VERSION=0.3.1
6 CFLAGS="-Winline -Wparentheses -Wimplicit -Wreturn-type -O2 -fomit-frame-pointer"
7 CXXFLAGS="-Winline -Wparentheses -Wimplicit -Wreturn-type -O2 -fomit-frame-pointer"
8 export PACKAGE VERSION CFLAGS CXXFLAGS
9
10 dnl Checks for programs.
11  AC_PROG_CC
12  AC_PROG_CPP
13  AC_PROG_CXX
14  AC_PROG_RANLIB
15  AC_PROG_MAKE_SET
16  AC_PROG_INSTALL
17  AC_PROG_LN_S
18  AC_CHECK_PROGS(UNCOMPRESS, gzip uncompress compress, )
19
20 dnl Checks for system services
21  AC_EXEEXT
22
23 dnl Checks for libraries.
24  AC_CHECK_LIB(m, sin,, 
25  echo "Error: Math library not found.";
26  exit;
27  )
28  AC_CHECK_LIB(z, deflate,, 
29  echo "Error: The zlib compression library is required."
30  DISABLEPDF2SWF=true; 
31  MISSINGLIBS="${MISSINGLIBS} zlib"
32  exit;
33  )
34  AC_CHECK_LIB(jpeg, jpeg_write_raw_data,, 
35  DISABLEPDF2SWF=true;
36  DISABLEJPEG2SWF=true;
37  MISSINGLIBS="${MISSINGLIBS} jpeglib"
38  )
39  AC_CHECK_LIB(t1, T1_LoadFont,,
40  DISABLEPDF2SWF=true;
41  MISSINGLIBS="${MISSINGLIBS} T1lib"
42  )
43
44 SWF_CHECK_BYTEORDER
45 AC_SUBST(WORDS_BIGENDIAN)
46 SWF_CHECK_SYSTEM_BACKTICKS
47 AC_SUBST(SYSTEM_BACKTICKS)
48
49 AC_ARG_PROGRAM
50
51 dnl do we need those?
52 dnl AC_CHECK_LIB(pthread, pthread_create)
53 dnl AC_CHECK_LIB(X11, XFlush)
54
55 dnl Checks for header files.
56  AC_CONFIG_HEADER(config.h)
57 dnl AC_PATH_X
58 dnl AC_PATH_XTRA
59  AC_HEADER_DIRENT
60  AC_HEADER_STDC
61  AC_CHECK_HEADERS(zlib.h jpeglib.h t1lib.h sys/stat.h sys/types.h dirent.h sys/ndir.h sys/dir.h ndir.h)
62
63 if test "x${ac_cv_header_jpeglib_h}" != "xyes"; then
64  DISABLEPDF2SWF=true;
65  DISABLEJPEG2SWF=true;
66  MISSINGLIBS="${MISSINGLIBS} jpeglib.h"
67 fi
68 if test "x${ac_cv_header_t1lib_h}" != "xyes"; then
69  DISABLEPDF2SWF=true;
70  MISSINGLIBS="${MISSINGLIBS} t1lib.h"
71 fi
72 if test "x${ac_cv_header_zlib_h}" != "xyes"; then
73  DISABLEPDF2SWF=true;
74  MISSINGLIBS="${MISSINGLIBS} zlib.h"
75 fi
76
77 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE")
78 AC_DEFINE_UNQUOTED(VERSION, "$VERSION")
79 AC_SUBST(PACKAGE)
80 AC_SUBST(VERSION)
81
82 AC_SUBST(HAVE_UNISTD_H)
83 AC_SUBST(EXEEXT)
84
85 dnl Checks for typedefs, structures, and compiler characteristics.
86  AC_C_CONST
87  AC_C_INLINE
88  AC_TYPE_OFF_T
89  AC_TYPE_SIZE_T
90  AC_STRUCT_TM
91  AC_CHECK_TYPE(boolean,int)
92  AC_CHECK_TYPE(bool,char)
93  dnl AC_CHECK_TYPE(uchar,unsigned char)
94  dnl AC_CHECK_TYPE(schar,signed char)
95  dnl AC_CHECK_TYPE(word,unsigned short int)
96  dnl AC_CHECK_TYPE(sword,unsigned short int)
97  dnl AC_CHECK_TYPE(uint,unsigned long int)
98
99 dnl Checks for library functions.
100  AC_CHECK_FUNCS(popen mkstemp stat lrand48 rand srand48 srand)
101  SWF_CHECK_AVI2SWF
102
103 avi2swf="avi2swf/Makefile"
104 if test "x${AVIFILE}" != "xtrue"; then
105  echo "* Couldn't compile the avifile test program."
106  echo "* Disabling avi2swf tool..."
107  echo all: > avi2swf/Makefile
108  echo install: >> avi2swf/Makefile
109  echo clean: >> avi2swf/Makefile
110  avi2swf=
111 fi
112
113 if test "x${UNCOMPRESS}" = "xgzip"; then
114     AC_DEFINE_UNQUOTED(USE_GZIP, 1)
115 fi
116 AC_SUBST(USE_GZIP)
117
118 JPEG2SWF='jpeg2swf$(EXEEXT)'
119 export JPEG2SWF
120 if test "x${DISABLEPDF2SWF}" = "xtrue"; then
121   echo "***************************************************"
122   echo "The following headers/libraries are missing: " ${MISSINGLIBS}
123   echo "Disabling pdf2swf tool..."
124   rm -f pdf2swf/Makefile
125   echo all: > pdf2swf/Makefile
126   echo install: >> pdf2swf/Makefile
127   echo clean: >> pdf2swf/Makefile
128   if test "x${DISABLEJPEG2SWF}" = "xtrue"; then
129     echo "Disabling jpeg2swf tool..."
130     JPEG2SWF=
131     export JPEG2SWF
132   fi
133   echo "***************************************************"
134   FILES="./release ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile swfs/Makefile"
135 else
136   FILES="./release ${avi2swf} Makefile lib/lame/Makefile lib/Makefile src/Makefile pdf2swf/Makefile pdf2swf/xpdf/Makefile pdf2swf/ttf2pt1/Makefile pdf2swf/fonts/Makefile swfs/Makefile"
137 fi
138 AC_SUBST(JPEG2SWF)
139
140 AC_OUTPUT(${FILES})