[asterisk-commits] rizzo: branch rizzo/cygwin_build r88468 - in /team/rizzo/cygwin_build: ./ main/

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Nov 4 15:23:49 CST 2007


Author: rizzo
Date: Sun Nov  4 15:23:49 2007
New Revision: 88468

URL: http://svn.digium.com/view/asterisk?view=rev&rev=88468
Log:
more experiments with linking under windows

Modified:
    team/rizzo/cygwin_build/Makefile
    team/rizzo/cygwin_build/main/Makefile

Modified: team/rizzo/cygwin_build/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/cygwin_build/Makefile?view=diff&rev=88468&r1=88467&r2=88468
==============================================================================
--- team/rizzo/cygwin_build/Makefile (original)
+++ team/rizzo/cygwin_build/Makefile Sun Nov  4 15:23:49 2007
@@ -259,9 +259,11 @@
 
 ASTCFLAGS+=$(MALLOC_DEBUG)$(BUSYDETECT)$(OPTIONS)
 
-MOD_SUBDIRS:=res channels pbx apps codecs formats cdr funcs main
+MOD_SUBDIRS:=channels pbx apps codecs formats cdr funcs
 OTHER_SUBDIRS:=utils agi
 SUBDIRS:=$(OTHER_SUBDIRS) $(MOD_SUBDIRS)
+# in cygwin we need to build main (i.e. asterisk.dll) first, then res
+SUBDIRS+=main res
 SUBDIRS_INSTALL:=$(SUBDIRS:%=%-install)
 SUBDIRS_CLEAN:=$(SUBDIRS:%=%-clean)
 SUBDIRS_DIST_CLEAN:=$(SUBDIRS:%=%-dist-clean)
@@ -343,9 +345,15 @@
 # a parallel build, since if there are modules selected to be embedded the
 # directories containing them must be completed before the main Asterisk
 # binary can be built
-main: $(filter-out main,$(MOD_SUBDIRS))
-
-$(MOD_SUBDIRS):
+# XXX in cygwin, main must be built first because it generates the dll
+# then comes the res_ and then other subdirs
+main:
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
+
+res: main
+	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
+
+$(MOD_SUBDIRS): main
 	@ASTCFLAGS="$(MOD_SUBDIR_CFLAGS) $(ASTCFLAGS)" ASTLDFLAGS="$(ASTLDFLAGS)" AST_LIBS="$(AST_LIBS)" $(MAKE) --no-print-directory --no-builtin-rules -C $@ SUBDIR=$@ all
 
 $(OTHER_SUBDIRS):

Modified: team/rizzo/cygwin_build/main/Makefile
URL: http://svn.digium.com/view/asterisk/team/rizzo/cygwin_build/main/Makefile?view=diff&rev=88468&r1=88467&r2=88468
==============================================================================
--- team/rizzo/cygwin_build/main/Makefile (original)
+++ team/rizzo/cygwin_build/main/Makefile Sun Nov  4 15:23:49 2007
@@ -75,7 +75,9 @@
 else
 # These are used for all but Darwin
   ifneq ($(findstring LOADABLE_MODULES,$(MENUSELECT_CFLAGS)),)
-    ASTLINK+=-Wl,--export-dynamic
+    ifneq ($(OSARCH),cygwin)
+      ASTLINK+=-Wl,--export-dynamic
+    endif
   else
     ASTLINK+=${GC_LDFLAGS}
   endif
@@ -89,7 +91,8 @@
 endif
 
 ifeq ($(OSARCH),cygwin)
-  AST_LIBS+=-lminires
+  AST_LIBS+=-lminires -ldl
+  ASTLINK+= -shared -Wl,--out-implib,asterisk.dll
 endif
 
 ifeq ($(OSARCH),NetBSD)
@@ -145,7 +148,13 @@
 minimime/libmmime.a: CHECK_SUBDIR
 	@cd minimime && $(MAKE) libmmime.a
 
-asterisk: $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS)
+# XXX this could be done better...
+asterisk: cygload
+	mv cygload.exe asterisk.exe
+
+cygload: asterisk.dll
+
+asterisk.dll: $(OBJS) editline/libedit.a db1-ast/libdb1.a minimime/libmmime.a $(AST_EMBED_LDSCRIPTS)
 	@$(CC) -c -o buildinfo.o $(ASTCFLAGS) buildinfo.c
 	$(ECHO_PREFIX) echo "   [LD] $^ -> $@"
 ifneq ($(findstring chan_h323,$(MENUSELECT_CHANNELS)),)




More information about the asterisk-commits mailing list