I am building my C Program using GCC on AIX. While building it I am referring to some libraries those are complied and build using XLC on AIX. My library location has two forms i.e same library is present in the form of *.so and *.a. But when while building my application it statically links to *.a library instead of *.so And while loading the library dynamically it refers to *.so is there any way to control this so that my static and dynamic linking of library only happens with *.a.
P.S I can't remove the *.so libs from library location.
Commands I am using are as follows:
$(PRODUCT)/lib contains libraries(*.a, *.so) those are build using XLC on AIX
CC=/usr/bin/gcc -maix64
DynamicInboxLibGcc:
$(CC) -o InboxLib.o -I$(PRODUCT)/include -I. -L$(PRODUCT)/lib -fPIC -c InboxLib.c $(LIBS)
$(CC) InboxLib.o -I$(PRODUCT)/include -ar -shared -o $(PRODUCT)/libInboxLibXlc.a -L$(PRODUCT)/lib $(LIBS)
WrapperLibGcc:
$(CC) -o DynamicLinkSample.o -I$(PRODUCT)/include -I. -L$(PRODUCT)/lib -qPIC -c DynamicLinkSample.c $(LIBS)
$(CC) DynamicLinkSample.o -I$(PRODUCT)/include -ar -shared -o $(PRODUCT)/CustomLib.a -L$(PRODUCT)/lib $(LIBS)
DynamicMainProgramGcc:
$(CC) -o DynamicMainProgram -wl -brtl MainProgram.c -Wall -fPIC -I$(PRODUCT)/include -I. -L/usr/lib/threadsi -L$(PRODUCT)/lib $(LIB_PATH)/CustomLib.a $(LIB_PATH)/libInboxLibXlc.a -ldl $(LIBS)