-
Notifications
You must be signed in to change notification settings - Fork 7
/
configure.ac
94 lines (81 loc) · 2.28 KB
/
configure.ac
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
dnl Process this file with autoconf to produce a configure script.
## replace the email below with authors' emails
AC_INIT([Hoa], 2.2-git, [email protected],[Hoa],[https://github.com/CICM/HoaLibrary-PD])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_AUX_DIR(config)
AC_CONFIG_FILES([Sources/Makefile])
AC_CONFIG_FILES([ThirdParty/CicmWrapper/Makefile ThirdParty/CicmWrapper/Sources/Makefile])
AC_CONFIG_FILES([Package/Hoa/Makefile Package/Hoa/helps/Makefile Package/Hoa/media/Makefile Package/Hoa/misc/Makefile Package/Hoa/patchers/Makefile Package/Hoa/tutorials/Makefile])
AX_FAT_BINARY()
AC_SUBST(PD_CPPFLAGS)
AC_SUBST(PD_LDFLAGS)
AC_SUBST(EXTENSION)
AM_INIT_AUTOMAKE([1.10 foreign])
AC_ARG_WITH([pd], [ --with-pd=</path/to/pd> where to look for pd-headers and and -libs])
AC_ARG_WITH([extension],[ --with-extension=<ext> enforce a certain extension for the dynamic library (e.g. dll)])
ARCH=$(uname -m)
KERN=$(uname -s)
AC_PROG_CXX
AC_PROG_LIBTOOL
if test "x${libdir}" = "x\${exec_prefix}/lib"; then
libdir='${exec_prefix}/lib/pd/extra'
fi
if test "x$with_pd" != "x"; then
if test -d "${with_pd}"; then
PDPATH=${with_pd}
fi
if test -d "${PDPATH}/src"; then
AC_MSG_RESULT([adding ${PDPATH}/src to INCLUDES])
PD_CPPFLAGS="-I${PDPATH}/src ${CPPFLAGS}"
AC_MSG_RESULT([adding ${PDPATH}/src to LDFLAGS])
PD_LDFLAGS="-L${PDPATH}/src ${LDFLAGS}"
else
if test -d "${PDPATH}"; then
AC_MSG_RESULT([adding ${PDPATH} to INCLUDES])
PD_CPPFLAGS="-I${PDPATH} ${CPPFLAGS}"
fi
fi
if test -d "${PDPATH}/bin"; then
AC_MSG_RESULT([adding ${PDPATH}/bin to LDFLAGS])
PD_LDFLAGS="-L${PDPATH}/bin ${LDFLAGS}"
else
if test -d "${PDPATH}"; then
AC_MSG_RESULT([adding ${PDPATH} to LDFLAGS])
PD_LDFLAGS="-L${PDPATH} ${LDFLAGS}"
fi
fi
else
AC_MSG_RESULT([no pd path given, trying with pkg-config data])
PD_CPPFLAGS=`pkg-config --cflags pd`
PD_LDFLAGS=`pkg-config --libs pd`
fi
AC_MSG_CHECKING([extension])
if test "x$with_extension" != "x"
then
EXTENSION=$with_extension
else
case "$KERN" in
Darwin)
EXTENSION=pd_darwin
;;
Linux)
if test "$ARCH" == x86_64
then
EXTENSION=l_ia64
else
EXTENSION=l_i386
fi
;;
*CYGWIN*)
EXTENSION=dll
;;
*MINGW*)
EXTENSION=dll
;;
*)
EXTENSION=pd_linux
;;
esac
fi
AC_MSG_RESULT([$EXTENSION])
AC_OUTPUT(Makefile)