From: <aw...@us...> - 2012-11-18 22:47:03
|
Revision: 12983 http://openmsx.svn.sourceforge.net/openmsx/?rev=12983&view=rev Author: awulms Date: 2012-11-18 22:46:56 +0000 (Sun, 18 Nov 2012) Log Message: ----------- Support build of shared library (preparation for Android port) Modified Paths: -------------- openmsx/trunk/build/main.mk openmsx/trunk/build/platform-darwin.mk openmsx/trunk/build/platform-dingux.mk openmsx/trunk/build/platform-freebsd.mk openmsx/trunk/build/platform-linux.mk openmsx/trunk/build/platform-mingw32.mk openmsx/trunk/build/platform-nacl.mk openmsx/trunk/build/platform-netbsd.mk openmsx/trunk/build/platform-openbsd.mk openmsx/trunk/build/platform-solaris.mk Modified: openmsx/trunk/build/main.mk =================================================================== --- openmsx/trunk/build/main.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/main.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -173,6 +173,8 @@ $(call DEFCHECK,OPENMSX_TARGET_OS) include build/platform-$(OPENMSX_TARGET_OS).mk # Check that all expected variables were defined by OS specific Makefile: +# - library file name extension +$(call DEFCHECK,LIBRARYEXT) # - executable file name extension $(call DEFCHECK,EXEEXT) # - platform supports symlinks? @@ -223,6 +225,10 @@ BINARY_FULL:=$(BINARY_PATH)/$(BINARY_FILE) endif +LIBRARY_FILE:=openmsx$(LIBRARYEXT) +LIBRARY_PATH:=$(BUILD_PATH)/lib +LIBRARY_FULL:=$(LIBRARY_PATH)/$(LIBRARY_FILE) + BUILDINFO_SCRIPT:=build/buildinfo2code.py CONFIG_HEADER:=$(BUILD_PATH)/config/build-info.hh PROBE_SCRIPT:=build/probe.py @@ -483,8 +489,12 @@ ifeq ($(OPENMSX_TARGET_OS),darwin) all: app else +ifeq ($(OPENMSX_TARGET_OS),android) +all: $(LIBRARY_FULL) +else all: $(BINARY_FULL) endif +endif # This is a workaround for the lack of order-only dependencies in GNU Make # versions older than 3.80 (for example Mac OS X 10.3 still ships with 3.79). @@ -605,6 +615,11 @@ endif # subset endif # universal binary +$(LIBRARY_FULL): $(OBJECTS_FULL) $(RESOURCE_OBJ) + @echo "Linking $(notdir $@)..." + @mkdir -p $(@D) + @$(LINK_ENV) $(CXX) -o $@ $(CXXFLAGS) $^ $(LINK_FLAGS) + # Run executable. run: all @echo "Running $(notdir $(BINARY_FULL))..." Modified: openmsx/trunk/build/platform-darwin.mk =================================================================== --- openmsx/trunk/build/platform-darwin.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-darwin.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -20,6 +20,7 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so # Select the OS X version we want to be compatible with. # TODO: When compiling an executable for local use, we could pick the OS X Modified: openmsx/trunk/build/platform-dingux.mk =================================================================== --- openmsx/trunk/build/platform-dingux.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-dingux.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -18,6 +18,7 @@ # Allow GMenu to identify our binary as an executable. # Since the file system is FAT this cannot be done with a permission flag. EXEEXT:=.dge +LIBRARYEXT:=.so # Build a minimal set of components. LINK_MODE:=3RD_STA_MIN Modified: openmsx/trunk/build/platform-freebsd.mk =================================================================== --- openmsx/trunk/build/platform-freebsd.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-freebsd.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,5 +7,6 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so COMPILE_FLAGS+=-D_REENTRANT -D_THREAD_SAFE Modified: openmsx/trunk/build/platform-linux.mk =================================================================== --- openmsx/trunk/build/platform-linux.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-linux.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,6 +7,7 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so # In glibc the function clock_gettime() is defined in the librt library. In # uClibc it's defined in libc itself. We should write a function that actually Modified: openmsx/trunk/build/platform-mingw32.mk =================================================================== --- openmsx/trunk/build/platform-mingw32.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-mingw32.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,6 +7,7 @@ # File name extension of executables. EXEEXT:=.exe +LIBRARYEXT:=.dll # Compiler flags. COMPILE_FLAGS+= \ Modified: openmsx/trunk/build/platform-nacl.mk =================================================================== --- openmsx/trunk/build/platform-nacl.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-nacl.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -15,6 +15,7 @@ # File name extension of executables. EXEEXT:=.nexe +LIBRARYEXT:=.so # Build a minimal set of components. LINK_MODE:=3RD_STA_MIN Modified: openmsx/trunk/build/platform-netbsd.mk =================================================================== --- openmsx/trunk/build/platform-netbsd.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-netbsd.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,5 +7,6 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so COMPILE_FLAGS+=-D_REENTRANT -D_THREAD_SAFE Modified: openmsx/trunk/build/platform-openbsd.mk =================================================================== --- openmsx/trunk/build/platform-openbsd.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-openbsd.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,3 +7,5 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so + Modified: openmsx/trunk/build/platform-solaris.mk =================================================================== --- openmsx/trunk/build/platform-solaris.mk 2012-11-18 20:28:03 UTC (rev 12982) +++ openmsx/trunk/build/platform-solaris.mk 2012-11-18 22:46:56 UTC (rev 12983) @@ -7,3 +7,5 @@ # File name extension of executables. EXEEXT:= +LIBRARYEXT:=.so + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |