Commit 87098f0e authored by Christophe Massiot's avatar Christophe Massiot

* Wrote support for .c files compilation and fixed OS X port (thanks nitrox

for your three lines of code :p).
* Couldn't find a way to have C++ plug-ins on Darwin, though.
parent 88355854
......@@ -48,6 +48,10 @@ N: Tristan Leteurtre
E: tooney@videolan.org
D: doc, dvb
N: Christophe Massiot
E: massiot@via.ecp.fr
D: portability fixes (*BSD, Darwin, Solaris)
N: Jean-Paul Saman
E: jpsaman@wxs.nl
D: Dynamic configuration
......
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) main Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile,v 1.100 2002/12/03 22:33:14 nitrox Exp $
# $Id: Makefile,v 1.101 2002/12/08 14:50:43 massiot Exp $
################################################################################
......@@ -85,7 +85,7 @@ SRC+= src/mpeg/dvbpsi.cpp \
endif
ifeq ($(NEEDSRC_getopt),1)
SRC+= src/extras/getopt.c \
C_SRC+= src/extras/getopt.c \
src/extras/getopt1.c \
endif
......@@ -113,12 +113,14 @@ PLUGINSTARGETS:=$(PLUGINS:%:bin/%.so)
# Object files
#
OBJ:=$(SRC:src/%.cpp=obj/%.o)
C_OBJ:=$(C_SRC:src/%.c=obj/%.o)
#
# Dependencies
#
DEP:=$(SRC:src/%.cpp=dep/%.d)
DEP:=$(SRC:src/%.cpp=dep/%.dpp)
C_DEP:=$(C_SRC:src/%.c=dep/%.d)
#
......@@ -187,10 +189,10 @@ lexer:
dep: Makefile.opts $(DEP)
vls: Makefile.opts $(OBJ) $(BUILTINS)
vls: Makefile.opts $(OBJ) $(C_OBJ) $(BUILTINS)
@echo "Linking $@..."
@test -d bin || mkdir -p bin
$(CXX) $(LCFLAGS) -o bin/$@ $(OBJ) $(BUILTINS:%=obj/%.a) $(VLS_LIB)
$(CXX) $(LCFLAGS) -o bin/$@ $(OBJ) $(C_OBJ) $(BUILTINS:%=obj/%.a) $(VLS_LIB)
@test -f bin/vlsd || ln -s $@ bin/$@d
chmod 755 bin/$@
......@@ -224,14 +226,25 @@ $(BUILTINS): %: src/modules/%/Makefile
cd src/modules/$* && $(MAKE) ../../../obj/$*.a
$(OBJ): obj/%.o: Makefile.opts
$(OBJ): obj/%.o: dep/%.d
$(OBJ): obj/%.o: dep/%.dpp
$(OBJ): obj/%.o: src/%.cpp
@test -d obj/$(dir $*) || mkdir -p obj/$(dir $*)
@echo "Compiling $<..."
$(CXX) $(CCFLAGS) $(INCLUDE) -o $@ -c $<
$(C_OBJ): obj/%.o: Makefile.opts
$(C_OBJ): obj/%.o: dep/%.d
$(C_OBJ): obj/%.o: src/%.c
@test -d obj/$(dir $*) || mkdir -p obj/$(dir $*)
@echo "Compiling $<..."
$(CC) $(CCFLAGS) $(INCLUDE) -o $@ -c $<
$(DEP): Makefile.opts Makefile FORCE
$(DEP): dep/%.d: src/%.cpp
$(DEP): dep/%.dpp: src/%.cpp
@$(MAKE) -s --no-print-directory -f Makefile.dep $@
$(C_DEP): Makefile.opts Makefile FORCE
$(C_DEP): dep/%.d: src/%.c
@$(MAKE) -s --no-print-directory -f Makefile.dep $@
FORCE:
......
......@@ -2,7 +2,7 @@
# vls (VideoLAN Server) dependencies Makefile
#-------------------------------------------------------------------------------
# (c)1999-2001 VideoLAN
# $Id: Makefile.dep,v 1.2 2001/10/22 12:41:28 bozo Exp $
# $Id: Makefile.dep,v 1.3 2002/12/08 14:50:43 massiot Exp $
################################################################################
......@@ -46,7 +46,7 @@ default:
-include $(MAKECMDGOALS)
$(DEP): dep/%.d: src/%.cpp
$(DEP): dep/%.dpp: src/%.cpp
@test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
@echo "Generating dependancies for $<..."
@$(SHELL) -ec '$(CXX) $(DCFLAGS) $(INCLUDE) $< \
......@@ -54,3 +54,11 @@ $(DEP): dep/%.d: src/%.cpp
dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
$(C_DEP): dep/%.d: src/%.c
@test -d dep/$(dir $*) || mkdir -p dep/$(dir $*)
@echo "Generating dependancies for $<..."
@$(SHELL) -ec '$(CC) $(DCFLAGS) $(INCLUDE) $< \
| sed '\''s/$(subst .,\.,$(notdir $*))\.o[ :]*/src\/$(subst /,\/,$*).o \
dep\/$(subst /,\/,$*).d : /g'\'' > $@; \
[ -s $@ ] || rm -f $@'
......@@ -33,6 +33,7 @@ NEEDSRC_server = @NEEDSRC_server@
NEEDSRC_daemon = @NEEDSRC_daemon@
NEEDSRC_mpegbase = @NEEDSRC_mpegbase@
NEEDSRC_mpegmux = @NEEDSRC_mpegmux@
NEEDSRC_getopt = @NEEDSRC_getopt@
#
......
This diff is collapsed.
......@@ -14,6 +14,7 @@ NEEDSRC_server=1
NEEDSRC_daemon=1
NEEDSRC_mpegbase=1
NEEDSRC_mpegmux=1
NEEDSRC_getopt=0
dnl Save CXXFLAGS and LDFLAGS
......@@ -133,6 +134,9 @@ AC_CHECK_FUNC(getopt_long,[AC_DEFINE(HAVE_GETOPT_LONG,1,long getopt support)],
AC_CHECK_LIB([gnugetopt],[getopt_long],
[AC_DEFINE(HAVE_GETOPT_LONG,1,getopt support) VLS_LIB="${VLS_LIB} -lgnugetopt"],
[need_getopt=:])])
if test x"$need_getopt" = x":"; then
NEEDSRC_getopt=1
fi
dnl Check for socklen_t
......@@ -183,6 +187,15 @@ if test x"$ac_cv_ld_plugins" != x"no"; then
MODULE_LCFLAGS="${MODULE_LCFLAGS} -shared"
fi
dnl Check for Darwin plugin linking flags
AC_CACHE_CHECK([if \$CXX accepts -bundle -undefined error -lcc_dynamic],
[ac_cv_ld_darwin],
[CXXFLAGS="${CXXFLAGS_save} -bundle -undefined error -lcc_dynamic"
AC_TRY_COMPILE([],,ac_cv_ld_darwin=yes, ac_cv_ld_darwin=no)])
if test "x${ac_cv_ld_darwin}" != "xno"; then
MODULE_LCFLAGS="${MODULE_LCFLAGS} -bundle -undefined error -lcc_dynamic"
fi
AC_CACHE_CHECK([if \$CXX accepts -rdynamic],
[ac_cv_ld_rdynamic],
[CXXFLAGS="${save_CXXFLAGS} -rdynamic"
......@@ -437,6 +450,7 @@ AC_SUBST(NEEDSRC_server)
AC_SUBST(NEEDSRC_daemon)
AC_SUBST(NEEDSRC_mpegbase)
AC_SUBST(NEEDSRC_mpegmux)
AC_SUBST(NEEDSRC_getopt)
AC_SUBST(BUILTINS)
AC_SUBST(PLUGINS)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment