diff options
Diffstat (limited to 'winsup/cygwin/Makefile.in')
-rw-r--r-- | winsup/cygwin/Makefile.in | 48 |
1 files changed, 31 insertions, 17 deletions
diff --git a/winsup/cygwin/Makefile.in b/winsup/cygwin/Makefile.in index 56c910a69..0c387e717 100644 --- a/winsup/cygwin/Makefile.in +++ b/winsup/cygwin/Makefile.in @@ -31,6 +31,7 @@ export CCWRAP_DIRAFTER_HEADERS:=@windows_headers@ VPATH+=$(CONFIG_DIR) $(srcdir)/regex $(srcdir)/lib $(srcdir)/libc +target_cpu:=@target_cpu@ target_alias:=@target_alias@ build_alias:=@build_alias@ host_alias:=@host_alias@ @@ -76,6 +77,9 @@ MT_SAFE:=@MT_SAFE@ DEFS:=@DEFS@ CCEXTRA= COMMON_CFLAGS=-MMD ${$(*F)_CFLAGS} -Werror -fmerge-constants -ftracer $(CCEXTRA) +ifeq ($(target_cpu),x86_64) +COMMON_CFLAGS+=-mcmodel=small +endif COMPILE.cc+=${COMMON_CFLAGS} -mno-use-libstdc-wrappers COMPILE.c+=${COMMON_CFLAGS} @@ -110,23 +114,26 @@ RUNTESTFLAGS = # native rebuilding issues (we don't want the build tools to see a partially # built cygwin.dll and attempt to use it instead of the old one). -DLL_NAME:=cygwin1.dll -TEST_DLL_NAME:=cygwin0.dll +DLL_NAME:=@DLL_NAME@ +TEST_DLL_NAME:=${patsubst %1.dll,%0.dll,@DLL_NAME@} TEST_LIB_NAME:=libcygwin0.a STATIC_LIB_NAME:=libcygwin_s.a +DIN_FILE=@DIN_FILE@ DEF_FILE:=cygwin.def +TLSOFFSETS_H:=@TLSOFFSETS_H@ DLL_ENTRY:=@DLL_ENTRY@ LIBGMON_A:=libgmon.a CYGWIN_START:=crt0.o GMON_START:=gcrt0.o -toolopts:=--ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY} +toolopts:=--cpu=${target_cpu} --ar=${AR} --as=${AS} --nm=${NM} --objcopy=${OBJCOPY} speclib=\ ${srcdir}/speclib ${toolopts} \ --exclude='cygwin' \ --exclude='(?i:dll)' \ --exclude='reloc' \ + --exclude='^main$$' \ --exclude='^_main$$' \ $^ @@ -143,7 +150,7 @@ EXTRA_DLL_OFILES:=${addsuffix .o,${basename ${notdir ${wildcard $(CONFIG_DIR)/*. EXTRA_OFILES:= -MALLOC_OFILES:=@MALLOC_OFILES@ +MALLOC_OFILES:=malloc.o DLL_IMPORTS:=${shell $(CC) -print-file-name=w32api/libkernel32.a} ${shell $(CC) -print-file-name=w32api/libntdll.a} @@ -193,6 +200,9 @@ endif #PREPROCESS GMON_OFILES:=gmon.o mcount.o profil.o +ifeq ($(target_cpu),x86_64) +NEW_FUNCTIONS:= +else NEW_FUNCTIONS:=$(addprefix --replace=,\ acl=_acl32 \ aclcheck=_aclcheck32 \ @@ -245,6 +255,7 @@ NEW_FUNCTIONS:=$(addprefix --replace=,\ tmpfile=_tmpfile64 \ truncate=_truncate64 \ ) +endif API_VER:=$(srcdir)/include/cygwin/version.h @@ -390,20 +401,20 @@ uninstall-headers: uninstall-man: cd $(srcdir); \ for i in `find . -type f -name '*.2'`; do \ - rm -f $(tooldir)/man/man2/`basename $$i` ; \ + rm -f $(DESTDIR)$(mandir)/man2/`basename $$i` ; \ done; \ for i in `find . -type f -name '*.3'`; do \ - rm -f $(tooldir)/man/man3/`basename $$i` ; \ + rm -f $(DESTDIR)$(mandir)/man3/`basename $$i` ; \ done; \ for i in `find . -type f -name '*.5'`; do \ - rm -f $(tooldir)/man/man5/`basename $$i` ; \ + rm -f $(DESTDIR)$(mandir)/man5/`basename $$i` ; \ done; \ for i in `find . -type f -name '*.7'`; do \ - rm -f $(tooldir)/man/man7/`basename $$i` ; \ + rm -f $(DESTDIR)$(mandir)/man7/`basename $$i` ; \ done clean: - -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h $(srcdir)/tlsoffsets.h $(srcdir)/devices.cc + -rm -f *.o *.dll *.dbg *.a *.exp junk *.base version.cc winver_stamp *.exe *.d *stamp* *_magic.h sigfe.s cygwin.def globals.h $(srcdir)/$(TLSOFFSETS_H) $(srcdir)/devices.cc -@$(MAKE) -C ${cygserver_blddir} libclean maintainer-clean realclean: clean @@ -411,6 +422,9 @@ maintainer-clean realclean: clean @echo "it deletes files that may require special tools to rebuild." -rm -fr configure +# Rule to build LDSCRIPT +$(LDSCRIPT): $(LDSCRIPT).in + $(CC) -E - -P < $^ -o $@ # Rule to build cygwin.dll $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIBM) $(API_VER) Makefile winver_stamp @@ -423,8 +437,8 @@ $(TEST_DLL_NAME): $(LDSCRIPT) dllfixdbg $(DLL_OFILES) $(LIBSERVER) $(LIBC) $(LIB @ln -f $@ new-$(DLL_NAME) # Rule to build libcygwin.a -$(LIB_NAME): $(LIBCOS) | $(TEST_DLL_NAME) - ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $^ +$(LIB_NAME): $(DEF_FILE) $(LIBCOS) | $(TEST_DLL_NAME) + ${srcdir}/mkimport ${toolopts} ${NEW_FUNCTIONS} $@ cygdll.a $(wordlist 2,99,$^) ${STATIC_LIB_NAME}: mkstatic ${TEST_DLL_NAME} perl -d $< -x ${EXCLUDE_STATIC_OFILES} --library=${LIBC} --library=${LIBM} --ar=${AR} $@ cygwin.map @@ -446,7 +460,7 @@ dll_ofiles: $(DLL_OFILES) $(LIBGMON_A): $(GMON_OFILES) $(GMON_START) $(AR) rcv $(LIBGMON_A) $(GMON_OFILES) -$(API_VER): $(srcdir)/cygwin.din +$(API_VER): $(srcdir)/$(DIN_FILE) @echo Error: Version info is older than DLL API! version.cc winver.o: winver_stamp @@ -500,14 +514,14 @@ winver_stamp: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES) $(COMPILE.cc) -c -o version.o version.cc && \ touch $@ -Makefile: cygwin.din ${srcdir}/Makefile.in +Makefile: $(DIN_FILE) ${srcdir}/Makefile.in /bin/sh ./config.status -$(DEF_FILE): gendef cygwin.din $(srcdir)/tlsoffsets.h - $^ $@ sigfe.s +$(DEF_FILE): gendef $(DIN_FILE) $(srcdir)/$(TLSOFFSETS_H) + $^ $(target_cpu) $@ sigfe.s -$(srcdir)/tlsoffsets.h: gentls_offsets cygtls.h - $^ $@ $(COMPILE.cc) -c +$(srcdir)/$(TLSOFFSETS_H): gentls_offsets cygtls.h + $^ $@ @CONFIG_DIR@ $(COMPILE.cc) -c sigfe.s: $(DEF_FILE) @[ -s $@ ] || \ |