Skip to content

Commit

Permalink
mk: Get rid of redundant LIBUV_FLAGS.
Browse files Browse the repository at this point in the history
  • Loading branch information
luqmana committed Nov 23, 2013
1 parent 6820ed4 commit a2c111a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 38 deletions.
5 changes: 3 additions & 2 deletions mk/platform.mk
Expand Up @@ -231,7 +231,7 @@ CFG_LIB_NAME_x86_64-apple-darwin=lib$(1).dylib
CFG_STATIC_LIB_NAME_x86_64-apple-darwin=lib$(1).a
CFG_LIB_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib
CFG_LIB_DSYM_GLOB_x86_64-apple-darwin=lib$(1)-*.dylib.dSYM
CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -Werror -g -fPIC -m64 -arch x86_64
CFG_GCCISH_CFLAGS_x86_64-apple-darwin := -Wall -g -fPIC -m64 -arch x86_64
CFG_GCCISH_CXXFLAGS_x86_64-apple-darwin := -fno-rtti
CFG_GCCISH_LINK_FLAGS_x86_64-apple-darwin := -dynamiclib -pthread -framework CoreServices -m64
CFG_GCCISH_DEF_FLAG_x86_64-apple-darwin := -Wl,-exported_symbols_list,
Expand Down Expand Up @@ -300,6 +300,7 @@ CFG_LDPATH_arm-linux-androideabi :=
CFG_RUN_arm-linux-androideabi=
CFG_RUN_TARG_arm-linux-androideabi=
RUSTC_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)
RUSTC_CROSS_FLAGS_arm-linux-androideabi :=--android-cross-path=$(CFG_ANDROID_CROSS_PATH)

# arm-unknown-linux-gnueabihf configuration
CROSS_PREFIX_arm-unknown-linux-gnueabihf=arm-linux-gnueabihf-
Expand Down Expand Up @@ -395,7 +396,7 @@ CFG_LIB_NAME_i686-pc-mingw32=$(1).dll
CFG_STATIC_LIB_NAME_i686-pc-mingw32=$(1).lib
CFG_LIB_GLOB_i686-pc-mingw32=$(1)-*.dll
CFG_LIB_DSYM_GLOB_i686-pc-mingw32=$(1)-*.dylib.dSYM
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -Werror -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include
CFG_GCCISH_CFLAGS_i686-pc-mingw32 := -Wall -g -m32 -march=i686 -D_WIN32_WINNT=0x0600 -I$(CFG_SRC_DIR)src/etc/mingw-fix-include
CFG_GCCISH_CXXFLAGS_i686-pc-mingw32 := -fno-rtti
CFG_GCCISH_LINK_FLAGS_i686-pc-mingw32 := -shared -fPIC -g -m32
CFG_GCCISH_DEF_FLAG_i686-pc-mingw32 :=
Expand Down
39 changes: 3 additions & 36 deletions mk/rt.mk
Expand Up @@ -23,39 +23,6 @@
# fit the experimental data (i.e., I was able to get the system
# working under these assumptions).

# Hack for passing flags into LIBUV, see below.
define DEF_LIBUV_FLAGS
ifeq ($(HOST_$(1)), i386)
ifneq (,$(findstring mingw32,$(OSTYPE_$(1))))
# Don't add -fPIC since it's ignored for this target
# and it will just cause the build to fail due to -Werror
LIBUV_FLAGS_$(1) = -m32 -I$(S)src/etc/mingw-fix-include
else
LIBUV_FLAGS_$(1) = -m32 -fPIC -I$(S)src/etc/mingw-fix-include
endif
else ifeq ($(HOST_$(1)), x86_64)
ifneq (,$(findstring mingw32,$(OSTYPE_$(1))))
# Don't add -fPIC since it's ignored for this target
# and it will just cause the build to fail due to -Werror
LIBUV_FLAGS_$(1) = -m64
else
LIBUV_FLAGS_$(1) = -m64 -fPIC
endif
else ifeq ($(HOST_$(1)), arm)
ifeq ($(OSTYPE_$(1)), apple-darwin)
IOS_SDK := $(shell xcrun --show-sdk-path -sdk iphoneos 2>/dev/null)
LIBUV_FLAGS_$(1) = -fPIC -std=gnu99 -I$(IOS_SDK)/usr/include -I$(IOS_SDK)/usr/include/c++/4.2.1
else
LIBUV_FLAGS_$(1) = -fPIC -std=gnu99
endif
else ifeq ($(HOST_$(1)), mips)
LIBUV_FLAGS_$(1) = -fPIC -mips32r2 -msoft-float -mabi=32
else
LIBUV_FLAGS_$(1) = -fPIC -std=gnu99
endif
endef
$(foreach t,$(CFG_TARGET),$(eval $(call DEF_LIBUV_FLAGS,$(t))))

# when we're doing a snapshot build, we intentionally degrade as many
# features in libuv and the runtime as possible, to ease portability.

Expand Down Expand Up @@ -238,15 +205,15 @@ $$(LIBUV_MAKEFILE_$(1)): $$(LIBUV_DEPS)
ifdef CFG_WINDOWSY_$(1)
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS)
$$(Q)$$(MAKE) -C $$(S)src/libuv -f Makefile.mingw \
CC="$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) $$(LIBUV_FLAGS_$(1)) $$(SNAP_DEFINES)" \
CC="$$(CC_$(1)) $$(CFG_GCCISH_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
AR="$$(AR_$(1))" \
V=$$(VERBOSE)
$$(Q)cp $$(S)src/libuv/libuv.a $$@
else
$$(LIBUV_LIB_$(1)): $$(LIBUV_DEPS) $$(LIBUV_MAKEFILE_$(1))
$$(Q)$$(MAKE) -C $$(@D) \
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1)) $$(LIBUV_FLAGS_$(1)) $$(SNAP_DEFINES)" \
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1)) $$(LIBUV_FLAGS_$(1))" \
CFLAGS="$$(CFG_GCCISH_CFLAGS_$(1)) $$(SNAP_DEFINES)" \
LDFLAGS="$$(CFG_GCCISH_LINK_FLAGS_$(1))" \
CC="$$(CC_$(1))" \
CXX="$$(CXX_$(1))" \
AR="$$(AR_$(1))" \
Expand Down

4 comments on commit a2c111a

@bors
Copy link
Contributor

@bors bors commented on a2c111a Nov 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from alexcrichton
at luqmana@a2c111a

@bors
Copy link
Contributor

@bors bors commented on a2c111a Nov 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging luqmana/rust/mingw64 = a2c111a into auto

@bors
Copy link
Contributor

@bors bors commented on a2c111a Nov 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

luqmana/rust/mingw64 = a2c111a merged ok, testing candidate = 0499a92b

@bors
Copy link
Contributor

@bors bors commented on a2c111a Nov 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.