Chameleon

Chameleon Commit Details

Date:2010-12-13 04:27:31 (8 years 9 months ago)
Author:Evan Lojewski
Commit:658
Parents: 657
Message:Makeful update (again). Added a ugly hack so that only c++ modules will link agains the uClibc++ module. Removed the possibility for modules to link agains themselfs. Added laxydylib1.c so that if you try to compile a module with -lazy_library instead of -weak_library, the build will not fail
Changes:
A/branches/meklort/i386/modules/lazydylib1.c
M/branches/meklort/i386/modules/Makefile
M/branches/meklort/i386/modules/ACPIPatcher/Makefile
M/branches/meklort/i386/modules/MakeInc.dir

File differences

branches/meklort/i386/modules/ACPIPatcher/Makefile
3535
3636
3737
38
38
3939
4040
4141
DIRS_NEEDED = $(OBJROOT) $(SYMROOT)
all embedtheme optionrom: $(DIRS_NEEDED) dylib
all embedtheme optionrom: dylib
include ../MakeInc.dir
branches/meklort/i386/modules/MakeInc.dir
1313
1414
1515
16
1617
1718
19
20
1821
19
22
23
24
25
2026
27
28
2129
2230
2331
......
2634
2735
2836
37
38
39
40
2941
3042
3143
44
45
46
3247
33
48
49
50
51
52
3453
3554
3655
......
3857
3958
4059
41
60
61
62
63
4264
4365
4466
4567
46
4768
4869
4970
INSTALLDIR = $(DSTROOT)/System/Library/Frameworks/System.framework/Versions/B/PrivateHeaders/standalone
dylib: ${MODULE_OBJS} dylib_final
HAVE_MODULES := $(wildcard $(SYMROOT)/*.dylib)
##IS_CPP_MODULE = $(shell nm $(OBJROOT)/*.o | grep " __Z")
ifneq ($(strip $(HAVE_MODULES)),)
dylib: ${MODULE_OBJS}
#### Other modules Exist ####
dylib_final:
@rm -rf $(SYMROOT)/$(MODULE_NAME).dylib#ensure module doesn't link with old version of self
@### Ugly hack, remove the c++ module if this module shouldn't link with it. Needed due to LD behavoir
@echo "\t[LD] $(MODULE_NAME).dylib"
@if [ -f "$(SYMROOT)/uClibc++.dylib" ]; then if [ x"$(shell nm $(OBJROOT)/*.o 2>/dev/null | grep " __Z")" == x"" ]; then mv $(SYMROOT)/uClibc++.dylib $(SYMROOT)/../uClibc++.dylib; fi; fi;
@ld -arch i386 \
-undefined dynamic_lookup \
-alias $(MODULE_START) start \
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
-L$(OBJROOT)/ \
-L$(OBJROOT)/../ \
-L$(OBJROOT)/../*/ \
-L$(SYMROOT)/ \
$(OBJROOT)/*.o \
-weak_library $(SYMROOT)/*.dylib \
-o $(SYMROOT)/$(MODULE_NAME).dylib
@if [ -f "$(SYMROOT)/../uClibc++.dylib" ]; then if [ x"$(shell nm $(OBJROOT)/*.o 2>/dev/null | grep " __Z")" == x"" ]; then mv $(SYMROOT)/../uClibc++.dylib $(SYMROOT)/uClibc++.dylib; fi; fi;
else
dylib: ${MODULE_OBJS}
#### This is the first module ####
dylib_final:
@rm -rf $(SYMROOT)/$(MODULE_NAME).dylib#ensure module doesn't link with old version of self
@echo "\t[LD] $(MODULE_NAME).dylib"
@ld -arch i386 \
-undefined dynamic_lookup \
-alias $(MODULE_START) start \
-S -x -Z -dead_strip_dylibs \
-no_uuid \
-current_version $(MODULE_VERSION) -compatibility_version $(MODULE_COMPAT_VERSION) \
-final_output $(MODULE_NAME) \
-L$(OBJROOT)/ \
-L$(OBJROOT)/../ \
-L$(OBJROOT)/../*/ \
-L$(SYMROOT)/ \
$(OBJROOT)/*.o \
-o $(SYMROOT)/$(MODULE_NAME).dylib
endif
%.o: %.c
@echo "\t[CC] $<"
@$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@"
branches/meklort/i386/modules/lazydylib1.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
/*
000003b3 S _dyld_lazy_dylib_proxy
00000071 T _lazy_load_dylib
00000000 T dyld_lazy_dylib_stub_binding_helper
*/
#if 0
int dyld_lazy_dylib_proxy()
{
return 0;
}
void* lazy_load_dylib(void* lazyPointer)
{
}
#endif
branches/meklort/i386/modules/Makefile
2929
3030
3131
32
33
34
32
3533
3634
3735
......
4745
4846
4947
48
49
50
51
52
53
54
55
56
57
58
59
5060
5161
SUBDIRS = klibc uClibc++ Resolution KernelPatcher GUI KextPatcher GraphicsEnabler HPET USBFix Memory Networking NetbookInstaller ACPIPatcher HelloWorld
#SUBDIRS = HelloWorld
all embedtheme optionrom tags debug install installhdrs:
@rm -rf $(OBJROOT)
@mkdir $(OBJROOT)
all embedtheme optionrom tags debug install installhdrs: objroot_dirs lazydylib1.o
@for i in ${SUBDIRS}; \
do \
echo ================= make $@ for $$i =================; \
) || exit $$?; \
done
objroot_dirs:
@rm -rf $(OBJROOT)
@mkdir $(OBJROOT) &> /dev/null
%.o: %.c
@echo "\t[CC] $<"
@$(CC) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@"
%.o: %.cpp
@echo "\t[CPP] $<"
@$(CPP) $(CPPFLAGS) $(CFLAGS) $(DEFINES) -c "$<" $(INC) -o "$(OBJROOT)/$@"
installsrc:
tar cf - . | (cd ${SRCROOT}; tar xfBp -)

Archive Download the corresponding diff file

Revision: 658