1 #*************************************************************************
3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 # Copyright 2008 by Sun Microsystems, Inc.
7 # OpenOffice.org - a multi-platform office productivity suite
9 # $RCSfile: makefile.mk,v $
13 # This file is part of OpenOffice.org.
15 # OpenOffice.org is free software: you can redistribute it and/or modify
16 # it under the terms of the GNU Lesser General Public License version 3
17 # only, as published by the Free Software Foundation.
19 # OpenOffice.org is distributed in the hope that it will be useful,
20 # but WITHOUT ANY WARRANTY; without even the implied warranty of
21 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 # GNU Lesser General Public License version 3 for more details
23 # (a copy is included in the LICENSE file that accompanied this code).
25 # You should have received a copy of the GNU Lesser General Public License
26 # version 3 along with OpenOffice.org. If not, see
27 # <http://www.openoffice.org/license.html>
28 # for a copy of the LGPLv3 License.
30 #*************************************************************************
37 # --- Settings -----------------------------------------------------
39 .INCLUDE
: settings.mk
40 .INCLUDE
: pyversion.mk
42 .IF
"$(SYSTEM_PYTHON)" == "YES"
44 @echo
"An already available installation of python should exist on your system."
45 @echo
"Therefore the version provided here does not need to be built in addition."
49 # --- Files --------------------------------------------------------
52 TARFILE_NAME
=Python-
$(PYVERSION
)
53 PATCH_FILES
=Python-
$(PYVERSION
).patch
59 MYCWD
=$(shell @pwd
)/$(INPATH
)/misc
/build
61 # CLFLAGS get overwritten in Makefile.pre.in
63 CC
+:=-I
$(SYSBASE
)$/usr
$/include
64 python_LDFLAGS
+=-L
$(SYSBASE
)/usr
/lib
65 .IF
"$(COMNAME)"=="sunpro5"
66 CC
+:=$(C_RESTRICTIONFLAGS
)
67 .ENDIF
# "$(COMNAME)"=="sunpro5"
68 .ENDIF
# "$(SYSBASE)"!=""
70 .IF
"$(OS)$(COM)"=="LINUXGCC"
71 python_LDFLAGS
+=-Wl
,-z
,noexecstack
74 .IF
"$(OS)$(CPU)"=="SOLARISU"
76 python_LDFLAGS
+=$(ARCH_FLAGS
)
79 CONFIGURE_ACTION
=$(AUGMENT_LIBRARY_PATH
) .
/configure
--prefix=$(MYCWD
)/python-inst
--enable-shared CFLAGS
="$(python_CFLAGS)" LDFLAGS
="$(python_LDFLAGS)"
80 .IF
"$(OS)$(CPU)" == "SOLARISI"
81 CONFIGURE_ACTION
+= --disable-ipv6
84 BUILD_ACTION
=$(ENV_BUILD
) gmake
-j
$(EXTMAXPROCESS
) ; gmake
install
86 BUILD_ACTION
=$(ENV_BUILD
) $(GNUMAKE
) -j
$(EXTMAXPROCESS
) ; $(GNUMAKE
) install ; chmod
-R ug
+w
$(MYCWD
)/python-inst
89 # ----------------------------------
91 # ----------------------------------
93 PATCH_FILES
=Python-
$(PYVERSION
)-mingw.patch
95 MYCWD
=$(shell cygpath
-m
$(shell @pwd
))/$(INPATH
)/misc
/build
96 python_CFLAGS
=-mno-cygwin
-mthreads
97 python_LDFLAGS
=-mno-cygwin
-mthreads
98 .IF
"$(MINGW_SHARED_GCCLIB)"=="YES"
99 python_LDFLAGS
+=-shared-libgcc
101 CONFIGURE_ACTION
=.
/configure
--prefix=$(MYCWD
)/python-inst
--enable-shared CC
="$(CC:s/guw.exe //)" CXX
="$(CXX:s/guw.exe //)" MACHDEP
=MINGW32 LN
="cp -p" CFLAGS
="$(python_CFLAGS)" LDFLAGS
="$(python_LDFLAGS)"
102 BUILD_ACTION
=$(ENV_BUILD
) make
; make
install
105 #.EXPORT : PYTHONPATH
107 #.IF "$(CCNUMVER)" <= "001400000000"
110 #.IF "$(WINDOWS_VISTA_PSDK)"!=""
111 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
112 #ADDITIONALLIBS=ws2_32.lib
113 #.ELSE #"$(WINDOWS_VISTA_PSDK)"!=""
114 #EXFLAGS="/EHa /Zc:wchar_t- /D "_CRT_SECURE_NO_DEPRECATE""
115 #.ENDIF #"$(WINDOWS_VISTA_PSDK)"!=""
120 # Build python executable and then runs a minimal script. Running the minimal script
121 # ensures that certain *.pyc files are generated which would otherwise be created on
122 # solver during registration in insetoo_native
123 .IF
"$(SYSBASE)" != ""
124 BUILD_ACTION
=$(COMPATH
)$/vcpackages
$/vcbuild.exe
-useenv pcbuild.sln
"Release|Win32"
126 BUILD_ACTION
=$(COMPATH
)$/vcpackages
$/vcbuild.exe pcbuild.sln
"Release|Win32"
127 .ENDIF
# "$(SYSBASE)" != ""
131 PYVERSIONFILE
=$(MISC
)$/pyversion.mk
133 # --- Targets ------------------------------------------------------
136 .INCLUDE
: set_ext.mk
140 .IF
"$(L10N_framework)"==""
141 .IF
"$(GUI)" != "UNX"
143 PYCONFIG
:=$(MISC
)$/build
$/pyconfig.h
144 $(MISC
)$/build
$/$(TARFILE_NAME
)$/PC
$/pyconfig.h
: $(PACKAGE_DIR
)$/$(CONFIGURE_FLAG_FILE
)
146 $(PACKAGE_DIR
)$/$(BUILD_FLAG_FILE
) : $(PYCONFIG
)
148 $(PYCONFIG
) : $(MISC
)$/build
$/$(TARFILE_NAME
)$/PC
$/pyconfig.h
150 cat
$(MISC
)$/build
$/$(TARFILE_NAME
)$/PC
$/pyconfig.h
> $@
154 ALLTAR
: $(PYVERSIONFILE
)
155 .ENDIF
# "$(L10N_framework)"==""
158 $(PYVERSIONFILE
) : pyversion.mk
$(PACKAGE_DIR
)$/$(PREDELIVER_FLAG_FILE
)