Permalink
Browse files

Preliminary autotools support

  • Loading branch information...
alexkay committed Feb 1, 2012
1 parent 3c10740 commit 9c8a52f752ff455f53bd8fb08e8e6fcf4d01589e
Showing with 2,366 additions and 118 deletions.
  1. +13 −1 .gitignore
  2. +10 −0 Makefile.am
  3. +118 −0 Makefile.include
  4. +34 −77 Mono.Upnp.sln
  5. +83 −0 autogen.sh
  6. +89 −0 configure.ac
  7. +50 −0 expansions.m4
  8. +13 −0 src/Mono.Ssdp/Mono.Ssdp/Makefile.am
  9. +16 −3 src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.csproj
  10. +101 −0 src/Mono.Ssdp/Mono.Ssdp/Mono.Ssdp.make
  11. +6 −0 src/Mono.Ssdp/Mono.Ssdp/mono.ssdp.pc.in
  12. +10 −0 src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Makefile.am
  13. +104 −0 src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Makefile.am
  14. +16 −3 ...diaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1.csproj
  15. +6 −0 ...ediaServer1/Mono.Upnp.Dcp.MSMediaReceiverRegistrar1/mono.upnp.dcp.msmediareceiverregistrar1.pc.in
  16. +136 −0 ...np.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/Makefile.am
  17. +10 −4 ....MediaServer1.FileSystem.ConsoleServer/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer.csproj
  18. +3 −0 ...MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server.in
  19. +126 −0 src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Makefile.am
  20. +18 −6 ...p.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/Mono.Upnp.Dcp.MediaServer1.FileSystem.csproj
  21. +6 −0 ...cp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem/mono.upnp.dcp.mediaserver1.filesystem.pc.in
  22. +124 −0 src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Makefile.am
  23. +24 −0 ...Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/Mono.Upnp.Dcp.MediaServer1.GtkClient.csproj
  24. +6 −0 ....Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.GtkClient/mono.upnp.dcp.mediaserver1.gtkclient.pc.in
  25. +211 −0 src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Makefile.am
  26. +17 −6 ....Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.csproj
  27. +6 −0 ...o.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1/mono.upnp.dcp.mediaserver1.pc.in
  28. +10 −0 src/Mono.Upnp/Makefile.am
  29. +144 −0 src/Mono.Upnp/Mono.Upnp.GtkClient/Makefile.am
  30. +12 −9 src/Mono.Upnp/Mono.Upnp.GtkClient/Mono.Upnp.GtkClient.csproj
  31. +3 −0 src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk.in
  32. +188 −0 src/Mono.Upnp/Mono.Upnp/Makefile.am
  33. +17 −6 src/Mono.Upnp/Mono.Upnp/Mono.Upnp.csproj
  34. +6 −0 src/Mono.Upnp/Mono.Upnp/mono.upnp.pc.in
  35. +10 −0 tests/Makefile.am
  36. +87 −0 tests/Mono.Ssdp.Tests/Makefile.am
  37. +9 −0 tests/Mono.Ssdp.Tests/Mono.Ssdp.Tests.csproj
  38. +86 −0 tests/Mono.Ssdp.Tests/Mono.Ssdp.Tests.make
  39. +132 −0 tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Makefile.am
  40. +21 −3 tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests.csproj
  41. +6 −0 tests/Mono.Upnp.Dcp.MediaServer1.FileSystem.Tests/mono.upnp.dcp.mediaserver1.filesystem.tests.pc.in
  42. +125 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/Makefile.am
  43. +18 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/Mono.Upnp.Dcp.MediaServer1.Tests.csproj
  44. +6 −0 tests/Mono.Upnp.Dcp.MediaServer1.Tests/mono.upnp.dcp.mediaserver1.tests.pc.in
  45. +118 −0 tests/Mono.Upnp.Tests/Makefile.am
  46. +12 −0 tests/Mono.Upnp.Tests/Mono.Upnp.Tests.csproj
View
@@ -1,10 +1,22 @@
*.dll
*.exe
*.mdb
+*.pc
*.pidb
*.userprefs
*.usertasks
.DS_Store
+Makefile
+Makefile.in
+TestResult.xml
+aclocal.m4
+autom4te.cache/
+config.log
+config.status
+configure
+install-sh
+missing
obj
+src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1/Mono.Upnp.Dcp.MediaServer1.FileSystem.ConsoleServer/mono-upnp-simple-media-server
+src/Mono.Upnp/Mono.Upnp.GtkClient/mono-upnp-gtk
test-results/
-TestResult.xml
View
@@ -0,0 +1,10 @@
+
+EXTRA_DIST = expansions.m4
+
+#Warning: This is an automatically generated file, do not edit!
+if ENABLE_DEBUG
+ SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests
+endif
+if ENABLE_RELEASE
+ SUBDIRS = src/Mono.Ssdp/Mono.Ssdp src/Mono.Upnp src/Mono.Upnp.Dcp/Mono.Upnp.Dcp.MediaServer1 tests
+endif
View
@@ -0,0 +1,118 @@
+VALID_CULTURES = ar bg ca zh-CHS cs da de el en es fi fr he hu is it ja ko nl no pl pt ro ru hr sk sq sv th tr id uk be sl et lv lt fa vi hy eu mk af ka fo hi sw gu ta te kn mr gl kok ar-SA bg-BG ca-ES zh-TW cs-CZ da-DK de-DE el-GR en-US fi-FI fr-FR he-IL hu-HU is-IS it-IT ja-JP ko-KR nl-NL nb-NO pl-PL pt-BR ro-RO ru-RU hr-HR sk-SK sq-AL sv-SE th-TH tr-TR id-ID uk-UA be-BY sl-SI et-EE lv-LV lt-LT fa-IR vi-VN hy-AM eu-ES mk-MK af-ZA ka-GE fo-FO hi-IN sw-KE gu-IN ta-IN te-IN kn-IN mr-IN gl-ES kok-IN ar-IQ zh-CN de-CH en-GB es-MX fr-BE it-CH nl-BE nn-NO pt-PT sv-FI ar-EG zh-HK de-AT en-AU es-ES fr-CA ar-LY zh-SG de-LU en-CA es-GT fr-CH ar-DZ zh-MO en-NZ es-CR fr-LU ar-MA en-IE es-PA ar-TN en-ZA es-DO ar-OM es-VE ar-YE es-CO ar-SY es-PE ar-JO en-TT es-AR ar-LB en-ZW es-EC ar-KW en-PH es-CL ar-AE es-UY ar-BH es-PY ar-QA es-BO es-SV es-HN es-NI es-PR zh-CHT
+
+s2q=$(subst \ ,?,$1)
+q2s=$(subst ?,\ ,$1)
+# use this when result will be quoted
+unesc2=$(subst ?, ,$1)
+
+build_sources = $(FILES) $(GENERATED_FILES)
+build_sources_esc= $(call s2q,$(build_sources))
+# use unesc2, as build_sources_embed is quoted
+build_sources_embed= $(call unesc2,$(build_sources_esc:%='$(srcdir)/%'))
+
+comma__=,
+get_resource_name = $(firstword $(subst $(comma__), ,$1))
+get_culture = $(lastword $(subst ., ,$(basename $1)))
+is_cultured_resource = $(and $(word 3,$(subst ., ,$1)), $(filter $(VALID_CULTURES),$(lastword $(subst ., ,$(basename $1)))))
+
+RESOURCES_ESC=$(call s2q,$(RESOURCES))
+
+build_resx_list = $(foreach res, $(RESOURCES_ESC), $(if $(filter %.resx, $(call get_resource_name,$(res))),$(res),))
+build_non_culture_resx_list = $(foreach res, $(build_resx_list),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
+build_non_culture_others_list = $(foreach res, $(filter-out $(build_resx_list),$(RESOURCES_ESC)),$(if $(call is_cultured_resource,$(call get_resource_name,$(res))),,$(res)))
+build_others_list = $(build_non_culture_others_list)
+build_xamlg_list = $(filter %.xaml.g.cs, $(FILES))
+
+# resgen all .resx resources
+build_resx_files = $(foreach res, $(build_resx_list), $(call get_resource_name,$(res)))
+build_resx_resources_esc = $(build_resx_files:.resx=.resources)
+build_resx_resources = $(call q2s,$(build_resx_resources_esc))
+
+# embed resources for the main assembly
+build_resx_resources_hack = $(subst .resx,.resources, $(build_non_culture_resx_list))
+# use unesc2, as build_resx_resources_embed is quoted
+build_resx_resources_embed = $(call unesc2,$(build_resx_resources_hack:%='-resource:%'))
+build_others_files = $(call q2s,$(foreach res, $(build_others_list),$(call get_resource_name,$(res))))
+build_others_resources = $(build_others_files)
+# use unesc2, as build_others_resources_embed is quoted
+build_others_resources_embed = $(call unesc2,$(build_others_list:%='-resource:$(srcdir)/%'))
+
+build_resources = $(build_resx_resources) $(build_others_resources)
+build_resources_embed = $(build_resx_resources_embed) $(build_others_resources_embed)
+
+# -usesourcepath is available only for resgen2
+emit_resgen_target_1=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); cd '$$(shell dirname '$$<')' && MONO_IOMAP=drive $$(RESGEN) '$$(shell basename '$$<')' '$$(shell basename '$$@')'
+emit_resgen_target_2=$(call q2s,$1) : $(call q2s,$(subst .resources,.resx,$1)); MONO_IOMAP=drive $$(RESGEN) -usesourcepath '$$<' '$$@'
+
+emit_resgen_target=$(if $(filter resgen2,$(RESGEN)),$(emit_resgen_target_2),$(emit_resgen_target_1))
+emit_resgen_targets=$(foreach res,$(build_resx_resources_esc),$(eval $(call emit_resgen_target,$(res))))
+
+build_references_ref = $(call q2s,$(foreach ref, $(call s2q,$(REFERENCES)), $(if $(filter -pkg:%, $(ref)), $(ref), $(if $(filter -r:%, $(ref)), $(ref), -r:$(ref)))))
+build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(DLL_REFERENCES)), -r:$(ref)))
+build_references_ref += $(call q2s,$(foreach ref, $(call s2q,$(PROJECT_REFERENCES)), -r:$(ref)))
+
+s2q2s=$(call unesc2,$(call s2q,$1))
+cp_actual=test -z $1 || cp $1 $2
+cp=$(call cp_actual,'$(call s2q2s,$1)','$(call s2q2s,$2)')
+
+rm_actual=test -z '$1' || rm -f '$2'
+rm=$(call rm_actual,$(call s2q2s,$1),$(call s2q2s,$2)/$(shell basename '$(call s2q2s,$1)'))
+
+EXTRA_DIST += $(build_sources) $(build_resx_files) $(build_others_files) $(ASSEMBLY_WRAPPER_IN) $(EXTRAS) $(DATA_FILES) $(build_culture_res_files)
+CLEANFILES += $(ASSEMBLY) $(ASSEMBLY).mdb $(BINARIES) $(build_resx_resources) $(build_satellite_assembly_list)
+DISTCLEANFILES = $(GENERATED_FILES) $(pc_files) $(BUILD_DIR)/*
+
+pkglib_SCRIPTS = $(ASSEMBLY)
+bin_SCRIPTS = $(BINARIES)
+
+programfilesdir = @libdir@/@PACKAGE@
+programfiles_DATA = $(PROGRAMFILES)
+linuxpkgconfigdir = @libdir@/pkgconfig
+linuxpkgconfig_DATA = $(LINUX_PKGCONFIG)
+
+
+# macros
+
+# $(call emit-deploy-target,deploy-variable-name)
+define emit-deploy-target
+$($1): $($1_SOURCE)
+ mkdir -p '$$(shell dirname '$$@')'
+ cp '$$<' '$$@'
+endef
+
+# $(call emit-deploy-wrapper,wrapper-variable-name,wrapper-sourcefile,x)
+# assumes that for a wrapper foo.pc its source template is foo.pc.in
+# if $3 is non-empty then wrapper is marked exec
+define emit-deploy-wrapper
+$($1): $2
+ mkdir -p '$$(shell dirname '$$@')'
+ cp '$$<' '$$@'
+ $(if $3,chmod +x '$$@')
+
+endef
+
+# generating satellite assemblies
+
+culture_resources = $(foreach res, $(RESOURCES_ESC), $(if $(call is_cultured_resource,$(call get_resource_name, $(res))),$(res)))
+cultures = $(sort $(foreach res, $(culture_resources), $(call get_culture,$(call get_resource_name,$(res)))))
+culture_resource_dependencies = $(call q2s,$(BUILD_DIR)/$1/$(SATELLITE_ASSEMBLY_NAME): $(subst .resx,.resources,$2))
+culture_resource_commandlines = $(call unesc2,cmd_line_satellite_$1 += '/embed:$(subst .resx,.resources,$2)')
+build_satellite_assembly_list = $(call q2s,$(cultures:%=$(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME)))
+build_culture_res_files = $(call q2s,$(foreach res, $(culture_resources),$(call get_resource_name,$(res))))
+install_satellite_assembly_list = $(subst $(BUILD_DIR),$(DESTDIR)$(libdir)/$(PACKAGE),$(build_satellite_assembly_list))
+
+$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_dependencies,$(call get_culture,$(call get_resource_name,$(res))),$(call get_resource_name,$(res))))))
+$(eval $(foreach res, $(culture_resources), $(eval $(call culture_resource_commandlines,$(call get_culture,$(call get_resource_name,$(res))),$(res)))))
+
+$(build_satellite_assembly_list): $(BUILD_DIR)/%/$(SATELLITE_ASSEMBLY_NAME):
+ mkdir -p '$(@D)'
+ $(AL) -out:'$@' -culture:$* -t:lib $(cmd_line_satellite_$*)
+
+$(install_satellite_assembly_list):
+ mkdir -p '$(@D)'
+ cp $(subst $(DESTDIR)$(libdir)/$(PACKAGE), $(BUILD_DIR), $@) $@
+
+install-satellite-assemblies: $(install_satellite_assembly_list)
+
+uninstall-satellite-assemblies:
+ rm -rf $(install_satellite_assembly_list)
Oops, something went wrong.

0 comments on commit 9c8a52f

Please sign in to comment.