forked from shirok/Gauche-gl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfigure.in
131 lines (116 loc) · 3.84 KB
/
configure.in
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
dnl
dnl Configuring gauche-gl
dnl process this file with "autoconf" to generate 'configure'.
dnl $Id: configure.in,v 1.32 2007-07-10 00:13:21 shirok Exp $
AC_PREREQ(2.54)
AC_INIT(Gauche-gl, 0.5.1, shiro@acm.org)
AC_CANONICAL_SYSTEM
AC_PATH_XTRA
case "$target" in
*-*-cygwin*)
if test "x-$have_x" = "x-disabled" -o "x-$have_x" = "x-no";
then
LIBGLUT=glut32;
else
LIBGLUT=glut
CPPFLAGS="$CPPFLAGS -I$x_includes";
fi;;
*)
LIBGLUT=glut;;
esac
# options for configure scripts
GLUT_LIB="-l$LIBGLUT"
AC_ARG_WITH(glut, [ --with-glut[=PATH]: Use GLUT library installed under PATH.
By default, Gauche-gl assumes GLUT is installed in the system standard
location. If you do not want to use GLUT support, specify --with-glut=no.
On MinGW you can statically link freeglut included in the source.
If you want to choose so, say --with-glut=mingw-static.], [
case $with_glut in
no) GLUT_LIB= ;;
yes) GLUT_LIB="-l$LIBGLUT";;
mingw-static)
GLUT_LIB="-lfreeglut_static -lgdi32 -lwinmm"
GLUT_INCDIR="-I../win32/freeglut-2.6.0-3/include -DFREEGLUT_STATIC"
GLUT_LIBDIR="-L../win32/freeglut-2.6.0-3/lib";;
*) GLUT_LIB="-l$LIBGLUT"
GLUT_INCDIR="-I$with_glut/include"
GLUT_LIBDIR="-L$with_glut/lib";;
esac
])
AC_ARG_ENABLE(cg,
AC_HELP_STRING([--enable-cg], [Enable NVidia's Cg binding.]), [
AC_DEFINE(HAVE_CG, 1)
ENABLE_CG=1
CG_LIBS="-lCgGL -lCg"
CG_SCM="cg/gl/cg.scm";
])
AC_SUBST(ENABLE_CG)
AC_SUBST(CG_LIBS)
AC_SUBST(CG_SCM)
dnl Set up gauche related commands. The commands are set by scanning
dnl PATH. You can override them by "GOSH=/my/gosh ./configure" etc.
AC_PATH_PROG([GOSH], gosh)
AC_PATH_PROG([GAUCHE_CONFIG], gauche-config)
AC_PATH_PROG([GAUCHE_PACKAGE], gauche-package)
AC_PATH_PROG([GAUCHE_INSTALL], gauche-install)
AC_PATH_PROG([GAUCHE_CESCONV], gauche-cesconv)
dnl Usually these parameters are set by AC_PROG_CC, but we'd rather use
dnl the same one as Gauche has been compiled with.
SOEXT=`"$GAUCHE_CONFIG" --so-suffix`
OBJEXT=`"$GAUCHE_CONFIG" --object-suffix`
EXEEXT=`"$GAUCHE_CONFIG" --executable-suffix`
AC_SUBST(SOEXT)
AC_SUBST(OBJEXT)
AC_SUBST(EXEEXT)
# Check for headers
AC_CHECK_HEADERS(GL/glx.h, [ # OpenGL/X11
# NB: FreeBSD seems to need -lX11 -lXext. We are on X11 system anyway,
# so I assume this won't do any harm.
GL_LIBS='-lGLU -lGL -lX11 -lXext'
GLUT_LIB="$GLUT_LIB -lXmu -lXi"
], ,)
AC_CHECK_HEADERS(GLUT/glut.h, [
case $target in
*-apple-darwin*)
AC_DEFINE(MacOSX, 1) # darwin which has GLUT/glut.h is MacOSX
GL_LIBS='-framework OpenGL -framework GLUT' # GLUT for glutGetProcAddress
GLUT_LIB='-framework GLUT' ;;
*) # other OSes w/o X11 but have GLUT/glut.h. Possibly MacOS9??
;;
esac
], ,)
if test "$GL_LIBS" = ""; then
case $target in
*-*-cygwin*|*-*-mingw*)
GL_LIBS='-lglu32 -lopengl32' ;;
*)
GL_LIBS='-lGLU -lGL' ;;
esac
fi
AC_SUBST(GL_LIBS)
AC_SUBST(GLUT_LIB)
AC_SUBST(GLUT_INCDIR)
AC_SUBST(GLUT_LIBDIR)
# Check for other programs.
AC_CHECK_PROGS(MAKEINFO, makeinfo)
AC_CHECK_PROGS(GZIP_PROGRAM, gzip)
# Check for libraries
# on cygwin, we need several extra -l flags.
case "$target" in
*-*-cygwin*|*-*-mingw*)
LIBS="-lgauche-uvector $LIBS"
GL_EXTRALIBS="-L. -lgauche-math3d"
GLUT_EXTRALIBS="-L. -lgauche-gl -lgauche-math3d"
;;
esac
AC_SUBST(GL_EXTRALIBS)
AC_SUBST(GLUT_EXTRALIBS)
dnl Creating gpd (gauche package description) file
GAUCHE_PACKAGE_CONFIGURE_ARGS="`echo ""$ac_configure_args"" | sed 's/[\\""\`\$]/\\\&/g'`"
AC_MSG_NOTICE([creating ${PACKAGE_NAME}.gpd])
"$GAUCHE_PACKAGE" make-gpd "$PACKAGE_NAME" \
-version "$PACKAGE_VERSION" \
-configure "./configure $GAUCHE_PACKAGE_CONFIGURE_ARGS"
dnl Output
echo $PACKAGE_VERSION > VERSION
AC_OUTPUT(Makefile src/Makefile lib/Makefile cg/Makefile doc/Makefile)