Initial revision
[platform/upstream/libvorbis.git] / configure.in
1 # $Id: configure.in,v 1.1 1999/07/13 06:50:34 mwhitson Exp $
2 # $Date: 1999/07/13 06:50:34 $
3
4 AC_INIT(mdct.c)
5 #AC_CONFIG_HEADER(config.h)
6
7 cp configure.guess config.guess
8 cp configure.sub config.sub
9
10 AC_CANONICAL_HOST
11
12 dnl If we're on IRIX, we wanna use cc even if gcc is there (unless the user
13 dnl has overriden us)...
14 case $host 
15         in *-*-irix*)
16                 if test -z "$CC"; then
17                         CC=cc
18                 fi
19                 AC_CHECK_LIB(audio, ALwritesamps)
20         ;;
21 esac
22
23 if test -z "$CC"; then
24         AC_PROG_CC      
25 fi
26 AC_PROG_RANLIB
27 AC_CHECK_PROG(AR,ar,ar)
28
29 dnl Set some target options
30 if test -z "$GCC"; then
31         case $host in 
32         *-*-irix*)
33                 DEBUG="-g" 
34                 OPT="-O2 -w"
35                 PROFILE="-p -g3 -O2" ;;
36         sparc-sun-solaris*)
37                 DEBUG="-v -g"
38                 OPT="-xO4 -fast -w -fsingle -fsimple -native -xcg92"
39                 PROFILE="-v -xpg -g -xO4 -fast -fsingle -native -fsimple -xcg92 -Dsuncc" ;;
40         *)
41                 DEBUG="-g"
42                 OPT="-O"
43                 PROFILE="-g -p" ;;
44         esac
45 else
46         case $host in 
47         i?86-*-linux*)
48                 DEBUG="-g -Wall -fsigned-char"
49                 OPT="-O20 -ffast-math -fsigned-char"
50                 PROFILE="-pg -g -O20 -fsigned-char";;
51         sparc-sun-*)
52                 DEBUG="-g -Wall -fsigned-char -mv8"
53                 OPT="-O20 -ffast-math -fsigned-char -mv8"
54                 PROFILE="-pg -g -O20 -fsigned-char -mv8" ;;
55         *)
56                 DEBUG="-g -Wall -fsigned-char"
57                 OPT="-O20 -fsigned-char"
58                 PROFILE="-O20 -g -pg -fsigned-char" ;;
59         esac
60 fi
61
62 AC_HEADER_STDC
63
64 CFLAGS=""
65
66 AC_PATH_X
67 AC_PATH_XTRA
68
69 AC_CHECK_LIB(pthread, pthread_create, 
70         pthread_lib="-lpthread"; AC_DEFINE(HAVE_LIBPTHREAD), :)
71
72 dnl Linuxthreads require you to define _REENTRANT in all threaded
73 dnl code.  Bogus, bogus...
74
75 if test -n "$pthread_lib"; then
76         case $host in 
77         i?86-*-linux*)
78                 AC_DEFINE(_REENTRANT)
79                 ;;
80         esac
81 fi
82
83 #if test -n "$x_libraries"; then
84 #       XOGG="yes"
85 #
86 #       dnl If we find libgtk installed, great; otherwise assume we have
87 #       dnl to build it ourselves.
88 #
89 #       AC_CHECK_LIB(gtk, gtk_main, :, LIBGTKDIR="libgtk", $X_LIBS -lglib -lgdk -lX11 -lXext -lm)
90 #
91 #       dnl libpthread is required for xogg.
92 #
93 #       if test -z "$pthread_lib"; then XOGG=""; fi
94 #
95 #       dnl If we don't have libgtk installed, and we don't have a libgtk 
96 #       dnl  subdirectory to build the library ourself, we can't build xogg.
97 #
98 #       if test -n "$LIBGTKDIR" -a ! -d "$LIBGTKDIR"; then
99 #               XOGG=""
100 #               LIBGTKDIR=""
101 #       fi
102 #fi
103
104 dnl This seems to be the only way to make autoconf only *sometimes* configure
105 dnl a subdirectory with AC_CONFIG_SUBDIRS.  "__noconf" is assumed to not 
106 dnl exist as a directory, so configure won't try to recursively enter it, unless
107 dnl the shell variable $dummy is reset to an existing directory inside the
108 dnl if clause.
109
110 dummy="__noconf"
111
112 #if test -d "$LIBGTKDIR"; then
113 #       enable_shared="no"; export enable_shared
114 #       dummy="libgtk"
115 #       AC_CONFIG_SUBDIRS("$dummy")
116 #       X_LIBS="-L${srcdir}/libgtk/gtk/.libs -L${srcdir}/libgtk/gdk/.libs -L${srcdir}/libgtk/glib/.libs $X_LIBS"
117 #fi
118
119 TYPESIZES="" 
120
121 AC_CHECK_SIZEOF(short)
122 AC_CHECK_SIZEOF(int)
123 AC_CHECK_SIZEOF(long)
124 AC_CHECK_SIZEOF(long long)
125
126 case 2 in
127         $ac_cv_sizeof_short) TYPESIZES="$TYPESIZES -Dsize16='short'"
128                 SIZE16=TRUE;;
129         $ac_cv_sizeof_int) TYPESIZES="$TYPESIZES -Dsize16='int'"
130                 SIZE16=TRUE;;
131 esac
132
133 case 4 in
134         $ac_cv_sizeof_short) TYPESIZES="$TYPESIZES -Dsize32='short'"
135                 SIZE32=TRUE;;
136         $ac_cv_sizeof_int) TYPESIZES="$TYPESIZES -Dsize32='int'"
137                 SIZE32=TRUE;;
138         $ac_cv_sizeof_long) TYPESIZES="$TYPESIZES -Dsize32='long'"
139                 SIZE32=TRUE;;
140 esac
141
142 case 8 in
143         $ac_cv_sizeof_int) TYPESIZES="$TYPESIZES -Dsize64='int'"
144                 SIZE64=TRUE;;
145         $ac_cv_sizeof_long) TYPESIZES="$TYPESIZES -Dsize64='long'"
146                 SIZE64=TRUE;;
147         $ac_cv_sizeof_long_long) TYPESIZES="$TYPESIZES -Dsize64='long long'"
148                 SIZE64=TRUE;;
149 esac
150
151
152 if test -z "$SIZE16"; then
153         AC_MSG_ERROR(No 16 bit tupe found on this platform!)
154 fi
155 if test -z "$SIZE32"; then
156         AC_MSG_ERROR(No 32 bit tupe found on this platform!)
157 fi
158 if test -z "$SIZE64"; then
159         AC_MSG_WARN(No 64 bit tupe found on this platform!)
160 fi
161         
162 AC_HEADER_SYS_WAIT
163 AC_CHECK_HEADERS(fcntl.h limits.h sys/ioctl.h sys/time.h unistd.h)
164
165 AC_C_CONST
166 AC_HEADER_TIME
167 AC_STRUCT_TM
168
169 AC_PROG_MAKE_SET
170 AC_FUNC_MEMCMP
171 AC_TYPE_SIGNAL
172 AC_CHECK_FUNCS(gettimeofday select strcspn strerror strspn sigaction)
173
174 AC_SUBST(TYPESIZES)
175 AC_SUBST(OPT)
176 AC_SUBST(DEBUG)
177 AC_SUBST(PROFILE)
178 AC_SUBST(CC)
179 AC_SUBST(RANLIB)
180 #AC_SUBST(XOGG)
181 #AC_SUBST(LIBGTKDIR)
182 AC_SUBST(pthread_lib)
183
184 AC_OUTPUT(Makefile)