aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
blob: 42f021a82076764b6a41d05da100f3c6c97cdbc6 (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
dnl Process this file with autoconf to produce a configure script.

AC_INIT
GEM2PDP_VERSION=0.6

if test -d /usr/local/pd; 
then
	PD_DIR=/usr/local/pd
elif test -d ../../pd; 
then
	PD_DIR=../../pd
else
   echo "Pd sources not found"
fi

if test -d /usr/local/pd/pdp; 
then
	PDP_DIR=/usr/local/pd/pdp
elif test -d ../pdp; 
then
	PDP_DIR=../pdp
else
   echo "PdP sources not found"
fi

if test -d /win/Georg/pd-cvs/gem/Gem; 
then
   GEM_DIR=/win/Georg/pd-cvs/gem/Gem
elif test -d ../../gem/Gem; 
then
	GEM_DIR=../../gem/Gem
elif  test -d ../../gem/Gem; 
then
	GEM_DIR=../../gem/Gem
else
   echo "Gem sources not found"
fi

AC_ISC_POSIX
AC_PROG_CC
AM_PROG_CC_STDC
AC_HEADER_STDC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AM_SANITY_CHECK

AM_MAINTAINER_MODE
AM_WITH_DMALLOC

AC_SUBST(GEM2PDP_VERSION)

AC_ARG_WITH(pddir,       [  --with-pddir=<dir>      specify an alternate pd source tree])
AC_ARG_WITH(gemdir,      [  --with-gemdir=<dir>     specify an alternate gem source tree])
AC_ARG_WITH(pdpdir,      [  --with-pdpdir=<dir>     specify an alternate pdp source tree])

if test "$with_gemdir" != ""
then
 GEM_DIR=$with_gemdir
fi

if test "$with_pdpdir" != ""
then
 PDP_DIR=$with_pdpdir
fi

if test "$with_pddir" != ""
then
 PD_DIR=$with_pddir
fi

echo -n "looking for gem sources (required) ... "
if test -f $GEM_DIR/src/Base/GemMan.h
then
  AC_SUBST(GEM_DIR)
  echo "ok." 
else
  echo "gem source tree not found... install it, fix the path in configure.ac and run autoconf"
  exit -1
fi

AC_SUBST(PD_DIR)

echo -n "looking for pdp sources (required) ... "
if test -f $PDP_DIR/include/pdp.h
then
  AC_SUBST(PDP_DIR)
  echo "ok." 
else
  echo "pdp source tree not found... install it, fix the path in configure.ac and run autoconf"
  exit -1
fi


AC_CANONICAL_HOST
case "$host" in
 	*-linux*)
		  EXTENSION=pd_linux
		  LDFLAGS="$LDFLAGS -export_dynamic -shared"
		  ;;
 	*-mingw*)
		  CFLAGS="$CFLAGS -mms-bitfields"
		  EXTENSION=dll
		  LDFLAGS="$LDFLAGS -shared"
		  ;;
   *-darwin* | *-macos10*)
	  EXTENSION=pd_darwin
	  LDFLAGS="$LDFLAGS -bundle -undefined dynamic_lookup"
  	  # Check for DarwinPorts and/or Fink on Mac OS X/Darwin
     if test -d /sw ; then
       # Fink
       PATH="/sw/bin:/sw/sbin:$PATH"
       INCLUDES="$INCLUDES -I/sw/include"
       LIBS="$LIBS -L/sw/lib"
     elif test -d /opt/local ; then
       # DarwinPorts
       PATH="/opt/local/bin:/opt/local/sbin:$PATH"
       INCLUDES="$INCLUDES -I/opt/local/include"
       LIBS="$LIBS -L/opt/local/lib"
     fi
  ;;
esac

AC_SUBST(CFLAGS)
AC_SUBST(EXTENSION)
AC_SUBST(INCLUDES)
AC_SUBST(LDFLAGS)

LIBS="$LIBS -lm"

AC_CONFIG_FILES([
Makefile
])
AC_OUTPUT