File: configure.in

package info (click to toggle)
mountapp 2.7-2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 536 kB
  • ctags: 242
  • sloc: ansic: 2,629; sh: 1,600; makefile: 64
file content (171 lines) | stat: -rw-r--r-- 4,631 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
167
168
169
170
171
dnl Process this file with autoconf to produce a configure script.
dnl Process with: aclocal; autoconf; automake

AC_INIT(src/mount.c)

AM_CONFIG_HEADER(config.h)

AM_INIT_AUTOMAKE(mountapp, 2.7)

dnl Checks for host/os name
dnl =======================
AC_CANONICAL_HOST

dnl Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_MAKE_SET
AC_PROG_RANLIB
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_GCC_TRADITIONAL
AC_PROG_INSTALL
AC_PROG_LN_S

AC_PATH_PROG(MOUNT_CMD, mount)
AC_PATH_PROG(UMOUNT_CMD, umount)
AC_PATH_PROG(EJECT_CMD, eject)
AC_PATH_PROG(XMESSAGE, xmessage)

AC_SUBST(MOUNT_CMD)
AC_SUBST(UMOUNT_CMD)
AC_SUBST(EJECT_CMD)
AC_SUBST(XMESSAGE)

AC_DEFINE_UNQUOTED(MOUNT_CMD, "$MOUNT_CMD")
AC_DEFINE_UNQUOTED(UMOUNT_CMD, "$UMOUNT_CMD")
AC_DEFINE_UNQUOTED(EJECT_CMD, "$EJECT_CMD")
AC_DEFINE_UNQUOTED(XMESSAGE, "$XMESSAGE")

dnl Checks for libraries.

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

dnl ===========================================
dnl         Stuff that uses X
dnl ===========================================
AC_PATH_XTRA

dnl
dnl Specify paths to look for graphic format libraries
dnl ==================================================
AC_ARG_WITH(gfx-libs,
[  --with-gfx-libs         pass compiler flags to look for gfx libraries],
    [GFXLIBS="$withval" GFX_LIB_PATH=$withval],    [GFXLIBS="" GFX_LIB_PATH=""])

AC_ARG_WITH(gfx-incs,
[  --with-gfx-incs         pass compiler flags to look for gfx header files],
    [GFXFLAGS="$withval" GFX_INC_PATH=$withval],
    [GFXFLAGS="" GFX_INC_PATH=""])

XCFLAGS="$X_CFLAGS"
XLFLAGS="$X_LIBS"
XLIBS="$X_EXTRA_LIBS -lX11"

CFLAGS="$GFX_INC_PATH $GFX_LIB_PATH"
shape=yes
AC_CHECK_LIB(Xext, XShapeCombineMask, [XLIBS="-lXext $XLIBS"], shape=no, $XLFLAGS $XLIBS)

if test "$shape" = no; then
    echo "********** WARNING *************"
    echo "You need X server shape extensions in order to run mount.app,"
    echo "and they were not found on your system."
    read foo
fi

dnl XPM Support  <- If you disable XPM, mount.app will not compile.
dnl ===========
xpm=yes
AC_ARG_ENABLE(xpm,
[  --disable-xpm           disable use of XPM pixmaps through libXpm],
    xpm=$enableval, xpm=yes)

if test "$xpm" = yes; then
    AC_CHECK_LIB(Xpm, XpmCreatePixmapFromData,
    [GFXFLAGS="$GFXFLAGS -DUSE_XPM" GFXLIBS="$GFXLIBS -lXpm"],,
    $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS)
    AC_CHECK_LIB(m, cos)
    AC_CHECK_LIB(z, gzread,GFXLIBS="$GFXLIBS -lz",,
    $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS)
    AC_CHECK_LIB(jpeg, jpeg_destroy_compress, GFXLIBS="-ljpeg $GFXLIBS",,
    $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS)
    AC_CHECK_LIB(tiff, TIFFGetVersion, GFXLIBS="-ltiff $GFXLIBS",
    AC_CHECK_LIB(tiff34, TIFFGetVersion, GFXLIBS="-ltiff34 $GFXLIBS",,
    $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS),
    $GFX_INC_PATH $GFX_LIB_PATH $XLFLAGS $XLIBS $GFXLIBS)
fi

dnl =====================================================
dnl        Check for libPropList
dnl =====================================================

AC_CHECK_LIB(PropList, PLGetString,
    [LIBPL_LIBS=-lPropList LIBPL_INC_PATH="" needtobuild=no],
    [LIBPL_LIBS="-L$PLPATH -lPropList"
     LIBPL_INC_PATH="-I$PLPATH" needtobuild=yes])

if test "$needtobuild" = yes; then
    echo "********** WARNING *************"
    echo "libPropList is not installed in your system."
    echo "You need to build it before building mount.app (if you already"
    echo "did that, remove config.cache and rerun configure)."
    echo "Please read the INSTALL file for detailed instructions."
    read foo
fi

AC_SUBST(LIBPL_LIBS)
AC_SUBST(LIBPL_INC_PATH)

GTK_LIBS=`gtk-config --libs`
GTK_CFLAGS=`gtk-config --cflags`
AC_SUBST(GTK_LIBS)
AC_SUBST(GTK_CFLAGS)

if test "${prefix}" = "NONE"; then
	prefix=/usr/local
fi

if test "${exec_prefix}" = "NONE"; then
	exec_prefix=${prefix}
fi

mountsdir='${bindir}'
pixmapdir='${datadir}/mount.app'
AC_SUBST(mountsdir)
AC_SUBST(pixmapdir)

if test "${bindir}" = '${exec_prefix}/bin'; then
	if test "${exec_prefix}" = '${prefix}'; then
		BINDIR=${prefix}/bin
	else
		BINDIR=${exec_prefix}/bin
	fi
else
	BINDIR=${bindir}
fi
AC_DEFINE_UNQUOTED(BINDIR, "$BINDIR")

if test "${datadir}" = '${prefix}/share'; then
	ICONDIR=${prefix}/share/mount.app
else
	ICONDIR=${datadir}/mount.app
fi
AC_DEFINE_UNQUOTED(ICONDIR, "$ICONDIR")

AC_SUBST(XLIBS)
AC_SUBST(XCFLAGS)
AC_SUBST(XLFLAGS)
AC_SUBST(GFXFLAGS)
AC_SUBST(GFXLIBS)

dnl Checks for typedefs, structures, and compiler characteristics.

dnl Checks for library functions.
AC_TYPE_SIGNAL
AC_CHECK_FUNCS(strdup strstr)

AC_OUTPUT(Makefile src/Makefile src/EXTRAS/Makefile)