aboutsummaryrefslogtreecommitdiff
path: root/externals/grill/flext/configure.ac
blob: e8e53e139751c288b2a4380bb36afb735aa0c8d2 (plain)
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
dnl
dnl autoconf template
dnl added by tim blechmann
dnl

dnl flext API version (current:release:age)
API_VERSION=0:0:0

AC_INIT([flext],[0.4.7],[gr@grrrr.org],[flext])
AM_INIT_AUTOMAKE(1.8)


dnl configure options
AC_ARG_ENABLE(system, [  --enable-system         flext system (default: pd)],
    [
	case $enableval in 
		max) AC_DEFINE(FLEXT_SYS,1)
			 TARGETDIR=maxmsp;;
		*) AC_DEFINE(FLEXT_SYS,2)
			 TARGETDIR=pd;;
	esac
	system = $enableval
	],
	AC_DEFINE(FLEXT_SYS,2)
	TARGETDIR=pd
)

AC_ARG_WITH(sysdir,
	[  --with-sysdir           path to pd or max headers],
    	[
		sysdir=$withval
		INCLUDEDIR="-I$withval $INCLUDEDIR"
	],
	[echo "path to system headers required "$enableval && exit 1])

dnl check for g_canvas.h in pd folder
AC_CHECK_FILE("$sysdir/g_canvas.h",,[echo "$sysdir/g_canvas.h not found" && exit 1])

AC_ARG_WITH(stkdir,
	[  --with-stkdir           path to stk headers],
	[
	    AC_CHECK_FILE("$withval/Stk.h",,[echo "$withval/Stk.h not found" && exit 1])	
		stkdir=$withval
		INCLUDEDIR="-I$withval $INCLUDEDIR"
	])

AM_CONDITIONAL([STK],[test "$stkdir"])

AC_ARG_WITH(sndobjdir,
	[  --with-sndobjdir      path to SndObj headers],
	[
		AC_CHECK_FILE("$withval/SndObj.h",,[echo "$withval/SndObj.h not found" && exit 1])
		sndobjdir=$withval
		INCLUDEDIR="-I$withval $INCLUDEDIR"
	])

AM_CONDITIONAL([SNDOBJ],[test "$sndobjdir"])

AC_ARG_ENABLE(optimize, [  --enable-optimize       enables optimized builds for: pentium4, pentium3, G4, G5],
    [
	case $enableval in
	pentium3 | pentium3m)
		OPT_FLAGS = "-mtune=$enableval -march=$enableval -mmmx -msse -mfpmath=sse";
		AC_DEFINE(FLEXT_USE_SIMD);;
	pentium2 | athlon | pentium-mmx)
		OPT_FLAGS="-mtune=$enableval -march=$enableval -mmmx";;
	pentium)
	 	OPT_FLAGS="-mtune=$enableval -march=$enableval";;
	pentium4 | pentium4m | pentium-m | prescott | nocona | athlon-xp | athlon-mp | athlon64 | opteron) 
		OPT_FLAGS="-mtune=$enableval -march=$enableval -mmmx -msse -msse2 -mfpmath=sse";
		AC_DEFINE(FLEXT_USE_SIMD);;
	G5 | G4)
		OPT_FLAGS="-mtune=$enableval -march=$enableval -maltivec -faltivec -malign-natural";
		AC_DEFINE(FLEXT_USE_SIMD);;
	G3)
		OPT_FLAGS="-mtune=$enableval -march=$enableval -malign-natural";;
	*)
		;;
	esac
	])

dnl Checks for programs.
AC_PROG_CC
AC_PROG_CXX
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_RANLIB

dnl Checks for libraries.

dnl Checks for header files.

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_C_INLINE
AC_TYPE_SIZE_T
AC_STRUCT_TM

dnl Checks for library functions.

dnl system specific

if test `uname -s` == Linux; then
	DYNAMIC_LDFLAGS="-Wl,-Bdynamic"
	EXTENSION=pd_linux
	SOEXT=so
fi

if test `uname -s` == Darwin; then
	DYNAMIC_LDFLAGS = "-version-info $API_VERSION -release $AC_PACKAGE_VERSION -dylib -dynamic -flat_namespace -undefined suppress"

	if test $system = max; then
		echo "what's the name in max???" #EXEEXT = ???
	else	
		EXTENSION=pd_darwin
		SOEXT=dylib
		FRAMEWORKS=???
	fi
fi

dnl todo: mingw / cygwin

AC_SUBST(INCLUDEDIR)
AC_SUBST(OPT_FLAGS)
AC_SUBST(DYNAMIC_LDFLAGS)
AC_SUBST(stkdir)
AC_SUBST(sndobjdir)
AC_SUBST(EXTENSION)
AC_SUBST(SOEXT)
AC_SUBST(TARGETDIR)
AC_SUBST(FRAMEWORKS) dnl for osx
AC_OUTPUT([
			Makefile
			tutorial/Makefile
			tutorial/adv1/Makefile
			tutorial/adv2/Makefile
			tutorial/adv3/Makefile
			tutorial/attr1/Makefile
			tutorial/attr2/Makefile
			tutorial/attr3/Makefile
			tutorial/bind1/Makefile
			tutorial/buffer1/Makefile
			tutorial/lib1/Makefile
			tutorial/signal1/Makefile
			tutorial/signal2/Makefile
			tutorial/simple1/Makefile
			tutorial/simple2/Makefile
			tutorial/simple3/Makefile
			tutorial/sndobj1/Makefile
			tutorial/stk1/Makefile
			tutorial/stk2/Makefile
			tutorial/thread1/Makefile
			tutorial/thread2/Makefile
			tutorial/timer1/Makefile
			tutorial/pd/Makefile
			tutorial/maxmsp/Makefile
			source/Makefile])