aboutsummaryrefslogtreecommitdiff
path: root/aclocal.m4
blob: b09b3f2b250a60c617a772647d787276a370e719 (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
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
#
# Include the TEA standard macro set
#

builtin(include,tclconfig/tcl.m4)

#
# Zinc specific macros below.
#
#
# ALL the new macros here need to be modified to
# detect the various packages needed and to get their paths.
# Right now all this is statically defined in the macros.
#
#------------------------------------------------------------------------
# ZINC_ENABLE_GL --
#
#	Specify if openGL support should be used.
#	Code for managing a damage area can also be enabled.
#
# Arguments:
#	none
#	
# Results:
#
#	Adds the following arguments to configure:
#		--enable-gl=[yes,no,damage]
#
#	Defines the following vars:
#		GL_INCLUDES	OpenGL include files path
#		GL_LIBS		additional libraries needed for GL
#		LIBS		Modified to reflect the need of new
#				libraries
#		GL		Defined if GL support is enabled
#		GL_DAMAGE	Defined if damage support has been
#				requested
#
#------------------------------------------------------------------------

AC_DEFUN(ZINC_ENABLE_GL, [
     if test x"${TEA_INITED}" = x ; then
  	AC_MSG_ERROR([Must call TEA INIT before ENABLE_GL])
     fi

     AC_MSG_CHECKING([for build with GL])
     AC_ARG_ENABLE(gl,
 		  [  --enable-gl             build with openGL support (yes,no,damage) [[no]]],
 		  [tcl_ok=$enableval], [tcl_ok=no])

     if test "$tcl_ok" = "no"; then
 	GL_LIBS=
 	GL_INCLUDES=
 	AC_MSG_RESULT([no])
     else
	if test "${TEA_PLATFORM}" = "windows" ; then
	    GL_LIBS=-lopengl32
	else
	  #
	  # On Linux, the Nvidia GL libraries needs threads support via
	  # pthreads but not mesa. Need to auto-detect that and the
	  #  availability of pthreads.
 	  GL_LIBS="-lGL -lpthread"
# 	  GL_LIBS="-lGL"
 	  GL_INCLUDES='/usr/include'
        fi

 	AC_DEFINE(GL)
 	if test "$tcl_ok" = "damage"; then
 	    AC_DEFINE(GL_DAMAGE)
         fi

 	LIBS="$LIBS $GL_LIBS"

 	if test "$tcl_ok" = "yes"; then
 	    AC_MSG_RESULT([yes (standard)])
 	else
 	    AC_MSG_RESULT([yes (with damage support)])
 	fi
     fi

     AC_SUBST(GL_LIBS)
     AC_SUBST(GL_INCLUDES)
])

#------------------------------------------------------------------------
# ZINC_ENABLE_OM --
#
#	Specify if the anti overlapping code should be included.
#
# Arguments:
#	none
#	
# Results:
#
#	Adds the following arguments to configure:
#		--enable-om=[yes,no]
#
#	Defines the following vars:
#		Om_LIB_FILE	Contains the platform depent library
#				name for the pluggable overlap manager
#		OM		Defined if overlap manager support
#				is enabled
#
#	Adjust LIBS to include the overlap manager default library.
#	May Modify LD_SEARCH_FLAGS to include the zinc install directory
#
#------------------------------------------------------------------------

 AC_DEFUN(ZINC_ENABLE_OM, [
     if test x"${TEA_INITED}" = x ; then
  	AC_MSG_ERROR([Must call TEA INIT before ENABLE_OM])
     fi

     AC_MSG_CHECKING([for build with the overlap manager])
     AC_ARG_ENABLE(om,
 		  [  --enable-om             build with overlap manager support [[yes]]],
 		  [tcl_ok=$enableval], [tcl_ok=yes])
     if test "$tcl_ok" = "no"; then
 	Om_LIB_FILE=
 	AC_MSG_RESULT([no])
     else
	if test "${TEA_PLATFORM}" = "windows" ; then
	    Om_LIB_FILE=om.dll
	    bin_BINARIES="\$(Om_LIB_FILE) ${bin_BINARIES}"
	else
 	    Om_LIB_FILE=libom.so
	    aux_BINARIES="\$(Om_LIB_FILE) ${bin_BINARIES}"
	fi
 	AC_DEFINE(OM)
 	AC_MSG_RESULT([yes])
	LIBS="${LIBS} -L. -lom"
     fi
     AC_SUBST(Om_LIB_FILE)
])

#------------------------------------------------------------------------
# ZINC_ENABLE_SHAPE --
#
#	Specify if the X shape extension support should be included.
#
# Arguments:
#	none
#	
# Results:
#
#	Adds the following arguments to configure:
#		--enable-shape=[yes,no]
#
#	Defines the following vars:
#		SHAPE		Defined if shape support is enabled
#
#	Adjust LIBS to include the X extension library
#
#------------------------------------------------------------------------

AC_DEFUN(ZINC_ENABLE_SHAPE, [
     if test x"${TEA_INITED}" = x ; then
 	AC_MSG_ERROR([Must call TEA INIT before ENABLE_SHAPE])
     fi
     AC_MSG_CHECKING([for build with X shape support])
     AC_ARG_ENABLE(shape,
 		  [  --enable-shape          build with X shape support (if applicable) [[yes]]],
 		  [tcl_ok=$enableval], [tcl_ok=yes])
     if test "$tcl_ok" = "no"; then
 	AC_MSG_RESULT([no])
     else
         if test "${TEA_PLATFORM}" = "windows" ; then
 	    AC_MSG_RESULT([no (not available on windows)])
 	else
 	    AC_DEFINE(SHAPE)
 	    AC_MSG_RESULT([yes])
	    LIBS="${LIBS} -lXext"
 	fi
     fi
])

#------------------------------------------------------------------------
# ZINC_ENABLE_PTK --
#
#	Specify that zinc should be build for perl/Tk instead of Tk
#
# Arguments:
#	none
#	
# Results:
#
#	Adds the following arguments to configure:
#		--enable-ptk=[yes,no]
#
#	Defines the following vars:
#		PTK			Defined if compilation should be
#					done for perl/Tk
#		PERL_TK_LIB		Path to perl/tk library (.pm)
#
#	Modifies SHLIB_LD_LIBS, TCL_INCLUDES and TK_INCLUDES to
#	reflect the change in runtime environment.
#
#------------------------------------------------------------------------

AC_DEFUN(ZINC_ENABLE_PTK, [
     AC_MSG_CHECKING([for build with perl/Tk support])
     AC_ARG_ENABLE(ptk,
 		  [  --enable-ptk            build with perl/Tk support [[no]]],
 		  [tcl_ok=$enableval], [tcl_ok=no])
     if test "$tcl_ok" = "no"; then
	PERL_TK_LIB=
 	AC_MSG_RESULT([no])
     else
	#
	# Locate the perl hierarchy and the corresponding perl/tk.
	#
	AC_CHECK_PROGS(PERL, perl, error)
	changequote()
	PERL_TK_LIB=`perl -MTk -e 'print $Tk::library'`
	changequote([, ])

	#
	# Don't use stubs libraries with perl/Tk.
	# Don't use either the includes from Tcl/Tk.
	SHLIB_LD_LIBS="\${LIBS}"
	TCL_INCLUDES=
	TK_INCLUDES=-I${PERL_TK_LIB}/pTk
	AC_DEFINE(PTK)
 	AC_MSG_RESULT([yes])
     fi

     AC_SUBST(PERL_TK_LIB)
])