[x264-devel] [PATCH 1/7] Add build configurations for OS/2
KO Myung-Hun
komh at chollian.net
Sat Mar 19 15:17:23 CET 2011
---
Makefile | 40 +++++++++++++++++++++++++---------------
configure | 13 +++++++++++++
2 files changed, 38 insertions(+), 15 deletions(-)
mode change 100755 => 100644 configure
diff --git a/Makefile b/Makefile
index a66a9ee..bbca387 100644
--- a/Makefile
+++ b/Makefile
@@ -88,7 +88,7 @@ ASFLAGS += -Icommon/x86/
SRCS += common/x86/mc-c.c common/x86/predict-c.c
OBJASM = $(ASMSRC:%.asm=%.o)
$(OBJASM): common/x86/x86inc.asm common/x86/x86util.asm
-checkasm: tools/checkasm-a.o
+checkasm$(EXE): tools/checkasm-a.o
endif
endif
@@ -144,12 +144,19 @@ libx264.a: .depend $(OBJS) $(OBJASM)
$(RANLIB) libx264.a
$(SONAME): .depend $(OBJS) $(OBJASM) $(OBJSO)
+ifeq ($(SYS),OS2)
+ echo "LIBRARY $(SONAME:.$(SOSUFFIX)=)" > $(SODEF)
+ echo "DATA MULTIPLE NONSHARED" >> $(SODEF)
+ echo "EXPORTS" >> $(SODEF)
+ emxexp $(OBJS) $(OBJASM) >> $(SODEF)
+ emximp -o $(IMPLIBNAME) $(SODEF)
+endif
$(CC) -shared -o $@ $(OBJS) $(OBJASM) $(OBJSO) $(SOFLAGS) $(LDFLAGS)
x264$(EXE): $(OBJCLI) libx264.a
$(CC) -o $@ $+ $(LDFLAGSCLI) $(LDFLAGS)
-checkasm: tools/checkasm.o libx264.a
+checkasm$(EXE): tools/checkasm.o libx264.a
$(CC) -o $@ $+ $(LDFLAGS)
%.o: %.asm
@@ -203,7 +210,7 @@ fprofiled:
endif
clean:
- rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(SONAME) *.a x264 x264.exe .depend TAGS
+ rm -f $(OBJS) $(OBJASM) $(OBJCLI) $(OBJSO) $(SONAME) $(SODEF) *.a x264 x264.exe .depend TAGS
rm -f checkasm checkasm.exe tools/checkasm.o tools/checkasm-a.o
rm -f $(SRC2:%.c=%.gcda) $(SRC2:%.c=%.gcno)
- sed -e 's/ *-fprofile-\(generate\|use\)//g' config.mak > config.mak2 && mv config.mak2 config.mak
@@ -213,28 +220,31 @@ distclean: clean
rm -rf test/
install: x264$(EXE) $(SONAME)
- install -d $(DESTDIR)$(bindir)
- install -d $(DESTDIR)$(includedir)
- install -d $(DESTDIR)$(libdir)
- install -d $(DESTDIR)$(libdir)/pkgconfig
- install -m 644 x264.h $(DESTDIR)$(includedir)
- install -m 644 x264_config.h $(DESTDIR)$(includedir)
- install -m 644 libx264.a $(DESTDIR)$(libdir)
- install -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
- install x264$(EXE) $(DESTDIR)$(bindir)
+ $(INSTALL) -d $(DESTDIR)$(bindir)
+ $(INSTALL) -d $(DESTDIR)$(includedir)
+ $(INSTALL) -d $(DESTDIR)$(libdir)
+ $(INSTALL) -d $(DESTDIR)$(libdir)/pkgconfig
+ $(INSTALL) -m 644 x264.h $(DESTDIR)$(includedir)
+ $(INSTALL) -m 644 x264_config.h $(DESTDIR)$(includedir)
+ $(INSTALL) -m 644 libx264.a $(DESTDIR)$(libdir)
+ $(INSTALL) -m 644 x264.pc $(DESTDIR)$(libdir)/pkgconfig
+ $(INSTALL) x264$(EXE) $(DESTDIR)$(bindir)
$(RANLIB) $(DESTDIR)$(libdir)/libx264.a
ifeq ($(SYS),MINGW)
- $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(bindir))
+ $(if $(SONAME), $(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(bindir))
else
+ifneq ($(SYS),OS2)
$(if $(SONAME), ln -f -s $(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX))
- $(if $(SONAME), install -m 755 $(SONAME) $(DESTDIR)$(libdir))
endif
- $(if $(IMPLIBNAME), install -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir))
+ $(if $(SONAME), $(INSTALL) -m 755 $(SONAME) $(DESTDIR)$(libdir))
+endif
+ $(if $(IMPLIBNAME), $(INSTALL) -m 644 $(IMPLIBNAME) $(DESTDIR)$(libdir))
uninstall:
rm -f $(DESTDIR)$(includedir)/x264.h $(DESTDIR)$(includedir)/x264_config.h $(DESTDIR)$(libdir)/libx264.a
rm -f $(DESTDIR)$(bindir)/x264$(EXE) $(DESTDIR)$(libdir)/pkgconfig/x264.pc
$(if $(SONAME), rm -f $(DESTDIR)$(libdir)/$(SONAME) $(DESTDIR)$(libdir)/libx264.$(SOSUFFIX))
+ $(if $(IMPLIBNAME), rm -f $(DESTDIR)$(libdir)/$(IMPLIBNAME))
etags: TAGS
diff --git a/configure b/configure
old mode 100755
new mode 100644
index 96544ce..0aedeb5
--- a/configure
+++ b/configure
@@ -345,6 +345,13 @@ case $host_os in
LDFLAGS="$LDFLAGS -lm"
HAVE_GETOPT_LONG=0
;;
+ os2*)
+ SYS="OS2"
+ EXE=".exe"
+ DEVNULL="NUL"
+ define HAVE_MALLOC_H
+ LDFLAGS="$LDFLAGS -Zbin-files"
+ ;;
*)
die "Unknown system $host, edit the configure"
;;
@@ -816,6 +823,12 @@ if [ "$shared" = "yes" ]; then
echo "SOSUFFIX=so" >> config.mak
echo "SONAME=libx264.so.$API" >> config.mak
echo 'SOFLAGS=-Wl,-h,$(SONAME)' >> config.mak
+ elif [ "$SYS" = "OS2" ]; then
+ echo "SOSUFFIX=dll" >> config.mak
+ echo "SONAME=libx264.dll" >> config.mak
+ echo "SODEF=libx264.def" >> config.mak
+ echo "IMPLIBNAME=libx264_dll.a" >> config.mak
+ echo 'SOFLAGS=-Zdll $(SODEF)' >> config.mak
else
echo "SOSUFFIX=so" >> config.mak
echo "SONAME=libx264.so.$API" >> config.mak
--
1.7.3.2
More information about the x264-devel
mailing list