File: configure.in

package info (click to toggle)
xmakemol 5.15-2
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 1,592 kB
  • ctags: 1,305
  • sloc: ansic: 18,178; sh: 2,794; makefile: 114; perl: 98
file content (166 lines) | stat: -rw-r--r-- 5,664 bytes parent folder | download
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
/*

Copyright (C) 2001, 2002, 2003, 2004 Matthew P. Hodges
Copyright (C) 2001, 2002, 2003, 2004, 2005 Matthew P. Hodges

This file is part of XMakemol.

XMakemol is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2, or (at your option)
any later version.

XMakemol is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with XMakemol; see the file COPYING.  If not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

configure.in for xmakemol:

    acincluce.m4 gives detailed description of local routines below:
         [ICE_FIND_MOTIF]  -- borrowed from mgv
         [ICE_FIND_XPM]    -- borrowed from mgv
         [SIM_AC_CHECK_OPENGL]  -- derived from coin3d
         [SIM_AC_CHECK_GLU]  -- derived from coin3d
         [SIM_CHECK_MOTIF_GLWIDGET] --derived from coin3d
*/

dnl Process this file with autoconf to produce a configure script.
AC_INIT(xmakemol.c)

dnl Checks for system
AC_CANONICAL_SYSTEM

AM_INIT_AUTOMAKE(xmakemol,5.15)
AM_CONFIG_HEADER(config.h)


dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL

dnl Configs from ac_opengl package
dnl AC_CONFIG_AUX_DIR(config)

dnl Checks for libraries.
dnl ==========================================================================
dnl Checks for libraries.
dnl ==========================================================================
AC_PATH_X
AC_PATH_XTRA
ICE_FIND_MOTIF
ICE_FIND_XPM
LIBS="$LIBS $X_EXTRA_LIBS"
CFLAGS="$CFLAGS $X_CFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
LDFLAGS="$LDFLAGS $X_LIBS"
 
dnl ==========================================================================
dnl Check for X11.
dnl ==========================================================================
X11_LIBS=""
AC_CHECK_LIB(X11, XOpenDisplay, X11_LIBS="-lX11",,${X_PRE_LIBS})
if test "$X11_LIBS" = ""; then
AC_MSG_ERROR([The X11 library '-lX11' could not be found.
                Please use the configure options '--x-includes=DIR'
                and '--x-libraries=DIR' to specify the X location.
                See the 'config.log' file for further diagnostics.])
fi
AC_SUBST(X_LIBS)
AC_SUBST(X11_LIBS)
AC_SUBST(X_PRE_LIBS)
 
dnl ==========================================================================
dnl Check for Xext, Xpm usually needs the shape extensions.
dnl We don't crap out if we can't find it though.
dnl ==========================================================================
XEXT_LIBS=""
AC_CHECK_LIB(Xext, XShapeQueryVersion, XEXT_LIBS="-lXext",,
        ${X_PRE_LIBS} ${X11_LIBS})
AC_SUBST(XEXT_LIBS)

dnl ==========================================================================
dnl Check for Xi, GLUT sometimes uses it
dnl We don't crap out if we can't find it though.
dnl ==========================================================================
XI_LIBS=""
AC_CHECK_LIB(Xi, XGetExtensionVersion, XI_LIBS="-lXi",,
        ${X_PRE_LIBS} ${X11_LIBS})
AC_SUBST(XI_LIBS)

dnl ==========================================================================
dnl Check for Xt
dnl ==========================================================================
XT_LIBS=""
AC_CHECK_LIB(Xt, XtToolkitInitialize, XT_LIBS="-lXt",,
        ${X_PRE_LIBS} ${X11_LIBS})
if test "$XT_LIBS" = ""; then
AC_MSG_ERROR([The X toolkit library '-lXt' could not be found.
                Please use the configure iptions '--x-includes=DIR'
                and '--x-libraries=DIR' to specify the X location.
                See the 'config.log' file for further diagnostics.])
fi
AC_SUBST(XT_LIBS)
 
dnl ==========================================================================
dnl Check for Motif
dnl I couldn't resist using the most hideously named function in the Motif
dnl API in this test, sorry if I've frightened anyone.
dnl ==========================================================================
XM_LIBS=""
AC_CHECK_LIB(Xm, XmRepTypeInstallTearOffModelConverter,
        XM_LIBS="-lXm"
        AC_DEFINE(HAVE_MOTIF, 1), AC_DEFINE(HAVE_MOTIF, 0),
        ${X_PRE_LIBS} ${XPM_LIBS} ${XEXT_LIBS} ${XT_LIBS} ${XI_LIBS} ${X11_LIBS})
if test "$XM_LIBS" = ""; then
AC_MSG_ERROR([The Motif library '-lXm' could not be found.
                Please use the configure options '--with-motif-includes=DIR'
                and '--with-motif-libraries=DIR' to specify the Xm location.
                See the 'config.log' file for further diagnostics.])
fi
AC_SUBST(XM_LIBS)

dnl
dnl Check for OpenGL
dnl

GL_LIBS=""
AC_CHECK_LIB(m,pow,[MATHLIB="true"])
if test x"$MATHLIB" != x"true"; then
	AC_MSG_ERROR([the math library '-lm' could not be found!
			Please check the installation of math library])
fi
if test x"$MATHLIB" = x"true"; then
  LIBS="$LIBS -lm"
  SIM_AC_CHECK_OPENGL([OPENGLLIB="true"])
  if test x"$OPENGLLIB" = x"true" ; then
    SIM_AC_CHECK_GLU([GLULIB="true"])
    if test x"$GLULIB" = x"true" ; then
	SIM_CHECK_MOTIF_GLWIDGET([GLWIDGETLIB="true"],GL_LIBS="")
        XMAKEMOL_GLUT_CHECK()
    fi
  fi
fi

AC_SUBST(GL_LIBS)	

dnl Checks for other libraries

dnl AC_CHECK_LIB(gen,basename,[AC_DEFINE(HAVE_LIBGEN,1) LIBS="${LIBS} -lgen"],)

dnl Checks for other header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(unistd.h)

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST

dnl Checks for library functions.
AC_FUNC_ALLOCA
AC_CHECK_FUNCS(ftime strstr usleep)

AC_OUTPUT(Makefile)