[PD] makefile and tcl
Miha Tomšič
miha.tomsic at guest.arnes.si
Sat Dec 1 00:43:51 CET 2001
Hello!
On Fri, 30 Nov 2001, pix wrote:
> yeah i could always link /usr/include/tcl to /usr/include/tcl8.3... i
> guess i'm curious if there is some holy debian-endorsed way to do it ;) so
> thoroughly off topic in that respect.
This is what I am using and it works the holy. I would be interested if it
works for other distributions and Unices.
I am also using slightly modified s_linux.c
-- changed --
#ifdef ALSA
#include <sys/asoundlib.h> /* The include file path is the same for both */
#endif
---- with ----
#ifdef ALSA99
#include <sys/asoundlib.h>
#else ifdef ALSA01
#include <alsa/asoundlib.h>
#endif
--------------
Because newer ALSA says:
--
In file included from s_linux.c:42:
/usr/include/sys/asoundlib.h:1: warning: #warning This header is
deprecated, use <alsa/asoundlib.h> instead.
make: *** [s_linux.o] Error 1
--
Please report about successes and problems and take care,
Miha...
- Miha Tomšič --- C. na postajo 55 -- SI-1351 Brezovica pri Lj. --- SLOVENIA -
-------------- next part --------------
dnl Process this file with autoconf to produce a configure script.
AC_INIT(d_arithmetic.c)
AC_SUBST(alsa)
AC_SUBST(rme)
AC_SUBST(PDLIB)
AC_SUBST(DEFINES)
AC_SUBST(MORECFLAGS)
AC_SUBST(EXT)
AC_SUBST(OPT_CFLAGS)
AC_SUBST(SYSSRC)
AC_SUBST(STRIPFLAG)
AC_SUBST(GUINAME)
AC_SUBST(GUIFLAGS)
dnl other defaults
dnl check for features
AC_ARG_ENABLE(alsa, [ --enable-alsa compile ALSA support],
alsa="yes")
AC_ARG_ENABLE(old-alsa,[ --enable-old-alsa ALSA 0.5x support],
alsa="old")
AC_ARG_ENABLE(rme, [ --enable-rme compile RME support],
rme="yes")
AC_ARG_ENABLE(debug, [ --enable-debug debugging support],
OPT_CFLAGS="-g", OPT_CFLAGS="-O6 -funroll-loops -fomit-frame-pointer")
dnl Checks for programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_MAKE_SET
AC_PROG_CPP
dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h limits.h malloc.h sys/ioctl.h sys/time.h unistd.h bstring.h)
dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
AC_FUNC_VPRINTF
AC_CHECK_FUNCS(gettimeofday select socket strerror)
dnl Checks for libraries.
dnl Checking for `dlopen' function in -ldl:
AC_CHECK_LIB(dl, dlopen,PDLIB="$PDLIB -ldl",
echo "dynamic link support required" || exit 0)
dnl Checking for `sin' function in -lffm:
dnl ffm is the fast math library on the alpha
AC_CHECK_LIB(ffm, sin,PDLIB="$PDLIB -lffm")
dnl Checking for `sin' function in -lm:
AC_CHECK_LIB(m, sin,PDLIB="$PDLIB -lm",
echo "math library required" || exit 0 )
dnl Checking for `pthread_create' function in -pthread
AC_CHECK_LIB(pthread, pthread_create,PDLIB="$PDLIB -lpthread",
echo "pthreads required" || exit 0)
dnl This should be fixed so Pd can use ALSA shared libraries where appropriate.
if test "$alsa" = yes; then
AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound",alsa="")
elif test "$alsa" = old; then
AC_CHECK_LIB(asound,snd_pcm_info,PDLIB="$PDLIB -lasound",alsa="")
fi
dnl Find paths to includes and libraries for X11
AC_PATH_X
dnl Checking for `XCreateWindow' function in -lX11:
AC_CHECK_LIB(X11, XCreateWindow, LIBS="$LIBS -lX11 -L$x_libraries",
echo "no X11 found" || exit 0, -L$x_libraries)
AC_CHECK_HEADER(tcl.h,,
AC_CHECK_HEADER(tcl8.1/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.1",
AC_CHECK_HEADER(tcl8.2/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.2",
AC_CHECK_HEADER(tcl8.3/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.3",
AC_CHECK_HEADER(tcl8.4/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.4",
AC_CHECK_HEADER(tcl8.5/tcl.h,GUIFLAGS="$GUIFLAGS -I /usr/include/tcl8.5",
echo "no tcl/tk header found" || exit 0))))))
AC_CHECK_LIB(tcl8.3, main,,
AC_CHECK_LIB(tcl8.2, main,,
AC_CHECK_LIB(tcl8.0, main)))
AC_CHECK_LIB(tk8.3, main,,
AC_CHECK_LIB(tk8.2, main,,
AC_CHECK_LIB(tk8.0, main)))
dnl Checking for tk.h or tkstep.h - not used at the moment
dnl AC_CHECK_HEADER(tk.h,DEFINES="$DEFINES -DTKINC=\\\"tk.h\\\"")
dnl AC_CHECK_HEADER(tkstep.h,DEFINES="$DEFINES -DTKINC=\\\"tkstep.h\\\"")
if test `uname -s` = Linux;
then
LDFLAGS="-Wl,-export-dynamic"
EXT=pd_linux
MORECFLAGS=-DDL_OPEN
SYSSRC=s_linux.c
STRIPFLAG=-s
GUINAME="pd-gui"
fi
if test `uname -s` = IRIX64;
then
LDFLAGS="-n32 -DUNIX -DIRIX -DN32 -woff 1080,1064,1185 \
-OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \
-shared -rdata_shared"
EXT=pd_irix6
MORECFLAGS=-DDL_OPEN
SYSSRC=s_sgi.c
STRIPFLAG=-s
GUINAME="pd-gui"
fi
if test `uname -s` = IRIX32;
then
LDFLAGS="-o32 -DUNIX -DIRIX -O2 -shared -rdata_shared"
EXT=pd_irix5
MORECFLAGS=-DDL_OPEN
SYSSRC=s_sgi.c
STRIPFLAG=-s
GUINAME="pd-gui"
fi
if test `uname -s` = Darwin;
then
LDFLAGS="-Wl"
EXT=pd_darwin
MORECFLAGS="-DMACOSX -framework Tcl -framework Tk -I/usr/X11R6/include"
SYSSRC="s_mac.c s_portaudio.c s_pa_lib.c s_pa_trace.c \
s_pa_pablio.c s_pa_ringbuffer.c s_pa_mac_core.c -framework CoreAudio"
STRIPFLAG=""
GUINAME="pdtcl"
fi
AC_OUTPUT(makefile)
-------------- next part --------------
#
#
#
VPATH = ../obj:./
OBJ_DIR = ../obj
BIN_DIR = ../bin
PDEXEC = $(BIN_DIR)/pd
EXT= @EXT@
GUINAME= @GUINAME@
INSTALL_PREFIX = @prefix@
GFLAGS = -DINSTALL_PREFIX=\"$(INSTALL_PREFIX)\"
# ALSA compilation
SOUND_ALSA = @alsa@
# RME compilation
SOUND_RME = @rme@
DEFINES = @DEFINES@
MORECFLAGS = @MORECFLAGS@
INCLUDE = -I.
GINCLUDE = $(INCLUDE) @GUIFLAGS@
GLIB = @LIBS@
LDFLAGS = @LDFLAGS@
LIB = @PDLIB@
#select either the DBG and OPT compiler flags below:
OPT_CFLAGS = @OPT_CFLAGS@
WARN_CFLAGS = -Wall -W -Wstrict-prototypes -Werror \
-Wno-unused -Wno-parentheses -Wno-switch
ARCH_CFLAGS = -DPD -DUNIX
CFLAGS = $(ARCH_CFLAGS) $(WARN_CFLAGS) $(OPT_CFLAGS) $(DEFINES) $(MORECFLAGS)
# you might want ALSA linked in non-shared because
# many Linux machines don't have the ALSA shared library. To link
# ALSA non-shared, move the # sign below.
ifeq (${SOUND_ALSA},yes)
CFLAGS += -DALSA01
#LIB += /usr/lib/libasound.a
#LIB += -lasound
endif
ifeq (${SOUND_ALSA},old)
CFLAGS += -DALSA99
#LIB += /usr/lib/libasound.a
#LIB += -lasound
endif
ifeq (${SOUND_RME},yes)
CFLAGS += -DRME_HAMMERFALL
endif
# Which system
SYSTEM = $(shell uname -m)
ifeq (${SYSTEM},alpha)
#LIB += -lffm -lm
CFLAGS += -mieee -mcpu=ev56
endif
# Which compiler
ifeq (${CC},ccc)
CFLAGS += -g3 -D__COMPAQC__ -arch host
endif
# the sources
SYSSRC = @SYSSRC@
SRC = g_canvas.c g_graph.c g_text.c g_rtext.c g_array.c g_template.c g_io.c \
g_scalar.c g_traversal.c g_guiconnect.c \
g_7_guis.c \
m_pd.c m_class.c m_obj.c m_atom.c m_memory.c m_binbuf.c \
m_conf.c m_glob.c m_sched.c \
s_main.c s_inter.c s_unix.c s_file.c s_print.c \
s_loader.c s_path.c s_entry.c \
d_ugen.c d_ctl.c d_arithmetic.c d_osc.c d_filter.c d_dac.c d_misc.c \
d_math.c d_fft.c d_mayer_fft.c d_fftroutine.c d_array.c d_global.c \
d_delay.c d_resample.c \
x_arithmetic.c x_connective.c x_interface.c x_midi.c x_misc.c \
x_time.c x_acoustics.c x_net.c x_qlist.c x_gui.c d_soundfile.c\
$(SYSSRC)
OBJ = $(SRC:.c=.o)
EXTERNS = ../extra/*/*.$(EXT)
GSRC = t_main.c t_tkcmd.c
GOBJ = $(GSRC:.c=.o)
#
# ------------------ targets ------------------------------------
#
.PHONY: pd gui externs
all: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk externs
bin: $(PDEXEC) $(BIN_DIR)/pd-watchdog $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd.tk
$(OBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(INCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
$(GOBJ) : %.o : %.c
$(CC) $(CFLAGS) $(GFLAGS) $(GINCLUDE) -c -o $(OBJ_DIR)/$*.o $*.c
pd: $(PDEXEC)
gui: $(BIN_DIR)/$(GUINAME)
pd-watchdog: $(BIN_DIR)/pd-watchdog
$(BIN_DIR)/pd-watchdog: s_watchdog.c
cc -O2 $(STRIPFLAG) -o $(BIN_DIR)/pd-watchdog s_watchdog.c
$(BIN_DIR)/pdsend: u_pdsend.c
cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdsend u_pdsend.c
$(BIN_DIR)/pdreceive: u_pdreceive.c
cc $(CFLAGS) $(STRIPFLAG) -o $(BIN_DIR)/pdreceive u_pdreceive.c
$(PDEXEC): $(OBJ)
cd ../obj; $(CC) $(LDFLAGS) $(DBG_CFLAGS) -o $(PDEXEC) $(OBJ) \
$(LIB)
$(BIN_DIR)/$(GUINAME): $(GOBJ) $(GSRC)
cd ../obj; $(CC) $(INCLUDE) -o $(BIN_DIR)/$(GUINAME) $(GOBJ) \
$(GLIB)
$(BIN_DIR)/pd.tk: u_main.tk; cp u_main.tk $(BIN_DIR)/pd.tk
externs:
cd ../doc/6.externs;make $(EXT)
# cd ../doc/4.fft.examples;make $(EXT)
cd ../extra/bonk~;make
cd ../extra/choice;make
cd ../extra/expr~;make
cd ../extra/fiddle~;make
cd ../extra/loop~;make
cd ../extra/lrshift~;make
cd ../extra/paf~;make
cd ../extra/pique;make
install: install-bin install-indep
INSTDIR = $(DESTDIR)/$(INSTALL_PREFIX)
install-bin:
install -d $(INSTDIR)/lib/pd/bin
install $(BIN_DIR)/$(GUINAME) $(INSTDIR)/lib/pd/bin/$(GUINAME)
install $(BIN_DIR)/pd-watchdog $(INSTDIR)/lib/pd/bin/pd-watchdog
install -m644 $(BIN_DIR)/pd.tk $(INSTDIR)/lib/pd/bin/pd.tk
cp $(PDEXEC) $(INSTDIR)/bin/pd
install -m 755 $(BIN_DIR)/pdsend $(INSTDIR)/bin/pdsend
install -m 755 $(BIN_DIR)/pdreceive $(INSTDIR)/bin/pdreceive
install -d $(INSTDIR)/lib/pd/extra
install -d $(INSTDIR)/lib/pd/externs
cp $(EXTERNS) $(INSTDIR)/lib/pd/extra
install-indep:
install -d $(INSTDIR)/lib/pd/src
install -d $(INSTDIR)/include
install -m644 *.tk $(INSTDIR)/lib/pd/src
cp -r ../doc $(INSTDIR)/lib/pd/
install -m644 m_pd.h $(INSTDIR)/include/m_pd.h
local-clean:
-rm -f ../obj/* $(BIN_DIR)/pd $(BIN_DIR)/$(GUINAME) $(BIN_DIR)/pdsend \
$(BIN_DIR)/pdreceive $(BIN_DIR)/pd-watchdog m_stamp.c
-rm -f *~
-rm -f $(BIN_DIR)/pdsend $(BIN_DIR)/pdreceive
-(cd ../doc/6.externs; rm -f *.pd_linux)
-rm -f tags
-rm -f makefile.dependencies
touch makefile.dependencies
chmod 666 makefile.dependencies
extra-clean:
-rm -f `find ../extra/ -name "*.pd_*"`
clean: extra-clean local-clean
distclean: clean
-rm config.cache config.log config.status makefile tags
echo all: > makefile
echo -e "\t./configure" >> makefile
echo -e "\tmake" >> makefile
tags: $(SRC) $(GSRC); ctags *.[ch]
depend:
$(CC) $(INCLUDE) $(CFLAGS) -M $(SRC) > makefile.dependencies
include makefile.dependencies
More information about the Pd-list
mailing list